@opencx/widget 3.0.14 → 3.0.16

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.
@@ -37,7 +37,7 @@ var vie=Object.defineProperty;var rO=lt=>{throw TypeError(lt)};var wie=(lt,Qe,St
37
37
  `+i[o].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=o&&0<=s);break}}}finally{kh=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?tu(e):""}function OO(e){switch(e.tag){case 5:return tu(e.type);case 16:return tu("Lazy");case 13:return tu("Suspense");case 19:return tu("SuspenseList");case 0:case 2:case 15:return e=Rh(e.type,!1),e;case 11:return e=Rh(e.type.render,!1),e;case 1:return e=Rh(e.type,!0),e;default:return""}}function Nh(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 Co:return"Fragment";case So:return"Portal";case Eh:return"Profiler";case xh:return"StrictMode";case _h:return"Suspense";case Sh:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case gw:return(e.displayName||"Context")+".Consumer";case mw:return(e._context.displayName||"Context")+".Provider";case Th: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:Nh(e.type)||"Memo";case Ni:t=e._payload,e=e._init;try{return Nh(e(t))}catch{}}return null}function DO(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 Nh(t);case 8:return t===xh?"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 Pi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ww(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function LO(e){var t=ww(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,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,a.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 Cc(e){e._valueTracker||(e._valueTracker=LO(e))}function bw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ww(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ac(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 Ph(e,t){var n=t.checked;return ct({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function xw(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Pi(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 Ew(e,t){t=t.checked,t!=null&&bh(e,"checked",t,!1)}function Ih(e,t){Ew(e,t);var n=Pi(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")?Oh(e,t.type,n):t.hasOwnProperty("defaultValue")&&Oh(e,t.type,Pi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Tw(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 Oh(e,t,n){(t!=="number"||Ac(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var nu=Array.isArray;function Ao(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=""+Pi(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 Dh(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Q(91));return ct({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function _w(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(Q(92));if(nu(n)){if(1<n.length)throw Error(Q(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Pi(n)}}function Sw(e,t){var n=Pi(t.value),r=Pi(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 Cw(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Aw(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 Lh(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Aw(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var kc,kw=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(kc=kc||document.createElement("div"),kc.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=kc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ru(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var iu={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},MO=["Webkit","ms","Moz","O"];Object.keys(iu).forEach(function(e){MO.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),iu[t]=iu[e]})});function Rw(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||iu.hasOwnProperty(e)&&iu[e]?(""+t).trim():t+"px"}function Nw(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Rw(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var FO=ct({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 Mh(e,t){if(t){if(FO[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Q(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Q(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Q(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Q(62))}}function Fh(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 Bh=null;function jh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Uh=null,ko=null,Ro=null;function Pw(e){if(e=Cu(e)){if(typeof Uh!="function")throw Error(Q(280));var t=e.stateNode;t&&(t=Qc(t),Uh(e.stateNode,e.type,t))}}function Iw(e){ko?Ro?Ro.push(e):Ro=[e]:ko=e}function Ow(){if(ko){var e=ko,t=Ro;if(Ro=ko=null,Pw(e),t)for(e=0;e<t.length;e++)Pw(t[e])}}function Dw(e,t){return e(t)}function Lw(){}var Hh=!1;function Mw(e,t,n){if(Hh)return e(t,n);Hh=!0;try{return Dw(e,t,n)}finally{Hh=!1,(ko!==null||Ro!==null)&&(Lw(),Ow())}}function au(e,t){var n=e.stateNode;if(n===null)return null;var r=Qc(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(Q(231,t,typeof n));return n}var zh=!1;if(ei)try{var ou={};Object.defineProperty(ou,"passive",{get:function(){zh=!0}}),window.addEventListener("test",ou,ou),window.removeEventListener("test",ou,ou)}catch{zh=!1}function BO(e,t,n,r,i,a,o,s,u){var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(c){this.onError(c)}}var su=!1,Rc=null,Nc=!1,Vh=null,jO={onError:function(e){su=!0,Rc=e}};function UO(e,t,n,r,i,a,o,s,u){su=!1,Rc=null,BO.apply(jO,arguments)}function HO(e,t,n,r,i,a,o,s,u){if(UO.apply(this,arguments),su){if(su){var l=Rc;su=!1,Rc=null}else throw Error(Q(198));Nc||(Nc=!0,Vh=l)}}function La(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 Fw(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 Bw(e){if(La(e)!==e)throw Error(Q(188))}function zO(e){var t=e.alternate;if(!t){if(t=La(e),t===null)throw Error(Q(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return Bw(i),e;if(a===r)return Bw(i),t;a=a.sibling}throw Error(Q(188))}if(n.return!==r.return)n=i,r=a;else{for(var o=!1,s=i.child;s;){if(s===n){o=!0,n=i,r=a;break}if(s===r){o=!0,r=i,n=a;break}s=s.sibling}if(!o){for(s=a.child;s;){if(s===n){o=!0,n=a,r=i;break}if(s===r){o=!0,r=a,n=i;break}s=s.sibling}if(!o)throw Error(Q(189))}}if(n.alternate!==r)throw Error(Q(190))}if(n.tag!==3)throw Error(Q(188));return n.stateNode.current===n?e:t}function jw(e){return e=zO(e),e!==null?Uw(e):null}function Uw(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Uw(e);if(t!==null)return t;e=e.sibling}return null}var Hw=Dn.unstable_scheduleCallback,zw=Dn.unstable_cancelCallback,VO=Dn.unstable_shouldYield,$O=Dn.unstable_requestPaint,xt=Dn.unstable_now,WO=Dn.unstable_getCurrentPriorityLevel,$h=Dn.unstable_ImmediatePriority,Vw=Dn.unstable_UserBlockingPriority,Pc=Dn.unstable_NormalPriority,YO=Dn.unstable_LowPriority,$w=Dn.unstable_IdlePriority,Ic=null,Or=null;function qO(e){if(Or&&typeof Or.onCommitFiberRoot=="function")try{Or.onCommitFiberRoot(Ic,e,void 0,(e.current.flags&128)===128)}catch{}}var hr=Math.clz32?Math.clz32:XO,GO=Math.log,KO=Math.LN2;function XO(e){return e>>>=0,e===0?32:31-(GO(e)/KO|0)|0}var Oc=64,Dc=4194304;function uu(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 Lc(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s!==0?r=uu(s):(a&=o,a!==0&&(r=uu(a)))}else o=n&~i,o!==0?r=uu(o):a!==0&&(r=uu(a));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,a=t&-t,i>=a||i===16&&(a&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-hr(t),i=1<<n,r|=e[n],t&=~i;return r}function QO(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 ZO(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-hr(a),s=1<<o,u=i[o];u===-1?(!(s&n)||s&r)&&(i[o]=QO(s,t)):u<=t&&(e.expiredLanes|=s),a&=~s}}function Wh(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Ww(){var e=Oc;return Oc<<=1,!(Oc&4194240)&&(Oc=64),e}function Yh(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function lu(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-hr(t),e[t]=n}function JO(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-hr(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function qh(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-hr(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var qe=0;function Yw(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var qw,Gh,Gw,Kw,Xw,Kh=!1,Mc=[],Ii=null,Oi=null,Di=null,cu=new Map,du=new Map,Li=[],eD="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 Qw(e,t){switch(e){case"focusin":case"focusout":Ii=null;break;case"dragenter":case"dragleave":Oi=null;break;case"mouseover":case"mouseout":Di=null;break;case"pointerover":case"pointerout":cu.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":du.delete(t.pointerId)}}function fu(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Cu(t),t!==null&&Gh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function tD(e,t,n,r,i){switch(t){case"focusin":return Ii=fu(Ii,e,t,n,r,i),!0;case"dragenter":return Oi=fu(Oi,e,t,n,r,i),!0;case"mouseover":return Di=fu(Di,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return cu.set(a,fu(cu.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,du.set(a,fu(du.get(a)||null,e,t,n,r,i)),!0}return!1}function Zw(e){var t=Ma(e.target);if(t!==null){var n=La(t);if(n!==null){if(t=n.tag,t===13){if(t=Fw(n),t!==null){e.blockedOn=t,Xw(e.priority,function(){Gw(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 Fc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Qh(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Bh=r,n.target.dispatchEvent(r),Bh=null}else return t=Cu(n),t!==null&&Gh(t),e.blockedOn=n,!1;t.shift()}return!0}function Jw(e,t,n){Fc(e)&&n.delete(t)}function nD(){Kh=!1,Ii!==null&&Fc(Ii)&&(Ii=null),Oi!==null&&Fc(Oi)&&(Oi=null),Di!==null&&Fc(Di)&&(Di=null),cu.forEach(Jw),du.forEach(Jw)}function pu(e,t){e.blockedOn===t&&(e.blockedOn=null,Kh||(Kh=!0,Dn.unstable_scheduleCallback(Dn.unstable_NormalPriority,nD)))}function hu(e){function t(i){return pu(i,e)}if(0<Mc.length){pu(Mc[0],e);for(var n=1;n<Mc.length;n++){var r=Mc[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Ii!==null&&pu(Ii,e),Oi!==null&&pu(Oi,e),Di!==null&&pu(Di,e),cu.forEach(t),du.forEach(t),n=0;n<Li.length;n++)r=Li[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Li.length&&(n=Li[0],n.blockedOn===null);)Zw(n),n.blockedOn===null&&Li.shift()}var No=ti.ReactCurrentBatchConfig,Bc=!0;function rD(e,t,n,r){var i=qe,a=No.transition;No.transition=null;try{qe=1,Xh(e,t,n,r)}finally{qe=i,No.transition=a}}function iD(e,t,n,r){var i=qe,a=No.transition;No.transition=null;try{qe=4,Xh(e,t,n,r)}finally{qe=i,No.transition=a}}function Xh(e,t,n,r){if(Bc){var i=Qh(e,t,n,r);if(i===null)hm(e,t,r,jc,n),Qw(e,r);else if(tD(i,e,t,n,r))r.stopPropagation();else if(Qw(e,r),t&4&&-1<eD.indexOf(e)){for(;i!==null;){var a=Cu(i);if(a!==null&&qw(a),a=Qh(e,t,n,r),a===null&&hm(e,t,r,jc,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else hm(e,t,r,null,n)}}var jc=null;function Qh(e,t,n,r){if(jc=null,e=jh(r),e=Ma(e),e!==null)if(t=La(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Fw(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 jc=e,null}function eb(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(WO()){case $h:return 1;case Vw:return 4;case Pc:case YO:return 16;case $w:return 536870912;default:return 16}default:return 16}}var Mi=null,Zh=null,Uc=null;function tb(){if(Uc)return Uc;var e,t=Zh,n=t.length,r,i="value"in Mi?Mi.value:Mi.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Uc=i.slice(e,1<r?1-r:void 0)}function Hc(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 zc(){return!0}function nb(){return!1}function Ln(e){function t(n,r,i,a,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(n=e[s],this[s]=n?n(a):a[s]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?zc:nb,this.isPropagationStopped=nb,this}return ct(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=zc)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=zc)},persist:function(){},isPersistent:zc}),t}var Po={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Jh=Ln(Po),mu=ct({},Po,{view:0,detail:0}),aD=Ln(mu),em,tm,gu,Vc=ct({},mu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rm,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!==gu&&(gu&&e.type==="mousemove"?(em=e.screenX-gu.screenX,tm=e.screenY-gu.screenY):tm=em=0,gu=e),em)},movementY:function(e){return"movementY"in e?e.movementY:tm}}),rb=Ln(Vc),oD=ct({},Vc,{dataTransfer:0}),sD=Ln(oD),uD=ct({},mu,{relatedTarget:0}),nm=Ln(uD),lD=ct({},Po,{animationName:0,elapsedTime:0,pseudoElement:0}),cD=Ln(lD),dD=ct({},Po,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),fD=Ln(dD),pD=ct({},Po,{data:0}),ib=Ln(pD),hD={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},mD={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"},gD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function yD(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=gD[e])?!!t[e]:!1}function rm(){return yD}var vD=ct({},mu,{key:function(e){if(e.key){var t=hD[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Hc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?mD[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rm,charCode:function(e){return e.type==="keypress"?Hc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Hc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),wD=Ln(vD),bD=ct({},Vc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ab=Ln(bD),xD=ct({},mu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rm}),ED=Ln(xD),TD=ct({},Po,{propertyName:0,elapsedTime:0,pseudoElement:0}),_D=Ln(TD),SD=ct({},Vc,{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}),CD=Ln(SD),AD=[9,13,27,32],im=ei&&"CompositionEvent"in window,yu=null;ei&&"documentMode"in document&&(yu=document.documentMode);var kD=ei&&"TextEvent"in window&&!yu,ob=ei&&(!im||yu&&8<yu&&11>=yu),sb=" ",ub=!1;function lb(e,t){switch(e){case"keyup":return AD.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cb(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Io=!1;function RD(e,t){switch(e){case"compositionend":return cb(t);case"keypress":return t.which!==32?null:(ub=!0,sb);case"textInput":return e=t.data,e===sb&&ub?null:e;default:return null}}function ND(e,t){if(Io)return e==="compositionend"||!im&&lb(e,t)?(e=tb(),Uc=Zh=Mi=null,Io=!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 ob&&t.locale!=="ko"?null:t.data;default:return null}}var PD={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 db(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!PD[e.type]:t==="textarea"}function fb(e,t,n,r){Iw(r),t=Gc(t,"onChange"),0<t.length&&(n=new Jh("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var vu=null,wu=null;function ID(e){Nb(e,0)}function $c(e){var t=Fo(e);if(bw(t))return e}function OD(e,t){if(e==="change")return t}var pb=!1;if(ei){var am;if(ei){var om="oninput"in document;if(!om){var hb=document.createElement("div");hb.setAttribute("oninput","return;"),om=typeof hb.oninput=="function"}am=om}else am=!1;pb=am&&(!document.documentMode||9<document.documentMode)}function mb(){vu&&(vu.detachEvent("onpropertychange",gb),wu=vu=null)}function gb(e){if(e.propertyName==="value"&&$c(wu)){var t=[];fb(t,wu,e,jh(e)),Mw(ID,t)}}function DD(e,t,n){e==="focusin"?(mb(),vu=t,wu=n,vu.attachEvent("onpropertychange",gb)):e==="focusout"&&mb()}function LD(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return $c(wu)}function MD(e,t){if(e==="click")return $c(t)}function FD(e,t){if(e==="input"||e==="change")return $c(t)}function BD(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var mr=typeof Object.is=="function"?Object.is:BD;function bu(e,t){if(mr(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(!yh.call(t,i)||!mr(e[i],t[i]))return!1}return!0}function yb(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function vb(e,t){var n=yb(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=yb(n)}}function wb(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?wb(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function bb(){for(var e=window,t=Ac();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ac(e.document)}return t}function sm(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 jD(e){var t=bb(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&wb(n.ownerDocument.documentElement,n)){if(r!==null&&sm(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,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=vb(n,a);var o=vb(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(),a>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 UD=ei&&"documentMode"in document&&11>=document.documentMode,Oo=null,um=null,xu=null,lm=!1;function xb(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;lm||Oo==null||Oo!==Ac(r)||(r=Oo,"selectionStart"in r&&sm(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}),xu&&bu(xu,r)||(xu=r,r=Gc(um,"onSelect"),0<r.length&&(t=new Jh("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Oo)))}function Wc(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Do={animationend:Wc("Animation","AnimationEnd"),animationiteration:Wc("Animation","AnimationIteration"),animationstart:Wc("Animation","AnimationStart"),transitionend:Wc("Transition","TransitionEnd")},cm={},Eb={};ei&&(Eb=document.createElement("div").style,"AnimationEvent"in window||(delete Do.animationend.animation,delete Do.animationiteration.animation,delete Do.animationstart.animation),"TransitionEvent"in window||delete Do.transitionend.transition);function Yc(e){if(cm[e])return cm[e];if(!Do[e])return e;var t=Do[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Eb)return cm[e]=t[n];return e}var Tb=Yc("animationend"),_b=Yc("animationiteration"),Sb=Yc("animationstart"),Cb=Yc("transitionend"),Ab=new Map,kb="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 Fi(e,t){Ab.set(e,t),Da(t,[e])}for(var dm=0;dm<kb.length;dm++){var fm=kb[dm],HD=fm.toLowerCase(),zD=fm[0].toUpperCase()+fm.slice(1);Fi(HD,"on"+zD)}Fi(Tb,"onAnimationEnd"),Fi(_b,"onAnimationIteration"),Fi(Sb,"onAnimationStart"),Fi("dblclick","onDoubleClick"),Fi("focusin","onFocus"),Fi("focusout","onBlur"),Fi(Cb,"onTransitionEnd"),_o("onMouseEnter",["mouseout","mouseover"]),_o("onMouseLeave",["mouseout","mouseover"]),_o("onPointerEnter",["pointerout","pointerover"]),_o("onPointerLeave",["pointerout","pointerover"]),Da("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Da("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Da("onBeforeInput",["compositionend","keypress","textInput","paste"]),Da("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Da("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Da("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Eu="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(" "),VD=new Set("cancel close invalid load scroll toggle".split(" ").concat(Eu));function Rb(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,HO(r,t,void 0,e),e.currentTarget=null}function Nb(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 a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],u=s.instance,l=s.currentTarget;if(s=s.listener,u!==a&&i.isPropagationStopped())break e;Rb(i,s,l),a=u}else for(o=0;o<r.length;o++){if(s=r[o],u=s.instance,l=s.currentTarget,s=s.listener,u!==a&&i.isPropagationStopped())break e;Rb(i,s,l),a=u}}}if(Nc)throw e=Vh,Nc=!1,Vh=null,e}function nt(e,t){var n=t[bm];n===void 0&&(n=t[bm]=new Set);var r=e+"__bubble";n.has(r)||(Pb(t,e,2,!1),n.add(r))}function pm(e,t,n){var r=0;t&&(r|=4),Pb(n,e,r,t)}var qc="_reactListening"+Math.random().toString(36).slice(2);function Tu(e){if(!e[qc]){e[qc]=!0,fw.forEach(function(n){n!=="selectionchange"&&(VD.has(n)||pm(n,!1,e),pm(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[qc]||(t[qc]=!0,pm("selectionchange",!1,t))}}function Pb(e,t,n,r){switch(eb(t)){case 1:var i=rD;break;case 4:i=iD;break;default:i=Xh}n=i.bind(null,t,n,e),i=void 0,!zh||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 hm(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var u=o.tag;if((u===3||u===4)&&(u=o.stateNode.containerInfo,u===i||u.nodeType===8&&u.parentNode===i))return;o=o.return}for(;s!==null;){if(o=Ma(s),o===null)return;if(u=o.tag,u===5||u===6){r=a=o;continue e}s=s.parentNode}}r=r.return}Mw(function(){var l=a,c=jh(n),d=[];e:{var f=Ab.get(e);if(f!==void 0){var p=Jh,m=e;switch(e){case"keypress":if(Hc(n)===0)break e;case"keydown":case"keyup":p=wD;break;case"focusin":m="focus",p=nm;break;case"focusout":m="blur",p=nm;break;case"beforeblur":case"afterblur":p=nm;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=rb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=sD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=ED;break;case Tb:case _b:case Sb:p=cD;break;case Cb:p=_D;break;case"scroll":p=aD;break;case"wheel":p=CD;break;case"copy":case"cut":case"paste":p=fD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=ab}var g=(t&4)!==0,x=!g&&e==="scroll",y=g?f!==null?f+"Capture":null:f;g=[];for(var w=l,b;w!==null;){b=w;var T=b.stateNode;if(b.tag===5&&T!==null&&(b=T,y!==null&&(T=au(w,y),T!=null&&g.push(_u(w,T,b)))),x)break;w=w.return}0<g.length&&(f=new p(f,m,null,n,c),d.push({event:f,listeners:g}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&n!==Bh&&(m=n.relatedTarget||n.fromElement)&&(Ma(m)||m[ni]))break e;if((p||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,p?(m=n.relatedTarget||n.toElement,p=l,m=m?Ma(m):null,m!==null&&(x=La(m),m!==x||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=l),p!==m)){if(g=rb,T="onMouseLeave",y="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(g=ab,T="onPointerLeave",y="onPointerEnter",w="pointer"),x=p==null?f:Fo(p),b=m==null?f:Fo(m),f=new g(T,w+"leave",p,n,c),f.target=x,f.relatedTarget=b,T=null,Ma(c)===l&&(g=new g(y,w+"enter",m,n,c),g.target=b,g.relatedTarget=x,T=g),x=T,p&&m)t:{for(g=p,y=m,w=0,b=g;b;b=Lo(b))w++;for(b=0,T=y;T;T=Lo(T))b++;for(;0<w-b;)g=Lo(g),w--;for(;0<b-w;)y=Lo(y),b--;for(;w--;){if(g===y||y!==null&&g===y.alternate)break t;g=Lo(g),y=Lo(y)}g=null}else g=null;p!==null&&Ib(d,f,p,g,!1),m!==null&&x!==null&&Ib(d,x,m,g,!0)}}e:{if(f=l?Fo(l):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var S=OD;else if(db(f))if(pb)S=FD;else{S=LD;var _=DD}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(S=MD);if(S&&(S=S(e,l))){fb(d,S,n,c);break e}_&&_(e,f,l),e==="focusout"&&(_=f._wrapperState)&&_.controlled&&f.type==="number"&&Oh(f,"number",f.value)}switch(_=l?Fo(l):window,e){case"focusin":(db(_)||_.contentEditable==="true")&&(Oo=_,um=l,xu=null);break;case"focusout":xu=um=Oo=null;break;case"mousedown":lm=!0;break;case"contextmenu":case"mouseup":case"dragend":lm=!1,xb(d,n,c);break;case"selectionchange":if(UD)break;case"keydown":case"keyup":xb(d,n,c)}var N;if(im)e:{switch(e){case"compositionstart":var D="onCompositionStart";break e;case"compositionend":D="onCompositionEnd";break e;case"compositionupdate":D="onCompositionUpdate";break e}D=void 0}else Io?lb(e,n)&&(D="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(D="onCompositionStart");D&&(ob&&n.locale!=="ko"&&(Io||D!=="onCompositionStart"?D==="onCompositionEnd"&&Io&&(N=tb()):(Mi=c,Zh="value"in Mi?Mi.value:Mi.textContent,Io=!0)),_=Gc(l,D),0<_.length&&(D=new ib(D,e,null,n,c),d.push({event:D,listeners:_}),N?D.data=N:(N=cb(n),N!==null&&(D.data=N)))),(N=kD?RD(e,n):ND(e,n))&&(l=Gc(l,"onBeforeInput"),0<l.length&&(c=new ib("onBeforeInput","beforeinput",null,n,c),d.push({event:c,listeners:l}),c.data=N))}Nb(d,t)})}function _u(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Gc(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=au(e,n),a!=null&&r.unshift(_u(e,a,i)),a=au(e,t),a!=null&&r.push(_u(e,a,i))),e=e.return}return r}function Lo(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Ib(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,u=s.alternate,l=s.stateNode;if(u!==null&&u===r)break;s.tag===5&&l!==null&&(s=l,i?(u=au(n,a),u!=null&&o.unshift(_u(n,u,s))):i||(u=au(n,a),u!=null&&o.push(_u(n,u,s)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var $D=/\r\n?/g,WD=/\u0000|\uFFFD/g;function Ob(e){return(typeof e=="string"?e:""+e).replace($D,`
38
38
  `).replace(WD,"")}function Kc(e,t,n){if(t=Ob(t),Ob(e)!==t&&n)throw Error(Q(425))}function Xc(){}var mm=null,gm=null;function ym(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 vm=typeof setTimeout=="function"?setTimeout:void 0,YD=typeof clearTimeout=="function"?clearTimeout:void 0,Db=typeof Promise=="function"?Promise:void 0,qD=typeof queueMicrotask=="function"?queueMicrotask:typeof Db<"u"?function(e){return Db.resolve(null).then(e).catch(GD)}:vm;function GD(e){setTimeout(function(){throw e})}function wm(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),hu(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);hu(t)}function Bi(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 Lb(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 Mo=Math.random().toString(36).slice(2),Dr="__reactFiber$"+Mo,Su="__reactProps$"+Mo,ni="__reactContainer$"+Mo,bm="__reactEvents$"+Mo,KD="__reactListeners$"+Mo,XD="__reactHandles$"+Mo;function Ma(e){var t=e[Dr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ni]||n[Dr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Lb(e);e!==null;){if(n=e[Dr])return n;e=Lb(e)}return t}e=n,n=e.parentNode}return null}function Cu(e){return e=e[Dr]||e[ni],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Fo(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Q(33))}function Qc(e){return e[Su]||null}var xm=[],Bo=-1;function ji(e){return{current:e}}function rt(e){0>Bo||(e.current=xm[Bo],xm[Bo]=null,Bo--)}function et(e,t){Bo++,xm[Bo]=e.current,e.current=t}var Ui={},qt=ji(Ui),vn=ji(!1),Fa=Ui;function jo(e,t){var n=e.type.contextTypes;if(!n)return Ui;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function wn(e){return e=e.childContextTypes,e!=null}function Zc(){rt(vn),rt(qt)}function Mb(e,t,n){if(qt.current!==Ui)throw Error(Q(168));et(qt,t),et(vn,n)}function Fb(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(Q(108,DO(e)||"Unknown",i));return ct({},n,r)}function Jc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ui,Fa=qt.current,et(qt,e),et(vn,vn.current),!0}function Bb(e,t,n){var r=e.stateNode;if(!r)throw Error(Q(169));n?(e=Fb(e,t,Fa),r.__reactInternalMemoizedMergedChildContext=e,rt(vn),rt(qt),et(qt,e)):rt(vn),et(vn,n)}var ri=null,ed=!1,Em=!1;function jb(e){ri===null?ri=[e]:ri.push(e)}function QD(e){ed=!0,jb(e)}function Hi(){if(!Em&&ri!==null){Em=!0;var e=0,t=qe;try{var n=ri;for(qe=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ri=null,ed=!1}catch(i){throw ri!==null&&(ri=ri.slice(e+1)),Hw($h,Hi),i}finally{qe=t,Em=!1}}return null}var Uo=[],Ho=0,td=null,nd=0,Qn=[],Zn=0,Ba=null,ii=1,ai="";function ja(e,t){Uo[Ho++]=nd,Uo[Ho++]=td,td=e,nd=t}function Ub(e,t,n){Qn[Zn++]=ii,Qn[Zn++]=ai,Qn[Zn++]=Ba,Ba=e;var r=ii;e=ai;var i=32-hr(r)-1;r&=~(1<<i),n+=1;var a=32-hr(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ii=1<<32-hr(t)+i|n<<i|r,ai=a+e}else ii=1<<a|n<<i|r,ai=e}function Tm(e){e.return!==null&&(ja(e,1),Ub(e,1,0))}function _m(e){for(;e===td;)td=Uo[--Ho],Uo[Ho]=null,nd=Uo[--Ho],Uo[Ho]=null;for(;e===Ba;)Ba=Qn[--Zn],Qn[Zn]=null,ai=Qn[--Zn],Qn[Zn]=null,ii=Qn[--Zn],Qn[Zn]=null}var Mn=null,Fn=null,ot=!1,gr=null;function Hb(e,t){var n=nr(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 zb(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,Mn=e,Fn=Bi(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Mn=e,Fn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Ba!==null?{id:ii,overflow:ai}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=nr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Mn=e,Fn=null,!0):!1;default:return!1}}function Sm(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Cm(e){if(ot){var t=Fn;if(t){var n=t;if(!zb(e,t)){if(Sm(e))throw Error(Q(418));t=Bi(n.nextSibling);var r=Mn;t&&zb(e,t)?Hb(r,n):(e.flags=e.flags&-4097|2,ot=!1,Mn=e)}}else{if(Sm(e))throw Error(Q(418));e.flags=e.flags&-4097|2,ot=!1,Mn=e}}}function Vb(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Mn=e}function rd(e){if(e!==Mn)return!1;if(!ot)return Vb(e),ot=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ym(e.type,e.memoizedProps)),t&&(t=Fn)){if(Sm(e))throw $b(),Error(Q(418));for(;t;)Hb(e,t),t=Bi(t.nextSibling)}if(Vb(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Q(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Fn=Bi(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Fn=null}}else Fn=Mn?Bi(e.stateNode.nextSibling):null;return!0}function $b(){for(var e=Fn;e;)e=Bi(e.nextSibling)}function zo(){Fn=Mn=null,ot=!1}function Am(e){gr===null?gr=[e]:gr.push(e)}var ZD=ti.ReactCurrentBatchConfig;function Au(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(Q(309));var r=n.stateNode}if(!r)throw Error(Q(147,e));var i=r,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(o){var s=i.refs;o===null?delete s[a]:s[a]=o},t._stringRef=a,t)}if(typeof e!="string")throw Error(Q(284));if(!n._owner)throw Error(Q(290,e))}return e}function id(e,t){throw e=Object.prototype.toString.call(t),Error(Q(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Wb(e){var t=e._init;return t(e._payload)}function Yb(e){function t(y,w){if(e){var b=y.deletions;b===null?(y.deletions=[w],y.flags|=16):b.push(w)}}function n(y,w){if(!e)return null;for(;w!==null;)t(y,w),w=w.sibling;return null}function r(y,w){for(y=new Map;w!==null;)w.key!==null?y.set(w.key,w):y.set(w.index,w),w=w.sibling;return y}function i(y,w){return y=Ki(y,w),y.index=0,y.sibling=null,y}function a(y,w,b){return y.index=b,e?(b=y.alternate,b!==null?(b=b.index,b<w?(y.flags|=2,w):b):(y.flags|=2,w)):(y.flags|=1048576,w)}function o(y){return e&&y.alternate===null&&(y.flags|=2),y}function s(y,w,b,T){return w===null||w.tag!==6?(w=vg(b,y.mode,T),w.return=y,w):(w=i(w,b),w.return=y,w)}function u(y,w,b,T){var S=b.type;return S===Co?c(y,w,b.props.children,T,b.key):w!==null&&(w.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Ni&&Wb(S)===w.type)?(T=i(w,b.props),T.ref=Au(y,w,b),T.return=y,T):(T=kd(b.type,b.key,b.props,null,y.mode,T),T.ref=Au(y,w,b),T.return=y,T)}function l(y,w,b,T){return w===null||w.tag!==4||w.stateNode.containerInfo!==b.containerInfo||w.stateNode.implementation!==b.implementation?(w=wg(b,y.mode,T),w.return=y,w):(w=i(w,b.children||[]),w.return=y,w)}function c(y,w,b,T,S){return w===null||w.tag!==7?(w=qa(b,y.mode,T,S),w.return=y,w):(w=i(w,b),w.return=y,w)}function d(y,w,b){if(typeof w=="string"&&w!==""||typeof w=="number")return w=vg(""+w,y.mode,b),w.return=y,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Sc:return b=kd(w.type,w.key,w.props,null,y.mode,b),b.ref=Au(y,null,w),b.return=y,b;case So:return w=wg(w,y.mode,b),w.return=y,w;case Ni:var T=w._init;return d(y,T(w._payload),b)}if(nu(w)||eu(w))return w=qa(w,y.mode,b,null),w.return=y,w;id(y,w)}return null}function f(y,w,b,T){var S=w!==null?w.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return S!==null?null:s(y,w,""+b,T);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Sc:return b.key===S?u(y,w,b,T):null;case So:return b.key===S?l(y,w,b,T):null;case Ni:return S=b._init,f(y,w,S(b._payload),T)}if(nu(b)||eu(b))return S!==null?null:c(y,w,b,T,null);id(y,b)}return null}function p(y,w,b,T,S){if(typeof T=="string"&&T!==""||typeof T=="number")return y=y.get(b)||null,s(w,y,""+T,S);if(typeof T=="object"&&T!==null){switch(T.$$typeof){case Sc:return y=y.get(T.key===null?b:T.key)||null,u(w,y,T,S);case So:return y=y.get(T.key===null?b:T.key)||null,l(w,y,T,S);case Ni:var _=T._init;return p(y,w,b,_(T._payload),S)}if(nu(T)||eu(T))return y=y.get(b)||null,c(w,y,T,S,null);id(w,T)}return null}function m(y,w,b,T){for(var S=null,_=null,N=w,D=w=0,V=null;N!==null&&D<b.length;D++){N.index>D?(V=N,N=null):V=N.sibling;var P=f(y,N,b[D],T);if(P===null){N===null&&(N=V);break}e&&N&&P.alternate===null&&t(y,N),w=a(P,w,D),_===null?S=P:_.sibling=P,_=P,N=V}if(D===b.length)return n(y,N),ot&&ja(y,D),S;if(N===null){for(;D<b.length;D++)N=d(y,b[D],T),N!==null&&(w=a(N,w,D),_===null?S=N:_.sibling=N,_=N);return ot&&ja(y,D),S}for(N=r(y,N);D<b.length;D++)V=p(N,y,D,b[D],T),V!==null&&(e&&V.alternate!==null&&N.delete(V.key===null?D:V.key),w=a(V,w,D),_===null?S=V:_.sibling=V,_=V);return e&&N.forEach(function($){return t(y,$)}),ot&&ja(y,D),S}function g(y,w,b,T){var S=eu(b);if(typeof S!="function")throw Error(Q(150));if(b=S.call(b),b==null)throw Error(Q(151));for(var _=S=null,N=w,D=w=0,V=null,P=b.next();N!==null&&!P.done;D++,P=b.next()){N.index>D?(V=N,N=null):V=N.sibling;var $=f(y,N,P.value,T);if($===null){N===null&&(N=V);break}e&&N&&$.alternate===null&&t(y,N),w=a($,w,D),_===null?S=$:_.sibling=$,_=$,N=V}if(P.done)return n(y,N),ot&&ja(y,D),S;if(N===null){for(;!P.done;D++,P=b.next())P=d(y,P.value,T),P!==null&&(w=a(P,w,D),_===null?S=P:_.sibling=P,_=P);return ot&&ja(y,D),S}for(N=r(y,N);!P.done;D++,P=b.next())P=p(N,y,D,P.value,T),P!==null&&(e&&P.alternate!==null&&N.delete(P.key===null?D:P.key),w=a(P,w,D),_===null?S=P:_.sibling=P,_=P);return e&&N.forEach(function(H){return t(y,H)}),ot&&ja(y,D),S}function x(y,w,b,T){if(typeof b=="object"&&b!==null&&b.type===Co&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case Sc:e:{for(var S=b.key,_=w;_!==null;){if(_.key===S){if(S=b.type,S===Co){if(_.tag===7){n(y,_.sibling),w=i(_,b.props.children),w.return=y,y=w;break e}}else if(_.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Ni&&Wb(S)===_.type){n(y,_.sibling),w=i(_,b.props),w.ref=Au(y,_,b),w.return=y,y=w;break e}n(y,_);break}else t(y,_);_=_.sibling}b.type===Co?(w=qa(b.props.children,y.mode,T,b.key),w.return=y,y=w):(T=kd(b.type,b.key,b.props,null,y.mode,T),T.ref=Au(y,w,b),T.return=y,y=T)}return o(y);case So:e:{for(_=b.key;w!==null;){if(w.key===_)if(w.tag===4&&w.stateNode.containerInfo===b.containerInfo&&w.stateNode.implementation===b.implementation){n(y,w.sibling),w=i(w,b.children||[]),w.return=y,y=w;break e}else{n(y,w);break}else t(y,w);w=w.sibling}w=wg(b,y.mode,T),w.return=y,y=w}return o(y);case Ni:return _=b._init,x(y,w,_(b._payload),T)}if(nu(b))return m(y,w,b,T);if(eu(b))return g(y,w,b,T);id(y,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,w!==null&&w.tag===6?(n(y,w.sibling),w=i(w,b),w.return=y,y=w):(n(y,w),w=vg(b,y.mode,T),w.return=y,y=w),o(y)):n(y,w)}return x}var Vo=Yb(!0),qb=Yb(!1),ad=ji(null),od=null,$o=null,km=null;function Rm(){km=$o=od=null}function Nm(e){var t=ad.current;rt(ad),e._currentValue=t}function Pm(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 Wo(e,t){od=e,km=$o=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(bn=!0),e.firstContext=null)}function Jn(e){var t=e._currentValue;if(km!==e)if(e={context:e,memoizedValue:t,next:null},$o===null){if(od===null)throw Error(Q(308));$o=e,od.dependencies={lanes:0,firstContext:e}}else $o=$o.next=e;return t}var Ua=null;function Im(e){Ua===null?Ua=[e]:Ua.push(e)}function Gb(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Im(t)):(n.next=i.next,i.next=n),t.interleaved=n,oi(e,r)}function oi(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 zi=!1;function Om(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Kb(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 si(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Vi(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ue&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,oi(e,n)}return i=r.interleaved,i===null?(t.next=t,Im(r)):(t.next=i.next,i.next=t),r.interleaved=t,oi(e,n)}function sd(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,qh(e,n)}}function Xb(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ud(e,t,n,r){var i=e.updateQueue;zi=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var u=s,l=u.next;u.next=null,o===null?a=l:o.next=l,o=u;var c=e.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==o&&(s===null?c.firstBaseUpdate=l:s.next=l,c.lastBaseUpdate=u))}if(a!==null){var d=i.baseState;o=0,c=l=u=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var m=e,g=s;switch(f=t,p=n,g.tag){case 1:if(m=g.payload,typeof m=="function"){d=m.call(p,d,f);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m=="function"?m.call(p,d,f):m,f==null)break e;d=ct({},d,f);break e;case 2:zi=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(l=c=p,u=d):c=c.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(c===null&&(u=d),i.baseState=u,i.firstBaseUpdate=l,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Va|=o,e.lanes=o,e.memoizedState=d}}function Qb(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(Q(191,i));i.call(r)}}}var ku={},Lr=ji(ku),Ru=ji(ku),Nu=ji(ku);function Ha(e){if(e===ku)throw Error(Q(174));return e}function Dm(e,t){switch(et(Nu,t),et(Ru,e),et(Lr,ku),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Lh(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Lh(t,e)}rt(Lr),et(Lr,t)}function Yo(){rt(Lr),rt(Ru),rt(Nu)}function Zb(e){Ha(Nu.current);var t=Ha(Lr.current),n=Lh(t,e.type);t!==n&&(et(Ru,e),et(Lr,n))}function Lm(e){Ru.current===e&&(rt(Lr),rt(Ru))}var dt=ji(0);function ld(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 Mm=[];function Fm(){for(var e=0;e<Mm.length;e++)Mm[e]._workInProgressVersionPrimary=null;Mm.length=0}var cd=ti.ReactCurrentDispatcher,Bm=ti.ReactCurrentBatchConfig,za=0,ft=null,Nt=null,Ot=null,dd=!1,Pu=!1,Iu=0,JD=0;function Gt(){throw Error(Q(321))}function jm(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!mr(e[n],t[n]))return!1;return!0}function Um(e,t,n,r,i,a){if(za=a,ft=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,cd.current=e===null||e.memoizedState===null?r6:i6,e=n(r,i),Pu){a=0;do{if(Pu=!1,Iu=0,25<=a)throw Error(Q(301));a+=1,Ot=Nt=null,t.updateQueue=null,cd.current=a6,e=n(r,i)}while(Pu)}if(cd.current=hd,t=Nt!==null&&Nt.next!==null,za=0,Ot=Nt=ft=null,dd=!1,t)throw Error(Q(300));return e}function Hm(){var e=Iu!==0;return Iu=0,e}function Mr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ot===null?ft.memoizedState=Ot=e:Ot=Ot.next=e,Ot}function er(){if(Nt===null){var e=ft.alternate;e=e!==null?e.memoizedState:null}else e=Nt.next;var t=Ot===null?ft.memoizedState:Ot.next;if(t!==null)Ot=t,Nt=e;else{if(e===null)throw Error(Q(310));Nt=e,e={memoizedState:Nt.memoizedState,baseState:Nt.baseState,baseQueue:Nt.baseQueue,queue:Nt.queue,next:null},Ot===null?ft.memoizedState=Ot=e:Ot=Ot.next=e}return Ot}function Ou(e,t){return typeof t=="function"?t(e):t}function zm(e){var t=er(),n=t.queue;if(n===null)throw Error(Q(311));n.lastRenderedReducer=e;var r=Nt,i=r.baseQueue,a=n.pending;if(a!==null){if(i!==null){var o=i.next;i.next=a.next,a.next=o}r.baseQueue=i=a,n.pending=null}if(i!==null){a=i.next,r=r.baseState;var s=o=null,u=null,l=a;do{var c=l.lane;if((za&c)===c)u!==null&&(u=u.next={lane:0,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null}),r=l.hasEagerState?l.eagerState:e(r,l.action);else{var d={lane:c,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null};u===null?(s=u=d,o=r):u=u.next=d,ft.lanes|=c,Va|=c}l=l.next}while(l!==null&&l!==a);u===null?o=r:u.next=s,mr(r,t.memoizedState)||(bn=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do a=i.lane,ft.lanes|=a,Va|=a,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Vm(e){var t=er(),n=t.queue;if(n===null)throw Error(Q(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do a=e(a,o.action),o=o.next;while(o!==i);mr(a,t.memoizedState)||(bn=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function Jb(){}function ex(e,t){var n=ft,r=er(),i=t(),a=!mr(r.memoizedState,i);if(a&&(r.memoizedState=i,bn=!0),r=r.queue,$m(rx.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||Ot!==null&&Ot.memoizedState.tag&1){if(n.flags|=2048,Du(9,nx.bind(null,n,r,i,t),void 0,null),Dt===null)throw Error(Q(349));za&30||tx(n,t,i)}return i}function tx(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ft.updateQueue,t===null?(t={lastEffect:null,stores:null},ft.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function nx(e,t,n,r){t.value=n,t.getSnapshot=r,ix(t)&&ax(e)}function rx(e,t,n){return n(function(){ix(t)&&ax(e)})}function ix(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!mr(e,n)}catch{return!0}}function ax(e){var t=oi(e,1);t!==null&&br(t,e,1,-1)}function ox(e){var t=Mr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ou,lastRenderedState:e},t.queue=e,e=e.dispatch=n6.bind(null,ft,e),[t.memoizedState,e]}function Du(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ft.updateQueue,t===null?(t={lastEffect:null,stores:null},ft.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 sx(){return er().memoizedState}function fd(e,t,n,r){var i=Mr();ft.flags|=e,i.memoizedState=Du(1|t,n,void 0,r===void 0?null:r)}function pd(e,t,n,r){var i=er();r=r===void 0?null:r;var a=void 0;if(Nt!==null){var o=Nt.memoizedState;if(a=o.destroy,r!==null&&jm(r,o.deps)){i.memoizedState=Du(t,n,a,r);return}}ft.flags|=e,i.memoizedState=Du(1|t,n,a,r)}function ux(e,t){return fd(8390656,8,e,t)}function $m(e,t){return pd(2048,8,e,t)}function lx(e,t){return pd(4,2,e,t)}function cx(e,t){return pd(4,4,e,t)}function dx(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 fx(e,t,n){return n=n!=null?n.concat([e]):null,pd(4,4,dx.bind(null,t,e),n)}function Wm(){}function px(e,t){var n=er();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&jm(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function hx(e,t){var n=er();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&jm(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function mx(e,t,n){return za&21?(mr(n,t)||(n=Ww(),ft.lanes|=n,Va|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,bn=!0),e.memoizedState=n)}function e6(e,t){var n=qe;qe=n!==0&&4>n?n:4,e(!0);var r=Bm.transition;Bm.transition={};try{e(!1),t()}finally{qe=n,Bm.transition=r}}function gx(){return er().memoizedState}function t6(e,t,n){var r=qi(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},yx(e))vx(t,n);else if(n=Gb(e,t,n,r),n!==null){var i=dn();br(n,e,r,i),wx(n,t,r)}}function n6(e,t,n){var r=qi(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(yx(e))vx(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,mr(s,o)){var u=t.interleaved;u===null?(i.next=i,Im(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}n=Gb(e,t,i,r),n!==null&&(i=dn(),br(n,e,r,i),wx(n,t,r))}}function yx(e){var t=e.alternate;return e===ft||t!==null&&t===ft}function vx(e,t){Pu=dd=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function wx(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,qh(e,n)}}var hd={readContext:Jn,useCallback:Gt,useContext:Gt,useEffect:Gt,useImperativeHandle:Gt,useInsertionEffect:Gt,useLayoutEffect:Gt,useMemo:Gt,useReducer:Gt,useRef:Gt,useState:Gt,useDebugValue:Gt,useDeferredValue:Gt,useTransition:Gt,useMutableSource:Gt,useSyncExternalStore:Gt,useId:Gt,unstable_isNewReconciler:!1},r6={readContext:Jn,useCallback:function(e,t){return Mr().memoizedState=[e,t===void 0?null:t],e},useContext:Jn,useEffect:ux,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,fd(4194308,4,dx.bind(null,t,e),n)},useLayoutEffect:function(e,t){return fd(4194308,4,e,t)},useInsertionEffect:function(e,t){return fd(4,2,e,t)},useMemo:function(e,t){var n=Mr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Mr();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=t6.bind(null,ft,e),[r.memoizedState,e]},useRef:function(e){var t=Mr();return e={current:e},t.memoizedState=e},useState:ox,useDebugValue:Wm,useDeferredValue:function(e){return Mr().memoizedState=e},useTransition:function(){var e=ox(!1),t=e[0];return e=e6.bind(null,e[1]),Mr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ft,i=Mr();if(ot){if(n===void 0)throw Error(Q(407));n=n()}else{if(n=t(),Dt===null)throw Error(Q(349));za&30||tx(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,ux(rx.bind(null,r,a,e),[e]),r.flags|=2048,Du(9,nx.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=Mr(),t=Dt.identifierPrefix;if(ot){var n=ai,r=ii;n=(r&~(1<<32-hr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Iu++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=JD++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},i6={readContext:Jn,useCallback:px,useContext:Jn,useEffect:$m,useImperativeHandle:fx,useInsertionEffect:lx,useLayoutEffect:cx,useMemo:hx,useReducer:zm,useRef:sx,useState:function(){return zm(Ou)},useDebugValue:Wm,useDeferredValue:function(e){var t=er();return mx(t,Nt.memoizedState,e)},useTransition:function(){var e=zm(Ou)[0],t=er().memoizedState;return[e,t]},useMutableSource:Jb,useSyncExternalStore:ex,useId:gx,unstable_isNewReconciler:!1},a6={readContext:Jn,useCallback:px,useContext:Jn,useEffect:$m,useImperativeHandle:fx,useInsertionEffect:lx,useLayoutEffect:cx,useMemo:hx,useReducer:Vm,useRef:sx,useState:function(){return Vm(Ou)},useDebugValue:Wm,useDeferredValue:function(e){var t=er();return Nt===null?t.memoizedState=e:mx(t,Nt.memoizedState,e)},useTransition:function(){var e=Vm(Ou)[0],t=er().memoizedState;return[e,t]},useMutableSource:Jb,useSyncExternalStore:ex,useId:gx,unstable_isNewReconciler:!1};function yr(e,t){if(e&&e.defaultProps){t=ct({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Ym(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ct({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var md={isMounted:function(e){return(e=e._reactInternals)?La(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=dn(),i=qi(e),a=si(r,i);a.payload=t,n!=null&&(a.callback=n),t=Vi(e,a,i),t!==null&&(br(t,e,i,r),sd(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=dn(),i=qi(e),a=si(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Vi(e,a,i),t!==null&&(br(t,e,i,r),sd(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=dn(),r=qi(e),i=si(n,r);i.tag=2,t!=null&&(i.callback=t),t=Vi(e,i,r),t!==null&&(br(t,e,r,n),sd(t,e,r))}};function bx(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!bu(n,r)||!bu(i,a):!0}function xx(e,t,n){var r=!1,i=Ui,a=t.contextType;return typeof a=="object"&&a!==null?a=Jn(a):(i=wn(t)?Fa:qt.current,r=t.contextTypes,a=(r=r!=null)?jo(e,i):Ui),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=md,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function Ex(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&&md.enqueueReplaceState(t,t.state,null)}function qm(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Om(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=Jn(a):(a=wn(t)?Fa:qt.current,i.context=jo(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(Ym(e,t,a,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&&md.enqueueReplaceState(i,i.state,null),ud(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function qo(e,t){try{var n="",r=t;do n+=OO(r),r=r.return;while(r);var i=n}catch(a){i=`
39
39
  Error generating stack: `+a.message+`
40
- `+a.stack}return{value:e,source:t,stack:i,digest:null}}function Gm(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Km(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var o6=typeof WeakMap=="function"?WeakMap:Map;function Tx(e,t,n){n=si(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ed||(Ed=!0,cg=r),Km(e,t)},n}function _x(e,t,n){n=si(-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(){Km(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){Km(e,t),typeof r!="function"&&(Wi===null?Wi=new Set([this]):Wi.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Sx(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new o6;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=b6.bind(null,e,t,n),t.then(e,e))}function Cx(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 Ax(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=si(-1,1),t.tag=2,Vi(n,t,1))),n.lanes|=1),e)}var s6=ti.ReactCurrentOwner,bn=!1;function cn(e,t,n,r){t.child=e===null?qb(t,null,n,r):Vo(t,e.child,n,r)}function kx(e,t,n,r,i){n=n.render;var a=t.ref;return Wo(t,i),r=Um(e,t,n,r,a,i),n=Hm(),e!==null&&!bn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ui(e,t,i)):(ot&&n&&Tm(t),t.flags|=1,cn(e,t,r,i),t.child)}function Rx(e,t,n,r,i){if(e===null){var a=n.type;return typeof a=="function"&&!yg(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Nx(e,t,a,r,i)):(e=kd(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&i)){var o=a.memoizedProps;if(n=n.compare,n=n!==null?n:bu,n(o,r)&&e.ref===t.ref)return ui(e,t,i)}return t.flags|=1,e=Ki(a,r),e.ref=t.ref,e.return=t,t.child=e}function Nx(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(bu(a,r)&&e.ref===t.ref)if(bn=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(bn=!0);else return t.lanes=e.lanes,ui(e,t,i)}return Xm(e,t,n,r,i)}function Px(e,t,n){var r=t.pendingProps,i=r.children,a=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},et(Ko,Bn),Bn|=n;else{if(!(n&1073741824))return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,et(Ko,Bn),Bn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,et(Ko,Bn),Bn|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,et(Ko,Bn),Bn|=r;return cn(e,t,i,n),t.child}function Ix(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Xm(e,t,n,r,i){var a=wn(n)?Fa:qt.current;return a=jo(t,a),Wo(t,i),n=Um(e,t,n,r,a,i),r=Hm(),e!==null&&!bn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ui(e,t,i)):(ot&&r&&Tm(t),t.flags|=1,cn(e,t,n,i),t.child)}function Ox(e,t,n,r,i){if(wn(n)){var a=!0;Jc(t)}else a=!1;if(Wo(t,i),t.stateNode===null)yd(e,t),xx(t,n,r),qm(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var u=o.context,l=n.contextType;typeof l=="object"&&l!==null?l=Jn(l):(l=wn(n)?Fa:qt.current,l=jo(t,l));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s!==r||u!==l)&&Ex(t,o,r,l),zi=!1;var f=t.memoizedState;o.state=f,ud(t,r,o,i),u=t.memoizedState,s!==r||f!==u||vn.current||zi?(typeof c=="function"&&(Ym(t,n,c,r),u=t.memoizedState),(s=zi||bx(t,n,s,r,f,u,l))?(d||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=u),o.props=r,o.state=u,o.context=l,r=s):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Kb(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:yr(t.type,s),o.props=l,d=t.pendingProps,f=o.context,u=n.contextType,typeof u=="object"&&u!==null?u=Jn(u):(u=wn(n)?Fa:qt.current,u=jo(t,u));var p=n.getDerivedStateFromProps;(c=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s!==d||f!==u)&&Ex(t,o,r,u),zi=!1,f=t.memoizedState,o.state=f,ud(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||vn.current||zi?(typeof p=="function"&&(Ym(t,n,p,r),m=t.memoizedState),(l=zi||bx(t,n,l,r,f,m,u)||!1)?(c||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,m,u),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,m,u)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=u,r=l):(typeof o.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Qm(e,t,n,r,a,i)}function Qm(e,t,n,r,i,a){Ix(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&Bb(t,n,!1),ui(e,t,a);r=t.stateNode,s6.current=t;var s=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Vo(t,e.child,null,a),t.child=Vo(t,null,s,a)):cn(e,t,s,a),t.memoizedState=r.state,i&&Bb(t,n,!0),t.child}function Dx(e){var t=e.stateNode;t.pendingContext?Mb(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Mb(e,t.context,!1),Dm(e,t.containerInfo)}function Lx(e,t,n,r,i){return zo(),Am(i),t.flags|=256,cn(e,t,n,r),t.child}var Zm={dehydrated:null,treeContext:null,retryLane:0};function Jm(e){return{baseLanes:e,cachePool:null,transitions:null}}function Mx(e,t,n){var r=t.pendingProps,i=dt.current,a=!1,o=(t.flags&128)!==0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!==0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),et(dt,i&1),e===null)return Cm(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,a?(r=t.mode,a=t.child,o={mode:"hidden",children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=Rd(o,r,0,null),e=qa(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Jm(n),t.memoizedState=Zm,e):eg(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return u6(e,t,o,r,s,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,s=i.sibling;var u={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=Ki(i,u),r.subtreeFlags=i.subtreeFlags&14680064),s!==null?a=Ki(s,a):(a=qa(a,o,n,null),a.flags|=2),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?Jm(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=Zm,r}return a=e.child,e=a.sibling,r=Ki(a,{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 eg(e,t){return t=Rd({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function gd(e,t,n,r){return r!==null&&Am(r),Vo(t,e.child,null,n),e=eg(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function u6(e,t,n,r,i,a,o){if(n)return t.flags&256?(t.flags&=-257,r=Gm(Error(Q(422))),gd(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=r.fallback,i=t.mode,r=Rd({mode:"visible",children:r.children},i,0,null),a=qa(a,i,o,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,t.mode&1&&Vo(t,e.child,null,o),t.child.memoizedState=Jm(o),t.memoizedState=Zm,a);if(!(t.mode&1))return gd(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var s=r.dgst;return r=s,a=Error(Q(419)),r=Gm(a,r,void 0),gd(e,t,o,r)}if(s=(o&e.childLanes)!==0,bn||s){if(r=Dt,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!==a.retryLane&&(a.retryLane=i,oi(e,i),br(r,e,i,-1))}return gg(),r=Gm(Error(Q(421))),gd(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=x6.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,Fn=Bi(i.nextSibling),Mn=t,ot=!0,gr=null,e!==null&&(Qn[Zn++]=ii,Qn[Zn++]=ai,Qn[Zn++]=Ba,ii=e.id,ai=e.overflow,Ba=t),t=eg(t,r.children),t.flags|=4096,t)}function Fx(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Pm(e.return,t,n)}function tg(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function Bx(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(cn(e,t,r.children,n),r=dt.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&&Fx(e,n,t);else if(e.tag===19)Fx(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(et(dt,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&&ld(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),tg(t,!1,i,n,a);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ld(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}tg(t,!0,n,null,a);break;case"together":tg(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function yd(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ui(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Va|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Q(153));if(t.child!==null){for(e=t.child,n=Ki(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ki(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function l6(e,t,n){switch(t.tag){case 3:Dx(t),zo();break;case 5:Zb(t);break;case 1:wn(t.type)&&Jc(t);break;case 4:Dm(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;et(ad,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(et(dt,dt.current&1),t.flags|=128,null):n&t.child.childLanes?Mx(e,t,n):(et(dt,dt.current&1),e=ui(e,t,n),e!==null?e.sibling:null);et(dt,dt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Bx(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),et(dt,dt.current),r)break;return null;case 22:case 23:return t.lanes=0,Px(e,t,n)}return ui(e,t,n)}var jx,ng,Ux,Hx;jx=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}},ng=function(){},Ux=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Ha(Lr.current);var a=null;switch(n){case"input":i=Ph(e,i),r=Ph(e,r),a=[];break;case"select":i=ct({},i,{value:void 0}),r=ct({},r,{value:void 0}),a=[];break;case"textarea":i=Dh(e,i),r=Dh(e,r),a=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Xc)}Mh(n,r);var o;n=null;for(l in i)if(!r.hasOwnProperty(l)&&i.hasOwnProperty(l)&&i[l]!=null)if(l==="style"){var s=i[l];for(o in s)s.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else l!=="dangerouslySetInnerHTML"&&l!=="children"&&l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(Js.hasOwnProperty(l)?a||(a=[]):(a=a||[]).push(l,null));for(l in r){var u=r[l];if(s=i!=null?i[l]:void 0,r.hasOwnProperty(l)&&u!==s&&(u!=null||s!=null))if(l==="style")if(s){for(o in s)!s.hasOwnProperty(o)||u&&u.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in u)u.hasOwnProperty(o)&&s[o]!==u[o]&&(n||(n={}),n[o]=u[o])}else n||(a||(a=[]),a.push(l,n)),n=u;else l==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,s=s?s.__html:void 0,u!=null&&s!==u&&(a=a||[]).push(l,u)):l==="children"?typeof u!="string"&&typeof u!="number"||(a=a||[]).push(l,""+u):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&(Js.hasOwnProperty(l)?(u!=null&&l==="onScroll"&&nt("scroll",e),a||s===u||(a=[])):(a=a||[]).push(l,u))}n&&(a=a||[]).push("style",n);var l=a;(t.updateQueue=l)&&(t.flags|=4)}},Hx=function(e,t,n,r){n!==r&&(t.flags|=4)};function Lu(e,t){if(!ot)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 Kt(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 c6(e,t,n){var r=t.pendingProps;switch(_m(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Kt(t),null;case 1:return wn(t.type)&&Zc(),Kt(t),null;case 3:return r=t.stateNode,Yo(),rt(vn),rt(qt),Fm(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(rd(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,gr!==null&&(pg(gr),gr=null))),ng(e,t),Kt(t),null;case 5:Lm(t);var i=Ha(Nu.current);if(n=t.type,e!==null&&t.stateNode!=null)Ux(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(Q(166));return Kt(t),null}if(e=Ha(Lr.current),rd(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[Dr]=t,r[Su]=a,e=(t.mode&1)!==0,n){case"dialog":nt("cancel",r),nt("close",r);break;case"iframe":case"object":case"embed":nt("load",r);break;case"video":case"audio":for(i=0;i<Eu.length;i++)nt(Eu[i],r);break;case"source":nt("error",r);break;case"img":case"image":case"link":nt("error",r),nt("load",r);break;case"details":nt("toggle",r);break;case"input":xw(r,a),nt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},nt("invalid",r);break;case"textarea":_w(r,a),nt("invalid",r)}Mh(n,a),i=null;for(var o in a)if(a.hasOwnProperty(o)){var s=a[o];o==="children"?typeof s=="string"?r.textContent!==s&&(a.suppressHydrationWarning!==!0&&Kc(r.textContent,s,e),i=["children",s]):typeof s=="number"&&r.textContent!==""+s&&(a.suppressHydrationWarning!==!0&&Kc(r.textContent,s,e),i=["children",""+s]):Js.hasOwnProperty(o)&&s!=null&&o==="onScroll"&&nt("scroll",r)}switch(n){case"input":Cc(r),Tw(r,a,!0);break;case"textarea":Cc(r),Cw(r);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(r.onclick=Xc)}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=Aw(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[Dr]=t,e[Su]=r,jx(e,t,!1,!1),t.stateNode=e;e:{switch(o=Fh(n,r),n){case"dialog":nt("cancel",e),nt("close",e),i=r;break;case"iframe":case"object":case"embed":nt("load",e),i=r;break;case"video":case"audio":for(i=0;i<Eu.length;i++)nt(Eu[i],e);i=r;break;case"source":nt("error",e),i=r;break;case"img":case"image":case"link":nt("error",e),nt("load",e),i=r;break;case"details":nt("toggle",e),i=r;break;case"input":xw(e,r),i=Ph(e,r),nt("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=ct({},r,{value:void 0}),nt("invalid",e);break;case"textarea":_w(e,r),i=Dh(e,r),nt("invalid",e);break;default:i=r}Mh(n,i),s=i;for(a in s)if(s.hasOwnProperty(a)){var u=s[a];a==="style"?Nw(e,u):a==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&kw(e,u)):a==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&ru(e,u):typeof u=="number"&&ru(e,""+u):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Js.hasOwnProperty(a)?u!=null&&a==="onScroll"&&nt("scroll",e):u!=null&&bh(e,a,u,o))}switch(n){case"input":Cc(e),Tw(e,r,!1);break;case"textarea":Cc(e),Cw(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Pi(r.value));break;case"select":e.multiple=!!r.multiple,a=r.value,a!=null?Ao(e,!!r.multiple,a,!1):r.defaultValue!=null&&Ao(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Xc)}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 Kt(t),null;case 6:if(e&&t.stateNode!=null)Hx(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(Q(166));if(n=Ha(Nu.current),Ha(Lr.current),rd(t)){if(r=t.stateNode,n=t.memoizedProps,r[Dr]=t,(a=r.nodeValue!==n)&&(e=Mn,e!==null))switch(e.tag){case 3:Kc(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Kc(r.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Dr]=t,t.stateNode=r}return Kt(t),null;case 13:if(rt(dt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ot&&Fn!==null&&t.mode&1&&!(t.flags&128))$b(),zo(),t.flags|=98560,a=!1;else if(a=rd(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(Q(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(Q(317));a[Dr]=t}else zo(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Kt(t),a=!1}else gr!==null&&(pg(gr),gr=null),a=!0;if(!a)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||dt.current&1?Pt===0&&(Pt=3):gg())),t.updateQueue!==null&&(t.flags|=4),Kt(t),null);case 4:return Yo(),ng(e,t),e===null&&Tu(t.stateNode.containerInfo),Kt(t),null;case 10:return Nm(t.type._context),Kt(t),null;case 17:return wn(t.type)&&Zc(),Kt(t),null;case 19:if(rt(dt),a=t.memoizedState,a===null)return Kt(t),null;if(r=(t.flags&128)!==0,o=a.rendering,o===null)if(r)Lu(a,!1);else{if(Pt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ld(e),o!==null){for(t.flags|=128,Lu(a,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)a=n,e=r,a.flags&=14680066,o=a.alternate,o===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,e=o.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return et(dt,dt.current&1|2),t.child}e=e.sibling}a.tail!==null&&xt()>Xo&&(t.flags|=128,r=!0,Lu(a,!1),t.lanes=4194304)}else{if(!r)if(e=ld(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Lu(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!ot)return Kt(t),null}else 2*xt()-a.renderingStartTime>Xo&&n!==1073741824&&(t.flags|=128,r=!0,Lu(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(n=a.last,n!==null?n.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=xt(),t.sibling=null,n=dt.current,et(dt,r?n&1|2:n&1),t):(Kt(t),null);case 22:case 23:return mg(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Bn&1073741824&&(Kt(t),t.subtreeFlags&6&&(t.flags|=8192)):Kt(t),null;case 24:return null;case 25:return null}throw Error(Q(156,t.tag))}function d6(e,t){switch(_m(t),t.tag){case 1:return wn(t.type)&&Zc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Yo(),rt(vn),rt(qt),Fm(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Lm(t),null;case 13:if(rt(dt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Q(340));zo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return rt(dt),null;case 4:return Yo(),null;case 10:return Nm(t.type._context),null;case 22:case 23:return mg(),null;case 24:return null;default:return null}}var vd=!1,Xt=!1,f6=typeof WeakSet=="function"?WeakSet:Set,ue=null;function Go(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){yt(e,t,r)}else n.current=null}function rg(e,t,n){try{n()}catch(r){yt(e,t,r)}}var zx=!1;function p6(e,t){if(mm=Bc,e=bb(),sm(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,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var o=0,s=-1,u=-1,l=0,c=0,d=e,f=null;t:for(;;){for(var p;d!==n||i!==0&&d.nodeType!==3||(s=o+i),d!==a||r!==0&&d.nodeType!==3||(u=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===n&&++l===i&&(s=o),f===a&&++c===r&&(u=o),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=s===-1||u===-1?null:{start:s,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(gm={focusedElem:e,selectionRange:n},Bc=!1,ue=t;ue!==null;)if(t=ue,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ue=e;else for(;ue!==null;){t=ue;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var g=m.memoizedProps,x=m.memoizedState,y=t.stateNode,w=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:yr(t.type,g),x);y.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Q(163))}}catch(T){yt(t,t.return,T)}if(e=t.sibling,e!==null){e.return=t.return,ue=e;break}ue=t.return}return m=zx,zx=!1,m}function Mu(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 a=i.destroy;i.destroy=void 0,a!==void 0&&rg(t,n,a)}i=i.next}while(i!==r)}}function wd(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 ig(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 Vx(e){var t=e.alternate;t!==null&&(e.alternate=null,Vx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Dr],delete t[Su],delete t[bm],delete t[KD],delete t[XD])),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 $x(e){return e.tag===5||e.tag===3||e.tag===4}function Wx(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||$x(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 ag(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=Xc));else if(r!==4&&(e=e.child,e!==null))for(ag(e,t,n),e=e.sibling;e!==null;)ag(e,t,n),e=e.sibling}function og(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(og(e,t,n),e=e.sibling;e!==null;)og(e,t,n),e=e.sibling}var Ht=null,vr=!1;function $i(e,t,n){for(n=n.child;n!==null;)Yx(e,t,n),n=n.sibling}function Yx(e,t,n){if(Or&&typeof Or.onCommitFiberUnmount=="function")try{Or.onCommitFiberUnmount(Ic,n)}catch{}switch(n.tag){case 5:Xt||Go(n,t);case 6:var r=Ht,i=vr;Ht=null,$i(e,t,n),Ht=r,vr=i,Ht!==null&&(vr?(e=Ht,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ht.removeChild(n.stateNode));break;case 18:Ht!==null&&(vr?(e=Ht,n=n.stateNode,e.nodeType===8?wm(e.parentNode,n):e.nodeType===1&&wm(e,n),hu(e)):wm(Ht,n.stateNode));break;case 4:r=Ht,i=vr,Ht=n.stateNode.containerInfo,vr=!0,$i(e,t,n),Ht=r,vr=i;break;case 0:case 11:case 14:case 15:if(!Xt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&rg(n,t,o),i=i.next}while(i!==r)}$i(e,t,n);break;case 1:if(!Xt&&(Go(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){yt(n,t,s)}$i(e,t,n);break;case 21:$i(e,t,n);break;case 22:n.mode&1?(Xt=(r=Xt)||n.memoizedState!==null,$i(e,t,n),Xt=r):$i(e,t,n);break;default:$i(e,t,n)}}function qx(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new f6),t.forEach(function(r){var i=E6.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function wr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var a=e,o=t,s=o;e:for(;s!==null;){switch(s.tag){case 5:Ht=s.stateNode,vr=!1;break e;case 3:Ht=s.stateNode.containerInfo,vr=!0;break e;case 4:Ht=s.stateNode.containerInfo,vr=!0;break e}s=s.return}if(Ht===null)throw Error(Q(160));Yx(a,o,i),Ht=null,vr=!1;var u=i.alternate;u!==null&&(u.return=null),i.return=null}catch(l){yt(i,t,l)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Gx(t,e),t=t.sibling}function Gx(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(wr(t,e),Fr(e),r&4){try{Mu(3,e,e.return),wd(3,e)}catch(g){yt(e,e.return,g)}try{Mu(5,e,e.return)}catch(g){yt(e,e.return,g)}}break;case 1:wr(t,e),Fr(e),r&512&&n!==null&&Go(n,n.return);break;case 5:if(wr(t,e),Fr(e),r&512&&n!==null&&Go(n,n.return),e.flags&32){var i=e.stateNode;try{ru(i,"")}catch(g){yt(e,e.return,g)}}if(r&4&&(i=e.stateNode,i!=null)){var a=e.memoizedProps,o=n!==null?n.memoizedProps:a,s=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{s==="input"&&a.type==="radio"&&a.name!=null&&Ew(i,a),Fh(s,o);var l=Fh(s,a);for(o=0;o<u.length;o+=2){var c=u[o],d=u[o+1];c==="style"?Nw(i,d):c==="dangerouslySetInnerHTML"?kw(i,d):c==="children"?ru(i,d):bh(i,c,d,l)}switch(s){case"input":Ih(i,a);break;case"textarea":Sw(i,a);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var p=a.value;p!=null?Ao(i,!!a.multiple,p,!1):f!==!!a.multiple&&(a.defaultValue!=null?Ao(i,!!a.multiple,a.defaultValue,!0):Ao(i,!!a.multiple,a.multiple?[]:"",!1))}i[Su]=a}catch(g){yt(e,e.return,g)}}break;case 6:if(wr(t,e),Fr(e),r&4){if(e.stateNode===null)throw Error(Q(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(g){yt(e,e.return,g)}}break;case 3:if(wr(t,e),Fr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{hu(t.containerInfo)}catch(g){yt(e,e.return,g)}break;case 4:wr(t,e),Fr(e);break;case 13:wr(t,e),Fr(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(lg=xt())),r&4&&qx(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(Xt=(l=Xt)||c,wr(t,e),Xt=l):wr(t,e),Fr(e),r&8192){if(l=e.memoizedState!==null,(e.stateNode.isHidden=l)&&!c&&e.mode&1)for(ue=e,c=e.child;c!==null;){for(d=ue=c;ue!==null;){switch(f=ue,p=f.child,f.tag){case 0:case 11:case 14:case 15:Mu(4,f,f.return);break;case 1:Go(f,f.return);var m=f.stateNode;if(typeof m.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(g){yt(r,n,g)}}break;case 5:Go(f,f.return);break;case 22:if(f.memoizedState!==null){Qx(d);continue}}p!==null?(p.return=f,ue=p):Qx(d)}c=c.sibling}e:for(c=null,d=e;;){if(d.tag===5){if(c===null){c=d;try{i=d.stateNode,l?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(s=d.stateNode,u=d.memoizedProps.style,o=u!=null&&u.hasOwnProperty("display")?u.display:null,s.style.display=Rw("display",o))}catch(g){yt(e,e.return,g)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=l?"":d.memoizedProps}catch(g){yt(e,e.return,g)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:wr(t,e),Fr(e),r&4&&qx(e);break;case 21:break;default:wr(t,e),Fr(e)}}function Fr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if($x(n)){var r=n;break e}n=n.return}throw Error(Q(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(ru(i,""),r.flags&=-33);var a=Wx(e);og(e,a,i);break;case 3:case 4:var o=r.stateNode.containerInfo,s=Wx(e);ag(e,s,o);break;default:throw Error(Q(161))}}catch(u){yt(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function h6(e,t,n){ue=e,Kx(e)}function Kx(e,t,n){for(var r=(e.mode&1)!==0;ue!==null;){var i=ue,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||vd;if(!o){var s=i.alternate,u=s!==null&&s.memoizedState!==null||Xt;s=vd;var l=Xt;if(vd=o,(Xt=u)&&!l)for(ue=i;ue!==null;)o=ue,u=o.child,o.tag===22&&o.memoizedState!==null?Zx(i):u!==null?(u.return=o,ue=u):Zx(i);for(;a!==null;)ue=a,Kx(a),a=a.sibling;ue=i,vd=s,Xt=l}Xx(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,ue=a):Xx(e)}}function Xx(e){for(;ue!==null;){var t=ue;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Xt||wd(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Xt)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:yr(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&Qb(t,a,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}Qb(t,o,n)}break;case 5:var s=t.stateNode;if(n===null&&t.flags&4){n=s;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var l=t.alternate;if(l!==null){var c=l.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&hu(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Q(163))}Xt||t.flags&512&&ig(t)}catch(f){yt(t,t.return,f)}}if(t===e){ue=null;break}if(n=t.sibling,n!==null){n.return=t.return,ue=n;break}ue=t.return}}function Qx(e){for(;ue!==null;){var t=ue;if(t===e){ue=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ue=n;break}ue=t.return}}function Zx(e){for(;ue!==null;){var t=ue;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{wd(4,t)}catch(u){yt(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(u){yt(t,i,u)}}var a=t.return;try{ig(t)}catch(u){yt(t,a,u)}break;case 5:var o=t.return;try{ig(t)}catch(u){yt(t,o,u)}}}catch(u){yt(t,t.return,u)}if(t===e){ue=null;break}var s=t.sibling;if(s!==null){s.return=t.return,ue=s;break}ue=t.return}}var m6=Math.ceil,bd=ti.ReactCurrentDispatcher,sg=ti.ReactCurrentOwner,tr=ti.ReactCurrentBatchConfig,Ue=0,Dt=null,Ct=null,zt=0,Bn=0,Ko=ji(0),Pt=0,Fu=null,Va=0,xd=0,ug=0,Bu=null,xn=null,lg=0,Xo=1/0,li=null,Ed=!1,cg=null,Wi=null,Td=!1,Yi=null,_d=0,ju=0,dg=null,Sd=-1,Cd=0;function dn(){return Ue&6?xt():Sd!==-1?Sd:Sd=xt()}function qi(e){return e.mode&1?Ue&2&&zt!==0?zt&-zt:ZD.transition!==null?(Cd===0&&(Cd=Ww()),Cd):(e=qe,e!==0||(e=window.event,e=e===void 0?16:eb(e.type)),e):1}function br(e,t,n,r){if(50<ju)throw ju=0,dg=null,Error(Q(185));lu(e,n,r),(!(Ue&2)||e!==Dt)&&(e===Dt&&(!(Ue&2)&&(xd|=n),Pt===4&&Gi(e,zt)),En(e,r),n===1&&Ue===0&&!(t.mode&1)&&(Xo=xt()+500,ed&&Hi()))}function En(e,t){var n=e.callbackNode;ZO(e,t);var r=Lc(e,e===Dt?zt:0);if(r===0)n!==null&&zw(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&zw(n),t===1)e.tag===0?QD(eE.bind(null,e)):jb(eE.bind(null,e)),qD(function(){!(Ue&6)&&Hi()}),n=null;else{switch(Yw(r)){case 1:n=$h;break;case 4:n=Vw;break;case 16:n=Pc;break;case 536870912:n=$w;break;default:n=Pc}n=uE(n,Jx.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Jx(e,t){if(Sd=-1,Cd=0,Ue&6)throw Error(Q(327));var n=e.callbackNode;if(Qo()&&e.callbackNode!==n)return null;var r=Lc(e,e===Dt?zt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Ad(e,r);else{t=r;var i=Ue;Ue|=2;var a=nE();(Dt!==e||zt!==t)&&(li=null,Xo=xt()+500,Wa(e,t));do try{v6();break}catch(s){tE(e,s)}while(!0);Rm(),bd.current=a,Ue=i,Ct!==null?t=0:(Dt=null,zt=0,t=Pt)}if(t!==0){if(t===2&&(i=Wh(e),i!==0&&(r=i,t=fg(e,i))),t===1)throw n=Fu,Wa(e,0),Gi(e,r),En(e,xt()),n;if(t===6)Gi(e,r);else{if(i=e.current.alternate,!(r&30)&&!g6(i)&&(t=Ad(e,r),t===2&&(a=Wh(e),a!==0&&(r=a,t=fg(e,a))),t===1))throw n=Fu,Wa(e,0),Gi(e,r),En(e,xt()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(Q(345));case 2:Ya(e,xn,li);break;case 3:if(Gi(e,r),(r&130023424)===r&&(t=lg+500-xt(),10<t)){if(Lc(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){dn(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=vm(Ya.bind(null,e,xn,li),t);break}Ya(e,xn,li);break;case 4:if(Gi(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-hr(r);a=1<<o,o=t[o],o>i&&(i=o),r&=~a}if(r=i,r=xt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*m6(r/1960))-r,10<r){e.timeoutHandle=vm(Ya.bind(null,e,xn,li),r);break}Ya(e,xn,li);break;case 5:Ya(e,xn,li);break;default:throw Error(Q(329))}}}return En(e,xt()),e.callbackNode===n?Jx.bind(null,e):null}function fg(e,t){var n=Bu;return e.current.memoizedState.isDehydrated&&(Wa(e,t).flags|=256),e=Ad(e,t),e!==2&&(t=xn,xn=n,t!==null&&pg(t)),e}function pg(e){xn===null?xn=e:xn.push.apply(xn,e)}function g6(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],a=i.getSnapshot;i=i.value;try{if(!mr(a(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Gi(e,t){for(t&=~ug,t&=~xd,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-hr(t),r=1<<n;e[n]=-1,t&=~r}}function eE(e){if(Ue&6)throw Error(Q(327));Qo();var t=Lc(e,0);if(!(t&1))return En(e,xt()),null;var n=Ad(e,t);if(e.tag!==0&&n===2){var r=Wh(e);r!==0&&(t=r,n=fg(e,r))}if(n===1)throw n=Fu,Wa(e,0),Gi(e,t),En(e,xt()),n;if(n===6)throw Error(Q(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ya(e,xn,li),En(e,xt()),null}function hg(e,t){var n=Ue;Ue|=1;try{return e(t)}finally{Ue=n,Ue===0&&(Xo=xt()+500,ed&&Hi())}}function $a(e){Yi!==null&&Yi.tag===0&&!(Ue&6)&&Qo();var t=Ue;Ue|=1;var n=tr.transition,r=qe;try{if(tr.transition=null,qe=1,e)return e()}finally{qe=r,tr.transition=n,Ue=t,!(Ue&6)&&Hi()}}function mg(){Bn=Ko.current,rt(Ko)}function Wa(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,YD(n)),Ct!==null)for(n=Ct.return;n!==null;){var r=n;switch(_m(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Zc();break;case 3:Yo(),rt(vn),rt(qt),Fm();break;case 5:Lm(r);break;case 4:Yo();break;case 13:rt(dt);break;case 19:rt(dt);break;case 10:Nm(r.type._context);break;case 22:case 23:mg()}n=n.return}if(Dt=e,Ct=e=Ki(e.current,null),zt=Bn=t,Pt=0,Fu=null,ug=xd=Va=0,xn=Bu=null,Ua!==null){for(t=0;t<Ua.length;t++)if(n=Ua[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,r.next=o}n.pending=r}Ua=null}return e}function tE(e,t){do{var n=Ct;try{if(Rm(),cd.current=hd,dd){for(var r=ft.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}dd=!1}if(za=0,Ot=Nt=ft=null,Pu=!1,Iu=0,sg.current=null,n===null||n.return===null){Pt=1,Fu=t,Ct=null;break}e:{var a=e,o=n.return,s=n,u=t;if(t=zt,s.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var l=u,c=s,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var p=Cx(o);if(p!==null){p.flags&=-257,Ax(p,o,s,a,t),p.mode&1&&Sx(a,l,t),t=p,u=l;var m=t.updateQueue;if(m===null){var g=new Set;g.add(u),t.updateQueue=g}else m.add(u);break e}else{if(!(t&1)){Sx(a,l,t),gg();break e}u=Error(Q(426))}}else if(ot&&s.mode&1){var x=Cx(o);if(x!==null){!(x.flags&65536)&&(x.flags|=256),Ax(x,o,s,a,t),Am(qo(u,s));break e}}a=u=qo(u,s),Pt!==4&&(Pt=2),Bu===null?Bu=[a]:Bu.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var y=Tx(a,u,t);Xb(a,y);break e;case 1:s=u;var w=a.type,b=a.stateNode;if(!(a.flags&128)&&(typeof w.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Wi===null||!Wi.has(b)))){a.flags|=65536,t&=-t,a.lanes|=t;var T=_x(a,s,t);Xb(a,T);break e}}a=a.return}while(a!==null)}iE(n)}catch(S){t=S,Ct===n&&n!==null&&(Ct=n=n.return);continue}break}while(!0)}function nE(){var e=bd.current;return bd.current=hd,e===null?hd:e}function gg(){(Pt===0||Pt===3||Pt===2)&&(Pt=4),Dt===null||!(Va&268435455)&&!(xd&268435455)||Gi(Dt,zt)}function Ad(e,t){var n=Ue;Ue|=2;var r=nE();(Dt!==e||zt!==t)&&(li=null,Wa(e,t));do try{y6();break}catch(i){tE(e,i)}while(!0);if(Rm(),Ue=n,bd.current=r,Ct!==null)throw Error(Q(261));return Dt=null,zt=0,Pt}function y6(){for(;Ct!==null;)rE(Ct)}function v6(){for(;Ct!==null&&!VO();)rE(Ct)}function rE(e){var t=sE(e.alternate,e,Bn);e.memoizedProps=e.pendingProps,t===null?iE(e):Ct=t,sg.current=null}function iE(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=d6(n,t),n!==null){n.flags&=32767,Ct=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Pt=6,Ct=null;return}}else if(n=c6(n,t,Bn),n!==null){Ct=n;return}if(t=t.sibling,t!==null){Ct=t;return}Ct=t=e}while(t!==null);Pt===0&&(Pt=5)}function Ya(e,t,n){var r=qe,i=tr.transition;try{tr.transition=null,qe=1,w6(e,t,n,r)}finally{tr.transition=i,qe=r}return null}function w6(e,t,n,r){do Qo();while(Yi!==null);if(Ue&6)throw Error(Q(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(Q(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(JO(e,a),e===Dt&&(Ct=Dt=null,zt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Td||(Td=!0,uE(Pc,function(){return Qo(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=tr.transition,tr.transition=null;var o=qe;qe=1;var s=Ue;Ue|=4,sg.current=null,p6(e,n),Gx(n,e),jD(gm),Bc=!!mm,gm=mm=null,e.current=n,h6(n),$O(),Ue=s,qe=o,tr.transition=a}else e.current=n;if(Td&&(Td=!1,Yi=e,_d=i),a=e.pendingLanes,a===0&&(Wi=null),qO(n.stateNode),En(e,xt()),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(Ed)throw Ed=!1,e=cg,cg=null,e;return _d&1&&e.tag!==0&&Qo(),a=e.pendingLanes,a&1?e===dg?ju++:(ju=0,dg=e):ju=0,Hi(),null}function Qo(){if(Yi!==null){var e=Yw(_d),t=tr.transition,n=qe;try{if(tr.transition=null,qe=16>e?16:e,Yi===null)var r=!1;else{if(e=Yi,Yi=null,_d=0,Ue&6)throw Error(Q(331));var i=Ue;for(Ue|=4,ue=e.current;ue!==null;){var a=ue,o=a.child;if(ue.flags&16){var s=a.deletions;if(s!==null){for(var u=0;u<s.length;u++){var l=s[u];for(ue=l;ue!==null;){var c=ue;switch(c.tag){case 0:case 11:case 15:Mu(8,c,a)}var d=c.child;if(d!==null)d.return=c,ue=d;else for(;ue!==null;){c=ue;var f=c.sibling,p=c.return;if(Vx(c),c===l){ue=null;break}if(f!==null){f.return=p,ue=f;break}ue=p}}}var m=a.alternate;if(m!==null){var g=m.child;if(g!==null){m.child=null;do{var x=g.sibling;g.sibling=null,g=x}while(g!==null)}}ue=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,ue=o;else e:for(;ue!==null;){if(a=ue,a.flags&2048)switch(a.tag){case 0:case 11:case 15:Mu(9,a,a.return)}var y=a.sibling;if(y!==null){y.return=a.return,ue=y;break e}ue=a.return}}var w=e.current;for(ue=w;ue!==null;){o=ue;var b=o.child;if(o.subtreeFlags&2064&&b!==null)b.return=o,ue=b;else e:for(o=w;ue!==null;){if(s=ue,s.flags&2048)try{switch(s.tag){case 0:case 11:case 15:wd(9,s)}}catch(S){yt(s,s.return,S)}if(s===o){ue=null;break e}var T=s.sibling;if(T!==null){T.return=s.return,ue=T;break e}ue=s.return}}if(Ue=i,Hi(),Or&&typeof Or.onPostCommitFiberRoot=="function")try{Or.onPostCommitFiberRoot(Ic,e)}catch{}r=!0}return r}finally{qe=n,tr.transition=t}}return!1}function aE(e,t,n){t=qo(n,t),t=Tx(e,t,1),e=Vi(e,t,1),t=dn(),e!==null&&(lu(e,1,t),En(e,t))}function yt(e,t,n){if(e.tag===3)aE(e,e,n);else for(;t!==null;){if(t.tag===3){aE(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Wi===null||!Wi.has(r))){e=qo(n,e),e=_x(t,e,1),t=Vi(t,e,1),e=dn(),t!==null&&(lu(t,1,e),En(t,e));break}}t=t.return}}function b6(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=dn(),e.pingedLanes|=e.suspendedLanes&n,Dt===e&&(zt&n)===n&&(Pt===4||Pt===3&&(zt&130023424)===zt&&500>xt()-lg?Wa(e,0):ug|=n),En(e,t)}function oE(e,t){t===0&&(e.mode&1?(t=Dc,Dc<<=1,!(Dc&130023424)&&(Dc=4194304)):t=1);var n=dn();e=oi(e,t),e!==null&&(lu(e,t,n),En(e,n))}function x6(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),oE(e,n)}function E6(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(Q(314))}r!==null&&r.delete(t),oE(e,n)}var sE;sE=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||vn.current)bn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return bn=!1,l6(e,t,n);bn=!!(e.flags&131072)}else bn=!1,ot&&t.flags&1048576&&Ub(t,nd,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;yd(e,t),e=t.pendingProps;var i=jo(t,qt.current);Wo(t,n),i=Um(null,t,r,e,i,n);var a=Hm();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,wn(r)?(a=!0,Jc(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Om(t),i.updater=md,t.stateNode=i,i._reactInternals=t,qm(t,r,e,n),t=Qm(null,t,r,!0,a,n)):(t.tag=0,ot&&a&&Tm(t),cn(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(yd(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=_6(r),e=yr(r,e),i){case 0:t=Xm(null,t,r,e,n);break e;case 1:t=Ox(null,t,r,e,n);break e;case 11:t=kx(null,t,r,e,n);break e;case 14:t=Rx(null,t,r,yr(r.type,e),n);break e}throw Error(Q(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:yr(r,i),Xm(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:yr(r,i),Ox(e,t,r,i,n);case 3:e:{if(Dx(t),e===null)throw Error(Q(387));r=t.pendingProps,a=t.memoizedState,i=a.element,Kb(e,t),ud(t,r,null,n);var o=t.memoizedState;if(r=o.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=qo(Error(Q(423)),t),t=Lx(e,t,r,n,i);break e}else if(r!==i){i=qo(Error(Q(424)),t),t=Lx(e,t,r,n,i);break e}else for(Fn=Bi(t.stateNode.containerInfo.firstChild),Mn=t,ot=!0,gr=null,n=qb(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(zo(),r===i){t=ui(e,t,n);break e}cn(e,t,r,n)}t=t.child}return t;case 5:return Zb(t),e===null&&Cm(t),r=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,ym(r,i)?o=null:a!==null&&ym(r,a)&&(t.flags|=32),Ix(e,t),cn(e,t,o,n),t.child;case 6:return e===null&&Cm(t),null;case 13:return Mx(e,t,n);case 4:return Dm(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Vo(t,null,r,n):cn(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:yr(r,i),kx(e,t,r,i,n);case 7:return cn(e,t,t.pendingProps,n),t.child;case 8:return cn(e,t,t.pendingProps.children,n),t.child;case 12:return cn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,et(ad,r._currentValue),r._currentValue=o,a!==null)if(mr(a.value,o)){if(a.children===i.children&&!vn.current){t=ui(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var s=a.dependencies;if(s!==null){o=a.child;for(var u=s.firstContext;u!==null;){if(u.context===r){if(a.tag===1){u=si(-1,n&-n),u.tag=2;var l=a.updateQueue;if(l!==null){l=l.shared;var c=l.pending;c===null?u.next=u:(u.next=c.next,c.next=u),l.pending=u}}a.lanes|=n,u=a.alternate,u!==null&&(u.lanes|=n),Pm(a.return,n,t),s.lanes|=n;break}u=u.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(Q(341));o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),Pm(o,n,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}cn(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Wo(t,n),i=Jn(i),r=r(i),t.flags|=1,cn(e,t,r,n),t.child;case 14:return r=t.type,i=yr(r,t.pendingProps),i=yr(r.type,i),Rx(e,t,r,i,n);case 15:return Nx(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:yr(r,i),yd(e,t),t.tag=1,wn(r)?(e=!0,Jc(t)):e=!1,Wo(t,n),xx(t,r,i),qm(t,r,i,n),Qm(null,t,r,!0,e,n);case 19:return Bx(e,t,n);case 22:return Px(e,t,n)}throw Error(Q(156,t.tag))};function uE(e,t){return Hw(e,t)}function T6(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 nr(e,t,n,r){return new T6(e,t,n,r)}function yg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _6(e){if(typeof e=="function")return yg(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Th)return 11;if(e===Ch)return 14}return 2}function Ki(e,t){var n=e.alternate;return n===null?(n=nr(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 kd(e,t,n,r,i,a){var o=2;if(r=e,typeof e=="function")yg(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Co:return qa(n.children,i,a,t);case xh:o=8,i|=8;break;case Eh:return e=nr(12,n,t,i|2),e.elementType=Eh,e.lanes=a,e;case _h:return e=nr(13,n,t,i),e.elementType=_h,e.lanes=a,e;case Sh:return e=nr(19,n,t,i),e.elementType=Sh,e.lanes=a,e;case yw:return Rd(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case mw:o=10;break e;case gw:o=9;break e;case Th:o=11;break e;case Ch:o=14;break e;case Ni:o=16,r=null;break e}throw Error(Q(130,e==null?e:typeof e,""))}return t=nr(o,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function qa(e,t,n,r){return e=nr(7,e,r,t),e.lanes=n,e}function Rd(e,t,n,r){return e=nr(22,e,r,t),e.elementType=yw,e.lanes=n,e.stateNode={isHidden:!1},e}function vg(e,t,n){return e=nr(6,e,null,t),e.lanes=n,e}function wg(e,t,n){return t=nr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function S6(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=Yh(0),this.expirationTimes=Yh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yh(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function bg(e,t,n,r,i,a,o,s,u){return e=new S6(e,t,n,s,u),t===1?(t=1,a===!0&&(t|=8)):t=0,a=nr(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Om(a),e}function C6(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:So,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function lE(e){if(!e)return Ui;e=e._reactInternals;e:{if(La(e)!==e||e.tag!==1)throw Error(Q(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(wn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Q(171))}if(e.tag===1){var n=e.type;if(wn(n))return Fb(e,n,t)}return t}function cE(e,t,n,r,i,a,o,s,u){return e=bg(n,r,!0,e,i,a,o,s,u),e.context=lE(null),n=e.current,r=dn(),i=qi(n),a=si(r,i),a.callback=t??null,Vi(n,a,i),e.current.lanes=i,lu(e,i,r),En(e,r),e}function Nd(e,t,n,r){var i=t.current,a=dn(),o=qi(i);return n=lE(n),t.context===null?t.context=n:t.pendingContext=n,t=si(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Vi(i,t,o),e!==null&&(br(e,i,o,a),sd(e,i,o)),o}function Pd(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 dE(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function xg(e,t){dE(e,t),(e=e.alternate)&&dE(e,t)}function A6(){return null}var fE=typeof reportError=="function"?reportError:function(e){console.error(e)};function Eg(e){this._internalRoot=e}Id.prototype.render=Eg.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Q(409));Nd(e,t,null,null)},Id.prototype.unmount=Eg.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;$a(function(){Nd(null,e,null,null)}),t[ni]=null}};function Id(e){this._internalRoot=e}Id.prototype.unstable_scheduleHydration=function(e){if(e){var t=Kw();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Li.length&&t!==0&&t<Li[n].priority;n++);Li.splice(n,0,e),n===0&&Zw(e)}};function Tg(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Od(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function pE(){}function k6(e,t,n,r,i){if(i){if(typeof r=="function"){var a=r;r=function(){var l=Pd(o);a.call(l)}}var o=cE(t,r,e,0,null,!1,!1,"",pE);return e._reactRootContainer=o,e[ni]=o.current,Tu(e.nodeType===8?e.parentNode:e),$a(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var s=r;r=function(){var l=Pd(u);s.call(l)}}var u=bg(e,0,!1,null,null,!1,!1,"",pE);return e._reactRootContainer=u,e[ni]=u.current,Tu(e.nodeType===8?e.parentNode:e),$a(function(){Nd(t,u,n,r)}),u}function Dd(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i=="function"){var s=i;i=function(){var u=Pd(o);s.call(u)}}Nd(t,o,e,i)}else o=k6(n,t,e,i,r);return Pd(o)}qw=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=uu(t.pendingLanes);n!==0&&(qh(t,n|1),En(t,xt()),!(Ue&6)&&(Xo=xt()+500,Hi()))}break;case 13:$a(function(){var r=oi(e,1);if(r!==null){var i=dn();br(r,e,1,i)}}),xg(e,1)}},Gh=function(e){if(e.tag===13){var t=oi(e,134217728);if(t!==null){var n=dn();br(t,e,134217728,n)}xg(e,134217728)}},Gw=function(e){if(e.tag===13){var t=qi(e),n=oi(e,t);if(n!==null){var r=dn();br(n,e,t,r)}xg(e,t)}},Kw=function(){return qe},Xw=function(e,t){var n=qe;try{return qe=e,t()}finally{qe=n}},Uh=function(e,t,n){switch(t){case"input":if(Ih(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=Qc(r);if(!i)throw Error(Q(90));bw(r),Ih(r,i)}}}break;case"textarea":Sw(e,n);break;case"select":t=n.value,t!=null&&Ao(e,!!n.multiple,t,!1)}},Dw=hg,Lw=$a;var R6={usingClientEntryPoint:!1,Events:[Cu,Fo,Qc,Iw,Ow,hg]},Uu={findFiberByHostInstance:Ma,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},N6={bundleType:Uu.bundleType,version:Uu.version,rendererPackageName:Uu.rendererPackageName,rendererConfig:Uu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ti.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=jw(e),e===null?null:e.stateNode},findFiberByHostInstance:Uu.findFiberByHostInstance||A6,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 Ld=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ld.isDisabled&&Ld.supportsFiber)try{Ic=Ld.inject(N6),Or=Ld}catch{}}On.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=R6,On.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Tg(t))throw Error(Q(200));return C6(e,t,null,n)},On.createRoot=function(e,t){if(!Tg(e))throw Error(Q(299));var n=!1,r="",i=fE;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=bg(e,1,!1,null,null,n,!1,r,i),e[ni]=t.current,Tu(e.nodeType===8?e.parentNode:e),new Eg(t)},On.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(Q(188)):(e=Object.keys(e).join(","),Error(Q(268,e)));return e=jw(t),e=e===null?null:e.stateNode,e},On.flushSync=function(e){return $a(e)},On.hydrate=function(e,t,n){if(!Od(t))throw Error(Q(200));return Dd(null,e,t,!0,n)},On.hydrateRoot=function(e,t,n){if(!Tg(e))throw Error(Q(405));var r=n!=null&&n.hydratedSources||null,i=!1,a="",o=fE;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=cE(t,null,e,1,n??null,i,!1,a,o),e[ni]=t.current,Tu(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 Id(t)},On.render=function(e,t,n){if(!Od(t))throw Error(Q(200));return Dd(null,e,t,!1,n)},On.unmountComponentAtNode=function(e){if(!Od(e))throw Error(Q(40));return e._reactRootContainer?($a(function(){Dd(null,null,e,!1,function(){e._reactRootContainer=null,e[ni]=null})}),!0):!1},On.unstable_batchedUpdates=hg,On.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Od(n))throw Error(Q(200));if(e==null||e._reactInternals===void 0)throw Error(Q(38));return Dd(e,t,n,!1,r)},On.version="18.3.1-next-f1338f8080-20240426";function hE(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(hE)}catch(e){console.error(e)}}hE(),lw.exports=On;var Zo=lw.exports,mE,gE=Zo;mE=gE.createRoot,gE.hydrateRoot;const yE="3.0.14";function Md(e){"@babel/helpers - typeof";return Md=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Md(e)}var P6=/^\s+/,I6=/\s+$/;function fe(e,t){if(e=e||"",t=t||{},e instanceof fe)return e;if(!(this instanceof fe))return new fe(e,t);var n=O6(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}fe.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),n,r,i,a,o,s;return n=t.r/255,r=t.g/255,i=t.b/255,n<=.03928?a=n/12.92:a=Math.pow((n+.055)/1.055,2.4),r<=.03928?o=r/12.92:o=Math.pow((r+.055)/1.055,2.4),i<=.03928?s=i/12.92:s=Math.pow((i+.055)/1.055,2.4),.2126*a+.7152*o+.0722*s},setAlpha:function(t){return this._a=TE(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=wE(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=wE(this._r,this._g,this._b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.v*100);return this._a==1?"hsv("+n+", "+r+"%, "+i+"%)":"hsva("+n+", "+r+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var t=vE(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=vE(this._r,this._g,this._b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.l*100);return this._a==1?"hsl("+n+", "+r+"%, "+i+"%)":"hsla("+n+", "+r+"%, "+i+"%, "+this._roundA+")"},toHex:function(t){return bE(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return F6(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(st(this._r,255)*100)+"%",g:Math.round(st(this._g,255)*100)+"%",b:Math.round(st(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(st(this._r,255)*100)+"%, "+Math.round(st(this._g,255)*100)+"%, "+Math.round(st(this._b,255)*100)+"%)":"rgba("+Math.round(st(this._r,255)*100)+"%, "+Math.round(st(this._g,255)*100)+"%, "+Math.round(st(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:K6[bE(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var n="#"+xE(this._r,this._g,this._b,this._a),r=n,i=this._gradientType?"GradientType = 1, ":"";if(t){var a=fe(t);r="#"+xE(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+n+",endColorstr="+r+")"},toString:function(t){var n=!!t;t=t||this._format;var r=!1,i=this._a<1&&this._a>=0,a=!n&&i&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return a?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return fe(this.toString())},_applyModification:function(t,n){var r=t.apply(null,[this].concat([].slice.call(n)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(H6,arguments)},brighten:function(){return this._applyModification(z6,arguments)},darken:function(){return this._applyModification(V6,arguments)},desaturate:function(){return this._applyModification(B6,arguments)},saturate:function(){return this._applyModification(j6,arguments)},greyscale:function(){return this._applyModification(U6,arguments)},spin:function(){return this._applyModification($6,arguments)},_applyCombination:function(t,n){return t.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(q6,arguments)},complement:function(){return this._applyCombination(W6,arguments)},monochromatic:function(){return this._applyCombination(G6,arguments)},splitcomplement:function(){return this._applyCombination(Y6,arguments)},triad:function(){return this._applyCombination(EE,[3])},tetrad:function(){return this._applyCombination(EE,[4])}},fe.fromRatio=function(e,t){if(Md(e)=="object"){var n={};for(var r in e)e.hasOwnProperty(r)&&(r==="a"?n[r]=e[r]:n[r]=Hu(e[r]));e=n}return fe(e,t)};function O6(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,a=null,o=!1,s=!1;return typeof e=="string"&&(e=J6(e)),Md(e)=="object"&&(ci(e.r)&&ci(e.g)&&ci(e.b)?(t=D6(e.r,e.g,e.b),o=!0,s=String(e.r).substr(-1)==="%"?"prgb":"rgb"):ci(e.h)&&ci(e.s)&&ci(e.v)?(r=Hu(e.s),i=Hu(e.v),t=M6(e.h,r,i),o=!0,s="hsv"):ci(e.h)&&ci(e.s)&&ci(e.l)&&(r=Hu(e.s),a=Hu(e.l),t=L6(e.h,r,a),o=!0,s="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=TE(n),{ok:o,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}function D6(e,t,n){return{r:st(e,255)*255,g:st(t,255)*255,b:st(n,255)*255}}function vE(e,t,n){e=st(e,255),t=st(t,255),n=st(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),a,o,s=(r+i)/2;if(r==i)a=o=0;else{var u=r-i;switch(o=s>.5?u/(2-r-i):u/(r+i),r){case e:a=(t-n)/u+(t<n?6:0);break;case t:a=(n-e)/u+2;break;case n:a=(e-t)/u+4;break}a/=6}return{h:a,s:o,l:s}}function L6(e,t,n){var r,i,a;e=st(e,360),t=st(t,100),n=st(n,100);function o(l,c,d){return d<0&&(d+=1),d>1&&(d-=1),d<1/6?l+(c-l)*6*d:d<1/2?c:d<2/3?l+(c-l)*(2/3-d)*6:l}if(t===0)r=i=a=n;else{var s=n<.5?n*(1+t):n+t-n*t,u=2*n-s;r=o(u,s,e+1/3),i=o(u,s,e),a=o(u,s,e-1/3)}return{r:r*255,g:i*255,b:a*255}}function wE(e,t,n){e=st(e,255),t=st(t,255),n=st(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),a,o,s=r,u=r-i;if(o=r===0?0:u/r,r==i)a=0;else{switch(r){case e:a=(t-n)/u+(t<n?6:0);break;case t:a=(n-e)/u+2;break;case n:a=(e-t)/u+4;break}a/=6}return{h:a,s:o,v:s}}function M6(e,t,n){e=st(e,360)*6,t=st(t,100),n=st(n,100);var r=Math.floor(e),i=e-r,a=n*(1-t),o=n*(1-i*t),s=n*(1-(1-i)*t),u=r%6,l=[n,o,a,a,s,n][u],c=[s,n,n,o,a,a][u],d=[a,a,s,n,n,o][u];return{r:l*255,g:c*255,b:d*255}}function bE(e,t,n,r){var i=[xr(Math.round(e).toString(16)),xr(Math.round(t).toString(16)),xr(Math.round(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function F6(e,t,n,r,i){var a=[xr(Math.round(e).toString(16)),xr(Math.round(t).toString(16)),xr(Math.round(n).toString(16)),xr(_E(r))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function xE(e,t,n,r){var i=[xr(_E(r)),xr(Math.round(e).toString(16)),xr(Math.round(t).toString(16)),xr(Math.round(n).toString(16))];return i.join("")}fe.equals=function(e,t){return!e||!t?!1:fe(e).toRgbString()==fe(t).toRgbString()},fe.random=function(){return fe.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function B6(e,t){t=t===0?0:t||10;var n=fe(e).toHsl();return n.s-=t/100,n.s=Fd(n.s),fe(n)}function j6(e,t){t=t===0?0:t||10;var n=fe(e).toHsl();return n.s+=t/100,n.s=Fd(n.s),fe(n)}function U6(e){return fe(e).desaturate(100)}function H6(e,t){t=t===0?0:t||10;var n=fe(e).toHsl();return n.l+=t/100,n.l=Fd(n.l),fe(n)}function z6(e,t){t=t===0?0:t||10;var n=fe(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),fe(n)}function V6(e,t){t=t===0?0:t||10;var n=fe(e).toHsl();return n.l-=t/100,n.l=Fd(n.l),fe(n)}function $6(e,t){var n=fe(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,fe(n)}function W6(e){var t=fe(e).toHsl();return t.h=(t.h+180)%360,fe(t)}function EE(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var n=fe(e).toHsl(),r=[fe(e)],i=360/t,a=1;a<t;a++)r.push(fe({h:(n.h+a*i)%360,s:n.s,l:n.l}));return r}function Y6(e){var t=fe(e).toHsl(),n=t.h;return[fe(e),fe({h:(n+72)%360,s:t.s,l:t.l}),fe({h:(n+216)%360,s:t.s,l:t.l})]}function q6(e,t,n){t=t||6,n=n||30;var r=fe(e).toHsl(),i=360/n,a=[fe(e)];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,a.push(fe(r));return a}function G6(e,t){t=t||6;for(var n=fe(e).toHsv(),r=n.h,i=n.s,a=n.v,o=[],s=1/t;t--;)o.push(fe({h:r,s:i,v:a})),a=(a+s)%1;return o}fe.mix=function(e,t,n){n=n===0?0:n||50;var r=fe(e).toRgb(),i=fe(t).toRgb(),a=n/100,o={r:(i.r-r.r)*a+r.r,g:(i.g-r.g)*a+r.g,b:(i.b-r.b)*a+r.b,a:(i.a-r.a)*a+r.a};return fe(o)},fe.readability=function(e,t){var n=fe(e),r=fe(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)},fe.isReadable=function(e,t,n){var r=fe.readability(e,t),i,a;switch(a=!1,i=eL(n),i.level+i.size){case"AAsmall":case"AAAlarge":a=r>=4.5;break;case"AAlarge":a=r>=3;break;case"AAAsmall":a=r>=7;break}return a},fe.mostReadable=function(e,t,n){var r=null,i=0,a,o,s,u;n=n||{},o=n.includeFallbackColors,s=n.level,u=n.size;for(var l=0;l<t.length;l++)a=fe.readability(e,t[l]),a>i&&(i=a,r=fe(t[l]));return fe.isReadable(e,r,{level:s,size:u})||!o?r:(n.includeFallbackColors=!1,fe.mostReadable(e,["#fff","#000"],n))};var _g=fe.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},K6=fe.hexNames=X6(_g);function X6(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function TE(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function st(e,t){Q6(e)&&(e="100%");var n=Z6(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function Fd(e){return Math.min(1,Math.max(0,e))}function jn(e){return parseInt(e,16)}function Q6(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function Z6(e){return typeof e=="string"&&e.indexOf("%")!=-1}function xr(e){return e.length==1?"0"+e:""+e}function Hu(e){return e<=1&&(e=e*100+"%"),e}function _E(e){return Math.round(parseFloat(e)*255).toString(16)}function SE(e){return jn(e)/255}var Er=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",n="(?:"+t+")|(?:"+e+")",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",i="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function ci(e){return!!Er.CSS_UNIT.exec(e)}function J6(e){e=e.replace(P6,"").replace(I6,"").toLowerCase();var t=!1;if(_g[e])e=_g[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=Er.rgb.exec(e))?{r:n[1],g:n[2],b:n[3]}:(n=Er.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Er.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=Er.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Er.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=Er.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Er.hex8.exec(e))?{r:jn(n[1]),g:jn(n[2]),b:jn(n[3]),a:SE(n[4]),format:t?"name":"hex8"}:(n=Er.hex6.exec(e))?{r:jn(n[1]),g:jn(n[2]),b:jn(n[3]),format:t?"name":"hex"}:(n=Er.hex4.exec(e))?{r:jn(n[1]+""+n[1]),g:jn(n[2]+""+n[2]),b:jn(n[3]+""+n[3]),a:SE(n[4]+""+n[4]),format:t?"name":"hex8"}:(n=Er.hex3.exec(e))?{r:jn(n[1]+""+n[1]),g:jn(n[2]+""+n[2]),b:jn(n[3]+""+n[3]),format:t?"name":"hex"}:!1}function eL(e){var t,n;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:t,size:n}}const tL=400,CE=600,Bd={widgetMinHeight:"min-h-[400px]",widgetMaxHeight:"max-h-[600px]",widgetHeight:"h-[600px]"},AE=({primary:e="hsl(0, 0%, 0%)"})=>{const t=fe(e).toHsl(),n=fe(e).isLight()?"240 10% 3.9%":"0 0% 100%";return{"--opencx-primary":`${t.h} ${t.s*100}% ${t.l*100}%`,"--opencx-primary-foreground":n,"--opencx-background":"0 0% 100%","--opencx-foreground":"240 10% 3.9%","--opencx-accent":"240 4.8% 95.9%","--opencx-accent-foreground":"240 5.9% 10%","--opencx-destructive":"0 84.2% 60.2%","--opencx-destructive-foreground":"0 0% 98%","--opencx-secondary":"240 4.8% 95.9%","--opencx-secondary-foreground":"240 5.9% 10%","--opencx-muted":"240 4.8% 95.9%","--opencx-muted-foreground":"240 3.8% 46.1%","--opencx-input":"240 5.9% 90%","--opencx-border":"240 5.9% 90%","--opencx-ring":"240 5.9% 10%"}};function nL(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))})}function zu(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Sg=e=>Array.isArray(e);function kE(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}function Vu(e){return typeof e=="string"||Array.isArray(e)}function RE(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Cg(e,t,n,r){if(typeof t=="function"){const[i,a]=RE(r);t=t(n!==void 0?n:e.custom,i,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,a]=RE(r);t=t(n!==void 0?n:e.custom,i,a)}return t}function jd(e,t,n){const r=e.getProps();return Cg(r,t,n!==void 0?n:r.custom,e)}const Ag=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],kg=["initial",...Ag],$u=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Xi=new Set($u),di=e=>e*1e3,fi=e=>e/1e3,rL={type:"spring",stiffness:500,damping:25,restSpeed:10},iL=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),aL={type:"keyframes",duration:.8},oL={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},sL=(e,{keyframes:t})=>t.length>2?aL:Xi.has(e)?e.startsWith("scale")?iL(t[1]):rL:oL;function Rg(e,t){return e?e[t]||e.default||e:void 0}const uL={skipAnimations:!1,useManualTiming:!1},lL=e=>e!==null;function Ud(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(lL),a=t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const Qt=e=>e;function cL(e){let t=new Set,n=new Set,r=!1,i=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function s(l){a.has(l)&&(u.schedule(l),e()),l(o)}const u={schedule:(l,c=!1,d=!1)=>{const p=d&&r?t:n;return c&&a.add(l),p.has(l)||p.add(l),l},cancel:l=>{n.delete(l),a.delete(l)},process:l=>{if(o=l,r){i=!0;return}r=!0,[t,n]=[n,t],n.clear(),t.forEach(s),r=!1,i&&(i=!1,u.process(l))}};return u}const Hd=["read","resolveKeyframes","update","preRender","render","postRender"],dL=40;function NE(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Hd.reduce((y,w)=>(y[w]=cL(a),y),{}),{read:s,resolveKeyframes:u,update:l,preRender:c,render:d,postRender:f}=o,p=()=>{const y=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(y-i.timestamp,dL),1),i.timestamp=y,i.isProcessing=!0,s.process(i),u.process(i),l.process(i),c.process(i),d.process(i),f.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(p))},m=()=>{n=!0,r=!0,i.isProcessing||e(p)};return{schedule:Hd.reduce((y,w)=>{const b=o[w];return y[w]=(T,S=!1,_=!1)=>(n||m(),b.schedule(T,S,_)),y},{}),cancel:y=>{for(let w=0;w<Hd.length;w++)o[Hd[w]].cancel(y)},state:i,steps:o}}const{schedule:Xe,cancel:Qi,state:Vt,steps:Ng}=NE(typeof requestAnimationFrame<"u"?requestAnimationFrame:Qt,!0),PE=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,fL=1e-7,pL=12;function hL(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=PE(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>fL&&++s<pL);return o}function Wu(e,t,n,r){if(e===t&&n===r)return Qt;const i=a=>hL(a,0,1,e,n);return a=>a===0||a===1?a:PE(i(a),t,r)}const IE=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,OE=e=>t=>1-e(1-t),DE=Wu(.33,1.53,.69,.99),Pg=OE(DE),LE=IE(Pg),ME=e=>(e*=2)<1?.5*Pg(e):.5*(2-Math.pow(2,-10*(e-1))),Ig=e=>1-Math.sin(Math.acos(e)),FE=OE(Ig),BE=IE(Ig),jE=e=>/^0[^.\s]+$/u.test(e);function mL(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||jE(e):!0}let Og=Qt;const UE=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),HE=e=>t=>typeof t=="string"&&t.startsWith(e),zE=HE("--"),gL=HE("var(--"),Dg=e=>gL(e)?yL.test(e.split("/*")[0].trim()):!1,yL=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,vL=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function wL(e){const t=vL.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function VE(e,t,n=1){const[r,i]=wL(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const o=a.trim();return UE(o)?parseFloat(o):o}return Dg(i)?VE(i,t,n+1):i}const Zi=(e,t,n)=>n>t?t:n<e?e:n,Jo={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Yu={...Jo,transform:e=>Zi(0,1,e)},zd={...Jo,default:1},qu=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ji=qu("deg"),Br=qu("%"),ye=qu("px"),bL=qu("vh"),xL=qu("vw"),$E={...Br,parse:e=>Br.parse(e)/100,transform:e=>Br.transform(e*100)},EL=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),WE=e=>e===Jo||e===ye,YE=(e,t)=>parseFloat(e.split(", ")[t]),qE=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return YE(i[1],t);{const a=r.match(/^matrix\((.+)\)$/u);return a?YE(a[1],e):0}},TL=new Set(["x","y","z"]),_L=$u.filter(e=>!TL.has(e));function SL(e){const t=[];return _L.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const es={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:qE(4,13),y:qE(5,14)};es.translateX=es.x,es.translateY=es.y;const GE=e=>t=>t.test(e),KE=[Jo,ye,Br,Ji,xL,bL,{test:e=>e==="auto",parse:e=>e}],XE=e=>KE.find(GE(e)),Ga=new Set;let Lg=!1,Mg=!1;function QE(){if(Mg){const e=Array.from(Ga).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=SL(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(([a,o])=>{var s;(s=r.getValue(a))===null||s===void 0||s.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Mg=!1,Lg=!1,Ga.forEach(e=>e.complete()),Ga.clear()}function ZE(){Ga.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Mg=!0)})}function CL(){ZE(),QE()}class Fg{constructor(t,n,r,i,a,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=a,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ga.add(this),Lg||(Lg=!0,Xe.read(ZE),Xe.resolveKeyframes(QE))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let a=0;a<t.length;a++)if(t[a]===null)if(a===0){const o=i==null?void 0:i.get(),s=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const u=r.readValue(n,s);u!=null&&(t[0]=u)}t[0]===void 0&&(t[0]=s),i&&o===void 0&&i.set(t[0])}else t[a]=t[a-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ga.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ga.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Gu=e=>Math.round(e*1e5)/1e5,Bg=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function AL(e){return e==null}const kL=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,jg=(e,t)=>n=>!!(typeof n=="string"&&kL.test(n)&&n.startsWith(e)||t&&!AL(n)&&Object.prototype.hasOwnProperty.call(n,t)),JE=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,a,o,s]=r.match(Bg);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s!==void 0?parseFloat(s):1}},RL=e=>Zi(0,255,e),Ug={...Jo,transform:e=>Math.round(RL(e))},Ka={test:jg("rgb","red"),parse:JE("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Ug.transform(e)+", "+Ug.transform(t)+", "+Ug.transform(n)+", "+Gu(Yu.transform(r))+")"};function NL(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 Hg={test:jg("#"),parse:NL,transform:Ka.transform},ts={test:jg("hsl","hue"),parse:JE("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Br.transform(Gu(t))+", "+Br.transform(Gu(n))+", "+Gu(Yu.transform(r))+")"},Zt={test:e=>Ka.test(e)||Hg.test(e)||ts.test(e),parse:e=>Ka.test(e)?Ka.parse(e):ts.test(e)?ts.parse(e):Hg.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ka.transform(e):ts.transform(e)},PL=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function IL(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Bg))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(PL))===null||n===void 0?void 0:n.length)||0)>0}const eT="number",tT="color",OL="var",DL="var(",nT="${}",LL=/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 Ku(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let a=0;const s=t.replace(LL,u=>(Zt.test(u)?(r.color.push(a),i.push(tT),n.push(Zt.parse(u))):u.startsWith(DL)?(r.var.push(a),i.push(OL),n.push(u)):(r.number.push(a),i.push(eT),n.push(parseFloat(u))),++a,nT)).split(nT);return{values:n,split:s,indexes:r,types:i}}function rT(e){return Ku(e).values}function iT(e){const{split:t,types:n}=Ku(e),r=t.length;return i=>{let a="";for(let o=0;o<r;o++)if(a+=t[o],i[o]!==void 0){const s=n[o];s===eT?a+=Gu(i[o]):s===tT?a+=Zt.transform(i[o]):a+=i[o]}return a}}const ML=e=>typeof e=="number"?0:e;function FL(e){const t=rT(e);return iT(e)(t.map(ML))}const ea={test:IL,parse:rT,createTransformer:iT,getAnimatableNone:FL},BL=new Set(["brightness","contrast","saturate","opacity"]);function jL(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Bg)||[];if(!r)return e;const i=n.replace(r,"");let a=BL.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+i+")"}const UL=/\b([a-z-]*)\(.*?\)/gu,zg={...ea,getAnimatableNone:e=>{const t=e.match(UL);return t?t.map(jL).join(" "):e}},HL={borderWidth:ye,borderTopWidth:ye,borderRightWidth:ye,borderBottomWidth:ye,borderLeftWidth:ye,borderRadius:ye,radius:ye,borderTopLeftRadius:ye,borderTopRightRadius:ye,borderBottomRightRadius:ye,borderBottomLeftRadius:ye,width:ye,maxWidth:ye,height:ye,maxHeight:ye,top:ye,right:ye,bottom:ye,left:ye,padding:ye,paddingTop:ye,paddingRight:ye,paddingBottom:ye,paddingLeft:ye,margin:ye,marginTop:ye,marginRight:ye,marginBottom:ye,marginLeft:ye,backgroundPositionX:ye,backgroundPositionY:ye},zL={rotate:Ji,rotateX:Ji,rotateY:Ji,rotateZ:Ji,scale:zd,scaleX:zd,scaleY:zd,scaleZ:zd,skew:Ji,skewX:Ji,skewY:Ji,distance:ye,translateX:ye,translateY:ye,translateZ:ye,x:ye,y:ye,z:ye,perspective:ye,transformPerspective:ye,opacity:Yu,originX:$E,originY:$E,originZ:ye},aT={...Jo,transform:Math.round},Vg={...HL,...zL,zIndex:aT,size:ye,fillOpacity:Yu,strokeOpacity:Yu,numOctaves:aT},VL={...Vg,color:Zt,backgroundColor:Zt,outlineColor:Zt,fill:Zt,stroke:Zt,borderColor:Zt,borderTopColor:Zt,borderRightColor:Zt,borderBottomColor:Zt,borderLeftColor:Zt,filter:zg,WebkitFilter:zg},$g=e=>VL[e];function oT(e,t){let n=$g(e);return n!==zg&&(n=ea),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const $L=new Set(["auto","none","0"]);function WL(e,t,n){let r=0,i;for(;r<e.length&&!i;){const a=e[r];typeof a=="string"&&!$L.has(a)&&Ku(a).values.length&&(i=e[r]),r++}if(i&&n)for(const a of t)e[a]=oT(n,i)}class sT extends Fg{constructor(t,n,r,i,a){super(t,n,r,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<t.length;u++){let l=t[u];if(typeof l=="string"&&(l=l.trim(),Dg(l))){const c=VE(l,n.current);c!==void 0&&(t[u]=c),u===t.length-1&&(this.finalKeyframe=l)}}if(this.resolveNoneKeyframes(),!EL.has(r)||t.length!==2)return;const[i,a]=t,o=XE(i),s=XE(a);if(o!==s)if(WE(o)&&WE(s))for(let u=0;u<t.length;u++){const l=t[u];typeof l=="string"&&(t[u]=parseFloat(l))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)mL(t[i])&&r.push(i);r.length&&WL(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=es[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 t;const{element:n,name:r,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const a=n.getValue(r);a&&a.jump(this.measuredOrigin,!1);const o=i.length-1,s=i[o];i[o]=es[r](n.measureViewportBox(),window.getComputedStyle(n.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([u,l])=>{n.getValue(u).set(l)}),this.resolveNoneKeyframes()}}function Wg(e){return typeof e=="function"}let Vd;function YL(){Vd=void 0}const jr={now:()=>(Vd===void 0&&jr.set(Vt.isProcessing||uL.useManualTiming?Vt.timestamp:performance.now()),Vd),set:e=>{Vd=e,queueMicrotask(YL)}},uT=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ea.test(e)||e==="0")&&!e.startsWith("url("));function qL(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 GL(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],o=uT(i,t),s=uT(a,t);return!o||!s?!1:qL(e)||(n==="spring"||Wg(n))&&r}const KL=40;class lT{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:o="loop",...s}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=jr.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:a,repeatType:o,...s},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>KL?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&CL(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=jr.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:a,delay:o,onComplete:s,onUpdate:u,isGenerator:l}=this.options;if(!l&&!GL(t,r,i,a))if(o)this.options.duration=0;else{u==null||u(Ud(t,this.options,n)),s==null||s(),this.resolveFinishedPromise();return}const c=this.initPlayback(t,n);c!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...c},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}function cT(e,t){return t?e*(1e3/t):0}const XL=5;function dT(e,t,n){const r=Math.max(t-XL,0);return cT(n-e(r),t-r)}const Yg=.001,QL=.01,ZL=10,JL=.05,e4=1;function t4({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,a,o=1-t;o=Zi(JL,e4,o),e=Zi(QL,ZL,fi(e)),o<1?(i=l=>{const c=l*o,d=c*e,f=c-n,p=qg(l,o),m=Math.exp(-d);return Yg-f/p*m},a=l=>{const d=l*o*e,f=d*n+n,p=Math.pow(o,2)*Math.pow(l,2)*e,m=Math.exp(-d),g=qg(Math.pow(l,2),o);return(-i(l)+Yg>0?-1:1)*((f-p)*m)/g}):(i=l=>{const c=Math.exp(-l*e),d=(l-n)*e+1;return-Yg+c*d},a=l=>{const c=Math.exp(-l*e),d=(n-l)*(e*e);return c*d});const s=5/e,u=r4(i,a,s);if(e=di(e),isNaN(u))return{stiffness:100,damping:10,duration:e};{const l=Math.pow(u,2)*r;return{stiffness:l,damping:o*2*Math.sqrt(r*l),duration:e}}}const n4=12;function r4(e,t,n){let r=n;for(let i=1;i<n4;i++)r=r-e(r)/t(r);return r}function qg(e,t){return e*Math.sqrt(1-t*t)}const i4=["duration","bounce"],a4=["stiffness","damping","mass"];function fT(e,t){return t.some(n=>e[n]!==void 0)}function o4(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!fT(e,a4)&&fT(e,i4)){const n=t4(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}function pT({keyframes:e,restDelta:t,restSpeed:n,...r}){const i=e[0],a=e[e.length-1],o={done:!1,value:i},{stiffness:s,damping:u,mass:l,duration:c,velocity:d,isResolvedFromDuration:f}=o4({...r,velocity:-fi(r.velocity||0)}),p=d||0,m=u/(2*Math.sqrt(s*l)),g=a-i,x=fi(Math.sqrt(s/l)),y=Math.abs(g)<5;n||(n=y?.01:2),t||(t=y?.005:.5);let w;if(m<1){const b=qg(x,m);w=T=>{const S=Math.exp(-m*x*T);return a-S*((p+m*x*g)/b*Math.sin(b*T)+g*Math.cos(b*T))}}else if(m===1)w=b=>a-Math.exp(-x*b)*(g+(p+x*g)*b);else{const b=x*Math.sqrt(m*m-1);w=T=>{const S=Math.exp(-m*x*T),_=Math.min(b*T,300);return a-S*((p+m*x*g)*Math.sinh(_)+b*g*Math.cosh(_))/b}}return{calculatedDuration:f&&c||null,next:b=>{const T=w(b);if(f)o.done=b>=c;else{let S=0;m<1&&(S=b===0?di(p):dT(w,b,T));const _=Math.abs(S)<=n,N=Math.abs(a-T)<=t;o.done=_&&N}return o.value=o.done?a:T,o}}}function hT({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:u,restDelta:l=.5,restSpeed:c}){const d=e[0],f={done:!1,value:d},p=D=>s!==void 0&&D<s||u!==void 0&&D>u,m=D=>s===void 0?u:u===void 0||Math.abs(s-D)<Math.abs(u-D)?s:u;let g=n*t;const x=d+g,y=o===void 0?x:o(x);y!==x&&(g=y-d);const w=D=>-g*Math.exp(-D/r),b=D=>y+w(D),T=D=>{const V=w(D),P=b(D);f.done=Math.abs(V)<=l,f.value=f.done?y:P};let S,_;const N=D=>{p(f.value)&&(S=D,_=pT({keyframes:[f.value,m(f.value)],velocity:dT(b,D,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:c}))};return N(0),{calculatedDuration:null,next:D=>{let V=!1;return!_&&S===void 0&&(V=!0,T(D),N(D)),S!==void 0&&D>=S?_.next(D-S):(!V&&T(D),f)}}}const s4=Wu(.42,0,1,1),u4=Wu(0,0,.58,1),mT=Wu(.42,0,.58,1),l4=e=>Array.isArray(e)&&typeof e[0]!="number",Gg=e=>Array.isArray(e)&&typeof e[0]=="number",gT={linear:Qt,easeIn:s4,easeInOut:mT,easeOut:u4,circIn:Ig,circInOut:BE,circOut:FE,backIn:Pg,backInOut:LE,backOut:DE,anticipate:ME},yT=e=>{if(Gg(e)){Og(e.length===4);const[t,n,r,i]=e;return Wu(t,n,r,i)}else if(typeof e=="string")return Og(gT[e]!==void 0),gT[e];return e},c4=(e,t)=>n=>t(e(n)),pi=(...e)=>e.reduce(c4),ns=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},pt=(e,t,n)=>e+(t-e)*n;function Kg(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 d4({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{const s=n<.5?n*(1+t):n+t-n*t,u=2*n-s;i=Kg(u,s,e+1/3),a=Kg(u,s,e),o=Kg(u,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function $d(e,t){return n=>n>0?t:e}const Xg=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},f4=[Hg,Ka,ts],p4=e=>f4.find(t=>t.test(e));function vT(e){const t=p4(e);if(!t)return!1;let n=t.parse(e);return t===ts&&(n=d4(n)),n}const wT=(e,t)=>{const n=vT(e),r=vT(t);if(!n||!r)return $d(e,t);const i={...n};return a=>(i.red=Xg(n.red,r.red,a),i.green=Xg(n.green,r.green,a),i.blue=Xg(n.blue,r.blue,a),i.alpha=pt(n.alpha,r.alpha,a),Ka.transform(i))},Qg=new Set(["none","hidden"]);function h4(e,t){return Qg.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function m4(e,t){return n=>pt(e,t,n)}function Zg(e){return typeof e=="number"?m4:typeof e=="string"?Dg(e)?$d:Zt.test(e)?wT:v4:Array.isArray(e)?bT:typeof e=="object"?Zt.test(e)?wT:g4:$d}function bT(e,t){const n=[...e],r=n.length,i=e.map((a,o)=>Zg(a)(a,t[o]));return a=>{for(let o=0;o<r;o++)n[o]=i[o](a);return n}}function g4(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Zg(e[i])(e[i],t[i]));return i=>{for(const a in r)n[a]=r[a](i);return n}}function y4(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const o=t.types[a],s=e.indexes[o][i[o]],u=(n=e.values[s])!==null&&n!==void 0?n:0;r[a]=u,i[o]++}return r}const v4=(e,t)=>{const n=ea.createTransformer(t),r=Ku(e),i=Ku(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?Qg.has(e)&&!i.values.length||Qg.has(t)&&!r.values.length?h4(e,t):pi(bT(y4(r,i),i.values),n):$d(e,t)};function xT(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?pt(e,t,n):Zg(e)(e,t)}function w4(e,t,n){const r=[],i=n||xT,a=e.length-1;for(let o=0;o<a;o++){let s=i(e[o],e[o+1]);if(t){const u=Array.isArray(t)?t[o]||Qt:t;s=pi(u,s)}r.push(s)}return r}function b4(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const a=e.length;if(Og(a===t.length),a===1)return()=>t[0];if(a===2&&e[0]===e[1])return()=>t[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=w4(t,r,i),s=o.length,u=l=>{let c=0;if(s>1)for(;c<e.length-2&&!(l<e[c+1]);c++);const d=ns(e[c],e[c+1],l);return o[c](d)};return n?l=>u(Zi(e[0],e[a-1],l)):u}function x4(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=ns(0,t,r);e.push(pt(n,1,i))}}function E4(e){const t=[0];return x4(t,e.length-1),t}function T4(e,t){return e.map(n=>n*t)}function _4(e,t){return e.map(()=>t||mT).splice(0,e.length-1)}function Wd({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=l4(r)?r.map(yT):yT(r),a={done:!1,value:t[0]},o=T4(n&&n.length===t.length?n:E4(t),e),s=b4(o,t,{ease:Array.isArray(i)?i:_4(t,i)});return{calculatedDuration:e,next:u=>(a.value=s(u),a.done=u>=e,a)}}const ET=2e4;function S4(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<ET;)t+=n,r=e.next(t);return t>=ET?1/0:t}const C4=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Xe.update(t,!0),stop:()=>Qi(t),now:()=>Vt.isProcessing?Vt.timestamp:jr.now()}},A4={decay:hT,inertia:hT,tween:Wd,keyframes:Wd,spring:pT},k4=e=>e/100;class Jg extends lT{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:u}=this.options;u&&u()};const{name:n,motionValue:r,element:i,keyframes:a}=this.options,o=(i==null?void 0:i.KeyframeResolver)||Fg,s=(u,l)=>this.onKeyframesResolved(u,l);this.resolver=new o(a,s,n,r,i),this.resolver.scheduleResolve()}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:a,velocity:o=0}=this.options,s=Wg(n)?n:A4[n]||Wd;let u,l;s!==Wd&&typeof t[0]!="number"&&(u=pi(k4,xT(t[0],t[1])),t=[0,100]);const c=s({...this.options,keyframes:t});a==="mirror"&&(l=s({...this.options,keyframes:[...t].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=S4(c));const{calculatedDuration:d}=c,f=d+i,p=f*(r+1)-i;return{generator:c,mirroredGenerator:l,mapPercentToKeyframes:u,calculatedDuration:d,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:D}=this.options;return{done:!0,value:D[D.length-1]}}const{finalKeyframe:i,generator:a,mirroredGenerator:o,mapPercentToKeyframes:s,keyframes:u,calculatedDuration:l,totalDuration:c,resolvedDuration:d}=r;if(this.startTime===null)return a.next(0);const{delay:f,repeat:p,repeatType:m,repeatDelay:g,onUpdate:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-c/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 y=this.currentTime-f*(this.speed>=0?1:-1),w=this.speed>=0?y<0:y>c;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let b=this.currentTime,T=a;if(p){const D=Math.min(this.currentTime,c)/d;let V=Math.floor(D),P=D%1;!P&&D>=1&&(P=1),P===1&&V--,V=Math.min(V,p+1),!!(V%2)&&(m==="reverse"?(P=1-P,g&&(P-=g/d)):m==="mirror"&&(T=o)),b=Zi(0,1,P)*d}const S=w?{done:!1,value:u[0]}:T.next(b);s&&(S.value=s(S.value));let{done:_}=S;!w&&l!==null&&(_=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const N=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&_);return N&&i!==void 0&&(S.value=Ud(u,this.options,i)),x&&x(S.value),N&&this.finish(),S}get duration(){const{resolved:t}=this;return t?fi(t.calculatedDuration):0}get time(){return fi(this.currentTime)}set time(t){t=di(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=fi(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=C4,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),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(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t: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)}}const TT=new Set(["opacity","clipPath","filter","transform"]),R4=10,N4=(e,t)=>{let n="";const r=Math.max(Math.round(t/R4),2);for(let i=0;i<r;i++)n+=e(ns(0,r-1,i))+", ";return`linear(${n.substring(0,n.length-2)})`};function e0(e){let t;return()=>(t===void 0&&(t=e()),t)}const P4={linearEasing:void 0};function I4(e,t){const n=e0(e);return()=>{var r;return(r=P4[t])!==null&&r!==void 0?r:n()}}const Yd=I4(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");function _T(e){return!!(typeof e=="function"&&Yd()||!e||typeof e=="string"&&(e in t0||Yd())||Gg(e)||Array.isArray(e)&&e.every(_T))}const Xu=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,t0={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Xu([0,.65,.55,1]),circOut:Xu([.55,0,1,.45]),backIn:Xu([.31,.01,.66,-.59]),backOut:Xu([.33,1.53,.69,.99])};function ST(e,t){if(e)return typeof e=="function"&&Yd()?N4(e,t):Gg(e)?Xu(e):Array.isArray(e)?e.map(n=>ST(n,t)||t0.easeOut):t0[e]}function O4(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o="loop",ease:s,times:u}={}){const l={[t]:n};u&&(l.offset=u);const c=ST(s,i);return Array.isArray(c)&&(l.easing=c),e.animate(l,{delay:r,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"})}function CT(e,t){e.timeline=t,e.onfinish=null}const D4=e0(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),qd=10,L4=2e4;function M4(e){return Wg(e.type)||e.type==="spring"||!_T(e.ease)}function F4(e,t){const n=new Jg({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let a=0;for(;!r.done&&a<L4;)r=n.sample(a),i.push(r.value),a+=qd;return{times:void 0,keyframes:i,duration:a-qd,ease:"linear"}}const AT={anticipate:ME,backInOut:LE,circInOut:BE};function B4(e){return e in AT}class kT extends lT{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:a}=this.options;this.resolver=new sT(a,(o,s)=>this.onKeyframesResolved(o,s),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){var r;let{duration:i=300,times:a,ease:o,type:s,motionValue:u,name:l,startTime:c}=this.options;if(!(!((r=u.owner)===null||r===void 0)&&r.current))return!1;if(typeof o=="string"&&Yd()&&B4(o)&&(o=AT[o]),M4(this.options)){const{onComplete:f,onUpdate:p,motionValue:m,element:g,...x}=this.options,y=F4(t,x);t=y.keyframes,t.length===1&&(t[1]=t[0]),i=y.duration,a=y.times,o=y.ease,s="keyframes"}const d=O4(u.owner.current,l,t,{...this.options,duration:i,times:a,ease:o});return d.startTime=c??this.calcStartTime(),this.pendingTimeline?(CT(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;u.set(Ud(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:i,times:a,type:s,ease:o,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return fi(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return fi(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=di(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}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 Qt;const{animation:r}=n;CT(r,t)}return Qt}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:a,ease:o,times:s}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:l,onUpdate:c,onComplete:d,element:f,...p}=this.options,m=new Jg({...p,keyframes:r,duration:i,type:a,ease:o,times:s,isGenerator:!0}),g=di(this.time);l.setWithVelocity(m.sample(g-qd).value,m.sample(g).value,qd)}const{onStop:u}=this.options;u&&u(),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:a,damping:o,type:s}=t;return D4()&&r&&TT.has(r)&&n&&n.owner&&n.owner.current instanceof HTMLElement&&!n.owner.getProps().onUpdate&&!i&&a!=="mirror"&&o!==0&&s!=="inertia"}}const j4=e0(()=>window.ScrollTimeline!==void 0);class U4{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}then(t,n){return Promise.all(this.animations).then(t).catch(n)}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=>j4()&&i.attachTimeline?i.attachTimeline(t):n(i));return()=>{r.forEach((i,a)=>{i&&i(),this.animations[a].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]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function H4({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:s,from:u,elapsed:l,...c}){return!!Object.keys(c).length}const n0=(e,t,n,r={},i,a)=>o=>{const s=Rg(r,e)||{},u=s.delay||r.delay||0;let{elapsed:l=0}=r;l=l-di(u);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-l,onUpdate:f=>{t.set(f),s.onUpdate&&s.onUpdate(f)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};H4(s)||(c={...c,...sL(e,c)}),c.duration&&(c.duration=di(c.duration)),c.repeatDelay&&(c.repeatDelay=di(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let d=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(d=!0)),d&&!a&&t.get()!==void 0){const f=Ud(c.keyframes,s);if(f!==void 0)return Xe.update(()=>{c.onUpdate(f),c.onComplete()}),new U4([])}return!a&&kT.supports(c)?new kT(c):new Jg(c)},z4=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),V4=e=>Sg(e)?e[e.length-1]||0:e;function r0(e,t){e.indexOf(t)===-1&&e.push(t)}function i0(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class a0{constructor(){this.subscriptions=[]}add(t){return r0(this.subscriptions,t),()=>i0(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 a=0;a<i;a++){const o=this.subscriptions[a];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const RT=30,$4=e=>!isNaN(parseFloat(e));class W4{constructor(t,n={}){this.version="11.11.9",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const a=jr.now();this.updatedAt!==a&&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=jr.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=$4(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 a0);const r=this.events[t].add(n);return t==="change"?()=>{r(),Xe.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=jr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>RT)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,RT);return cT(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 Qu(e,t){return new W4(e,t)}function Y4(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Qu(n))}function q4(e,t){const n=jd(e,t);let{transitionEnd:r={},transition:i={},...a}=n||{};a={...a,...r};for(const o in a){const s=V4(a[o]);Y4(e,o,s)}}const Gd=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),NT="data-"+Gd("framerAppearId");function PT(e){return e.props[NT]}const Jt=e=>!!(e&&e.getVelocity);function G4(e){return!!(Jt(e)&&e.add)}function o0(e,t){if(!e.applyWillChange)return;const n=e.getValue("willChange");if(G4(n))return n.add(t)}function K4({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function IT(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var a;let{transition:o=e.getDefaultTransition(),transitionEnd:s,...u}=t;r&&(o=r);const l=[],c=i&&e.animationState&&e.animationState.getState()[i];for(const d in u){const f=e.getValue(d,(a=e.latestValues[d])!==null&&a!==void 0?a:null),p=u[d];if(p===void 0||c&&K4(c,d))continue;const m={delay:n,...Rg(o||{},d)};let g=!1;if(window.MotionHandoffAnimation){const y=PT(e);if(y){const w=window.MotionHandoffAnimation(y,d,Xe);w!==null&&(m.startTime=w,g=!0)}}o0(e,d),f.start(n0(d,f,p,e.shouldReduceMotion&&Xi.has(d)?{type:!1}:m,e,g));const x=f.animation;x&&l.push(x)}return s&&Promise.all(l).then(()=>{Xe.update(()=>{s&&q4(e,s)})}),l}function s0(e,t,n={}){var r;const i=jd(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(a=n.transitionOverride);const o=i?()=>Promise.all(IT(e,i,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:d,staggerDirection:f}=a;return X4(e,t,c+l,d,f,n)}:()=>Promise.resolve(),{when:u}=a;if(u){const[l,c]=u==="beforeChildren"?[o,s]:[s,o];return l().then(()=>c())}else return Promise.all([o(),s(n.delay)])}function X4(e,t,n=0,r=0,i=1,a){const o=[],s=(e.variantChildren.size-1)*r,u=i===1?(l=0)=>l*r:(l=0)=>s-l*r;return Array.from(e.variantChildren).sort(Q4).forEach((l,c)=>{l.notify("AnimationStart",t),o.push(s0(l,t,{...a,delay:n+u(c)}).then(()=>l.notify("AnimationComplete",t)))}),Promise.all(o)}function Q4(e,t){return e.sortNodePosition(t)}function Z4(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(a=>s0(e,a,n));r=Promise.all(i)}else if(typeof t=="string")r=s0(e,t,n);else{const i=typeof t=="function"?jd(e,t,n.custom):t;r=Promise.all(IT(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const J4=kg.length;function OT(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?OT(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<J4;n++){const r=kg[n],i=e.props[r];(Vu(i)||i===!1)&&(t[r]=i)}return t}const eM=[...Ag].reverse(),tM=Ag.length;function nM(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Z4(e,n,r)))}function rM(e){let t=nM(e),n=DT(),r=!0;const i=u=>(l,c)=>{var d;const f=jd(e,c,u==="exit"?(d=e.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(f){const{transition:p,transitionEnd:m,...g}=f;l={...l,...g,...m}}return l};function a(u){t=u(e)}function o(u){const{props:l}=e,c=OT(e.parent)||{},d=[],f=new Set;let p={},m=1/0;for(let x=0;x<tM;x++){const y=eM[x],w=n[y],b=l[y]!==void 0?l[y]:c[y],T=Vu(b),S=y===u?w.isActive:null;S===!1&&(m=x);let _=b===c[y]&&b!==l[y]&&T;if(_&&r&&e.manuallyAnimateOnMount&&(_=!1),w.protectedKeys={...p},!w.isActive&&S===null||!b&&!w.prevProp||zu(b)||typeof b=="boolean")continue;const N=iM(w.prevProp,b);let D=N||y===u&&w.isActive&&!_&&T||x>m&&T,V=!1;const P=Array.isArray(b)?b:[b];let $=P.reduce(i(y),{});S===!1&&($={});const{prevResolvedValues:H={}}=w,X={...H,...$},Y=ee=>{D=!0,f.has(ee)&&(V=!0,f.delete(ee)),w.needsAnimating[ee]=!0;const F=e.getValue(ee);F&&(F.liveStyle=!1)};for(const ee in X){const F=$[ee],B=H[ee];if(p.hasOwnProperty(ee))continue;let A=!1;Sg(F)&&Sg(B)?A=!kE(F,B):A=F!==B,A?F!=null?Y(ee):f.add(ee):F!==void 0&&f.has(ee)?Y(ee):w.protectedKeys[ee]=!0}w.prevProp=b,w.prevResolvedValues=$,w.isActive&&(p={...p,...$}),r&&e.blockInitialAnimation&&(D=!1),D&&(!(_&&N)||V)&&d.push(...P.map(ee=>({animation:ee,options:{type:y}})))}if(f.size){const x={};f.forEach(y=>{const w=e.getBaseTarget(y),b=e.getValue(y);b&&(b.liveStyle=!0),x[y]=w??null}),d.push({animation:x})}let g=!!d.length;return r&&(l.initial===!1||l.initial===l.animate)&&!e.manuallyAnimateOnMount&&(g=!1),r=!1,g?t(d):Promise.resolve()}function s(u,l){var c;if(n[u].isActive===l)return Promise.resolve();(c=e.variantChildren)===null||c===void 0||c.forEach(f=>{var p;return(p=f.animationState)===null||p===void 0?void 0:p.setActive(u,l)}),n[u].isActive=l;const d=o(u);for(const f in n)n[f].protectedKeys={};return d}return{animateChanges:o,setActive:s,setAnimateFunction:a,getState:()=>n,reset:()=>{n=DT(),r=!0}}}function iM(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!kE(t,e):!1}function Xa(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function DT(){return{animate:Xa(!0),whileInView:Xa(),whileHover:Xa(),whileTap:Xa(),whileDrag:Xa(),whileFocus:Xa(),exit:Xa()}}class ta{constructor(t){this.isMounted=!1,this.node=t}update(){}}class aM extends ta{constructor(t){super(t),t.animationState||(t.animationState=rM(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();zu(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===void 0||t.call(this)}}let oM=0;class sM extends ta{constructor(){super(...arguments),this.id=oM++}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}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const uM={animation:{Feature:aM},exit:{Feature:sM}},LT=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Kd(e,t="page"){return{point:{x:e[`${t}X`],y:e[`${t}Y`]}}}const lM=e=>t=>LT(t)&&e(t,Kd(t));function hi(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function mi(e,t,n,r){return hi(e,t,lM(n),r)}const MT=(e,t)=>Math.abs(e-t);function cM(e,t){const n=MT(e.x,t.x),r=MT(e.y,t.y);return Math.sqrt(n**2+r**2)}class FT{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:a=!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 d=l0(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,p=cM(d.offset,{x:0,y:0})>=3;if(!f&&!p)return;const{point:m}=d,{timestamp:g}=Vt;this.history.push({...m,timestamp:g});const{onStart:x,onMove:y}=this.handlers;f||(x&&x(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=u0(f,this.transformPagePoint),Xe.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();const{onEnd:p,onSessionEnd:m,resumeAnimation:g}=this.handlers;if(this.dragSnapToOrigin&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=l0(d.type==="pointercancel"?this.lastMoveEventInfo:u0(f,this.transformPagePoint),this.history);this.startEvent&&p&&p(d,x),m&&m(d,x)},!LT(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=Kd(t),s=u0(o,this.transformPagePoint),{point:u}=s,{timestamp:l}=Vt;this.history=[{...u,timestamp:l}];const{onSessionStart:c}=n;c&&c(t,l0(s,this.history)),this.removeListeners=pi(mi(this.contextWindow,"pointermove",this.handlePointerMove),mi(this.contextWindow,"pointerup",this.handlePointerUp),mi(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Qi(this.updatePoint)}}function u0(e,t){return t?{point:t(e.point)}:e}function BT(e,t){return{x:e.x-t.x,y:e.y-t.y}}function l0({point:e},t){return{point:e,delta:BT(e,jT(t)),offset:BT(e,dM(t)),velocity:fM(t,.1)}}function dM(e){return e[0]}function jT(e){return e[e.length-1]}function fM(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=jT(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>di(t)));)n--;if(!r)return{x:0,y:0};const a=fi(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};const o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function UT(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const HT=UT("dragHorizontal"),zT=UT("dragVertical");function VT(e){let t=!1;if(e==="y")t=zT();else if(e==="x")t=HT();else{const n=HT(),r=zT();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function $T(){const e=VT(!0);return e?(e(),!1):!0}function rs(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}const WT=1e-4,pM=1-WT,hM=1+WT,YT=.01,mM=0-YT,gM=0+YT;function Un(e){return e.max-e.min}function yM(e,t,n){return Math.abs(e-t)<=n}function qT(e,t,n,r=.5){e.origin=r,e.originPoint=pt(t.min,t.max,e.origin),e.scale=Un(n)/Un(t),e.translate=pt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=pM&&e.scale<=hM||isNaN(e.scale))&&(e.scale=1),(e.translate>=mM&&e.translate<=gM||isNaN(e.translate))&&(e.translate=0)}function Zu(e,t,n,r){qT(e.x,t.x,n.x,r?r.originX:void 0),qT(e.y,t.y,n.y,r?r.originY:void 0)}function GT(e,t,n){e.min=n.min+t.min,e.max=e.min+Un(t)}function vM(e,t,n){GT(e.x,t.x,n.x),GT(e.y,t.y,n.y)}function KT(e,t,n){e.min=t.min-n.min,e.max=e.min+Un(t)}function Ju(e,t,n){KT(e.x,t.x,n.x),KT(e.y,t.y,n.y)}function wM(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?pt(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?pt(n,e,r.max):Math.min(e,n)),e}function XT(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 bM(e,{top:t,left:n,bottom:r,right:i}){return{x:XT(e.x,n,i),y:XT(e.y,t,r)}}function QT(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 xM(e,t){return{x:QT(e.x,t.x),y:QT(e.y,t.y)}}function EM(e,t){let n=.5;const r=Un(e),i=Un(t);return i>r?n=ns(t.min,t.max-r,e.min):r>i&&(n=ns(e.min,e.max-i,t.min)),Zi(0,1,n)}function TM(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 c0=.35;function _M(e=c0){return e===!1?e=0:e===!0&&(e=c0),{x:ZT(e,"left","right"),y:ZT(e,"top","bottom")}}function ZT(e,t,n){return{min:JT(e,t),max:JT(e,n)}}function JT(e,t){return typeof e=="number"?e:e[t]||0}const e2=()=>({translate:0,scale:1,origin:0,originPoint:0}),is=()=>({x:e2(),y:e2()}),t2=()=>({min:0,max:0}),Et=()=>({x:t2(),y:t2()});function rr(e){return[e("x"),e("y")]}function n2({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function SM({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function CM(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}}function d0(e){return e===void 0||e===1}function f0({scale:e,scaleX:t,scaleY:n}){return!d0(e)||!d0(t)||!d0(n)}function Qa(e){return f0(e)||r2(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function r2(e){return i2(e.x)||i2(e.y)}function i2(e){return e&&e!=="0%"}function Xd(e,t,n){const r=e-n,i=t*r;return n+i}function a2(e,t,n,r,i){return i!==void 0&&(e=Xd(e,i,r)),Xd(e,n,r)+t}function p0(e,t=0,n=1,r,i){e.min=a2(e.min,t,n,r,i),e.max=a2(e.max,t,n,r,i)}function o2(e,{x:t,y:n}){p0(e.x,t.translate,t.scale,t.originPoint),p0(e.y,n.translate,n.scale,n.originPoint)}const s2=.999999999999,u2=1.0000000000001;function AM(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;const{visualElement:u}=a.options;u&&u.props.style&&u.props.style.display==="contents"||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&os(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,o2(e,o)),r&&Qa(a.latestValues)&&os(e,a.latestValues))}t.x<u2&&t.x>s2&&(t.x=1),t.y<u2&&t.y>s2&&(t.y=1)}function as(e,t){e.min=e.min+t,e.max=e.max+t}function l2(e,t,n,r,i=.5){const a=pt(e.min,e.max,i);p0(e,t,n,a,r)}function os(e,t){l2(e.x,t.x,t.scaleX,t.scale,t.originX),l2(e.y,t.y,t.scaleY,t.scale,t.originY)}function c2(e,t){return n2(CM(e.getBoundingClientRect(),t))}function kM(e,t,n){const r=c2(e,n),{scroll:i}=t;return i&&(as(r.x,i.offset.x),as(r.y,i.offset.y)),r}const d2=({current:e})=>e?e.ownerDocument.defaultView:null,RM=new WeakMap;class NM{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Et(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=c=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Kd(c,"page").point)},a=(c,d)=>{const{drag:f,dragPropagation:p,onDragStart:m}=this.getProps();if(f&&!p&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=VT(f),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),rr(x=>{let y=this.getAxisMotionValue(x).get()||0;if(Br.test(y)){const{projection:w}=this.visualElement;if(w&&w.layout){const b=w.layout.layoutBox[x];b&&(y=Un(b)*(parseFloat(y)/100))}}this.originPoint[x]=y}),m&&Xe.postRender(()=>m(c,d)),o0(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},o=(c,d)=>{const{dragPropagation:f,dragDirectionLock:p,onDirectionLock:m,onDrag:g}=this.getProps();if(!f&&!this.openGlobalLock)return;const{offset:x}=d;if(p&&this.currentDirection===null){this.currentDirection=PM(x),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",d.point,x),this.updateAxis("y",d.point,x),this.visualElement.render(),g&&g(c,d)},s=(c,d)=>this.stop(c,d),u=()=>rr(c=>{var d;return this.getAnimationState(c)==="paused"&&((d=this.getAxisMotionValue(c).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:l}=this.getProps();this.panSession=new FT(t,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,contextWindow:d2(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&Xe.postRender(()=>a(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.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Qd(t,i,this.currentDirection))return;const a=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=wM(o,this.constraints[t],this.elastic[t])),a.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,a=this.constraints;n&&rs(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=bM(i.layoutBox,n):this.constraints=!1,this.elastic=_M(r),a!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&rr(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=TM(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!rs(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const a=kM(r,i.root,this.visualElement.getTransformPagePoint());let o=xM(i.layout.layoutBox,a);if(n){const s=n(SM(o));this.hasMutatedConstraints=!!s,s&&(o=n2(s))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),u=this.constraints||{},l=rr(c=>{if(!Qd(c,n,this.currentDirection))return;let d=u&&u[c]||{};o&&(d={min:0,max:0});const f=i?200:1e6,p=i?40:1e7,m={type:"inertia",velocity:r?t[c]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...a,...d};return this.startAxisValueAnimation(c,m)});return Promise.all(l).then(s)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return o0(this.visualElement,t),r.start(n0(t,r,0,n,this.visualElement,!1))}stopAnimation(){rr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){rr(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?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){rr(n=>{const{drag:r}=this.getProps();if(!Qd(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,a=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:s}=i.layout.layoutBox[n];a.set(t[n]-pt(o,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!rs(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};rr(o=>{const s=this.getAxisMotionValue(o);if(s&&this.constraints!==!1){const u=s.get();i[o]=EM({min:u,max:u},this.constraints[o])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),rr(o=>{if(!Qd(o,t,null))return;const s=this.getAxisMotionValue(o),{min:u,max:l}=this.constraints[o];s.set(pt(u,l,i[o]))})}addListeners(){if(!this.visualElement.current)return;RM.set(this.visualElement,this);const t=this.visualElement.current,n=mi(t,"pointerdown",u=>{const{drag:l,dragListener:c=!0}=this.getProps();l&&c&&this.start(u)}),r=()=>{const{dragConstraints:u}=this.getProps();rs(u)&&u.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,a=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Xe.read(r);const o=hi(window,"resize",()=>this.scalePositionWithinConstraints()),s=i.addEventListener("didUpdate",({delta:u,hasLayoutChanged:l})=>{this.isDragging&&l&&(rr(c=>{const d=this.getAxisMotionValue(c);d&&(this.originPoint[c]+=u[c].translate,d.set(d.get()+u[c].translate))}),this.visualElement.render())});return()=>{o(),n(),a(),s&&s()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:o=c0,dragMomentum:s=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:a,dragElastic:o,dragMomentum:s}}}function Qd(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function PM(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class IM extends ta{constructor(t){super(t),this.removeGroupControls=Qt,this.removeListeners=Qt,this.controls=new NM(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Qt}unmount(){this.removeGroupControls(),this.removeListeners()}}const f2=e=>(t,n)=>{e&&Xe.postRender(()=>e(t,n))};class OM extends ta{constructor(){super(...arguments),this.removePointerDownListener=Qt}onPointerDown(t){this.session=new FT(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:d2(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:f2(t),onStart:f2(n),onMove:r,onEnd:(a,o)=>{delete this.session,i&&Xe.postRender(()=>i(a,o))}}}mount(){this.removePointerDownListener=mi(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 Zd=v.createContext(null);function DM(){const e=v.useContext(Zd);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=v.useId();v.useEffect(()=>r(i),[]);const a=v.useCallback(()=>n&&n(i),[i,n]);return!t&&n?[!1,a]:[!0]}const h0=v.createContext({}),p2=v.createContext({}),Jd={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function h2(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const el={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ye.test(e))e=parseFloat(e);else return e;const n=h2(e,t.target.x),r=h2(e,t.target.y);return`${n}% ${r}%`}},LM={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=ea.parse(e);if(i.length>5)return r;const a=ea.createTransformer(e),o=typeof i[0]!="number"?1:0,s=n.x.scale*t.x,u=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=u;const l=pt(s,u,.5);return typeof i[2+o]=="number"&&(i[2+o]/=l),typeof i[3+o]=="number"&&(i[3+o]/=l),a(i)}},ef={};function MM(e){Object.assign(ef,e)}const{schedule:m0,cancel:Eie}=NE(queueMicrotask,!1);class FM extends v.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:a}=t;MM(BM),a&&(n.group&&n.group.add(a),r&&r.register&&i&&r.register(a),a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),Jd.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:a}=this.props,o=r.projection;return o&&(o.isPresent=a,i||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?o.promote():o.relegate()||Xe.postRender(()=>{const s=o.getStack();(!s||!s.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),m0.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 m2(e){const[t,n]=DM(),r=v.useContext(h0);return E.jsx(FM,{...e,layoutGroup:r,switchLayoutGroup:v.useContext(p2),isPresent:t,safeToRemove:n})}const BM={borderRadius:{...el,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:el,borderTopRightRadius:el,borderBottomLeftRadius:el,borderBottomRightRadius:el,boxShadow:LM},g2=["TopLeft","TopRight","BottomLeft","BottomRight"],jM=g2.length,y2=e=>typeof e=="string"?parseFloat(e):e,v2=e=>typeof e=="number"||ye.test(e);function UM(e,t,n,r,i,a){i?(e.opacity=pt(0,n.opacity!==void 0?n.opacity:1,HM(r)),e.opacityExit=pt(t.opacity!==void 0?t.opacity:1,0,zM(r))):a&&(e.opacity=pt(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<jM;o++){const s=`border${g2[o]}Radius`;let u=w2(t,s),l=w2(n,s);if(u===void 0&&l===void 0)continue;u||(u=0),l||(l=0),u===0||l===0||v2(u)===v2(l)?(e[s]=Math.max(pt(y2(u),y2(l),r),0),(Br.test(l)||Br.test(u))&&(e[s]+="%")):e[s]=l}(t.rotate||n.rotate)&&(e.rotate=pt(t.rotate||0,n.rotate||0,r))}function w2(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const HM=b2(0,.5,FE),zM=b2(.5,.95,Qt);function b2(e,t,n){return r=>r<e?0:r>t?1:n(ns(e,t,r))}function x2(e,t){e.min=t.min,e.max=t.max}function ir(e,t){x2(e.x,t.x),x2(e.y,t.y)}function E2(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function T2(e,t,n,r,i){return e-=t,e=Xd(e,1/n,r),i!==void 0&&(e=Xd(e,1/i,r)),e}function VM(e,t=0,n=1,r=.5,i,a=e,o=e){if(Br.test(t)&&(t=parseFloat(t),t=pt(o.min,o.max,t/100)-o.min),typeof t!="number")return;let s=pt(a.min,a.max,r);e===a&&(s-=t),e.min=T2(e.min,t,n,s,i),e.max=T2(e.max,t,n,s,i)}function _2(e,t,[n,r,i],a,o){VM(e,t[n],t[r],t[i],t.scale,a,o)}const $M=["x","scaleX","originX"],WM=["y","scaleY","originY"];function S2(e,t,n,r){_2(e.x,t,$M,n?n.x:void 0,r?r.x:void 0),_2(e.y,t,WM,n?n.y:void 0,r?r.y:void 0)}function C2(e){return e.translate===0&&e.scale===1}function A2(e){return C2(e.x)&&C2(e.y)}function k2(e,t){return e.min===t.min&&e.max===t.max}function YM(e,t){return k2(e.x,t.x)&&k2(e.y,t.y)}function R2(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function N2(e,t){return R2(e.x,t.x)&&R2(e.y,t.y)}function P2(e){return Un(e.x)/Un(e.y)}function I2(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class qM{constructor(){this.members=[]}add(t){r0(this.members,t),t.scheduleRender()}remove(t){if(i0(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 a=this.members[i];if(a.isPresent!==!1){r=a;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 GM(e,t,n){let r="";const i=e.x.translate/t.x,a=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:l,rotate:c,rotateX:d,rotateY:f,skewX:p,skewY:m}=n;l&&(r=`perspective(${l}px) ${r}`),c&&(r+=`rotate(${c}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),p&&(r+=`skewX(${p}deg) `),m&&(r+=`skewY(${m}deg) `)}const s=e.x.scale*t.x,u=e.y.scale*t.y;return(s!==1||u!==1)&&(r+=`scale(${s}, ${u})`),r||"none"}const KM=(e,t)=>e.depth-t.depth;class XM{constructor(){this.children=[],this.isDirty=!1}add(t){r0(this.children,t),this.isDirty=!0}remove(t){i0(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(KM),this.isDirty=!1,this.children.forEach(t)}}function tf(e){const t=Jt(e)?e.get():e;return z4(t)?t.toValue():t}function QM(e,t){const n=jr.now(),r=({timestamp:i})=>{const a=i-n;a>=t&&(Qi(r),e(a-t))};return Xe.read(r,!0),()=>Qi(r)}function ZM(e){return e instanceof SVGElement&&e.tagName!=="svg"}function JM(e,t,n){const r=Jt(e)?e:Qu(e);return r.start(n0("",r,t,n)),r.animation}const Za={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},tl=typeof window<"u"&&window.MotionDebug!==void 0,g0=["","X","Y","Z"],e5={visibility:"hidden"},O2=1e3;let t5=0;function y0(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function D2(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=PT(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Xe,!(i||a))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&D2(r)}function L2({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},s=t==null?void 0:t()){this.id=t5++,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,tl&&(Za.totalNodes=Za.resolvedTargetDeltas=Za.recalculatedProjection=0),this.nodes.forEach(i5),this.nodes.forEach(l5),this.nodes.forEach(c5),this.nodes.forEach(a5),tl&&window.MotionDebug.record(Za)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new XM)}addEventListener(o,s){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new a0),this.eventHandlers.get(o).add(s)}notifyListeners(o,...s){const u=this.eventHandlers.get(o);u&&u.notify(...s)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,s=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=ZM(o),this.instance=o;const{layoutId:u,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),s&&(l||u)&&(this.isLayoutDirty=!0),e){let d;const f=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=QM(f,250),Jd.hasAnimatedSinceResize&&(Jd.hasAnimatedSinceResize=!1,this.nodes.forEach(F2))})}u&&this.root.registerSharedNode(u,this),this.options.animate!==!1&&c&&(u||l)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeTargetChanged:p,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||c.getDefaultTransition()||m5,{onLayoutAnimationStart:x,onLayoutAnimationComplete:y}=c.getProps(),w=!this.targetLayout||!N2(this.targetLayout,m)||p,b=!f&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||b||f&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,b);const T={...Rg(g,"layout"),onPlay:x,onComplete:y};(c.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T)}else f||F2(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}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,Qi(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(d5),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&&D2(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const d=this.path[c];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:s,layout:u}=this.options;if(s===void 0&&!u)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(M2);return}this.isUpdating||this.nodes.forEach(s5),this.isUpdating=!1,this.nodes.forEach(u5),this.nodes.forEach(n5),this.nodes.forEach(r5),this.clearAllSnapshots();const s=jr.now();Vt.delta=Zi(0,1e3/60,s-Vt.timestamp),Vt.timestamp=s,Vt.isProcessing=!0,Ng.update.process(Vt),Ng.preRender.process(Vt),Ng.render.process(Vt),Vt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,m0.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(o5),this.sharedNodes.forEach(f5)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Xe.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Xe.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let u=0;u<this.path.length;u++)this.path[u].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Et(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:s}=this.options;s&&s.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let s=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(s=!1),s){const u=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:u,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,s=this.projectionDelta&&!A2(this.projectionDelta),u=this.getTransformTemplate(),l=u?u(this.latestValues,""):void 0,c=l!==this.prevTransformTemplateValue;o&&(s||Qa(this.latestValues)||c)&&(i(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const s=this.measurePageBox();let u=this.removeElementScroll(s);return o&&(u=this.removeTransform(u)),g5(u),{animationId:this.root.animationId,measuredBox:s,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:s}=this.options;if(!s)return Et();const u=s.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(y5))){const{scroll:c}=this.root;c&&(as(u.x,c.offset.x),as(u.y,c.offset.y))}return u}removeElementScroll(o){var s;const u=Et();if(ir(u,o),!((s=this.scroll)===null||s===void 0)&&s.wasRoot)return u;for(let l=0;l<this.path.length;l++){const c=this.path[l],{scroll:d,options:f}=c;c!==this.root&&d&&f.layoutScroll&&(d.wasRoot&&ir(u,o),as(u.x,d.offset.x),as(u.y,d.offset.y))}return u}applyTransform(o,s=!1){const u=Et();ir(u,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];!s&&c.options.layoutScroll&&c.scroll&&c!==c.root&&os(u,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),Qa(c.latestValues)&&os(u,c.latestValues)}return Qa(this.latestValues)&&os(u,this.latestValues),u}removeTransform(o){const s=Et();ir(s,o);for(let u=0;u<this.path.length;u++){const l=this.path[u];if(!l.instance||!Qa(l.latestValues))continue;f0(l.latestValues)&&l.updateSnapshot();const c=Et(),d=l.measurePageBox();ir(c,d),S2(s,l.latestValues,l.snapshot?l.snapshot.layoutBox:void 0,c)}return Qa(this.latestValues)&&S2(s,this.latestValues),s}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!==Vt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var s;const u=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=u.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=u.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=u.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==u;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||!((s=this.parent)===null||s===void 0)&&s.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=Vt.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Et(),this.relativeTargetOrigin=Et(),Ju(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),ir(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Et(),this.targetWithTransforms=Et()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),vM(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ir(this.target,this.layout.layoutBox),o2(this.target,this.targetDelta)):ir(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=Et(),this.relativeTargetOrigin=Et(),Ju(this.relativeTargetOrigin,this.target,p.target),ir(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}tl&&Za.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||f0(this.parent.latestValues)||r2(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 o;const s=this.getLead(),u=!!this.resumingFrom||this!==s;let l=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(l=!1),u&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Vt.timestamp&&(l=!1),l)return;const{layout:c,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||!(c||d))return;ir(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,p=this.treeScale.y;AM(this.layoutCorrected,this.treeScale,this.path,u),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=Et());const{target:m}=s;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(E2(this.prevProjectionDelta.x,this.projectionDelta.x),E2(this.prevProjectionDelta.y,this.projectionDelta.y)),Zu(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==p||!I2(this.projectionDelta.x,this.prevProjectionDelta.x)||!I2(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m)),tl&&Za.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var s;if((s=this.options.visualElement)===null||s===void 0||s.scheduleRender(),o){const u=this.getStack();u&&u.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=is(),this.projectionDelta=is(),this.projectionDeltaWithTransform=is()}setAnimationOrigin(o,s=!1){const u=this.snapshot,l=u?u.latestValues:{},c={...this.latestValues},d=is();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!s;const f=Et(),p=u?u.source:void 0,m=this.layout?this.layout.source:void 0,g=p!==m,x=this.getStack(),y=!x||x.members.length<=1,w=!!(g&&!y&&this.options.crossfade===!0&&!this.path.some(h5));this.animationProgress=0;let b;this.mixTargetDelta=T=>{const S=T/1e3;B2(d.x,o.x,S),B2(d.y,o.y,S),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ju(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),p5(this.relativeTarget,this.relativeTargetOrigin,f,S),b&&YM(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=Et()),ir(b,this.relativeTarget)),g&&(this.animationValues=c,UM(c,l,this.latestValues,S,w,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},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&&(Qi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Xe.update(()=>{Jd.hasAnimatedSinceResize=!0,this.currentAnimation=JM(0,O2,{...o,onUpdate:s=>{this.mixTargetDelta(s),o.onUpdate&&o.onUpdate(s)},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(O2),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:s,target:u,layout:l,latestValues:c}=o;if(!(!s||!u||!l)){if(this!==o&&this.layout&&l&&V2(this.options.animationType,this.layout.layoutBox,l.layoutBox)){u=this.target||Et();const d=Un(this.layout.layoutBox.x);u.x.min=o.target.x.min,u.x.max=u.x.min+d;const f=Un(this.layout.layoutBox.y);u.y.min=o.target.y.min,u.y.max=u.y.min+f}ir(s,u),os(s,c),Zu(this.projectionDeltaWithTransform,this.layoutCorrected,s,c)}}registerSharedNode(o,s){this.sharedNodes.has(o)||this.sharedNodes.set(o,new qM),this.sharedNodes.get(o).add(s);const l=s.options.initialPromotionConfig;s.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(s):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:s}=this.options;return s?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:s}=this.options;return s?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:s,preserveFollowOpacity:u}={}){const l=this.getStack();l&&l.promote(this,u),o&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let s=!1;const{latestValues:u}=o;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(s=!0),!s)return;const l={};u.z&&y0("z",o,l,this.animationValues);for(let c=0;c<g0.length;c++)y0(`rotate${g0[c]}`,o,l,this.animationValues),y0(`skew${g0[c]}`,o,l,this.animationValues);o.render();for(const c in l)o.setStaticValue(c,l[c]),this.animationValues&&(this.animationValues[c]=l[c]);o.scheduleRender()}getProjectionStyles(o){var s,u;if(!this.instance||this.isSVG)return;if(!this.isVisible)return e5;const l={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,l.opacity="",l.pointerEvents=tf(o==null?void 0:o.pointerEvents)||"",l.transform=c?c(this.latestValues,""):"none",l;const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){const g={};return this.options.layoutId&&(g.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,g.pointerEvents=tf(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Qa(this.latestValues)&&(g.transform=c?c({},""):"none",this.hasProjected=!1),g}const f=d.animationValues||d.latestValues;this.applyTransformsToTarget(),l.transform=GM(this.projectionDeltaWithTransform,this.treeScale,f),c&&(l.transform=c(f,l.transform));const{x:p,y:m}=this.projectionDelta;l.transformOrigin=`${p.origin*100}% ${m.origin*100}% 0`,d.animationValues?l.opacity=d===this?(u=(s=f.opacity)!==null&&s!==void 0?s:this.latestValues.opacity)!==null&&u!==void 0?u:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:l.opacity=d===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const g in ef){if(f[g]===void 0)continue;const{correct:x,applyTo:y}=ef[g],w=l.transform==="none"?f[g]:x(f[g],d);if(y){const b=y.length;for(let T=0;T<b;T++)l[y[T]]=w}else l[g]=w}return this.options.layoutId&&(l.pointerEvents=d===this?tf(o==null?void 0:o.pointerEvents)||"":"none"),l}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var s;return(s=o.currentAnimation)===null||s===void 0?void 0:s.stop()}),this.root.nodes.forEach(M2),this.root.sharedNodes.clear()}}}function n5(e){e.updateLayout()}function r5(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:a}=e.options,o=n.source!==e.layout.source;a==="size"?rr(d=>{const f=o?n.measuredBox[d]:n.layoutBox[d],p=Un(f);f.min=r[d].min,f.max=f.min+p}):V2(a,n.layoutBox,r)&&rr(d=>{const f=o?n.measuredBox[d]:n.layoutBox[d],p=Un(r[d]);f.max=f.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+p)});const s=is();Zu(s,r,n.layoutBox);const u=is();o?Zu(u,e.applyTransform(i,!0),n.measuredBox):Zu(u,r,n.layoutBox);const l=!A2(s);let c=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:p}=d;if(f&&p){const m=Et();Ju(m,n.layoutBox,f.layoutBox);const g=Et();Ju(g,r,p.layoutBox),N2(m,g)||(c=!0),d.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=m,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:u,layoutDelta:s,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function i5(e){tl&&Za.totalNodes++,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 a5(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function o5(e){e.clearSnapshot()}function M2(e){e.clearMeasurements()}function s5(e){e.isLayoutDirty=!1}function u5(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function F2(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function l5(e){e.resolveTargetDelta()}function c5(e){e.calcProjection()}function d5(e){e.resetSkewAndRotation()}function f5(e){e.removeLeadSnapshot()}function B2(e,t,n){e.translate=pt(t.translate,0,n),e.scale=pt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function j2(e,t,n,r){e.min=pt(t.min,n.min,r),e.max=pt(t.max,n.max,r)}function p5(e,t,n,r){j2(e.x,t.x,n.x,r),j2(e.y,t.y,n.y,r)}function h5(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const m5={duration:.45,ease:[.4,0,.1,1]},U2=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),H2=U2("applewebkit/")&&!U2("chrome/")?Math.round:Qt;function z2(e){e.min=H2(e.min),e.max=H2(e.max)}function g5(e){z2(e.x),z2(e.y)}function V2(e,t,n){return e==="position"||e==="preserve-aspect"&&!yM(P2(t),P2(n),.2)}function y5(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const v5=L2({attachResizeListener:(e,t)=>hi(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),v0={current:void 0},$2=L2({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!v0.current){const e=new v5({});e.mount(window),e.setOptions({layoutScroll:!0}),v0.current=e}return v0.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),w5={pan:{Feature:OM},drag:{Feature:IM,ProjectionNode:$2,MeasureLayout:m2}};function W2(e,t){const n=t?"pointerenter":"pointerleave",r=t?"onHoverStart":"onHoverEnd",i=(a,o)=>{if(a.pointerType==="touch"||$T())return;const s=e.getProps();e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",t);const u=s[r];u&&Xe.postRender(()=>u(a,o))};return mi(e.current,n,i,{passive:!e.getProps()[r]})}class b5 extends ta{mount(){this.unmount=pi(W2(this.node,!0),W2(this.node,!1))}unmount(){}}class x5 extends ta{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=pi(hi(this.node.current,"focus",()=>this.onFocus()),hi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const Y2=(e,t)=>t?e===t?!0:Y2(e,t.parentElement):!1;function w0(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Kd(n))}class E5 extends ta{constructor(){super(...arguments),this.removeStartListeners=Qt,this.removeEndListeners=Qt,this.removeAccessibleListeners=Qt,this.startPointerPress=(t,n)=>{if(this.isPressing)return;this.removeEndListeners();const r=this.node.getProps(),a=mi(window,"pointerup",(s,u)=>{if(!this.checkPressEnd())return;const{onTap:l,onTapCancel:c,globalTapTarget:d}=this.node.getProps(),f=!d&&!Y2(this.node.current,s.target)?c:l;f&&Xe.update(()=>f(s,u))},{passive:!(r.onTap||r.onPointerUp)}),o=mi(window,"pointercancel",(s,u)=>this.cancelPress(s,u),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=pi(a,o),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=a=>{if(a.key!=="Enter"||this.isPressing)return;const o=s=>{s.key!=="Enter"||!this.checkPressEnd()||w0("up",(u,l)=>{const{onTap:c}=this.node.getProps();c&&Xe.postRender(()=>c(u,l))})};this.removeEndListeners(),this.removeEndListeners=hi(this.node.current,"keyup",o),w0("down",(s,u)=>{this.startPress(s,u)})},n=hi(this.node.current,"keydown",t),r=()=>{this.isPressing&&w0("cancel",(a,o)=>this.cancelPress(a,o))},i=hi(this.node.current,"blur",r);this.removeAccessibleListeners=pi(n,i)}}startPress(t,n){this.isPressing=!0;const{onTapStart:r,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&Xe.postRender(()=>r(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!$T()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&Xe.postRender(()=>r(t,n))}mount(){const t=this.node.getProps(),n=mi(t.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),r=hi(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=pi(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const b0=new WeakMap,x0=new WeakMap,T5=e=>{const t=b0.get(e.target);t&&t(e)},_5=e=>{e.forEach(T5)};function S5({root:e,...t}){const n=e||document;x0.has(n)||x0.set(n,{});const r=x0.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(_5,{root:e,...t})),r[i]}function C5(e,t,n){const r=S5(t);return b0.set(e,n),r.observe(e),()=>{b0.delete(e),r.unobserve(e)}}const A5={some:0,all:1};class k5 extends ta{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:a}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:A5[i]},s=u=>{const{isIntersecting:l}=u;if(this.isInView===l||(this.isInView=l,a&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:c,onViewportLeave:d}=this.node.getProps(),f=l?c:d;f&&f(u)};return C5(this.node.current,o,s)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(R5(t,n))&&this.startObserver()}unmount(){}}function R5({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const N5={inView:{Feature:k5},tap:{Feature:E5},focus:{Feature:x5},hover:{Feature:b5}},P5={layout:{ProjectionNode:$2,MeasureLayout:m2}},E0=v.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),nf=v.createContext({}),T0=typeof window<"u",q2=T0?v.useLayoutEffect:v.useEffect,G2=v.createContext({strict:!1});function I5(e,t,n,r,i){var a,o;const{visualElement:s}=v.useContext(nf),u=v.useContext(G2),l=v.useContext(Zd),c=v.useContext(E0).reducedMotion,d=v.useRef();r=r||u.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:s,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c}));const f=d.current,p=v.useContext(p2);f&&!f.projection&&i&&(f.type==="html"||f.type==="svg")&&O5(d.current,n,i,p),v.useInsertionEffect(()=>{f&&f.update(n,l)});const m=n[NT],g=v.useRef(!!m&&!(!((a=window.MotionHandoffIsComplete)===null||a===void 0)&&a.call(window,m))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,m)));return q2(()=>{f&&(window.MotionIsMounted=!0,f.updateFeatures(),m0.render(f.render),g.current&&f.animationState&&f.animationState.animateChanges())}),v.useEffect(()=>{f&&(!g.current&&f.animationState&&f.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{var x;(x=window.MotionHandoffMarkAsComplete)===null||x===void 0||x.call(window,m)}),g.current=!1))}),f}function O5(e,t,n,r){const{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:u,layoutRoot:l}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:K2(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&rs(s),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,layoutScroll:u,layoutRoot:l})}function K2(e){if(e)return e.options.allowProjection!==!1?e.projection:K2(e.parent)}function D5(e,t,n){return v.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):rs(n)&&(n.current=r))},[t])}function rf(e){return zu(e.animate)||kg.some(t=>Vu(e[t]))}function X2(e){return!!(rf(e)||e.variants)}function L5(e,t){if(rf(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Vu(n)?n:void 0,animate:Vu(r)?r:void 0}}return e.inherit!==!1?t:{}}function M5(e){const{initial:t,animate:n}=L5(e,v.useContext(nf));return v.useMemo(()=>({initial:t,animate:n}),[Q2(t),Q2(n)])}function Q2(e){return Array.isArray(e)?e.join(" "):e}const Z2={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"]},ss={};for(const e in Z2)ss[e]={isEnabled:t=>Z2[e].some(n=>!!t[n])};function F5(e){for(const t in e)ss[t]={...ss[t],...e[t]}}const B5=Symbol.for("motionComponentSymbol");function j5({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&F5(e);function a(s,u){let l;const c={...v.useContext(E0),...s,layoutId:U5(s)},{isStatic:d}=c,f=M5(s),p=r(s,d);if(!d&&T0){H5();const m=z5(c);l=m.MeasureLayout,f.visualElement=I5(i,p,c,t,m.ProjectionNode)}return E.jsxs(nf.Provider,{value:f,children:[l&&f.visualElement?E.jsx(l,{visualElement:f.visualElement,...c}):null,n(i,s,D5(p,f.visualElement,u),p,d,f.visualElement)]})}const o=v.forwardRef(a);return o[B5]=i,o}function U5({layoutId:e}){const t=v.useContext(h0).id;return t&&e!==void 0?t+"-"+e:e}function H5(e,t){v.useContext(G2).strict}function z5(e){const{drag:t,layout:n}=ss;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 V5=["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 _0(e){return typeof e!="string"||e.includes("-")?!1:!!(V5.indexOf(e)>-1||/[A-Z]/u.test(e))}function J2(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const a in n)e.style.setProperty(a,n[a])}const e_=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 t_(e,t,n,r){J2(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(e_.has(i)?i:Gd(i),t.attrs[i])}function n_(e,{layout:t,layoutId:n}){return Xi.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ef[e]||e==="opacity")}function S0(e,t,n){var r;const{style:i}=e,a={};for(const o in i)(Jt(i[o])||t.style&&Jt(t.style[o])||n_(o,e)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(a[o]=i[o]);return n&&i&&typeof i.willChange=="string"&&(n.applyWillChange=!1),a}function r_(e,t,n){const r=S0(e,t,n);for(const i in e)if(Jt(e[i])||Jt(t[i])){const a=$u.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[a]=e[i]}return r}function C0(e){const t=v.useRef(null);return t.current===null&&(t.current=e()),t.current}function $5(e){if(Xi.has(e))return"transform";if(TT.has(e))return Gd(e)}function W5({applyWillChange:e=!1,scrapeMotionValuesFromProps:t,createRenderState:n,onMount:r},i,a,o,s){const u={latestValues:Y5(i,a,o,s?!1:e,t),renderState:n()};return r&&(u.mount=l=>r(i,l,u)),u}const i_=e=>(t,n)=>{const r=v.useContext(nf),i=v.useContext(Zd),a=()=>W5(e,t,r,i,n);return n?a():C0(a)};function a_(e,t,n){const r=Array.isArray(t)?t:[t];for(let i=0;i<r.length;i++){const a=Cg(e,r[i]);if(a){const{transitionEnd:o,transition:s,...u}=a;n(u,o)}}}function Y5(e,t,n,r,i){var a;const o={},s=new Set,u=r&&((a=e.style)===null||a===void 0?void 0:a.willChange)===void 0,l=i(e,{});for(const x in l)o[x]=tf(l[x]);let{initial:c,animate:d}=e;const f=rf(e),p=X2(e);t&&p&&!f&&e.inherit!==!1&&(c===void 0&&(c=t.initial),d===void 0&&(d=t.animate));let m=n?n.initial===!1:!1;m=m||c===!1;const g=m?d:c;return g&&typeof g!="boolean"&&!zu(g)&&a_(e,g,(x,y)=>{for(const w in x){let b=x[w];if(Array.isArray(b)){const T=m?b.length-1:0;b=b[T]}b!==null&&(o[w]=b)}for(const w in y)o[w]=y[w]}),u&&(d&&c!==!1&&!zu(d)&&a_(e,d,x=>{for(const y in x){const w=$5(y);w&&s.add(w)}}),s.size&&(o.willChange=Array.from(s).join(","))),o}const A0=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),o_=()=>({...A0(),attrs:{}}),s_=(e,t)=>t&&typeof e=="number"?t.transform(e):e,q5={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},G5=$u.length;function K5(e,t,n){let r="",i=!0;for(let a=0;a<G5;a++){const o=$u[a],s=e[o];if(s===void 0)continue;let u=!0;if(typeof s=="number"?u=s===(o.startsWith("scale")?1:0):u=parseFloat(s)===0,!u||n){const l=s_(s,Vg[o]);if(!u){i=!1;const c=q5[o]||o;r+=`${c}(${l}) `}n&&(t[o]=l)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function k0(e,t,n){const{style:r,vars:i,transformOrigin:a}=e;let o=!1,s=!1;for(const u in t){const l=t[u];if(Xi.has(u)){o=!0;continue}else if(zE(u)){i[u]=l;continue}else{const c=s_(l,Vg[u]);u.startsWith("origin")?(s=!0,a[u]=c):r[u]=c}}if(t.transform||(o||n?r.transform=K5(t,e.transform,n):r.transform&&(r.transform="none")),s){const{originX:u="50%",originY:l="50%",originZ:c=0}=a;r.transformOrigin=`${u} ${l} ${c}`}}function u_(e,t,n){return typeof e=="string"?e:ye.transform(t+n*e)}function X5(e,t,n){const r=u_(t,e.x,e.width),i=u_(n,e.y,e.height);return`${r} ${i}`}const Q5={offset:"stroke-dashoffset",array:"stroke-dasharray"},Z5={offset:"strokeDashoffset",array:"strokeDasharray"};function J5(e,t,n=1,r=0,i=!0){e.pathLength=1;const a=i?Q5:Z5;e[a.offset]=ye.transform(-r);const o=ye.transform(t),s=ye.transform(n);e[a.array]=`${o} ${s}`}function R0(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:a,pathLength:o,pathSpacing:s=1,pathOffset:u=0,...l},c,d){if(k0(e,l,d),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:p,dimensions:m}=e;f.transform&&(m&&(p.transform=f.transform),delete f.transform),m&&(i!==void 0||a!==void 0||p.transform)&&(p.transformOrigin=X5(m,i!==void 0?i:.5,a!==void 0?a:.5)),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&J5(f,o,s,u,!1)}const N0=e=>typeof e=="string"&&e.toLowerCase()==="svg",e8={useVisualState:i_({scrapeMotionValuesFromProps:r_,createRenderState:o_,onMount:(e,t,{renderState:n,latestValues:r})=>{Xe.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),Xe.render(()=>{R0(n,r,N0(t.tagName),e.transformTemplate),t_(t,n)})}})},t8={useVisualState:i_({applyWillChange:!0,scrapeMotionValuesFromProps:S0,createRenderState:A0})};function l_(e,t,n){for(const r in t)!Jt(t[r])&&!n_(r,n)&&(e[r]=t[r])}function n8({transformTemplate:e},t){return v.useMemo(()=>{const n=A0();return k0(n,t,e),Object.assign({},n.vars,n.style)},[t])}function r8(e,t){const n=e.style||{},r={};return l_(r,n,e),Object.assign(r,n8(e,t)),r}function i8(e,t){const n={},r=r8(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 a8=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 af(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||a8.has(e)}let c_=e=>!af(e);function o8(e){e&&(c_=t=>t.startsWith("on")?!af(t):e(t))}try{o8(require("@emotion/is-prop-valid").default)}catch{}function s8(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(c_(i)||n===!0&&af(i)||!t&&!af(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function u8(e,t,n,r){const i=v.useMemo(()=>{const a=o_();return R0(a,t,N0(r),e.transformTemplate),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};l_(a,e.style,e),i.style={...a,...i.style}}return i}function l8(e=!1){return(n,r,i,{latestValues:a},o)=>{const u=(_0(n)?u8:i8)(r,a,o,n),l=s8(r,typeof n=="string",e),c=n!==v.Fragment?{...l,...u,ref:i}:{},{children:d}=r,f=v.useMemo(()=>Jt(d)?d.get():d,[d]);return v.createElement(n,{...c,children:f})}}function c8(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={..._0(r)?e8:t8,preloadedFeatures:e,useRender:l8(i),createVisualElement:t,Component:r};return j5(o)}}const P0={current:null},d_={current:!1};function d8(){if(d_.current=!0,!!T0)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>P0.current=e.matches;e.addListener(t),t()}else P0.current=!1}function f8(e,t,n){for(const r in t){const i=t[r],a=n[r];if(Jt(i))e.addValue(r,i);else if(Jt(a))e.addValue(r,Qu(i,{owner:e}));else if(a!==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,Qu(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const f_=new WeakMap,p8=[...KE,Zt,ea],h8=e=>p8.find(GE(e)),p_=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class m8{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:a,visualState:o},s={}){this.applyWillChange=!1,this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Fg,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 f=jr.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,Xe.render(this.render,!1,!0))};const{latestValues:u,renderState:l}=o;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=rf(n),this.isVariantNode=X2(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:c,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const p=d[f];u[f]!==void 0&&Jt(p)&&p.set(u[f],!1)}}mount(t){this.current=t,f_.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)),d_.current||d8(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:P0.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){f_.delete(this.current),this.projection&&this.projection.unmount(),Qi(this.notifyUpdate),Qi(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=Xi.has(t),i=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&Xe.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),a=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),a(),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 ss){const n=ss[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 a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Et()}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<p_.length;r++){const i=p_[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const a="on"+i,o=t[a];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=f8(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}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=Qu(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(UE(i)||jE(i))?i=parseFloat(i):!h8(i)&&ea.test(n)&&(i=oT(t,n)),this.setBaseTarget(t,Jt(i)?i.get():i)),Jt(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const o=Cg(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(i=o[t])}if(r&&i!==void 0)return i;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!Jt(a)?a:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new a0),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class h_ extends m8{constructor(){super(...arguments),this.KeyframeResolver=sT}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]}}function g8(e){return window.getComputedStyle(e)}class y8 extends h_{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=J2}readValueFromInstance(t,n){if(Xi.has(n)){const r=$g(n);return r&&r.default||0}else{const r=g8(t),i=(zE(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return c2(t,n)}build(t,n,r){k0(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return S0(t,n,r)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Jt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class v8 extends h_{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Et}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Xi.has(n)){const r=$g(n);return r&&r.default||0}return n=e_.has(n)?n:Gd(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return r_(t,n,r)}build(t,n,r){R0(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){t_(t,n,r,i)}mount(t){this.isSVGTag=N0(t.tagName),super.mount(t)}}const w8=(e,t)=>_0(e)?new v8(t):new y8(t,{allowProjection:e!==v.Fragment}),b8=c8({...uM,...N5,...w5,...P5},w8),us=nL(b8);class x8 extends v.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function E8({children:e,isPresent:t}){const n=v.useId(),r=v.useRef(null),i=v.useRef({width:0,height:0,top:0,left:0}),{nonce:a}=v.useContext(E0);return v.useInsertionEffect(()=>{const{width:o,height:s,top:u,left:l}=i.current;if(t||!r.current||!o||!s)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return a&&(c.nonce=a),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`
40
+ `+a.stack}return{value:e,source:t,stack:i,digest:null}}function Gm(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Km(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var o6=typeof WeakMap=="function"?WeakMap:Map;function Tx(e,t,n){n=si(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ed||(Ed=!0,cg=r),Km(e,t)},n}function _x(e,t,n){n=si(-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(){Km(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){Km(e,t),typeof r!="function"&&(Wi===null?Wi=new Set([this]):Wi.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Sx(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new o6;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=b6.bind(null,e,t,n),t.then(e,e))}function Cx(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 Ax(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=si(-1,1),t.tag=2,Vi(n,t,1))),n.lanes|=1),e)}var s6=ti.ReactCurrentOwner,bn=!1;function cn(e,t,n,r){t.child=e===null?qb(t,null,n,r):Vo(t,e.child,n,r)}function kx(e,t,n,r,i){n=n.render;var a=t.ref;return Wo(t,i),r=Um(e,t,n,r,a,i),n=Hm(),e!==null&&!bn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ui(e,t,i)):(ot&&n&&Tm(t),t.flags|=1,cn(e,t,r,i),t.child)}function Rx(e,t,n,r,i){if(e===null){var a=n.type;return typeof a=="function"&&!yg(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Nx(e,t,a,r,i)):(e=kd(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&i)){var o=a.memoizedProps;if(n=n.compare,n=n!==null?n:bu,n(o,r)&&e.ref===t.ref)return ui(e,t,i)}return t.flags|=1,e=Ki(a,r),e.ref=t.ref,e.return=t,t.child=e}function Nx(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(bu(a,r)&&e.ref===t.ref)if(bn=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(bn=!0);else return t.lanes=e.lanes,ui(e,t,i)}return Xm(e,t,n,r,i)}function Px(e,t,n){var r=t.pendingProps,i=r.children,a=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},et(Ko,Bn),Bn|=n;else{if(!(n&1073741824))return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,et(Ko,Bn),Bn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,et(Ko,Bn),Bn|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,et(Ko,Bn),Bn|=r;return cn(e,t,i,n),t.child}function Ix(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Xm(e,t,n,r,i){var a=wn(n)?Fa:qt.current;return a=jo(t,a),Wo(t,i),n=Um(e,t,n,r,a,i),r=Hm(),e!==null&&!bn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ui(e,t,i)):(ot&&r&&Tm(t),t.flags|=1,cn(e,t,n,i),t.child)}function Ox(e,t,n,r,i){if(wn(n)){var a=!0;Jc(t)}else a=!1;if(Wo(t,i),t.stateNode===null)yd(e,t),xx(t,n,r),qm(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var u=o.context,l=n.contextType;typeof l=="object"&&l!==null?l=Jn(l):(l=wn(n)?Fa:qt.current,l=jo(t,l));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s!==r||u!==l)&&Ex(t,o,r,l),zi=!1;var f=t.memoizedState;o.state=f,ud(t,r,o,i),u=t.memoizedState,s!==r||f!==u||vn.current||zi?(typeof c=="function"&&(Ym(t,n,c,r),u=t.memoizedState),(s=zi||bx(t,n,s,r,f,u,l))?(d||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=u),o.props=r,o.state=u,o.context=l,r=s):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Kb(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:yr(t.type,s),o.props=l,d=t.pendingProps,f=o.context,u=n.contextType,typeof u=="object"&&u!==null?u=Jn(u):(u=wn(n)?Fa:qt.current,u=jo(t,u));var p=n.getDerivedStateFromProps;(c=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s!==d||f!==u)&&Ex(t,o,r,u),zi=!1,f=t.memoizedState,o.state=f,ud(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||vn.current||zi?(typeof p=="function"&&(Ym(t,n,p,r),m=t.memoizedState),(l=zi||bx(t,n,l,r,f,m,u)||!1)?(c||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,m,u),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,m,u)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=u,r=l):(typeof o.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Qm(e,t,n,r,a,i)}function Qm(e,t,n,r,i,a){Ix(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&Bb(t,n,!1),ui(e,t,a);r=t.stateNode,s6.current=t;var s=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Vo(t,e.child,null,a),t.child=Vo(t,null,s,a)):cn(e,t,s,a),t.memoizedState=r.state,i&&Bb(t,n,!0),t.child}function Dx(e){var t=e.stateNode;t.pendingContext?Mb(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Mb(e,t.context,!1),Dm(e,t.containerInfo)}function Lx(e,t,n,r,i){return zo(),Am(i),t.flags|=256,cn(e,t,n,r),t.child}var Zm={dehydrated:null,treeContext:null,retryLane:0};function Jm(e){return{baseLanes:e,cachePool:null,transitions:null}}function Mx(e,t,n){var r=t.pendingProps,i=dt.current,a=!1,o=(t.flags&128)!==0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!==0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),et(dt,i&1),e===null)return Cm(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,a?(r=t.mode,a=t.child,o={mode:"hidden",children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=Rd(o,r,0,null),e=qa(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Jm(n),t.memoizedState=Zm,e):eg(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return u6(e,t,o,r,s,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,s=i.sibling;var u={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=Ki(i,u),r.subtreeFlags=i.subtreeFlags&14680064),s!==null?a=Ki(s,a):(a=qa(a,o,n,null),a.flags|=2),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?Jm(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=Zm,r}return a=e.child,e=a.sibling,r=Ki(a,{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 eg(e,t){return t=Rd({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function gd(e,t,n,r){return r!==null&&Am(r),Vo(t,e.child,null,n),e=eg(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function u6(e,t,n,r,i,a,o){if(n)return t.flags&256?(t.flags&=-257,r=Gm(Error(Q(422))),gd(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=r.fallback,i=t.mode,r=Rd({mode:"visible",children:r.children},i,0,null),a=qa(a,i,o,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,t.mode&1&&Vo(t,e.child,null,o),t.child.memoizedState=Jm(o),t.memoizedState=Zm,a);if(!(t.mode&1))return gd(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var s=r.dgst;return r=s,a=Error(Q(419)),r=Gm(a,r,void 0),gd(e,t,o,r)}if(s=(o&e.childLanes)!==0,bn||s){if(r=Dt,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!==a.retryLane&&(a.retryLane=i,oi(e,i),br(r,e,i,-1))}return gg(),r=Gm(Error(Q(421))),gd(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=x6.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,Fn=Bi(i.nextSibling),Mn=t,ot=!0,gr=null,e!==null&&(Qn[Zn++]=ii,Qn[Zn++]=ai,Qn[Zn++]=Ba,ii=e.id,ai=e.overflow,Ba=t),t=eg(t,r.children),t.flags|=4096,t)}function Fx(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Pm(e.return,t,n)}function tg(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function Bx(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(cn(e,t,r.children,n),r=dt.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&&Fx(e,n,t);else if(e.tag===19)Fx(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(et(dt,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&&ld(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),tg(t,!1,i,n,a);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ld(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}tg(t,!0,n,null,a);break;case"together":tg(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function yd(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ui(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Va|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Q(153));if(t.child!==null){for(e=t.child,n=Ki(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ki(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function l6(e,t,n){switch(t.tag){case 3:Dx(t),zo();break;case 5:Zb(t);break;case 1:wn(t.type)&&Jc(t);break;case 4:Dm(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;et(ad,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(et(dt,dt.current&1),t.flags|=128,null):n&t.child.childLanes?Mx(e,t,n):(et(dt,dt.current&1),e=ui(e,t,n),e!==null?e.sibling:null);et(dt,dt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Bx(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),et(dt,dt.current),r)break;return null;case 22:case 23:return t.lanes=0,Px(e,t,n)}return ui(e,t,n)}var jx,ng,Ux,Hx;jx=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}},ng=function(){},Ux=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Ha(Lr.current);var a=null;switch(n){case"input":i=Ph(e,i),r=Ph(e,r),a=[];break;case"select":i=ct({},i,{value:void 0}),r=ct({},r,{value:void 0}),a=[];break;case"textarea":i=Dh(e,i),r=Dh(e,r),a=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Xc)}Mh(n,r);var o;n=null;for(l in i)if(!r.hasOwnProperty(l)&&i.hasOwnProperty(l)&&i[l]!=null)if(l==="style"){var s=i[l];for(o in s)s.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else l!=="dangerouslySetInnerHTML"&&l!=="children"&&l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(Js.hasOwnProperty(l)?a||(a=[]):(a=a||[]).push(l,null));for(l in r){var u=r[l];if(s=i!=null?i[l]:void 0,r.hasOwnProperty(l)&&u!==s&&(u!=null||s!=null))if(l==="style")if(s){for(o in s)!s.hasOwnProperty(o)||u&&u.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in u)u.hasOwnProperty(o)&&s[o]!==u[o]&&(n||(n={}),n[o]=u[o])}else n||(a||(a=[]),a.push(l,n)),n=u;else l==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,s=s?s.__html:void 0,u!=null&&s!==u&&(a=a||[]).push(l,u)):l==="children"?typeof u!="string"&&typeof u!="number"||(a=a||[]).push(l,""+u):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&(Js.hasOwnProperty(l)?(u!=null&&l==="onScroll"&&nt("scroll",e),a||s===u||(a=[])):(a=a||[]).push(l,u))}n&&(a=a||[]).push("style",n);var l=a;(t.updateQueue=l)&&(t.flags|=4)}},Hx=function(e,t,n,r){n!==r&&(t.flags|=4)};function Lu(e,t){if(!ot)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 Kt(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 c6(e,t,n){var r=t.pendingProps;switch(_m(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Kt(t),null;case 1:return wn(t.type)&&Zc(),Kt(t),null;case 3:return r=t.stateNode,Yo(),rt(vn),rt(qt),Fm(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(rd(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,gr!==null&&(pg(gr),gr=null))),ng(e,t),Kt(t),null;case 5:Lm(t);var i=Ha(Nu.current);if(n=t.type,e!==null&&t.stateNode!=null)Ux(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(Q(166));return Kt(t),null}if(e=Ha(Lr.current),rd(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[Dr]=t,r[Su]=a,e=(t.mode&1)!==0,n){case"dialog":nt("cancel",r),nt("close",r);break;case"iframe":case"object":case"embed":nt("load",r);break;case"video":case"audio":for(i=0;i<Eu.length;i++)nt(Eu[i],r);break;case"source":nt("error",r);break;case"img":case"image":case"link":nt("error",r),nt("load",r);break;case"details":nt("toggle",r);break;case"input":xw(r,a),nt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},nt("invalid",r);break;case"textarea":_w(r,a),nt("invalid",r)}Mh(n,a),i=null;for(var o in a)if(a.hasOwnProperty(o)){var s=a[o];o==="children"?typeof s=="string"?r.textContent!==s&&(a.suppressHydrationWarning!==!0&&Kc(r.textContent,s,e),i=["children",s]):typeof s=="number"&&r.textContent!==""+s&&(a.suppressHydrationWarning!==!0&&Kc(r.textContent,s,e),i=["children",""+s]):Js.hasOwnProperty(o)&&s!=null&&o==="onScroll"&&nt("scroll",r)}switch(n){case"input":Cc(r),Tw(r,a,!0);break;case"textarea":Cc(r),Cw(r);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(r.onclick=Xc)}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=Aw(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[Dr]=t,e[Su]=r,jx(e,t,!1,!1),t.stateNode=e;e:{switch(o=Fh(n,r),n){case"dialog":nt("cancel",e),nt("close",e),i=r;break;case"iframe":case"object":case"embed":nt("load",e),i=r;break;case"video":case"audio":for(i=0;i<Eu.length;i++)nt(Eu[i],e);i=r;break;case"source":nt("error",e),i=r;break;case"img":case"image":case"link":nt("error",e),nt("load",e),i=r;break;case"details":nt("toggle",e),i=r;break;case"input":xw(e,r),i=Ph(e,r),nt("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=ct({},r,{value:void 0}),nt("invalid",e);break;case"textarea":_w(e,r),i=Dh(e,r),nt("invalid",e);break;default:i=r}Mh(n,i),s=i;for(a in s)if(s.hasOwnProperty(a)){var u=s[a];a==="style"?Nw(e,u):a==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&kw(e,u)):a==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&ru(e,u):typeof u=="number"&&ru(e,""+u):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Js.hasOwnProperty(a)?u!=null&&a==="onScroll"&&nt("scroll",e):u!=null&&bh(e,a,u,o))}switch(n){case"input":Cc(e),Tw(e,r,!1);break;case"textarea":Cc(e),Cw(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Pi(r.value));break;case"select":e.multiple=!!r.multiple,a=r.value,a!=null?Ao(e,!!r.multiple,a,!1):r.defaultValue!=null&&Ao(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Xc)}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 Kt(t),null;case 6:if(e&&t.stateNode!=null)Hx(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(Q(166));if(n=Ha(Nu.current),Ha(Lr.current),rd(t)){if(r=t.stateNode,n=t.memoizedProps,r[Dr]=t,(a=r.nodeValue!==n)&&(e=Mn,e!==null))switch(e.tag){case 3:Kc(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Kc(r.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Dr]=t,t.stateNode=r}return Kt(t),null;case 13:if(rt(dt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ot&&Fn!==null&&t.mode&1&&!(t.flags&128))$b(),zo(),t.flags|=98560,a=!1;else if(a=rd(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(Q(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(Q(317));a[Dr]=t}else zo(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Kt(t),a=!1}else gr!==null&&(pg(gr),gr=null),a=!0;if(!a)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||dt.current&1?Pt===0&&(Pt=3):gg())),t.updateQueue!==null&&(t.flags|=4),Kt(t),null);case 4:return Yo(),ng(e,t),e===null&&Tu(t.stateNode.containerInfo),Kt(t),null;case 10:return Nm(t.type._context),Kt(t),null;case 17:return wn(t.type)&&Zc(),Kt(t),null;case 19:if(rt(dt),a=t.memoizedState,a===null)return Kt(t),null;if(r=(t.flags&128)!==0,o=a.rendering,o===null)if(r)Lu(a,!1);else{if(Pt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ld(e),o!==null){for(t.flags|=128,Lu(a,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)a=n,e=r,a.flags&=14680066,o=a.alternate,o===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,e=o.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return et(dt,dt.current&1|2),t.child}e=e.sibling}a.tail!==null&&xt()>Xo&&(t.flags|=128,r=!0,Lu(a,!1),t.lanes=4194304)}else{if(!r)if(e=ld(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Lu(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!ot)return Kt(t),null}else 2*xt()-a.renderingStartTime>Xo&&n!==1073741824&&(t.flags|=128,r=!0,Lu(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(n=a.last,n!==null?n.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=xt(),t.sibling=null,n=dt.current,et(dt,r?n&1|2:n&1),t):(Kt(t),null);case 22:case 23:return mg(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Bn&1073741824&&(Kt(t),t.subtreeFlags&6&&(t.flags|=8192)):Kt(t),null;case 24:return null;case 25:return null}throw Error(Q(156,t.tag))}function d6(e,t){switch(_m(t),t.tag){case 1:return wn(t.type)&&Zc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Yo(),rt(vn),rt(qt),Fm(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Lm(t),null;case 13:if(rt(dt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Q(340));zo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return rt(dt),null;case 4:return Yo(),null;case 10:return Nm(t.type._context),null;case 22:case 23:return mg(),null;case 24:return null;default:return null}}var vd=!1,Xt=!1,f6=typeof WeakSet=="function"?WeakSet:Set,ue=null;function Go(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){yt(e,t,r)}else n.current=null}function rg(e,t,n){try{n()}catch(r){yt(e,t,r)}}var zx=!1;function p6(e,t){if(mm=Bc,e=bb(),sm(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,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var o=0,s=-1,u=-1,l=0,c=0,d=e,f=null;t:for(;;){for(var p;d!==n||i!==0&&d.nodeType!==3||(s=o+i),d!==a||r!==0&&d.nodeType!==3||(u=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===n&&++l===i&&(s=o),f===a&&++c===r&&(u=o),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=s===-1||u===-1?null:{start:s,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(gm={focusedElem:e,selectionRange:n},Bc=!1,ue=t;ue!==null;)if(t=ue,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ue=e;else for(;ue!==null;){t=ue;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var g=m.memoizedProps,x=m.memoizedState,y=t.stateNode,w=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:yr(t.type,g),x);y.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Q(163))}}catch(T){yt(t,t.return,T)}if(e=t.sibling,e!==null){e.return=t.return,ue=e;break}ue=t.return}return m=zx,zx=!1,m}function Mu(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 a=i.destroy;i.destroy=void 0,a!==void 0&&rg(t,n,a)}i=i.next}while(i!==r)}}function wd(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 ig(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 Vx(e){var t=e.alternate;t!==null&&(e.alternate=null,Vx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Dr],delete t[Su],delete t[bm],delete t[KD],delete t[XD])),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 $x(e){return e.tag===5||e.tag===3||e.tag===4}function Wx(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||$x(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 ag(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=Xc));else if(r!==4&&(e=e.child,e!==null))for(ag(e,t,n),e=e.sibling;e!==null;)ag(e,t,n),e=e.sibling}function og(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(og(e,t,n),e=e.sibling;e!==null;)og(e,t,n),e=e.sibling}var Ht=null,vr=!1;function $i(e,t,n){for(n=n.child;n!==null;)Yx(e,t,n),n=n.sibling}function Yx(e,t,n){if(Or&&typeof Or.onCommitFiberUnmount=="function")try{Or.onCommitFiberUnmount(Ic,n)}catch{}switch(n.tag){case 5:Xt||Go(n,t);case 6:var r=Ht,i=vr;Ht=null,$i(e,t,n),Ht=r,vr=i,Ht!==null&&(vr?(e=Ht,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ht.removeChild(n.stateNode));break;case 18:Ht!==null&&(vr?(e=Ht,n=n.stateNode,e.nodeType===8?wm(e.parentNode,n):e.nodeType===1&&wm(e,n),hu(e)):wm(Ht,n.stateNode));break;case 4:r=Ht,i=vr,Ht=n.stateNode.containerInfo,vr=!0,$i(e,t,n),Ht=r,vr=i;break;case 0:case 11:case 14:case 15:if(!Xt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&rg(n,t,o),i=i.next}while(i!==r)}$i(e,t,n);break;case 1:if(!Xt&&(Go(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){yt(n,t,s)}$i(e,t,n);break;case 21:$i(e,t,n);break;case 22:n.mode&1?(Xt=(r=Xt)||n.memoizedState!==null,$i(e,t,n),Xt=r):$i(e,t,n);break;default:$i(e,t,n)}}function qx(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new f6),t.forEach(function(r){var i=E6.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function wr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var a=e,o=t,s=o;e:for(;s!==null;){switch(s.tag){case 5:Ht=s.stateNode,vr=!1;break e;case 3:Ht=s.stateNode.containerInfo,vr=!0;break e;case 4:Ht=s.stateNode.containerInfo,vr=!0;break e}s=s.return}if(Ht===null)throw Error(Q(160));Yx(a,o,i),Ht=null,vr=!1;var u=i.alternate;u!==null&&(u.return=null),i.return=null}catch(l){yt(i,t,l)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Gx(t,e),t=t.sibling}function Gx(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(wr(t,e),Fr(e),r&4){try{Mu(3,e,e.return),wd(3,e)}catch(g){yt(e,e.return,g)}try{Mu(5,e,e.return)}catch(g){yt(e,e.return,g)}}break;case 1:wr(t,e),Fr(e),r&512&&n!==null&&Go(n,n.return);break;case 5:if(wr(t,e),Fr(e),r&512&&n!==null&&Go(n,n.return),e.flags&32){var i=e.stateNode;try{ru(i,"")}catch(g){yt(e,e.return,g)}}if(r&4&&(i=e.stateNode,i!=null)){var a=e.memoizedProps,o=n!==null?n.memoizedProps:a,s=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{s==="input"&&a.type==="radio"&&a.name!=null&&Ew(i,a),Fh(s,o);var l=Fh(s,a);for(o=0;o<u.length;o+=2){var c=u[o],d=u[o+1];c==="style"?Nw(i,d):c==="dangerouslySetInnerHTML"?kw(i,d):c==="children"?ru(i,d):bh(i,c,d,l)}switch(s){case"input":Ih(i,a);break;case"textarea":Sw(i,a);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var p=a.value;p!=null?Ao(i,!!a.multiple,p,!1):f!==!!a.multiple&&(a.defaultValue!=null?Ao(i,!!a.multiple,a.defaultValue,!0):Ao(i,!!a.multiple,a.multiple?[]:"",!1))}i[Su]=a}catch(g){yt(e,e.return,g)}}break;case 6:if(wr(t,e),Fr(e),r&4){if(e.stateNode===null)throw Error(Q(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(g){yt(e,e.return,g)}}break;case 3:if(wr(t,e),Fr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{hu(t.containerInfo)}catch(g){yt(e,e.return,g)}break;case 4:wr(t,e),Fr(e);break;case 13:wr(t,e),Fr(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(lg=xt())),r&4&&qx(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(Xt=(l=Xt)||c,wr(t,e),Xt=l):wr(t,e),Fr(e),r&8192){if(l=e.memoizedState!==null,(e.stateNode.isHidden=l)&&!c&&e.mode&1)for(ue=e,c=e.child;c!==null;){for(d=ue=c;ue!==null;){switch(f=ue,p=f.child,f.tag){case 0:case 11:case 14:case 15:Mu(4,f,f.return);break;case 1:Go(f,f.return);var m=f.stateNode;if(typeof m.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(g){yt(r,n,g)}}break;case 5:Go(f,f.return);break;case 22:if(f.memoizedState!==null){Qx(d);continue}}p!==null?(p.return=f,ue=p):Qx(d)}c=c.sibling}e:for(c=null,d=e;;){if(d.tag===5){if(c===null){c=d;try{i=d.stateNode,l?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(s=d.stateNode,u=d.memoizedProps.style,o=u!=null&&u.hasOwnProperty("display")?u.display:null,s.style.display=Rw("display",o))}catch(g){yt(e,e.return,g)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=l?"":d.memoizedProps}catch(g){yt(e,e.return,g)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:wr(t,e),Fr(e),r&4&&qx(e);break;case 21:break;default:wr(t,e),Fr(e)}}function Fr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if($x(n)){var r=n;break e}n=n.return}throw Error(Q(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(ru(i,""),r.flags&=-33);var a=Wx(e);og(e,a,i);break;case 3:case 4:var o=r.stateNode.containerInfo,s=Wx(e);ag(e,s,o);break;default:throw Error(Q(161))}}catch(u){yt(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function h6(e,t,n){ue=e,Kx(e)}function Kx(e,t,n){for(var r=(e.mode&1)!==0;ue!==null;){var i=ue,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||vd;if(!o){var s=i.alternate,u=s!==null&&s.memoizedState!==null||Xt;s=vd;var l=Xt;if(vd=o,(Xt=u)&&!l)for(ue=i;ue!==null;)o=ue,u=o.child,o.tag===22&&o.memoizedState!==null?Zx(i):u!==null?(u.return=o,ue=u):Zx(i);for(;a!==null;)ue=a,Kx(a),a=a.sibling;ue=i,vd=s,Xt=l}Xx(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,ue=a):Xx(e)}}function Xx(e){for(;ue!==null;){var t=ue;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Xt||wd(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Xt)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:yr(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&Qb(t,a,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}Qb(t,o,n)}break;case 5:var s=t.stateNode;if(n===null&&t.flags&4){n=s;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var l=t.alternate;if(l!==null){var c=l.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&hu(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Q(163))}Xt||t.flags&512&&ig(t)}catch(f){yt(t,t.return,f)}}if(t===e){ue=null;break}if(n=t.sibling,n!==null){n.return=t.return,ue=n;break}ue=t.return}}function Qx(e){for(;ue!==null;){var t=ue;if(t===e){ue=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ue=n;break}ue=t.return}}function Zx(e){for(;ue!==null;){var t=ue;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{wd(4,t)}catch(u){yt(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(u){yt(t,i,u)}}var a=t.return;try{ig(t)}catch(u){yt(t,a,u)}break;case 5:var o=t.return;try{ig(t)}catch(u){yt(t,o,u)}}}catch(u){yt(t,t.return,u)}if(t===e){ue=null;break}var s=t.sibling;if(s!==null){s.return=t.return,ue=s;break}ue=t.return}}var m6=Math.ceil,bd=ti.ReactCurrentDispatcher,sg=ti.ReactCurrentOwner,tr=ti.ReactCurrentBatchConfig,Ue=0,Dt=null,Ct=null,zt=0,Bn=0,Ko=ji(0),Pt=0,Fu=null,Va=0,xd=0,ug=0,Bu=null,xn=null,lg=0,Xo=1/0,li=null,Ed=!1,cg=null,Wi=null,Td=!1,Yi=null,_d=0,ju=0,dg=null,Sd=-1,Cd=0;function dn(){return Ue&6?xt():Sd!==-1?Sd:Sd=xt()}function qi(e){return e.mode&1?Ue&2&&zt!==0?zt&-zt:ZD.transition!==null?(Cd===0&&(Cd=Ww()),Cd):(e=qe,e!==0||(e=window.event,e=e===void 0?16:eb(e.type)),e):1}function br(e,t,n,r){if(50<ju)throw ju=0,dg=null,Error(Q(185));lu(e,n,r),(!(Ue&2)||e!==Dt)&&(e===Dt&&(!(Ue&2)&&(xd|=n),Pt===4&&Gi(e,zt)),En(e,r),n===1&&Ue===0&&!(t.mode&1)&&(Xo=xt()+500,ed&&Hi()))}function En(e,t){var n=e.callbackNode;ZO(e,t);var r=Lc(e,e===Dt?zt:0);if(r===0)n!==null&&zw(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&zw(n),t===1)e.tag===0?QD(eE.bind(null,e)):jb(eE.bind(null,e)),qD(function(){!(Ue&6)&&Hi()}),n=null;else{switch(Yw(r)){case 1:n=$h;break;case 4:n=Vw;break;case 16:n=Pc;break;case 536870912:n=$w;break;default:n=Pc}n=uE(n,Jx.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Jx(e,t){if(Sd=-1,Cd=0,Ue&6)throw Error(Q(327));var n=e.callbackNode;if(Qo()&&e.callbackNode!==n)return null;var r=Lc(e,e===Dt?zt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Ad(e,r);else{t=r;var i=Ue;Ue|=2;var a=nE();(Dt!==e||zt!==t)&&(li=null,Xo=xt()+500,Wa(e,t));do try{v6();break}catch(s){tE(e,s)}while(!0);Rm(),bd.current=a,Ue=i,Ct!==null?t=0:(Dt=null,zt=0,t=Pt)}if(t!==0){if(t===2&&(i=Wh(e),i!==0&&(r=i,t=fg(e,i))),t===1)throw n=Fu,Wa(e,0),Gi(e,r),En(e,xt()),n;if(t===6)Gi(e,r);else{if(i=e.current.alternate,!(r&30)&&!g6(i)&&(t=Ad(e,r),t===2&&(a=Wh(e),a!==0&&(r=a,t=fg(e,a))),t===1))throw n=Fu,Wa(e,0),Gi(e,r),En(e,xt()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(Q(345));case 2:Ya(e,xn,li);break;case 3:if(Gi(e,r),(r&130023424)===r&&(t=lg+500-xt(),10<t)){if(Lc(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){dn(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=vm(Ya.bind(null,e,xn,li),t);break}Ya(e,xn,li);break;case 4:if(Gi(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-hr(r);a=1<<o,o=t[o],o>i&&(i=o),r&=~a}if(r=i,r=xt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*m6(r/1960))-r,10<r){e.timeoutHandle=vm(Ya.bind(null,e,xn,li),r);break}Ya(e,xn,li);break;case 5:Ya(e,xn,li);break;default:throw Error(Q(329))}}}return En(e,xt()),e.callbackNode===n?Jx.bind(null,e):null}function fg(e,t){var n=Bu;return e.current.memoizedState.isDehydrated&&(Wa(e,t).flags|=256),e=Ad(e,t),e!==2&&(t=xn,xn=n,t!==null&&pg(t)),e}function pg(e){xn===null?xn=e:xn.push.apply(xn,e)}function g6(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],a=i.getSnapshot;i=i.value;try{if(!mr(a(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Gi(e,t){for(t&=~ug,t&=~xd,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-hr(t),r=1<<n;e[n]=-1,t&=~r}}function eE(e){if(Ue&6)throw Error(Q(327));Qo();var t=Lc(e,0);if(!(t&1))return En(e,xt()),null;var n=Ad(e,t);if(e.tag!==0&&n===2){var r=Wh(e);r!==0&&(t=r,n=fg(e,r))}if(n===1)throw n=Fu,Wa(e,0),Gi(e,t),En(e,xt()),n;if(n===6)throw Error(Q(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ya(e,xn,li),En(e,xt()),null}function hg(e,t){var n=Ue;Ue|=1;try{return e(t)}finally{Ue=n,Ue===0&&(Xo=xt()+500,ed&&Hi())}}function $a(e){Yi!==null&&Yi.tag===0&&!(Ue&6)&&Qo();var t=Ue;Ue|=1;var n=tr.transition,r=qe;try{if(tr.transition=null,qe=1,e)return e()}finally{qe=r,tr.transition=n,Ue=t,!(Ue&6)&&Hi()}}function mg(){Bn=Ko.current,rt(Ko)}function Wa(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,YD(n)),Ct!==null)for(n=Ct.return;n!==null;){var r=n;switch(_m(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Zc();break;case 3:Yo(),rt(vn),rt(qt),Fm();break;case 5:Lm(r);break;case 4:Yo();break;case 13:rt(dt);break;case 19:rt(dt);break;case 10:Nm(r.type._context);break;case 22:case 23:mg()}n=n.return}if(Dt=e,Ct=e=Ki(e.current,null),zt=Bn=t,Pt=0,Fu=null,ug=xd=Va=0,xn=Bu=null,Ua!==null){for(t=0;t<Ua.length;t++)if(n=Ua[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,r.next=o}n.pending=r}Ua=null}return e}function tE(e,t){do{var n=Ct;try{if(Rm(),cd.current=hd,dd){for(var r=ft.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}dd=!1}if(za=0,Ot=Nt=ft=null,Pu=!1,Iu=0,sg.current=null,n===null||n.return===null){Pt=1,Fu=t,Ct=null;break}e:{var a=e,o=n.return,s=n,u=t;if(t=zt,s.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var l=u,c=s,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var p=Cx(o);if(p!==null){p.flags&=-257,Ax(p,o,s,a,t),p.mode&1&&Sx(a,l,t),t=p,u=l;var m=t.updateQueue;if(m===null){var g=new Set;g.add(u),t.updateQueue=g}else m.add(u);break e}else{if(!(t&1)){Sx(a,l,t),gg();break e}u=Error(Q(426))}}else if(ot&&s.mode&1){var x=Cx(o);if(x!==null){!(x.flags&65536)&&(x.flags|=256),Ax(x,o,s,a,t),Am(qo(u,s));break e}}a=u=qo(u,s),Pt!==4&&(Pt=2),Bu===null?Bu=[a]:Bu.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var y=Tx(a,u,t);Xb(a,y);break e;case 1:s=u;var w=a.type,b=a.stateNode;if(!(a.flags&128)&&(typeof w.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Wi===null||!Wi.has(b)))){a.flags|=65536,t&=-t,a.lanes|=t;var T=_x(a,s,t);Xb(a,T);break e}}a=a.return}while(a!==null)}iE(n)}catch(S){t=S,Ct===n&&n!==null&&(Ct=n=n.return);continue}break}while(!0)}function nE(){var e=bd.current;return bd.current=hd,e===null?hd:e}function gg(){(Pt===0||Pt===3||Pt===2)&&(Pt=4),Dt===null||!(Va&268435455)&&!(xd&268435455)||Gi(Dt,zt)}function Ad(e,t){var n=Ue;Ue|=2;var r=nE();(Dt!==e||zt!==t)&&(li=null,Wa(e,t));do try{y6();break}catch(i){tE(e,i)}while(!0);if(Rm(),Ue=n,bd.current=r,Ct!==null)throw Error(Q(261));return Dt=null,zt=0,Pt}function y6(){for(;Ct!==null;)rE(Ct)}function v6(){for(;Ct!==null&&!VO();)rE(Ct)}function rE(e){var t=sE(e.alternate,e,Bn);e.memoizedProps=e.pendingProps,t===null?iE(e):Ct=t,sg.current=null}function iE(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=d6(n,t),n!==null){n.flags&=32767,Ct=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Pt=6,Ct=null;return}}else if(n=c6(n,t,Bn),n!==null){Ct=n;return}if(t=t.sibling,t!==null){Ct=t;return}Ct=t=e}while(t!==null);Pt===0&&(Pt=5)}function Ya(e,t,n){var r=qe,i=tr.transition;try{tr.transition=null,qe=1,w6(e,t,n,r)}finally{tr.transition=i,qe=r}return null}function w6(e,t,n,r){do Qo();while(Yi!==null);if(Ue&6)throw Error(Q(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(Q(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(JO(e,a),e===Dt&&(Ct=Dt=null,zt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Td||(Td=!0,uE(Pc,function(){return Qo(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=tr.transition,tr.transition=null;var o=qe;qe=1;var s=Ue;Ue|=4,sg.current=null,p6(e,n),Gx(n,e),jD(gm),Bc=!!mm,gm=mm=null,e.current=n,h6(n),$O(),Ue=s,qe=o,tr.transition=a}else e.current=n;if(Td&&(Td=!1,Yi=e,_d=i),a=e.pendingLanes,a===0&&(Wi=null),qO(n.stateNode),En(e,xt()),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(Ed)throw Ed=!1,e=cg,cg=null,e;return _d&1&&e.tag!==0&&Qo(),a=e.pendingLanes,a&1?e===dg?ju++:(ju=0,dg=e):ju=0,Hi(),null}function Qo(){if(Yi!==null){var e=Yw(_d),t=tr.transition,n=qe;try{if(tr.transition=null,qe=16>e?16:e,Yi===null)var r=!1;else{if(e=Yi,Yi=null,_d=0,Ue&6)throw Error(Q(331));var i=Ue;for(Ue|=4,ue=e.current;ue!==null;){var a=ue,o=a.child;if(ue.flags&16){var s=a.deletions;if(s!==null){for(var u=0;u<s.length;u++){var l=s[u];for(ue=l;ue!==null;){var c=ue;switch(c.tag){case 0:case 11:case 15:Mu(8,c,a)}var d=c.child;if(d!==null)d.return=c,ue=d;else for(;ue!==null;){c=ue;var f=c.sibling,p=c.return;if(Vx(c),c===l){ue=null;break}if(f!==null){f.return=p,ue=f;break}ue=p}}}var m=a.alternate;if(m!==null){var g=m.child;if(g!==null){m.child=null;do{var x=g.sibling;g.sibling=null,g=x}while(g!==null)}}ue=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,ue=o;else e:for(;ue!==null;){if(a=ue,a.flags&2048)switch(a.tag){case 0:case 11:case 15:Mu(9,a,a.return)}var y=a.sibling;if(y!==null){y.return=a.return,ue=y;break e}ue=a.return}}var w=e.current;for(ue=w;ue!==null;){o=ue;var b=o.child;if(o.subtreeFlags&2064&&b!==null)b.return=o,ue=b;else e:for(o=w;ue!==null;){if(s=ue,s.flags&2048)try{switch(s.tag){case 0:case 11:case 15:wd(9,s)}}catch(S){yt(s,s.return,S)}if(s===o){ue=null;break e}var T=s.sibling;if(T!==null){T.return=s.return,ue=T;break e}ue=s.return}}if(Ue=i,Hi(),Or&&typeof Or.onPostCommitFiberRoot=="function")try{Or.onPostCommitFiberRoot(Ic,e)}catch{}r=!0}return r}finally{qe=n,tr.transition=t}}return!1}function aE(e,t,n){t=qo(n,t),t=Tx(e,t,1),e=Vi(e,t,1),t=dn(),e!==null&&(lu(e,1,t),En(e,t))}function yt(e,t,n){if(e.tag===3)aE(e,e,n);else for(;t!==null;){if(t.tag===3){aE(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Wi===null||!Wi.has(r))){e=qo(n,e),e=_x(t,e,1),t=Vi(t,e,1),e=dn(),t!==null&&(lu(t,1,e),En(t,e));break}}t=t.return}}function b6(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=dn(),e.pingedLanes|=e.suspendedLanes&n,Dt===e&&(zt&n)===n&&(Pt===4||Pt===3&&(zt&130023424)===zt&&500>xt()-lg?Wa(e,0):ug|=n),En(e,t)}function oE(e,t){t===0&&(e.mode&1?(t=Dc,Dc<<=1,!(Dc&130023424)&&(Dc=4194304)):t=1);var n=dn();e=oi(e,t),e!==null&&(lu(e,t,n),En(e,n))}function x6(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),oE(e,n)}function E6(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(Q(314))}r!==null&&r.delete(t),oE(e,n)}var sE;sE=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||vn.current)bn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return bn=!1,l6(e,t,n);bn=!!(e.flags&131072)}else bn=!1,ot&&t.flags&1048576&&Ub(t,nd,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;yd(e,t),e=t.pendingProps;var i=jo(t,qt.current);Wo(t,n),i=Um(null,t,r,e,i,n);var a=Hm();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,wn(r)?(a=!0,Jc(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Om(t),i.updater=md,t.stateNode=i,i._reactInternals=t,qm(t,r,e,n),t=Qm(null,t,r,!0,a,n)):(t.tag=0,ot&&a&&Tm(t),cn(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(yd(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=_6(r),e=yr(r,e),i){case 0:t=Xm(null,t,r,e,n);break e;case 1:t=Ox(null,t,r,e,n);break e;case 11:t=kx(null,t,r,e,n);break e;case 14:t=Rx(null,t,r,yr(r.type,e),n);break e}throw Error(Q(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:yr(r,i),Xm(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:yr(r,i),Ox(e,t,r,i,n);case 3:e:{if(Dx(t),e===null)throw Error(Q(387));r=t.pendingProps,a=t.memoizedState,i=a.element,Kb(e,t),ud(t,r,null,n);var o=t.memoizedState;if(r=o.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=qo(Error(Q(423)),t),t=Lx(e,t,r,n,i);break e}else if(r!==i){i=qo(Error(Q(424)),t),t=Lx(e,t,r,n,i);break e}else for(Fn=Bi(t.stateNode.containerInfo.firstChild),Mn=t,ot=!0,gr=null,n=qb(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(zo(),r===i){t=ui(e,t,n);break e}cn(e,t,r,n)}t=t.child}return t;case 5:return Zb(t),e===null&&Cm(t),r=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,ym(r,i)?o=null:a!==null&&ym(r,a)&&(t.flags|=32),Ix(e,t),cn(e,t,o,n),t.child;case 6:return e===null&&Cm(t),null;case 13:return Mx(e,t,n);case 4:return Dm(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Vo(t,null,r,n):cn(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:yr(r,i),kx(e,t,r,i,n);case 7:return cn(e,t,t.pendingProps,n),t.child;case 8:return cn(e,t,t.pendingProps.children,n),t.child;case 12:return cn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,et(ad,r._currentValue),r._currentValue=o,a!==null)if(mr(a.value,o)){if(a.children===i.children&&!vn.current){t=ui(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var s=a.dependencies;if(s!==null){o=a.child;for(var u=s.firstContext;u!==null;){if(u.context===r){if(a.tag===1){u=si(-1,n&-n),u.tag=2;var l=a.updateQueue;if(l!==null){l=l.shared;var c=l.pending;c===null?u.next=u:(u.next=c.next,c.next=u),l.pending=u}}a.lanes|=n,u=a.alternate,u!==null&&(u.lanes|=n),Pm(a.return,n,t),s.lanes|=n;break}u=u.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(Q(341));o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),Pm(o,n,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}cn(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Wo(t,n),i=Jn(i),r=r(i),t.flags|=1,cn(e,t,r,n),t.child;case 14:return r=t.type,i=yr(r,t.pendingProps),i=yr(r.type,i),Rx(e,t,r,i,n);case 15:return Nx(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:yr(r,i),yd(e,t),t.tag=1,wn(r)?(e=!0,Jc(t)):e=!1,Wo(t,n),xx(t,r,i),qm(t,r,i,n),Qm(null,t,r,!0,e,n);case 19:return Bx(e,t,n);case 22:return Px(e,t,n)}throw Error(Q(156,t.tag))};function uE(e,t){return Hw(e,t)}function T6(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 nr(e,t,n,r){return new T6(e,t,n,r)}function yg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _6(e){if(typeof e=="function")return yg(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Th)return 11;if(e===Ch)return 14}return 2}function Ki(e,t){var n=e.alternate;return n===null?(n=nr(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 kd(e,t,n,r,i,a){var o=2;if(r=e,typeof e=="function")yg(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Co:return qa(n.children,i,a,t);case xh:o=8,i|=8;break;case Eh:return e=nr(12,n,t,i|2),e.elementType=Eh,e.lanes=a,e;case _h:return e=nr(13,n,t,i),e.elementType=_h,e.lanes=a,e;case Sh:return e=nr(19,n,t,i),e.elementType=Sh,e.lanes=a,e;case yw:return Rd(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case mw:o=10;break e;case gw:o=9;break e;case Th:o=11;break e;case Ch:o=14;break e;case Ni:o=16,r=null;break e}throw Error(Q(130,e==null?e:typeof e,""))}return t=nr(o,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function qa(e,t,n,r){return e=nr(7,e,r,t),e.lanes=n,e}function Rd(e,t,n,r){return e=nr(22,e,r,t),e.elementType=yw,e.lanes=n,e.stateNode={isHidden:!1},e}function vg(e,t,n){return e=nr(6,e,null,t),e.lanes=n,e}function wg(e,t,n){return t=nr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function S6(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=Yh(0),this.expirationTimes=Yh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yh(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function bg(e,t,n,r,i,a,o,s,u){return e=new S6(e,t,n,s,u),t===1?(t=1,a===!0&&(t|=8)):t=0,a=nr(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Om(a),e}function C6(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:So,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function lE(e){if(!e)return Ui;e=e._reactInternals;e:{if(La(e)!==e||e.tag!==1)throw Error(Q(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(wn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Q(171))}if(e.tag===1){var n=e.type;if(wn(n))return Fb(e,n,t)}return t}function cE(e,t,n,r,i,a,o,s,u){return e=bg(n,r,!0,e,i,a,o,s,u),e.context=lE(null),n=e.current,r=dn(),i=qi(n),a=si(r,i),a.callback=t??null,Vi(n,a,i),e.current.lanes=i,lu(e,i,r),En(e,r),e}function Nd(e,t,n,r){var i=t.current,a=dn(),o=qi(i);return n=lE(n),t.context===null?t.context=n:t.pendingContext=n,t=si(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Vi(i,t,o),e!==null&&(br(e,i,o,a),sd(e,i,o)),o}function Pd(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 dE(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function xg(e,t){dE(e,t),(e=e.alternate)&&dE(e,t)}function A6(){return null}var fE=typeof reportError=="function"?reportError:function(e){console.error(e)};function Eg(e){this._internalRoot=e}Id.prototype.render=Eg.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Q(409));Nd(e,t,null,null)},Id.prototype.unmount=Eg.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;$a(function(){Nd(null,e,null,null)}),t[ni]=null}};function Id(e){this._internalRoot=e}Id.prototype.unstable_scheduleHydration=function(e){if(e){var t=Kw();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Li.length&&t!==0&&t<Li[n].priority;n++);Li.splice(n,0,e),n===0&&Zw(e)}};function Tg(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Od(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function pE(){}function k6(e,t,n,r,i){if(i){if(typeof r=="function"){var a=r;r=function(){var l=Pd(o);a.call(l)}}var o=cE(t,r,e,0,null,!1,!1,"",pE);return e._reactRootContainer=o,e[ni]=o.current,Tu(e.nodeType===8?e.parentNode:e),$a(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var s=r;r=function(){var l=Pd(u);s.call(l)}}var u=bg(e,0,!1,null,null,!1,!1,"",pE);return e._reactRootContainer=u,e[ni]=u.current,Tu(e.nodeType===8?e.parentNode:e),$a(function(){Nd(t,u,n,r)}),u}function Dd(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i=="function"){var s=i;i=function(){var u=Pd(o);s.call(u)}}Nd(t,o,e,i)}else o=k6(n,t,e,i,r);return Pd(o)}qw=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=uu(t.pendingLanes);n!==0&&(qh(t,n|1),En(t,xt()),!(Ue&6)&&(Xo=xt()+500,Hi()))}break;case 13:$a(function(){var r=oi(e,1);if(r!==null){var i=dn();br(r,e,1,i)}}),xg(e,1)}},Gh=function(e){if(e.tag===13){var t=oi(e,134217728);if(t!==null){var n=dn();br(t,e,134217728,n)}xg(e,134217728)}},Gw=function(e){if(e.tag===13){var t=qi(e),n=oi(e,t);if(n!==null){var r=dn();br(n,e,t,r)}xg(e,t)}},Kw=function(){return qe},Xw=function(e,t){var n=qe;try{return qe=e,t()}finally{qe=n}},Uh=function(e,t,n){switch(t){case"input":if(Ih(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=Qc(r);if(!i)throw Error(Q(90));bw(r),Ih(r,i)}}}break;case"textarea":Sw(e,n);break;case"select":t=n.value,t!=null&&Ao(e,!!n.multiple,t,!1)}},Dw=hg,Lw=$a;var R6={usingClientEntryPoint:!1,Events:[Cu,Fo,Qc,Iw,Ow,hg]},Uu={findFiberByHostInstance:Ma,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},N6={bundleType:Uu.bundleType,version:Uu.version,rendererPackageName:Uu.rendererPackageName,rendererConfig:Uu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ti.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=jw(e),e===null?null:e.stateNode},findFiberByHostInstance:Uu.findFiberByHostInstance||A6,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 Ld=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ld.isDisabled&&Ld.supportsFiber)try{Ic=Ld.inject(N6),Or=Ld}catch{}}On.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=R6,On.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Tg(t))throw Error(Q(200));return C6(e,t,null,n)},On.createRoot=function(e,t){if(!Tg(e))throw Error(Q(299));var n=!1,r="",i=fE;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=bg(e,1,!1,null,null,n,!1,r,i),e[ni]=t.current,Tu(e.nodeType===8?e.parentNode:e),new Eg(t)},On.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(Q(188)):(e=Object.keys(e).join(","),Error(Q(268,e)));return e=jw(t),e=e===null?null:e.stateNode,e},On.flushSync=function(e){return $a(e)},On.hydrate=function(e,t,n){if(!Od(t))throw Error(Q(200));return Dd(null,e,t,!0,n)},On.hydrateRoot=function(e,t,n){if(!Tg(e))throw Error(Q(405));var r=n!=null&&n.hydratedSources||null,i=!1,a="",o=fE;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=cE(t,null,e,1,n??null,i,!1,a,o),e[ni]=t.current,Tu(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 Id(t)},On.render=function(e,t,n){if(!Od(t))throw Error(Q(200));return Dd(null,e,t,!1,n)},On.unmountComponentAtNode=function(e){if(!Od(e))throw Error(Q(40));return e._reactRootContainer?($a(function(){Dd(null,null,e,!1,function(){e._reactRootContainer=null,e[ni]=null})}),!0):!1},On.unstable_batchedUpdates=hg,On.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Od(n))throw Error(Q(200));if(e==null||e._reactInternals===void 0)throw Error(Q(38));return Dd(e,t,n,!1,r)},On.version="18.3.1-next-f1338f8080-20240426";function hE(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(hE)}catch(e){console.error(e)}}hE(),lw.exports=On;var Zo=lw.exports,mE,gE=Zo;mE=gE.createRoot,gE.hydrateRoot;const yE="3.0.16";function Md(e){"@babel/helpers - typeof";return Md=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Md(e)}var P6=/^\s+/,I6=/\s+$/;function fe(e,t){if(e=e||"",t=t||{},e instanceof fe)return e;if(!(this instanceof fe))return new fe(e,t);var n=O6(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}fe.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),n,r,i,a,o,s;return n=t.r/255,r=t.g/255,i=t.b/255,n<=.03928?a=n/12.92:a=Math.pow((n+.055)/1.055,2.4),r<=.03928?o=r/12.92:o=Math.pow((r+.055)/1.055,2.4),i<=.03928?s=i/12.92:s=Math.pow((i+.055)/1.055,2.4),.2126*a+.7152*o+.0722*s},setAlpha:function(t){return this._a=TE(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=wE(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=wE(this._r,this._g,this._b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.v*100);return this._a==1?"hsv("+n+", "+r+"%, "+i+"%)":"hsva("+n+", "+r+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var t=vE(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=vE(this._r,this._g,this._b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.l*100);return this._a==1?"hsl("+n+", "+r+"%, "+i+"%)":"hsla("+n+", "+r+"%, "+i+"%, "+this._roundA+")"},toHex:function(t){return bE(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return F6(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(st(this._r,255)*100)+"%",g:Math.round(st(this._g,255)*100)+"%",b:Math.round(st(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(st(this._r,255)*100)+"%, "+Math.round(st(this._g,255)*100)+"%, "+Math.round(st(this._b,255)*100)+"%)":"rgba("+Math.round(st(this._r,255)*100)+"%, "+Math.round(st(this._g,255)*100)+"%, "+Math.round(st(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:K6[bE(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var n="#"+xE(this._r,this._g,this._b,this._a),r=n,i=this._gradientType?"GradientType = 1, ":"";if(t){var a=fe(t);r="#"+xE(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+n+",endColorstr="+r+")"},toString:function(t){var n=!!t;t=t||this._format;var r=!1,i=this._a<1&&this._a>=0,a=!n&&i&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return a?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return fe(this.toString())},_applyModification:function(t,n){var r=t.apply(null,[this].concat([].slice.call(n)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(H6,arguments)},brighten:function(){return this._applyModification(z6,arguments)},darken:function(){return this._applyModification(V6,arguments)},desaturate:function(){return this._applyModification(B6,arguments)},saturate:function(){return this._applyModification(j6,arguments)},greyscale:function(){return this._applyModification(U6,arguments)},spin:function(){return this._applyModification($6,arguments)},_applyCombination:function(t,n){return t.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(q6,arguments)},complement:function(){return this._applyCombination(W6,arguments)},monochromatic:function(){return this._applyCombination(G6,arguments)},splitcomplement:function(){return this._applyCombination(Y6,arguments)},triad:function(){return this._applyCombination(EE,[3])},tetrad:function(){return this._applyCombination(EE,[4])}},fe.fromRatio=function(e,t){if(Md(e)=="object"){var n={};for(var r in e)e.hasOwnProperty(r)&&(r==="a"?n[r]=e[r]:n[r]=Hu(e[r]));e=n}return fe(e,t)};function O6(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,a=null,o=!1,s=!1;return typeof e=="string"&&(e=J6(e)),Md(e)=="object"&&(ci(e.r)&&ci(e.g)&&ci(e.b)?(t=D6(e.r,e.g,e.b),o=!0,s=String(e.r).substr(-1)==="%"?"prgb":"rgb"):ci(e.h)&&ci(e.s)&&ci(e.v)?(r=Hu(e.s),i=Hu(e.v),t=M6(e.h,r,i),o=!0,s="hsv"):ci(e.h)&&ci(e.s)&&ci(e.l)&&(r=Hu(e.s),a=Hu(e.l),t=L6(e.h,r,a),o=!0,s="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=TE(n),{ok:o,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}function D6(e,t,n){return{r:st(e,255)*255,g:st(t,255)*255,b:st(n,255)*255}}function vE(e,t,n){e=st(e,255),t=st(t,255),n=st(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),a,o,s=(r+i)/2;if(r==i)a=o=0;else{var u=r-i;switch(o=s>.5?u/(2-r-i):u/(r+i),r){case e:a=(t-n)/u+(t<n?6:0);break;case t:a=(n-e)/u+2;break;case n:a=(e-t)/u+4;break}a/=6}return{h:a,s:o,l:s}}function L6(e,t,n){var r,i,a;e=st(e,360),t=st(t,100),n=st(n,100);function o(l,c,d){return d<0&&(d+=1),d>1&&(d-=1),d<1/6?l+(c-l)*6*d:d<1/2?c:d<2/3?l+(c-l)*(2/3-d)*6:l}if(t===0)r=i=a=n;else{var s=n<.5?n*(1+t):n+t-n*t,u=2*n-s;r=o(u,s,e+1/3),i=o(u,s,e),a=o(u,s,e-1/3)}return{r:r*255,g:i*255,b:a*255}}function wE(e,t,n){e=st(e,255),t=st(t,255),n=st(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),a,o,s=r,u=r-i;if(o=r===0?0:u/r,r==i)a=0;else{switch(r){case e:a=(t-n)/u+(t<n?6:0);break;case t:a=(n-e)/u+2;break;case n:a=(e-t)/u+4;break}a/=6}return{h:a,s:o,v:s}}function M6(e,t,n){e=st(e,360)*6,t=st(t,100),n=st(n,100);var r=Math.floor(e),i=e-r,a=n*(1-t),o=n*(1-i*t),s=n*(1-(1-i)*t),u=r%6,l=[n,o,a,a,s,n][u],c=[s,n,n,o,a,a][u],d=[a,a,s,n,n,o][u];return{r:l*255,g:c*255,b:d*255}}function bE(e,t,n,r){var i=[xr(Math.round(e).toString(16)),xr(Math.round(t).toString(16)),xr(Math.round(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function F6(e,t,n,r,i){var a=[xr(Math.round(e).toString(16)),xr(Math.round(t).toString(16)),xr(Math.round(n).toString(16)),xr(_E(r))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function xE(e,t,n,r){var i=[xr(_E(r)),xr(Math.round(e).toString(16)),xr(Math.round(t).toString(16)),xr(Math.round(n).toString(16))];return i.join("")}fe.equals=function(e,t){return!e||!t?!1:fe(e).toRgbString()==fe(t).toRgbString()},fe.random=function(){return fe.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function B6(e,t){t=t===0?0:t||10;var n=fe(e).toHsl();return n.s-=t/100,n.s=Fd(n.s),fe(n)}function j6(e,t){t=t===0?0:t||10;var n=fe(e).toHsl();return n.s+=t/100,n.s=Fd(n.s),fe(n)}function U6(e){return fe(e).desaturate(100)}function H6(e,t){t=t===0?0:t||10;var n=fe(e).toHsl();return n.l+=t/100,n.l=Fd(n.l),fe(n)}function z6(e,t){t=t===0?0:t||10;var n=fe(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),fe(n)}function V6(e,t){t=t===0?0:t||10;var n=fe(e).toHsl();return n.l-=t/100,n.l=Fd(n.l),fe(n)}function $6(e,t){var n=fe(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,fe(n)}function W6(e){var t=fe(e).toHsl();return t.h=(t.h+180)%360,fe(t)}function EE(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var n=fe(e).toHsl(),r=[fe(e)],i=360/t,a=1;a<t;a++)r.push(fe({h:(n.h+a*i)%360,s:n.s,l:n.l}));return r}function Y6(e){var t=fe(e).toHsl(),n=t.h;return[fe(e),fe({h:(n+72)%360,s:t.s,l:t.l}),fe({h:(n+216)%360,s:t.s,l:t.l})]}function q6(e,t,n){t=t||6,n=n||30;var r=fe(e).toHsl(),i=360/n,a=[fe(e)];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,a.push(fe(r));return a}function G6(e,t){t=t||6;for(var n=fe(e).toHsv(),r=n.h,i=n.s,a=n.v,o=[],s=1/t;t--;)o.push(fe({h:r,s:i,v:a})),a=(a+s)%1;return o}fe.mix=function(e,t,n){n=n===0?0:n||50;var r=fe(e).toRgb(),i=fe(t).toRgb(),a=n/100,o={r:(i.r-r.r)*a+r.r,g:(i.g-r.g)*a+r.g,b:(i.b-r.b)*a+r.b,a:(i.a-r.a)*a+r.a};return fe(o)},fe.readability=function(e,t){var n=fe(e),r=fe(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)},fe.isReadable=function(e,t,n){var r=fe.readability(e,t),i,a;switch(a=!1,i=eL(n),i.level+i.size){case"AAsmall":case"AAAlarge":a=r>=4.5;break;case"AAlarge":a=r>=3;break;case"AAAsmall":a=r>=7;break}return a},fe.mostReadable=function(e,t,n){var r=null,i=0,a,o,s,u;n=n||{},o=n.includeFallbackColors,s=n.level,u=n.size;for(var l=0;l<t.length;l++)a=fe.readability(e,t[l]),a>i&&(i=a,r=fe(t[l]));return fe.isReadable(e,r,{level:s,size:u})||!o?r:(n.includeFallbackColors=!1,fe.mostReadable(e,["#fff","#000"],n))};var _g=fe.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},K6=fe.hexNames=X6(_g);function X6(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function TE(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function st(e,t){Q6(e)&&(e="100%");var n=Z6(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function Fd(e){return Math.min(1,Math.max(0,e))}function jn(e){return parseInt(e,16)}function Q6(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function Z6(e){return typeof e=="string"&&e.indexOf("%")!=-1}function xr(e){return e.length==1?"0"+e:""+e}function Hu(e){return e<=1&&(e=e*100+"%"),e}function _E(e){return Math.round(parseFloat(e)*255).toString(16)}function SE(e){return jn(e)/255}var Er=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",n="(?:"+t+")|(?:"+e+")",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",i="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function ci(e){return!!Er.CSS_UNIT.exec(e)}function J6(e){e=e.replace(P6,"").replace(I6,"").toLowerCase();var t=!1;if(_g[e])e=_g[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=Er.rgb.exec(e))?{r:n[1],g:n[2],b:n[3]}:(n=Er.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Er.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=Er.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Er.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=Er.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Er.hex8.exec(e))?{r:jn(n[1]),g:jn(n[2]),b:jn(n[3]),a:SE(n[4]),format:t?"name":"hex8"}:(n=Er.hex6.exec(e))?{r:jn(n[1]),g:jn(n[2]),b:jn(n[3]),format:t?"name":"hex"}:(n=Er.hex4.exec(e))?{r:jn(n[1]+""+n[1]),g:jn(n[2]+""+n[2]),b:jn(n[3]+""+n[3]),a:SE(n[4]+""+n[4]),format:t?"name":"hex8"}:(n=Er.hex3.exec(e))?{r:jn(n[1]+""+n[1]),g:jn(n[2]+""+n[2]),b:jn(n[3]+""+n[3]),format:t?"name":"hex"}:!1}function eL(e){var t,n;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:t,size:n}}const tL=400,CE=600,Bd={widgetMinHeight:"min-h-[400px]",widgetMaxHeight:"max-h-[600px]",widgetHeight:"h-[600px]"},AE=({primary:e="hsl(0, 0%, 0%)"})=>{const t=fe(e).toHsl(),n=fe(e).isLight()?"240 10% 3.9%":"0 0% 100%";return{"--opencx-primary":`${t.h} ${t.s*100}% ${t.l*100}%`,"--opencx-primary-foreground":n,"--opencx-background":"0 0% 100%","--opencx-foreground":"240 10% 3.9%","--opencx-accent":"240 4.8% 95.9%","--opencx-accent-foreground":"240 5.9% 10%","--opencx-destructive":"0 84.2% 60.2%","--opencx-destructive-foreground":"0 0% 98%","--opencx-secondary":"240 4.8% 95.9%","--opencx-secondary-foreground":"240 5.9% 10%","--opencx-muted":"240 4.8% 95.9%","--opencx-muted-foreground":"240 3.8% 46.1%","--opencx-input":"240 5.9% 90%","--opencx-border":"240 5.9% 90%","--opencx-ring":"240 5.9% 10%"}};function nL(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))})}function zu(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Sg=e=>Array.isArray(e);function kE(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}function Vu(e){return typeof e=="string"||Array.isArray(e)}function RE(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Cg(e,t,n,r){if(typeof t=="function"){const[i,a]=RE(r);t=t(n!==void 0?n:e.custom,i,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,a]=RE(r);t=t(n!==void 0?n:e.custom,i,a)}return t}function jd(e,t,n){const r=e.getProps();return Cg(r,t,n!==void 0?n:r.custom,e)}const Ag=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],kg=["initial",...Ag],$u=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Xi=new Set($u),di=e=>e*1e3,fi=e=>e/1e3,rL={type:"spring",stiffness:500,damping:25,restSpeed:10},iL=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),aL={type:"keyframes",duration:.8},oL={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},sL=(e,{keyframes:t})=>t.length>2?aL:Xi.has(e)?e.startsWith("scale")?iL(t[1]):rL:oL;function Rg(e,t){return e?e[t]||e.default||e:void 0}const uL={skipAnimations:!1,useManualTiming:!1},lL=e=>e!==null;function Ud(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(lL),a=t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const Qt=e=>e;function cL(e){let t=new Set,n=new Set,r=!1,i=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function s(l){a.has(l)&&(u.schedule(l),e()),l(o)}const u={schedule:(l,c=!1,d=!1)=>{const p=d&&r?t:n;return c&&a.add(l),p.has(l)||p.add(l),l},cancel:l=>{n.delete(l),a.delete(l)},process:l=>{if(o=l,r){i=!0;return}r=!0,[t,n]=[n,t],n.clear(),t.forEach(s),r=!1,i&&(i=!1,u.process(l))}};return u}const Hd=["read","resolveKeyframes","update","preRender","render","postRender"],dL=40;function NE(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Hd.reduce((y,w)=>(y[w]=cL(a),y),{}),{read:s,resolveKeyframes:u,update:l,preRender:c,render:d,postRender:f}=o,p=()=>{const y=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(y-i.timestamp,dL),1),i.timestamp=y,i.isProcessing=!0,s.process(i),u.process(i),l.process(i),c.process(i),d.process(i),f.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(p))},m=()=>{n=!0,r=!0,i.isProcessing||e(p)};return{schedule:Hd.reduce((y,w)=>{const b=o[w];return y[w]=(T,S=!1,_=!1)=>(n||m(),b.schedule(T,S,_)),y},{}),cancel:y=>{for(let w=0;w<Hd.length;w++)o[Hd[w]].cancel(y)},state:i,steps:o}}const{schedule:Xe,cancel:Qi,state:Vt,steps:Ng}=NE(typeof requestAnimationFrame<"u"?requestAnimationFrame:Qt,!0),PE=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,fL=1e-7,pL=12;function hL(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=PE(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>fL&&++s<pL);return o}function Wu(e,t,n,r){if(e===t&&n===r)return Qt;const i=a=>hL(a,0,1,e,n);return a=>a===0||a===1?a:PE(i(a),t,r)}const IE=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,OE=e=>t=>1-e(1-t),DE=Wu(.33,1.53,.69,.99),Pg=OE(DE),LE=IE(Pg),ME=e=>(e*=2)<1?.5*Pg(e):.5*(2-Math.pow(2,-10*(e-1))),Ig=e=>1-Math.sin(Math.acos(e)),FE=OE(Ig),BE=IE(Ig),jE=e=>/^0[^.\s]+$/u.test(e);function mL(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||jE(e):!0}let Og=Qt;const UE=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),HE=e=>t=>typeof t=="string"&&t.startsWith(e),zE=HE("--"),gL=HE("var(--"),Dg=e=>gL(e)?yL.test(e.split("/*")[0].trim()):!1,yL=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,vL=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function wL(e){const t=vL.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function VE(e,t,n=1){const[r,i]=wL(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const o=a.trim();return UE(o)?parseFloat(o):o}return Dg(i)?VE(i,t,n+1):i}const Zi=(e,t,n)=>n>t?t:n<e?e:n,Jo={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Yu={...Jo,transform:e=>Zi(0,1,e)},zd={...Jo,default:1},qu=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ji=qu("deg"),Br=qu("%"),ye=qu("px"),bL=qu("vh"),xL=qu("vw"),$E={...Br,parse:e=>Br.parse(e)/100,transform:e=>Br.transform(e*100)},EL=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),WE=e=>e===Jo||e===ye,YE=(e,t)=>parseFloat(e.split(", ")[t]),qE=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return YE(i[1],t);{const a=r.match(/^matrix\((.+)\)$/u);return a?YE(a[1],e):0}},TL=new Set(["x","y","z"]),_L=$u.filter(e=>!TL.has(e));function SL(e){const t=[];return _L.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const es={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:qE(4,13),y:qE(5,14)};es.translateX=es.x,es.translateY=es.y;const GE=e=>t=>t.test(e),KE=[Jo,ye,Br,Ji,xL,bL,{test:e=>e==="auto",parse:e=>e}],XE=e=>KE.find(GE(e)),Ga=new Set;let Lg=!1,Mg=!1;function QE(){if(Mg){const e=Array.from(Ga).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=SL(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(([a,o])=>{var s;(s=r.getValue(a))===null||s===void 0||s.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Mg=!1,Lg=!1,Ga.forEach(e=>e.complete()),Ga.clear()}function ZE(){Ga.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Mg=!0)})}function CL(){ZE(),QE()}class Fg{constructor(t,n,r,i,a,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=a,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ga.add(this),Lg||(Lg=!0,Xe.read(ZE),Xe.resolveKeyframes(QE))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let a=0;a<t.length;a++)if(t[a]===null)if(a===0){const o=i==null?void 0:i.get(),s=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const u=r.readValue(n,s);u!=null&&(t[0]=u)}t[0]===void 0&&(t[0]=s),i&&o===void 0&&i.set(t[0])}else t[a]=t[a-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ga.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ga.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Gu=e=>Math.round(e*1e5)/1e5,Bg=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function AL(e){return e==null}const kL=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,jg=(e,t)=>n=>!!(typeof n=="string"&&kL.test(n)&&n.startsWith(e)||t&&!AL(n)&&Object.prototype.hasOwnProperty.call(n,t)),JE=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,a,o,s]=r.match(Bg);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s!==void 0?parseFloat(s):1}},RL=e=>Zi(0,255,e),Ug={...Jo,transform:e=>Math.round(RL(e))},Ka={test:jg("rgb","red"),parse:JE("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Ug.transform(e)+", "+Ug.transform(t)+", "+Ug.transform(n)+", "+Gu(Yu.transform(r))+")"};function NL(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 Hg={test:jg("#"),parse:NL,transform:Ka.transform},ts={test:jg("hsl","hue"),parse:JE("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Br.transform(Gu(t))+", "+Br.transform(Gu(n))+", "+Gu(Yu.transform(r))+")"},Zt={test:e=>Ka.test(e)||Hg.test(e)||ts.test(e),parse:e=>Ka.test(e)?Ka.parse(e):ts.test(e)?ts.parse(e):Hg.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ka.transform(e):ts.transform(e)},PL=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function IL(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Bg))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(PL))===null||n===void 0?void 0:n.length)||0)>0}const eT="number",tT="color",OL="var",DL="var(",nT="${}",LL=/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 Ku(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let a=0;const s=t.replace(LL,u=>(Zt.test(u)?(r.color.push(a),i.push(tT),n.push(Zt.parse(u))):u.startsWith(DL)?(r.var.push(a),i.push(OL),n.push(u)):(r.number.push(a),i.push(eT),n.push(parseFloat(u))),++a,nT)).split(nT);return{values:n,split:s,indexes:r,types:i}}function rT(e){return Ku(e).values}function iT(e){const{split:t,types:n}=Ku(e),r=t.length;return i=>{let a="";for(let o=0;o<r;o++)if(a+=t[o],i[o]!==void 0){const s=n[o];s===eT?a+=Gu(i[o]):s===tT?a+=Zt.transform(i[o]):a+=i[o]}return a}}const ML=e=>typeof e=="number"?0:e;function FL(e){const t=rT(e);return iT(e)(t.map(ML))}const ea={test:IL,parse:rT,createTransformer:iT,getAnimatableNone:FL},BL=new Set(["brightness","contrast","saturate","opacity"]);function jL(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Bg)||[];if(!r)return e;const i=n.replace(r,"");let a=BL.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+i+")"}const UL=/\b([a-z-]*)\(.*?\)/gu,zg={...ea,getAnimatableNone:e=>{const t=e.match(UL);return t?t.map(jL).join(" "):e}},HL={borderWidth:ye,borderTopWidth:ye,borderRightWidth:ye,borderBottomWidth:ye,borderLeftWidth:ye,borderRadius:ye,radius:ye,borderTopLeftRadius:ye,borderTopRightRadius:ye,borderBottomRightRadius:ye,borderBottomLeftRadius:ye,width:ye,maxWidth:ye,height:ye,maxHeight:ye,top:ye,right:ye,bottom:ye,left:ye,padding:ye,paddingTop:ye,paddingRight:ye,paddingBottom:ye,paddingLeft:ye,margin:ye,marginTop:ye,marginRight:ye,marginBottom:ye,marginLeft:ye,backgroundPositionX:ye,backgroundPositionY:ye},zL={rotate:Ji,rotateX:Ji,rotateY:Ji,rotateZ:Ji,scale:zd,scaleX:zd,scaleY:zd,scaleZ:zd,skew:Ji,skewX:Ji,skewY:Ji,distance:ye,translateX:ye,translateY:ye,translateZ:ye,x:ye,y:ye,z:ye,perspective:ye,transformPerspective:ye,opacity:Yu,originX:$E,originY:$E,originZ:ye},aT={...Jo,transform:Math.round},Vg={...HL,...zL,zIndex:aT,size:ye,fillOpacity:Yu,strokeOpacity:Yu,numOctaves:aT},VL={...Vg,color:Zt,backgroundColor:Zt,outlineColor:Zt,fill:Zt,stroke:Zt,borderColor:Zt,borderTopColor:Zt,borderRightColor:Zt,borderBottomColor:Zt,borderLeftColor:Zt,filter:zg,WebkitFilter:zg},$g=e=>VL[e];function oT(e,t){let n=$g(e);return n!==zg&&(n=ea),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const $L=new Set(["auto","none","0"]);function WL(e,t,n){let r=0,i;for(;r<e.length&&!i;){const a=e[r];typeof a=="string"&&!$L.has(a)&&Ku(a).values.length&&(i=e[r]),r++}if(i&&n)for(const a of t)e[a]=oT(n,i)}class sT extends Fg{constructor(t,n,r,i,a){super(t,n,r,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<t.length;u++){let l=t[u];if(typeof l=="string"&&(l=l.trim(),Dg(l))){const c=VE(l,n.current);c!==void 0&&(t[u]=c),u===t.length-1&&(this.finalKeyframe=l)}}if(this.resolveNoneKeyframes(),!EL.has(r)||t.length!==2)return;const[i,a]=t,o=XE(i),s=XE(a);if(o!==s)if(WE(o)&&WE(s))for(let u=0;u<t.length;u++){const l=t[u];typeof l=="string"&&(t[u]=parseFloat(l))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)mL(t[i])&&r.push(i);r.length&&WL(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=es[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 t;const{element:n,name:r,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const a=n.getValue(r);a&&a.jump(this.measuredOrigin,!1);const o=i.length-1,s=i[o];i[o]=es[r](n.measureViewportBox(),window.getComputedStyle(n.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([u,l])=>{n.getValue(u).set(l)}),this.resolveNoneKeyframes()}}function Wg(e){return typeof e=="function"}let Vd;function YL(){Vd=void 0}const jr={now:()=>(Vd===void 0&&jr.set(Vt.isProcessing||uL.useManualTiming?Vt.timestamp:performance.now()),Vd),set:e=>{Vd=e,queueMicrotask(YL)}},uT=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ea.test(e)||e==="0")&&!e.startsWith("url("));function qL(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 GL(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],o=uT(i,t),s=uT(a,t);return!o||!s?!1:qL(e)||(n==="spring"||Wg(n))&&r}const KL=40;class lT{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:o="loop",...s}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=jr.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:a,repeatType:o,...s},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>KL?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&CL(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=jr.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:a,delay:o,onComplete:s,onUpdate:u,isGenerator:l}=this.options;if(!l&&!GL(t,r,i,a))if(o)this.options.duration=0;else{u==null||u(Ud(t,this.options,n)),s==null||s(),this.resolveFinishedPromise();return}const c=this.initPlayback(t,n);c!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...c},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}function cT(e,t){return t?e*(1e3/t):0}const XL=5;function dT(e,t,n){const r=Math.max(t-XL,0);return cT(n-e(r),t-r)}const Yg=.001,QL=.01,ZL=10,JL=.05,e4=1;function t4({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,a,o=1-t;o=Zi(JL,e4,o),e=Zi(QL,ZL,fi(e)),o<1?(i=l=>{const c=l*o,d=c*e,f=c-n,p=qg(l,o),m=Math.exp(-d);return Yg-f/p*m},a=l=>{const d=l*o*e,f=d*n+n,p=Math.pow(o,2)*Math.pow(l,2)*e,m=Math.exp(-d),g=qg(Math.pow(l,2),o);return(-i(l)+Yg>0?-1:1)*((f-p)*m)/g}):(i=l=>{const c=Math.exp(-l*e),d=(l-n)*e+1;return-Yg+c*d},a=l=>{const c=Math.exp(-l*e),d=(n-l)*(e*e);return c*d});const s=5/e,u=r4(i,a,s);if(e=di(e),isNaN(u))return{stiffness:100,damping:10,duration:e};{const l=Math.pow(u,2)*r;return{stiffness:l,damping:o*2*Math.sqrt(r*l),duration:e}}}const n4=12;function r4(e,t,n){let r=n;for(let i=1;i<n4;i++)r=r-e(r)/t(r);return r}function qg(e,t){return e*Math.sqrt(1-t*t)}const i4=["duration","bounce"],a4=["stiffness","damping","mass"];function fT(e,t){return t.some(n=>e[n]!==void 0)}function o4(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!fT(e,a4)&&fT(e,i4)){const n=t4(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}function pT({keyframes:e,restDelta:t,restSpeed:n,...r}){const i=e[0],a=e[e.length-1],o={done:!1,value:i},{stiffness:s,damping:u,mass:l,duration:c,velocity:d,isResolvedFromDuration:f}=o4({...r,velocity:-fi(r.velocity||0)}),p=d||0,m=u/(2*Math.sqrt(s*l)),g=a-i,x=fi(Math.sqrt(s/l)),y=Math.abs(g)<5;n||(n=y?.01:2),t||(t=y?.005:.5);let w;if(m<1){const b=qg(x,m);w=T=>{const S=Math.exp(-m*x*T);return a-S*((p+m*x*g)/b*Math.sin(b*T)+g*Math.cos(b*T))}}else if(m===1)w=b=>a-Math.exp(-x*b)*(g+(p+x*g)*b);else{const b=x*Math.sqrt(m*m-1);w=T=>{const S=Math.exp(-m*x*T),_=Math.min(b*T,300);return a-S*((p+m*x*g)*Math.sinh(_)+b*g*Math.cosh(_))/b}}return{calculatedDuration:f&&c||null,next:b=>{const T=w(b);if(f)o.done=b>=c;else{let S=0;m<1&&(S=b===0?di(p):dT(w,b,T));const _=Math.abs(S)<=n,N=Math.abs(a-T)<=t;o.done=_&&N}return o.value=o.done?a:T,o}}}function hT({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:u,restDelta:l=.5,restSpeed:c}){const d=e[0],f={done:!1,value:d},p=D=>s!==void 0&&D<s||u!==void 0&&D>u,m=D=>s===void 0?u:u===void 0||Math.abs(s-D)<Math.abs(u-D)?s:u;let g=n*t;const x=d+g,y=o===void 0?x:o(x);y!==x&&(g=y-d);const w=D=>-g*Math.exp(-D/r),b=D=>y+w(D),T=D=>{const V=w(D),P=b(D);f.done=Math.abs(V)<=l,f.value=f.done?y:P};let S,_;const N=D=>{p(f.value)&&(S=D,_=pT({keyframes:[f.value,m(f.value)],velocity:dT(b,D,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:c}))};return N(0),{calculatedDuration:null,next:D=>{let V=!1;return!_&&S===void 0&&(V=!0,T(D),N(D)),S!==void 0&&D>=S?_.next(D-S):(!V&&T(D),f)}}}const s4=Wu(.42,0,1,1),u4=Wu(0,0,.58,1),mT=Wu(.42,0,.58,1),l4=e=>Array.isArray(e)&&typeof e[0]!="number",Gg=e=>Array.isArray(e)&&typeof e[0]=="number",gT={linear:Qt,easeIn:s4,easeInOut:mT,easeOut:u4,circIn:Ig,circInOut:BE,circOut:FE,backIn:Pg,backInOut:LE,backOut:DE,anticipate:ME},yT=e=>{if(Gg(e)){Og(e.length===4);const[t,n,r,i]=e;return Wu(t,n,r,i)}else if(typeof e=="string")return Og(gT[e]!==void 0),gT[e];return e},c4=(e,t)=>n=>t(e(n)),pi=(...e)=>e.reduce(c4),ns=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},pt=(e,t,n)=>e+(t-e)*n;function Kg(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 d4({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{const s=n<.5?n*(1+t):n+t-n*t,u=2*n-s;i=Kg(u,s,e+1/3),a=Kg(u,s,e),o=Kg(u,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function $d(e,t){return n=>n>0?t:e}const Xg=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},f4=[Hg,Ka,ts],p4=e=>f4.find(t=>t.test(e));function vT(e){const t=p4(e);if(!t)return!1;let n=t.parse(e);return t===ts&&(n=d4(n)),n}const wT=(e,t)=>{const n=vT(e),r=vT(t);if(!n||!r)return $d(e,t);const i={...n};return a=>(i.red=Xg(n.red,r.red,a),i.green=Xg(n.green,r.green,a),i.blue=Xg(n.blue,r.blue,a),i.alpha=pt(n.alpha,r.alpha,a),Ka.transform(i))},Qg=new Set(["none","hidden"]);function h4(e,t){return Qg.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function m4(e,t){return n=>pt(e,t,n)}function Zg(e){return typeof e=="number"?m4:typeof e=="string"?Dg(e)?$d:Zt.test(e)?wT:v4:Array.isArray(e)?bT:typeof e=="object"?Zt.test(e)?wT:g4:$d}function bT(e,t){const n=[...e],r=n.length,i=e.map((a,o)=>Zg(a)(a,t[o]));return a=>{for(let o=0;o<r;o++)n[o]=i[o](a);return n}}function g4(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Zg(e[i])(e[i],t[i]));return i=>{for(const a in r)n[a]=r[a](i);return n}}function y4(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const o=t.types[a],s=e.indexes[o][i[o]],u=(n=e.values[s])!==null&&n!==void 0?n:0;r[a]=u,i[o]++}return r}const v4=(e,t)=>{const n=ea.createTransformer(t),r=Ku(e),i=Ku(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?Qg.has(e)&&!i.values.length||Qg.has(t)&&!r.values.length?h4(e,t):pi(bT(y4(r,i),i.values),n):$d(e,t)};function xT(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?pt(e,t,n):Zg(e)(e,t)}function w4(e,t,n){const r=[],i=n||xT,a=e.length-1;for(let o=0;o<a;o++){let s=i(e[o],e[o+1]);if(t){const u=Array.isArray(t)?t[o]||Qt:t;s=pi(u,s)}r.push(s)}return r}function b4(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const a=e.length;if(Og(a===t.length),a===1)return()=>t[0];if(a===2&&e[0]===e[1])return()=>t[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=w4(t,r,i),s=o.length,u=l=>{let c=0;if(s>1)for(;c<e.length-2&&!(l<e[c+1]);c++);const d=ns(e[c],e[c+1],l);return o[c](d)};return n?l=>u(Zi(e[0],e[a-1],l)):u}function x4(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=ns(0,t,r);e.push(pt(n,1,i))}}function E4(e){const t=[0];return x4(t,e.length-1),t}function T4(e,t){return e.map(n=>n*t)}function _4(e,t){return e.map(()=>t||mT).splice(0,e.length-1)}function Wd({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=l4(r)?r.map(yT):yT(r),a={done:!1,value:t[0]},o=T4(n&&n.length===t.length?n:E4(t),e),s=b4(o,t,{ease:Array.isArray(i)?i:_4(t,i)});return{calculatedDuration:e,next:u=>(a.value=s(u),a.done=u>=e,a)}}const ET=2e4;function S4(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<ET;)t+=n,r=e.next(t);return t>=ET?1/0:t}const C4=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Xe.update(t,!0),stop:()=>Qi(t),now:()=>Vt.isProcessing?Vt.timestamp:jr.now()}},A4={decay:hT,inertia:hT,tween:Wd,keyframes:Wd,spring:pT},k4=e=>e/100;class Jg extends lT{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:u}=this.options;u&&u()};const{name:n,motionValue:r,element:i,keyframes:a}=this.options,o=(i==null?void 0:i.KeyframeResolver)||Fg,s=(u,l)=>this.onKeyframesResolved(u,l);this.resolver=new o(a,s,n,r,i),this.resolver.scheduleResolve()}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:a,velocity:o=0}=this.options,s=Wg(n)?n:A4[n]||Wd;let u,l;s!==Wd&&typeof t[0]!="number"&&(u=pi(k4,xT(t[0],t[1])),t=[0,100]);const c=s({...this.options,keyframes:t});a==="mirror"&&(l=s({...this.options,keyframes:[...t].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=S4(c));const{calculatedDuration:d}=c,f=d+i,p=f*(r+1)-i;return{generator:c,mirroredGenerator:l,mapPercentToKeyframes:u,calculatedDuration:d,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:D}=this.options;return{done:!0,value:D[D.length-1]}}const{finalKeyframe:i,generator:a,mirroredGenerator:o,mapPercentToKeyframes:s,keyframes:u,calculatedDuration:l,totalDuration:c,resolvedDuration:d}=r;if(this.startTime===null)return a.next(0);const{delay:f,repeat:p,repeatType:m,repeatDelay:g,onUpdate:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-c/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 y=this.currentTime-f*(this.speed>=0?1:-1),w=this.speed>=0?y<0:y>c;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let b=this.currentTime,T=a;if(p){const D=Math.min(this.currentTime,c)/d;let V=Math.floor(D),P=D%1;!P&&D>=1&&(P=1),P===1&&V--,V=Math.min(V,p+1),!!(V%2)&&(m==="reverse"?(P=1-P,g&&(P-=g/d)):m==="mirror"&&(T=o)),b=Zi(0,1,P)*d}const S=w?{done:!1,value:u[0]}:T.next(b);s&&(S.value=s(S.value));let{done:_}=S;!w&&l!==null&&(_=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const N=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&_);return N&&i!==void 0&&(S.value=Ud(u,this.options,i)),x&&x(S.value),N&&this.finish(),S}get duration(){const{resolved:t}=this;return t?fi(t.calculatedDuration):0}get time(){return fi(this.currentTime)}set time(t){t=di(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=fi(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=C4,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),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(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t: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)}}const TT=new Set(["opacity","clipPath","filter","transform"]),R4=10,N4=(e,t)=>{let n="";const r=Math.max(Math.round(t/R4),2);for(let i=0;i<r;i++)n+=e(ns(0,r-1,i))+", ";return`linear(${n.substring(0,n.length-2)})`};function e0(e){let t;return()=>(t===void 0&&(t=e()),t)}const P4={linearEasing:void 0};function I4(e,t){const n=e0(e);return()=>{var r;return(r=P4[t])!==null&&r!==void 0?r:n()}}const Yd=I4(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");function _T(e){return!!(typeof e=="function"&&Yd()||!e||typeof e=="string"&&(e in t0||Yd())||Gg(e)||Array.isArray(e)&&e.every(_T))}const Xu=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,t0={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Xu([0,.65,.55,1]),circOut:Xu([.55,0,1,.45]),backIn:Xu([.31,.01,.66,-.59]),backOut:Xu([.33,1.53,.69,.99])};function ST(e,t){if(e)return typeof e=="function"&&Yd()?N4(e,t):Gg(e)?Xu(e):Array.isArray(e)?e.map(n=>ST(n,t)||t0.easeOut):t0[e]}function O4(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o="loop",ease:s,times:u}={}){const l={[t]:n};u&&(l.offset=u);const c=ST(s,i);return Array.isArray(c)&&(l.easing=c),e.animate(l,{delay:r,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"})}function CT(e,t){e.timeline=t,e.onfinish=null}const D4=e0(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),qd=10,L4=2e4;function M4(e){return Wg(e.type)||e.type==="spring"||!_T(e.ease)}function F4(e,t){const n=new Jg({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let a=0;for(;!r.done&&a<L4;)r=n.sample(a),i.push(r.value),a+=qd;return{times:void 0,keyframes:i,duration:a-qd,ease:"linear"}}const AT={anticipate:ME,backInOut:LE,circInOut:BE};function B4(e){return e in AT}class kT extends lT{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:a}=this.options;this.resolver=new sT(a,(o,s)=>this.onKeyframesResolved(o,s),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){var r;let{duration:i=300,times:a,ease:o,type:s,motionValue:u,name:l,startTime:c}=this.options;if(!(!((r=u.owner)===null||r===void 0)&&r.current))return!1;if(typeof o=="string"&&Yd()&&B4(o)&&(o=AT[o]),M4(this.options)){const{onComplete:f,onUpdate:p,motionValue:m,element:g,...x}=this.options,y=F4(t,x);t=y.keyframes,t.length===1&&(t[1]=t[0]),i=y.duration,a=y.times,o=y.ease,s="keyframes"}const d=O4(u.owner.current,l,t,{...this.options,duration:i,times:a,ease:o});return d.startTime=c??this.calcStartTime(),this.pendingTimeline?(CT(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;u.set(Ud(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:i,times:a,type:s,ease:o,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return fi(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return fi(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=di(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}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 Qt;const{animation:r}=n;CT(r,t)}return Qt}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:a,ease:o,times:s}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:l,onUpdate:c,onComplete:d,element:f,...p}=this.options,m=new Jg({...p,keyframes:r,duration:i,type:a,ease:o,times:s,isGenerator:!0}),g=di(this.time);l.setWithVelocity(m.sample(g-qd).value,m.sample(g).value,qd)}const{onStop:u}=this.options;u&&u(),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:a,damping:o,type:s}=t;return D4()&&r&&TT.has(r)&&n&&n.owner&&n.owner.current instanceof HTMLElement&&!n.owner.getProps().onUpdate&&!i&&a!=="mirror"&&o!==0&&s!=="inertia"}}const j4=e0(()=>window.ScrollTimeline!==void 0);class U4{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}then(t,n){return Promise.all(this.animations).then(t).catch(n)}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=>j4()&&i.attachTimeline?i.attachTimeline(t):n(i));return()=>{r.forEach((i,a)=>{i&&i(),this.animations[a].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]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function H4({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:s,from:u,elapsed:l,...c}){return!!Object.keys(c).length}const n0=(e,t,n,r={},i,a)=>o=>{const s=Rg(r,e)||{},u=s.delay||r.delay||0;let{elapsed:l=0}=r;l=l-di(u);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-l,onUpdate:f=>{t.set(f),s.onUpdate&&s.onUpdate(f)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};H4(s)||(c={...c,...sL(e,c)}),c.duration&&(c.duration=di(c.duration)),c.repeatDelay&&(c.repeatDelay=di(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let d=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(d=!0)),d&&!a&&t.get()!==void 0){const f=Ud(c.keyframes,s);if(f!==void 0)return Xe.update(()=>{c.onUpdate(f),c.onComplete()}),new U4([])}return!a&&kT.supports(c)?new kT(c):new Jg(c)},z4=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),V4=e=>Sg(e)?e[e.length-1]||0:e;function r0(e,t){e.indexOf(t)===-1&&e.push(t)}function i0(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class a0{constructor(){this.subscriptions=[]}add(t){return r0(this.subscriptions,t),()=>i0(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 a=0;a<i;a++){const o=this.subscriptions[a];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const RT=30,$4=e=>!isNaN(parseFloat(e));class W4{constructor(t,n={}){this.version="11.11.9",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const a=jr.now();this.updatedAt!==a&&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=jr.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=$4(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 a0);const r=this.events[t].add(n);return t==="change"?()=>{r(),Xe.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=jr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>RT)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,RT);return cT(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 Qu(e,t){return new W4(e,t)}function Y4(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Qu(n))}function q4(e,t){const n=jd(e,t);let{transitionEnd:r={},transition:i={},...a}=n||{};a={...a,...r};for(const o in a){const s=V4(a[o]);Y4(e,o,s)}}const Gd=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),NT="data-"+Gd("framerAppearId");function PT(e){return e.props[NT]}const Jt=e=>!!(e&&e.getVelocity);function G4(e){return!!(Jt(e)&&e.add)}function o0(e,t){if(!e.applyWillChange)return;const n=e.getValue("willChange");if(G4(n))return n.add(t)}function K4({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function IT(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var a;let{transition:o=e.getDefaultTransition(),transitionEnd:s,...u}=t;r&&(o=r);const l=[],c=i&&e.animationState&&e.animationState.getState()[i];for(const d in u){const f=e.getValue(d,(a=e.latestValues[d])!==null&&a!==void 0?a:null),p=u[d];if(p===void 0||c&&K4(c,d))continue;const m={delay:n,...Rg(o||{},d)};let g=!1;if(window.MotionHandoffAnimation){const y=PT(e);if(y){const w=window.MotionHandoffAnimation(y,d,Xe);w!==null&&(m.startTime=w,g=!0)}}o0(e,d),f.start(n0(d,f,p,e.shouldReduceMotion&&Xi.has(d)?{type:!1}:m,e,g));const x=f.animation;x&&l.push(x)}return s&&Promise.all(l).then(()=>{Xe.update(()=>{s&&q4(e,s)})}),l}function s0(e,t,n={}){var r;const i=jd(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(a=n.transitionOverride);const o=i?()=>Promise.all(IT(e,i,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:d,staggerDirection:f}=a;return X4(e,t,c+l,d,f,n)}:()=>Promise.resolve(),{when:u}=a;if(u){const[l,c]=u==="beforeChildren"?[o,s]:[s,o];return l().then(()=>c())}else return Promise.all([o(),s(n.delay)])}function X4(e,t,n=0,r=0,i=1,a){const o=[],s=(e.variantChildren.size-1)*r,u=i===1?(l=0)=>l*r:(l=0)=>s-l*r;return Array.from(e.variantChildren).sort(Q4).forEach((l,c)=>{l.notify("AnimationStart",t),o.push(s0(l,t,{...a,delay:n+u(c)}).then(()=>l.notify("AnimationComplete",t)))}),Promise.all(o)}function Q4(e,t){return e.sortNodePosition(t)}function Z4(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(a=>s0(e,a,n));r=Promise.all(i)}else if(typeof t=="string")r=s0(e,t,n);else{const i=typeof t=="function"?jd(e,t,n.custom):t;r=Promise.all(IT(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const J4=kg.length;function OT(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?OT(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<J4;n++){const r=kg[n],i=e.props[r];(Vu(i)||i===!1)&&(t[r]=i)}return t}const eM=[...Ag].reverse(),tM=Ag.length;function nM(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Z4(e,n,r)))}function rM(e){let t=nM(e),n=DT(),r=!0;const i=u=>(l,c)=>{var d;const f=jd(e,c,u==="exit"?(d=e.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(f){const{transition:p,transitionEnd:m,...g}=f;l={...l,...g,...m}}return l};function a(u){t=u(e)}function o(u){const{props:l}=e,c=OT(e.parent)||{},d=[],f=new Set;let p={},m=1/0;for(let x=0;x<tM;x++){const y=eM[x],w=n[y],b=l[y]!==void 0?l[y]:c[y],T=Vu(b),S=y===u?w.isActive:null;S===!1&&(m=x);let _=b===c[y]&&b!==l[y]&&T;if(_&&r&&e.manuallyAnimateOnMount&&(_=!1),w.protectedKeys={...p},!w.isActive&&S===null||!b&&!w.prevProp||zu(b)||typeof b=="boolean")continue;const N=iM(w.prevProp,b);let D=N||y===u&&w.isActive&&!_&&T||x>m&&T,V=!1;const P=Array.isArray(b)?b:[b];let $=P.reduce(i(y),{});S===!1&&($={});const{prevResolvedValues:H={}}=w,X={...H,...$},Y=ee=>{D=!0,f.has(ee)&&(V=!0,f.delete(ee)),w.needsAnimating[ee]=!0;const F=e.getValue(ee);F&&(F.liveStyle=!1)};for(const ee in X){const F=$[ee],B=H[ee];if(p.hasOwnProperty(ee))continue;let A=!1;Sg(F)&&Sg(B)?A=!kE(F,B):A=F!==B,A?F!=null?Y(ee):f.add(ee):F!==void 0&&f.has(ee)?Y(ee):w.protectedKeys[ee]=!0}w.prevProp=b,w.prevResolvedValues=$,w.isActive&&(p={...p,...$}),r&&e.blockInitialAnimation&&(D=!1),D&&(!(_&&N)||V)&&d.push(...P.map(ee=>({animation:ee,options:{type:y}})))}if(f.size){const x={};f.forEach(y=>{const w=e.getBaseTarget(y),b=e.getValue(y);b&&(b.liveStyle=!0),x[y]=w??null}),d.push({animation:x})}let g=!!d.length;return r&&(l.initial===!1||l.initial===l.animate)&&!e.manuallyAnimateOnMount&&(g=!1),r=!1,g?t(d):Promise.resolve()}function s(u,l){var c;if(n[u].isActive===l)return Promise.resolve();(c=e.variantChildren)===null||c===void 0||c.forEach(f=>{var p;return(p=f.animationState)===null||p===void 0?void 0:p.setActive(u,l)}),n[u].isActive=l;const d=o(u);for(const f in n)n[f].protectedKeys={};return d}return{animateChanges:o,setActive:s,setAnimateFunction:a,getState:()=>n,reset:()=>{n=DT(),r=!0}}}function iM(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!kE(t,e):!1}function Xa(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function DT(){return{animate:Xa(!0),whileInView:Xa(),whileHover:Xa(),whileTap:Xa(),whileDrag:Xa(),whileFocus:Xa(),exit:Xa()}}class ta{constructor(t){this.isMounted=!1,this.node=t}update(){}}class aM extends ta{constructor(t){super(t),t.animationState||(t.animationState=rM(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();zu(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===void 0||t.call(this)}}let oM=0;class sM extends ta{constructor(){super(...arguments),this.id=oM++}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}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const uM={animation:{Feature:aM},exit:{Feature:sM}},LT=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Kd(e,t="page"){return{point:{x:e[`${t}X`],y:e[`${t}Y`]}}}const lM=e=>t=>LT(t)&&e(t,Kd(t));function hi(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function mi(e,t,n,r){return hi(e,t,lM(n),r)}const MT=(e,t)=>Math.abs(e-t);function cM(e,t){const n=MT(e.x,t.x),r=MT(e.y,t.y);return Math.sqrt(n**2+r**2)}class FT{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:a=!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 d=l0(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,p=cM(d.offset,{x:0,y:0})>=3;if(!f&&!p)return;const{point:m}=d,{timestamp:g}=Vt;this.history.push({...m,timestamp:g});const{onStart:x,onMove:y}=this.handlers;f||(x&&x(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=u0(f,this.transformPagePoint),Xe.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();const{onEnd:p,onSessionEnd:m,resumeAnimation:g}=this.handlers;if(this.dragSnapToOrigin&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=l0(d.type==="pointercancel"?this.lastMoveEventInfo:u0(f,this.transformPagePoint),this.history);this.startEvent&&p&&p(d,x),m&&m(d,x)},!LT(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=Kd(t),s=u0(o,this.transformPagePoint),{point:u}=s,{timestamp:l}=Vt;this.history=[{...u,timestamp:l}];const{onSessionStart:c}=n;c&&c(t,l0(s,this.history)),this.removeListeners=pi(mi(this.contextWindow,"pointermove",this.handlePointerMove),mi(this.contextWindow,"pointerup",this.handlePointerUp),mi(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Qi(this.updatePoint)}}function u0(e,t){return t?{point:t(e.point)}:e}function BT(e,t){return{x:e.x-t.x,y:e.y-t.y}}function l0({point:e},t){return{point:e,delta:BT(e,jT(t)),offset:BT(e,dM(t)),velocity:fM(t,.1)}}function dM(e){return e[0]}function jT(e){return e[e.length-1]}function fM(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=jT(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>di(t)));)n--;if(!r)return{x:0,y:0};const a=fi(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};const o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function UT(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const HT=UT("dragHorizontal"),zT=UT("dragVertical");function VT(e){let t=!1;if(e==="y")t=zT();else if(e==="x")t=HT();else{const n=HT(),r=zT();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function $T(){const e=VT(!0);return e?(e(),!1):!0}function rs(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}const WT=1e-4,pM=1-WT,hM=1+WT,YT=.01,mM=0-YT,gM=0+YT;function Un(e){return e.max-e.min}function yM(e,t,n){return Math.abs(e-t)<=n}function qT(e,t,n,r=.5){e.origin=r,e.originPoint=pt(t.min,t.max,e.origin),e.scale=Un(n)/Un(t),e.translate=pt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=pM&&e.scale<=hM||isNaN(e.scale))&&(e.scale=1),(e.translate>=mM&&e.translate<=gM||isNaN(e.translate))&&(e.translate=0)}function Zu(e,t,n,r){qT(e.x,t.x,n.x,r?r.originX:void 0),qT(e.y,t.y,n.y,r?r.originY:void 0)}function GT(e,t,n){e.min=n.min+t.min,e.max=e.min+Un(t)}function vM(e,t,n){GT(e.x,t.x,n.x),GT(e.y,t.y,n.y)}function KT(e,t,n){e.min=t.min-n.min,e.max=e.min+Un(t)}function Ju(e,t,n){KT(e.x,t.x,n.x),KT(e.y,t.y,n.y)}function wM(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?pt(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?pt(n,e,r.max):Math.min(e,n)),e}function XT(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 bM(e,{top:t,left:n,bottom:r,right:i}){return{x:XT(e.x,n,i),y:XT(e.y,t,r)}}function QT(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 xM(e,t){return{x:QT(e.x,t.x),y:QT(e.y,t.y)}}function EM(e,t){let n=.5;const r=Un(e),i=Un(t);return i>r?n=ns(t.min,t.max-r,e.min):r>i&&(n=ns(e.min,e.max-i,t.min)),Zi(0,1,n)}function TM(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 c0=.35;function _M(e=c0){return e===!1?e=0:e===!0&&(e=c0),{x:ZT(e,"left","right"),y:ZT(e,"top","bottom")}}function ZT(e,t,n){return{min:JT(e,t),max:JT(e,n)}}function JT(e,t){return typeof e=="number"?e:e[t]||0}const e2=()=>({translate:0,scale:1,origin:0,originPoint:0}),is=()=>({x:e2(),y:e2()}),t2=()=>({min:0,max:0}),Et=()=>({x:t2(),y:t2()});function rr(e){return[e("x"),e("y")]}function n2({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function SM({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function CM(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}}function d0(e){return e===void 0||e===1}function f0({scale:e,scaleX:t,scaleY:n}){return!d0(e)||!d0(t)||!d0(n)}function Qa(e){return f0(e)||r2(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function r2(e){return i2(e.x)||i2(e.y)}function i2(e){return e&&e!=="0%"}function Xd(e,t,n){const r=e-n,i=t*r;return n+i}function a2(e,t,n,r,i){return i!==void 0&&(e=Xd(e,i,r)),Xd(e,n,r)+t}function p0(e,t=0,n=1,r,i){e.min=a2(e.min,t,n,r,i),e.max=a2(e.max,t,n,r,i)}function o2(e,{x:t,y:n}){p0(e.x,t.translate,t.scale,t.originPoint),p0(e.y,n.translate,n.scale,n.originPoint)}const s2=.999999999999,u2=1.0000000000001;function AM(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;const{visualElement:u}=a.options;u&&u.props.style&&u.props.style.display==="contents"||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&os(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,o2(e,o)),r&&Qa(a.latestValues)&&os(e,a.latestValues))}t.x<u2&&t.x>s2&&(t.x=1),t.y<u2&&t.y>s2&&(t.y=1)}function as(e,t){e.min=e.min+t,e.max=e.max+t}function l2(e,t,n,r,i=.5){const a=pt(e.min,e.max,i);p0(e,t,n,a,r)}function os(e,t){l2(e.x,t.x,t.scaleX,t.scale,t.originX),l2(e.y,t.y,t.scaleY,t.scale,t.originY)}function c2(e,t){return n2(CM(e.getBoundingClientRect(),t))}function kM(e,t,n){const r=c2(e,n),{scroll:i}=t;return i&&(as(r.x,i.offset.x),as(r.y,i.offset.y)),r}const d2=({current:e})=>e?e.ownerDocument.defaultView:null,RM=new WeakMap;class NM{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Et(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=c=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Kd(c,"page").point)},a=(c,d)=>{const{drag:f,dragPropagation:p,onDragStart:m}=this.getProps();if(f&&!p&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=VT(f),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),rr(x=>{let y=this.getAxisMotionValue(x).get()||0;if(Br.test(y)){const{projection:w}=this.visualElement;if(w&&w.layout){const b=w.layout.layoutBox[x];b&&(y=Un(b)*(parseFloat(y)/100))}}this.originPoint[x]=y}),m&&Xe.postRender(()=>m(c,d)),o0(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},o=(c,d)=>{const{dragPropagation:f,dragDirectionLock:p,onDirectionLock:m,onDrag:g}=this.getProps();if(!f&&!this.openGlobalLock)return;const{offset:x}=d;if(p&&this.currentDirection===null){this.currentDirection=PM(x),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",d.point,x),this.updateAxis("y",d.point,x),this.visualElement.render(),g&&g(c,d)},s=(c,d)=>this.stop(c,d),u=()=>rr(c=>{var d;return this.getAnimationState(c)==="paused"&&((d=this.getAxisMotionValue(c).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:l}=this.getProps();this.panSession=new FT(t,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,contextWindow:d2(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&Xe.postRender(()=>a(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.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Qd(t,i,this.currentDirection))return;const a=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=wM(o,this.constraints[t],this.elastic[t])),a.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,a=this.constraints;n&&rs(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=bM(i.layoutBox,n):this.constraints=!1,this.elastic=_M(r),a!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&rr(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=TM(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!rs(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const a=kM(r,i.root,this.visualElement.getTransformPagePoint());let o=xM(i.layout.layoutBox,a);if(n){const s=n(SM(o));this.hasMutatedConstraints=!!s,s&&(o=n2(s))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),u=this.constraints||{},l=rr(c=>{if(!Qd(c,n,this.currentDirection))return;let d=u&&u[c]||{};o&&(d={min:0,max:0});const f=i?200:1e6,p=i?40:1e7,m={type:"inertia",velocity:r?t[c]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...a,...d};return this.startAxisValueAnimation(c,m)});return Promise.all(l).then(s)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return o0(this.visualElement,t),r.start(n0(t,r,0,n,this.visualElement,!1))}stopAnimation(){rr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){rr(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?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){rr(n=>{const{drag:r}=this.getProps();if(!Qd(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,a=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:s}=i.layout.layoutBox[n];a.set(t[n]-pt(o,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!rs(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};rr(o=>{const s=this.getAxisMotionValue(o);if(s&&this.constraints!==!1){const u=s.get();i[o]=EM({min:u,max:u},this.constraints[o])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),rr(o=>{if(!Qd(o,t,null))return;const s=this.getAxisMotionValue(o),{min:u,max:l}=this.constraints[o];s.set(pt(u,l,i[o]))})}addListeners(){if(!this.visualElement.current)return;RM.set(this.visualElement,this);const t=this.visualElement.current,n=mi(t,"pointerdown",u=>{const{drag:l,dragListener:c=!0}=this.getProps();l&&c&&this.start(u)}),r=()=>{const{dragConstraints:u}=this.getProps();rs(u)&&u.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,a=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Xe.read(r);const o=hi(window,"resize",()=>this.scalePositionWithinConstraints()),s=i.addEventListener("didUpdate",({delta:u,hasLayoutChanged:l})=>{this.isDragging&&l&&(rr(c=>{const d=this.getAxisMotionValue(c);d&&(this.originPoint[c]+=u[c].translate,d.set(d.get()+u[c].translate))}),this.visualElement.render())});return()=>{o(),n(),a(),s&&s()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:o=c0,dragMomentum:s=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:a,dragElastic:o,dragMomentum:s}}}function Qd(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function PM(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class IM extends ta{constructor(t){super(t),this.removeGroupControls=Qt,this.removeListeners=Qt,this.controls=new NM(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Qt}unmount(){this.removeGroupControls(),this.removeListeners()}}const f2=e=>(t,n)=>{e&&Xe.postRender(()=>e(t,n))};class OM extends ta{constructor(){super(...arguments),this.removePointerDownListener=Qt}onPointerDown(t){this.session=new FT(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:d2(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:f2(t),onStart:f2(n),onMove:r,onEnd:(a,o)=>{delete this.session,i&&Xe.postRender(()=>i(a,o))}}}mount(){this.removePointerDownListener=mi(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 Zd=v.createContext(null);function DM(){const e=v.useContext(Zd);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=v.useId();v.useEffect(()=>r(i),[]);const a=v.useCallback(()=>n&&n(i),[i,n]);return!t&&n?[!1,a]:[!0]}const h0=v.createContext({}),p2=v.createContext({}),Jd={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function h2(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const el={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ye.test(e))e=parseFloat(e);else return e;const n=h2(e,t.target.x),r=h2(e,t.target.y);return`${n}% ${r}%`}},LM={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=ea.parse(e);if(i.length>5)return r;const a=ea.createTransformer(e),o=typeof i[0]!="number"?1:0,s=n.x.scale*t.x,u=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=u;const l=pt(s,u,.5);return typeof i[2+o]=="number"&&(i[2+o]/=l),typeof i[3+o]=="number"&&(i[3+o]/=l),a(i)}},ef={};function MM(e){Object.assign(ef,e)}const{schedule:m0,cancel:Eie}=NE(queueMicrotask,!1);class FM extends v.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:a}=t;MM(BM),a&&(n.group&&n.group.add(a),r&&r.register&&i&&r.register(a),a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),Jd.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:a}=this.props,o=r.projection;return o&&(o.isPresent=a,i||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?o.promote():o.relegate()||Xe.postRender(()=>{const s=o.getStack();(!s||!s.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),m0.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 m2(e){const[t,n]=DM(),r=v.useContext(h0);return E.jsx(FM,{...e,layoutGroup:r,switchLayoutGroup:v.useContext(p2),isPresent:t,safeToRemove:n})}const BM={borderRadius:{...el,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:el,borderTopRightRadius:el,borderBottomLeftRadius:el,borderBottomRightRadius:el,boxShadow:LM},g2=["TopLeft","TopRight","BottomLeft","BottomRight"],jM=g2.length,y2=e=>typeof e=="string"?parseFloat(e):e,v2=e=>typeof e=="number"||ye.test(e);function UM(e,t,n,r,i,a){i?(e.opacity=pt(0,n.opacity!==void 0?n.opacity:1,HM(r)),e.opacityExit=pt(t.opacity!==void 0?t.opacity:1,0,zM(r))):a&&(e.opacity=pt(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<jM;o++){const s=`border${g2[o]}Radius`;let u=w2(t,s),l=w2(n,s);if(u===void 0&&l===void 0)continue;u||(u=0),l||(l=0),u===0||l===0||v2(u)===v2(l)?(e[s]=Math.max(pt(y2(u),y2(l),r),0),(Br.test(l)||Br.test(u))&&(e[s]+="%")):e[s]=l}(t.rotate||n.rotate)&&(e.rotate=pt(t.rotate||0,n.rotate||0,r))}function w2(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const HM=b2(0,.5,FE),zM=b2(.5,.95,Qt);function b2(e,t,n){return r=>r<e?0:r>t?1:n(ns(e,t,r))}function x2(e,t){e.min=t.min,e.max=t.max}function ir(e,t){x2(e.x,t.x),x2(e.y,t.y)}function E2(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function T2(e,t,n,r,i){return e-=t,e=Xd(e,1/n,r),i!==void 0&&(e=Xd(e,1/i,r)),e}function VM(e,t=0,n=1,r=.5,i,a=e,o=e){if(Br.test(t)&&(t=parseFloat(t),t=pt(o.min,o.max,t/100)-o.min),typeof t!="number")return;let s=pt(a.min,a.max,r);e===a&&(s-=t),e.min=T2(e.min,t,n,s,i),e.max=T2(e.max,t,n,s,i)}function _2(e,t,[n,r,i],a,o){VM(e,t[n],t[r],t[i],t.scale,a,o)}const $M=["x","scaleX","originX"],WM=["y","scaleY","originY"];function S2(e,t,n,r){_2(e.x,t,$M,n?n.x:void 0,r?r.x:void 0),_2(e.y,t,WM,n?n.y:void 0,r?r.y:void 0)}function C2(e){return e.translate===0&&e.scale===1}function A2(e){return C2(e.x)&&C2(e.y)}function k2(e,t){return e.min===t.min&&e.max===t.max}function YM(e,t){return k2(e.x,t.x)&&k2(e.y,t.y)}function R2(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function N2(e,t){return R2(e.x,t.x)&&R2(e.y,t.y)}function P2(e){return Un(e.x)/Un(e.y)}function I2(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class qM{constructor(){this.members=[]}add(t){r0(this.members,t),t.scheduleRender()}remove(t){if(i0(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 a=this.members[i];if(a.isPresent!==!1){r=a;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 GM(e,t,n){let r="";const i=e.x.translate/t.x,a=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:l,rotate:c,rotateX:d,rotateY:f,skewX:p,skewY:m}=n;l&&(r=`perspective(${l}px) ${r}`),c&&(r+=`rotate(${c}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),p&&(r+=`skewX(${p}deg) `),m&&(r+=`skewY(${m}deg) `)}const s=e.x.scale*t.x,u=e.y.scale*t.y;return(s!==1||u!==1)&&(r+=`scale(${s}, ${u})`),r||"none"}const KM=(e,t)=>e.depth-t.depth;class XM{constructor(){this.children=[],this.isDirty=!1}add(t){r0(this.children,t),this.isDirty=!0}remove(t){i0(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(KM),this.isDirty=!1,this.children.forEach(t)}}function tf(e){const t=Jt(e)?e.get():e;return z4(t)?t.toValue():t}function QM(e,t){const n=jr.now(),r=({timestamp:i})=>{const a=i-n;a>=t&&(Qi(r),e(a-t))};return Xe.read(r,!0),()=>Qi(r)}function ZM(e){return e instanceof SVGElement&&e.tagName!=="svg"}function JM(e,t,n){const r=Jt(e)?e:Qu(e);return r.start(n0("",r,t,n)),r.animation}const Za={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},tl=typeof window<"u"&&window.MotionDebug!==void 0,g0=["","X","Y","Z"],e5={visibility:"hidden"},O2=1e3;let t5=0;function y0(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function D2(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=PT(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Xe,!(i||a))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&D2(r)}function L2({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},s=t==null?void 0:t()){this.id=t5++,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,tl&&(Za.totalNodes=Za.resolvedTargetDeltas=Za.recalculatedProjection=0),this.nodes.forEach(i5),this.nodes.forEach(l5),this.nodes.forEach(c5),this.nodes.forEach(a5),tl&&window.MotionDebug.record(Za)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new XM)}addEventListener(o,s){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new a0),this.eventHandlers.get(o).add(s)}notifyListeners(o,...s){const u=this.eventHandlers.get(o);u&&u.notify(...s)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,s=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=ZM(o),this.instance=o;const{layoutId:u,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),s&&(l||u)&&(this.isLayoutDirty=!0),e){let d;const f=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=QM(f,250),Jd.hasAnimatedSinceResize&&(Jd.hasAnimatedSinceResize=!1,this.nodes.forEach(F2))})}u&&this.root.registerSharedNode(u,this),this.options.animate!==!1&&c&&(u||l)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeTargetChanged:p,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||c.getDefaultTransition()||m5,{onLayoutAnimationStart:x,onLayoutAnimationComplete:y}=c.getProps(),w=!this.targetLayout||!N2(this.targetLayout,m)||p,b=!f&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||b||f&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,b);const T={...Rg(g,"layout"),onPlay:x,onComplete:y};(c.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T)}else f||F2(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}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,Qi(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(d5),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&&D2(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const d=this.path[c];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:s,layout:u}=this.options;if(s===void 0&&!u)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(M2);return}this.isUpdating||this.nodes.forEach(s5),this.isUpdating=!1,this.nodes.forEach(u5),this.nodes.forEach(n5),this.nodes.forEach(r5),this.clearAllSnapshots();const s=jr.now();Vt.delta=Zi(0,1e3/60,s-Vt.timestamp),Vt.timestamp=s,Vt.isProcessing=!0,Ng.update.process(Vt),Ng.preRender.process(Vt),Ng.render.process(Vt),Vt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,m0.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(o5),this.sharedNodes.forEach(f5)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Xe.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Xe.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let u=0;u<this.path.length;u++)this.path[u].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Et(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:s}=this.options;s&&s.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let s=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(s=!1),s){const u=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:u,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,s=this.projectionDelta&&!A2(this.projectionDelta),u=this.getTransformTemplate(),l=u?u(this.latestValues,""):void 0,c=l!==this.prevTransformTemplateValue;o&&(s||Qa(this.latestValues)||c)&&(i(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const s=this.measurePageBox();let u=this.removeElementScroll(s);return o&&(u=this.removeTransform(u)),g5(u),{animationId:this.root.animationId,measuredBox:s,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:s}=this.options;if(!s)return Et();const u=s.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(y5))){const{scroll:c}=this.root;c&&(as(u.x,c.offset.x),as(u.y,c.offset.y))}return u}removeElementScroll(o){var s;const u=Et();if(ir(u,o),!((s=this.scroll)===null||s===void 0)&&s.wasRoot)return u;for(let l=0;l<this.path.length;l++){const c=this.path[l],{scroll:d,options:f}=c;c!==this.root&&d&&f.layoutScroll&&(d.wasRoot&&ir(u,o),as(u.x,d.offset.x),as(u.y,d.offset.y))}return u}applyTransform(o,s=!1){const u=Et();ir(u,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];!s&&c.options.layoutScroll&&c.scroll&&c!==c.root&&os(u,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),Qa(c.latestValues)&&os(u,c.latestValues)}return Qa(this.latestValues)&&os(u,this.latestValues),u}removeTransform(o){const s=Et();ir(s,o);for(let u=0;u<this.path.length;u++){const l=this.path[u];if(!l.instance||!Qa(l.latestValues))continue;f0(l.latestValues)&&l.updateSnapshot();const c=Et(),d=l.measurePageBox();ir(c,d),S2(s,l.latestValues,l.snapshot?l.snapshot.layoutBox:void 0,c)}return Qa(this.latestValues)&&S2(s,this.latestValues),s}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!==Vt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var s;const u=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=u.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=u.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=u.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==u;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||!((s=this.parent)===null||s===void 0)&&s.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=Vt.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Et(),this.relativeTargetOrigin=Et(),Ju(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),ir(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Et(),this.targetWithTransforms=Et()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),vM(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ir(this.target,this.layout.layoutBox),o2(this.target,this.targetDelta)):ir(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=Et(),this.relativeTargetOrigin=Et(),Ju(this.relativeTargetOrigin,this.target,p.target),ir(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}tl&&Za.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||f0(this.parent.latestValues)||r2(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 o;const s=this.getLead(),u=!!this.resumingFrom||this!==s;let l=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(l=!1),u&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Vt.timestamp&&(l=!1),l)return;const{layout:c,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||!(c||d))return;ir(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,p=this.treeScale.y;AM(this.layoutCorrected,this.treeScale,this.path,u),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=Et());const{target:m}=s;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(E2(this.prevProjectionDelta.x,this.projectionDelta.x),E2(this.prevProjectionDelta.y,this.projectionDelta.y)),Zu(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==p||!I2(this.projectionDelta.x,this.prevProjectionDelta.x)||!I2(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m)),tl&&Za.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var s;if((s=this.options.visualElement)===null||s===void 0||s.scheduleRender(),o){const u=this.getStack();u&&u.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=is(),this.projectionDelta=is(),this.projectionDeltaWithTransform=is()}setAnimationOrigin(o,s=!1){const u=this.snapshot,l=u?u.latestValues:{},c={...this.latestValues},d=is();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!s;const f=Et(),p=u?u.source:void 0,m=this.layout?this.layout.source:void 0,g=p!==m,x=this.getStack(),y=!x||x.members.length<=1,w=!!(g&&!y&&this.options.crossfade===!0&&!this.path.some(h5));this.animationProgress=0;let b;this.mixTargetDelta=T=>{const S=T/1e3;B2(d.x,o.x,S),B2(d.y,o.y,S),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ju(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),p5(this.relativeTarget,this.relativeTargetOrigin,f,S),b&&YM(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=Et()),ir(b,this.relativeTarget)),g&&(this.animationValues=c,UM(c,l,this.latestValues,S,w,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},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&&(Qi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Xe.update(()=>{Jd.hasAnimatedSinceResize=!0,this.currentAnimation=JM(0,O2,{...o,onUpdate:s=>{this.mixTargetDelta(s),o.onUpdate&&o.onUpdate(s)},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(O2),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:s,target:u,layout:l,latestValues:c}=o;if(!(!s||!u||!l)){if(this!==o&&this.layout&&l&&V2(this.options.animationType,this.layout.layoutBox,l.layoutBox)){u=this.target||Et();const d=Un(this.layout.layoutBox.x);u.x.min=o.target.x.min,u.x.max=u.x.min+d;const f=Un(this.layout.layoutBox.y);u.y.min=o.target.y.min,u.y.max=u.y.min+f}ir(s,u),os(s,c),Zu(this.projectionDeltaWithTransform,this.layoutCorrected,s,c)}}registerSharedNode(o,s){this.sharedNodes.has(o)||this.sharedNodes.set(o,new qM),this.sharedNodes.get(o).add(s);const l=s.options.initialPromotionConfig;s.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(s):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:s}=this.options;return s?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:s}=this.options;return s?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:s,preserveFollowOpacity:u}={}){const l=this.getStack();l&&l.promote(this,u),o&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let s=!1;const{latestValues:u}=o;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(s=!0),!s)return;const l={};u.z&&y0("z",o,l,this.animationValues);for(let c=0;c<g0.length;c++)y0(`rotate${g0[c]}`,o,l,this.animationValues),y0(`skew${g0[c]}`,o,l,this.animationValues);o.render();for(const c in l)o.setStaticValue(c,l[c]),this.animationValues&&(this.animationValues[c]=l[c]);o.scheduleRender()}getProjectionStyles(o){var s,u;if(!this.instance||this.isSVG)return;if(!this.isVisible)return e5;const l={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,l.opacity="",l.pointerEvents=tf(o==null?void 0:o.pointerEvents)||"",l.transform=c?c(this.latestValues,""):"none",l;const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){const g={};return this.options.layoutId&&(g.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,g.pointerEvents=tf(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Qa(this.latestValues)&&(g.transform=c?c({},""):"none",this.hasProjected=!1),g}const f=d.animationValues||d.latestValues;this.applyTransformsToTarget(),l.transform=GM(this.projectionDeltaWithTransform,this.treeScale,f),c&&(l.transform=c(f,l.transform));const{x:p,y:m}=this.projectionDelta;l.transformOrigin=`${p.origin*100}% ${m.origin*100}% 0`,d.animationValues?l.opacity=d===this?(u=(s=f.opacity)!==null&&s!==void 0?s:this.latestValues.opacity)!==null&&u!==void 0?u:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:l.opacity=d===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const g in ef){if(f[g]===void 0)continue;const{correct:x,applyTo:y}=ef[g],w=l.transform==="none"?f[g]:x(f[g],d);if(y){const b=y.length;for(let T=0;T<b;T++)l[y[T]]=w}else l[g]=w}return this.options.layoutId&&(l.pointerEvents=d===this?tf(o==null?void 0:o.pointerEvents)||"":"none"),l}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var s;return(s=o.currentAnimation)===null||s===void 0?void 0:s.stop()}),this.root.nodes.forEach(M2),this.root.sharedNodes.clear()}}}function n5(e){e.updateLayout()}function r5(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:a}=e.options,o=n.source!==e.layout.source;a==="size"?rr(d=>{const f=o?n.measuredBox[d]:n.layoutBox[d],p=Un(f);f.min=r[d].min,f.max=f.min+p}):V2(a,n.layoutBox,r)&&rr(d=>{const f=o?n.measuredBox[d]:n.layoutBox[d],p=Un(r[d]);f.max=f.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+p)});const s=is();Zu(s,r,n.layoutBox);const u=is();o?Zu(u,e.applyTransform(i,!0),n.measuredBox):Zu(u,r,n.layoutBox);const l=!A2(s);let c=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:p}=d;if(f&&p){const m=Et();Ju(m,n.layoutBox,f.layoutBox);const g=Et();Ju(g,r,p.layoutBox),N2(m,g)||(c=!0),d.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=m,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:u,layoutDelta:s,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function i5(e){tl&&Za.totalNodes++,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 a5(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function o5(e){e.clearSnapshot()}function M2(e){e.clearMeasurements()}function s5(e){e.isLayoutDirty=!1}function u5(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function F2(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function l5(e){e.resolveTargetDelta()}function c5(e){e.calcProjection()}function d5(e){e.resetSkewAndRotation()}function f5(e){e.removeLeadSnapshot()}function B2(e,t,n){e.translate=pt(t.translate,0,n),e.scale=pt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function j2(e,t,n,r){e.min=pt(t.min,n.min,r),e.max=pt(t.max,n.max,r)}function p5(e,t,n,r){j2(e.x,t.x,n.x,r),j2(e.y,t.y,n.y,r)}function h5(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const m5={duration:.45,ease:[.4,0,.1,1]},U2=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),H2=U2("applewebkit/")&&!U2("chrome/")?Math.round:Qt;function z2(e){e.min=H2(e.min),e.max=H2(e.max)}function g5(e){z2(e.x),z2(e.y)}function V2(e,t,n){return e==="position"||e==="preserve-aspect"&&!yM(P2(t),P2(n),.2)}function y5(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const v5=L2({attachResizeListener:(e,t)=>hi(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),v0={current:void 0},$2=L2({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!v0.current){const e=new v5({});e.mount(window),e.setOptions({layoutScroll:!0}),v0.current=e}return v0.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),w5={pan:{Feature:OM},drag:{Feature:IM,ProjectionNode:$2,MeasureLayout:m2}};function W2(e,t){const n=t?"pointerenter":"pointerleave",r=t?"onHoverStart":"onHoverEnd",i=(a,o)=>{if(a.pointerType==="touch"||$T())return;const s=e.getProps();e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",t);const u=s[r];u&&Xe.postRender(()=>u(a,o))};return mi(e.current,n,i,{passive:!e.getProps()[r]})}class b5 extends ta{mount(){this.unmount=pi(W2(this.node,!0),W2(this.node,!1))}unmount(){}}class x5 extends ta{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=pi(hi(this.node.current,"focus",()=>this.onFocus()),hi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const Y2=(e,t)=>t?e===t?!0:Y2(e,t.parentElement):!1;function w0(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Kd(n))}class E5 extends ta{constructor(){super(...arguments),this.removeStartListeners=Qt,this.removeEndListeners=Qt,this.removeAccessibleListeners=Qt,this.startPointerPress=(t,n)=>{if(this.isPressing)return;this.removeEndListeners();const r=this.node.getProps(),a=mi(window,"pointerup",(s,u)=>{if(!this.checkPressEnd())return;const{onTap:l,onTapCancel:c,globalTapTarget:d}=this.node.getProps(),f=!d&&!Y2(this.node.current,s.target)?c:l;f&&Xe.update(()=>f(s,u))},{passive:!(r.onTap||r.onPointerUp)}),o=mi(window,"pointercancel",(s,u)=>this.cancelPress(s,u),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=pi(a,o),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=a=>{if(a.key!=="Enter"||this.isPressing)return;const o=s=>{s.key!=="Enter"||!this.checkPressEnd()||w0("up",(u,l)=>{const{onTap:c}=this.node.getProps();c&&Xe.postRender(()=>c(u,l))})};this.removeEndListeners(),this.removeEndListeners=hi(this.node.current,"keyup",o),w0("down",(s,u)=>{this.startPress(s,u)})},n=hi(this.node.current,"keydown",t),r=()=>{this.isPressing&&w0("cancel",(a,o)=>this.cancelPress(a,o))},i=hi(this.node.current,"blur",r);this.removeAccessibleListeners=pi(n,i)}}startPress(t,n){this.isPressing=!0;const{onTapStart:r,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&Xe.postRender(()=>r(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!$T()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&Xe.postRender(()=>r(t,n))}mount(){const t=this.node.getProps(),n=mi(t.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),r=hi(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=pi(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const b0=new WeakMap,x0=new WeakMap,T5=e=>{const t=b0.get(e.target);t&&t(e)},_5=e=>{e.forEach(T5)};function S5({root:e,...t}){const n=e||document;x0.has(n)||x0.set(n,{});const r=x0.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(_5,{root:e,...t})),r[i]}function C5(e,t,n){const r=S5(t);return b0.set(e,n),r.observe(e),()=>{b0.delete(e),r.unobserve(e)}}const A5={some:0,all:1};class k5 extends ta{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:a}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:A5[i]},s=u=>{const{isIntersecting:l}=u;if(this.isInView===l||(this.isInView=l,a&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:c,onViewportLeave:d}=this.node.getProps(),f=l?c:d;f&&f(u)};return C5(this.node.current,o,s)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(R5(t,n))&&this.startObserver()}unmount(){}}function R5({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const N5={inView:{Feature:k5},tap:{Feature:E5},focus:{Feature:x5},hover:{Feature:b5}},P5={layout:{ProjectionNode:$2,MeasureLayout:m2}},E0=v.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),nf=v.createContext({}),T0=typeof window<"u",q2=T0?v.useLayoutEffect:v.useEffect,G2=v.createContext({strict:!1});function I5(e,t,n,r,i){var a,o;const{visualElement:s}=v.useContext(nf),u=v.useContext(G2),l=v.useContext(Zd),c=v.useContext(E0).reducedMotion,d=v.useRef();r=r||u.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:s,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c}));const f=d.current,p=v.useContext(p2);f&&!f.projection&&i&&(f.type==="html"||f.type==="svg")&&O5(d.current,n,i,p),v.useInsertionEffect(()=>{f&&f.update(n,l)});const m=n[NT],g=v.useRef(!!m&&!(!((a=window.MotionHandoffIsComplete)===null||a===void 0)&&a.call(window,m))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,m)));return q2(()=>{f&&(window.MotionIsMounted=!0,f.updateFeatures(),m0.render(f.render),g.current&&f.animationState&&f.animationState.animateChanges())}),v.useEffect(()=>{f&&(!g.current&&f.animationState&&f.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{var x;(x=window.MotionHandoffMarkAsComplete)===null||x===void 0||x.call(window,m)}),g.current=!1))}),f}function O5(e,t,n,r){const{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:u,layoutRoot:l}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:K2(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&rs(s),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,layoutScroll:u,layoutRoot:l})}function K2(e){if(e)return e.options.allowProjection!==!1?e.projection:K2(e.parent)}function D5(e,t,n){return v.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):rs(n)&&(n.current=r))},[t])}function rf(e){return zu(e.animate)||kg.some(t=>Vu(e[t]))}function X2(e){return!!(rf(e)||e.variants)}function L5(e,t){if(rf(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Vu(n)?n:void 0,animate:Vu(r)?r:void 0}}return e.inherit!==!1?t:{}}function M5(e){const{initial:t,animate:n}=L5(e,v.useContext(nf));return v.useMemo(()=>({initial:t,animate:n}),[Q2(t),Q2(n)])}function Q2(e){return Array.isArray(e)?e.join(" "):e}const Z2={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"]},ss={};for(const e in Z2)ss[e]={isEnabled:t=>Z2[e].some(n=>!!t[n])};function F5(e){for(const t in e)ss[t]={...ss[t],...e[t]}}const B5=Symbol.for("motionComponentSymbol");function j5({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&F5(e);function a(s,u){let l;const c={...v.useContext(E0),...s,layoutId:U5(s)},{isStatic:d}=c,f=M5(s),p=r(s,d);if(!d&&T0){H5();const m=z5(c);l=m.MeasureLayout,f.visualElement=I5(i,p,c,t,m.ProjectionNode)}return E.jsxs(nf.Provider,{value:f,children:[l&&f.visualElement?E.jsx(l,{visualElement:f.visualElement,...c}):null,n(i,s,D5(p,f.visualElement,u),p,d,f.visualElement)]})}const o=v.forwardRef(a);return o[B5]=i,o}function U5({layoutId:e}){const t=v.useContext(h0).id;return t&&e!==void 0?t+"-"+e:e}function H5(e,t){v.useContext(G2).strict}function z5(e){const{drag:t,layout:n}=ss;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 V5=["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 _0(e){return typeof e!="string"||e.includes("-")?!1:!!(V5.indexOf(e)>-1||/[A-Z]/u.test(e))}function J2(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const a in n)e.style.setProperty(a,n[a])}const e_=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 t_(e,t,n,r){J2(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(e_.has(i)?i:Gd(i),t.attrs[i])}function n_(e,{layout:t,layoutId:n}){return Xi.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ef[e]||e==="opacity")}function S0(e,t,n){var r;const{style:i}=e,a={};for(const o in i)(Jt(i[o])||t.style&&Jt(t.style[o])||n_(o,e)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(a[o]=i[o]);return n&&i&&typeof i.willChange=="string"&&(n.applyWillChange=!1),a}function r_(e,t,n){const r=S0(e,t,n);for(const i in e)if(Jt(e[i])||Jt(t[i])){const a=$u.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[a]=e[i]}return r}function C0(e){const t=v.useRef(null);return t.current===null&&(t.current=e()),t.current}function $5(e){if(Xi.has(e))return"transform";if(TT.has(e))return Gd(e)}function W5({applyWillChange:e=!1,scrapeMotionValuesFromProps:t,createRenderState:n,onMount:r},i,a,o,s){const u={latestValues:Y5(i,a,o,s?!1:e,t),renderState:n()};return r&&(u.mount=l=>r(i,l,u)),u}const i_=e=>(t,n)=>{const r=v.useContext(nf),i=v.useContext(Zd),a=()=>W5(e,t,r,i,n);return n?a():C0(a)};function a_(e,t,n){const r=Array.isArray(t)?t:[t];for(let i=0;i<r.length;i++){const a=Cg(e,r[i]);if(a){const{transitionEnd:o,transition:s,...u}=a;n(u,o)}}}function Y5(e,t,n,r,i){var a;const o={},s=new Set,u=r&&((a=e.style)===null||a===void 0?void 0:a.willChange)===void 0,l=i(e,{});for(const x in l)o[x]=tf(l[x]);let{initial:c,animate:d}=e;const f=rf(e),p=X2(e);t&&p&&!f&&e.inherit!==!1&&(c===void 0&&(c=t.initial),d===void 0&&(d=t.animate));let m=n?n.initial===!1:!1;m=m||c===!1;const g=m?d:c;return g&&typeof g!="boolean"&&!zu(g)&&a_(e,g,(x,y)=>{for(const w in x){let b=x[w];if(Array.isArray(b)){const T=m?b.length-1:0;b=b[T]}b!==null&&(o[w]=b)}for(const w in y)o[w]=y[w]}),u&&(d&&c!==!1&&!zu(d)&&a_(e,d,x=>{for(const y in x){const w=$5(y);w&&s.add(w)}}),s.size&&(o.willChange=Array.from(s).join(","))),o}const A0=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),o_=()=>({...A0(),attrs:{}}),s_=(e,t)=>t&&typeof e=="number"?t.transform(e):e,q5={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},G5=$u.length;function K5(e,t,n){let r="",i=!0;for(let a=0;a<G5;a++){const o=$u[a],s=e[o];if(s===void 0)continue;let u=!0;if(typeof s=="number"?u=s===(o.startsWith("scale")?1:0):u=parseFloat(s)===0,!u||n){const l=s_(s,Vg[o]);if(!u){i=!1;const c=q5[o]||o;r+=`${c}(${l}) `}n&&(t[o]=l)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function k0(e,t,n){const{style:r,vars:i,transformOrigin:a}=e;let o=!1,s=!1;for(const u in t){const l=t[u];if(Xi.has(u)){o=!0;continue}else if(zE(u)){i[u]=l;continue}else{const c=s_(l,Vg[u]);u.startsWith("origin")?(s=!0,a[u]=c):r[u]=c}}if(t.transform||(o||n?r.transform=K5(t,e.transform,n):r.transform&&(r.transform="none")),s){const{originX:u="50%",originY:l="50%",originZ:c=0}=a;r.transformOrigin=`${u} ${l} ${c}`}}function u_(e,t,n){return typeof e=="string"?e:ye.transform(t+n*e)}function X5(e,t,n){const r=u_(t,e.x,e.width),i=u_(n,e.y,e.height);return`${r} ${i}`}const Q5={offset:"stroke-dashoffset",array:"stroke-dasharray"},Z5={offset:"strokeDashoffset",array:"strokeDasharray"};function J5(e,t,n=1,r=0,i=!0){e.pathLength=1;const a=i?Q5:Z5;e[a.offset]=ye.transform(-r);const o=ye.transform(t),s=ye.transform(n);e[a.array]=`${o} ${s}`}function R0(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:a,pathLength:o,pathSpacing:s=1,pathOffset:u=0,...l},c,d){if(k0(e,l,d),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:p,dimensions:m}=e;f.transform&&(m&&(p.transform=f.transform),delete f.transform),m&&(i!==void 0||a!==void 0||p.transform)&&(p.transformOrigin=X5(m,i!==void 0?i:.5,a!==void 0?a:.5)),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&J5(f,o,s,u,!1)}const N0=e=>typeof e=="string"&&e.toLowerCase()==="svg",e8={useVisualState:i_({scrapeMotionValuesFromProps:r_,createRenderState:o_,onMount:(e,t,{renderState:n,latestValues:r})=>{Xe.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),Xe.render(()=>{R0(n,r,N0(t.tagName),e.transformTemplate),t_(t,n)})}})},t8={useVisualState:i_({applyWillChange:!0,scrapeMotionValuesFromProps:S0,createRenderState:A0})};function l_(e,t,n){for(const r in t)!Jt(t[r])&&!n_(r,n)&&(e[r]=t[r])}function n8({transformTemplate:e},t){return v.useMemo(()=>{const n=A0();return k0(n,t,e),Object.assign({},n.vars,n.style)},[t])}function r8(e,t){const n=e.style||{},r={};return l_(r,n,e),Object.assign(r,n8(e,t)),r}function i8(e,t){const n={},r=r8(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 a8=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 af(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||a8.has(e)}let c_=e=>!af(e);function o8(e){e&&(c_=t=>t.startsWith("on")?!af(t):e(t))}try{o8(require("@emotion/is-prop-valid").default)}catch{}function s8(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(c_(i)||n===!0&&af(i)||!t&&!af(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function u8(e,t,n,r){const i=v.useMemo(()=>{const a=o_();return R0(a,t,N0(r),e.transformTemplate),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};l_(a,e.style,e),i.style={...a,...i.style}}return i}function l8(e=!1){return(n,r,i,{latestValues:a},o)=>{const u=(_0(n)?u8:i8)(r,a,o,n),l=s8(r,typeof n=="string",e),c=n!==v.Fragment?{...l,...u,ref:i}:{},{children:d}=r,f=v.useMemo(()=>Jt(d)?d.get():d,[d]);return v.createElement(n,{...c,children:f})}}function c8(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={..._0(r)?e8:t8,preloadedFeatures:e,useRender:l8(i),createVisualElement:t,Component:r};return j5(o)}}const P0={current:null},d_={current:!1};function d8(){if(d_.current=!0,!!T0)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>P0.current=e.matches;e.addListener(t),t()}else P0.current=!1}function f8(e,t,n){for(const r in t){const i=t[r],a=n[r];if(Jt(i))e.addValue(r,i);else if(Jt(a))e.addValue(r,Qu(i,{owner:e}));else if(a!==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,Qu(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const f_=new WeakMap,p8=[...KE,Zt,ea],h8=e=>p8.find(GE(e)),p_=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class m8{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:a,visualState:o},s={}){this.applyWillChange=!1,this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Fg,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 f=jr.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,Xe.render(this.render,!1,!0))};const{latestValues:u,renderState:l}=o;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=rf(n),this.isVariantNode=X2(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:c,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const p=d[f];u[f]!==void 0&&Jt(p)&&p.set(u[f],!1)}}mount(t){this.current=t,f_.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)),d_.current||d8(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:P0.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){f_.delete(this.current),this.projection&&this.projection.unmount(),Qi(this.notifyUpdate),Qi(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=Xi.has(t),i=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&Xe.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),a=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),a(),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 ss){const n=ss[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 a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Et()}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<p_.length;r++){const i=p_[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const a="on"+i,o=t[a];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=f8(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}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=Qu(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(UE(i)||jE(i))?i=parseFloat(i):!h8(i)&&ea.test(n)&&(i=oT(t,n)),this.setBaseTarget(t,Jt(i)?i.get():i)),Jt(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const o=Cg(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(i=o[t])}if(r&&i!==void 0)return i;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!Jt(a)?a:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new a0),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class h_ extends m8{constructor(){super(...arguments),this.KeyframeResolver=sT}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]}}function g8(e){return window.getComputedStyle(e)}class y8 extends h_{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=J2}readValueFromInstance(t,n){if(Xi.has(n)){const r=$g(n);return r&&r.default||0}else{const r=g8(t),i=(zE(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return c2(t,n)}build(t,n,r){k0(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return S0(t,n,r)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Jt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class v8 extends h_{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Et}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Xi.has(n)){const r=$g(n);return r&&r.default||0}return n=e_.has(n)?n:Gd(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return r_(t,n,r)}build(t,n,r){R0(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){t_(t,n,r,i)}mount(t){this.isSVGTag=N0(t.tagName),super.mount(t)}}const w8=(e,t)=>_0(e)?new v8(t):new y8(t,{allowProjection:e!==v.Fragment}),b8=c8({...uM,...N5,...w5,...P5},w8),us=nL(b8);class x8 extends v.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function E8({children:e,isPresent:t}){const n=v.useId(),r=v.useRef(null),i=v.useRef({width:0,height:0,top:0,left:0}),{nonce:a}=v.useContext(E0);return v.useInsertionEffect(()=>{const{width:o,height:s,top:u,left:l}=i.current;if(t||!r.current||!o||!s)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return a&&(c.nonce=a),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`
41
41
  [data-motion-pop-id="${n}"] {
42
42
  position: absolute !important;
43
43
  width: ${o}px !important;
@@ -330,7 +330,7 @@ to {
330
330
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[GS]=this[GS]={accessors:{}}).accessors,i=this.prototype;function a(o){const s=cl(o);r[s]||(s7(i,o),r[s]=!0)}return z.isArray(t)?t.forEach(a):a(t),this}}Tn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),z.reduceDescriptors(Tn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),z.freezeMethods(Tn);function ay(e,t){const n=this||ll,r=t||n,i=Tn.from(r.headers);let a=r.data;return z.forEach(e,function(s){a=s.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function KS(e){return!!(e&&e.__CANCEL__)}function hs(e,t,n){Se.call(this,e??"canceled",Se.ERR_CANCELED,t,n),this.name="CanceledError"}z.inherits(hs,Se,{__CANCEL__:!0});function XS(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Se("Request failed with status code "+n.status,[Se.ERR_BAD_REQUEST,Se.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function u7(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function l7(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,a=0,o;return t=t!==void 0?t:1e3,function(u){const l=Date.now(),c=r[a];o||(o=l),n[i]=u,r[i]=l;let d=a,f=0;for(;d!==i;)f+=n[d++],d=d%e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),l-o<t)return;const p=c&&l-c;return p?Math.round(f*1e3/p):void 0}}function c7(e,t){let n=0,r=1e3/t,i,a;const o=(l,c=Date.now())=>{n=c,i=null,a&&(clearTimeout(a),a=null),e.apply(null,l)};return[(...l)=>{const c=Date.now(),d=c-n;d>=r?o(l,c):(i=l,a||(a=setTimeout(()=>{a=null,o(i)},r-d)))},()=>i&&o(i)]}const Tf=(e,t,n=3)=>{let r=0;const i=l7(50,250);return c7(a=>{const o=a.loaded,s=a.lengthComputable?a.total:void 0,u=o-r,l=i(u),c=o<=s;r=o;const d={loaded:o,total:s,progress:s?o/s:void 0,bytes:u,rate:l||void 0,estimated:l&&s&&c?(s-o)/l:void 0,event:a,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(d)},n)},QS=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ZS=e=>(...t)=>z.asap(()=>e(...t)),d7=tn.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,tn.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(tn.origin),tn.navigator&&/(msie|trident)/i.test(tn.navigator.userAgent)):()=>!0,f7=tn.hasStandardBrowserEnv?{write(e,t,n,r,i,a){const o=[e+"="+encodeURIComponent(t)];z.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),z.isString(r)&&o.push("path="+r),z.isString(i)&&o.push("domain="+i),a===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function p7(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function h7(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function JS(e,t){return e&&!p7(t)?h7(e,t):t}const eC=e=>e instanceof Tn?{...e}:e;function no(e,t){t=t||{};const n={};function r(l,c,d,f){return z.isPlainObject(l)&&z.isPlainObject(c)?z.merge.call({caseless:f},l,c):z.isPlainObject(c)?z.merge({},c):z.isArray(c)?c.slice():c}function i(l,c,d,f){if(z.isUndefined(c)){if(!z.isUndefined(l))return r(void 0,l,d,f)}else return r(l,c,d,f)}function a(l,c){if(!z.isUndefined(c))return r(void 0,c)}function o(l,c){if(z.isUndefined(c)){if(!z.isUndefined(l))return r(void 0,l)}else return r(void 0,c)}function s(l,c,d){if(d in t)return r(l,c);if(d in e)return r(void 0,l)}const u={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(l,c,d)=>i(eC(l),eC(c),d,!0)};return z.forEach(Object.keys(Object.assign({},e,t)),function(c){const d=u[c]||i,f=d(e[c],t[c],c);z.isUndefined(f)&&d!==s||(n[c]=f)}),n}const tC=e=>{const t=no({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:s}=t;t.headers=o=Tn.from(o),t.url=$S(JS(t.baseURL,t.url),e.params,e.paramsSerializer),s&&o.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):"")));let u;if(z.isFormData(n)){if(tn.hasStandardBrowserEnv||tn.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((u=o.getContentType())!==!1){const[l,...c]=u?u.split(";").map(d=>d.trim()).filter(Boolean):[];o.setContentType([l||"multipart/form-data",...c].join("; "))}}if(tn.hasStandardBrowserEnv&&(r&&z.isFunction(r)&&(r=r(t)),r||r!==!1&&d7(t.url))){const l=i&&a&&f7.read(a);l&&o.set(i,l)}return t},m7=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const i=tC(e);let a=i.data;const o=Tn.from(i.headers).normalize();let{responseType:s,onUploadProgress:u,onDownloadProgress:l}=i,c,d,f,p,m;function g(){p&&p(),m&&m(),i.cancelToken&&i.cancelToken.unsubscribe(c),i.signal&&i.signal.removeEventListener("abort",c)}let x=new XMLHttpRequest;x.open(i.method.toUpperCase(),i.url,!0),x.timeout=i.timeout;function y(){if(!x)return;const b=Tn.from("getAllResponseHeaders"in x&&x.getAllResponseHeaders()),S={data:!s||s==="text"||s==="json"?x.responseText:x.response,status:x.status,statusText:x.statusText,headers:b,config:e,request:x};XS(function(N){n(N),g()},function(N){r(N),g()},S),x=null}"onloadend"in x?x.onloadend=y:x.onreadystatechange=function(){!x||x.readyState!==4||x.status===0&&!(x.responseURL&&x.responseURL.indexOf("file:")===0)||setTimeout(y)},x.onabort=function(){x&&(r(new Se("Request aborted",Se.ECONNABORTED,e,x)),x=null)},x.onerror=function(){r(new Se("Network Error",Se.ERR_NETWORK,e,x)),x=null},x.ontimeout=function(){let T=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const S=i.transitional||YS;i.timeoutErrorMessage&&(T=i.timeoutErrorMessage),r(new Se(T,S.clarifyTimeoutError?Se.ETIMEDOUT:Se.ECONNABORTED,e,x)),x=null},a===void 0&&o.setContentType(null),"setRequestHeader"in x&&z.forEach(o.toJSON(),function(T,S){x.setRequestHeader(S,T)}),z.isUndefined(i.withCredentials)||(x.withCredentials=!!i.withCredentials),s&&s!=="json"&&(x.responseType=i.responseType),l&&([f,m]=Tf(l,!0),x.addEventListener("progress",f)),u&&x.upload&&([d,p]=Tf(u),x.upload.addEventListener("progress",d),x.upload.addEventListener("loadend",p)),(i.cancelToken||i.signal)&&(c=b=>{x&&(r(!b||b.type?new hs(null,e,x):b),x.abort(),x=null)},i.cancelToken&&i.cancelToken.subscribe(c),i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c)));const w=u7(i.url);if(w&&tn.protocols.indexOf(w)===-1){r(new Se("Unsupported protocol "+w+":",Se.ERR_BAD_REQUEST,e));return}x.send(a||null)})},g7=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const a=function(l){if(!i){i=!0,s();const c=l instanceof Error?l:this.reason;r.abort(c instanceof Se?c:new hs(c instanceof Error?c.message:c))}};let o=t&&setTimeout(()=>{o=null,a(new Se(`timeout ${t} of ms exceeded`,Se.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(a):l.removeEventListener("abort",a)}),e=null)};e.forEach(l=>l.addEventListener("abort",a));const{signal:u}=r;return u.unsubscribe=()=>z.asap(s),u}},y7=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},v7=async function*(e,t){for await(const n of w7(e))yield*y7(n,t)},w7=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},nC=(e,t,n,r)=>{const i=v7(e,t);let a=0,o,s=u=>{o||(o=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:l,value:c}=await i.next();if(l){s(),u.close();return}let d=c.byteLength;if(n){let f=a+=d;n(f)}u.enqueue(new Uint8Array(c))}catch(l){throw s(l),l}},cancel(u){return s(u),i.return()}},{highWaterMark:2})},_f=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",rC=_f&&typeof ReadableStream=="function",b7=_f&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),iC=(e,...t)=>{try{return!!e(...t)}catch{return!1}},x7=rC&&iC(()=>{let e=!1;const t=new Request(tn.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),aC=64*1024,oy=rC&&iC(()=>z.isReadableStream(new Response("").body)),Sf={stream:oy&&(e=>e.body)};_f&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Sf[t]&&(Sf[t]=z.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new Se(`Response type '${t}' is not supported`,Se.ERR_NOT_SUPPORT,r)})})})(new Response);const E7=async e=>{if(e==null)return 0;if(z.isBlob(e))return e.size;if(z.isSpecCompliantForm(e))return(await new Request(tn.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(z.isArrayBufferView(e)||z.isArrayBuffer(e))return e.byteLength;if(z.isURLSearchParams(e)&&(e=e+""),z.isString(e))return(await b7(e)).byteLength},T7=async(e,t)=>{const n=z.toFiniteNumber(e.getContentLength());return n??E7(t)},sy={http:$B,xhr:m7,fetch:_f&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:a,timeout:o,onDownloadProgress:s,onUploadProgress:u,responseType:l,headers:c,withCredentials:d="same-origin",fetchOptions:f}=tC(e);l=l?(l+"").toLowerCase():"text";let p=g7([i,a&&a.toAbortSignal()],o),m;const g=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let x;try{if(u&&x7&&n!=="get"&&n!=="head"&&(x=await T7(c,r))!==0){let S=new Request(t,{method:"POST",body:r,duplex:"half"}),_;if(z.isFormData(r)&&(_=S.headers.get("content-type"))&&c.setContentType(_),S.body){const[N,D]=QS(x,Tf(ZS(u)));r=nC(S.body,aC,N,D)}}z.isString(d)||(d=d?"include":"omit");const y="credentials"in Request.prototype;m=new Request(t,{...f,signal:p,method:n.toUpperCase(),headers:c.normalize().toJSON(),body:r,duplex:"half",credentials:y?d:void 0});let w=await fetch(m);const b=oy&&(l==="stream"||l==="response");if(oy&&(s||b&&g)){const S={};["status","statusText","headers"].forEach(V=>{S[V]=w[V]});const _=z.toFiniteNumber(w.headers.get("content-length")),[N,D]=s&&QS(_,Tf(ZS(s),!0))||[];w=new Response(nC(w.body,aC,N,()=>{D&&D(),g&&g()}),S)}l=l||"text";let T=await Sf[z.findKey(Sf,l)||"text"](w,e);return!b&&g&&g(),await new Promise((S,_)=>{XS(S,_,{data:T,headers:Tn.from(w.headers),status:w.status,statusText:w.statusText,config:e,request:m})})}catch(y){throw g&&g(),y&&y.name==="TypeError"&&/fetch/i.test(y.message)?Object.assign(new Se("Network Error",Se.ERR_NETWORK,e,m),{cause:y.cause||y}):Se.from(y,y&&y.code,e,m)}})};z.forEach(sy,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const oC=e=>`- ${e}`,_7=e=>z.isFunction(e)||e===null||e===!1,sC={getAdapter:e=>{e=z.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let a=0;a<t;a++){n=e[a];let o;if(r=n,!_7(n)&&(r=sy[(o=String(n)).toLowerCase()],r===void 0))throw new Se(`Unknown adapter '${o}'`);if(r)break;i[o||"#"+a]=r}if(!r){const a=Object.entries(i).map(([s,u])=>`adapter ${s} `+(u===!1?"is not supported by the environment":"is not available in the build"));let o=t?a.length>1?`since :
331
331
  `+a.map(oC).join(`
332
332
  `):" "+oC(a[0]):"as no adapter specified";throw new Se("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:sy};function uy(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new hs(null,e)}function uC(e){return uy(e),e.headers=Tn.from(e.headers),e.data=ay.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),sC.getAdapter(e.adapter||ll.adapter)(e).then(function(r){return uy(e),r.data=ay.call(e,e.transformResponse,r),r.headers=Tn.from(r.headers),r},function(r){return KS(r)||(uy(e),r&&r.response&&(r.response.data=ay.call(e,e.transformResponse,r.response),r.response.headers=Tn.from(r.response.headers))),Promise.reject(r)})}const lC="1.7.9",Cf={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Cf[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const cC={};Cf.transitional=function(t,n,r){function i(a,o){return"[Axios v"+lC+"] Transitional option '"+a+"'"+o+(r?". "+r:"")}return(a,o,s)=>{if(t===!1)throw new Se(i(o," has been removed"+(n?" in "+n:"")),Se.ERR_DEPRECATED);return n&&!cC[o]&&(cC[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(a,o,s):!0}},Cf.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function S7(e,t,n){if(typeof e!="object")throw new Se("options must be an object",Se.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const a=r[i],o=t[a];if(o){const s=e[a],u=s===void 0||o(s,a,e);if(u!==!0)throw new Se("option "+a+" must be "+u,Se.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Se("Unknown option "+a,Se.ERR_BAD_OPTION)}}const Af={assertOptions:S7,validators:Cf},Hr=Af.validators;class ro{constructor(t){this.defaults=t,this.interceptors={request:new WS,response:new WS}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const a=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?a&&!String(r.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(r.stack+=`
333
- `+a):r.stack=a}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=no(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:a}=n;r!==void 0&&Af.assertOptions(r,{silentJSONParsing:Hr.transitional(Hr.boolean),forcedJSONParsing:Hr.transitional(Hr.boolean),clarifyTimeoutError:Hr.transitional(Hr.boolean)},!1),i!=null&&(z.isFunction(i)?n.paramsSerializer={serialize:i}:Af.assertOptions(i,{encode:Hr.function,serialize:Hr.function},!0)),Af.assertOptions(n,{baseUrl:Hr.spelling("baseURL"),withXsrfToken:Hr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=a&&z.merge(a.common,a[n.method]);a&&z.forEach(["delete","get","head","post","put","patch","common"],m=>{delete a[m]}),n.headers=Tn.concat(o,a);const s=[];let u=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(u=u&&g.synchronous,s.unshift(g.fulfilled,g.rejected))});const l=[];this.interceptors.response.forEach(function(g){l.push(g.fulfilled,g.rejected)});let c,d=0,f;if(!u){const m=[uC.bind(this),void 0];for(m.unshift.apply(m,s),m.push.apply(m,l),f=m.length,c=Promise.resolve(n);d<f;)c=c.then(m[d++],m[d++]);return c}f=s.length;let p=n;for(d=0;d<f;){const m=s[d++],g=s[d++];try{p=m(p)}catch(x){g.call(this,x);break}}try{c=uC.call(this,p)}catch(m){return Promise.reject(m)}for(d=0,f=l.length;d<f;)c=c.then(l[d++],l[d++]);return c}getUri(t){t=no(this.defaults,t);const n=JS(t.baseURL,t.url);return $S(n,t.params,t.paramsSerializer)}}z.forEach(["delete","get","head","options"],function(t){ro.prototype[t]=function(n,r){return this.request(no(r||{},{method:t,url:n,data:(r||{}).data}))}}),z.forEach(["post","put","patch"],function(t){function n(r){return function(a,o,s){return this.request(no(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:o}))}}ro.prototype[t]=n(),ro.prototype[t+"Form"]=n(!0)});class ly{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const r=this;this.promise.then(i=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](i);r._listeners=null}),this.promise.then=i=>{let a;const o=new Promise(s=>{r.subscribe(s),a=s}).then(i);return o.cancel=function(){r.unsubscribe(a)},o},t(function(a,o,s){r.reason||(r.reason=new hs(a,o,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new ly(function(i){t=i}),cancel:t}}}function C7(e){return function(n){return e.apply(null,n)}}function A7(e){return z.isObject(e)&&e.isAxiosError===!0}const cy={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(cy).forEach(([e,t])=>{cy[t]=e});function dC(e){const t=new ro(e),n=kS(ro.prototype.request,t);return z.extend(n,ro.prototype,t,{allOwnKeys:!0}),z.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return dC(no(e,i))},n}const At=dC(ll);At.Axios=ro,At.CanceledError=hs,At.CancelToken=ly,At.isCancel=KS,At.VERSION=lC,At.toFormData=xf,At.AxiosError=Se,At.Cancel=At.CanceledError,At.all=function(t){return Promise.all(t)},At.spread=C7,At.isAxiosError=A7,At.mergeConfig=no,At.AxiosHeaders=Tn,At.formToJSON=e=>qS(z.isHTMLForm(e)?new FormData(e):e),At.getAdapter=sC.getAdapter,At.HttpStatusCode=cy,At.default=At;const k7=/\{[^{}]+\}/g,R7=()=>{var e,t;return typeof process=="object"&&Number.parseInt((t=(e=process==null?void 0:process.versions)==null?void 0:e.node)==null?void 0:t.substring(0,2))>=18&&process.versions.undici};function N7(){return Math.random().toString(36).slice(2,11)}function P7(e){let{baseUrl:t="",Request:n=globalThis.Request,fetch:r=globalThis.fetch,querySerializer:i,bodySerializer:a,headers:o,requestInitExt:s=void 0,...u}={...e};s=R7()?s:void 0,t=mC(t);const l=[];async function c(d,f){const{baseUrl:p,fetch:m=r,Request:g=n,headers:x,params:y={},parseAs:w="json",querySerializer:b,bodySerializer:T=a??O7,body:S,..._}=f||{};p&&(t=mC(p));let N=typeof i=="function"?i:hC(i);b&&(N=typeof b=="function"?b:hC({...typeof i=="object"?i:{},...b}));const D=S===void 0?void 0:T(S),V=D===void 0||D instanceof FormData?{}:{"Content-Type":"application/json"},P={redirect:"follow",...u,..._,body:D,headers:L7(V,o,x,y.header)};let $,H,X=new n(D7(d,{baseUrl:t,params:y,querySerializer:N}),P);for(const re in _)re in X||(X[re]=_[re]);if(l.length){$=N7(),H=Object.freeze({baseUrl:t,fetch:m,parseAs:w,querySerializer:N,bodySerializer:T});for(const re of l)if(re&&typeof re=="object"&&typeof re.onRequest=="function"){const ee=await re.onRequest({request:X,schemaPath:d,params:y,options:H,id:$});if(ee){if(!(ee instanceof n))throw new Error("onRequest: must return new Request() when modifying the request");X=ee}}}let Y;try{Y=await m(X,s)}catch(re){let ee=re;if(l.length)for(let F=l.length-1;F>=0;F--){const B=l[F];if(B&&typeof B=="object"&&typeof B.onError=="function"){const A=await B.onError({request:X,error:ee,schemaPath:d,params:y,options:H,id:$});if(A){if(A instanceof Response){ee=void 0,Y=A;break}if(A instanceof Error){ee=A;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(ee)throw ee}if(l.length)for(let re=l.length-1;re>=0;re--){const ee=l[re];if(ee&&typeof ee=="object"&&typeof ee.onResponse=="function"){const F=await ee.onResponse({request:X,response:Y,schemaPath:d,params:y,options:H,id:$});if(F){if(!(F instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");Y=F}}}if(Y.status===204||Y.headers.get("Content-Length")==="0")return Y.ok?{data:void 0,response:Y}:{error:void 0,response:Y};if(Y.ok)return w==="stream"?{data:Y.body,response:Y}:{data:await Y[w](),response:Y};let ne=await Y.text();try{ne=JSON.parse(ne)}catch{}return{error:ne,response:Y}}return{request(d,f,p){return c(f,{...p,method:d.toUpperCase()})},GET(d,f){return c(d,{...f,method:"GET"})},PUT(d,f){return c(d,{...f,method:"PUT"})},POST(d,f){return c(d,{...f,method:"POST"})},DELETE(d,f){return c(d,{...f,method:"DELETE"})},OPTIONS(d,f){return c(d,{...f,method:"OPTIONS"})},HEAD(d,f){return c(d,{...f,method:"HEAD"})},PATCH(d,f){return c(d,{...f,method:"PATCH"})},TRACE(d,f){return c(d,{...f,method:"TRACE"})},use(...d){for(const f of d)if(f){if(typeof f!="object"||!("onRequest"in f||"onResponse"in f||"onError"in f))throw new Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");l.push(f)}},eject(...d){for(const f of d){const p=l.indexOf(f);p!==-1&&l.splice(p,1)}}}}function kf(e,t,n){if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${(n==null?void 0:n.allowReserved)===!0?t:encodeURIComponent(t)}`}function fC(e,t,n){if(!t||typeof t!="object")return"";const r=[],i={simple:",",label:".",matrix:";"}[n.style]||"&";if(n.style!=="deepObject"&&n.explode===!1){for(const s in t)r.push(s,n.allowReserved===!0?t[s]:encodeURIComponent(t[s]));const o=r.join(",");switch(n.style){case"form":return`${e}=${o}`;case"label":return`.${o}`;case"matrix":return`;${e}=${o}`;default:return o}}for(const o in t){const s=n.style==="deepObject"?`${e}[${o}]`:o;r.push(kf(s,t[o],n))}const a=r.join(i);return n.style==="label"||n.style==="matrix"?`${i}${a}`:a}function pC(e,t,n){if(!Array.isArray(t))return"";if(n.explode===!1){const a={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[n.style]||",",o=(n.allowReserved===!0?t:t.map(s=>encodeURIComponent(s))).join(a);switch(n.style){case"simple":return o;case"label":return`.${o}`;case"matrix":return`;${e}=${o}`;default:return`${e}=${o}`}}const r={simple:",",label:".",matrix:";"}[n.style]||"&",i=[];for(const a of t)n.style==="simple"||n.style==="label"?i.push(n.allowReserved===!0?a:encodeURIComponent(a)):i.push(kf(e,a,n));return n.style==="label"||n.style==="matrix"?`${r}${i.join(r)}`:i.join(r)}function hC(e){return function(n){const r=[];if(n&&typeof n=="object")for(const i in n){const a=n[i];if(a!=null){if(Array.isArray(a)){if(a.length===0)continue;r.push(pC(i,a,{style:"form",explode:!0,...e==null?void 0:e.array,allowReserved:(e==null?void 0:e.allowReserved)||!1}));continue}if(typeof a=="object"){r.push(fC(i,a,{style:"deepObject",explode:!0,...e==null?void 0:e.object,allowReserved:(e==null?void 0:e.allowReserved)||!1}));continue}r.push(kf(i,a,e))}}return r.join("&")}}function I7(e,t){let n=e;for(const r of e.match(k7)??[]){let i=r.substring(1,r.length-1),a=!1,o="simple";if(i.endsWith("*")&&(a=!0,i=i.substring(0,i.length-1)),i.startsWith(".")?(o="label",i=i.substring(1)):i.startsWith(";")&&(o="matrix",i=i.substring(1)),!t||t[i]===void 0||t[i]===null)continue;const s=t[i];if(Array.isArray(s)){n=n.replace(r,pC(i,s,{style:o,explode:a}));continue}if(typeof s=="object"){n=n.replace(r,fC(i,s,{style:o,explode:a}));continue}if(o==="matrix"){n=n.replace(r,`;${kf(i,s)}`);continue}n=n.replace(r,o==="label"?`.${encodeURIComponent(s)}`:encodeURIComponent(s))}return n}function O7(e){return e instanceof FormData?e:JSON.stringify(e)}function D7(e,t){var i;let n=`${t.baseUrl}${e}`;(i=t.params)!=null&&i.path&&(n=I7(n,t.params.path));let r=t.querySerializer(t.params.query??{});return r.startsWith("?")&&(r=r.substring(1)),r&&(n+=`?${r}`),n}function L7(...e){const t=new Headers;for(const n of e){if(!n||typeof n!="object")continue;const r=n instanceof Headers?n.entries():Object.entries(n);for(const[i,a]of r)if(a===null)t.delete(i);else if(Array.isArray(a))for(const o of a)t.append(i,o);else a!==void 0&&t.set(i,a)}return t}function mC(e){return e.endsWith("/")?e.substring(0,e.length-1):e}const M7=e=>{console.log(e.error)},F7=e=>{const t=P7({baseUrl:e.baseUrl}),n={onRequest:e.onRequest,onResponse:e.onResponse,onError:e.onError||M7};return t.use(n),t};class B7{constructor({config:t}){ie(this,"client");ie(this,"uploadFileClient");ie(this,"config");ie(this,"constructClientOptions",t=>{const n=this.config.apiUrl||"https://api.open.cx",r={"X-Bot-Token":this.config.token,"Content-Type":"application/json",Accept:"application/json",Authorization:t?`Bearer ${t}`:void 0};return{baseUrl:n,headers:r}});ie(this,"createOpenAPIClient",({baseUrl:t,headers:n})=>F7({baseUrl:t,onRequest:({request:r})=>{Object.entries(n).forEach(([i,a])=>{a&&r.headers.set(i,a)})}}));ie(this,"createAxiosUploadClient",({baseUrl:t,headers:n})=>At.create({baseURL:`${t}/backend/widget/v2/upload`,headers:n}));ie(this,"setAuthToken",t=>{const{baseUrl:n,headers:r}=this.constructClientOptions(t);this.client=this.createOpenAPIClient({baseUrl:n,headers:r}),this.uploadFileClient=this.createAxiosUploadClient({baseUrl:n,headers:r})});ie(this,"widgetPrelude",async()=>await this.client.GET("/backend/widget/v2/prelude",{params:{header:{"X-Bot-Token":this.config.token}}}));ie(this,"sendMessage",async(t,n)=>await this.client.POST("/backend/widget/v2/chat/send",{body:t,signal:n}));ie(this,"getSessionHistory",async({sessionId:t,lastMessageTimestamp:n,abortSignal:r})=>{const i=n?{lastMessageTimestamp:n}:void 0;return await this.client.GET("/backend/widget/v2/session/history/{sessionId}",{params:{path:{sessionId:t},query:i},signal:r})});ie(this,"createUnverifiedContact",async t=>await this.client.POST("/backend/widget/v2/contact/create-unverified",{params:{header:{"x-bot-token":this.config.token}},body:t}));ie(this,"createSession",async t=>await this.client.POST("/backend/widget/v2/create-session",{body:t}));ie(this,"getSession",async({sessionId:t,abortSignal:n})=>await this.client.GET("/backend/widget/v2/session/{sessionId}",{params:{path:{sessionId:t}},signal:n}));ie(this,"getSessions",async({cursor:t,filters:n,abortSignal:r})=>await this.client.GET("/backend/widget/v2/sessions",{params:{query:{cursor:t,filters:JSON.stringify(n)}},signal:r}));ie(this,"uploadFile",async(t,n={})=>{const r=new FormData;r.append("file",t.file);const{data:i}=await this.uploadFileClient.post("",r,{headers:{"Content-Type":"multipart/form-data"},...n});return i});ie(this,"vote",async t=>await this.client.POST("/backend/widget/v2/chat/vote",{body:t}));var i;this.config=t;const{baseUrl:n,headers:r}=this.constructClientOptions((i=t.user)==null?void 0:i.token);this.client=this.createOpenAPIClient({baseUrl:n,headers:r}),this.uploadFileClient=this.createAxiosUploadClient({baseUrl:n,headers:r})}}var Rf={exports:{}};Rf.exports,function(e,t){var n=200,r="__lodash_hash_undefined__",i=1,a=2,o=9007199254740991,s="[object Arguments]",u="[object Array]",l="[object AsyncFunction]",c="[object Boolean]",d="[object Date]",f="[object Error]",p="[object Function]",m="[object GeneratorFunction]",g="[object Map]",x="[object Number]",y="[object Null]",w="[object Object]",b="[object Promise]",T="[object Proxy]",S="[object RegExp]",_="[object Set]",N="[object String]",D="[object Symbol]",V="[object Undefined]",P="[object WeakMap]",$="[object ArrayBuffer]",H="[object DataView]",X="[object Float32Array]",Y="[object Float64Array]",ne="[object Int8Array]",re="[object Int16Array]",ee="[object Int32Array]",F="[object Uint8Array]",B="[object Uint8ClampedArray]",A="[object Uint16Array]",ae="[object Uint32Array]",he=/[\\^$.*+?()[\]{}|]/g,O=/^\[object .+?Constructor\]$/,Pe=/^(?:0|[1-9]\d*)$/,ge={};ge[X]=ge[Y]=ge[ne]=ge[re]=ge[ee]=ge[F]=ge[B]=ge[A]=ge[ae]=!0,ge[s]=ge[u]=ge[$]=ge[c]=ge[H]=ge[d]=ge[f]=ge[p]=ge[g]=ge[x]=ge[w]=ge[S]=ge[_]=ge[N]=ge[P]=!1;var we=typeof Qe=="object"&&Qe&&Qe.Object===Object&&Qe,$e=typeof self=="object"&&self&&self.Object===Object&&self,Ve=we||$e||Function("return this")(),We=t&&!t.nodeType&&t,Ge=We&&!0&&e&&!e.nodeType&&e,_t=Ge&&Ge.exports===We,Te=_t&&we.process,xe=function(){try{return Te&&Te.binding&&Te.binding("util")}catch{}}(),Ye=xe&&xe.isTypedArray;function He(k,L){for(var W=-1,le=k==null?0:k.length,at=0,Re=[];++W<le;){var bt=k[W];L(bt,W,k)&&(Re[at++]=bt)}return Re}function vt(k,L){for(var W=-1,le=L.length,at=k.length;++W<le;)k[at+W]=L[W];return k}function wt(k,L){for(var W=-1,le=k==null?0:k.length;++W<le;)if(L(k[W],W,k))return!0;return!1}function Ke(k,L){for(var W=-1,le=Array(k);++W<k;)le[W]=L(W);return le}function Me(k){return function(L){return k(L)}}function It(k,L){return k.has(L)}function ka(k,L){return k==null?void 0:k[L]}function Ra(k){var L=-1,W=Array(k.size);return k.forEach(function(le,at){W[++L]=[at,le]}),W}function Na(k,L){return function(W){return k(L(W))}}function te(k){var L=-1,W=Array(k.size);return k.forEach(function(le){W[++L]=le}),W}var de=Array.prototype,j=Function.prototype,q=Object.prototype,ce=Ve["__core-js_shared__"],_e=j.toString,Ee=q.hasOwnProperty,Bt=function(){var k=/[^.]+$/.exec(ce&&ce.keys&&ce.keys.IE_PROTO||"");return k?"Symbol(src)_1."+k:""}(),Pn=q.toString,mn=RegExp("^"+_e.call(Ee).replace(he,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Gn=_t?Ve.Buffer:void 0,In=Ve.Symbol,Rt=Ve.Uint8Array,Kn=q.propertyIsEnumerable,gn=de.splice,Ai=In?In.toStringTag:void 0,WI=Object.getOwnPropertySymbols,Ere=Gn?Gn.isBuffer:void 0,Tre=Na(Object.keys,Object),zv=Qs(Ve,"DataView"),mc=Qs(Ve,"Map"),Vv=Qs(Ve,"Promise"),$v=Qs(Ve,"Set"),Wv=Qs(Ve,"WeakMap"),gc=Qs(Object,"create"),_re=bo(zv),Sre=bo(mc),Cre=bo(Vv),Are=bo($v),kre=bo(Wv),YI=In?In.prototype:void 0,Yv=YI?YI.valueOf:void 0;function vo(k){var L=-1,W=k==null?0:k.length;for(this.clear();++L<W;){var le=k[L];this.set(le[0],le[1])}}function Rre(){this.__data__=gc?gc(null):{},this.size=0}function Nre(k){var L=this.has(k)&&delete this.__data__[k];return this.size-=L?1:0,L}function Pre(k){var L=this.__data__;if(gc){var W=L[k];return W===r?void 0:W}return Ee.call(L,k)?L[k]:void 0}function Ire(k){var L=this.__data__;return gc?L[k]!==void 0:Ee.call(L,k)}function Ore(k,L){var W=this.__data__;return this.size+=this.has(k)?0:1,W[k]=gc&&L===void 0?r:L,this}vo.prototype.clear=Rre,vo.prototype.delete=Nre,vo.prototype.get=Pre,vo.prototype.has=Ire,vo.prototype.set=Ore;function ki(k){var L=-1,W=k==null?0:k.length;for(this.clear();++L<W;){var le=k[L];this.set(le[0],le[1])}}function Dre(){this.__data__=[],this.size=0}function Lre(k){var L=this.__data__,W=sh(L,k);if(W<0)return!1;var le=L.length-1;return W==le?L.pop():gn.call(L,W,1),--this.size,!0}function Mre(k){var L=this.__data__,W=sh(L,k);return W<0?void 0:L[W][1]}function Fre(k){return sh(this.__data__,k)>-1}function Bre(k,L){var W=this.__data__,le=sh(W,k);return le<0?(++this.size,W.push([k,L])):W[le][1]=L,this}ki.prototype.clear=Dre,ki.prototype.delete=Lre,ki.prototype.get=Mre,ki.prototype.has=Fre,ki.prototype.set=Bre;function wo(k){var L=-1,W=k==null?0:k.length;for(this.clear();++L<W;){var le=k[L];this.set(le[0],le[1])}}function jre(){this.size=0,this.__data__={hash:new vo,map:new(mc||ki),string:new vo}}function Ure(k){var L=uh(this,k).delete(k);return this.size-=L?1:0,L}function Hre(k){return uh(this,k).get(k)}function zre(k){return uh(this,k).has(k)}function Vre(k,L){var W=uh(this,k),le=W.size;return W.set(k,L),this.size+=W.size==le?0:1,this}wo.prototype.clear=jre,wo.prototype.delete=Ure,wo.prototype.get=Hre,wo.prototype.has=zre,wo.prototype.set=Vre;function oh(k){var L=-1,W=k==null?0:k.length;for(this.__data__=new wo;++L<W;)this.add(k[L])}function $re(k){return this.__data__.set(k,r),this}function Wre(k){return this.__data__.has(k)}oh.prototype.add=oh.prototype.push=$re,oh.prototype.has=Wre;function Pa(k){var L=this.__data__=new ki(k);this.size=L.size}function Yre(){this.__data__=new ki,this.size=0}function qre(k){var L=this.__data__,W=L.delete(k);return this.size=L.size,W}function Gre(k){return this.__data__.get(k)}function Kre(k){return this.__data__.has(k)}function Xre(k,L){var W=this.__data__;if(W instanceof ki){var le=W.__data__;if(!mc||le.length<n-1)return le.push([k,L]),this.size=++W.size,this;W=this.__data__=new wo(le)}return W.set(k,L),this.size=W.size,this}Pa.prototype.clear=Yre,Pa.prototype.delete=qre,Pa.prototype.get=Gre,Pa.prototype.has=Kre,Pa.prototype.set=Xre;function Qre(k,L){var W=lh(k),le=!W&&fie(k),at=!W&&!le&&qv(k),Re=!W&&!le&&!at&&tO(k),bt=W||le||at||Re,jt=bt?Ke(k.length,String):[],Yt=jt.length;for(var gt in k)Ee.call(k,gt)&&!(bt&&(gt=="length"||at&&(gt=="offset"||gt=="parent")||Re&&(gt=="buffer"||gt=="byteLength"||gt=="byteOffset")||sie(gt,Yt)))&&jt.push(gt);return jt}function sh(k,L){for(var W=k.length;W--;)if(QI(k[W][0],L))return W;return-1}function Zre(k,L,W){var le=L(k);return lh(k)?le:vt(le,W(k))}function yc(k){return k==null?k===void 0?V:y:Ai&&Ai in Object(k)?aie(k):die(k)}function qI(k){return vc(k)&&yc(k)==s}function GI(k,L,W,le,at){return k===L?!0:k==null||L==null||!vc(k)&&!vc(L)?k!==k&&L!==L:Jre(k,L,W,le,GI,at)}function Jre(k,L,W,le,at,Re){var bt=lh(k),jt=lh(L),Yt=bt?u:Ia(k),gt=jt?u:Ia(L);Yt=Yt==s?w:Yt,gt=gt==s?w:gt;var Xn=Yt==w,Ir=gt==w,sn=Yt==gt;if(sn&&qv(k)){if(!qv(L))return!1;bt=!0,Xn=!1}if(sn&&!Xn)return Re||(Re=new Pa),bt||tO(k)?KI(k,L,W,le,at,Re):rie(k,L,Yt,W,le,at,Re);if(!(W&i)){var fr=Xn&&Ee.call(k,"__wrapped__"),pr=Ir&&Ee.call(L,"__wrapped__");if(fr||pr){var Oa=fr?k.value():k,Ri=pr?L.value():L;return Re||(Re=new Pa),at(Oa,Ri,W,le,Re)}}return sn?(Re||(Re=new Pa),iie(k,L,W,le,at,Re)):!1}function eie(k){if(!eO(k)||lie(k))return!1;var L=ZI(k)?mn:O;return L.test(bo(k))}function tie(k){return vc(k)&&JI(k.length)&&!!ge[yc(k)]}function nie(k){if(!cie(k))return Tre(k);var L=[];for(var W in Object(k))Ee.call(k,W)&&W!="constructor"&&L.push(W);return L}function KI(k,L,W,le,at,Re){var bt=W&i,jt=k.length,Yt=L.length;if(jt!=Yt&&!(bt&&Yt>jt))return!1;var gt=Re.get(k);if(gt&&Re.get(L))return gt==L;var Xn=-1,Ir=!0,sn=W&a?new oh:void 0;for(Re.set(k,L),Re.set(L,k);++Xn<jt;){var fr=k[Xn],pr=L[Xn];if(le)var Oa=bt?le(pr,fr,Xn,L,k,Re):le(fr,pr,Xn,k,L,Re);if(Oa!==void 0){if(Oa)continue;Ir=!1;break}if(sn){if(!wt(L,function(Ri,xo){if(!It(sn,xo)&&(fr===Ri||at(fr,Ri,W,le,Re)))return sn.push(xo)})){Ir=!1;break}}else if(!(fr===pr||at(fr,pr,W,le,Re))){Ir=!1;break}}return Re.delete(k),Re.delete(L),Ir}function rie(k,L,W,le,at,Re,bt){switch(W){case H:if(k.byteLength!=L.byteLength||k.byteOffset!=L.byteOffset)return!1;k=k.buffer,L=L.buffer;case $:return!(k.byteLength!=L.byteLength||!Re(new Rt(k),new Rt(L)));case c:case d:case x:return QI(+k,+L);case f:return k.name==L.name&&k.message==L.message;case S:case N:return k==L+"";case g:var jt=Ra;case _:var Yt=le&i;if(jt||(jt=te),k.size!=L.size&&!Yt)return!1;var gt=bt.get(k);if(gt)return gt==L;le|=a,bt.set(k,L);var Xn=KI(jt(k),jt(L),le,at,Re,bt);return bt.delete(k),Xn;case D:if(Yv)return Yv.call(k)==Yv.call(L)}return!1}function iie(k,L,W,le,at,Re){var bt=W&i,jt=XI(k),Yt=jt.length,gt=XI(L),Xn=gt.length;if(Yt!=Xn&&!bt)return!1;for(var Ir=Yt;Ir--;){var sn=jt[Ir];if(!(bt?sn in L:Ee.call(L,sn)))return!1}var fr=Re.get(k);if(fr&&Re.get(L))return fr==L;var pr=!0;Re.set(k,L),Re.set(L,k);for(var Oa=bt;++Ir<Yt;){sn=jt[Ir];var Ri=k[sn],xo=L[sn];if(le)var nO=bt?le(xo,Ri,sn,L,k,Re):le(Ri,xo,sn,k,L,Re);if(!(nO===void 0?Ri===xo||at(Ri,xo,W,le,Re):nO)){pr=!1;break}Oa||(Oa=sn=="constructor")}if(pr&&!Oa){var ch=k.constructor,dh=L.constructor;ch!=dh&&"constructor"in k&&"constructor"in L&&!(typeof ch=="function"&&ch instanceof ch&&typeof dh=="function"&&dh instanceof dh)&&(pr=!1)}return Re.delete(k),Re.delete(L),pr}function XI(k){return Zre(k,mie,oie)}function uh(k,L){var W=k.__data__;return uie(L)?W[typeof L=="string"?"string":"hash"]:W.map}function Qs(k,L){var W=ka(k,L);return eie(W)?W:void 0}function aie(k){var L=Ee.call(k,Ai),W=k[Ai];try{k[Ai]=void 0;var le=!0}catch{}var at=Pn.call(k);return le&&(L?k[Ai]=W:delete k[Ai]),at}var oie=WI?function(k){return k==null?[]:(k=Object(k),He(WI(k),function(L){return Kn.call(k,L)}))}:gie,Ia=yc;(zv&&Ia(new zv(new ArrayBuffer(1)))!=H||mc&&Ia(new mc)!=g||Vv&&Ia(Vv.resolve())!=b||$v&&Ia(new $v)!=_||Wv&&Ia(new Wv)!=P)&&(Ia=function(k){var L=yc(k),W=L==w?k.constructor:void 0,le=W?bo(W):"";if(le)switch(le){case _re:return H;case Sre:return g;case Cre:return b;case Are:return _;case kre:return P}return L});function sie(k,L){return L=L??o,!!L&&(typeof k=="number"||Pe.test(k))&&k>-1&&k%1==0&&k<L}function uie(k){var L=typeof k;return L=="string"||L=="number"||L=="symbol"||L=="boolean"?k!=="__proto__":k===null}function lie(k){return!!Bt&&Bt in k}function cie(k){var L=k&&k.constructor,W=typeof L=="function"&&L.prototype||q;return k===W}function die(k){return Pn.call(k)}function bo(k){if(k!=null){try{return _e.call(k)}catch{}try{return k+""}catch{}}return""}function QI(k,L){return k===L||k!==k&&L!==L}var fie=qI(function(){return arguments}())?qI:function(k){return vc(k)&&Ee.call(k,"callee")&&!Kn.call(k,"callee")},lh=Array.isArray;function pie(k){return k!=null&&JI(k.length)&&!ZI(k)}var qv=Ere||yie;function hie(k,L){return GI(k,L)}function ZI(k){if(!eO(k))return!1;var L=yc(k);return L==p||L==m||L==l||L==T}function JI(k){return typeof k=="number"&&k>-1&&k%1==0&&k<=o}function eO(k){var L=typeof k;return k!=null&&(L=="object"||L=="function")}function vc(k){return k!=null&&typeof k=="object"}var tO=Ye?Me(Ye):tie;function mie(k){return pie(k)?Qre(k):nie(k)}function gie(){return[]}function yie(){return!1}e.exports=hie}(Rf,Rf.exports);var j7=Rf.exports;const U7=St(j7);class ms{constructor(t){ie(this,"subscribers",new Set);Gv(this,Jr);ie(this,"initialState");Gv(this,Xs);ie(this,"lifecycleListeners",new Map);ie(this,"emitLifecycle",(t,n)=>{const r=this.lifecycleListeners.get(t);if(r){const i={type:t,timestamp:Date.now(),data:n};r.forEach(a=>{try{a(i)}catch{}})}});ie(this,"notifySubscribers",t=>{Array.from(this.subscribers).forEach(r=>{try{r(t)}catch(i){this.emitLifecycle("error",{error:i})}})});ie(this,"subscribe",t=>(this.subscribers.add(t),()=>{this.subscribers.delete(t)}));ie(this,"onLifecycle",(t,n)=>{this.lifecycleListeners.has(t)||this.lifecycleListeners.set(t,new Set);const r=this.lifecycleListeners.get(t);return r.add(n),()=>{r.delete(n),r.size===0&&this.lifecycleListeners.delete(t)}});ie(this,"get",()=>Eo(this,Jr));ie(this,"set",t=>{this.emitLifecycle("beforeUpdate",{previousState:Eo(this,Jr),nextState:t}),U7(Eo(this,Jr),t)||(wc(this,Jr,t),wc(this,Xs,Date.now()),this.emitLifecycle("stateChange",{state:t}),this.notifySubscribers(t)),this.emitLifecycle("afterUpdate",{state:t})});ie(this,"setPartial",t=>{if(t==null)return;const n={...Eo(this,Jr),...t};this.set(n)});ie(this,"clear",()=>{this.emitLifecycle("destroy"),this.subscribers=new Set,this.lifecycleListeners=new Map});ie(this,"reset",()=>{this.set(this.initialState)});ie(this,"lastUpdated",()=>Eo(this,Xs));wc(this,Jr,t),this.initialState=t,wc(this,Xs,Date.now()),this.emitLifecycle("init",{initialState:Eo(this,Jr)})}}Jr=new WeakMap,Xs=new WeakMap;class H7{constructor({config:t,api:n}){ie(this,"config");ie(this,"api");ie(this,"state");ie(this,"shouldCollectData",()=>{var n;return!!(!((n=this.state.get().contact)!=null&&n.token)&&this.config.collectUserData)});ie(this,"autoCreateUnverifiedUser",async()=>{var t,n,r,i;await this.createUnverifiedContact({name:((n=(t=this.config.user)==null?void 0:t.data)==null?void 0:n.name)||"Anonymous",email:(i=(r=this.config.user)==null?void 0:r.data)==null?void 0:i.email})});ie(this,"createUnverifiedContact",async t=>{try{this.state.setPartial({isCreatingUnverifiedContact:!0,isErrorCreatingUnverifiedContact:!1});const{data:n}=await this.api.createUnverifiedContact(t);n!=null&&n.token?(this.api.setAuthToken(n.token),this.state.setPartial({contact:{token:n.token}})):this.state.setPartial({isErrorCreatingUnverifiedContact:!0})}finally{this.state.setPartial({isCreatingUnverifiedContact:!1})}});var r,i,a;this.config=t,this.api=n,this.state=new ms({contact:(r=t.user)!=null&&r.token?{token:(i=t.user)==null?void 0:i.token}:null,isCreatingUnverifiedContact:!1,isErrorCreatingUnverifiedContact:!1}),!((a=t.user)!=null&&a.token)&&!t.collectUserData&&this.autoCreateUnverifiedUser()}}class gC{constructor(){ie(this,"state",new ms({isPolling:!1,isError:!1}));ie(this,"abortController",new AbortController);ie(this,"reset",()=>{var t;this.abortController.abort("Resetting poller"),(t=this.stopPolling)==null||t.call(this),this.stopPolling=null});ie(this,"stopPolling",null);ie(this,"startPolling",(t,n)=>{if(this.stopPolling)return;const r=[],i=async()=>{this.abortController=new AbortController,this.state.setPartial({isPolling:!0});try{await t(this.abortController.signal)}catch(a){if(this.abortController.signal.aborted)return;console.error("Failed to poll:",a),this.state.setPartial({isError:!0})}finally{this.state.setPartial({isPolling:!1})}this.abortController.signal.aborted?console.log("Poller aborted, not scheduling anymore"):r.push(setTimeout(i,n))};i(),this.stopPolling=()=>{r.forEach(clearTimeout),this.state.reset()}})}}const $t=[];for(let e=0;e<256;++e)$t.push((e+256).toString(16).slice(1));function z7(e,t=0){return($t[e[t+0]]+$t[e[t+1]]+$t[e[t+2]]+$t[e[t+3]]+"-"+$t[e[t+4]]+$t[e[t+5]]+"-"+$t[e[t+6]]+$t[e[t+7]]+"-"+$t[e[t+8]]+$t[e[t+9]]+"-"+$t[e[t+10]]+$t[e[t+11]]+$t[e[t+12]]+$t[e[t+13]]+$t[e[t+14]]+$t[e[t+15]]).toLowerCase()}let dy;const V7=new Uint8Array(16);function $7(){if(!dy){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");dy=crypto.getRandomValues.bind(crypto)}return dy(V7)}const yC={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function vC(e,t,n){var i;if(yC.randomUUID&&!t&&!e)return yC.randomUUID();e=e||{};const r=e.random??((i=e.rng)==null?void 0:i.call(e))??$7();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,z7(r)}function Nf(){return vC()}class W7{constructor({config:t,api:n,contactCtx:r}){ie(this,"config");ie(this,"api");ie(this,"contactCtx");ie(this,"poller",new gC);ie(this,"sessionState",new ms({session:null,isCreatingSession:!1}));ie(this,"sessionsState",new ms({data:[],cursor:void 0,isLastPage:!1,didStartInitialFetch:!1,isInitialFetchLoading:!0}));ie(this,"reset",async()=>{this.sessionState.reset(),this.poller.reset()});ie(this,"registerPolling",()=>{this.sessionState.subscribe(({session:t})=>{t!=null&&t.id?this.poller.startPolling(async n=>{const{data:r}=await this.api.getSession({sessionId:t.id,abortSignal:n});r&&this.sessionState.setPartial({session:r})},1e3):this.poller.reset()})});ie(this,"registerInitialSessionsFetch",()=>{this.contactCtx.state.subscribe(async({contact:t})=>{t!=null&&t.token&&!this.sessionsState.get().didStartInitialFetch&&(this.sessionsState.setPartial({didStartInitialFetch:!0}),await this.loadMoreSessions(),this.sessionsState.setPartial({isInitialFetchLoading:!1}))})});ie(this,"createSession",async()=>{var r,i;this.sessionState.setPartial({session:null,isCreatingSession:!0});const{data:t,error:n}=await this.api.createSession({customData:(r=this.config.user)!=null&&r.externalId?{external_id:(i=this.config.user)==null?void 0:i.externalId}:void 0});return t?(this.sessionState.setPartial({session:t,isCreatingSession:!1}),t):(console.error("Failed to create session:",n),null)});ie(this,"loadMoreSessions",async()=>{var n,r;if(this.sessionsState.get().isLastPage||!((n=this.contactCtx.state.get().contact)!=null&&n.token))return;const{data:t}=await this.api.getSessions({cursor:this.sessionsState.get().cursor,filters:(r=this.config.user)!=null&&r.externalId?{external_id:this.config.user.externalId}:{}});if(t){const a=[...this.sessionsState.get().data,...t.items].filter((o,s,u)=>s===u.findIndex(l=>o.id===l.id));this.sessionsState.setPartial({data:a,cursor:t.next||void 0,isLastPage:t.next===null})}});this.config=t,this.api=n,this.contactCtx=r,this.registerPolling(),this.registerInitialSessionsFetch()}}class gs{constructor({config:t,api:n,sessionCtx:r}){ie(this,"config");ie(this,"api");ie(this,"sessionCtx");ie(this,"poller",new gC);ie(this,"state",new ms({messages:[],isSendingMessage:!1,suggestedReplies:null,isInitialFetchLoading:!1}));ie(this,"sendMessageAbortController",new AbortController);ie(this,"reset",()=>{this.sendMessageAbortController.abort("Resetting chat"),this.state.reset(),this.poller.reset()});ie(this,"registerPolling",()=>{this.sessionCtx.sessionState.subscribe(({session:t})=>{t!=null&&t.id?this.poller.startPolling(async n=>{await this.fetchAndSetHistory(t.id,n)},1e3):this.poller.reset()})});ie(this,"sendMessage",async t=>{var i,a,o,s,u,l,c;this.sendMessageAbortController=new AbortController;const n=this.state.get().isSendingMessage,r=((i=this.sessionCtx.sessionState.get().session)==null?void 0:i.assignee.kind)==="ai";if(n&&r){console.warn("Cannot send messages while awaiting AI response");return}this.state.setPartial({suggestedReplies:null});try{this.state.setPartial({isSendingMessage:!0});const d=gs.toUserMessage(t.content,t.attachments||void 0),f=this.state.get().messages;if(this.state.setPartial({messages:[...f,d]}),!((a=this.sessionCtx.sessionState.get().session)!=null&&a.id)&&!await this.sessionCtx.createSession()){console.error("Failed to create session");return}const p=(o=this.sessionCtx.sessionState.get().session)==null?void 0:o.id;if(!p)return;const{data:m}=await this.api.sendMessage({uuid:d.id,bot_token:this.config.token,headers:this.config.headers,query_params:this.config.queryParams,session_id:p,user:(s=this.config.user)==null?void 0:s.data,...t},this.sendMessageAbortController.signal);if(m!=null&&m.success){const g=gs.toBotMessage(m);if(g){const x=this.state.get().messages;if(!!x.some(w=>w.id===g.id))return;this.state.setPartial({messages:[...x,g]})}else(u=m.options)!=null&&u.value&&((l=m.options)==null?void 0:l.value.length)>0&&this.state.setPartial({suggestedReplies:m.options.value})}else{const g=gs.toErrorMessage(((c=m==null?void 0:m.error)==null?void 0:c.message)||"Unknown error occurred"),x=this.state.get().messages;this.state.setPartial({messages:[...x,g]})}}catch(d){this.sendMessageAbortController.signal.aborted||console.error("Failed to send message:",d)}finally{this.state.setPartial({isSendingMessage:!1})}});ie(this,"fetchAndSetHistory",async(t,n)=>{var a;this.state.get().messages.length===0&&this.state.setPartial({isInitialFetchLoading:!0});const r=(a=this.state.get().messages.at(-1))==null?void 0:a.timestamp,{data:i}=await this.api.getSessionHistory({sessionId:t,lastMessageTimestamp:r,abortSignal:n});if(i&&i.length>0){const o=this.state.get().messages,s=i.map(gs.mapHistoryToMessage).filter(u=>!o.some(l=>l.id===u.id));this.state.setPartial({messages:[...o,...s]})}this.state.get().isInitialFetchLoading&&this.state.setPartial({isInitialFetchLoading:!1})});this.config=t,this.api=n,this.sessionCtx=r,this.registerPolling()}static mapHistoryToMessage(t){const n={id:t.publicId,timestamp:t.sentAt||"",attachments:t.attachments||void 0};return t.sender.kind==="user"?{...n,type:"FROM_USER",content:t.content.text||"",deliveredAt:t.sentAt||""}:t.sender.kind==="agent"?{...n,type:"FROM_AGENT",component:"agent_message",data:{message:t.content.text||""}}:{...n,type:"FROM_BOT",component:"bot_message",agent:{id:null,name:t.sender.name||"",isAi:t.sender.kind==="ai",avatar:t.sender.avatar||null},data:{message:t.content.text}}}static toUserMessage(t,n){return{id:Nf(),type:"FROM_USER",content:t,deliveredAt:new Date().toISOString(),attachments:n,timestamp:new Date().toISOString()}}static toBotMessage(t){if(t.success&&t.autopilotResponse)return{type:"FROM_BOT",id:t.autopilotResponse.id||Nf(),timestamp:new Date().toISOString(),component:"bot_message",data:{message:t.autopilotResponse.value.content}};if(t.success&&t.uiResponse){const n=t.uiResponse.value;return{type:"FROM_BOT",id:Nf(),timestamp:new Date().toISOString(),component:n.name,data:n.request_response}}return null}static toErrorMessage(t){return{type:"FROM_BOT",id:Nf(),timestamp:new Date().toISOString(),component:"TEXT",data:{message:t,variant:"error"}}}}class Y7{constructor({contactCtx:t,sessionCtx:n,resetChat:r}){ie(this,"state");ie(this,"contactCtx");ie(this,"sessionCtx");ie(this,"resetChat");ie(this,"registerRoutingListener",()=>{this.contactCtx.state.subscribe(({contact:t})=>{t!=null&&t.token&&this.state.get().screen==="welcome"&&this.state.setPartial({screen:"sessions"})})});ie(this,"toSessionsScreen",()=>{this.resetChat(),this.state.setPartial({screen:"sessions"})});ie(this,"toChatScreen",t=>{if(this.resetChat(),t){const n=this.sessionCtx.sessionsState.get().data.find(r=>r.id===t);if(!n)return;this.sessionCtx.sessionState.setPartial({session:n})}this.state.setPartial({screen:"chat"})});this.state=new ms({screen:t.shouldCollectData()?"welcome":"sessions"}),this.contactCtx=t,this.sessionCtx=n,this.resetChat=r,this.registerRoutingListener()}}class q7{constructor({config:t}){ie(this,"config");ie(this,"api");ie(this,"contactCtx");ie(this,"sessionCtx");ie(this,"messageCtx");ie(this,"routerCtx");ie(this,"resetChat",()=>{this.sessionCtx.reset(),this.messageCtx.reset()});this.config=t,this.api=new B7({config:t}),this.contactCtx=new H7({api:this.api,config:this.config}),this.sessionCtx=new W7({config:this.config,api:this.api,contactCtx:this.contactCtx}),this.messageCtx=new gs({config:this.config,api:this.api,sessionCtx:this.sessionCtx}),this.routerCtx=new Y7({contactCtx:this.contactCtx,sessionCtx:this.sessionCtx,resetChat:this.resetChat})}}const[zn,G7]=iB();function K7({options:e,children:t,components:n}){const r=v.useMemo(()=>new q7({config:e}),[e]),i=v.useMemo(()=>new rB({components:n}),[n]);return E.jsx(G7,{value:{widgetCtx:r,components:n,componentStore:i,version:yE},children:t})}function dl(){const{widgetCtx:e}=zn();return e.config}function fl(e){return v.useSyncExternalStore(e.subscribe,e.get,e.get)}function X7(){const{widgetCtx:e}=zn();return{contactState:fl(e.contactCtx.state),createUnverifiedContact:e.contactCtx.createUnverifiedContact}}function pl(){const{widgetCtx:e}=zn();return{messagesState:fl(e.messageCtx.state),sendMessage:e.messageCtx.sendMessage}}function ys(){const{widgetCtx:e}=zn(),t=fl(e.sessionCtx.sessionState),n=fl(e.sessionCtx.sessionsState);return{sessionState:t,sessionsState:n,loadMoreSessions:e.sessionCtx.loadMoreSessions}}function wC(){var r;const{sessionState:e}=ys(),{messagesState:t}=pl();return{isAwaitingBotReply:(!((r=e.session)!=null&&r.isHandedOff)||e.session.assignee.kind==="ai"||e.isCreatingSession)&&t.isSendingMessage}}var bC={exports:{}},xC={};/**
333
+ `+a):r.stack=a}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=no(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:a}=n;r!==void 0&&Af.assertOptions(r,{silentJSONParsing:Hr.transitional(Hr.boolean),forcedJSONParsing:Hr.transitional(Hr.boolean),clarifyTimeoutError:Hr.transitional(Hr.boolean)},!1),i!=null&&(z.isFunction(i)?n.paramsSerializer={serialize:i}:Af.assertOptions(i,{encode:Hr.function,serialize:Hr.function},!0)),Af.assertOptions(n,{baseUrl:Hr.spelling("baseURL"),withXsrfToken:Hr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=a&&z.merge(a.common,a[n.method]);a&&z.forEach(["delete","get","head","post","put","patch","common"],m=>{delete a[m]}),n.headers=Tn.concat(o,a);const s=[];let u=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(u=u&&g.synchronous,s.unshift(g.fulfilled,g.rejected))});const l=[];this.interceptors.response.forEach(function(g){l.push(g.fulfilled,g.rejected)});let c,d=0,f;if(!u){const m=[uC.bind(this),void 0];for(m.unshift.apply(m,s),m.push.apply(m,l),f=m.length,c=Promise.resolve(n);d<f;)c=c.then(m[d++],m[d++]);return c}f=s.length;let p=n;for(d=0;d<f;){const m=s[d++],g=s[d++];try{p=m(p)}catch(x){g.call(this,x);break}}try{c=uC.call(this,p)}catch(m){return Promise.reject(m)}for(d=0,f=l.length;d<f;)c=c.then(l[d++],l[d++]);return c}getUri(t){t=no(this.defaults,t);const n=JS(t.baseURL,t.url);return $S(n,t.params,t.paramsSerializer)}}z.forEach(["delete","get","head","options"],function(t){ro.prototype[t]=function(n,r){return this.request(no(r||{},{method:t,url:n,data:(r||{}).data}))}}),z.forEach(["post","put","patch"],function(t){function n(r){return function(a,o,s){return this.request(no(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:o}))}}ro.prototype[t]=n(),ro.prototype[t+"Form"]=n(!0)});class ly{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const r=this;this.promise.then(i=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](i);r._listeners=null}),this.promise.then=i=>{let a;const o=new Promise(s=>{r.subscribe(s),a=s}).then(i);return o.cancel=function(){r.unsubscribe(a)},o},t(function(a,o,s){r.reason||(r.reason=new hs(a,o,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new ly(function(i){t=i}),cancel:t}}}function C7(e){return function(n){return e.apply(null,n)}}function A7(e){return z.isObject(e)&&e.isAxiosError===!0}const cy={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(cy).forEach(([e,t])=>{cy[t]=e});function dC(e){const t=new ro(e),n=kS(ro.prototype.request,t);return z.extend(n,ro.prototype,t,{allOwnKeys:!0}),z.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return dC(no(e,i))},n}const At=dC(ll);At.Axios=ro,At.CanceledError=hs,At.CancelToken=ly,At.isCancel=KS,At.VERSION=lC,At.toFormData=xf,At.AxiosError=Se,At.Cancel=At.CanceledError,At.all=function(t){return Promise.all(t)},At.spread=C7,At.isAxiosError=A7,At.mergeConfig=no,At.AxiosHeaders=Tn,At.formToJSON=e=>qS(z.isHTMLForm(e)?new FormData(e):e),At.getAdapter=sC.getAdapter,At.HttpStatusCode=cy,At.default=At;const k7=/\{[^{}]+\}/g,R7=()=>{var e,t;return typeof process=="object"&&Number.parseInt((t=(e=process==null?void 0:process.versions)==null?void 0:e.node)==null?void 0:t.substring(0,2))>=18&&process.versions.undici};function N7(){return Math.random().toString(36).slice(2,11)}function P7(e){let{baseUrl:t="",Request:n=globalThis.Request,fetch:r=globalThis.fetch,querySerializer:i,bodySerializer:a,headers:o,requestInitExt:s=void 0,...u}={...e};s=R7()?s:void 0,t=mC(t);const l=[];async function c(d,f){const{baseUrl:p,fetch:m=r,Request:g=n,headers:x,params:y={},parseAs:w="json",querySerializer:b,bodySerializer:T=a??O7,body:S,..._}=f||{};p&&(t=mC(p));let N=typeof i=="function"?i:hC(i);b&&(N=typeof b=="function"?b:hC({...typeof i=="object"?i:{},...b}));const D=S===void 0?void 0:T(S),V=D===void 0||D instanceof FormData?{}:{"Content-Type":"application/json"},P={redirect:"follow",...u,..._,body:D,headers:L7(V,o,x,y.header)};let $,H,X=new n(D7(d,{baseUrl:t,params:y,querySerializer:N}),P);for(const re in _)re in X||(X[re]=_[re]);if(l.length){$=N7(),H=Object.freeze({baseUrl:t,fetch:m,parseAs:w,querySerializer:N,bodySerializer:T});for(const re of l)if(re&&typeof re=="object"&&typeof re.onRequest=="function"){const ee=await re.onRequest({request:X,schemaPath:d,params:y,options:H,id:$});if(ee){if(!(ee instanceof n))throw new Error("onRequest: must return new Request() when modifying the request");X=ee}}}let Y;try{Y=await m(X,s)}catch(re){let ee=re;if(l.length)for(let F=l.length-1;F>=0;F--){const B=l[F];if(B&&typeof B=="object"&&typeof B.onError=="function"){const A=await B.onError({request:X,error:ee,schemaPath:d,params:y,options:H,id:$});if(A){if(A instanceof Response){ee=void 0,Y=A;break}if(A instanceof Error){ee=A;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(ee)throw ee}if(l.length)for(let re=l.length-1;re>=0;re--){const ee=l[re];if(ee&&typeof ee=="object"&&typeof ee.onResponse=="function"){const F=await ee.onResponse({request:X,response:Y,schemaPath:d,params:y,options:H,id:$});if(F){if(!(F instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");Y=F}}}if(Y.status===204||Y.headers.get("Content-Length")==="0")return Y.ok?{data:void 0,response:Y}:{error:void 0,response:Y};if(Y.ok)return w==="stream"?{data:Y.body,response:Y}:{data:await Y[w](),response:Y};let ne=await Y.text();try{ne=JSON.parse(ne)}catch{}return{error:ne,response:Y}}return{request(d,f,p){return c(f,{...p,method:d.toUpperCase()})},GET(d,f){return c(d,{...f,method:"GET"})},PUT(d,f){return c(d,{...f,method:"PUT"})},POST(d,f){return c(d,{...f,method:"POST"})},DELETE(d,f){return c(d,{...f,method:"DELETE"})},OPTIONS(d,f){return c(d,{...f,method:"OPTIONS"})},HEAD(d,f){return c(d,{...f,method:"HEAD"})},PATCH(d,f){return c(d,{...f,method:"PATCH"})},TRACE(d,f){return c(d,{...f,method:"TRACE"})},use(...d){for(const f of d)if(f){if(typeof f!="object"||!("onRequest"in f||"onResponse"in f||"onError"in f))throw new Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");l.push(f)}},eject(...d){for(const f of d){const p=l.indexOf(f);p!==-1&&l.splice(p,1)}}}}function kf(e,t,n){if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${(n==null?void 0:n.allowReserved)===!0?t:encodeURIComponent(t)}`}function fC(e,t,n){if(!t||typeof t!="object")return"";const r=[],i={simple:",",label:".",matrix:";"}[n.style]||"&";if(n.style!=="deepObject"&&n.explode===!1){for(const s in t)r.push(s,n.allowReserved===!0?t[s]:encodeURIComponent(t[s]));const o=r.join(",");switch(n.style){case"form":return`${e}=${o}`;case"label":return`.${o}`;case"matrix":return`;${e}=${o}`;default:return o}}for(const o in t){const s=n.style==="deepObject"?`${e}[${o}]`:o;r.push(kf(s,t[o],n))}const a=r.join(i);return n.style==="label"||n.style==="matrix"?`${i}${a}`:a}function pC(e,t,n){if(!Array.isArray(t))return"";if(n.explode===!1){const a={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[n.style]||",",o=(n.allowReserved===!0?t:t.map(s=>encodeURIComponent(s))).join(a);switch(n.style){case"simple":return o;case"label":return`.${o}`;case"matrix":return`;${e}=${o}`;default:return`${e}=${o}`}}const r={simple:",",label:".",matrix:";"}[n.style]||"&",i=[];for(const a of t)n.style==="simple"||n.style==="label"?i.push(n.allowReserved===!0?a:encodeURIComponent(a)):i.push(kf(e,a,n));return n.style==="label"||n.style==="matrix"?`${r}${i.join(r)}`:i.join(r)}function hC(e){return function(n){const r=[];if(n&&typeof n=="object")for(const i in n){const a=n[i];if(a!=null){if(Array.isArray(a)){if(a.length===0)continue;r.push(pC(i,a,{style:"form",explode:!0,...e==null?void 0:e.array,allowReserved:(e==null?void 0:e.allowReserved)||!1}));continue}if(typeof a=="object"){r.push(fC(i,a,{style:"deepObject",explode:!0,...e==null?void 0:e.object,allowReserved:(e==null?void 0:e.allowReserved)||!1}));continue}r.push(kf(i,a,e))}}return r.join("&")}}function I7(e,t){let n=e;for(const r of e.match(k7)??[]){let i=r.substring(1,r.length-1),a=!1,o="simple";if(i.endsWith("*")&&(a=!0,i=i.substring(0,i.length-1)),i.startsWith(".")?(o="label",i=i.substring(1)):i.startsWith(";")&&(o="matrix",i=i.substring(1)),!t||t[i]===void 0||t[i]===null)continue;const s=t[i];if(Array.isArray(s)){n=n.replace(r,pC(i,s,{style:o,explode:a}));continue}if(typeof s=="object"){n=n.replace(r,fC(i,s,{style:o,explode:a}));continue}if(o==="matrix"){n=n.replace(r,`;${kf(i,s)}`);continue}n=n.replace(r,o==="label"?`.${encodeURIComponent(s)}`:encodeURIComponent(s))}return n}function O7(e){return e instanceof FormData?e:JSON.stringify(e)}function D7(e,t){var i;let n=`${t.baseUrl}${e}`;(i=t.params)!=null&&i.path&&(n=I7(n,t.params.path));let r=t.querySerializer(t.params.query??{});return r.startsWith("?")&&(r=r.substring(1)),r&&(n+=`?${r}`),n}function L7(...e){const t=new Headers;for(const n of e){if(!n||typeof n!="object")continue;const r=n instanceof Headers?n.entries():Object.entries(n);for(const[i,a]of r)if(a===null)t.delete(i);else if(Array.isArray(a))for(const o of a)t.append(i,o);else a!==void 0&&t.set(i,a)}return t}function mC(e){return e.endsWith("/")?e.substring(0,e.length-1):e}const M7=e=>{console.log(e.error)},F7=e=>{const t=P7({baseUrl:e.baseUrl}),n={onRequest:e.onRequest,onResponse:e.onResponse,onError:e.onError||M7};return t.use(n),t};class B7{constructor({config:t}){ie(this,"client");ie(this,"uploadFileClient");ie(this,"config");ie(this,"constructClientOptions",t=>{const n=this.config.apiUrl||"https://api.open.cx",r={"X-Bot-Token":this.config.token,"Content-Type":"application/json",Accept:"application/json",Authorization:t?`Bearer ${t}`:void 0};return{baseUrl:n,headers:r}});ie(this,"createOpenAPIClient",({baseUrl:t,headers:n})=>F7({baseUrl:t,onRequest:({request:r})=>{Object.entries(n).forEach(([i,a])=>{a&&r.headers.set(i,a)})}}));ie(this,"createAxiosUploadClient",({baseUrl:t,headers:n})=>At.create({baseURL:`${t}/backend/widget/v2/upload`,headers:n}));ie(this,"setAuthToken",t=>{const{baseUrl:n,headers:r}=this.constructClientOptions(t);this.client=this.createOpenAPIClient({baseUrl:n,headers:r}),this.uploadFileClient=this.createAxiosUploadClient({baseUrl:n,headers:r})});ie(this,"widgetPrelude",async()=>await this.client.GET("/backend/widget/v2/prelude",{params:{header:{"X-Bot-Token":this.config.token}}}));ie(this,"sendMessage",async(t,n)=>await this.client.POST("/backend/widget/v2/chat/send",{body:t,signal:n}));ie(this,"getSessionHistory",async({sessionId:t,lastMessageTimestamp:n,abortSignal:r})=>{const i=n?{lastMessageTimestamp:n}:void 0;return await this.client.GET("/backend/widget/v2/session/history/{sessionId}",{params:{path:{sessionId:t},query:i},signal:r})});ie(this,"createUnverifiedContact",async t=>await this.client.POST("/backend/widget/v2/contact/create-unverified",{params:{header:{"x-bot-token":this.config.token}},body:t}));ie(this,"createSession",async t=>await this.client.POST("/backend/widget/v2/create-session",{body:t}));ie(this,"getSession",async({sessionId:t,abortSignal:n})=>await this.client.GET("/backend/widget/v2/session/{sessionId}",{params:{path:{sessionId:t}},signal:n}));ie(this,"getSessions",async({cursor:t,filters:n,abortSignal:r})=>await this.client.GET("/backend/widget/v2/sessions",{params:{query:{cursor:t,filters:JSON.stringify(n)}},signal:r}));ie(this,"uploadFile",async(t,n={})=>{const r=new FormData;r.append("file",t.file);const{data:i}=await this.uploadFileClient.post("",r,{headers:{"Content-Type":"multipart/form-data"},...n});return i});ie(this,"vote",async t=>await this.client.POST("/backend/widget/v2/chat/vote",{body:t}));var i;this.config=t;const{baseUrl:n,headers:r}=this.constructClientOptions((i=t.user)==null?void 0:i.token);this.client=this.createOpenAPIClient({baseUrl:n,headers:r}),this.uploadFileClient=this.createAxiosUploadClient({baseUrl:n,headers:r})}}var Rf={exports:{}};Rf.exports,function(e,t){var n=200,r="__lodash_hash_undefined__",i=1,a=2,o=9007199254740991,s="[object Arguments]",u="[object Array]",l="[object AsyncFunction]",c="[object Boolean]",d="[object Date]",f="[object Error]",p="[object Function]",m="[object GeneratorFunction]",g="[object Map]",x="[object Number]",y="[object Null]",w="[object Object]",b="[object Promise]",T="[object Proxy]",S="[object RegExp]",_="[object Set]",N="[object String]",D="[object Symbol]",V="[object Undefined]",P="[object WeakMap]",$="[object ArrayBuffer]",H="[object DataView]",X="[object Float32Array]",Y="[object Float64Array]",ne="[object Int8Array]",re="[object Int16Array]",ee="[object Int32Array]",F="[object Uint8Array]",B="[object Uint8ClampedArray]",A="[object Uint16Array]",ae="[object Uint32Array]",he=/[\\^$.*+?()[\]{}|]/g,O=/^\[object .+?Constructor\]$/,Pe=/^(?:0|[1-9]\d*)$/,ge={};ge[X]=ge[Y]=ge[ne]=ge[re]=ge[ee]=ge[F]=ge[B]=ge[A]=ge[ae]=!0,ge[s]=ge[u]=ge[$]=ge[c]=ge[H]=ge[d]=ge[f]=ge[p]=ge[g]=ge[x]=ge[w]=ge[S]=ge[_]=ge[N]=ge[P]=!1;var we=typeof Qe=="object"&&Qe&&Qe.Object===Object&&Qe,$e=typeof self=="object"&&self&&self.Object===Object&&self,Ve=we||$e||Function("return this")(),We=t&&!t.nodeType&&t,Ge=We&&!0&&e&&!e.nodeType&&e,_t=Ge&&Ge.exports===We,Te=_t&&we.process,xe=function(){try{return Te&&Te.binding&&Te.binding("util")}catch{}}(),Ye=xe&&xe.isTypedArray;function He(k,L){for(var W=-1,le=k==null?0:k.length,at=0,Re=[];++W<le;){var bt=k[W];L(bt,W,k)&&(Re[at++]=bt)}return Re}function vt(k,L){for(var W=-1,le=L.length,at=k.length;++W<le;)k[at+W]=L[W];return k}function wt(k,L){for(var W=-1,le=k==null?0:k.length;++W<le;)if(L(k[W],W,k))return!0;return!1}function Ke(k,L){for(var W=-1,le=Array(k);++W<k;)le[W]=L(W);return le}function Me(k){return function(L){return k(L)}}function It(k,L){return k.has(L)}function ka(k,L){return k==null?void 0:k[L]}function Ra(k){var L=-1,W=Array(k.size);return k.forEach(function(le,at){W[++L]=[at,le]}),W}function Na(k,L){return function(W){return k(L(W))}}function te(k){var L=-1,W=Array(k.size);return k.forEach(function(le){W[++L]=le}),W}var de=Array.prototype,j=Function.prototype,q=Object.prototype,ce=Ve["__core-js_shared__"],_e=j.toString,Ee=q.hasOwnProperty,Bt=function(){var k=/[^.]+$/.exec(ce&&ce.keys&&ce.keys.IE_PROTO||"");return k?"Symbol(src)_1."+k:""}(),Pn=q.toString,mn=RegExp("^"+_e.call(Ee).replace(he,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Gn=_t?Ve.Buffer:void 0,In=Ve.Symbol,Rt=Ve.Uint8Array,Kn=q.propertyIsEnumerable,gn=de.splice,Ai=In?In.toStringTag:void 0,WI=Object.getOwnPropertySymbols,Ere=Gn?Gn.isBuffer:void 0,Tre=Na(Object.keys,Object),zv=Qs(Ve,"DataView"),mc=Qs(Ve,"Map"),Vv=Qs(Ve,"Promise"),$v=Qs(Ve,"Set"),Wv=Qs(Ve,"WeakMap"),gc=Qs(Object,"create"),_re=bo(zv),Sre=bo(mc),Cre=bo(Vv),Are=bo($v),kre=bo(Wv),YI=In?In.prototype:void 0,Yv=YI?YI.valueOf:void 0;function vo(k){var L=-1,W=k==null?0:k.length;for(this.clear();++L<W;){var le=k[L];this.set(le[0],le[1])}}function Rre(){this.__data__=gc?gc(null):{},this.size=0}function Nre(k){var L=this.has(k)&&delete this.__data__[k];return this.size-=L?1:0,L}function Pre(k){var L=this.__data__;if(gc){var W=L[k];return W===r?void 0:W}return Ee.call(L,k)?L[k]:void 0}function Ire(k){var L=this.__data__;return gc?L[k]!==void 0:Ee.call(L,k)}function Ore(k,L){var W=this.__data__;return this.size+=this.has(k)?0:1,W[k]=gc&&L===void 0?r:L,this}vo.prototype.clear=Rre,vo.prototype.delete=Nre,vo.prototype.get=Pre,vo.prototype.has=Ire,vo.prototype.set=Ore;function ki(k){var L=-1,W=k==null?0:k.length;for(this.clear();++L<W;){var le=k[L];this.set(le[0],le[1])}}function Dre(){this.__data__=[],this.size=0}function Lre(k){var L=this.__data__,W=sh(L,k);if(W<0)return!1;var le=L.length-1;return W==le?L.pop():gn.call(L,W,1),--this.size,!0}function Mre(k){var L=this.__data__,W=sh(L,k);return W<0?void 0:L[W][1]}function Fre(k){return sh(this.__data__,k)>-1}function Bre(k,L){var W=this.__data__,le=sh(W,k);return le<0?(++this.size,W.push([k,L])):W[le][1]=L,this}ki.prototype.clear=Dre,ki.prototype.delete=Lre,ki.prototype.get=Mre,ki.prototype.has=Fre,ki.prototype.set=Bre;function wo(k){var L=-1,W=k==null?0:k.length;for(this.clear();++L<W;){var le=k[L];this.set(le[0],le[1])}}function jre(){this.size=0,this.__data__={hash:new vo,map:new(mc||ki),string:new vo}}function Ure(k){var L=uh(this,k).delete(k);return this.size-=L?1:0,L}function Hre(k){return uh(this,k).get(k)}function zre(k){return uh(this,k).has(k)}function Vre(k,L){var W=uh(this,k),le=W.size;return W.set(k,L),this.size+=W.size==le?0:1,this}wo.prototype.clear=jre,wo.prototype.delete=Ure,wo.prototype.get=Hre,wo.prototype.has=zre,wo.prototype.set=Vre;function oh(k){var L=-1,W=k==null?0:k.length;for(this.__data__=new wo;++L<W;)this.add(k[L])}function $re(k){return this.__data__.set(k,r),this}function Wre(k){return this.__data__.has(k)}oh.prototype.add=oh.prototype.push=$re,oh.prototype.has=Wre;function Pa(k){var L=this.__data__=new ki(k);this.size=L.size}function Yre(){this.__data__=new ki,this.size=0}function qre(k){var L=this.__data__,W=L.delete(k);return this.size=L.size,W}function Gre(k){return this.__data__.get(k)}function Kre(k){return this.__data__.has(k)}function Xre(k,L){var W=this.__data__;if(W instanceof ki){var le=W.__data__;if(!mc||le.length<n-1)return le.push([k,L]),this.size=++W.size,this;W=this.__data__=new wo(le)}return W.set(k,L),this.size=W.size,this}Pa.prototype.clear=Yre,Pa.prototype.delete=qre,Pa.prototype.get=Gre,Pa.prototype.has=Kre,Pa.prototype.set=Xre;function Qre(k,L){var W=lh(k),le=!W&&fie(k),at=!W&&!le&&qv(k),Re=!W&&!le&&!at&&tO(k),bt=W||le||at||Re,jt=bt?Ke(k.length,String):[],Yt=jt.length;for(var gt in k)Ee.call(k,gt)&&!(bt&&(gt=="length"||at&&(gt=="offset"||gt=="parent")||Re&&(gt=="buffer"||gt=="byteLength"||gt=="byteOffset")||sie(gt,Yt)))&&jt.push(gt);return jt}function sh(k,L){for(var W=k.length;W--;)if(QI(k[W][0],L))return W;return-1}function Zre(k,L,W){var le=L(k);return lh(k)?le:vt(le,W(k))}function yc(k){return k==null?k===void 0?V:y:Ai&&Ai in Object(k)?aie(k):die(k)}function qI(k){return vc(k)&&yc(k)==s}function GI(k,L,W,le,at){return k===L?!0:k==null||L==null||!vc(k)&&!vc(L)?k!==k&&L!==L:Jre(k,L,W,le,GI,at)}function Jre(k,L,W,le,at,Re){var bt=lh(k),jt=lh(L),Yt=bt?u:Ia(k),gt=jt?u:Ia(L);Yt=Yt==s?w:Yt,gt=gt==s?w:gt;var Xn=Yt==w,Ir=gt==w,sn=Yt==gt;if(sn&&qv(k)){if(!qv(L))return!1;bt=!0,Xn=!1}if(sn&&!Xn)return Re||(Re=new Pa),bt||tO(k)?KI(k,L,W,le,at,Re):rie(k,L,Yt,W,le,at,Re);if(!(W&i)){var fr=Xn&&Ee.call(k,"__wrapped__"),pr=Ir&&Ee.call(L,"__wrapped__");if(fr||pr){var Oa=fr?k.value():k,Ri=pr?L.value():L;return Re||(Re=new Pa),at(Oa,Ri,W,le,Re)}}return sn?(Re||(Re=new Pa),iie(k,L,W,le,at,Re)):!1}function eie(k){if(!eO(k)||lie(k))return!1;var L=ZI(k)?mn:O;return L.test(bo(k))}function tie(k){return vc(k)&&JI(k.length)&&!!ge[yc(k)]}function nie(k){if(!cie(k))return Tre(k);var L=[];for(var W in Object(k))Ee.call(k,W)&&W!="constructor"&&L.push(W);return L}function KI(k,L,W,le,at,Re){var bt=W&i,jt=k.length,Yt=L.length;if(jt!=Yt&&!(bt&&Yt>jt))return!1;var gt=Re.get(k);if(gt&&Re.get(L))return gt==L;var Xn=-1,Ir=!0,sn=W&a?new oh:void 0;for(Re.set(k,L),Re.set(L,k);++Xn<jt;){var fr=k[Xn],pr=L[Xn];if(le)var Oa=bt?le(pr,fr,Xn,L,k,Re):le(fr,pr,Xn,k,L,Re);if(Oa!==void 0){if(Oa)continue;Ir=!1;break}if(sn){if(!wt(L,function(Ri,xo){if(!It(sn,xo)&&(fr===Ri||at(fr,Ri,W,le,Re)))return sn.push(xo)})){Ir=!1;break}}else if(!(fr===pr||at(fr,pr,W,le,Re))){Ir=!1;break}}return Re.delete(k),Re.delete(L),Ir}function rie(k,L,W,le,at,Re,bt){switch(W){case H:if(k.byteLength!=L.byteLength||k.byteOffset!=L.byteOffset)return!1;k=k.buffer,L=L.buffer;case $:return!(k.byteLength!=L.byteLength||!Re(new Rt(k),new Rt(L)));case c:case d:case x:return QI(+k,+L);case f:return k.name==L.name&&k.message==L.message;case S:case N:return k==L+"";case g:var jt=Ra;case _:var Yt=le&i;if(jt||(jt=te),k.size!=L.size&&!Yt)return!1;var gt=bt.get(k);if(gt)return gt==L;le|=a,bt.set(k,L);var Xn=KI(jt(k),jt(L),le,at,Re,bt);return bt.delete(k),Xn;case D:if(Yv)return Yv.call(k)==Yv.call(L)}return!1}function iie(k,L,W,le,at,Re){var bt=W&i,jt=XI(k),Yt=jt.length,gt=XI(L),Xn=gt.length;if(Yt!=Xn&&!bt)return!1;for(var Ir=Yt;Ir--;){var sn=jt[Ir];if(!(bt?sn in L:Ee.call(L,sn)))return!1}var fr=Re.get(k);if(fr&&Re.get(L))return fr==L;var pr=!0;Re.set(k,L),Re.set(L,k);for(var Oa=bt;++Ir<Yt;){sn=jt[Ir];var Ri=k[sn],xo=L[sn];if(le)var nO=bt?le(xo,Ri,sn,L,k,Re):le(Ri,xo,sn,k,L,Re);if(!(nO===void 0?Ri===xo||at(Ri,xo,W,le,Re):nO)){pr=!1;break}Oa||(Oa=sn=="constructor")}if(pr&&!Oa){var ch=k.constructor,dh=L.constructor;ch!=dh&&"constructor"in k&&"constructor"in L&&!(typeof ch=="function"&&ch instanceof ch&&typeof dh=="function"&&dh instanceof dh)&&(pr=!1)}return Re.delete(k),Re.delete(L),pr}function XI(k){return Zre(k,mie,oie)}function uh(k,L){var W=k.__data__;return uie(L)?W[typeof L=="string"?"string":"hash"]:W.map}function Qs(k,L){var W=ka(k,L);return eie(W)?W:void 0}function aie(k){var L=Ee.call(k,Ai),W=k[Ai];try{k[Ai]=void 0;var le=!0}catch{}var at=Pn.call(k);return le&&(L?k[Ai]=W:delete k[Ai]),at}var oie=WI?function(k){return k==null?[]:(k=Object(k),He(WI(k),function(L){return Kn.call(k,L)}))}:gie,Ia=yc;(zv&&Ia(new zv(new ArrayBuffer(1)))!=H||mc&&Ia(new mc)!=g||Vv&&Ia(Vv.resolve())!=b||$v&&Ia(new $v)!=_||Wv&&Ia(new Wv)!=P)&&(Ia=function(k){var L=yc(k),W=L==w?k.constructor:void 0,le=W?bo(W):"";if(le)switch(le){case _re:return H;case Sre:return g;case Cre:return b;case Are:return _;case kre:return P}return L});function sie(k,L){return L=L??o,!!L&&(typeof k=="number"||Pe.test(k))&&k>-1&&k%1==0&&k<L}function uie(k){var L=typeof k;return L=="string"||L=="number"||L=="symbol"||L=="boolean"?k!=="__proto__":k===null}function lie(k){return!!Bt&&Bt in k}function cie(k){var L=k&&k.constructor,W=typeof L=="function"&&L.prototype||q;return k===W}function die(k){return Pn.call(k)}function bo(k){if(k!=null){try{return _e.call(k)}catch{}try{return k+""}catch{}}return""}function QI(k,L){return k===L||k!==k&&L!==L}var fie=qI(function(){return arguments}())?qI:function(k){return vc(k)&&Ee.call(k,"callee")&&!Kn.call(k,"callee")},lh=Array.isArray;function pie(k){return k!=null&&JI(k.length)&&!ZI(k)}var qv=Ere||yie;function hie(k,L){return GI(k,L)}function ZI(k){if(!eO(k))return!1;var L=yc(k);return L==p||L==m||L==l||L==T}function JI(k){return typeof k=="number"&&k>-1&&k%1==0&&k<=o}function eO(k){var L=typeof k;return k!=null&&(L=="object"||L=="function")}function vc(k){return k!=null&&typeof k=="object"}var tO=Ye?Me(Ye):tie;function mie(k){return pie(k)?Qre(k):nie(k)}function gie(){return[]}function yie(){return!1}e.exports=hie}(Rf,Rf.exports);var j7=Rf.exports;const U7=St(j7);class ms{constructor(t){ie(this,"subscribers",new Set);Gv(this,Jr);ie(this,"initialState");Gv(this,Xs);ie(this,"lifecycleListeners",new Map);ie(this,"emitLifecycle",(t,n)=>{const r=this.lifecycleListeners.get(t);if(r){const i={type:t,timestamp:Date.now(),data:n};r.forEach(a=>{try{a(i)}catch{}})}});ie(this,"notifySubscribers",t=>{Array.from(this.subscribers).forEach(r=>{try{r(t)}catch(i){this.emitLifecycle("error",{error:i})}})});ie(this,"subscribe",t=>(this.subscribers.add(t),()=>{this.subscribers.delete(t)}));ie(this,"onLifecycle",(t,n)=>{this.lifecycleListeners.has(t)||this.lifecycleListeners.set(t,new Set);const r=this.lifecycleListeners.get(t);return r.add(n),()=>{r.delete(n),r.size===0&&this.lifecycleListeners.delete(t)}});ie(this,"get",()=>Eo(this,Jr));ie(this,"set",t=>{this.emitLifecycle("beforeUpdate",{previousState:Eo(this,Jr),nextState:t}),U7(Eo(this,Jr),t)||(wc(this,Jr,t),wc(this,Xs,Date.now()),this.emitLifecycle("stateChange",{state:t}),this.notifySubscribers(t)),this.emitLifecycle("afterUpdate",{state:t})});ie(this,"setPartial",t=>{if(t==null)return;const n={...Eo(this,Jr),...t};this.set(n)});ie(this,"clear",()=>{this.emitLifecycle("destroy"),this.subscribers=new Set,this.lifecycleListeners=new Map});ie(this,"reset",()=>{this.set(this.initialState)});ie(this,"lastUpdated",()=>Eo(this,Xs));wc(this,Jr,t),this.initialState=t,wc(this,Xs,Date.now()),this.emitLifecycle("init",{initialState:Eo(this,Jr)})}}Jr=new WeakMap,Xs=new WeakMap;class H7{constructor({config:t,api:n}){ie(this,"config");ie(this,"api");ie(this,"state");ie(this,"shouldCollectData",()=>{var n;return!!(!((n=this.state.get().contact)!=null&&n.token)&&this.config.collectUserData)});ie(this,"autoCreateUnverifiedUser",async()=>{var t,n,r,i;await this.createUnverifiedContact({name:((n=(t=this.config.user)==null?void 0:t.data)==null?void 0:n.name)||"Anonymous",email:(i=(r=this.config.user)==null?void 0:r.data)==null?void 0:i.email})});ie(this,"createUnverifiedContact",async t=>{try{this.state.setPartial({isCreatingUnverifiedContact:!0,isErrorCreatingUnverifiedContact:!1});const{data:n}=await this.api.createUnverifiedContact(t);n!=null&&n.token?(this.api.setAuthToken(n.token),this.state.setPartial({contact:{token:n.token}})):this.state.setPartial({isErrorCreatingUnverifiedContact:!0})}finally{this.state.setPartial({isCreatingUnverifiedContact:!1})}});var r,i,a;this.config=t,this.api=n,this.state=new ms({contact:(r=t.user)!=null&&r.token?{token:(i=t.user)==null?void 0:i.token}:null,isCreatingUnverifiedContact:!1,isErrorCreatingUnverifiedContact:!1}),!((a=t.user)!=null&&a.token)&&!t.collectUserData&&this.autoCreateUnverifiedUser()}}class gC{constructor(){ie(this,"state",new ms({isPolling:!1,isError:!1}));ie(this,"abortController",new AbortController);ie(this,"reset",()=>{var t;this.abortController.abort("Resetting poller"),(t=this.stopPolling)==null||t.call(this),this.stopPolling=null});ie(this,"stopPolling",null);ie(this,"startPolling",(t,n)=>{if(this.stopPolling)return;const r=[],i=async()=>{this.abortController=new AbortController,this.state.setPartial({isPolling:!0});try{await t(this.abortController.signal)}catch(a){if(this.abortController.signal.aborted)return;console.error("Failed to poll:",a),this.state.setPartial({isError:!0})}finally{this.state.setPartial({isPolling:!1})}this.abortController.signal.aborted?console.log("Poller aborted, not scheduling anymore"):r.push(setTimeout(i,n))};i(),this.stopPolling=()=>{r.forEach(clearTimeout),this.state.reset()}})}}const $t=[];for(let e=0;e<256;++e)$t.push((e+256).toString(16).slice(1));function z7(e,t=0){return($t[e[t+0]]+$t[e[t+1]]+$t[e[t+2]]+$t[e[t+3]]+"-"+$t[e[t+4]]+$t[e[t+5]]+"-"+$t[e[t+6]]+$t[e[t+7]]+"-"+$t[e[t+8]]+$t[e[t+9]]+"-"+$t[e[t+10]]+$t[e[t+11]]+$t[e[t+12]]+$t[e[t+13]]+$t[e[t+14]]+$t[e[t+15]]).toLowerCase()}let dy;const V7=new Uint8Array(16);function $7(){if(!dy){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");dy=crypto.getRandomValues.bind(crypto)}return dy(V7)}const yC={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function vC(e,t,n){var i;if(yC.randomUUID&&!t&&!e)return yC.randomUUID();e=e||{};const r=e.random??((i=e.rng)==null?void 0:i.call(e))??$7();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,z7(r)}function Nf(){return vC()}class W7{constructor({config:t,api:n,contactCtx:r}){ie(this,"config");ie(this,"api");ie(this,"contactCtx");ie(this,"poller",new gC);ie(this,"sessionState",new ms({session:null,isCreatingSession:!1}));ie(this,"sessionsState",new ms({data:[],cursor:void 0,isLastPage:!1,didStartInitialFetch:!1,isInitialFetchLoading:!0}));ie(this,"reset",async()=>{this.sessionState.reset(),this.poller.reset()});ie(this,"registerPolling",()=>{this.sessionState.subscribe(({session:t})=>{t!=null&&t.id?this.poller.startPolling(async n=>{const{data:r}=await this.api.getSession({sessionId:t.id,abortSignal:n});r&&this.sessionState.setPartial({session:r})},1e3):this.poller.reset()})});ie(this,"registerInitialSessionsFetch",()=>{this.contactCtx.state.subscribe(async({contact:t})=>{t!=null&&t.token&&!this.sessionsState.get().didStartInitialFetch&&(this.sessionsState.setPartial({didStartInitialFetch:!0}),await this.loadMoreSessions(),this.sessionsState.setPartial({isInitialFetchLoading:!1}))})});ie(this,"createSession",async()=>{var r,i;this.sessionState.setPartial({session:null,isCreatingSession:!0});const{data:t,error:n}=await this.api.createSession({customData:(r=this.config.user)!=null&&r.externalId?{external_id:(i=this.config.user)==null?void 0:i.externalId}:void 0});return t?(this.sessionState.setPartial({session:t,isCreatingSession:!1}),t):(console.error("Failed to create session:",n),null)});ie(this,"loadMoreSessions",async()=>{var n,r;if(this.sessionsState.get().isLastPage||!((n=this.contactCtx.state.get().contact)!=null&&n.token))return;const{data:t}=await this.api.getSessions({cursor:this.sessionsState.get().cursor,filters:(r=this.config.user)!=null&&r.externalId?{external_id:this.config.user.externalId}:{}});if(t){const a=[...this.sessionsState.get().data,...t.items].filter((o,s,u)=>s===u.findIndex(l=>o.id===l.id));this.sessionsState.setPartial({data:a,cursor:t.next||void 0,isLastPage:t.next===null})}});this.config=t,this.api=n,this.contactCtx=r,this.registerPolling(),this.registerInitialSessionsFetch()}}class gs{constructor({config:t,api:n,sessionCtx:r}){ie(this,"config");ie(this,"api");ie(this,"sessionCtx");ie(this,"poller",new gC);ie(this,"state",new ms({messages:[],isSendingMessage:!1,suggestedReplies:null,isInitialFetchLoading:!1}));ie(this,"sendMessageAbortController",new AbortController);ie(this,"reset",()=>{this.sendMessageAbortController.abort("Resetting chat"),this.state.reset(),this.poller.reset()});ie(this,"registerPolling",()=>{this.sessionCtx.sessionState.subscribe(({session:t})=>{t!=null&&t.id?this.poller.startPolling(async n=>{await this.fetchAndSetHistory(t.id,n)},1e3):this.poller.reset()})});ie(this,"sendMessage",async t=>{var i,a,o,s,u,l,c;this.sendMessageAbortController=new AbortController;const n=this.state.get().isSendingMessage,r=((i=this.sessionCtx.sessionState.get().session)==null?void 0:i.assignee.kind)==="ai";if(n&&r){console.warn("Cannot send messages while awaiting AI response");return}this.state.setPartial({suggestedReplies:null});try{this.state.setPartial({isSendingMessage:!0});const d=gs.toUserMessage(t.content,t.attachments||void 0),f=this.state.get().messages;if(this.state.setPartial({messages:[...f,d]}),!((a=this.sessionCtx.sessionState.get().session)!=null&&a.id)&&!await this.sessionCtx.createSession()){console.error("Failed to create session");return}const p=(o=this.sessionCtx.sessionState.get().session)==null?void 0:o.id;if(!p)return;const{data:m}=await this.api.sendMessage({uuid:d.id,bot_token:this.config.token,headers:this.config.headers,query_params:this.config.queryParams,session_id:p,user:(s=this.config.user)==null?void 0:s.data,...t},this.sendMessageAbortController.signal);if(m!=null&&m.success){const g=gs.toBotMessage(m);if(g){const x=this.state.get().messages;if(!!x.some(w=>w.id===g.id))return;this.state.setPartial({messages:[...x,g]})}else(u=m.options)!=null&&u.value&&((l=m.options)==null?void 0:l.value.length)>0&&this.state.setPartial({suggestedReplies:m.options.value})}else{const g=gs.toErrorMessage(((c=m==null?void 0:m.error)==null?void 0:c.message)||"Unknown error occurred"),x=this.state.get().messages;this.state.setPartial({messages:[...x,g]})}}catch(d){this.sendMessageAbortController.signal.aborted||console.error("Failed to send message:",d)}finally{this.state.setPartial({isSendingMessage:!1})}});ie(this,"fetchAndSetHistory",async(t,n)=>{var a;this.state.get().messages.length===0&&this.state.setPartial({isInitialFetchLoading:!0});const r=(a=this.state.get().messages.at(-1))==null?void 0:a.timestamp,{data:i}=await this.api.getSessionHistory({sessionId:t,lastMessageTimestamp:r,abortSignal:n});if(i&&i.length>0){const o=this.state.get().messages,s=i.map(gs.mapHistoryToMessage).filter(u=>!o.some(l=>l.id===u.id));this.state.setPartial({messages:[...o,...s]})}this.state.get().isInitialFetchLoading&&this.state.setPartial({isInitialFetchLoading:!1})});this.config=t,this.api=n,this.sessionCtx=r,this.registerPolling()}static mapHistoryToMessage(t){const n={id:t.publicId,timestamp:t.sentAt||"",attachments:t.attachments||void 0};return t.sender.kind==="user"?{...n,type:"FROM_USER",content:t.content.text||"",deliveredAt:t.sentAt||""}:t.sender.kind==="agent"?{...n,type:"FROM_AGENT",component:"agent_message",data:{message:t.content.text||""}}:{...n,type:"FROM_BOT",component:"bot_message",agent:{id:null,name:t.sender.name||"",isAi:t.sender.kind==="ai",avatar:t.sender.avatar||null},data:{message:t.content.text}}}static toUserMessage(t,n){return{id:Nf(),type:"FROM_USER",content:t,deliveredAt:new Date().toISOString(),attachments:n,timestamp:new Date().toISOString()}}static toBotMessage(t){if(t.success&&t.autopilotResponse)return{type:"FROM_BOT",id:t.autopilotResponse.id||Nf(),timestamp:new Date().toISOString(),component:"bot_message",data:{message:t.autopilotResponse.value.content}};if(t.success&&t.uiResponse){const n=t.uiResponse.value;return{type:"FROM_BOT",id:Nf(),timestamp:new Date().toISOString(),component:n.name,data:n.request_response}}return null}static toErrorMessage(t){return{type:"FROM_BOT",id:Nf(),timestamp:new Date().toISOString(),component:"TEXT",data:{message:t,variant:"error"}}}}class Y7{constructor({contactCtx:t,sessionCtx:n,resetChat:r}){ie(this,"state");ie(this,"contactCtx");ie(this,"sessionCtx");ie(this,"resetChat");ie(this,"registerRoutingListener",()=>{this.contactCtx.state.subscribe(({contact:t})=>{t!=null&&t.token&&this.state.get().screen==="welcome"&&this.state.setPartial({screen:"sessions"})})});ie(this,"toSessionsScreen",()=>{this.resetChat(),this.state.setPartial({screen:"sessions"})});ie(this,"toChatScreen",t=>{if(this.resetChat(),t){const n=this.sessionCtx.sessionsState.get().data.find(r=>r.id===t);if(!n)return;this.sessionCtx.sessionState.setPartial({session:n})}this.state.setPartial({screen:"chat"})});this.state=new ms({screen:t.shouldCollectData()?"welcome":"sessions"}),this.contactCtx=t,this.sessionCtx=n,this.resetChat=r,this.registerRoutingListener()}}class q7{constructor({config:t}){ie(this,"config");ie(this,"api");ie(this,"contactCtx");ie(this,"sessionCtx");ie(this,"messageCtx");ie(this,"routerCtx");ie(this,"resetChat",()=>{this.sessionCtx.reset(),this.messageCtx.reset()});this.config=t,this.api=new B7({config:t}),this.contactCtx=new H7({api:this.api,config:this.config}),this.sessionCtx=new W7({config:this.config,api:this.api,contactCtx:this.contactCtx}),this.messageCtx=new gs({config:this.config,api:this.api,sessionCtx:this.sessionCtx}),this.routerCtx=new Y7({contactCtx:this.contactCtx,sessionCtx:this.sessionCtx,resetChat:this.resetChat})}}const[zn,G7]=iB();function K7({options:e,children:t,components:n}){const r=v.useRef(new q7({config:e})).current,i=v.useMemo(()=>new rB({components:n}),[n]);return E.jsx(G7,{value:{widgetCtx:r,components:n,componentStore:i,version:yE},children:t})}function dl(){const{widgetCtx:e}=zn();return e.config}function fl(e){return v.useSyncExternalStore(e.subscribe,e.get,e.get)}function X7(){const{widgetCtx:e}=zn();return{contactState:fl(e.contactCtx.state),createUnverifiedContact:e.contactCtx.createUnverifiedContact}}function pl(){const{widgetCtx:e}=zn();return{messagesState:fl(e.messageCtx.state),sendMessage:e.messageCtx.sendMessage}}function ys(){const{widgetCtx:e}=zn(),t=fl(e.sessionCtx.sessionState),n=fl(e.sessionCtx.sessionsState);return{sessionState:t,sessionsState:n,loadMoreSessions:e.sessionCtx.loadMoreSessions}}function wC(){var r;const{sessionState:e}=ys(),{messagesState:t}=pl();return{isAwaitingBotReply:(!((r=e.session)!=null&&r.isHandedOff)||e.session.assignee.kind==="ai"||e.isCreatingSession)&&t.isSendingMessage}}var bC={exports:{}},xC={};/**
334
334
  * @license React
335
335
  * use-sync-external-store-shim.production.min.js
336
336
  *
@@ -338,7 +338,7 @@ to {
338
338
  *
339
339
  * This source code is licensed under the MIT license found in the
340
340
  * LICENSE file in the root directory of this source tree.
341
- */var vs=v;function Q7(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Z7=typeof Object.is=="function"?Object.is:Q7,J7=vs.useState,ej=vs.useEffect,tj=vs.useLayoutEffect,nj=vs.useDebugValue;function rj(e,t){var n=t(),r=J7({inst:{value:n,getSnapshot:t}}),i=r[0].inst,a=r[1];return tj(function(){i.value=n,i.getSnapshot=t,fy(i)&&a({inst:i})},[e,n,t]),ej(function(){return fy(i)&&a({inst:i}),e(function(){fy(i)&&a({inst:i})})},[e]),nj(n),n}function fy(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Z7(e,n)}catch{return!0}}function ij(e,t){return t()}var aj=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?ij:rj;xC.useSyncExternalStore=vs.useSyncExternalStore!==void 0?vs.useSyncExternalStore:aj,bC.exports=xC;var oj=bC.exports;const oa=()=>{},_n=oa(),py=Object,ze=e=>e===_n,zr=e=>typeof e=="function",sa=(e,t)=>({...e,...t}),sj=e=>zr(e.then),Pf=new WeakMap;let uj=0;const hl=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let i,a;if(py(e)===e&&!r&&n!=RegExp){if(i=Pf.get(e),i)return i;if(i=++uj+"~",Pf.set(e,i),n==Array){for(i="@",a=0;a<e.length;a++)i+=hl(e[a])+",";Pf.set(e,i)}if(n==py){i="#";const o=py.keys(e).sort();for(;!ze(a=o.pop());)ze(e[a])||(i+=a+":"+hl(e[a])+",");Pf.set(e,i)}}else i=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return i},bi=new WeakMap,hy={},If={},my="undefined",Of=typeof window!=my,gy=typeof document!=my,lj=()=>Of&&typeof window.requestAnimationFrame!=my,EC=(e,t)=>{const n=bi.get(e);return[()=>!ze(t)&&e.get(t)||hy,r=>{if(!ze(t)){const i=e.get(t);t in If||(If[t]=i),n[5](t,sa(i,r),i||hy)}},n[6],()=>!ze(t)&&t in If?If[t]:!ze(t)&&e.get(t)||hy]};let yy=!0;const cj=()=>yy,[vy,wy]=Of&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[oa,oa],dj=()=>{const e=gy&&document.visibilityState;return ze(e)||e!=="hidden"},fj=e=>(gy&&document.addEventListener("visibilitychange",e),vy("focus",e),()=>{gy&&document.removeEventListener("visibilitychange",e),wy("focus",e)}),pj=e=>{const t=()=>{yy=!0,e()},n=()=>{yy=!1};return vy("online",t),vy("offline",n),()=>{wy("online",t),wy("offline",n)}},hj={isOnline:cj,isVisible:dj},mj={initFocus:fj,initReconnect:pj},TC=!yn.useId,ml=!Of||"Deno"in window,gj=e=>lj()?window.requestAnimationFrame(e):setTimeout(e,1),by=ml?v.useEffect:v.useLayoutEffect,xy=typeof navigator<"u"&&navigator.connection,_C=!ml&&xy&&(["slow-2g","2g"].includes(xy.effectiveType)||xy.saveData),Ey=e=>{if(zr(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?hl(e):"",[e,t]};let yj=0;const Ty=()=>++yj,SC=0,CC=1,AC=2;var gl={__proto__:null,ERROR_REVALIDATE_EVENT:3,FOCUS_EVENT:SC,MUTATE_EVENT:AC,RECONNECT_EVENT:CC};async function kC(...e){const[t,n,r,i]=e,a=sa({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let o=a.populateCache;const s=a.rollbackOnError;let u=a.optimisticData;const l=f=>typeof s=="function"?s(f):s!==!1,c=a.throwOnError;if(zr(n)){const f=n,p=[],m=t.keys();for(const g of m)!/^\$(inf|sub)\$/.test(g)&&f(t.get(g)._k)&&p.push(g);return Promise.all(p.map(d))}return d(n);async function d(f){const[p]=Ey(f);if(!p)return;const[m,g]=EC(t,p),[x,y,w,b]=bi.get(t),T=()=>{const X=x[p];return(zr(a.revalidate)?a.revalidate(m().data,f):a.revalidate!==!1)&&(delete w[p],delete b[p],X&&X[0])?X[0](AC).then(()=>m().data):m().data};if(e.length<3)return T();let S=r,_;const N=Ty();y[p]=[N,0];const D=!ze(u),V=m(),P=V.data,$=V._c,H=ze($)?P:$;if(D&&(u=zr(u)?u(H,P):u,g({data:u,_c:H})),zr(S))try{S=S(H)}catch(X){_=X}if(S&&sj(S))if(S=await S.catch(X=>{_=X}),N!==y[p][0]){if(_)throw _;return S}else _&&D&&l(_)&&(o=!0,g({data:H,_c:_n}));if(o&&!_)if(zr(o)){const X=o(S,H);g({data:X,error:_n,_c:_n})}else g({data:S,error:_n,_c:_n});if(y[p][1]=Ty(),Promise.resolve(T()).then(()=>{g({_c:_n})}),_){if(c)throw _;return}return S}}const RC=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},vj=(e,t)=>{if(!bi.has(e)){const n=sa(mj,t),r={},i=kC.bind(_n,e);let a=oa;const o={},s=(c,d)=>{const f=o[c]||[];return o[c]=f,f.push(d),()=>f.splice(f.indexOf(d),1)},u=(c,d,f)=>{e.set(c,d);const p=o[c];if(p)for(const m of p)m(d,f)},l=()=>{if(!bi.has(e)&&(bi.set(e,[r,{},{},{},i,u,s]),!ml)){const c=n.initFocus(setTimeout.bind(_n,RC.bind(_n,r,SC))),d=n.initReconnect(setTimeout.bind(_n,RC.bind(_n,r,CC)));a=()=>{c&&c(),d&&d(),bi.delete(e)}}};return l(),[e,i,l,a]}return[e,bi.get(e)[4]]},wj=(e,t,n,r,i)=>{const a=n.errorRetryCount,o=i.retryCount,s=~~((Math.random()+.5)*(1<<(o<8?o:8)))*n.errorRetryInterval;!ze(a)&&o>a||setTimeout(r,s,i)},bj=(e,t)=>hl(e)==hl(t),[NC,xj]=vj(new Map),Ej=sa({onLoadingSlow:oa,onSuccess:oa,onError:oa,onErrorRetry:wj,onDiscarded:oa,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:_C?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:_C?5e3:3e3,compare:bj,isPaused:()=>!1,cache:NC,mutate:xj,fallback:{}},hj),Tj=(e,t)=>{const n=sa(e,t);if(t){const{use:r,fallback:i}=e,{use:a,fallback:o}=t;r&&a&&(n.use=r.concat(a)),i&&o&&(n.fallback=sa(i,o))}return n},_j=v.createContext({}),Sj="$inf$",PC=Of&&window.__SWR_DEVTOOLS_USE__,Cj=PC?window.__SWR_DEVTOOLS_USE__:[],Aj=()=>{PC&&(window.__SWR_DEVTOOLS_REACT__=yn)},kj=e=>zr(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],Rj=()=>sa(Ej,v.useContext(_j)),Nj=e=>(t,n,r)=>e(t,n&&((...a)=>{const[o]=Ey(t),[,,,s]=bi.get(NC);if(o.startsWith(Sj))return n(...a);const u=s[o];return ze(u)?n(...a):(delete s[o],u)}),r),Pj=Cj.concat(Nj),Ij=e=>function(...n){const r=Rj(),[i,a,o]=kj(n),s=Tj(r,o);let u=e;const{use:l}=s,c=(l||[]).concat(Pj);for(let d=c.length;d--;)u=c[d](u);return u(i,a||s.fetcher||null,s)},Oj=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const i=r.indexOf(n);i>=0&&(r[i]=r[r.length-1],r.pop())}};Aj();const IC=yn.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)}),_y={dedupe:!0},Dj=Ij((e,t,n)=>{const{cache:r,compare:i,suspense:a,fallbackData:o,revalidateOnMount:s,revalidateIfStale:u,refreshInterval:l,refreshWhenHidden:c,refreshWhenOffline:d,keepPreviousData:f}=n,[p,m,g,x]=bi.get(r),[y,w]=Ey(e),b=v.useRef(!1),T=v.useRef(!1),S=v.useRef(y),_=v.useRef(t),N=v.useRef(n),D=()=>N.current,V=()=>D().isVisible()&&D().isOnline(),[P,$,H,X]=EC(r,y),Y=v.useRef({}).current,ne=ze(o)?n.fallback[y]:o,re=(Te,xe)=>{for(const Ye in Y){const He=Ye;if(He==="data"){if(!i(Te[He],xe[He])&&(!ze(Te[He])||!i(ge,xe[He])))return!1}else if(xe[He]!==Te[He])return!1}return!0},ee=v.useMemo(()=>{const Te=!y||!t?!1:ze(s)?D().isPaused()||a?!1:ze(u)?!0:u:s,xe=Me=>{const It=sa(Me);return delete It._k,Te?{isValidating:!0,isLoading:!0,...It}:It},Ye=P(),He=X(),vt=xe(Ye),wt=Ye===He?vt:xe(He);let Ke=vt;return[()=>{const Me=xe(P());return re(Me,Ke)?(Ke.data=Me.data,Ke.isLoading=Me.isLoading,Ke.isValidating=Me.isValidating,Ke.error=Me.error,Ke):(Ke=Me,Me)},()=>wt]},[r,y]),F=oj.useSyncExternalStore(v.useCallback(Te=>H(y,(xe,Ye)=>{re(Ye,xe)||Te()}),[r,y]),ee[0],ee[1]),B=!b.current,A=p[y]&&p[y].length>0,ae=F.data,he=ze(ae)?ne:ae,O=F.error,Pe=v.useRef(he),ge=f?ze(ae)?Pe.current:ae:he,we=A&&!ze(O)?!1:B&&!ze(s)?s:D().isPaused()?!1:a?ze(he)?!1:u:ze(he)||u,$e=!!(y&&t&&B&&we),Ve=ze(F.isValidating)?$e:F.isValidating,We=ze(F.isLoading)?$e:F.isLoading,Ge=v.useCallback(async Te=>{const xe=_.current;if(!y||!xe||T.current||D().isPaused())return!1;let Ye,He,vt=!0;const wt=Te||{},Ke=!g[y]||!wt.dedupe,Me=()=>TC?!T.current&&y===S.current&&b.current:y===S.current,It={isValidating:!1,isLoading:!1},ka=()=>{$(It)},Ra=()=>{const te=g[y];te&&te[1]===He&&delete g[y]},Na={isValidating:!0};ze(P().data)&&(Na.isLoading=!0);try{if(Ke&&($(Na),n.loadingTimeout&&ze(P().data)&&setTimeout(()=>{vt&&Me()&&D().onLoadingSlow(y,n)},n.loadingTimeout),g[y]=[xe(w),Ty()]),[Ye,He]=g[y],Ye=await Ye,Ke&&setTimeout(Ra,n.dedupingInterval),!g[y]||g[y][1]!==He)return Ke&&Me()&&D().onDiscarded(y),!1;It.error=_n;const te=m[y];if(!ze(te)&&(He<=te[0]||He<=te[1]||te[1]===0))return ka(),Ke&&Me()&&D().onDiscarded(y),!1;const de=P().data;It.data=i(de,Ye)?de:Ye,Ke&&Me()&&D().onSuccess(Ye,y,n)}catch(te){Ra();const de=D(),{shouldRetryOnError:j}=de;de.isPaused()||(It.error=te,Ke&&Me()&&(de.onError(te,y,de),(j===!0||zr(j)&&j(te))&&(!D().revalidateOnFocus||!D().revalidateOnReconnect||V())&&de.onErrorRetry(te,y,de,q=>{const ce=p[y];ce&&ce[0]&&ce[0](gl.ERROR_REVALIDATE_EVENT,q)},{retryCount:(wt.retryCount||0)+1,dedupe:!0})))}return vt=!1,ka(),!0},[y,r]),_t=v.useCallback((...Te)=>kC(r,S.current,...Te),[]);if(by(()=>{_.current=t,N.current=n,ze(ae)||(Pe.current=ae)}),by(()=>{if(!y)return;const Te=Ge.bind(_n,_y);let xe=0;const He=Oj(y,p,(vt,wt={})=>{if(vt==gl.FOCUS_EVENT){const Ke=Date.now();D().revalidateOnFocus&&Ke>xe&&V()&&(xe=Ke+D().focusThrottleInterval,Te())}else if(vt==gl.RECONNECT_EVENT)D().revalidateOnReconnect&&V()&&Te();else{if(vt==gl.MUTATE_EVENT)return Ge();if(vt==gl.ERROR_REVALIDATE_EVENT)return Ge(wt)}});return T.current=!1,S.current=y,b.current=!0,$({_k:w}),we&&(ze(he)||ml?Te():gj(Te)),()=>{T.current=!0,He()}},[y]),by(()=>{let Te;function xe(){const He=zr(l)?l(P().data):l;He&&Te!==-1&&(Te=setTimeout(Ye,He))}function Ye(){!P().error&&(c||D().isVisible())&&(d||D().isOnline())?Ge(_y).then(xe):xe()}return xe(),()=>{Te&&(clearTimeout(Te),Te=-1)}},[l,c,d,y]),v.useDebugValue(ge),a&&ze(he)&&y){if(!TC&&ml)throw new Error("Fallback data is required when using suspense in SSR.");_.current=t,N.current=n,T.current=!1;const Te=x[y];if(!ze(Te)){const xe=_t(Te);IC(xe)}if(ze(O)){const xe=Ge(_y);ze(ge)||(xe.status="fulfilled",xe.value=!0),IC(xe)}else throw O}return{mutate:_t,get data(){return Y.data=!0,ge},get error(){return Y.error=!0,O},get isValidating(){return Y.isValidating=!0,Ve},get isLoading(){return Y.isLoading=!0,We}}});function Df(){const{widgetCtx:e}=zn();return Dj([e.config.token],e.api.widgetPrelude,{revalidateOnFocus:!1})}var OC={};const Lj=bc(AF);var Lf={},DC;function Mj(){if(DC)return Lf;DC=1,Object.defineProperty(Lf,"__esModule",{value:!0});var e=v;function t(){var n=e.useRef(!1),r=e.useCallback(function(){return n.current},[]);return e.useEffect(function(){return n.current=!0,function(){n.current=!1}},[]),r}return Lf.default=t,Lf}Object.defineProperty(OC,"__esModule",{value:!0});var Sy=Lj,Cy=v,Fj=Sy.__importDefault(Mj());function Bj(e,t,n){t===void 0&&(t=[]),n===void 0&&(n={loading:!1});var r=Cy.useRef(0),i=Fj.default(),a=Cy.useState(n),o=a[0],s=a[1],u=Cy.useCallback(function(){for(var l=[],c=0;c<arguments.length;c++)l[c]=arguments[c];var d=++r.current;return o.loading||s(function(f){return Sy.__assign(Sy.__assign({},f),{loading:!0})}),e.apply(void 0,l).then(function(f){return i()&&d===r.current&&s({value:f,loading:!1}),f},function(f){return i()&&d===r.current&&s({error:f,loading:!1}),f})},t);return[o,u]}var jj=OC.default=Bj;const ua=new Map;function Uj(){const[e,t]=v.useState([]),{widgetCtx:{api:n}}=zn();function r(c){const d=c.map(f=>({file:f,id:vC(),status:"pending",progress:0}));t(f=>[...f,...d]),d.forEach(o)}function i(c,d){t(f=>f.map(p=>p.id===c?{...p,...d}:p))}function a(c){t(d=>d.filter(f=>f.id!==c))}const o=async c=>{const d=new AbortController;ua.set(c.id,d);try{t(p=>p.map(m=>m.id===c.id?{...m,status:"uploading",progress:0}:m));const f=await n.uploadFile(c,{signal:d.signal,onUploadProgress:p=>{if(!p.total)return;const m=Math.round(p.loaded*100/p.total);i(c.id,{progress:m})}});i(c.id,{status:"success",fileUrl:f.fileUrl,progress:100})}catch(f){d.signal.aborted||i(c.id,{status:"error",error:f instanceof Error?f.message:"Upload failed",progress:0})}finally{ua.delete(c.id)}},s=c=>{const d=ua.get(c);d&&(d.abort(),ua.delete(c)),a(c)},u=v.useMemo(()=>e.filter(c=>c.status==="success"&&c.fileUrl),[e]);function l(){ua.forEach(c=>c.abort()),ua.clear(),t([])}return v.useEffect(()=>()=>{ua.forEach(c=>c.abort()),ua.clear()},[]),{allFiles:e,appendFiles:r,handleCancelUpload:s,successFiles:u,emptyTheFiles:l,getFileById:c=>e.find(d=>d.id===c),getUploadProgress:c=>{var d;return((d=e.find(f=>f.id===c))==null?void 0:d.progress)??0},getUploadStatus:c=>{var d;return(d=e.find(f=>f.id===c))==null?void 0:d.status},hasErrors:e.some(c=>c.status==="error"),isUploading:e.some(c=>c.status==="uploading")}}function Sn(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function Hj(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function LC(...e){return t=>e.forEach(n=>Hj(n,t))}function Vr(...e){return v.useCallback(LC(...e),e)}function la(e,t=[]){let n=[];function r(a,o){const s=v.createContext(o),u=n.length;n=[...n,o];const l=d=>{var y;const{scope:f,children:p,...m}=d,g=((y=f==null?void 0:f[e])==null?void 0:y[u])||s,x=v.useMemo(()=>m,Object.values(m));return E.jsx(g.Provider,{value:x,children:p})};l.displayName=a+"Provider";function c(d,f){var g;const p=((g=f==null?void 0:f[e])==null?void 0:g[u])||s,m=v.useContext(p);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${a}\``)}return[l,c]}const i=()=>{const a=n.map(o=>v.createContext(o));return function(s){const u=(s==null?void 0:s[e])||a;return v.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return i.scopeName=e,[r,zj(i,...t)]}function zj(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const o=r.reduce((s,{useScope:u,scopeName:l})=>{const d=u(a)[`__scope${l}`];return{...s,...d}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var Mf=v.forwardRef((e,t)=>{const{children:n,...r}=e,i=v.Children.toArray(n),a=i.find(Vj);if(a){const o=a.props.children,s=i.map(u=>u===a?v.Children.count(o)>1?v.Children.only(null):v.isValidElement(o)?o.props.children:null:u);return E.jsx(Ay,{...r,ref:t,children:v.isValidElement(o)?v.cloneElement(o,void 0,s):null})}return E.jsx(Ay,{...r,ref:t,children:n})});Mf.displayName="Slot";var Ay=v.forwardRef((e,t)=>{const{children:n,...r}=e;if(v.isValidElement(n)){const i=Wj(n);return v.cloneElement(n,{...$j(r,n.props),ref:t?LC(t,i):i})}return v.Children.count(n)>1?v.Children.only(null):null});Ay.displayName="SlotClone";var MC=({children:e})=>E.jsx(E.Fragment,{children:e});function Vj(e){return v.isValidElement(e)&&e.type===MC}function $j(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...s)=>{a(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function Wj(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Yj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Vn=Yj.reduce((e,t)=>{const n=v.forwardRef((r,i)=>{const{asChild:a,...o}=r,s=a?Mf:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),E.jsx(s,{...o,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function qj(e,t){e&&Zo.flushSync(()=>e.dispatchEvent(t))}function Wt(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function FC(e,t=globalThis==null?void 0:globalThis.document){const n=Wt(e);v.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Gj="DismissableLayer",ky="dismissableLayer.update",Kj="dismissableLayer.pointerDownOutside",Xj="dismissableLayer.focusOutside",BC,jC=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ry=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...u}=e,l=v.useContext(jC),[c,d]=v.useState(null),f=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=v.useState({}),m=Vr(t,N=>d(N)),g=Array.from(l.layers),[x]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),y=g.indexOf(x),w=c?g.indexOf(c):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,T=w>=y,S=Jj(N=>{const D=N.target,V=[...l.branches].some(P=>P.contains(D));!T||V||(i==null||i(N),o==null||o(N),N.defaultPrevented||s==null||s())},f),_=eU(N=>{const D=N.target;[...l.branches].some(P=>P.contains(D))||(a==null||a(N),o==null||o(N),N.defaultPrevented||s==null||s())},f);return FC(N=>{w===l.layers.size-1&&(r==null||r(N),!N.defaultPrevented&&s&&(N.preventDefault(),s()))},f),v.useEffect(()=>{if(c)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(BC=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(c)),l.layers.add(c),UC(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=BC)}},[c,f,n,l]),v.useEffect(()=>()=>{c&&(l.layers.delete(c),l.layersWithOutsidePointerEventsDisabled.delete(c),UC())},[c,l]),v.useEffect(()=>{const N=()=>p({});return document.addEventListener(ky,N),()=>document.removeEventListener(ky,N)},[]),E.jsx(Vn.div,{...u,ref:m,style:{pointerEvents:b?T?"auto":"none":void 0,...e.style},onFocusCapture:Sn(e.onFocusCapture,_.onFocusCapture),onBlurCapture:Sn(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:Sn(e.onPointerDownCapture,S.onPointerDownCapture)})});Ry.displayName=Gj;var Qj="DismissableLayerBranch",Zj=v.forwardRef((e,t)=>{const n=v.useContext(jC),r=v.useRef(null),i=Vr(t,r);return v.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),E.jsx(Vn.div,{...e,ref:i})});Zj.displayName=Qj;function Jj(e,t=globalThis==null?void 0:globalThis.document){const n=Wt(e),r=v.useRef(!1),i=v.useRef(()=>{});return v.useEffect(()=>{const a=s=>{if(s.target&&!r.current){let u=function(){HC(Kj,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function eU(e,t=globalThis==null?void 0:globalThis.document){const n=Wt(e),r=v.useRef(!1);return v.useEffect(()=>{const i=a=>{a.target&&!r.current&&HC(Xj,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function UC(){const e=new CustomEvent(ky);document.dispatchEvent(e)}function HC(e,t,n,{discrete:r}){const i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?qj(i,a):i.dispatchEvent(a)}var ar=globalThis!=null&&globalThis.document?v.useLayoutEffect:()=>{},tU=bO.useId||(()=>{}),nU=0;function yl(e){const[t,n]=v.useState(tU());return ar(()=>{e||n(r=>r??String(nU++))},[e]),e||(t?`radix-${t}`:"")}const rU=["top","right","bottom","left"],ca=Math.min,$n=Math.max,Ff=Math.round,Bf=Math.floor,da=e=>({x:e,y:e}),iU={left:"right",right:"left",bottom:"top",top:"bottom"},aU={start:"end",end:"start"};function Ny(e,t,n){return $n(e,ca(t,n))}function xi(e,t){return typeof e=="function"?e(t):e}function Ei(e){return e.split("-")[0]}function ws(e){return e.split("-")[1]}function Py(e){return e==="x"?"y":"x"}function Iy(e){return e==="y"?"height":"width"}function fa(e){return["top","bottom"].includes(Ei(e))?"y":"x"}function Oy(e){return Py(fa(e))}function oU(e,t,n){n===void 0&&(n=!1);const r=ws(e),i=Oy(e),a=Iy(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=jf(o)),[o,jf(o)]}function sU(e){const t=jf(e);return[Dy(e),t,Dy(t)]}function Dy(e){return e.replace(/start|end/g,t=>aU[t])}function uU(e,t,n){const r=["left","right"],i=["right","left"],a=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?a:o;default:return[]}}function lU(e,t,n,r){const i=ws(e);let a=uU(Ei(e),n==="start",r);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(Dy)))),a}function jf(e){return e.replace(/left|right|bottom|top/g,t=>iU[t])}function cU(e){return{top:0,right:0,bottom:0,left:0,...e}}function zC(e){return typeof e!="number"?cU(e):{top:e,right:e,bottom:e,left:e}}function Uf(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function VC(e,t,n){let{reference:r,floating:i}=e;const a=fa(t),o=Oy(t),s=Iy(o),u=Ei(t),l=a==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2;let p;switch(u){case"top":p={x:c,y:r.y-i.height};break;case"bottom":p={x:c,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(ws(t)){case"start":p[o]-=f*(n&&l?-1:1);break;case"end":p[o]+=f*(n&&l?-1:1);break}return p}const dU=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,s=a.filter(Boolean),u=await(o.isRTL==null?void 0:o.isRTL(t));let l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=VC(l,r,u),f=r,p={},m=0;for(let g=0;g<s.length;g++){const{name:x,fn:y}=s[g],{x:w,y:b,data:T,reset:S}=await y({x:c,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:o,elements:{reference:e,floating:t}});c=w??c,d=b??d,p={...p,[x]:{...p[x],...T}},S&&m<=50&&(m++,typeof S=="object"&&(S.placement&&(f=S.placement),S.rects&&(l=S.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):S.rects),{x:c,y:d}=VC(l,f,u)),g=-1)}return{x:c,y:d,placement:f,strategy:i,middlewareData:p}};async function vl(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:o,elements:s,strategy:u}=e,{boundary:l="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=xi(t,e),m=zC(p),x=s[f?d==="floating"?"reference":"floating":d],y=Uf(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(x)))==null||n?x:x.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:l,rootBoundary:c,strategy:u})),w=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,b=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),T=await(a.isElement==null?void 0:a.isElement(b))?await(a.getScale==null?void 0:a.getScale(b))||{x:1,y:1}:{x:1,y:1},S=Uf(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetParent:b,strategy:u}):w);return{top:(y.top-S.top+m.top)/T.y,bottom:(S.bottom-y.bottom+m.bottom)/T.y,left:(y.left-S.left+m.left)/T.x,right:(S.right-y.right+m.right)/T.x}}const fU=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:u}=t,{element:l,padding:c=0}=xi(e,t)||{};if(l==null)return{};const d=zC(c),f={x:n,y:r},p=Oy(i),m=Iy(p),g=await o.getDimensions(l),x=p==="y",y=x?"top":"left",w=x?"bottom":"right",b=x?"clientHeight":"clientWidth",T=a.reference[m]+a.reference[p]-f[p]-a.floating[m],S=f[p]-a.reference[p],_=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l));let N=_?_[b]:0;(!N||!await(o.isElement==null?void 0:o.isElement(_)))&&(N=s.floating[b]||a.floating[m]);const D=T/2-S/2,V=N/2-g[m]/2-1,P=ca(d[y],V),$=ca(d[w],V),H=P,X=N-g[m]-$,Y=N/2-g[m]/2+D,ne=Ny(H,Y,X),re=!u.arrow&&ws(i)!=null&&Y!==ne&&a.reference[m]/2-(Y<H?P:$)-g[m]/2<0,ee=re?Y<H?Y-H:Y-X:0;return{[p]:f[p]+ee,data:{[p]:ne,centerOffset:Y-ne-ee,...re&&{alignmentOffset:ee}},reset:re}}}),pU=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:a,rects:o,initialPlacement:s,platform:u,elements:l}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...x}=xi(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const y=Ei(i),w=fa(s),b=Ei(s)===s,T=await(u.isRTL==null?void 0:u.isRTL(l.floating)),S=f||(b||!g?[jf(s)]:sU(s)),_=m!=="none";!f&&_&&S.push(...lU(s,g,m,T));const N=[s,...S],D=await vl(t,x),V=[];let P=((r=a.flip)==null?void 0:r.overflows)||[];if(c&&V.push(D[y]),d){const Y=oU(i,o,T);V.push(D[Y[0]],D[Y[1]])}if(P=[...P,{placement:i,overflows:V}],!V.every(Y=>Y<=0)){var $,H;const Y=((($=a.flip)==null?void 0:$.index)||0)+1,ne=N[Y];if(ne)return{data:{index:Y,overflows:P},reset:{placement:ne}};let re=(H=P.filter(ee=>ee.overflows[0]<=0).sort((ee,F)=>ee.overflows[1]-F.overflows[1])[0])==null?void 0:H.placement;if(!re)switch(p){case"bestFit":{var X;const ee=(X=P.filter(F=>{if(_){const B=fa(F.placement);return B===w||B==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(B=>B>0).reduce((B,A)=>B+A,0)]).sort((F,B)=>F[1]-B[1])[0])==null?void 0:X[0];ee&&(re=ee);break}case"initialPlacement":re=s;break}if(i!==re)return{reset:{placement:re}}}return{}}}};function $C(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function WC(e){return rU.some(t=>e[t]>=0)}const hU=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=xi(e,t);switch(r){case"referenceHidden":{const a=await vl(t,{...i,elementContext:"reference"}),o=$C(a,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:WC(o)}}}case"escaped":{const a=await vl(t,{...i,altBoundary:!0}),o=$C(a,n.floating);return{data:{escapedOffsets:o,escaped:WC(o)}}}default:return{}}}}};async function mU(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ei(n),s=ws(n),u=fa(n)==="y",l=["left","top"].includes(o)?-1:1,c=a&&u?-1:1,d=xi(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m=="number"&&(p=s==="end"?m*-1:m),u?{x:p*c,y:f*l}:{x:f*l,y:p*c}}const gU=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:o,middlewareData:s}=t,u=await mU(t,e);return o===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+u.x,y:a+u.y,data:{...u,placement:o}}}}},yU=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:x=>{let{x:y,y:w}=x;return{x:y,y:w}}},...u}=xi(e,t),l={x:n,y:r},c=await vl(t,u),d=fa(Ei(i)),f=Py(d);let p=l[f],m=l[d];if(a){const x=f==="y"?"top":"left",y=f==="y"?"bottom":"right",w=p+c[x],b=p-c[y];p=Ny(w,p,b)}if(o){const x=d==="y"?"top":"left",y=d==="y"?"bottom":"right",w=m+c[x],b=m-c[y];m=Ny(w,m,b)}const g=s.fn({...t,[f]:p,[d]:m});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[f]:a,[d]:o}}}}}},vU=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:u=!0,crossAxis:l=!0}=xi(e,t),c={x:n,y:r},d=fa(i),f=Py(d);let p=c[f],m=c[d];const g=xi(s,t),x=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(u){const b=f==="y"?"height":"width",T=a.reference[f]-a.floating[b]+x.mainAxis,S=a.reference[f]+a.reference[b]-x.mainAxis;p<T?p=T:p>S&&(p=S)}if(l){var y,w;const b=f==="y"?"width":"height",T=["top","left"].includes(Ei(i)),S=a.reference[d]-a.floating[b]+(T&&((y=o.offset)==null?void 0:y[d])||0)+(T?0:x.crossAxis),_=a.reference[d]+a.reference[b]+(T?0:((w=o.offset)==null?void 0:w[d])||0)-(T?x.crossAxis:0);m<S?m=S:m>_&&(m=_)}return{[f]:p,[d]:m}}}},wU=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:a,platform:o,elements:s}=t,{apply:u=()=>{},...l}=xi(e,t),c=await vl(t,l),d=Ei(i),f=ws(i),p=fa(i)==="y",{width:m,height:g}=a.floating;let x,y;d==="top"||d==="bottom"?(x=d,y=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(y=d,x=f==="end"?"top":"bottom");const w=g-c.top-c.bottom,b=m-c.left-c.right,T=ca(g-c[x],w),S=ca(m-c[y],b),_=!t.middlewareData.shift;let N=T,D=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(N=w),_&&!f){const P=$n(c.left,0),$=$n(c.right,0),H=$n(c.top,0),X=$n(c.bottom,0);p?D=m-2*(P!==0||$!==0?P+$:$n(c.left,c.right)):N=g-2*(H!==0||X!==0?H+X:$n(c.top,c.bottom))}await u({...t,availableWidth:D,availableHeight:N});const V=await o.getDimensions(s.floating);return m!==V.width||g!==V.height?{reset:{rects:!0}}:{}}}};function Hf(){return typeof window<"u"}function bs(e){return YC(e)?(e.nodeName||"").toLowerCase():"#document"}function Wn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function $r(e){var t;return(t=(YC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function YC(e){return Hf()?e instanceof Node||e instanceof Wn(e).Node:!1}function Sr(e){return Hf()?e instanceof Element||e instanceof Wn(e).Element:!1}function Wr(e){return Hf()?e instanceof HTMLElement||e instanceof Wn(e).HTMLElement:!1}function qC(e){return!Hf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Wn(e).ShadowRoot}function wl(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Cr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function bU(e){return["table","td","th"].includes(bs(e))}function zf(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Ly(e){const t=My(),n=Sr(e)?Cr(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function xU(e){let t=pa(e);for(;Wr(t)&&!xs(t);){if(Ly(t))return t;if(zf(t))return null;t=pa(t)}return null}function My(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function xs(e){return["html","body","#document"].includes(bs(e))}function Cr(e){return Wn(e).getComputedStyle(e)}function Vf(e){return Sr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function pa(e){if(bs(e)==="html")return e;const t=e.assignedSlot||e.parentNode||qC(e)&&e.host||$r(e);return qC(t)?t.host:t}function GC(e){const t=pa(e);return xs(t)?e.ownerDocument?e.ownerDocument.body:e.body:Wr(t)&&wl(t)?t:GC(t)}function bl(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=GC(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=Wn(i);if(a){const s=Fy(o);return t.concat(o,o.visualViewport||[],wl(i)?i:[],s&&n?bl(s):[])}return t.concat(i,bl(i,[],n))}function Fy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function KC(e){const t=Cr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Wr(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ff(n)!==a||Ff(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function By(e){return Sr(e)?e:e.contextElement}function Es(e){const t=By(e);if(!Wr(t))return da(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=KC(t);let o=(a?Ff(n.width):n.width)/r,s=(a?Ff(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const EU=da(0);function XC(e){const t=Wn(e);return!My()||!t.visualViewport?EU:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function TU(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Wn(e)?!1:t}function io(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=By(e);let o=da(1);t&&(r?Sr(r)&&(o=Es(r)):o=Es(e));const s=TU(a,n,r)?XC(a):da(0);let u=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,c=i.width/o.x,d=i.height/o.y;if(a){const f=Wn(a),p=r&&Sr(r)?Wn(r):r;let m=f,g=Fy(m);for(;g&&r&&p!==m;){const x=Es(g),y=g.getBoundingClientRect(),w=Cr(g),b=y.left+(g.clientLeft+parseFloat(w.paddingLeft))*x.x,T=y.top+(g.clientTop+parseFloat(w.paddingTop))*x.y;u*=x.x,l*=x.y,c*=x.x,d*=x.y,u+=b,l+=T,m=Wn(g),g=Fy(m)}}return Uf({width:c,height:d,x:u,y:l})}function _U(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",o=$r(r),s=t?zf(t.floating):!1;if(r===o||s&&a)return n;let u={scrollLeft:0,scrollTop:0},l=da(1);const c=da(0),d=Wr(r);if((d||!d&&!a)&&((bs(r)!=="body"||wl(o))&&(u=Vf(r)),Wr(r))){const f=io(r);l=Es(r),c.x=f.x+r.clientLeft,c.y=f.y+r.clientTop}return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-u.scrollLeft*l.x+c.x,y:n.y*l.y-u.scrollTop*l.y+c.y}}function SU(e){return Array.from(e.getClientRects())}function jy(e,t){const n=Vf(e).scrollLeft;return t?t.left+n:io($r(e)).left+n}function CU(e){const t=$r(e),n=Vf(e),r=e.ownerDocument.body,i=$n(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=$n(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+jy(e);const s=-n.scrollTop;return Cr(r).direction==="rtl"&&(o+=$n(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function AU(e,t){const n=Wn(e),r=$r(e),i=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,s=0,u=0;if(i){a=i.width,o=i.height;const l=My();(!l||l&&t==="fixed")&&(s=i.offsetLeft,u=i.offsetTop)}return{width:a,height:o,x:s,y:u}}function kU(e,t){const n=io(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Wr(e)?Es(e):da(1),o=e.clientWidth*a.x,s=e.clientHeight*a.y,u=i*a.x,l=r*a.y;return{width:o,height:s,x:u,y:l}}function QC(e,t,n){let r;if(t==="viewport")r=AU(e,n);else if(t==="document")r=CU($r(e));else if(Sr(t))r=kU(t,n);else{const i=XC(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return Uf(r)}function ZC(e,t){const n=pa(e);return n===t||!Sr(n)||xs(n)?!1:Cr(n).position==="fixed"||ZC(n,t)}function RU(e,t){const n=t.get(e);if(n)return n;let r=bl(e,[],!1).filter(s=>Sr(s)&&bs(s)!=="body"),i=null;const a=Cr(e).position==="fixed";let o=a?pa(e):e;for(;Sr(o)&&!xs(o);){const s=Cr(o),u=Ly(o);!u&&s.position==="fixed"&&(i=null),(a?!u&&!i:!u&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||wl(o)&&!u&&ZC(e,o))?r=r.filter(c=>c!==o):i=s,o=pa(o)}return t.set(e,r),r}function NU(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?zf(t)?[]:RU(t,this._c):[].concat(n),r],s=o[0],u=o.reduce((l,c)=>{const d=QC(t,c,i);return l.top=$n(d.top,l.top),l.right=ca(d.right,l.right),l.bottom=ca(d.bottom,l.bottom),l.left=$n(d.left,l.left),l},QC(t,s,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function PU(e){const{width:t,height:n}=KC(e);return{width:t,height:n}}function IU(e,t,n){const r=Wr(t),i=$r(t),a=n==="fixed",o=io(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const u=da(0);if(r||!r&&!a)if((bs(t)!=="body"||wl(i))&&(s=Vf(t)),r){const p=io(t,!0,a,t);u.x=p.x+t.clientLeft,u.y=p.y+t.clientTop}else i&&(u.x=jy(i));let l=0,c=0;if(i&&!r&&!a){const p=i.getBoundingClientRect();c=p.top+s.scrollTop,l=p.left+s.scrollLeft-jy(i,p)}const d=o.left+s.scrollLeft-u.x-l,f=o.top+s.scrollTop-u.y-c;return{x:d,y:f,width:o.width,height:o.height}}function Uy(e){return Cr(e).position==="static"}function JC(e,t){if(!Wr(e)||Cr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return $r(e)===n&&(n=n.ownerDocument.body),n}function eA(e,t){const n=Wn(e);if(zf(e))return n;if(!Wr(e)){let i=pa(e);for(;i&&!xs(i);){if(Sr(i)&&!Uy(i))return i;i=pa(i)}return n}let r=JC(e,t);for(;r&&bU(r)&&Uy(r);)r=JC(r,t);return r&&xs(r)&&Uy(r)&&!Ly(r)?n:r||xU(e)||n}const OU=async function(e){const t=this.getOffsetParent||eA,n=this.getDimensions,r=await n(e.floating);return{reference:IU(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function DU(e){return Cr(e).direction==="rtl"}const LU={convertOffsetParentRelativeRectToViewportRelativeRect:_U,getDocumentElement:$r,getClippingRect:NU,getOffsetParent:eA,getElementRects:OU,getClientRects:SU,getDimensions:PU,getScale:Es,isElement:Sr,isRTL:DU};function MU(e,t){let n=null,r;const i=$r(e);function a(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function o(s,u){s===void 0&&(s=!1),u===void 0&&(u=1),a();const{left:l,top:c,width:d,height:f}=e.getBoundingClientRect();if(s||t(),!d||!f)return;const p=Bf(c),m=Bf(i.clientWidth-(l+d)),g=Bf(i.clientHeight-(c+f)),x=Bf(l),w={rootMargin:-p+"px "+-m+"px "+-g+"px "+-x+"px",threshold:$n(0,ca(1,u))||1};let b=!0;function T(S){const _=S[0].intersectionRatio;if(_!==u){if(!b)return o();_?o(!1,_):r=setTimeout(()=>{o(!1,1e-7)},1e3)}b=!1}try{n=new IntersectionObserver(T,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(T,w)}n.observe(e)}return o(!0),a}function tA(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,l=By(e),c=i||a?[...l?bl(l):[],...bl(t)]:[];c.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),a&&y.addEventListener("resize",n)});const d=l&&s?MU(l,n):null;let f=-1,p=null;o&&(p=new ResizeObserver(y=>{let[w]=y;w&&w.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(t)})),n()}),l&&!u&&p.observe(l),p.observe(t));let m,g=u?io(e):null;u&&x();function x(){const y=io(e);g&&(y.x!==g.x||y.y!==g.y||y.width!==g.width||y.height!==g.height)&&n(),g=y,m=requestAnimationFrame(x)}return n(),()=>{var y;c.forEach(w=>{i&&w.removeEventListener("scroll",n),a&&w.removeEventListener("resize",n)}),d==null||d(),(y=p)==null||y.disconnect(),p=null,u&&cancelAnimationFrame(m)}}const FU=gU,BU=yU,jU=pU,UU=wU,HU=hU,nA=fU,zU=vU,VU=(e,t,n)=>{const r=new Map,i={platform:LU,...n},a={...i.platform,_c:r};return dU(e,t,{...i,platform:a})};var $f=typeof document<"u"?v.useLayoutEffect:v.useEffect;function Wf(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Wf(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const a=i[r];if(!(a==="_owner"&&e.$$typeof)&&!Wf(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function rA(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function iA(e,t){const n=rA(e);return Math.round(t*n)/n}function Hy(e){const t=v.useRef(e);return $f(()=>{t.current=e}),t}function aA(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:u,open:l}=e,[c,d]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=v.useState(r);Wf(f,r)||p(r);const[m,g]=v.useState(null),[x,y]=v.useState(null),w=v.useCallback(F=>{F!==_.current&&(_.current=F,g(F))},[]),b=v.useCallback(F=>{F!==N.current&&(N.current=F,y(F))},[]),T=a||m,S=o||x,_=v.useRef(null),N=v.useRef(null),D=v.useRef(c),V=u!=null,P=Hy(u),$=Hy(i),H=Hy(l),X=v.useCallback(()=>{if(!_.current||!N.current)return;const F={placement:t,strategy:n,middleware:f};$.current&&(F.platform=$.current),VU(_.current,N.current,F).then(B=>{const A={...B,isPositioned:H.current!==!1};Y.current&&!Wf(D.current,A)&&(D.current=A,Zo.flushSync(()=>{d(A)}))})},[f,t,n,$,H]);$f(()=>{l===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,d(F=>({...F,isPositioned:!1})))},[l]);const Y=v.useRef(!1);$f(()=>(Y.current=!0,()=>{Y.current=!1}),[]),$f(()=>{if(T&&(_.current=T),S&&(N.current=S),T&&S){if(P.current)return P.current(T,S,X);X()}},[T,S,X,P,V]);const ne=v.useMemo(()=>({reference:_,floating:N,setReference:w,setFloating:b}),[w,b]),re=v.useMemo(()=>({reference:T,floating:S}),[T,S]),ee=v.useMemo(()=>{const F={position:n,left:0,top:0};if(!re.floating)return F;const B=iA(re.floating,c.x),A=iA(re.floating,c.y);return s?{...F,transform:"translate("+B+"px, "+A+"px)",...rA(re.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:B,top:A}},[n,s,re.floating,c.x,c.y]);return v.useMemo(()=>({...c,update:X,refs:ne,elements:re,floatingStyles:ee}),[c,X,ne,re,ee])}const $U=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?nA({element:r.current,padding:i}).fn(n):{}:r?nA({element:r,padding:i}).fn(n):{}}}},oA=(e,t)=>({...FU(e),options:[e,t]}),sA=(e,t)=>({...BU(e),options:[e,t]}),uA=(e,t)=>({...zU(e),options:[e,t]}),lA=(e,t)=>({...jU(e),options:[e,t]}),cA=(e,t)=>({...UU(e),options:[e,t]}),dA=(e,t)=>({...HU(e),options:[e,t]}),fA=(e,t)=>({...$U(e),options:[e,t]});var WU="Arrow",pA=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...a}=e;return E.jsx(Vn.svg,{...a,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:E.jsx("polygon",{points:"0,0 30,0 15,10"})})});pA.displayName=WU;var YU=pA;function qU(e,t=[]){let n=[];function r(a,o){const s=v.createContext(o),u=n.length;n=[...n,o];function l(d){const{scope:f,children:p,...m}=d,g=(f==null?void 0:f[e][u])||s,x=v.useMemo(()=>m,Object.values(m));return E.jsx(g.Provider,{value:x,children:p})}function c(d,f){const p=(f==null?void 0:f[e][u])||s,m=v.useContext(p);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${a}\``)}return l.displayName=a+"Provider",[l,c]}const i=()=>{const a=n.map(o=>v.createContext(o));return function(s){const u=(s==null?void 0:s[e])||a;return v.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return i.scopeName=e,[r,GU(i,...t)]}function GU(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const o=r.reduce((s,{useScope:u,scopeName:l})=>{const d=u(a)[`__scope${l}`];return{...s,...d}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function hA(e){const[t,n]=v.useState(void 0);return ar(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const a=i[0];let o,s;if("borderBoxSize"in a){const u=a.borderBoxSize,l=Array.isArray(u)?u[0]:u;o=l.inlineSize,s=l.blockSize}else o=e.offsetWidth,s=e.offsetHeight;n({width:o,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var zy="Popper",[mA,Yf]=qU(zy),[KU,gA]=mA(zy),yA=e=>{const{__scopePopper:t,children:n}=e,[r,i]=v.useState(null);return E.jsx(KU,{scope:t,anchor:r,onAnchorChange:i,children:n})};yA.displayName=zy;var vA="PopperAnchor",wA=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,a=gA(vA,n),o=v.useRef(null),s=Vr(t,o);return v.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:E.jsx(Vn.div,{...i,ref:s})});wA.displayName=vA;var Vy="PopperContent",[XU,QU]=mA(Vy),bA=v.forwardRef((e,t)=>{var $e,Ve,We,Ge,_t,Te;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:a="center",alignOffset:o=0,arrowPadding:s=0,avoidCollisions:u=!0,collisionBoundary:l=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:m,...g}=e,x=gA(Vy,n),[y,w]=v.useState(null),b=Vr(t,xe=>w(xe)),[T,S]=v.useState(null),_=hA(T),N=(_==null?void 0:_.width)??0,D=(_==null?void 0:_.height)??0,V=r+(a!=="center"?"-"+a:""),P=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},$=Array.isArray(l)?l:[l],H=$.length>0,X={padding:P,boundary:$.filter(JU),altBoundary:H},{refs:Y,floatingStyles:ne,placement:re,isPositioned:ee,middlewareData:F}=aA({strategy:"fixed",placement:V,whileElementsMounted:(...xe)=>tA(...xe,{animationFrame:p==="always"}),elements:{reference:x.anchor},middleware:[oA({mainAxis:i+D,alignmentAxis:o}),u&&sA({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?uA():void 0,...X}),u&&lA({...X}),cA({...X,apply:({elements:xe,rects:Ye,availableWidth:He,availableHeight:vt})=>{const{width:wt,height:Ke}=Ye.reference,Me=xe.floating.style;Me.setProperty("--radix-popper-available-width",`${He}px`),Me.setProperty("--radix-popper-available-height",`${vt}px`),Me.setProperty("--radix-popper-anchor-width",`${wt}px`),Me.setProperty("--radix-popper-anchor-height",`${Ke}px`)}}),T&&fA({element:T,padding:s}),eH({arrowWidth:N,arrowHeight:D}),f&&dA({strategy:"referenceHidden",...X})]}),[B,A]=TA(re),ae=Wt(m);ar(()=>{ee&&(ae==null||ae())},[ee,ae]);const he=($e=F.arrow)==null?void 0:$e.x,O=(Ve=F.arrow)==null?void 0:Ve.y,Pe=((We=F.arrow)==null?void 0:We.centerOffset)!==0,[ge,we]=v.useState();return ar(()=>{y&&we(window.getComputedStyle(y).zIndex)},[y]),E.jsx("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...ne,transform:ee?ne.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ge,"--radix-popper-transform-origin":[(Ge=F.transformOrigin)==null?void 0:Ge.x,(_t=F.transformOrigin)==null?void 0:_t.y].join(" "),...((Te=F.hide)==null?void 0:Te.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:E.jsx(XU,{scope:n,placedSide:B,onArrowChange:S,arrowX:he,arrowY:O,shouldHideArrow:Pe,children:E.jsx(Vn.div,{"data-side":B,"data-align":A,...g,ref:b,style:{...g.style,animation:ee?void 0:"none"}})})})});bA.displayName=Vy;var xA="PopperArrow",ZU={top:"bottom",right:"left",bottom:"top",left:"right"},EA=v.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,a=QU(xA,r),o=ZU[a.placedSide];return E.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:E.jsx(YU,{...i,ref:n,style:{...i.style,display:"block"}})})});EA.displayName=xA;function JU(e){return e!==null}var eH=e=>({name:"transformOrigin",options:e,fn(t){var x,y,w;const{placement:n,rects:r,middlewareData:i}=t,o=((x=i.arrow)==null?void 0:x.centerOffset)!==0,s=o?0:e.arrowWidth,u=o?0:e.arrowHeight,[l,c]=TA(n),d={start:"0%",center:"50%",end:"100%"}[c],f=(((y=i.arrow)==null?void 0:y.x)??0)+s/2,p=(((w=i.arrow)==null?void 0:w.y)??0)+u/2;let m="",g="";return l==="bottom"?(m=o?d:`${f}px`,g=`${-u}px`):l==="top"?(m=o?d:`${f}px`,g=`${r.floating.height+u}px`):l==="right"?(m=`${-u}px`,g=o?d:`${p}px`):l==="left"&&(m=`${r.floating.width+u}px`,g=o?d:`${p}px`),{data:{x:m,y:g}}}});function TA(e){const[t,n="center"]=e.split("-");return[t,n]}var _A=yA,$y=wA,SA=bA,CA=EA;function tH(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var Wy=e=>{const{present:t,children:n}=e,r=nH(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),a=Vr(r.ref,rH(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:a}):null};Wy.displayName="Presence";function nH(e){const[t,n]=v.useState(),r=v.useRef({}),i=v.useRef(e),a=v.useRef("none"),o=e?"mounted":"unmounted",[s,u]=tH(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=qf(r.current);a.current=s==="mounted"?l:"none"},[s]),ar(()=>{const l=r.current,c=i.current;if(c!==e){const f=a.current,p=qf(l);e?u("MOUNT"):p==="none"||(l==null?void 0:l.display)==="none"?u("UNMOUNT"):u(c&&f!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),ar(()=>{if(t){let l;const c=t.ownerDocument.defaultView??window,d=p=>{const g=qf(r.current).includes(p.animationName);if(p.target===t&&g&&(u("ANIMATION_END"),!i.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",l=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},f=p=>{p.target===t&&(a.current=qf(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{c.clearTimeout(l),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function qf(e){return(e==null?void 0:e.animationName)||"none"}function rH(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Gf({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=iH({defaultProp:t,onChange:n}),a=e!==void 0,o=a?e:r,s=Wt(n),u=v.useCallback(l=>{if(a){const d=typeof l=="function"?l(e):l;d!==e&&s(d)}else i(l)},[a,e,i,s]);return[o,u]}function iH({defaultProp:e,onChange:t}){const n=v.useState(e),[r]=n,i=v.useRef(r),a=Wt(t);return v.useEffect(()=>{i.current!==r&&(a(r),i.current=r)},[r,i,a]),n}var aH="VisuallyHidden",AA=v.forwardRef((e,t)=>E.jsx(Vn.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));AA.displayName=aH;var oH=AA,[Kf,Die]=la("Tooltip",[Yf]),Xf=Yf(),kA="TooltipProvider",sH=700,Yy="tooltip.open",[uH,qy]=Kf(kA),RA=e=>{const{__scopeTooltip:t,delayDuration:n=sH,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,[o,s]=v.useState(!0),u=v.useRef(!1),l=v.useRef(0);return v.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),E.jsx(uH,{scope:t,isOpenDelayed:o,delayDuration:n,onOpen:v.useCallback(()=>{window.clearTimeout(l.current),s(!1)},[]),onClose:v.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s(!0),r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:v.useCallback(c=>{u.current=c},[]),disableHoverableContent:i,children:a})};RA.displayName=kA;var Qf="Tooltip",[lH,Zf]=Kf(Qf),NA=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,u=qy(Qf,e.__scopeTooltip),l=Xf(t),[c,d]=v.useState(null),f=yl(),p=v.useRef(0),m=o??u.disableHoverableContent,g=s??u.delayDuration,x=v.useRef(!1),[y=!1,w]=Gf({prop:r,defaultProp:i,onChange:N=>{N?(u.onOpen(),document.dispatchEvent(new CustomEvent(Yy))):u.onClose(),a==null||a(N)}}),b=v.useMemo(()=>y?x.current?"delayed-open":"instant-open":"closed",[y]),T=v.useCallback(()=>{window.clearTimeout(p.current),x.current=!1,w(!0)},[w]),S=v.useCallback(()=>{window.clearTimeout(p.current),w(!1)},[w]),_=v.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{x.current=!0,w(!0)},g)},[g,w]);return v.useEffect(()=>()=>window.clearTimeout(p.current),[]),E.jsx(_A,{...l,children:E.jsx(lH,{scope:t,contentId:f,open:y,stateAttribute:b,trigger:c,onTriggerChange:d,onTriggerEnter:v.useCallback(()=>{u.isOpenDelayed?_():T()},[u.isOpenDelayed,_,T]),onTriggerLeave:v.useCallback(()=>{m?S():window.clearTimeout(p.current)},[S,m]),onOpen:T,onClose:S,disableHoverableContent:m,children:n})})};NA.displayName=Qf;var Gy="TooltipTrigger",PA=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Zf(Gy,n),a=qy(Gy,n),o=Xf(n),s=v.useRef(null),u=Vr(t,s,i.onTriggerChange),l=v.useRef(!1),c=v.useRef(!1),d=v.useCallback(()=>l.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),E.jsx($y,{asChild:!0,...o,children:E.jsx(Vn.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:u,onPointerMove:Sn(e.onPointerMove,f=>{f.pointerType!=="touch"&&!c.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),c.current=!0)}),onPointerLeave:Sn(e.onPointerLeave,()=>{i.onTriggerLeave(),c.current=!1}),onPointerDown:Sn(e.onPointerDown,()=>{l.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Sn(e.onFocus,()=>{l.current||i.onOpen()}),onBlur:Sn(e.onBlur,i.onClose),onClick:Sn(e.onClick,i.onClose)})})});PA.displayName=Gy;var cH="TooltipPortal",[Lie,dH]=Kf(cH,{forceMount:void 0}),Ts="TooltipContent",IA=v.forwardRef((e,t)=>{const n=dH(Ts,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...a}=e,o=Zf(Ts,e.__scopeTooltip);return E.jsx(Wy,{present:r||o.open,children:o.disableHoverableContent?E.jsx(OA,{side:i,...a,ref:t}):E.jsx(fH,{side:i,...a,ref:t})})}),fH=v.forwardRef((e,t)=>{const n=Zf(Ts,e.__scopeTooltip),r=qy(Ts,e.__scopeTooltip),i=v.useRef(null),a=Vr(t,i),[o,s]=v.useState(null),{trigger:u,onClose:l}=n,c=i.current,{onPointerInTransitChange:d}=r,f=v.useCallback(()=>{s(null),d(!1)},[d]),p=v.useCallback((m,g)=>{const x=m.currentTarget,y={x:m.clientX,y:m.clientY},w=gH(y,x.getBoundingClientRect()),b=yH(y,w),T=vH(g.getBoundingClientRect()),S=bH([...b,...T]);s(S),d(!0)},[d]);return v.useEffect(()=>()=>f(),[f]),v.useEffect(()=>{if(u&&c){const m=x=>p(x,c),g=x=>p(x,u);return u.addEventListener("pointerleave",m),c.addEventListener("pointerleave",g),()=>{u.removeEventListener("pointerleave",m),c.removeEventListener("pointerleave",g)}}},[u,c,p,f]),v.useEffect(()=>{if(o){const m=g=>{const x=g.target,y={x:g.clientX,y:g.clientY},w=(u==null?void 0:u.contains(x))||(c==null?void 0:c.contains(x)),b=!wH(y,o);w?f():b&&(f(),l())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[u,c,o,l,f]),E.jsx(OA,{...e,ref:a})}),[pH,hH]=Kf(Qf,{isInside:!1}),OA=v.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,u=Zf(Ts,n),l=Xf(n),{onClose:c}=u;return v.useEffect(()=>(document.addEventListener(Yy,c),()=>document.removeEventListener(Yy,c)),[c]),v.useEffect(()=>{if(u.trigger){const d=f=>{const p=f.target;p!=null&&p.contains(u.trigger)&&c()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[u.trigger,c]),E.jsx(Ry,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:c,children:E.jsxs(SA,{"data-state":u.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[E.jsx(MC,{children:r}),E.jsx(pH,{scope:n,isInside:!0,children:E.jsx(oH,{id:u.contentId,role:"tooltip",children:i||r})})]})})});IA.displayName=Ts;var DA="TooltipArrow",mH=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Xf(n);return hH(DA,n).isInside?null:E.jsx(CA,{...i,...r,ref:t})});mH.displayName=DA;function gH(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function yH(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function vH(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function wH(e,t){const{x:n,y:r}=e;let i=!1;for(let a=0,o=t.length-1;a<t.length;o=a++){const s=t[a].x,u=t[a].y,l=t[o].x,c=t[o].y;u>r!=c>r&&n<(l-s)*(r-u)/(c-u)+s&&(i=!i)}return i}function bH(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),xH(t)}function xH(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const a=t[t.length-1],o=t[t.length-2];if((a.x-o.x)*(i.y-o.y)>=(a.y-o.y)*(i.x-o.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const a=n[n.length-1],o=n[n.length-2];if((a.x-o.x)*(i.y-o.y)>=(a.y-o.y)*(i.x-o.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var EH=RA,TH=NA,_H=PA,LA=IA;const SH=EH,CH=TH,AH=_H,MA=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>E.jsx(LA,{ref:r,sideOffset:t,className:Le("z-50 overflow-hidden max-w-xs rounded-xl bg-primary border text-primary-foreground p-2 text-center align-middle text-xs shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));MA.displayName=LA.displayName;function Ky({children:e,content:t,side:n,align:r}){return E.jsxs(CH,{children:[E.jsx(AH,{asChild:!0,children:e}),E.jsx(MA,{side:n,align:r,collisionPadding:8,avoidCollisions:!0,children:t})]})}const FA={en:{ok:"OK",yes:"Yes",no:"No",agree:"Agree",cancel:"Cancel","yes-exit":"Yes, exit","yes-reset":"Yes, reset","no-cancel":"No, cancel","are-you-sure":"Are you sure?",recording:"Recording...","thank-you":"Thank you","sorry-try-again":"Sorry, please try again","error-occurred":"An error occurred","please-try-again":"Please try again","write-a-message":"Write a message...","send-message":"Send message",connected:"Connected",connecting:"Connecting",reconnecting:"Reconnecting",reconnected:"Reconnected",disconnecting:"Disconnecting",disconnected:"Disconnected",error:"Error","persist-session":"Persist session",settings:"Settings",close:"Close",help:"Help",chat:"Chat",send:"Send",copy:"Copy",copied:"Copied","sound-effects":"Sound effects",language:"Language",select:"Select",agent:"Agent",user:"User",bot:"Bot","close-widget":"Close widget","got-any-questions":"Got any questions? Chat with us!","typical-response-time":"Typically respond in less than 1 minute","session-closed-lead":"Your issue has been resolved!","create-new-ticket":"Create new ticket",exit:"Exit","reset-conversation":"Reset conversation","new-conversation":"New conversation","welcome-title":"Welcome to our support chat","welcome-description":"We're here to help! Start a conversation and we'll get back to you as soon as possible.","your-name":"Your name","your-email":"Your email address","start-chat":"Talk to support","starting-chat":"Connecting...","hello-greeting":"Hi there!"},ar:{ok:"حسنا",yes:"نعم",no:"لا",agree:"موافق",cancel:"إلغاء","yes-exit":"نعم، اخرج","yes-reset":"نعم، إعادة تعيين","no-cancel":"لا، إلغاء","are-you-sure":"هل أنت متأكد؟",recording:"تسجيل","thank-you":"شكرا","sorry-try-again":"عذرا، حاول مرة أخرى","error-occurred":"حدث خطأ","please-try-again":"يرجى المحاولة مرة أخرى","write-a-message":"اكتب رسالة...","send-message":"إرسال رسالة",connected:"متصل",connecting:"جاري الاتصال",reconnecting:"جاري إعادة الاتصال",reconnected:"تم إعادة الاتصال",disconnecting:"جاري قطع الاتصال",disconnected:"قطع الاتصال",error:"خطأ","persist-session":"حفظ الجلسة",settings:"إعدادات",close:"إغلاق",help:"مساعدة",chat:"محادثة",send:"إرسال",copy:"نسخ",copied:"تم النسخ","sound-effects":"التاثيرات الصوتية",language:"اللغة",select:"اختر",agent:"الوكيل",user:"المستخدم",bot:"البوت","close-widget":"إغلاق الودجة","got-any-questions":"هل لديك أي أسئلة؟ تحدث معنا!","typical-response-time":"عادة ما نرد في أقل من دقيقة واحدة","session-closed-lead":"تم حل مشكلتك!",exit:"خروج","create-new-ticket":"إنشاء تذكرة جديدة","reset-conversation":"إعادة تعيين المحادثة","new-conversation":"محادثة جديدة","welcome-title":"مرحبًا بك في دردشة الدعم الخاصة بنا","welcome-description":"نحن هنا للمساعدة! ابدأ محادثة وسنرد عليك في أقرب وقت ممكن.","your-name":"اسمك","your-email":"عنوان بريدك الإلكتروني","start-chat":"تحدث إلى الدعم","starting-chat":"جاري الاتصال...","hello-greeting":"مرحبًا! كيف يمكننا مساعدتك اليوم؟"},nl:{ok:"OK",yes:"Ja",no:"Nee",agree:"Akkoord",cancel:"Annuleren","yes-exit":"Ja, afsluiten","yes-reset":"Ja, resetten","no-cancel":"Nee, annuleren","are-you-sure":"Weet u het zeker?",recording:"Opname...","thank-you":"Dank u","sorry-try-again":"Sorry, probeer het opnieuw","error-occurred":"Er is een fout opgetreden","please-try-again":"Probeer het opnieuw","write-a-message":"Schrijf een bericht...","send-message":"Bericht verzenden",connected:"Verbonden",connecting:"Verbinding maken",reconnecting:"Opnieuw verbinding maken",reconnected:"Opnieuw verbonden",disconnecting:"Verbinding verbreken",disconnected:"Verbinding verbroken",error:"Fout","persist-session":"Sessie behouden",settings:"Instellingen",close:"Sluiten",help:"Help",chat:"Chat",send:"Verzenden",copy:"Kopiëren",copied:"Gekopieerd","sound-effects":"Geluidseffecten",language:"Taal",select:"Selecteren",agent:"Agent",user:"Gebruiker",bot:"Bot","close-widget":"Widget sluiten","got-any-questions":"Heeft u vragen? Chat met ons!","typical-response-time":"We reageren doorgaans binnen 1 minuut","session-closed-lead":"Uw probleem is opgelost!","create-new-ticket":"Nieuw ticket aanmaken",exit:"Afsluiten","reset-conversation":"Gesprek resetten","new-conversation":"Nieuw gesprek","welcome-title":"Welkom bij onze supportchat","welcome-description":"We zijn hier om te helpen! Begin een gesprek en we nemen zo snel mogelijk contact met u op.","your-name":"Uw naam","your-email":"Uw e-mailadres","start-chat":"Praat met ondersteuning","starting-chat":"Verbinding maken...","hello-greeting":"Hallo! Hoe kunnen we u vandaag helpen?"},fr:{ok:"D'accord",yes:"Oui",no:"Non",agree:"Accepter",cancel:"Annuler","yes-exit":"Oui, quitter","yes-reset":"Oui, réinitialiser","no-cancel":"Non, annuler","are-you-sure":"Êtes-vous sûr ?",recording:"Enregistrement...","thank-you":"Merci","sorry-try-again":"Désolé, veuillez réessayer","error-occurred":"Une erreur s'est produite","please-try-again":"Veuillez réessayer","write-a-message":"Écrivez un message...","send-message":"Envoyer le message",connected:"Connecté",connecting:"Connexion en cours",reconnecting:"Reconnexion en cours",reconnected:"Reconnecté",disconnecting:"Déconnexion en cours",disconnected:"Déconnecté",error:"Erreur","persist-session":"Conserver la session",settings:"Paramètres",close:"Fermer",help:"Aide",chat:"Chat",send:"Envoyer",copy:"Copier",copied:"Copié","sound-effects":"Effets sonores",language:"Langue",select:"Sélectionner",agent:"Agent",user:"Utilisateur",bot:"Bot","close-widget":"Fermer le widget","got-any-questions":"Vous avez des questions ? Chattez avec nous !","typical-response-time":"Nous répondons généralement en moins d'une minute","session-closed-lead":"Votre problème a été résolu !","create-new-ticket":"Créer un nouveau ticket",exit:"Sortie","reset-conversation":"Réinitialiser la conversation","new-conversation":"Nouvelle conversation","welcome-title":"Bienvenue dans notre chat de support","welcome-description":"Nous sommes là pour vous aider ! Commencez une conversation et nous vous répondrons dès que possible.","your-name":"Votre nom","your-email":"Votre adresse e-mail","start-chat":"Parler au support","starting-chat":"Connexion...","hello-greeting":"Bonjour ! Comment pouvons-nous vous aider aujourd'hui ?"},de:{ok:"OK",yes:"Ja",no:"Nein",agree:"Zustimmen",cancel:"Stornieren","yes-exit":"Ja, beenden","yes-reset":"Ja, zurücksetzen","no-cancel":"Nein, abbrechen","are-you-sure":"Sind Sie sicher?",recording:"Aufnahme läuft","thank-you":"Vielen Dank","sorry-try-again":"Entschuldigung, bitte versuchen Sie es erneut","error-occurred":"Ein Fehler ist aufgetreten","please-try-again":"Bitte versuchen Sie es erneut","write-a-message":"Nachricht schreiben...","send-message":"Nachricht senden",connected:"Verbunden",connecting:"Verbindung wird hergestellt",reconnecting:"Verbindung wird wiederhergestellt",reconnected:"Wieder verbunden",disconnecting:"Verbindung wird getrennt",disconnected:"Verbindung getrennt",error:"Fehler","persist-session":"Sitzung beibehalten",settings:"Einstellungen",close:"Schließen",help:"Hilfe",chat:"Chat",send:"Senden",copy:"Kopieren",copied:"Kopiert","sound-effects":"Soundeffekte",language:"Sprache",select:"Auswählen",agent:"Agent",user:"Benutzer",bot:"Bot","got-any-questions":"Haben Sie Fragen? Chatten Sie mit uns!","typical-response-time":"Üblicherweise antworten wir in weniger als 1 Minute","close-widget":"Widget schließen","session-closed-lead":"Ihr Problem wurde gelöst!","create-new-ticket":"Neues Ticket erstellen",exit:"Beenden","reset-conversation":"Konversation zurücksetzen","new-conversation":"Neue Konversation","welcome-title":"Willkommen in unserem Support-Chat","welcome-description":"Wir sind hier, um zu helfen! Beginnen Sie ein Gespräch und wir werden so schnell wie möglich antworten.","your-name":"Ihr Name","your-email":"Ihre E-Mail-Adresse","start-chat":"Mit dem Support sprechen","starting-chat":"Verbindung wird hergestellt...","hello-greeting":"Hallo! Wie können wir Ihnen heute helfen?"},pt:{ok:"OK",yes:"Sim",no:"Não",agree:"Concordo",cancel:"Cancelar","yes-exit":"Sim, sair","yes-reset":"Sim, redefinir","no-cancel":"Não, cancelar","are-you-sure":"Você tem certeza?",recording:"Gravando...","thank-you":"Obrigado","sorry-try-again":"Desculpe, tente novamente","error-occurred":"Ocorreu um erro","please-try-again":"Por favor, tente novamente","write-a-message":"Escreva uma mensagem...","send-message":"Enviar mensagem",connected:"Conectado",connecting:"Conectando",reconnecting:"Reconectando",reconnected:"Reconectado",disconnecting:"Desconectando",disconnected:"Desconectado",error:"Erro","persist-session":"Persistir sessão",settings:"Configurações",close:"Fechar",help:"Ajuda",chat:"Bate-papo",send:"Enviar",copy:"Copiar",copied:"Copiado","sound-effects":"Efeitos sonoros",language:"Idioma",select:"Selecionar",agent:"Agente",user:"Usuário",bot:"Bot","close-widget":"Fechar widget","got-any-questions":"Tem alguma dúvida? Converse conosco!","typical-response-time":"Geralmente respondemos em menos de 1 minuto","session-closed-lead":"Seu problema foi resolvido!","create-new-ticket":"Criar novo ticket",exit:"Sair","reset-conversation":"Redefinir conversa","new-conversation":"Nova conversa","welcome-title":"Bem-vindo ao nosso chat de suporte","welcome-description":"Estamos aqui para ajudar! Inicie uma conversa e responderemos o mais rápido possível.","your-name":"Seu nome","your-email":"Seu endereço de email","start-chat":"Falar com o suporte","starting-chat":"Conectando...","hello-greeting":"Olá! Como podemos ajudar você hoje?"}},kH=Object.keys(FA),RH=e=>kH.includes(e);function NH(e,t){const n=FA[t];return n&&n[e]||""}function Jf(){const{widgetCtx:{config:e}}=zn();return v.useMemo(()=>{const n=RH(e.language)?e.language:"en";return{get:r=>NH(r,n),lang:n}},[e.language])}const PH=10,IH={right:(e,t)=>({initial:{opacity:0,x:-e,...t.initial},animate:{opacity:1,x:0,...t.animate},exit:{opacity:0,x:e,...t.exit}}),left:(e,t)=>({initial:{opacity:0,x:e,...t.initial},animate:{opacity:1,x:0,...t.animate},exit:{opacity:0,x:-e,...t.exit}}),up:(e,t)=>({initial:{opacity:0,y:e,...t.initial},animate:{opacity:1,y:0,...t.animate},exit:{opacity:0,y:-e,...t.exit}}),down:(e,t)=>({initial:{opacity:0,y:-e,...t.initial},animate:{opacity:1,y:0,...t.animate},exit:{opacity:0,y:e,...t.exit}})},fn=v.forwardRef(({fadeIn:e="down",distance:t=PH,children:n,snapExit:r=!1,overrides:i={},...a},o)=>{const s=e?IH[e](t,i):{};return r&&s.exit&&typeof s.exit=="object"&&!Array.isArray(s.exit)&&(s.exit.transition={duration:0}),E.jsx(us.div,{ref:o,...a,...s,children:n})});fn.displayName="MotionDiv";function BA(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=BA(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function OH(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=BA(e))&&(r&&(r+=" "),r+=t);return r}const jA=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,UA=OH,DH=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return UA(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(l=>{const c=n==null?void 0:n[l],d=a==null?void 0:a[l];if(c===null)return null;const f=jA(c)||jA(d);return i[l][f]}),s=n&&Object.entries(n).reduce((l,c)=>{let[d,f]=c;return f===void 0||(l[d]=f),l},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,c)=>{let{class:d,className:f,...p}=c;return Object.entries(p).every(m=>{let[g,x]=m;return Array.isArray(x)?x.includes({...a,...s}[g]):{...a,...s}[g]===x})?[...l,d,f]:l},[]);return UA(e,o,u,n==null?void 0:n.class,n==null?void 0:n.className)},HA={x:2,y:2},LH={1:"scale-[1]","1.01":"scale-[1.01]","1.02":"scale-[1.02]","1.1":"scale-[1.1]"},ep=v.memo(v.forwardRef(({children:e,className:t,scale:n="1.02",off:r=!1},i)=>{const[a,o]=v.useState(!1),[s,u]=v.useState({x:0,y:0});if(r||/translate/.test(e.props.className||""))return e;const c=m=>{var D,V;const{clientX:g,clientY:x}=m,y=m.currentTarget.getBoundingClientRect(),w=g-(y.left+y.width/2),b=x-(y.top+y.height/2),T=Math.max(-1,Math.min(1,w/(y.width/2))),S=Math.max(-1,Math.min(1,b/(y.height/2))),_=T*HA.x,N=S*HA.y;u({x:_,y:N}),(V=(D=e.props).onMouseMove)==null||V.call(D,m)},d=()=>{var m,g;o(!0),(g=(m=e.props).onMouseEnter)==null||g.call(m)},f=()=>{var m,g;o(!1),u({x:0,y:0}),(g=(m=e.props).onMouseLeave)==null||g.call(m)},p={"--opencx-wobble-x":a?`${s.x}px`:"0px","--opencx-wobble-y":a?`${s.y}px`:"0px"};return v.cloneElement(e,{ref:i,onMouseMove:c,onMouseEnter:d,onMouseLeave:f,style:{...p,...e.props.style},className:Le("translate-x-[var(--opencx-wobble-x)]","translate-y-[var(--opencx-wobble-y)]",`hover:${LH[n]}`,t,e.props.className,"transition-all ease-out")})}));ep.displayName="Wobble";const MH=DH(Le("inline-flex shrink-0 items-center justify-center gap-2","text-sm font-medium whitespace-nowrap","ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50","shadow-sm active:shadow-none active:scale-95 hover:active:scale-95","rounded-xl","border","transition"),{variants:{variant:{default:"border-primary bg-primary text-primary-foreground",destructive:"border-destructive bg-destructive text-destructive-foreground",outline:"bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground",ghost:"border-transparent shadow-none hover:bg-accent hover:text-accent-foreground",link:"border-transparent shadow-none text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-8 px-3 text-xs",lg:"min-h-12 px-4",icon:"h-10 w-10",fit:"size-fit p-2",free:"p-2"}},defaultVariants:{variant:"default",size:"default"}}),or=v.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>{const o=r?Mf:"button";return E.jsx(ep,{ref:a,children:E.jsx(o,{className:Le(MH({variant:t,size:n,className:e})),...i})})});or.displayName="Button";const xl=()=>{const[e,t]=v.useState("ltr");return v.useEffect(()=>{const n=()=>{typeof document>"u"||t(window.getComputedStyle(document.body).direction)};n();const r=new MutationObserver(n);return r.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]}),r.observe(document.body,{attributes:!0,attributeFilter:["dir"]}),window.addEventListener("languagechange",n),()=>{r.disconnect(),window.removeEventListener("languagechange",n)}},[]),e};function FH({options:e,onKeyboardClick:t}){return E.jsx("div",{className:"flex items-center gap-2 p-2 flex-wrap",children:e.map((n,r)=>E.jsx(or,{onClick:()=>t(n),className:"flex-1 rounded-full",size:"sm",children:n},r))})}function BH({file:{status:e,file:t,error:n},onCancel:r}){const[i,a]=v.useState(null);v.useEffect(()=>{if(!t.type.startsWith("image/"))return;const u=new FileReader;return u.onload=()=>a(u.result),u.onerror=()=>console.error("Error reading file"),u.readAsDataURL(t),()=>u.abort()},[t]);const o=()=>{switch(e){case"uploading":return E.jsx(gF,{className:"size-4 animate-spin"});case"error":return E.jsx(cF,{className:"size-4 text-destructive"});default:return null}},s=()=>{const u=t.type.split("/")[0];return u==="image"&&i?E.jsx("img",{src:typeof i=="string"?i:"",className:"object-cover bg-secondary size-full",alt:t.name}):u==="audio"?E.jsx(hF,{}):E.jsx(mF,{})};return E.jsx(Ky,{side:"bottom",content:e==="error"?E.jsxs("span",{className:"text-destructive",children:["Failed to upload: ",n]}):t.name,children:E.jsxs("div",{"data-test":"file-display",className:Le(e==="uploading"&&"opacity-50","group","size-12 border rounded-2xl overflow-hidden relative","flex items-center justify-center shrink-0"),children:[E.jsx("div",{className:"absolute inset-0 flex items-center justify-center","data-test":"file-status",children:o()}),E.jsx("button",{"data-test":"file-cancel-button",className:Le("absolute bg-black/50 inset-0 size-full z-10 opacity-0","flex items-center justify-center","opacity-0 group-hover:opacity-100 transition"),onClick:r,children:E.jsx(A_,{className:"size-4 text-primary-foreground"})}),E.jsx(s,{})]})})}const zA=Le("rounded-3xl");function jH(){var S;const e=v.useRef(null),{sendMessage:t}=pl(),{sessionState:n}=ys(),r=Jf(),i=xl(),[a,o]=v.useState(""),{allFiles:s,emptyTheFiles:u,handleCancelUpload:l,appendFiles:c,isUploading:d,successFiles:f}=Uj(),p=!!((S=n.session)!=null&&S.isHandedOff),{isAwaitingBotReply:m}=wC(),g=_=>{p&&c(_)},x=async()=>{if(m)return;if(d){const N="please wait for the file(s) to upload";AS.error(N),console.info(N)}const _=a.trim();_&&(o(""),u(),await t({content:_,attachments:f.map(N=>({url:N.fileUrl,type:N.file.type,name:N.file.name,id:N.id,size:N.file.size}))}))},{getRootProps:y,getInputProps:w,open:b}=xS({onDrop:g,noClick:!0,onDropRejected(){if(p){const _="unsupported file type, or the file is too large";AS.error(_),console.error(_)}},maxSize:5*1024*1024,accept:{"text/*":[".txt"],"image/*":[".png",".jpg",".jpeg",".gif"],"application/pdf":[".pdf"]}}),T=_=>{const N=_.clipboardData;N&&N.files.length>0&&g(Array.from(N.files))};return E.jsxs("div",{className:"p-2 relative space-y-1",...y(),"data-test":"chat-input-container",children:[E.jsx("input",{...w()}),E.jsxs("div",{className:Le(zA,"relative space-y-2 border transition-all shadow py-2"),"data-test":"chat-input-wrapper",children:[E.jsx("div",{className:"flex items-center gap-1 px-2","data-test":"file-attachments-container",children:E.jsx(Ja,{mode:"popLayout",children:s.map(_=>E.jsx(fn,{snapExit:!0,children:E.jsx(BH,{onCancel:()=>l(_.id),file:_})},_.id))})}),E.jsx("textarea",{onPaste:T,ref:e,id:"chat-input",dir:i,value:a,rows:3,"data-test":"chat-message-input",className:Le(zA,"w-full resize-none px-3","text-sm rtl:placeholder:text-right bg-transparent outline-none"),onChange:_=>o(_.target.value),onKeyDown:async _=>{_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),x())},placeholder:r.get("write-a-message")}),E.jsxs("div",{dir:i,className:"px-2 flex justify-between rtl:text-right","data-test":"chat-input-actions",children:[E.jsx(Ky,{side:"top",align:"start",content:"attach files, (maximum size 5mb)",children:E.jsx(or,{onClick:()=>{p&&b()},size:"fit",variant:"outline","data-test":"attach-file-button",className:Le("disabled:opacity-0","rounded-full size-8 flex items-center justify-center p-0"),disabled:!p,children:E.jsx(wF,{className:"size-4"})})}),E.jsx(Ky,{content:"send message",side:"top",align:"end",children:E.jsx(or,{size:"fit",onClick:x,disabled:m||d,"data-test":"send-message-button",className:"rounded-full size-8 flex items-center justify-center p-0",children:m?E.jsx(dF,{className:"size-4 animate-spin animate-iteration-infinite","data-test":"sending-message-indicator"}):E.jsx(C_,{className:"size-4 rtl:-scale-100"})})})]})]})]})}function UH(){const{widgetCtx:e}=zn(),t=Jf();return E.jsx("div",{className:"p-2","data-test":"session-closed-container",children:E.jsxs("div",{className:"p-2 bg-background rounded-3xl border shadow-2xl space-y-2","data-test":"session-closed-content",children:[E.jsxs("div",{className:"flex items-center gap-1","data-test":"session-closed-header",children:[E.jsx(sF,{className:"size-4 text-emerald-500"}),E.jsx("h2",{className:"text-sm font-medium",dir:"auto",children:t.get("session-closed-lead")})]}),E.jsx("div",{children:E.jsx(or,{onClick:e.resetChat,className:"rounded-2xl w-full",children:t.get("new-conversation")})})]})})}function HH(){var o,s,u;const{sessionState:e}=ys(),{messagesState:t,sendMessage:n}=pl(),i=(s=(o=Df().data)==null?void 0:o.data)==null?void 0:s.initialQuestions,a=t.messages.length===0;return E.jsxs("footer",{children:[t.suggestedReplies&&E.jsx(FH,{"data-test":"chat-keyboard",options:t.suggestedReplies,onKeyboardClick:l=>{const c=l.trim();c&&n({content:c})}}),a&&i&&E.jsx("div",{className:"flex items-center flex-row justify-end gap-2 flex-wrap px-2","data-test":"initial-questions-container",children:i==null?void 0:i.map((l,c)=>E.jsx(or,{dir:"auto",variant:"outline",size:"sm","data-test":`initial-question-${c}`,onClick:()=>{n({content:l})},children:l},c))}),E.jsx("div",{children:E.jsx(Ja,{mode:"wait",children:e.session&&!((u=e.session)!=null&&u.isOpened)?E.jsx(fn,{className:"overflow-hidden",overrides:{initial:{height:0},animate:{height:"auto"},exit:{height:0}},children:E.jsx(UH,{})},"session-closed"):E.jsx(fn,{className:"overflow-hidden",overrides:{initial:{height:0},animate:{height:"auto"},exit:{height:0}},children:E.jsx(jH,{})},"chat-input")})})]})}function Fe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function VA(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function tp(...e){return t=>{let n=!1;const r=e.map(i=>{const a=VA(i,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<r.length;i++){const a=r[i];typeof a=="function"?a():VA(e[i],null)}}}}function Cn(...e){return v.useCallback(tp(...e),e)}var El=v.forwardRef((e,t)=>{const{children:n,...r}=e,i=v.Children.toArray(n),a=i.find(VH);if(a){const o=a.props.children,s=i.map(u=>u===a?v.Children.count(o)>1?v.Children.only(null):v.isValidElement(o)?o.props.children:null:u);return E.jsx(Xy,{...r,ref:t,children:v.isValidElement(o)?v.cloneElement(o,void 0,s):null})}return E.jsx(Xy,{...r,ref:t,children:n})});El.displayName="Slot";var Xy=v.forwardRef((e,t)=>{const{children:n,...r}=e;if(v.isValidElement(n)){const i=WH(n);return v.cloneElement(n,{...$H(r,n.props),ref:t?tp(t,i):i})}return v.Children.count(n)>1?v.Children.only(null):null});Xy.displayName="SlotClone";var zH=({children:e})=>E.jsx(E.Fragment,{children:e});function VH(e){return v.isValidElement(e)&&e.type===zH}function $H(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...s)=>{a(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function WH(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var YH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],An=YH.reduce((e,t)=>{const n=v.forwardRef((r,i)=>{const{asChild:a,...o}=r,s=a?El:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),E.jsx(s,{...o,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function $A(e,t){e&&Zo.flushSync(()=>e.dispatchEvent(t))}function WA(e){const t=e+"CollectionProvider",[n,r]=la(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:m,children:g}=p,x=yn.useRef(null),y=yn.useRef(new Map).current;return E.jsx(i,{scope:m,itemMap:y,collectionRef:x,children:g})};o.displayName=t;const s=e+"CollectionSlot",u=yn.forwardRef((p,m)=>{const{scope:g,children:x}=p,y=a(s,g),w=Cn(m,y.collectionRef);return E.jsx(El,{ref:w,children:x})});u.displayName=s;const l=e+"CollectionItemSlot",c="data-radix-collection-item",d=yn.forwardRef((p,m)=>{const{scope:g,children:x,...y}=p,w=yn.useRef(null),b=Cn(m,w),T=a(l,g);return yn.useEffect(()=>(T.itemMap.set(w,{ref:w,...y}),()=>void T.itemMap.delete(w))),E.jsx(El,{[c]:"",ref:b,children:x})});d.displayName=l;function f(p){const m=a(e+"CollectionConsumer",p);return yn.useCallback(()=>{const x=m.collectionRef.current;if(!x)return[];const y=Array.from(x.querySelectorAll(`[${c}]`));return Array.from(m.itemMap.values()).sort((T,S)=>y.indexOf(T.ref.current)-y.indexOf(S.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:o,Slot:u,ItemSlot:d},f,r]}var qH=v.createContext(void 0);function YA(e){const t=v.useContext(qH);return e||t||"ltr"}var GH="DismissableLayer",Qy="dismissableLayer.update",KH="dismissableLayer.pointerDownOutside",XH="dismissableLayer.focusOutside",qA,GA=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),KA=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...u}=e,l=v.useContext(GA),[c,d]=v.useState(null),f=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=v.useState({}),m=Cn(t,N=>d(N)),g=Array.from(l.layers),[x]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),y=g.indexOf(x),w=c?g.indexOf(c):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,T=w>=y,S=JH(N=>{const D=N.target,V=[...l.branches].some(P=>P.contains(D));!T||V||(i==null||i(N),o==null||o(N),N.defaultPrevented||s==null||s())},f),_=ez(N=>{const D=N.target;[...l.branches].some(P=>P.contains(D))||(a==null||a(N),o==null||o(N),N.defaultPrevented||s==null||s())},f);return FC(N=>{w===l.layers.size-1&&(r==null||r(N),!N.defaultPrevented&&s&&(N.preventDefault(),s()))},f),v.useEffect(()=>{if(c)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(qA=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(c)),l.layers.add(c),XA(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=qA)}},[c,f,n,l]),v.useEffect(()=>()=>{c&&(l.layers.delete(c),l.layersWithOutsidePointerEventsDisabled.delete(c),XA())},[c,l]),v.useEffect(()=>{const N=()=>p({});return document.addEventListener(Qy,N),()=>document.removeEventListener(Qy,N)},[]),E.jsx(An.div,{...u,ref:m,style:{pointerEvents:b?T?"auto":"none":void 0,...e.style},onFocusCapture:Fe(e.onFocusCapture,_.onFocusCapture),onBlurCapture:Fe(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:Fe(e.onPointerDownCapture,S.onPointerDownCapture)})});KA.displayName=GH;var QH="DismissableLayerBranch",ZH=v.forwardRef((e,t)=>{const n=v.useContext(GA),r=v.useRef(null),i=Cn(t,r);return v.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),E.jsx(An.div,{...e,ref:i})});ZH.displayName=QH;function JH(e,t=globalThis==null?void 0:globalThis.document){const n=Wt(e),r=v.useRef(!1),i=v.useRef(()=>{});return v.useEffect(()=>{const a=s=>{if(s.target&&!r.current){let u=function(){QA(KH,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function ez(e,t=globalThis==null?void 0:globalThis.document){const n=Wt(e),r=v.useRef(!1);return v.useEffect(()=>{const i=a=>{a.target&&!r.current&&QA(XH,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function XA(){const e=new CustomEvent(Qy);document.dispatchEvent(e)}function QA(e,t,n,{discrete:r}){const i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?$A(i,a):i.dispatchEvent(a)}var Zy=0;function ZA(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??JA()),document.body.insertAdjacentElement("beforeend",e[1]??JA()),Zy++,()=>{Zy===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Zy--}},[])}function JA(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Jy="focusScope.autoFocusOnMount",e1="focusScope.autoFocusOnUnmount",ek={bubbles:!1,cancelable:!0},tz="FocusScope",tk=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,u]=v.useState(null),l=Wt(i),c=Wt(a),d=v.useRef(null),f=Cn(t,g=>u(g)),p=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let g=function(b){if(p.paused||!s)return;const T=b.target;s.contains(T)?d.current=T:ha(d.current,{select:!0})},x=function(b){if(p.paused||!s)return;const T=b.relatedTarget;T!==null&&(s.contains(T)||ha(d.current,{select:!0}))},y=function(b){if(document.activeElement===document.body)for(const S of b)S.removedNodes.length>0&&ha(s)};document.addEventListener("focusin",g),document.addEventListener("focusout",x);const w=new MutationObserver(y);return s&&w.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",x),w.disconnect()}}},[r,s,p.paused]),v.useEffect(()=>{if(s){ik.add(p);const g=document.activeElement;if(!s.contains(g)){const y=new CustomEvent(Jy,ek);s.addEventListener(Jy,l),s.dispatchEvent(y),y.defaultPrevented||(nz(sz(nk(s)),{select:!0}),document.activeElement===g&&ha(s))}return()=>{s.removeEventListener(Jy,l),setTimeout(()=>{const y=new CustomEvent(e1,ek);s.addEventListener(e1,c),s.dispatchEvent(y),y.defaultPrevented||ha(g??document.body,{select:!0}),s.removeEventListener(e1,c),ik.remove(p)},0)}}},[s,l,c,p]);const m=v.useCallback(g=>{if(!n&&!r||p.paused)return;const x=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,y=document.activeElement;if(x&&y){const w=g.currentTarget,[b,T]=rz(w);b&&T?!g.shiftKey&&y===T?(g.preventDefault(),n&&ha(b,{select:!0})):g.shiftKey&&y===b&&(g.preventDefault(),n&&ha(T,{select:!0})):y===w&&g.preventDefault()}},[n,r,p.paused]);return E.jsx(An.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});tk.displayName=tz;function nz(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ha(r,{select:t}),document.activeElement!==n)return}function rz(e){const t=nk(e),n=rk(t,e),r=rk(t.reverse(),e);return[n,r]}function nk(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function rk(e,t){for(const n of e)if(!iz(n,{upTo:t}))return n}function iz(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function az(e){return e instanceof HTMLInputElement&&"select"in e}function ha(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&az(e)&&t&&e.select()}}var ik=oz();function oz(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ak(e,t),e.unshift(t)},remove(t){var n;e=ak(e,t),(n=e[0])==null||n.resume()}}}function ak(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function sz(e){return e.filter(t=>t.tagName!=="A")}var uz="Arrow",ok=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...a}=e;return E.jsx(An.svg,{...a,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:E.jsx("polygon",{points:"0,0 30,0 15,10"})})});ok.displayName=uz;var lz=ok,t1="Popper",[sk,uk]=la(t1),[cz,lk]=sk(t1),ck=e=>{const{__scopePopper:t,children:n}=e,[r,i]=v.useState(null);return E.jsx(cz,{scope:t,anchor:r,onAnchorChange:i,children:n})};ck.displayName=t1;var dk="PopperAnchor",fk=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,a=lk(dk,n),o=v.useRef(null),s=Cn(t,o);return v.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:E.jsx(An.div,{...i,ref:s})});fk.displayName=dk;var n1="PopperContent",[dz,fz]=sk(n1),pk=v.forwardRef((e,t)=>{var $e,Ve,We,Ge,_t,Te;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:a="center",alignOffset:o=0,arrowPadding:s=0,avoidCollisions:u=!0,collisionBoundary:l=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:m,...g}=e,x=lk(n1,n),[y,w]=v.useState(null),b=Cn(t,xe=>w(xe)),[T,S]=v.useState(null),_=hA(T),N=(_==null?void 0:_.width)??0,D=(_==null?void 0:_.height)??0,V=r+(a!=="center"?"-"+a:""),P=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},$=Array.isArray(l)?l:[l],H=$.length>0,X={padding:P,boundary:$.filter(hz),altBoundary:H},{refs:Y,floatingStyles:ne,placement:re,isPositioned:ee,middlewareData:F}=aA({strategy:"fixed",placement:V,whileElementsMounted:(...xe)=>tA(...xe,{animationFrame:p==="always"}),elements:{reference:x.anchor},middleware:[oA({mainAxis:i+D,alignmentAxis:o}),u&&sA({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?uA():void 0,...X}),u&&lA({...X}),cA({...X,apply:({elements:xe,rects:Ye,availableWidth:He,availableHeight:vt})=>{const{width:wt,height:Ke}=Ye.reference,Me=xe.floating.style;Me.setProperty("--radix-popper-available-width",`${He}px`),Me.setProperty("--radix-popper-available-height",`${vt}px`),Me.setProperty("--radix-popper-anchor-width",`${wt}px`),Me.setProperty("--radix-popper-anchor-height",`${Ke}px`)}}),T&&fA({element:T,padding:s}),mz({arrowWidth:N,arrowHeight:D}),f&&dA({strategy:"referenceHidden",...X})]}),[B,A]=gk(re),ae=Wt(m);ar(()=>{ee&&(ae==null||ae())},[ee,ae]);const he=($e=F.arrow)==null?void 0:$e.x,O=(Ve=F.arrow)==null?void 0:Ve.y,Pe=((We=F.arrow)==null?void 0:We.centerOffset)!==0,[ge,we]=v.useState();return ar(()=>{y&&we(window.getComputedStyle(y).zIndex)},[y]),E.jsx("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...ne,transform:ee?ne.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ge,"--radix-popper-transform-origin":[(Ge=F.transformOrigin)==null?void 0:Ge.x,(_t=F.transformOrigin)==null?void 0:_t.y].join(" "),...((Te=F.hide)==null?void 0:Te.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:E.jsx(dz,{scope:n,placedSide:B,onArrowChange:S,arrowX:he,arrowY:O,shouldHideArrow:Pe,children:E.jsx(An.div,{"data-side":B,"data-align":A,...g,ref:b,style:{...g.style,animation:ee?void 0:"none"}})})})});pk.displayName=n1;var hk="PopperArrow",pz={top:"bottom",right:"left",bottom:"top",left:"right"},mk=v.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,a=fz(hk,r),o=pz[a.placedSide];return E.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:E.jsx(lz,{...i,ref:n,style:{...i.style,display:"block"}})})});mk.displayName=hk;function hz(e){return e!==null}var mz=e=>({name:"transformOrigin",options:e,fn(t){var x,y,w;const{placement:n,rects:r,middlewareData:i}=t,o=((x=i.arrow)==null?void 0:x.centerOffset)!==0,s=o?0:e.arrowWidth,u=o?0:e.arrowHeight,[l,c]=gk(n),d={start:"0%",center:"50%",end:"100%"}[c],f=(((y=i.arrow)==null?void 0:y.x)??0)+s/2,p=(((w=i.arrow)==null?void 0:w.y)??0)+u/2;let m="",g="";return l==="bottom"?(m=o?d:`${f}px`,g=`${-u}px`):l==="top"?(m=o?d:`${f}px`,g=`${r.floating.height+u}px`):l==="right"?(m=`${-u}px`,g=o?d:`${p}px`):l==="left"&&(m=`${r.floating.width+u}px`,g=o?d:`${p}px`),{data:{x:m,y:g}}}});function gk(e){const[t,n="center"]=e.split("-");return[t,n]}var gz=ck,yz=fk,vz=pk,wz=mk;function bz(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var np=e=>{const{present:t,children:n}=e,r=xz(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),a=Cn(r.ref,Ez(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:a}):null};np.displayName="Presence";function xz(e){const[t,n]=v.useState(),r=v.useRef({}),i=v.useRef(e),a=v.useRef("none"),o=e?"mounted":"unmounted",[s,u]=bz(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=rp(r.current);a.current=s==="mounted"?l:"none"},[s]),ar(()=>{const l=r.current,c=i.current;if(c!==e){const f=a.current,p=rp(l);e?u("MOUNT"):p==="none"||(l==null?void 0:l.display)==="none"?u("UNMOUNT"):u(c&&f!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),ar(()=>{if(t){let l;const c=t.ownerDocument.defaultView??window,d=p=>{const g=rp(r.current).includes(p.animationName);if(p.target===t&&g&&(u("ANIMATION_END"),!i.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",l=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},f=p=>{p.target===t&&(a.current=rp(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{c.clearTimeout(l),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function rp(e){return(e==null?void 0:e.animationName)||"none"}function Ez(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var r1="rovingFocusGroup.onEntryFocus",Tz={bubbles:!1,cancelable:!0},ip="RovingFocusGroup",[i1,yk,_z]=WA(ip),[Sz,vk]=la(ip,[_z]),[Cz,Az]=Sz(ip),wk=v.forwardRef((e,t)=>E.jsx(i1.Provider,{scope:e.__scopeRovingFocusGroup,children:E.jsx(i1.Slot,{scope:e.__scopeRovingFocusGroup,children:E.jsx(kz,{...e,ref:t})})}));wk.displayName=ip;var kz=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:u,onEntryFocus:l,preventScrollOnEntryFocus:c=!1,...d}=e,f=v.useRef(null),p=Cn(t,f),m=YA(a),[g=null,x]=Gf({prop:o,defaultProp:s,onChange:u}),[y,w]=v.useState(!1),b=Wt(l),T=yk(n),S=v.useRef(!1),[_,N]=v.useState(0);return v.useEffect(()=>{const D=f.current;if(D)return D.addEventListener(r1,b),()=>D.removeEventListener(r1,b)},[b]),E.jsx(Cz,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:g,onItemFocus:v.useCallback(D=>x(D),[x]),onItemShiftTab:v.useCallback(()=>w(!0),[]),onFocusableItemAdd:v.useCallback(()=>N(D=>D+1),[]),onFocusableItemRemove:v.useCallback(()=>N(D=>D-1),[]),children:E.jsx(An.div,{tabIndex:y||_===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:Fe(e.onMouseDown,()=>{S.current=!0}),onFocus:Fe(e.onFocus,D=>{const V=!S.current;if(D.target===D.currentTarget&&V&&!y){const P=new CustomEvent(r1,Tz);if(D.currentTarget.dispatchEvent(P),!P.defaultPrevented){const $=T().filter(re=>re.focusable),H=$.find(re=>re.active),X=$.find(re=>re.id===g),ne=[H,X,...$].filter(Boolean).map(re=>re.ref.current);Ek(ne,c)}}S.current=!1}),onBlur:Fe(e.onBlur,()=>w(!1))})})}),bk="RovingFocusGroupItem",xk=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,...o}=e,s=yl(),u=a||s,l=Az(bk,n),c=l.currentTabStopId===u,d=yk(n),{onFocusableItemAdd:f,onFocusableItemRemove:p}=l;return v.useEffect(()=>{if(r)return f(),()=>p()},[r,f,p]),E.jsx(i1.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:E.jsx(An.span,{tabIndex:c?0:-1,"data-orientation":l.orientation,...o,ref:t,onMouseDown:Fe(e.onMouseDown,m=>{r?l.onItemFocus(u):m.preventDefault()}),onFocus:Fe(e.onFocus,()=>l.onItemFocus(u)),onKeyDown:Fe(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){l.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const g=Pz(m,l.orientation,l.dir);if(g!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let y=d().filter(w=>w.focusable).map(w=>w.ref.current);if(g==="last")y.reverse();else if(g==="prev"||g==="next"){g==="prev"&&y.reverse();const w=y.indexOf(m.currentTarget);y=l.loop?Iz(y,w+1):y.slice(w+1)}setTimeout(()=>Ek(y))}})})})});xk.displayName=bk;var Rz={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Nz(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Pz(e,t,n){const r=Nz(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Rz[r]}function Ek(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Iz(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Oz=wk,Dz=xk,Lz=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},_s=new WeakMap,ap=new WeakMap,op={},a1=0,Tk=function(e){return e&&(e.host||Tk(e.parentNode))},Mz=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Tk(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Fz=function(e,t,n,r){var i=Mz(t,Array.isArray(e)?e:[e]);op[n]||(op[n]=new WeakMap);var a=op[n],o=[],s=new Set,u=new Set(i),l=function(d){!d||s.has(d)||(s.add(d),l(d.parentNode))};i.forEach(l);var c=function(d){!d||u.has(d)||Array.prototype.forEach.call(d.children,function(f){if(s.has(f))c(f);else try{var p=f.getAttribute(r),m=p!==null&&p!=="false",g=(_s.get(f)||0)+1,x=(a.get(f)||0)+1;_s.set(f,g),a.set(f,x),o.push(f),g===1&&m&&ap.set(f,!0),x===1&&f.setAttribute(n,"true"),m||f.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",f,y)}})};return c(t),s.clear(),a1++,function(){o.forEach(function(d){var f=_s.get(d)-1,p=a.get(d)-1;_s.set(d,f),a.set(d,p),f||(ap.has(d)||d.removeAttribute(r),ap.delete(d)),p||d.removeAttribute(n)}),a1--,a1||(_s=new WeakMap,_s=new WeakMap,ap=new WeakMap,op={})}},_k=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=Lz(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),Fz(r,i,n,"aria-hidden")):function(){return null}},sp="right-scroll-bar-position",up="width-before-scroll-bar",Bz="with-scroll-bars-hidden",jz="--removed-body-scroll-bar-size";function o1(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Uz(e,t){var n=v.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var Hz=typeof window<"u"?v.useLayoutEffect:v.useEffect,Sk=new WeakMap;function zz(e,t){var n=Uz(null,function(r){return e.forEach(function(i){return o1(i,r)})});return Hz(function(){var r=Sk.get(n);if(r){var i=new Set(r),a=new Set(e),o=n.current;i.forEach(function(s){a.has(s)||o1(s,null)}),a.forEach(function(s){i.has(s)||o1(s,o)})}Sk.set(n,e)},[e]),n}function Vz(e){return e}function $z(e,t){t===void 0&&(t=Vz);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var o=t(a,r);return n.push(o),function(){n=n.filter(function(s){return s!==o})}},assignSyncMedium:function(a){for(r=!0;n.length;){var o=n;n=[],o.forEach(a)}n={push:function(s){return a(s)},filter:function(){return n}}},assignMedium:function(a){r=!0;var o=[];if(n.length){var s=n;n=[],s.forEach(a),o=n}var u=function(){var c=o;o=[],c.forEach(a)},l=function(){return Promise.resolve().then(u)};l(),n={push:function(c){o.push(c),l()},filter:function(c){return o=o.filter(c),n}}}};return i}function Ck(e){e===void 0&&(e={});var t=$z(null);return t.options=Lt({async:!0,ssr:!1},e),t}var Ak=function(e){var t=e.sideCar,n=il(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return v.createElement(r,Lt({},n))};Ak.isSideCarExport=!0;function kk(e,t){return e.useMedium(t),Ak}var Rk=Ck(),s1=function(){},lp=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:s1,onWheelCapture:s1,onTouchMoveCapture:s1}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,u=e.className,l=e.removeScrollBar,c=e.enabled,d=e.shards,f=e.sideCar,p=e.noIsolation,m=e.inert,g=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,w=e.gapMode,b=il(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=f,S=zz([n,t]),_=Lt(Lt({},b),i);return v.createElement(v.Fragment,null,c&&v.createElement(T,{sideCar:Rk,removeScrollBar:l,shards:d,noIsolation:p,inert:m,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:w}),o?v.cloneElement(v.Children.only(s),Lt(Lt({},_),{ref:S})):v.createElement(y,Lt({},_,{className:u,ref:S}),s))});lp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},lp.classNames={fullWidth:up,zeroRight:sp};var Nk=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Wz(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Nk();return t&&e.setAttribute("nonce",t),e}function Yz(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function qz(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Gz=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Wz())&&(Yz(t,n),qz(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Kz=function(){var e=Gz();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Xz=function(){var e=Kz(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},Qz={left:0,top:0,right:0,gap:0},u1=function(e){return parseInt(e||"",10)||0},Zz=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[u1(n),u1(r),u1(i)]},Jz=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Qz;var t=Zz(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},eV=Xz(),Ss="data-scroll-locked",tV=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n="margin"),`
341
+ */var vs=v;function Q7(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Z7=typeof Object.is=="function"?Object.is:Q7,J7=vs.useState,ej=vs.useEffect,tj=vs.useLayoutEffect,nj=vs.useDebugValue;function rj(e,t){var n=t(),r=J7({inst:{value:n,getSnapshot:t}}),i=r[0].inst,a=r[1];return tj(function(){i.value=n,i.getSnapshot=t,fy(i)&&a({inst:i})},[e,n,t]),ej(function(){return fy(i)&&a({inst:i}),e(function(){fy(i)&&a({inst:i})})},[e]),nj(n),n}function fy(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Z7(e,n)}catch{return!0}}function ij(e,t){return t()}var aj=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?ij:rj;xC.useSyncExternalStore=vs.useSyncExternalStore!==void 0?vs.useSyncExternalStore:aj,bC.exports=xC;var oj=bC.exports;const oa=()=>{},_n=oa(),py=Object,ze=e=>e===_n,zr=e=>typeof e=="function",sa=(e,t)=>({...e,...t}),sj=e=>zr(e.then),Pf=new WeakMap;let uj=0;const hl=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let i,a;if(py(e)===e&&!r&&n!=RegExp){if(i=Pf.get(e),i)return i;if(i=++uj+"~",Pf.set(e,i),n==Array){for(i="@",a=0;a<e.length;a++)i+=hl(e[a])+",";Pf.set(e,i)}if(n==py){i="#";const o=py.keys(e).sort();for(;!ze(a=o.pop());)ze(e[a])||(i+=a+":"+hl(e[a])+",");Pf.set(e,i)}}else i=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return i},bi=new WeakMap,hy={},If={},my="undefined",Of=typeof window!=my,gy=typeof document!=my,lj=()=>Of&&typeof window.requestAnimationFrame!=my,EC=(e,t)=>{const n=bi.get(e);return[()=>!ze(t)&&e.get(t)||hy,r=>{if(!ze(t)){const i=e.get(t);t in If||(If[t]=i),n[5](t,sa(i,r),i||hy)}},n[6],()=>!ze(t)&&t in If?If[t]:!ze(t)&&e.get(t)||hy]};let yy=!0;const cj=()=>yy,[vy,wy]=Of&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[oa,oa],dj=()=>{const e=gy&&document.visibilityState;return ze(e)||e!=="hidden"},fj=e=>(gy&&document.addEventListener("visibilitychange",e),vy("focus",e),()=>{gy&&document.removeEventListener("visibilitychange",e),wy("focus",e)}),pj=e=>{const t=()=>{yy=!0,e()},n=()=>{yy=!1};return vy("online",t),vy("offline",n),()=>{wy("online",t),wy("offline",n)}},hj={isOnline:cj,isVisible:dj},mj={initFocus:fj,initReconnect:pj},TC=!yn.useId,ml=!Of||"Deno"in window,gj=e=>lj()?window.requestAnimationFrame(e):setTimeout(e,1),by=ml?v.useEffect:v.useLayoutEffect,xy=typeof navigator<"u"&&navigator.connection,_C=!ml&&xy&&(["slow-2g","2g"].includes(xy.effectiveType)||xy.saveData),Ey=e=>{if(zr(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?hl(e):"",[e,t]};let yj=0;const Ty=()=>++yj,SC=0,CC=1,AC=2;var gl={__proto__:null,ERROR_REVALIDATE_EVENT:3,FOCUS_EVENT:SC,MUTATE_EVENT:AC,RECONNECT_EVENT:CC};async function kC(...e){const[t,n,r,i]=e,a=sa({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let o=a.populateCache;const s=a.rollbackOnError;let u=a.optimisticData;const l=f=>typeof s=="function"?s(f):s!==!1,c=a.throwOnError;if(zr(n)){const f=n,p=[],m=t.keys();for(const g of m)!/^\$(inf|sub)\$/.test(g)&&f(t.get(g)._k)&&p.push(g);return Promise.all(p.map(d))}return d(n);async function d(f){const[p]=Ey(f);if(!p)return;const[m,g]=EC(t,p),[x,y,w,b]=bi.get(t),T=()=>{const X=x[p];return(zr(a.revalidate)?a.revalidate(m().data,f):a.revalidate!==!1)&&(delete w[p],delete b[p],X&&X[0])?X[0](AC).then(()=>m().data):m().data};if(e.length<3)return T();let S=r,_;const N=Ty();y[p]=[N,0];const D=!ze(u),V=m(),P=V.data,$=V._c,H=ze($)?P:$;if(D&&(u=zr(u)?u(H,P):u,g({data:u,_c:H})),zr(S))try{S=S(H)}catch(X){_=X}if(S&&sj(S))if(S=await S.catch(X=>{_=X}),N!==y[p][0]){if(_)throw _;return S}else _&&D&&l(_)&&(o=!0,g({data:H,_c:_n}));if(o&&!_)if(zr(o)){const X=o(S,H);g({data:X,error:_n,_c:_n})}else g({data:S,error:_n,_c:_n});if(y[p][1]=Ty(),Promise.resolve(T()).then(()=>{g({_c:_n})}),_){if(c)throw _;return}return S}}const RC=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},vj=(e,t)=>{if(!bi.has(e)){const n=sa(mj,t),r={},i=kC.bind(_n,e);let a=oa;const o={},s=(c,d)=>{const f=o[c]||[];return o[c]=f,f.push(d),()=>f.splice(f.indexOf(d),1)},u=(c,d,f)=>{e.set(c,d);const p=o[c];if(p)for(const m of p)m(d,f)},l=()=>{if(!bi.has(e)&&(bi.set(e,[r,{},{},{},i,u,s]),!ml)){const c=n.initFocus(setTimeout.bind(_n,RC.bind(_n,r,SC))),d=n.initReconnect(setTimeout.bind(_n,RC.bind(_n,r,CC)));a=()=>{c&&c(),d&&d(),bi.delete(e)}}};return l(),[e,i,l,a]}return[e,bi.get(e)[4]]},wj=(e,t,n,r,i)=>{const a=n.errorRetryCount,o=i.retryCount,s=~~((Math.random()+.5)*(1<<(o<8?o:8)))*n.errorRetryInterval;!ze(a)&&o>a||setTimeout(r,s,i)},bj=(e,t)=>hl(e)==hl(t),[NC,xj]=vj(new Map),Ej=sa({onLoadingSlow:oa,onSuccess:oa,onError:oa,onErrorRetry:wj,onDiscarded:oa,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:_C?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:_C?5e3:3e3,compare:bj,isPaused:()=>!1,cache:NC,mutate:xj,fallback:{}},hj),Tj=(e,t)=>{const n=sa(e,t);if(t){const{use:r,fallback:i}=e,{use:a,fallback:o}=t;r&&a&&(n.use=r.concat(a)),i&&o&&(n.fallback=sa(i,o))}return n},_j=v.createContext({}),Sj="$inf$",PC=Of&&window.__SWR_DEVTOOLS_USE__,Cj=PC?window.__SWR_DEVTOOLS_USE__:[],Aj=()=>{PC&&(window.__SWR_DEVTOOLS_REACT__=yn)},kj=e=>zr(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],Rj=()=>sa(Ej,v.useContext(_j)),Nj=e=>(t,n,r)=>e(t,n&&((...a)=>{const[o]=Ey(t),[,,,s]=bi.get(NC);if(o.startsWith(Sj))return n(...a);const u=s[o];return ze(u)?n(...a):(delete s[o],u)}),r),Pj=Cj.concat(Nj),Ij=e=>function(...n){const r=Rj(),[i,a,o]=kj(n),s=Tj(r,o);let u=e;const{use:l}=s,c=(l||[]).concat(Pj);for(let d=c.length;d--;)u=c[d](u);return u(i,a||s.fetcher||null,s)},Oj=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const i=r.indexOf(n);i>=0&&(r[i]=r[r.length-1],r.pop())}};Aj();const IC=yn.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)}),_y={dedupe:!0},Dj=Ij((e,t,n)=>{const{cache:r,compare:i,suspense:a,fallbackData:o,revalidateOnMount:s,revalidateIfStale:u,refreshInterval:l,refreshWhenHidden:c,refreshWhenOffline:d,keepPreviousData:f}=n,[p,m,g,x]=bi.get(r),[y,w]=Ey(e),b=v.useRef(!1),T=v.useRef(!1),S=v.useRef(y),_=v.useRef(t),N=v.useRef(n),D=()=>N.current,V=()=>D().isVisible()&&D().isOnline(),[P,$,H,X]=EC(r,y),Y=v.useRef({}).current,ne=ze(o)?n.fallback[y]:o,re=(Te,xe)=>{for(const Ye in Y){const He=Ye;if(He==="data"){if(!i(Te[He],xe[He])&&(!ze(Te[He])||!i(ge,xe[He])))return!1}else if(xe[He]!==Te[He])return!1}return!0},ee=v.useMemo(()=>{const Te=!y||!t?!1:ze(s)?D().isPaused()||a?!1:ze(u)?!0:u:s,xe=Me=>{const It=sa(Me);return delete It._k,Te?{isValidating:!0,isLoading:!0,...It}:It},Ye=P(),He=X(),vt=xe(Ye),wt=Ye===He?vt:xe(He);let Ke=vt;return[()=>{const Me=xe(P());return re(Me,Ke)?(Ke.data=Me.data,Ke.isLoading=Me.isLoading,Ke.isValidating=Me.isValidating,Ke.error=Me.error,Ke):(Ke=Me,Me)},()=>wt]},[r,y]),F=oj.useSyncExternalStore(v.useCallback(Te=>H(y,(xe,Ye)=>{re(Ye,xe)||Te()}),[r,y]),ee[0],ee[1]),B=!b.current,A=p[y]&&p[y].length>0,ae=F.data,he=ze(ae)?ne:ae,O=F.error,Pe=v.useRef(he),ge=f?ze(ae)?Pe.current:ae:he,we=A&&!ze(O)?!1:B&&!ze(s)?s:D().isPaused()?!1:a?ze(he)?!1:u:ze(he)||u,$e=!!(y&&t&&B&&we),Ve=ze(F.isValidating)?$e:F.isValidating,We=ze(F.isLoading)?$e:F.isLoading,Ge=v.useCallback(async Te=>{const xe=_.current;if(!y||!xe||T.current||D().isPaused())return!1;let Ye,He,vt=!0;const wt=Te||{},Ke=!g[y]||!wt.dedupe,Me=()=>TC?!T.current&&y===S.current&&b.current:y===S.current,It={isValidating:!1,isLoading:!1},ka=()=>{$(It)},Ra=()=>{const te=g[y];te&&te[1]===He&&delete g[y]},Na={isValidating:!0};ze(P().data)&&(Na.isLoading=!0);try{if(Ke&&($(Na),n.loadingTimeout&&ze(P().data)&&setTimeout(()=>{vt&&Me()&&D().onLoadingSlow(y,n)},n.loadingTimeout),g[y]=[xe(w),Ty()]),[Ye,He]=g[y],Ye=await Ye,Ke&&setTimeout(Ra,n.dedupingInterval),!g[y]||g[y][1]!==He)return Ke&&Me()&&D().onDiscarded(y),!1;It.error=_n;const te=m[y];if(!ze(te)&&(He<=te[0]||He<=te[1]||te[1]===0))return ka(),Ke&&Me()&&D().onDiscarded(y),!1;const de=P().data;It.data=i(de,Ye)?de:Ye,Ke&&Me()&&D().onSuccess(Ye,y,n)}catch(te){Ra();const de=D(),{shouldRetryOnError:j}=de;de.isPaused()||(It.error=te,Ke&&Me()&&(de.onError(te,y,de),(j===!0||zr(j)&&j(te))&&(!D().revalidateOnFocus||!D().revalidateOnReconnect||V())&&de.onErrorRetry(te,y,de,q=>{const ce=p[y];ce&&ce[0]&&ce[0](gl.ERROR_REVALIDATE_EVENT,q)},{retryCount:(wt.retryCount||0)+1,dedupe:!0})))}return vt=!1,ka(),!0},[y,r]),_t=v.useCallback((...Te)=>kC(r,S.current,...Te),[]);if(by(()=>{_.current=t,N.current=n,ze(ae)||(Pe.current=ae)}),by(()=>{if(!y)return;const Te=Ge.bind(_n,_y);let xe=0;const He=Oj(y,p,(vt,wt={})=>{if(vt==gl.FOCUS_EVENT){const Ke=Date.now();D().revalidateOnFocus&&Ke>xe&&V()&&(xe=Ke+D().focusThrottleInterval,Te())}else if(vt==gl.RECONNECT_EVENT)D().revalidateOnReconnect&&V()&&Te();else{if(vt==gl.MUTATE_EVENT)return Ge();if(vt==gl.ERROR_REVALIDATE_EVENT)return Ge(wt)}});return T.current=!1,S.current=y,b.current=!0,$({_k:w}),we&&(ze(he)||ml?Te():gj(Te)),()=>{T.current=!0,He()}},[y]),by(()=>{let Te;function xe(){const He=zr(l)?l(P().data):l;He&&Te!==-1&&(Te=setTimeout(Ye,He))}function Ye(){!P().error&&(c||D().isVisible())&&(d||D().isOnline())?Ge(_y).then(xe):xe()}return xe(),()=>{Te&&(clearTimeout(Te),Te=-1)}},[l,c,d,y]),v.useDebugValue(ge),a&&ze(he)&&y){if(!TC&&ml)throw new Error("Fallback data is required when using suspense in SSR.");_.current=t,N.current=n,T.current=!1;const Te=x[y];if(!ze(Te)){const xe=_t(Te);IC(xe)}if(ze(O)){const xe=Ge(_y);ze(ge)||(xe.status="fulfilled",xe.value=!0),IC(xe)}else throw O}return{mutate:_t,get data(){return Y.data=!0,ge},get error(){return Y.error=!0,O},get isValidating(){return Y.isValidating=!0,Ve},get isLoading(){return Y.isLoading=!0,We}}});function Df(){const{widgetCtx:e}=zn();return Dj([e.config.token],e.api.widgetPrelude,{revalidateOnFocus:!1})}function Sy(){const{widgetCtx:e}=zn();return{routerState:fl(e.routerCtx.state),toSessionsScreen:e.routerCtx.toSessionsScreen,toChatScreen:e.routerCtx.toChatScreen}}var OC={};const Lj=bc(AF);var Lf={},DC;function Mj(){if(DC)return Lf;DC=1,Object.defineProperty(Lf,"__esModule",{value:!0});var e=v;function t(){var n=e.useRef(!1),r=e.useCallback(function(){return n.current},[]);return e.useEffect(function(){return n.current=!0,function(){n.current=!1}},[]),r}return Lf.default=t,Lf}Object.defineProperty(OC,"__esModule",{value:!0});var Cy=Lj,Ay=v,Fj=Cy.__importDefault(Mj());function Bj(e,t,n){t===void 0&&(t=[]),n===void 0&&(n={loading:!1});var r=Ay.useRef(0),i=Fj.default(),a=Ay.useState(n),o=a[0],s=a[1],u=Ay.useCallback(function(){for(var l=[],c=0;c<arguments.length;c++)l[c]=arguments[c];var d=++r.current;return o.loading||s(function(f){return Cy.__assign(Cy.__assign({},f),{loading:!0})}),e.apply(void 0,l).then(function(f){return i()&&d===r.current&&s({value:f,loading:!1}),f},function(f){return i()&&d===r.current&&s({error:f,loading:!1}),f})},t);return[o,u]}var jj=OC.default=Bj;const ua=new Map;function Uj(){const[e,t]=v.useState([]),{widgetCtx:{api:n}}=zn();function r(c){const d=c.map(f=>({file:f,id:vC(),status:"pending",progress:0}));t(f=>[...f,...d]),d.forEach(o)}function i(c,d){t(f=>f.map(p=>p.id===c?{...p,...d}:p))}function a(c){t(d=>d.filter(f=>f.id!==c))}const o=async c=>{const d=new AbortController;ua.set(c.id,d);try{t(p=>p.map(m=>m.id===c.id?{...m,status:"uploading",progress:0}:m));const f=await n.uploadFile(c,{signal:d.signal,onUploadProgress:p=>{if(!p.total)return;const m=Math.round(p.loaded*100/p.total);i(c.id,{progress:m})}});i(c.id,{status:"success",fileUrl:f.fileUrl,progress:100})}catch(f){d.signal.aborted||i(c.id,{status:"error",error:f instanceof Error?f.message:"Upload failed",progress:0})}finally{ua.delete(c.id)}},s=c=>{const d=ua.get(c);d&&(d.abort(),ua.delete(c)),a(c)},u=v.useMemo(()=>e.filter(c=>c.status==="success"&&c.fileUrl),[e]);function l(){ua.forEach(c=>c.abort()),ua.clear(),t([])}return v.useEffect(()=>()=>{ua.forEach(c=>c.abort()),ua.clear()},[]),{allFiles:e,appendFiles:r,handleCancelUpload:s,successFiles:u,emptyTheFiles:l,getFileById:c=>e.find(d=>d.id===c),getUploadProgress:c=>{var d;return((d=e.find(f=>f.id===c))==null?void 0:d.progress)??0},getUploadStatus:c=>{var d;return(d=e.find(f=>f.id===c))==null?void 0:d.status},hasErrors:e.some(c=>c.status==="error"),isUploading:e.some(c=>c.status==="uploading")}}function Sn(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function Hj(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function LC(...e){return t=>e.forEach(n=>Hj(n,t))}function Vr(...e){return v.useCallback(LC(...e),e)}function la(e,t=[]){let n=[];function r(a,o){const s=v.createContext(o),u=n.length;n=[...n,o];const l=d=>{var y;const{scope:f,children:p,...m}=d,g=((y=f==null?void 0:f[e])==null?void 0:y[u])||s,x=v.useMemo(()=>m,Object.values(m));return E.jsx(g.Provider,{value:x,children:p})};l.displayName=a+"Provider";function c(d,f){var g;const p=((g=f==null?void 0:f[e])==null?void 0:g[u])||s,m=v.useContext(p);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${a}\``)}return[l,c]}const i=()=>{const a=n.map(o=>v.createContext(o));return function(s){const u=(s==null?void 0:s[e])||a;return v.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return i.scopeName=e,[r,zj(i,...t)]}function zj(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const o=r.reduce((s,{useScope:u,scopeName:l})=>{const d=u(a)[`__scope${l}`];return{...s,...d}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var Mf=v.forwardRef((e,t)=>{const{children:n,...r}=e,i=v.Children.toArray(n),a=i.find(Vj);if(a){const o=a.props.children,s=i.map(u=>u===a?v.Children.count(o)>1?v.Children.only(null):v.isValidElement(o)?o.props.children:null:u);return E.jsx(ky,{...r,ref:t,children:v.isValidElement(o)?v.cloneElement(o,void 0,s):null})}return E.jsx(ky,{...r,ref:t,children:n})});Mf.displayName="Slot";var ky=v.forwardRef((e,t)=>{const{children:n,...r}=e;if(v.isValidElement(n)){const i=Wj(n);return v.cloneElement(n,{...$j(r,n.props),ref:t?LC(t,i):i})}return v.Children.count(n)>1?v.Children.only(null):null});ky.displayName="SlotClone";var MC=({children:e})=>E.jsx(E.Fragment,{children:e});function Vj(e){return v.isValidElement(e)&&e.type===MC}function $j(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...s)=>{a(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function Wj(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Yj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Vn=Yj.reduce((e,t)=>{const n=v.forwardRef((r,i)=>{const{asChild:a,...o}=r,s=a?Mf:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),E.jsx(s,{...o,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function qj(e,t){e&&Zo.flushSync(()=>e.dispatchEvent(t))}function Wt(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function FC(e,t=globalThis==null?void 0:globalThis.document){const n=Wt(e);v.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Gj="DismissableLayer",Ry="dismissableLayer.update",Kj="dismissableLayer.pointerDownOutside",Xj="dismissableLayer.focusOutside",BC,jC=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ny=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...u}=e,l=v.useContext(jC),[c,d]=v.useState(null),f=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=v.useState({}),m=Vr(t,N=>d(N)),g=Array.from(l.layers),[x]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),y=g.indexOf(x),w=c?g.indexOf(c):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,T=w>=y,S=Jj(N=>{const D=N.target,V=[...l.branches].some(P=>P.contains(D));!T||V||(i==null||i(N),o==null||o(N),N.defaultPrevented||s==null||s())},f),_=eU(N=>{const D=N.target;[...l.branches].some(P=>P.contains(D))||(a==null||a(N),o==null||o(N),N.defaultPrevented||s==null||s())},f);return FC(N=>{w===l.layers.size-1&&(r==null||r(N),!N.defaultPrevented&&s&&(N.preventDefault(),s()))},f),v.useEffect(()=>{if(c)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(BC=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(c)),l.layers.add(c),UC(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=BC)}},[c,f,n,l]),v.useEffect(()=>()=>{c&&(l.layers.delete(c),l.layersWithOutsidePointerEventsDisabled.delete(c),UC())},[c,l]),v.useEffect(()=>{const N=()=>p({});return document.addEventListener(Ry,N),()=>document.removeEventListener(Ry,N)},[]),E.jsx(Vn.div,{...u,ref:m,style:{pointerEvents:b?T?"auto":"none":void 0,...e.style},onFocusCapture:Sn(e.onFocusCapture,_.onFocusCapture),onBlurCapture:Sn(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:Sn(e.onPointerDownCapture,S.onPointerDownCapture)})});Ny.displayName=Gj;var Qj="DismissableLayerBranch",Zj=v.forwardRef((e,t)=>{const n=v.useContext(jC),r=v.useRef(null),i=Vr(t,r);return v.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),E.jsx(Vn.div,{...e,ref:i})});Zj.displayName=Qj;function Jj(e,t=globalThis==null?void 0:globalThis.document){const n=Wt(e),r=v.useRef(!1),i=v.useRef(()=>{});return v.useEffect(()=>{const a=s=>{if(s.target&&!r.current){let u=function(){HC(Kj,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function eU(e,t=globalThis==null?void 0:globalThis.document){const n=Wt(e),r=v.useRef(!1);return v.useEffect(()=>{const i=a=>{a.target&&!r.current&&HC(Xj,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function UC(){const e=new CustomEvent(Ry);document.dispatchEvent(e)}function HC(e,t,n,{discrete:r}){const i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?qj(i,a):i.dispatchEvent(a)}var ar=globalThis!=null&&globalThis.document?v.useLayoutEffect:()=>{},tU=bO.useId||(()=>{}),nU=0;function yl(e){const[t,n]=v.useState(tU());return ar(()=>{e||n(r=>r??String(nU++))},[e]),e||(t?`radix-${t}`:"")}const rU=["top","right","bottom","left"],ca=Math.min,$n=Math.max,Ff=Math.round,Bf=Math.floor,da=e=>({x:e,y:e}),iU={left:"right",right:"left",bottom:"top",top:"bottom"},aU={start:"end",end:"start"};function Py(e,t,n){return $n(e,ca(t,n))}function xi(e,t){return typeof e=="function"?e(t):e}function Ei(e){return e.split("-")[0]}function ws(e){return e.split("-")[1]}function Iy(e){return e==="x"?"y":"x"}function Oy(e){return e==="y"?"height":"width"}function fa(e){return["top","bottom"].includes(Ei(e))?"y":"x"}function Dy(e){return Iy(fa(e))}function oU(e,t,n){n===void 0&&(n=!1);const r=ws(e),i=Dy(e),a=Oy(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=jf(o)),[o,jf(o)]}function sU(e){const t=jf(e);return[Ly(e),t,Ly(t)]}function Ly(e){return e.replace(/start|end/g,t=>aU[t])}function uU(e,t,n){const r=["left","right"],i=["right","left"],a=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?a:o;default:return[]}}function lU(e,t,n,r){const i=ws(e);let a=uU(Ei(e),n==="start",r);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(Ly)))),a}function jf(e){return e.replace(/left|right|bottom|top/g,t=>iU[t])}function cU(e){return{top:0,right:0,bottom:0,left:0,...e}}function zC(e){return typeof e!="number"?cU(e):{top:e,right:e,bottom:e,left:e}}function Uf(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function VC(e,t,n){let{reference:r,floating:i}=e;const a=fa(t),o=Dy(t),s=Oy(o),u=Ei(t),l=a==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2;let p;switch(u){case"top":p={x:c,y:r.y-i.height};break;case"bottom":p={x:c,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(ws(t)){case"start":p[o]-=f*(n&&l?-1:1);break;case"end":p[o]+=f*(n&&l?-1:1);break}return p}const dU=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,s=a.filter(Boolean),u=await(o.isRTL==null?void 0:o.isRTL(t));let l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=VC(l,r,u),f=r,p={},m=0;for(let g=0;g<s.length;g++){const{name:x,fn:y}=s[g],{x:w,y:b,data:T,reset:S}=await y({x:c,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:o,elements:{reference:e,floating:t}});c=w??c,d=b??d,p={...p,[x]:{...p[x],...T}},S&&m<=50&&(m++,typeof S=="object"&&(S.placement&&(f=S.placement),S.rects&&(l=S.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):S.rects),{x:c,y:d}=VC(l,f,u)),g=-1)}return{x:c,y:d,placement:f,strategy:i,middlewareData:p}};async function vl(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:o,elements:s,strategy:u}=e,{boundary:l="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=xi(t,e),m=zC(p),x=s[f?d==="floating"?"reference":"floating":d],y=Uf(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(x)))==null||n?x:x.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:l,rootBoundary:c,strategy:u})),w=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,b=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),T=await(a.isElement==null?void 0:a.isElement(b))?await(a.getScale==null?void 0:a.getScale(b))||{x:1,y:1}:{x:1,y:1},S=Uf(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetParent:b,strategy:u}):w);return{top:(y.top-S.top+m.top)/T.y,bottom:(S.bottom-y.bottom+m.bottom)/T.y,left:(y.left-S.left+m.left)/T.x,right:(S.right-y.right+m.right)/T.x}}const fU=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:u}=t,{element:l,padding:c=0}=xi(e,t)||{};if(l==null)return{};const d=zC(c),f={x:n,y:r},p=Dy(i),m=Oy(p),g=await o.getDimensions(l),x=p==="y",y=x?"top":"left",w=x?"bottom":"right",b=x?"clientHeight":"clientWidth",T=a.reference[m]+a.reference[p]-f[p]-a.floating[m],S=f[p]-a.reference[p],_=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l));let N=_?_[b]:0;(!N||!await(o.isElement==null?void 0:o.isElement(_)))&&(N=s.floating[b]||a.floating[m]);const D=T/2-S/2,V=N/2-g[m]/2-1,P=ca(d[y],V),$=ca(d[w],V),H=P,X=N-g[m]-$,Y=N/2-g[m]/2+D,ne=Py(H,Y,X),re=!u.arrow&&ws(i)!=null&&Y!==ne&&a.reference[m]/2-(Y<H?P:$)-g[m]/2<0,ee=re?Y<H?Y-H:Y-X:0;return{[p]:f[p]+ee,data:{[p]:ne,centerOffset:Y-ne-ee,...re&&{alignmentOffset:ee}},reset:re}}}),pU=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:a,rects:o,initialPlacement:s,platform:u,elements:l}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...x}=xi(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const y=Ei(i),w=fa(s),b=Ei(s)===s,T=await(u.isRTL==null?void 0:u.isRTL(l.floating)),S=f||(b||!g?[jf(s)]:sU(s)),_=m!=="none";!f&&_&&S.push(...lU(s,g,m,T));const N=[s,...S],D=await vl(t,x),V=[];let P=((r=a.flip)==null?void 0:r.overflows)||[];if(c&&V.push(D[y]),d){const Y=oU(i,o,T);V.push(D[Y[0]],D[Y[1]])}if(P=[...P,{placement:i,overflows:V}],!V.every(Y=>Y<=0)){var $,H;const Y=((($=a.flip)==null?void 0:$.index)||0)+1,ne=N[Y];if(ne)return{data:{index:Y,overflows:P},reset:{placement:ne}};let re=(H=P.filter(ee=>ee.overflows[0]<=0).sort((ee,F)=>ee.overflows[1]-F.overflows[1])[0])==null?void 0:H.placement;if(!re)switch(p){case"bestFit":{var X;const ee=(X=P.filter(F=>{if(_){const B=fa(F.placement);return B===w||B==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(B=>B>0).reduce((B,A)=>B+A,0)]).sort((F,B)=>F[1]-B[1])[0])==null?void 0:X[0];ee&&(re=ee);break}case"initialPlacement":re=s;break}if(i!==re)return{reset:{placement:re}}}return{}}}};function $C(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function WC(e){return rU.some(t=>e[t]>=0)}const hU=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=xi(e,t);switch(r){case"referenceHidden":{const a=await vl(t,{...i,elementContext:"reference"}),o=$C(a,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:WC(o)}}}case"escaped":{const a=await vl(t,{...i,altBoundary:!0}),o=$C(a,n.floating);return{data:{escapedOffsets:o,escaped:WC(o)}}}default:return{}}}}};async function mU(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ei(n),s=ws(n),u=fa(n)==="y",l=["left","top"].includes(o)?-1:1,c=a&&u?-1:1,d=xi(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m=="number"&&(p=s==="end"?m*-1:m),u?{x:p*c,y:f*l}:{x:f*l,y:p*c}}const gU=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:o,middlewareData:s}=t,u=await mU(t,e);return o===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+u.x,y:a+u.y,data:{...u,placement:o}}}}},yU=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:x=>{let{x:y,y:w}=x;return{x:y,y:w}}},...u}=xi(e,t),l={x:n,y:r},c=await vl(t,u),d=fa(Ei(i)),f=Iy(d);let p=l[f],m=l[d];if(a){const x=f==="y"?"top":"left",y=f==="y"?"bottom":"right",w=p+c[x],b=p-c[y];p=Py(w,p,b)}if(o){const x=d==="y"?"top":"left",y=d==="y"?"bottom":"right",w=m+c[x],b=m-c[y];m=Py(w,m,b)}const g=s.fn({...t,[f]:p,[d]:m});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[f]:a,[d]:o}}}}}},vU=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:u=!0,crossAxis:l=!0}=xi(e,t),c={x:n,y:r},d=fa(i),f=Iy(d);let p=c[f],m=c[d];const g=xi(s,t),x=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(u){const b=f==="y"?"height":"width",T=a.reference[f]-a.floating[b]+x.mainAxis,S=a.reference[f]+a.reference[b]-x.mainAxis;p<T?p=T:p>S&&(p=S)}if(l){var y,w;const b=f==="y"?"width":"height",T=["top","left"].includes(Ei(i)),S=a.reference[d]-a.floating[b]+(T&&((y=o.offset)==null?void 0:y[d])||0)+(T?0:x.crossAxis),_=a.reference[d]+a.reference[b]+(T?0:((w=o.offset)==null?void 0:w[d])||0)-(T?x.crossAxis:0);m<S?m=S:m>_&&(m=_)}return{[f]:p,[d]:m}}}},wU=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:a,platform:o,elements:s}=t,{apply:u=()=>{},...l}=xi(e,t),c=await vl(t,l),d=Ei(i),f=ws(i),p=fa(i)==="y",{width:m,height:g}=a.floating;let x,y;d==="top"||d==="bottom"?(x=d,y=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(y=d,x=f==="end"?"top":"bottom");const w=g-c.top-c.bottom,b=m-c.left-c.right,T=ca(g-c[x],w),S=ca(m-c[y],b),_=!t.middlewareData.shift;let N=T,D=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(N=w),_&&!f){const P=$n(c.left,0),$=$n(c.right,0),H=$n(c.top,0),X=$n(c.bottom,0);p?D=m-2*(P!==0||$!==0?P+$:$n(c.left,c.right)):N=g-2*(H!==0||X!==0?H+X:$n(c.top,c.bottom))}await u({...t,availableWidth:D,availableHeight:N});const V=await o.getDimensions(s.floating);return m!==V.width||g!==V.height?{reset:{rects:!0}}:{}}}};function Hf(){return typeof window<"u"}function bs(e){return YC(e)?(e.nodeName||"").toLowerCase():"#document"}function Wn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function $r(e){var t;return(t=(YC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function YC(e){return Hf()?e instanceof Node||e instanceof Wn(e).Node:!1}function Sr(e){return Hf()?e instanceof Element||e instanceof Wn(e).Element:!1}function Wr(e){return Hf()?e instanceof HTMLElement||e instanceof Wn(e).HTMLElement:!1}function qC(e){return!Hf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Wn(e).ShadowRoot}function wl(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Cr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function bU(e){return["table","td","th"].includes(bs(e))}function zf(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function My(e){const t=Fy(),n=Sr(e)?Cr(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function xU(e){let t=pa(e);for(;Wr(t)&&!xs(t);){if(My(t))return t;if(zf(t))return null;t=pa(t)}return null}function Fy(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function xs(e){return["html","body","#document"].includes(bs(e))}function Cr(e){return Wn(e).getComputedStyle(e)}function Vf(e){return Sr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function pa(e){if(bs(e)==="html")return e;const t=e.assignedSlot||e.parentNode||qC(e)&&e.host||$r(e);return qC(t)?t.host:t}function GC(e){const t=pa(e);return xs(t)?e.ownerDocument?e.ownerDocument.body:e.body:Wr(t)&&wl(t)?t:GC(t)}function bl(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=GC(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=Wn(i);if(a){const s=By(o);return t.concat(o,o.visualViewport||[],wl(i)?i:[],s&&n?bl(s):[])}return t.concat(i,bl(i,[],n))}function By(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function KC(e){const t=Cr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Wr(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ff(n)!==a||Ff(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function jy(e){return Sr(e)?e:e.contextElement}function Es(e){const t=jy(e);if(!Wr(t))return da(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=KC(t);let o=(a?Ff(n.width):n.width)/r,s=(a?Ff(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const EU=da(0);function XC(e){const t=Wn(e);return!Fy()||!t.visualViewport?EU:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function TU(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Wn(e)?!1:t}function io(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=jy(e);let o=da(1);t&&(r?Sr(r)&&(o=Es(r)):o=Es(e));const s=TU(a,n,r)?XC(a):da(0);let u=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,c=i.width/o.x,d=i.height/o.y;if(a){const f=Wn(a),p=r&&Sr(r)?Wn(r):r;let m=f,g=By(m);for(;g&&r&&p!==m;){const x=Es(g),y=g.getBoundingClientRect(),w=Cr(g),b=y.left+(g.clientLeft+parseFloat(w.paddingLeft))*x.x,T=y.top+(g.clientTop+parseFloat(w.paddingTop))*x.y;u*=x.x,l*=x.y,c*=x.x,d*=x.y,u+=b,l+=T,m=Wn(g),g=By(m)}}return Uf({width:c,height:d,x:u,y:l})}function _U(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",o=$r(r),s=t?zf(t.floating):!1;if(r===o||s&&a)return n;let u={scrollLeft:0,scrollTop:0},l=da(1);const c=da(0),d=Wr(r);if((d||!d&&!a)&&((bs(r)!=="body"||wl(o))&&(u=Vf(r)),Wr(r))){const f=io(r);l=Es(r),c.x=f.x+r.clientLeft,c.y=f.y+r.clientTop}return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-u.scrollLeft*l.x+c.x,y:n.y*l.y-u.scrollTop*l.y+c.y}}function SU(e){return Array.from(e.getClientRects())}function Uy(e,t){const n=Vf(e).scrollLeft;return t?t.left+n:io($r(e)).left+n}function CU(e){const t=$r(e),n=Vf(e),r=e.ownerDocument.body,i=$n(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=$n(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Uy(e);const s=-n.scrollTop;return Cr(r).direction==="rtl"&&(o+=$n(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function AU(e,t){const n=Wn(e),r=$r(e),i=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,s=0,u=0;if(i){a=i.width,o=i.height;const l=Fy();(!l||l&&t==="fixed")&&(s=i.offsetLeft,u=i.offsetTop)}return{width:a,height:o,x:s,y:u}}function kU(e,t){const n=io(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Wr(e)?Es(e):da(1),o=e.clientWidth*a.x,s=e.clientHeight*a.y,u=i*a.x,l=r*a.y;return{width:o,height:s,x:u,y:l}}function QC(e,t,n){let r;if(t==="viewport")r=AU(e,n);else if(t==="document")r=CU($r(e));else if(Sr(t))r=kU(t,n);else{const i=XC(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return Uf(r)}function ZC(e,t){const n=pa(e);return n===t||!Sr(n)||xs(n)?!1:Cr(n).position==="fixed"||ZC(n,t)}function RU(e,t){const n=t.get(e);if(n)return n;let r=bl(e,[],!1).filter(s=>Sr(s)&&bs(s)!=="body"),i=null;const a=Cr(e).position==="fixed";let o=a?pa(e):e;for(;Sr(o)&&!xs(o);){const s=Cr(o),u=My(o);!u&&s.position==="fixed"&&(i=null),(a?!u&&!i:!u&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||wl(o)&&!u&&ZC(e,o))?r=r.filter(c=>c!==o):i=s,o=pa(o)}return t.set(e,r),r}function NU(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?zf(t)?[]:RU(t,this._c):[].concat(n),r],s=o[0],u=o.reduce((l,c)=>{const d=QC(t,c,i);return l.top=$n(d.top,l.top),l.right=ca(d.right,l.right),l.bottom=ca(d.bottom,l.bottom),l.left=$n(d.left,l.left),l},QC(t,s,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function PU(e){const{width:t,height:n}=KC(e);return{width:t,height:n}}function IU(e,t,n){const r=Wr(t),i=$r(t),a=n==="fixed",o=io(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const u=da(0);if(r||!r&&!a)if((bs(t)!=="body"||wl(i))&&(s=Vf(t)),r){const p=io(t,!0,a,t);u.x=p.x+t.clientLeft,u.y=p.y+t.clientTop}else i&&(u.x=Uy(i));let l=0,c=0;if(i&&!r&&!a){const p=i.getBoundingClientRect();c=p.top+s.scrollTop,l=p.left+s.scrollLeft-Uy(i,p)}const d=o.left+s.scrollLeft-u.x-l,f=o.top+s.scrollTop-u.y-c;return{x:d,y:f,width:o.width,height:o.height}}function Hy(e){return Cr(e).position==="static"}function JC(e,t){if(!Wr(e)||Cr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return $r(e)===n&&(n=n.ownerDocument.body),n}function eA(e,t){const n=Wn(e);if(zf(e))return n;if(!Wr(e)){let i=pa(e);for(;i&&!xs(i);){if(Sr(i)&&!Hy(i))return i;i=pa(i)}return n}let r=JC(e,t);for(;r&&bU(r)&&Hy(r);)r=JC(r,t);return r&&xs(r)&&Hy(r)&&!My(r)?n:r||xU(e)||n}const OU=async function(e){const t=this.getOffsetParent||eA,n=this.getDimensions,r=await n(e.floating);return{reference:IU(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function DU(e){return Cr(e).direction==="rtl"}const LU={convertOffsetParentRelativeRectToViewportRelativeRect:_U,getDocumentElement:$r,getClippingRect:NU,getOffsetParent:eA,getElementRects:OU,getClientRects:SU,getDimensions:PU,getScale:Es,isElement:Sr,isRTL:DU};function MU(e,t){let n=null,r;const i=$r(e);function a(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function o(s,u){s===void 0&&(s=!1),u===void 0&&(u=1),a();const{left:l,top:c,width:d,height:f}=e.getBoundingClientRect();if(s||t(),!d||!f)return;const p=Bf(c),m=Bf(i.clientWidth-(l+d)),g=Bf(i.clientHeight-(c+f)),x=Bf(l),w={rootMargin:-p+"px "+-m+"px "+-g+"px "+-x+"px",threshold:$n(0,ca(1,u))||1};let b=!0;function T(S){const _=S[0].intersectionRatio;if(_!==u){if(!b)return o();_?o(!1,_):r=setTimeout(()=>{o(!1,1e-7)},1e3)}b=!1}try{n=new IntersectionObserver(T,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(T,w)}n.observe(e)}return o(!0),a}function tA(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,l=jy(e),c=i||a?[...l?bl(l):[],...bl(t)]:[];c.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),a&&y.addEventListener("resize",n)});const d=l&&s?MU(l,n):null;let f=-1,p=null;o&&(p=new ResizeObserver(y=>{let[w]=y;w&&w.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(t)})),n()}),l&&!u&&p.observe(l),p.observe(t));let m,g=u?io(e):null;u&&x();function x(){const y=io(e);g&&(y.x!==g.x||y.y!==g.y||y.width!==g.width||y.height!==g.height)&&n(),g=y,m=requestAnimationFrame(x)}return n(),()=>{var y;c.forEach(w=>{i&&w.removeEventListener("scroll",n),a&&w.removeEventListener("resize",n)}),d==null||d(),(y=p)==null||y.disconnect(),p=null,u&&cancelAnimationFrame(m)}}const FU=gU,BU=yU,jU=pU,UU=wU,HU=hU,nA=fU,zU=vU,VU=(e,t,n)=>{const r=new Map,i={platform:LU,...n},a={...i.platform,_c:r};return dU(e,t,{...i,platform:a})};var $f=typeof document<"u"?v.useLayoutEffect:v.useEffect;function Wf(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Wf(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const a=i[r];if(!(a==="_owner"&&e.$$typeof)&&!Wf(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function rA(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function iA(e,t){const n=rA(e);return Math.round(t*n)/n}function zy(e){const t=v.useRef(e);return $f(()=>{t.current=e}),t}function aA(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:u,open:l}=e,[c,d]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=v.useState(r);Wf(f,r)||p(r);const[m,g]=v.useState(null),[x,y]=v.useState(null),w=v.useCallback(F=>{F!==_.current&&(_.current=F,g(F))},[]),b=v.useCallback(F=>{F!==N.current&&(N.current=F,y(F))},[]),T=a||m,S=o||x,_=v.useRef(null),N=v.useRef(null),D=v.useRef(c),V=u!=null,P=zy(u),$=zy(i),H=zy(l),X=v.useCallback(()=>{if(!_.current||!N.current)return;const F={placement:t,strategy:n,middleware:f};$.current&&(F.platform=$.current),VU(_.current,N.current,F).then(B=>{const A={...B,isPositioned:H.current!==!1};Y.current&&!Wf(D.current,A)&&(D.current=A,Zo.flushSync(()=>{d(A)}))})},[f,t,n,$,H]);$f(()=>{l===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,d(F=>({...F,isPositioned:!1})))},[l]);const Y=v.useRef(!1);$f(()=>(Y.current=!0,()=>{Y.current=!1}),[]),$f(()=>{if(T&&(_.current=T),S&&(N.current=S),T&&S){if(P.current)return P.current(T,S,X);X()}},[T,S,X,P,V]);const ne=v.useMemo(()=>({reference:_,floating:N,setReference:w,setFloating:b}),[w,b]),re=v.useMemo(()=>({reference:T,floating:S}),[T,S]),ee=v.useMemo(()=>{const F={position:n,left:0,top:0};if(!re.floating)return F;const B=iA(re.floating,c.x),A=iA(re.floating,c.y);return s?{...F,transform:"translate("+B+"px, "+A+"px)",...rA(re.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:B,top:A}},[n,s,re.floating,c.x,c.y]);return v.useMemo(()=>({...c,update:X,refs:ne,elements:re,floatingStyles:ee}),[c,X,ne,re,ee])}const $U=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?nA({element:r.current,padding:i}).fn(n):{}:r?nA({element:r,padding:i}).fn(n):{}}}},oA=(e,t)=>({...FU(e),options:[e,t]}),sA=(e,t)=>({...BU(e),options:[e,t]}),uA=(e,t)=>({...zU(e),options:[e,t]}),lA=(e,t)=>({...jU(e),options:[e,t]}),cA=(e,t)=>({...UU(e),options:[e,t]}),dA=(e,t)=>({...HU(e),options:[e,t]}),fA=(e,t)=>({...$U(e),options:[e,t]});var WU="Arrow",pA=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...a}=e;return E.jsx(Vn.svg,{...a,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:E.jsx("polygon",{points:"0,0 30,0 15,10"})})});pA.displayName=WU;var YU=pA;function qU(e,t=[]){let n=[];function r(a,o){const s=v.createContext(o),u=n.length;n=[...n,o];function l(d){const{scope:f,children:p,...m}=d,g=(f==null?void 0:f[e][u])||s,x=v.useMemo(()=>m,Object.values(m));return E.jsx(g.Provider,{value:x,children:p})}function c(d,f){const p=(f==null?void 0:f[e][u])||s,m=v.useContext(p);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${a}\``)}return l.displayName=a+"Provider",[l,c]}const i=()=>{const a=n.map(o=>v.createContext(o));return function(s){const u=(s==null?void 0:s[e])||a;return v.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return i.scopeName=e,[r,GU(i,...t)]}function GU(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const o=r.reduce((s,{useScope:u,scopeName:l})=>{const d=u(a)[`__scope${l}`];return{...s,...d}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function hA(e){const[t,n]=v.useState(void 0);return ar(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const a=i[0];let o,s;if("borderBoxSize"in a){const u=a.borderBoxSize,l=Array.isArray(u)?u[0]:u;o=l.inlineSize,s=l.blockSize}else o=e.offsetWidth,s=e.offsetHeight;n({width:o,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Vy="Popper",[mA,Yf]=qU(Vy),[KU,gA]=mA(Vy),yA=e=>{const{__scopePopper:t,children:n}=e,[r,i]=v.useState(null);return E.jsx(KU,{scope:t,anchor:r,onAnchorChange:i,children:n})};yA.displayName=Vy;var vA="PopperAnchor",wA=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,a=gA(vA,n),o=v.useRef(null),s=Vr(t,o);return v.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:E.jsx(Vn.div,{...i,ref:s})});wA.displayName=vA;var $y="PopperContent",[XU,QU]=mA($y),bA=v.forwardRef((e,t)=>{var $e,Ve,We,Ge,_t,Te;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:a="center",alignOffset:o=0,arrowPadding:s=0,avoidCollisions:u=!0,collisionBoundary:l=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:m,...g}=e,x=gA($y,n),[y,w]=v.useState(null),b=Vr(t,xe=>w(xe)),[T,S]=v.useState(null),_=hA(T),N=(_==null?void 0:_.width)??0,D=(_==null?void 0:_.height)??0,V=r+(a!=="center"?"-"+a:""),P=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},$=Array.isArray(l)?l:[l],H=$.length>0,X={padding:P,boundary:$.filter(JU),altBoundary:H},{refs:Y,floatingStyles:ne,placement:re,isPositioned:ee,middlewareData:F}=aA({strategy:"fixed",placement:V,whileElementsMounted:(...xe)=>tA(...xe,{animationFrame:p==="always"}),elements:{reference:x.anchor},middleware:[oA({mainAxis:i+D,alignmentAxis:o}),u&&sA({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?uA():void 0,...X}),u&&lA({...X}),cA({...X,apply:({elements:xe,rects:Ye,availableWidth:He,availableHeight:vt})=>{const{width:wt,height:Ke}=Ye.reference,Me=xe.floating.style;Me.setProperty("--radix-popper-available-width",`${He}px`),Me.setProperty("--radix-popper-available-height",`${vt}px`),Me.setProperty("--radix-popper-anchor-width",`${wt}px`),Me.setProperty("--radix-popper-anchor-height",`${Ke}px`)}}),T&&fA({element:T,padding:s}),eH({arrowWidth:N,arrowHeight:D}),f&&dA({strategy:"referenceHidden",...X})]}),[B,A]=TA(re),ae=Wt(m);ar(()=>{ee&&(ae==null||ae())},[ee,ae]);const he=($e=F.arrow)==null?void 0:$e.x,O=(Ve=F.arrow)==null?void 0:Ve.y,Pe=((We=F.arrow)==null?void 0:We.centerOffset)!==0,[ge,we]=v.useState();return ar(()=>{y&&we(window.getComputedStyle(y).zIndex)},[y]),E.jsx("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...ne,transform:ee?ne.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ge,"--radix-popper-transform-origin":[(Ge=F.transformOrigin)==null?void 0:Ge.x,(_t=F.transformOrigin)==null?void 0:_t.y].join(" "),...((Te=F.hide)==null?void 0:Te.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:E.jsx(XU,{scope:n,placedSide:B,onArrowChange:S,arrowX:he,arrowY:O,shouldHideArrow:Pe,children:E.jsx(Vn.div,{"data-side":B,"data-align":A,...g,ref:b,style:{...g.style,animation:ee?void 0:"none"}})})})});bA.displayName=$y;var xA="PopperArrow",ZU={top:"bottom",right:"left",bottom:"top",left:"right"},EA=v.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,a=QU(xA,r),o=ZU[a.placedSide];return E.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:E.jsx(YU,{...i,ref:n,style:{...i.style,display:"block"}})})});EA.displayName=xA;function JU(e){return e!==null}var eH=e=>({name:"transformOrigin",options:e,fn(t){var x,y,w;const{placement:n,rects:r,middlewareData:i}=t,o=((x=i.arrow)==null?void 0:x.centerOffset)!==0,s=o?0:e.arrowWidth,u=o?0:e.arrowHeight,[l,c]=TA(n),d={start:"0%",center:"50%",end:"100%"}[c],f=(((y=i.arrow)==null?void 0:y.x)??0)+s/2,p=(((w=i.arrow)==null?void 0:w.y)??0)+u/2;let m="",g="";return l==="bottom"?(m=o?d:`${f}px`,g=`${-u}px`):l==="top"?(m=o?d:`${f}px`,g=`${r.floating.height+u}px`):l==="right"?(m=`${-u}px`,g=o?d:`${p}px`):l==="left"&&(m=`${r.floating.width+u}px`,g=o?d:`${p}px`),{data:{x:m,y:g}}}});function TA(e){const[t,n="center"]=e.split("-");return[t,n]}var _A=yA,Wy=wA,SA=bA,CA=EA;function tH(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var Yy=e=>{const{present:t,children:n}=e,r=nH(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),a=Vr(r.ref,rH(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:a}):null};Yy.displayName="Presence";function nH(e){const[t,n]=v.useState(),r=v.useRef({}),i=v.useRef(e),a=v.useRef("none"),o=e?"mounted":"unmounted",[s,u]=tH(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=qf(r.current);a.current=s==="mounted"?l:"none"},[s]),ar(()=>{const l=r.current,c=i.current;if(c!==e){const f=a.current,p=qf(l);e?u("MOUNT"):p==="none"||(l==null?void 0:l.display)==="none"?u("UNMOUNT"):u(c&&f!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),ar(()=>{if(t){let l;const c=t.ownerDocument.defaultView??window,d=p=>{const g=qf(r.current).includes(p.animationName);if(p.target===t&&g&&(u("ANIMATION_END"),!i.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",l=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},f=p=>{p.target===t&&(a.current=qf(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{c.clearTimeout(l),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function qf(e){return(e==null?void 0:e.animationName)||"none"}function rH(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Gf({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=iH({defaultProp:t,onChange:n}),a=e!==void 0,o=a?e:r,s=Wt(n),u=v.useCallback(l=>{if(a){const d=typeof l=="function"?l(e):l;d!==e&&s(d)}else i(l)},[a,e,i,s]);return[o,u]}function iH({defaultProp:e,onChange:t}){const n=v.useState(e),[r]=n,i=v.useRef(r),a=Wt(t);return v.useEffect(()=>{i.current!==r&&(a(r),i.current=r)},[r,i,a]),n}var aH="VisuallyHidden",AA=v.forwardRef((e,t)=>E.jsx(Vn.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));AA.displayName=aH;var oH=AA,[Kf,Die]=la("Tooltip",[Yf]),Xf=Yf(),kA="TooltipProvider",sH=700,qy="tooltip.open",[uH,Gy]=Kf(kA),RA=e=>{const{__scopeTooltip:t,delayDuration:n=sH,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,[o,s]=v.useState(!0),u=v.useRef(!1),l=v.useRef(0);return v.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),E.jsx(uH,{scope:t,isOpenDelayed:o,delayDuration:n,onOpen:v.useCallback(()=>{window.clearTimeout(l.current),s(!1)},[]),onClose:v.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s(!0),r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:v.useCallback(c=>{u.current=c},[]),disableHoverableContent:i,children:a})};RA.displayName=kA;var Qf="Tooltip",[lH,Zf]=Kf(Qf),NA=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,u=Gy(Qf,e.__scopeTooltip),l=Xf(t),[c,d]=v.useState(null),f=yl(),p=v.useRef(0),m=o??u.disableHoverableContent,g=s??u.delayDuration,x=v.useRef(!1),[y=!1,w]=Gf({prop:r,defaultProp:i,onChange:N=>{N?(u.onOpen(),document.dispatchEvent(new CustomEvent(qy))):u.onClose(),a==null||a(N)}}),b=v.useMemo(()=>y?x.current?"delayed-open":"instant-open":"closed",[y]),T=v.useCallback(()=>{window.clearTimeout(p.current),x.current=!1,w(!0)},[w]),S=v.useCallback(()=>{window.clearTimeout(p.current),w(!1)},[w]),_=v.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{x.current=!0,w(!0)},g)},[g,w]);return v.useEffect(()=>()=>window.clearTimeout(p.current),[]),E.jsx(_A,{...l,children:E.jsx(lH,{scope:t,contentId:f,open:y,stateAttribute:b,trigger:c,onTriggerChange:d,onTriggerEnter:v.useCallback(()=>{u.isOpenDelayed?_():T()},[u.isOpenDelayed,_,T]),onTriggerLeave:v.useCallback(()=>{m?S():window.clearTimeout(p.current)},[S,m]),onOpen:T,onClose:S,disableHoverableContent:m,children:n})})};NA.displayName=Qf;var Ky="TooltipTrigger",PA=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Zf(Ky,n),a=Gy(Ky,n),o=Xf(n),s=v.useRef(null),u=Vr(t,s,i.onTriggerChange),l=v.useRef(!1),c=v.useRef(!1),d=v.useCallback(()=>l.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),E.jsx(Wy,{asChild:!0,...o,children:E.jsx(Vn.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:u,onPointerMove:Sn(e.onPointerMove,f=>{f.pointerType!=="touch"&&!c.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),c.current=!0)}),onPointerLeave:Sn(e.onPointerLeave,()=>{i.onTriggerLeave(),c.current=!1}),onPointerDown:Sn(e.onPointerDown,()=>{l.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Sn(e.onFocus,()=>{l.current||i.onOpen()}),onBlur:Sn(e.onBlur,i.onClose),onClick:Sn(e.onClick,i.onClose)})})});PA.displayName=Ky;var cH="TooltipPortal",[Lie,dH]=Kf(cH,{forceMount:void 0}),Ts="TooltipContent",IA=v.forwardRef((e,t)=>{const n=dH(Ts,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...a}=e,o=Zf(Ts,e.__scopeTooltip);return E.jsx(Yy,{present:r||o.open,children:o.disableHoverableContent?E.jsx(OA,{side:i,...a,ref:t}):E.jsx(fH,{side:i,...a,ref:t})})}),fH=v.forwardRef((e,t)=>{const n=Zf(Ts,e.__scopeTooltip),r=Gy(Ts,e.__scopeTooltip),i=v.useRef(null),a=Vr(t,i),[o,s]=v.useState(null),{trigger:u,onClose:l}=n,c=i.current,{onPointerInTransitChange:d}=r,f=v.useCallback(()=>{s(null),d(!1)},[d]),p=v.useCallback((m,g)=>{const x=m.currentTarget,y={x:m.clientX,y:m.clientY},w=gH(y,x.getBoundingClientRect()),b=yH(y,w),T=vH(g.getBoundingClientRect()),S=bH([...b,...T]);s(S),d(!0)},[d]);return v.useEffect(()=>()=>f(),[f]),v.useEffect(()=>{if(u&&c){const m=x=>p(x,c),g=x=>p(x,u);return u.addEventListener("pointerleave",m),c.addEventListener("pointerleave",g),()=>{u.removeEventListener("pointerleave",m),c.removeEventListener("pointerleave",g)}}},[u,c,p,f]),v.useEffect(()=>{if(o){const m=g=>{const x=g.target,y={x:g.clientX,y:g.clientY},w=(u==null?void 0:u.contains(x))||(c==null?void 0:c.contains(x)),b=!wH(y,o);w?f():b&&(f(),l())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[u,c,o,l,f]),E.jsx(OA,{...e,ref:a})}),[pH,hH]=Kf(Qf,{isInside:!1}),OA=v.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,u=Zf(Ts,n),l=Xf(n),{onClose:c}=u;return v.useEffect(()=>(document.addEventListener(qy,c),()=>document.removeEventListener(qy,c)),[c]),v.useEffect(()=>{if(u.trigger){const d=f=>{const p=f.target;p!=null&&p.contains(u.trigger)&&c()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[u.trigger,c]),E.jsx(Ny,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:c,children:E.jsxs(SA,{"data-state":u.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[E.jsx(MC,{children:r}),E.jsx(pH,{scope:n,isInside:!0,children:E.jsx(oH,{id:u.contentId,role:"tooltip",children:i||r})})]})})});IA.displayName=Ts;var DA="TooltipArrow",mH=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Xf(n);return hH(DA,n).isInside?null:E.jsx(CA,{...i,...r,ref:t})});mH.displayName=DA;function gH(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function yH(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function vH(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function wH(e,t){const{x:n,y:r}=e;let i=!1;for(let a=0,o=t.length-1;a<t.length;o=a++){const s=t[a].x,u=t[a].y,l=t[o].x,c=t[o].y;u>r!=c>r&&n<(l-s)*(r-u)/(c-u)+s&&(i=!i)}return i}function bH(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),xH(t)}function xH(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const a=t[t.length-1],o=t[t.length-2];if((a.x-o.x)*(i.y-o.y)>=(a.y-o.y)*(i.x-o.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const a=n[n.length-1],o=n[n.length-2];if((a.x-o.x)*(i.y-o.y)>=(a.y-o.y)*(i.x-o.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var EH=RA,TH=NA,_H=PA,LA=IA;const SH=EH,CH=TH,AH=_H,MA=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>E.jsx(LA,{ref:r,sideOffset:t,className:Le("z-50 overflow-hidden max-w-xs rounded-xl bg-primary border text-primary-foreground p-2 text-center align-middle text-xs shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));MA.displayName=LA.displayName;function Xy({children:e,content:t,side:n,align:r}){return E.jsxs(CH,{children:[E.jsx(AH,{asChild:!0,children:e}),E.jsx(MA,{side:n,align:r,collisionPadding:8,avoidCollisions:!0,children:t})]})}const FA={en:{ok:"OK",yes:"Yes",no:"No",agree:"Agree",cancel:"Cancel","yes-exit":"Yes, exit","yes-reset":"Yes, reset","no-cancel":"No, cancel","are-you-sure":"Are you sure?",recording:"Recording...","thank-you":"Thank you","sorry-try-again":"Sorry, please try again","error-occurred":"An error occurred","please-try-again":"Please try again","write-a-message":"Write a message...","send-message":"Send message",connected:"Connected",connecting:"Connecting",reconnecting:"Reconnecting",reconnected:"Reconnected",disconnecting:"Disconnecting",disconnected:"Disconnected",error:"Error","persist-session":"Persist session",settings:"Settings",close:"Close",help:"Help",chat:"Chat",send:"Send",copy:"Copy",copied:"Copied","sound-effects":"Sound effects",language:"Language",select:"Select",agent:"Agent",user:"User",bot:"Bot","close-widget":"Close widget","got-any-questions":"Got any questions? Chat with us!","typical-response-time":"Typically respond in less than 1 minute","session-closed-lead":"Your issue has been resolved!","create-new-ticket":"Create new ticket",exit:"Exit","reset-conversation":"Reset conversation","new-conversation":"New conversation","welcome-title":"Welcome to our support chat","welcome-description":"We're here to help! Start a conversation and we'll get back to you as soon as possible.","your-name":"Your name","your-email":"Your email address","start-chat":"Talk to support","starting-chat":"Connecting...","hello-greeting":"Hi there!"},ar:{ok:"حسنا",yes:"نعم",no:"لا",agree:"موافق",cancel:"إلغاء","yes-exit":"نعم، اخرج","yes-reset":"نعم، إعادة تعيين","no-cancel":"لا، إلغاء","are-you-sure":"هل أنت متأكد؟",recording:"تسجيل","thank-you":"شكرا","sorry-try-again":"عذرا، حاول مرة أخرى","error-occurred":"حدث خطأ","please-try-again":"يرجى المحاولة مرة أخرى","write-a-message":"اكتب رسالة...","send-message":"إرسال رسالة",connected:"متصل",connecting:"جاري الاتصال",reconnecting:"جاري إعادة الاتصال",reconnected:"تم إعادة الاتصال",disconnecting:"جاري قطع الاتصال",disconnected:"قطع الاتصال",error:"خطأ","persist-session":"حفظ الجلسة",settings:"إعدادات",close:"إغلاق",help:"مساعدة",chat:"محادثة",send:"إرسال",copy:"نسخ",copied:"تم النسخ","sound-effects":"التاثيرات الصوتية",language:"اللغة",select:"اختر",agent:"الوكيل",user:"المستخدم",bot:"البوت","close-widget":"إغلاق الودجة","got-any-questions":"هل لديك أي أسئلة؟ تحدث معنا!","typical-response-time":"عادة ما نرد في أقل من دقيقة واحدة","session-closed-lead":"تم حل مشكلتك!",exit:"خروج","create-new-ticket":"إنشاء تذكرة جديدة","reset-conversation":"إعادة تعيين المحادثة","new-conversation":"محادثة جديدة","welcome-title":"مرحبًا بك في دردشة الدعم الخاصة بنا","welcome-description":"نحن هنا للمساعدة! ابدأ محادثة وسنرد عليك في أقرب وقت ممكن.","your-name":"اسمك","your-email":"عنوان بريدك الإلكتروني","start-chat":"تحدث إلى الدعم","starting-chat":"جاري الاتصال...","hello-greeting":"مرحبًا! كيف يمكننا مساعدتك اليوم؟"},nl:{ok:"OK",yes:"Ja",no:"Nee",agree:"Akkoord",cancel:"Annuleren","yes-exit":"Ja, afsluiten","yes-reset":"Ja, resetten","no-cancel":"Nee, annuleren","are-you-sure":"Weet u het zeker?",recording:"Opname...","thank-you":"Dank u","sorry-try-again":"Sorry, probeer het opnieuw","error-occurred":"Er is een fout opgetreden","please-try-again":"Probeer het opnieuw","write-a-message":"Schrijf een bericht...","send-message":"Bericht verzenden",connected:"Verbonden",connecting:"Verbinding maken",reconnecting:"Opnieuw verbinding maken",reconnected:"Opnieuw verbonden",disconnecting:"Verbinding verbreken",disconnected:"Verbinding verbroken",error:"Fout","persist-session":"Sessie behouden",settings:"Instellingen",close:"Sluiten",help:"Help",chat:"Chat",send:"Verzenden",copy:"Kopiëren",copied:"Gekopieerd","sound-effects":"Geluidseffecten",language:"Taal",select:"Selecteren",agent:"Agent",user:"Gebruiker",bot:"Bot","close-widget":"Widget sluiten","got-any-questions":"Heeft u vragen? Chat met ons!","typical-response-time":"We reageren doorgaans binnen 1 minuut","session-closed-lead":"Uw probleem is opgelost!","create-new-ticket":"Nieuw ticket aanmaken",exit:"Afsluiten","reset-conversation":"Gesprek resetten","new-conversation":"Nieuw gesprek","welcome-title":"Welkom bij onze supportchat","welcome-description":"We zijn hier om te helpen! Begin een gesprek en we nemen zo snel mogelijk contact met u op.","your-name":"Uw naam","your-email":"Uw e-mailadres","start-chat":"Praat met ondersteuning","starting-chat":"Verbinding maken...","hello-greeting":"Hallo! Hoe kunnen we u vandaag helpen?"},fr:{ok:"D'accord",yes:"Oui",no:"Non",agree:"Accepter",cancel:"Annuler","yes-exit":"Oui, quitter","yes-reset":"Oui, réinitialiser","no-cancel":"Non, annuler","are-you-sure":"Êtes-vous sûr ?",recording:"Enregistrement...","thank-you":"Merci","sorry-try-again":"Désolé, veuillez réessayer","error-occurred":"Une erreur s'est produite","please-try-again":"Veuillez réessayer","write-a-message":"Écrivez un message...","send-message":"Envoyer le message",connected:"Connecté",connecting:"Connexion en cours",reconnecting:"Reconnexion en cours",reconnected:"Reconnecté",disconnecting:"Déconnexion en cours",disconnected:"Déconnecté",error:"Erreur","persist-session":"Conserver la session",settings:"Paramètres",close:"Fermer",help:"Aide",chat:"Chat",send:"Envoyer",copy:"Copier",copied:"Copié","sound-effects":"Effets sonores",language:"Langue",select:"Sélectionner",agent:"Agent",user:"Utilisateur",bot:"Bot","close-widget":"Fermer le widget","got-any-questions":"Vous avez des questions ? Chattez avec nous !","typical-response-time":"Nous répondons généralement en moins d'une minute","session-closed-lead":"Votre problème a été résolu !","create-new-ticket":"Créer un nouveau ticket",exit:"Sortie","reset-conversation":"Réinitialiser la conversation","new-conversation":"Nouvelle conversation","welcome-title":"Bienvenue dans notre chat de support","welcome-description":"Nous sommes là pour vous aider ! Commencez une conversation et nous vous répondrons dès que possible.","your-name":"Votre nom","your-email":"Votre adresse e-mail","start-chat":"Parler au support","starting-chat":"Connexion...","hello-greeting":"Bonjour ! Comment pouvons-nous vous aider aujourd'hui ?"},de:{ok:"OK",yes:"Ja",no:"Nein",agree:"Zustimmen",cancel:"Stornieren","yes-exit":"Ja, beenden","yes-reset":"Ja, zurücksetzen","no-cancel":"Nein, abbrechen","are-you-sure":"Sind Sie sicher?",recording:"Aufnahme läuft","thank-you":"Vielen Dank","sorry-try-again":"Entschuldigung, bitte versuchen Sie es erneut","error-occurred":"Ein Fehler ist aufgetreten","please-try-again":"Bitte versuchen Sie es erneut","write-a-message":"Nachricht schreiben...","send-message":"Nachricht senden",connected:"Verbunden",connecting:"Verbindung wird hergestellt",reconnecting:"Verbindung wird wiederhergestellt",reconnected:"Wieder verbunden",disconnecting:"Verbindung wird getrennt",disconnected:"Verbindung getrennt",error:"Fehler","persist-session":"Sitzung beibehalten",settings:"Einstellungen",close:"Schließen",help:"Hilfe",chat:"Chat",send:"Senden",copy:"Kopieren",copied:"Kopiert","sound-effects":"Soundeffekte",language:"Sprache",select:"Auswählen",agent:"Agent",user:"Benutzer",bot:"Bot","got-any-questions":"Haben Sie Fragen? Chatten Sie mit uns!","typical-response-time":"Üblicherweise antworten wir in weniger als 1 Minute","close-widget":"Widget schließen","session-closed-lead":"Ihr Problem wurde gelöst!","create-new-ticket":"Neues Ticket erstellen",exit:"Beenden","reset-conversation":"Konversation zurücksetzen","new-conversation":"Neue Konversation","welcome-title":"Willkommen in unserem Support-Chat","welcome-description":"Wir sind hier, um zu helfen! Beginnen Sie ein Gespräch und wir werden so schnell wie möglich antworten.","your-name":"Ihr Name","your-email":"Ihre E-Mail-Adresse","start-chat":"Mit dem Support sprechen","starting-chat":"Verbindung wird hergestellt...","hello-greeting":"Hallo! Wie können wir Ihnen heute helfen?"},pt:{ok:"OK",yes:"Sim",no:"Não",agree:"Concordo",cancel:"Cancelar","yes-exit":"Sim, sair","yes-reset":"Sim, redefinir","no-cancel":"Não, cancelar","are-you-sure":"Você tem certeza?",recording:"Gravando...","thank-you":"Obrigado","sorry-try-again":"Desculpe, tente novamente","error-occurred":"Ocorreu um erro","please-try-again":"Por favor, tente novamente","write-a-message":"Escreva uma mensagem...","send-message":"Enviar mensagem",connected:"Conectado",connecting:"Conectando",reconnecting:"Reconectando",reconnected:"Reconectado",disconnecting:"Desconectando",disconnected:"Desconectado",error:"Erro","persist-session":"Persistir sessão",settings:"Configurações",close:"Fechar",help:"Ajuda",chat:"Bate-papo",send:"Enviar",copy:"Copiar",copied:"Copiado","sound-effects":"Efeitos sonoros",language:"Idioma",select:"Selecionar",agent:"Agente",user:"Usuário",bot:"Bot","close-widget":"Fechar widget","got-any-questions":"Tem alguma dúvida? Converse conosco!","typical-response-time":"Geralmente respondemos em menos de 1 minuto","session-closed-lead":"Seu problema foi resolvido!","create-new-ticket":"Criar novo ticket",exit:"Sair","reset-conversation":"Redefinir conversa","new-conversation":"Nova conversa","welcome-title":"Bem-vindo ao nosso chat de suporte","welcome-description":"Estamos aqui para ajudar! Inicie uma conversa e responderemos o mais rápido possível.","your-name":"Seu nome","your-email":"Seu endereço de email","start-chat":"Falar com o suporte","starting-chat":"Conectando...","hello-greeting":"Olá! Como podemos ajudar você hoje?"}},kH=Object.keys(FA),RH=e=>kH.includes(e);function NH(e,t){const n=FA[t];return n&&n[e]||""}function Jf(){const{widgetCtx:{config:e}}=zn();return v.useMemo(()=>{const n=RH(e.language)?e.language:"en";return{get:r=>NH(r,n),lang:n}},[e.language])}const PH=10,IH={right:(e,t)=>({initial:{opacity:0,x:-e,...t.initial},animate:{opacity:1,x:0,...t.animate},exit:{opacity:0,x:e,...t.exit}}),left:(e,t)=>({initial:{opacity:0,x:e,...t.initial},animate:{opacity:1,x:0,...t.animate},exit:{opacity:0,x:-e,...t.exit}}),up:(e,t)=>({initial:{opacity:0,y:e,...t.initial},animate:{opacity:1,y:0,...t.animate},exit:{opacity:0,y:-e,...t.exit}}),down:(e,t)=>({initial:{opacity:0,y:-e,...t.initial},animate:{opacity:1,y:0,...t.animate},exit:{opacity:0,y:e,...t.exit}})},fn=v.forwardRef(({fadeIn:e="down",distance:t=PH,children:n,snapExit:r=!1,overrides:i={},...a},o)=>{const s=e?IH[e](t,i):{};return r&&s.exit&&typeof s.exit=="object"&&!Array.isArray(s.exit)&&(s.exit.transition={duration:0}),E.jsx(us.div,{ref:o,...a,...s,children:n})});fn.displayName="MotionDiv";function BA(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=BA(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function OH(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=BA(e))&&(r&&(r+=" "),r+=t);return r}const jA=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,UA=OH,DH=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return UA(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(l=>{const c=n==null?void 0:n[l],d=a==null?void 0:a[l];if(c===null)return null;const f=jA(c)||jA(d);return i[l][f]}),s=n&&Object.entries(n).reduce((l,c)=>{let[d,f]=c;return f===void 0||(l[d]=f),l},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,c)=>{let{class:d,className:f,...p}=c;return Object.entries(p).every(m=>{let[g,x]=m;return Array.isArray(x)?x.includes({...a,...s}[g]):{...a,...s}[g]===x})?[...l,d,f]:l},[]);return UA(e,o,u,n==null?void 0:n.class,n==null?void 0:n.className)},HA={x:2,y:2},LH={1:"scale-[1]","1.01":"scale-[1.01]","1.02":"scale-[1.02]","1.1":"scale-[1.1]"},ep=v.memo(v.forwardRef(({children:e,className:t,scale:n="1.02",off:r=!1},i)=>{const[a,o]=v.useState(!1),[s,u]=v.useState({x:0,y:0});if(r||/translate/.test(e.props.className||""))return e;const c=m=>{var D,V;const{clientX:g,clientY:x}=m,y=m.currentTarget.getBoundingClientRect(),w=g-(y.left+y.width/2),b=x-(y.top+y.height/2),T=Math.max(-1,Math.min(1,w/(y.width/2))),S=Math.max(-1,Math.min(1,b/(y.height/2))),_=T*HA.x,N=S*HA.y;u({x:_,y:N}),(V=(D=e.props).onMouseMove)==null||V.call(D,m)},d=()=>{var m,g;o(!0),(g=(m=e.props).onMouseEnter)==null||g.call(m)},f=()=>{var m,g;o(!1),u({x:0,y:0}),(g=(m=e.props).onMouseLeave)==null||g.call(m)},p={"--opencx-wobble-x":a?`${s.x}px`:"0px","--opencx-wobble-y":a?`${s.y}px`:"0px"};return v.cloneElement(e,{ref:i,onMouseMove:c,onMouseEnter:d,onMouseLeave:f,style:{...p,...e.props.style},className:Le("translate-x-[var(--opencx-wobble-x)]","translate-y-[var(--opencx-wobble-y)]",`hover:${LH[n]}`,t,e.props.className,"transition-all ease-out")})}));ep.displayName="Wobble";const MH=DH(Le("inline-flex shrink-0 items-center justify-center gap-2","text-sm font-medium whitespace-nowrap","ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50","shadow-sm active:shadow-none active:scale-95 hover:active:scale-95","rounded-xl","border","transition"),{variants:{variant:{default:"border-primary bg-primary text-primary-foreground",destructive:"border-destructive bg-destructive text-destructive-foreground",outline:"bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground",ghost:"border-transparent shadow-none hover:bg-accent hover:text-accent-foreground",link:"border-transparent shadow-none text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-8 px-3 text-xs",lg:"min-h-12 px-4",icon:"h-10 w-10",fit:"size-fit p-2",free:"p-2"}},defaultVariants:{variant:"default",size:"default"}}),or=v.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>{const o=r?Mf:"button";return E.jsx(ep,{ref:a,children:E.jsx(o,{className:Le(MH({variant:t,size:n,className:e})),...i})})});or.displayName="Button";const xl=()=>{const[e,t]=v.useState("ltr");return v.useEffect(()=>{const n=()=>{typeof document>"u"||t(window.getComputedStyle(document.body).direction)};n();const r=new MutationObserver(n);return r.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]}),r.observe(document.body,{attributes:!0,attributeFilter:["dir"]}),window.addEventListener("languagechange",n),()=>{r.disconnect(),window.removeEventListener("languagechange",n)}},[]),e};function FH({options:e,onKeyboardClick:t}){return E.jsx("div",{className:"flex items-center gap-2 p-2 flex-wrap",children:e.map((n,r)=>E.jsx(or,{onClick:()=>t(n),className:"flex-1 rounded-full",size:"sm",children:n},r))})}function BH({file:{status:e,file:t,error:n},onCancel:r}){const[i,a]=v.useState(null);v.useEffect(()=>{if(!t.type.startsWith("image/"))return;const u=new FileReader;return u.onload=()=>a(u.result),u.onerror=()=>console.error("Error reading file"),u.readAsDataURL(t),()=>u.abort()},[t]);const o=()=>{switch(e){case"uploading":return E.jsx(gF,{className:"size-4 animate-spin"});case"error":return E.jsx(cF,{className:"size-4 text-destructive"});default:return null}},s=()=>{const u=t.type.split("/")[0];return u==="image"&&i?E.jsx("img",{src:typeof i=="string"?i:"",className:"object-cover bg-secondary size-full",alt:t.name}):u==="audio"?E.jsx(hF,{}):E.jsx(mF,{})};return E.jsx(Xy,{side:"bottom",content:e==="error"?E.jsxs("span",{className:"text-destructive",children:["Failed to upload: ",n]}):t.name,children:E.jsxs("div",{"data-test":"file-display",className:Le(e==="uploading"&&"opacity-50","group","size-12 border rounded-2xl overflow-hidden relative","flex items-center justify-center shrink-0"),children:[E.jsx("div",{className:"absolute inset-0 flex items-center justify-center","data-test":"file-status",children:o()}),E.jsx("button",{"data-test":"file-cancel-button",className:Le("absolute bg-black/50 inset-0 size-full z-10 opacity-0","flex items-center justify-center","opacity-0 group-hover:opacity-100 transition"),onClick:r,children:E.jsx(A_,{className:"size-4 text-primary-foreground"})}),E.jsx(s,{})]})})}const zA=Le("rounded-3xl");function jH(){var S;const e=v.useRef(null),{sendMessage:t}=pl(),{sessionState:n}=ys(),r=Jf(),i=xl(),[a,o]=v.useState(""),{allFiles:s,emptyTheFiles:u,handleCancelUpload:l,appendFiles:c,isUploading:d,successFiles:f}=Uj(),p=!!((S=n.session)!=null&&S.isHandedOff),{isAwaitingBotReply:m}=wC(),g=_=>{p&&c(_)},x=async()=>{if(m)return;if(d){const N="please wait for the file(s) to upload";AS.error(N),console.info(N)}const _=a.trim();_&&(o(""),u(),await t({content:_,attachments:f.map(N=>({url:N.fileUrl,type:N.file.type,name:N.file.name,id:N.id,size:N.file.size}))}))},{getRootProps:y,getInputProps:w,open:b}=xS({onDrop:g,noClick:!0,onDropRejected(){if(p){const _="unsupported file type, or the file is too large";AS.error(_),console.error(_)}},maxSize:5*1024*1024,accept:{"text/*":[".txt"],"image/*":[".png",".jpg",".jpeg",".gif"],"application/pdf":[".pdf"]}}),T=_=>{const N=_.clipboardData;N&&N.files.length>0&&g(Array.from(N.files))};return E.jsxs("div",{className:"p-2 relative space-y-1",...y(),"data-test":"chat-input-container",children:[E.jsx("input",{...w()}),E.jsxs("div",{className:Le(zA,"relative space-y-2 border transition-all shadow py-2"),"data-test":"chat-input-wrapper",children:[E.jsx("div",{className:"flex items-center gap-1 px-2","data-test":"file-attachments-container",children:E.jsx(Ja,{mode:"popLayout",children:s.map(_=>E.jsx(fn,{snapExit:!0,children:E.jsx(BH,{onCancel:()=>l(_.id),file:_})},_.id))})}),E.jsx("textarea",{onPaste:T,ref:e,id:"chat-input",dir:i,value:a,rows:3,"data-test":"chat-message-input",className:Le(zA,"w-full resize-none px-3","text-sm rtl:placeholder:text-right bg-transparent outline-none"),onChange:_=>o(_.target.value),onKeyDown:async _=>{_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),x())},placeholder:r.get("write-a-message")}),E.jsxs("div",{dir:i,className:"px-2 flex justify-between rtl:text-right","data-test":"chat-input-actions",children:[E.jsx(Xy,{side:"top",align:"start",content:"attach files, (maximum size 5mb)",children:E.jsx(or,{onClick:()=>{p&&b()},size:"fit",variant:"outline","data-test":"attach-file-button",className:Le("disabled:opacity-0","rounded-full size-8 flex items-center justify-center p-0"),disabled:!p,children:E.jsx(wF,{className:"size-4"})})}),E.jsx(Xy,{content:"send message",side:"top",align:"end",children:E.jsx(or,{size:"fit",onClick:x,disabled:m||d,"data-test":"send-message-button",className:"rounded-full size-8 flex items-center justify-center p-0",children:m?E.jsx(dF,{className:"size-4 animate-spin animate-iteration-infinite","data-test":"sending-message-indicator"}):E.jsx(C_,{className:"size-4 rtl:-scale-100"})})})]})]})]})}function UH(){const{widgetCtx:e}=zn(),t=Jf();return E.jsx("div",{className:"p-2","data-test":"session-closed-container",children:E.jsxs("div",{className:"p-2 bg-background rounded-3xl border shadow-2xl space-y-2","data-test":"session-closed-content",children:[E.jsxs("div",{className:"flex items-center gap-1","data-test":"session-closed-header",children:[E.jsx(sF,{className:"size-4 text-emerald-500"}),E.jsx("h2",{className:"text-sm font-medium",dir:"auto",children:t.get("session-closed-lead")})]}),E.jsx("div",{children:E.jsx(or,{onClick:e.resetChat,className:"rounded-2xl w-full",children:t.get("new-conversation")})})]})})}function HH(){var o,s,u;const{sessionState:e}=ys(),{messagesState:t,sendMessage:n}=pl(),i=(s=(o=Df().data)==null?void 0:o.data)==null?void 0:s.initialQuestions,a=t.messages.length===0;return E.jsxs("footer",{children:[t.suggestedReplies&&E.jsx(FH,{"data-test":"chat-keyboard",options:t.suggestedReplies,onKeyboardClick:l=>{const c=l.trim();c&&n({content:c})}}),a&&i&&E.jsx("div",{className:"flex items-center flex-row justify-end gap-2 flex-wrap px-2","data-test":"initial-questions-container",children:i==null?void 0:i.map((l,c)=>E.jsx(or,{dir:"auto",variant:"outline",size:"sm","data-test":`initial-question-${c}`,onClick:()=>{n({content:l})},children:l},c))}),E.jsx("div",{children:E.jsx(Ja,{mode:"wait",children:e.session&&!((u=e.session)!=null&&u.isOpened)?E.jsx(fn,{className:"overflow-hidden",overrides:{initial:{height:0},animate:{height:"auto"},exit:{height:0}},children:E.jsx(UH,{})},"session-closed"):E.jsx(fn,{className:"overflow-hidden",overrides:{initial:{height:0},animate:{height:"auto"},exit:{height:0}},children:E.jsx(jH,{})},"chat-input")})})]})}function Fe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function VA(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function tp(...e){return t=>{let n=!1;const r=e.map(i=>{const a=VA(i,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<r.length;i++){const a=r[i];typeof a=="function"?a():VA(e[i],null)}}}}function Cn(...e){return v.useCallback(tp(...e),e)}var El=v.forwardRef((e,t)=>{const{children:n,...r}=e,i=v.Children.toArray(n),a=i.find(VH);if(a){const o=a.props.children,s=i.map(u=>u===a?v.Children.count(o)>1?v.Children.only(null):v.isValidElement(o)?o.props.children:null:u);return E.jsx(Qy,{...r,ref:t,children:v.isValidElement(o)?v.cloneElement(o,void 0,s):null})}return E.jsx(Qy,{...r,ref:t,children:n})});El.displayName="Slot";var Qy=v.forwardRef((e,t)=>{const{children:n,...r}=e;if(v.isValidElement(n)){const i=WH(n);return v.cloneElement(n,{...$H(r,n.props),ref:t?tp(t,i):i})}return v.Children.count(n)>1?v.Children.only(null):null});Qy.displayName="SlotClone";var zH=({children:e})=>E.jsx(E.Fragment,{children:e});function VH(e){return v.isValidElement(e)&&e.type===zH}function $H(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...s)=>{a(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function WH(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var YH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],An=YH.reduce((e,t)=>{const n=v.forwardRef((r,i)=>{const{asChild:a,...o}=r,s=a?El:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),E.jsx(s,{...o,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function $A(e,t){e&&Zo.flushSync(()=>e.dispatchEvent(t))}function WA(e){const t=e+"CollectionProvider",[n,r]=la(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:m,children:g}=p,x=yn.useRef(null),y=yn.useRef(new Map).current;return E.jsx(i,{scope:m,itemMap:y,collectionRef:x,children:g})};o.displayName=t;const s=e+"CollectionSlot",u=yn.forwardRef((p,m)=>{const{scope:g,children:x}=p,y=a(s,g),w=Cn(m,y.collectionRef);return E.jsx(El,{ref:w,children:x})});u.displayName=s;const l=e+"CollectionItemSlot",c="data-radix-collection-item",d=yn.forwardRef((p,m)=>{const{scope:g,children:x,...y}=p,w=yn.useRef(null),b=Cn(m,w),T=a(l,g);return yn.useEffect(()=>(T.itemMap.set(w,{ref:w,...y}),()=>void T.itemMap.delete(w))),E.jsx(El,{[c]:"",ref:b,children:x})});d.displayName=l;function f(p){const m=a(e+"CollectionConsumer",p);return yn.useCallback(()=>{const x=m.collectionRef.current;if(!x)return[];const y=Array.from(x.querySelectorAll(`[${c}]`));return Array.from(m.itemMap.values()).sort((T,S)=>y.indexOf(T.ref.current)-y.indexOf(S.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:o,Slot:u,ItemSlot:d},f,r]}var qH=v.createContext(void 0);function YA(e){const t=v.useContext(qH);return e||t||"ltr"}var GH="DismissableLayer",Zy="dismissableLayer.update",KH="dismissableLayer.pointerDownOutside",XH="dismissableLayer.focusOutside",qA,GA=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),KA=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...u}=e,l=v.useContext(GA),[c,d]=v.useState(null),f=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=v.useState({}),m=Cn(t,N=>d(N)),g=Array.from(l.layers),[x]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),y=g.indexOf(x),w=c?g.indexOf(c):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,T=w>=y,S=JH(N=>{const D=N.target,V=[...l.branches].some(P=>P.contains(D));!T||V||(i==null||i(N),o==null||o(N),N.defaultPrevented||s==null||s())},f),_=ez(N=>{const D=N.target;[...l.branches].some(P=>P.contains(D))||(a==null||a(N),o==null||o(N),N.defaultPrevented||s==null||s())},f);return FC(N=>{w===l.layers.size-1&&(r==null||r(N),!N.defaultPrevented&&s&&(N.preventDefault(),s()))},f),v.useEffect(()=>{if(c)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(qA=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(c)),l.layers.add(c),XA(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=qA)}},[c,f,n,l]),v.useEffect(()=>()=>{c&&(l.layers.delete(c),l.layersWithOutsidePointerEventsDisabled.delete(c),XA())},[c,l]),v.useEffect(()=>{const N=()=>p({});return document.addEventListener(Zy,N),()=>document.removeEventListener(Zy,N)},[]),E.jsx(An.div,{...u,ref:m,style:{pointerEvents:b?T?"auto":"none":void 0,...e.style},onFocusCapture:Fe(e.onFocusCapture,_.onFocusCapture),onBlurCapture:Fe(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:Fe(e.onPointerDownCapture,S.onPointerDownCapture)})});KA.displayName=GH;var QH="DismissableLayerBranch",ZH=v.forwardRef((e,t)=>{const n=v.useContext(GA),r=v.useRef(null),i=Cn(t,r);return v.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),E.jsx(An.div,{...e,ref:i})});ZH.displayName=QH;function JH(e,t=globalThis==null?void 0:globalThis.document){const n=Wt(e),r=v.useRef(!1),i=v.useRef(()=>{});return v.useEffect(()=>{const a=s=>{if(s.target&&!r.current){let u=function(){QA(KH,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function ez(e,t=globalThis==null?void 0:globalThis.document){const n=Wt(e),r=v.useRef(!1);return v.useEffect(()=>{const i=a=>{a.target&&!r.current&&QA(XH,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function XA(){const e=new CustomEvent(Zy);document.dispatchEvent(e)}function QA(e,t,n,{discrete:r}){const i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?$A(i,a):i.dispatchEvent(a)}var Jy=0;function ZA(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??JA()),document.body.insertAdjacentElement("beforeend",e[1]??JA()),Jy++,()=>{Jy===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Jy--}},[])}function JA(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var e1="focusScope.autoFocusOnMount",t1="focusScope.autoFocusOnUnmount",ek={bubbles:!1,cancelable:!0},tz="FocusScope",tk=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,u]=v.useState(null),l=Wt(i),c=Wt(a),d=v.useRef(null),f=Cn(t,g=>u(g)),p=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let g=function(b){if(p.paused||!s)return;const T=b.target;s.contains(T)?d.current=T:ha(d.current,{select:!0})},x=function(b){if(p.paused||!s)return;const T=b.relatedTarget;T!==null&&(s.contains(T)||ha(d.current,{select:!0}))},y=function(b){if(document.activeElement===document.body)for(const S of b)S.removedNodes.length>0&&ha(s)};document.addEventListener("focusin",g),document.addEventListener("focusout",x);const w=new MutationObserver(y);return s&&w.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",x),w.disconnect()}}},[r,s,p.paused]),v.useEffect(()=>{if(s){ik.add(p);const g=document.activeElement;if(!s.contains(g)){const y=new CustomEvent(e1,ek);s.addEventListener(e1,l),s.dispatchEvent(y),y.defaultPrevented||(nz(sz(nk(s)),{select:!0}),document.activeElement===g&&ha(s))}return()=>{s.removeEventListener(e1,l),setTimeout(()=>{const y=new CustomEvent(t1,ek);s.addEventListener(t1,c),s.dispatchEvent(y),y.defaultPrevented||ha(g??document.body,{select:!0}),s.removeEventListener(t1,c),ik.remove(p)},0)}}},[s,l,c,p]);const m=v.useCallback(g=>{if(!n&&!r||p.paused)return;const x=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,y=document.activeElement;if(x&&y){const w=g.currentTarget,[b,T]=rz(w);b&&T?!g.shiftKey&&y===T?(g.preventDefault(),n&&ha(b,{select:!0})):g.shiftKey&&y===b&&(g.preventDefault(),n&&ha(T,{select:!0})):y===w&&g.preventDefault()}},[n,r,p.paused]);return E.jsx(An.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});tk.displayName=tz;function nz(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ha(r,{select:t}),document.activeElement!==n)return}function rz(e){const t=nk(e),n=rk(t,e),r=rk(t.reverse(),e);return[n,r]}function nk(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function rk(e,t){for(const n of e)if(!iz(n,{upTo:t}))return n}function iz(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function az(e){return e instanceof HTMLInputElement&&"select"in e}function ha(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&az(e)&&t&&e.select()}}var ik=oz();function oz(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ak(e,t),e.unshift(t)},remove(t){var n;e=ak(e,t),(n=e[0])==null||n.resume()}}}function ak(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function sz(e){return e.filter(t=>t.tagName!=="A")}var uz="Arrow",ok=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...a}=e;return E.jsx(An.svg,{...a,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:E.jsx("polygon",{points:"0,0 30,0 15,10"})})});ok.displayName=uz;var lz=ok,n1="Popper",[sk,uk]=la(n1),[cz,lk]=sk(n1),ck=e=>{const{__scopePopper:t,children:n}=e,[r,i]=v.useState(null);return E.jsx(cz,{scope:t,anchor:r,onAnchorChange:i,children:n})};ck.displayName=n1;var dk="PopperAnchor",fk=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,a=lk(dk,n),o=v.useRef(null),s=Cn(t,o);return v.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:E.jsx(An.div,{...i,ref:s})});fk.displayName=dk;var r1="PopperContent",[dz,fz]=sk(r1),pk=v.forwardRef((e,t)=>{var $e,Ve,We,Ge,_t,Te;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:a="center",alignOffset:o=0,arrowPadding:s=0,avoidCollisions:u=!0,collisionBoundary:l=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:m,...g}=e,x=lk(r1,n),[y,w]=v.useState(null),b=Cn(t,xe=>w(xe)),[T,S]=v.useState(null),_=hA(T),N=(_==null?void 0:_.width)??0,D=(_==null?void 0:_.height)??0,V=r+(a!=="center"?"-"+a:""),P=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},$=Array.isArray(l)?l:[l],H=$.length>0,X={padding:P,boundary:$.filter(hz),altBoundary:H},{refs:Y,floatingStyles:ne,placement:re,isPositioned:ee,middlewareData:F}=aA({strategy:"fixed",placement:V,whileElementsMounted:(...xe)=>tA(...xe,{animationFrame:p==="always"}),elements:{reference:x.anchor},middleware:[oA({mainAxis:i+D,alignmentAxis:o}),u&&sA({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?uA():void 0,...X}),u&&lA({...X}),cA({...X,apply:({elements:xe,rects:Ye,availableWidth:He,availableHeight:vt})=>{const{width:wt,height:Ke}=Ye.reference,Me=xe.floating.style;Me.setProperty("--radix-popper-available-width",`${He}px`),Me.setProperty("--radix-popper-available-height",`${vt}px`),Me.setProperty("--radix-popper-anchor-width",`${wt}px`),Me.setProperty("--radix-popper-anchor-height",`${Ke}px`)}}),T&&fA({element:T,padding:s}),mz({arrowWidth:N,arrowHeight:D}),f&&dA({strategy:"referenceHidden",...X})]}),[B,A]=gk(re),ae=Wt(m);ar(()=>{ee&&(ae==null||ae())},[ee,ae]);const he=($e=F.arrow)==null?void 0:$e.x,O=(Ve=F.arrow)==null?void 0:Ve.y,Pe=((We=F.arrow)==null?void 0:We.centerOffset)!==0,[ge,we]=v.useState();return ar(()=>{y&&we(window.getComputedStyle(y).zIndex)},[y]),E.jsx("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...ne,transform:ee?ne.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ge,"--radix-popper-transform-origin":[(Ge=F.transformOrigin)==null?void 0:Ge.x,(_t=F.transformOrigin)==null?void 0:_t.y].join(" "),...((Te=F.hide)==null?void 0:Te.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:E.jsx(dz,{scope:n,placedSide:B,onArrowChange:S,arrowX:he,arrowY:O,shouldHideArrow:Pe,children:E.jsx(An.div,{"data-side":B,"data-align":A,...g,ref:b,style:{...g.style,animation:ee?void 0:"none"}})})})});pk.displayName=r1;var hk="PopperArrow",pz={top:"bottom",right:"left",bottom:"top",left:"right"},mk=v.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,a=fz(hk,r),o=pz[a.placedSide];return E.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:E.jsx(lz,{...i,ref:n,style:{...i.style,display:"block"}})})});mk.displayName=hk;function hz(e){return e!==null}var mz=e=>({name:"transformOrigin",options:e,fn(t){var x,y,w;const{placement:n,rects:r,middlewareData:i}=t,o=((x=i.arrow)==null?void 0:x.centerOffset)!==0,s=o?0:e.arrowWidth,u=o?0:e.arrowHeight,[l,c]=gk(n),d={start:"0%",center:"50%",end:"100%"}[c],f=(((y=i.arrow)==null?void 0:y.x)??0)+s/2,p=(((w=i.arrow)==null?void 0:w.y)??0)+u/2;let m="",g="";return l==="bottom"?(m=o?d:`${f}px`,g=`${-u}px`):l==="top"?(m=o?d:`${f}px`,g=`${r.floating.height+u}px`):l==="right"?(m=`${-u}px`,g=o?d:`${p}px`):l==="left"&&(m=`${r.floating.width+u}px`,g=o?d:`${p}px`),{data:{x:m,y:g}}}});function gk(e){const[t,n="center"]=e.split("-");return[t,n]}var gz=ck,yz=fk,vz=pk,wz=mk;function bz(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var np=e=>{const{present:t,children:n}=e,r=xz(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),a=Cn(r.ref,Ez(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:a}):null};np.displayName="Presence";function xz(e){const[t,n]=v.useState(),r=v.useRef({}),i=v.useRef(e),a=v.useRef("none"),o=e?"mounted":"unmounted",[s,u]=bz(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=rp(r.current);a.current=s==="mounted"?l:"none"},[s]),ar(()=>{const l=r.current,c=i.current;if(c!==e){const f=a.current,p=rp(l);e?u("MOUNT"):p==="none"||(l==null?void 0:l.display)==="none"?u("UNMOUNT"):u(c&&f!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),ar(()=>{if(t){let l;const c=t.ownerDocument.defaultView??window,d=p=>{const g=rp(r.current).includes(p.animationName);if(p.target===t&&g&&(u("ANIMATION_END"),!i.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",l=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},f=p=>{p.target===t&&(a.current=rp(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{c.clearTimeout(l),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function rp(e){return(e==null?void 0:e.animationName)||"none"}function Ez(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var i1="rovingFocusGroup.onEntryFocus",Tz={bubbles:!1,cancelable:!0},ip="RovingFocusGroup",[a1,yk,_z]=WA(ip),[Sz,vk]=la(ip,[_z]),[Cz,Az]=Sz(ip),wk=v.forwardRef((e,t)=>E.jsx(a1.Provider,{scope:e.__scopeRovingFocusGroup,children:E.jsx(a1.Slot,{scope:e.__scopeRovingFocusGroup,children:E.jsx(kz,{...e,ref:t})})}));wk.displayName=ip;var kz=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:u,onEntryFocus:l,preventScrollOnEntryFocus:c=!1,...d}=e,f=v.useRef(null),p=Cn(t,f),m=YA(a),[g=null,x]=Gf({prop:o,defaultProp:s,onChange:u}),[y,w]=v.useState(!1),b=Wt(l),T=yk(n),S=v.useRef(!1),[_,N]=v.useState(0);return v.useEffect(()=>{const D=f.current;if(D)return D.addEventListener(i1,b),()=>D.removeEventListener(i1,b)},[b]),E.jsx(Cz,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:g,onItemFocus:v.useCallback(D=>x(D),[x]),onItemShiftTab:v.useCallback(()=>w(!0),[]),onFocusableItemAdd:v.useCallback(()=>N(D=>D+1),[]),onFocusableItemRemove:v.useCallback(()=>N(D=>D-1),[]),children:E.jsx(An.div,{tabIndex:y||_===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:Fe(e.onMouseDown,()=>{S.current=!0}),onFocus:Fe(e.onFocus,D=>{const V=!S.current;if(D.target===D.currentTarget&&V&&!y){const P=new CustomEvent(i1,Tz);if(D.currentTarget.dispatchEvent(P),!P.defaultPrevented){const $=T().filter(re=>re.focusable),H=$.find(re=>re.active),X=$.find(re=>re.id===g),ne=[H,X,...$].filter(Boolean).map(re=>re.ref.current);Ek(ne,c)}}S.current=!1}),onBlur:Fe(e.onBlur,()=>w(!1))})})}),bk="RovingFocusGroupItem",xk=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,...o}=e,s=yl(),u=a||s,l=Az(bk,n),c=l.currentTabStopId===u,d=yk(n),{onFocusableItemAdd:f,onFocusableItemRemove:p}=l;return v.useEffect(()=>{if(r)return f(),()=>p()},[r,f,p]),E.jsx(a1.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:E.jsx(An.span,{tabIndex:c?0:-1,"data-orientation":l.orientation,...o,ref:t,onMouseDown:Fe(e.onMouseDown,m=>{r?l.onItemFocus(u):m.preventDefault()}),onFocus:Fe(e.onFocus,()=>l.onItemFocus(u)),onKeyDown:Fe(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){l.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const g=Pz(m,l.orientation,l.dir);if(g!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let y=d().filter(w=>w.focusable).map(w=>w.ref.current);if(g==="last")y.reverse();else if(g==="prev"||g==="next"){g==="prev"&&y.reverse();const w=y.indexOf(m.currentTarget);y=l.loop?Iz(y,w+1):y.slice(w+1)}setTimeout(()=>Ek(y))}})})})});xk.displayName=bk;var Rz={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Nz(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Pz(e,t,n){const r=Nz(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Rz[r]}function Ek(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Iz(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Oz=wk,Dz=xk,Lz=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},_s=new WeakMap,ap=new WeakMap,op={},o1=0,Tk=function(e){return e&&(e.host||Tk(e.parentNode))},Mz=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Tk(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Fz=function(e,t,n,r){var i=Mz(t,Array.isArray(e)?e:[e]);op[n]||(op[n]=new WeakMap);var a=op[n],o=[],s=new Set,u=new Set(i),l=function(d){!d||s.has(d)||(s.add(d),l(d.parentNode))};i.forEach(l);var c=function(d){!d||u.has(d)||Array.prototype.forEach.call(d.children,function(f){if(s.has(f))c(f);else try{var p=f.getAttribute(r),m=p!==null&&p!=="false",g=(_s.get(f)||0)+1,x=(a.get(f)||0)+1;_s.set(f,g),a.set(f,x),o.push(f),g===1&&m&&ap.set(f,!0),x===1&&f.setAttribute(n,"true"),m||f.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",f,y)}})};return c(t),s.clear(),o1++,function(){o.forEach(function(d){var f=_s.get(d)-1,p=a.get(d)-1;_s.set(d,f),a.set(d,p),f||(ap.has(d)||d.removeAttribute(r),ap.delete(d)),p||d.removeAttribute(n)}),o1--,o1||(_s=new WeakMap,_s=new WeakMap,ap=new WeakMap,op={})}},_k=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=Lz(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),Fz(r,i,n,"aria-hidden")):function(){return null}},sp="right-scroll-bar-position",up="width-before-scroll-bar",Bz="with-scroll-bars-hidden",jz="--removed-body-scroll-bar-size";function s1(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Uz(e,t){var n=v.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var Hz=typeof window<"u"?v.useLayoutEffect:v.useEffect,Sk=new WeakMap;function zz(e,t){var n=Uz(null,function(r){return e.forEach(function(i){return s1(i,r)})});return Hz(function(){var r=Sk.get(n);if(r){var i=new Set(r),a=new Set(e),o=n.current;i.forEach(function(s){a.has(s)||s1(s,null)}),a.forEach(function(s){i.has(s)||s1(s,o)})}Sk.set(n,e)},[e]),n}function Vz(e){return e}function $z(e,t){t===void 0&&(t=Vz);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var o=t(a,r);return n.push(o),function(){n=n.filter(function(s){return s!==o})}},assignSyncMedium:function(a){for(r=!0;n.length;){var o=n;n=[],o.forEach(a)}n={push:function(s){return a(s)},filter:function(){return n}}},assignMedium:function(a){r=!0;var o=[];if(n.length){var s=n;n=[],s.forEach(a),o=n}var u=function(){var c=o;o=[],c.forEach(a)},l=function(){return Promise.resolve().then(u)};l(),n={push:function(c){o.push(c),l()},filter:function(c){return o=o.filter(c),n}}}};return i}function Ck(e){e===void 0&&(e={});var t=$z(null);return t.options=Lt({async:!0,ssr:!1},e),t}var Ak=function(e){var t=e.sideCar,n=il(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return v.createElement(r,Lt({},n))};Ak.isSideCarExport=!0;function kk(e,t){return e.useMedium(t),Ak}var Rk=Ck(),u1=function(){},lp=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:u1,onWheelCapture:u1,onTouchMoveCapture:u1}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,u=e.className,l=e.removeScrollBar,c=e.enabled,d=e.shards,f=e.sideCar,p=e.noIsolation,m=e.inert,g=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,w=e.gapMode,b=il(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=f,S=zz([n,t]),_=Lt(Lt({},b),i);return v.createElement(v.Fragment,null,c&&v.createElement(T,{sideCar:Rk,removeScrollBar:l,shards:d,noIsolation:p,inert:m,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:w}),o?v.cloneElement(v.Children.only(s),Lt(Lt({},_),{ref:S})):v.createElement(y,Lt({},_,{className:u,ref:S}),s))});lp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},lp.classNames={fullWidth:up,zeroRight:sp};var Nk=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Wz(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Nk();return t&&e.setAttribute("nonce",t),e}function Yz(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function qz(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Gz=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Wz())&&(Yz(t,n),qz(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Kz=function(){var e=Gz();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Xz=function(){var e=Kz(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},Qz={left:0,top:0,right:0,gap:0},l1=function(e){return parseInt(e||"",10)||0},Zz=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[l1(n),l1(r),l1(i)]},Jz=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Qz;var t=Zz(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},eV=Xz(),Ss="data-scroll-locked",tV=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n="margin"),`
342
342
  .`.concat(Bz,` {
343
343
  overflow: hidden `).concat(r,`;
344
344
  padding-right: `).concat(s,"px ").concat(r,`;
@@ -375,10 +375,10 @@ to {
375
375
  body[`).concat(Ss,`] {
376
376
  `).concat(jz,": ").concat(s,`px;
377
377
  }
378
- `)},Pk=function(){var e=parseInt(document.body.getAttribute(Ss)||"0",10);return isFinite(e)?e:0},nV=function(){v.useEffect(function(){return document.body.setAttribute(Ss,(Pk()+1).toString()),function(){var e=Pk()-1;e<=0?document.body.removeAttribute(Ss):document.body.setAttribute(Ss,e.toString())}},[])},rV=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;nV();var a=v.useMemo(function(){return Jz(i)},[i]);return v.createElement(eV,{styles:tV(a,!t,i,n?"":"!important")})};function iV(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Nk();return t&&e.setAttribute("nonce",t),e}function aV(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function oV(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var sV=function(){var e=0,t=null;return{add:function(n){e==0&&(t=iV())&&(aV(t,n),oV(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},uV=function(){var e=sV();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},l1=function(){var e=uV(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},c1=!1;if(typeof window<"u")try{var cp=Object.defineProperty({},"passive",{get:function(){return c1=!0,!0}});window.addEventListener("test",cp,cp),window.removeEventListener("test",cp,cp)}catch{c1=!1}var Cs=c1?{passive:!1}:!1,lV=function(e){return e.tagName==="TEXTAREA"},Ik=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!lV(e)&&n[t]==="visible")},cV=function(e){return Ik(e,"overflowY")},dV=function(e){return Ik(e,"overflowX")},Ok=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=Dk(e,r);if(i){var a=Lk(e,r),o=a[1],s=a[2];if(o>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},fV=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},pV=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Dk=function(e,t){return e==="v"?cV(t):dV(t)},Lk=function(e,t){return e==="v"?fV(t):pV(t)},hV=function(e,t){return e==="h"&&t==="rtl"?-1:1},mV=function(e,t,n,r,i){var a=hV(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,u=t.contains(s),l=!1,c=o>0,d=0,f=0;do{var p=Lk(e,s),m=p[0],g=p[1],x=p[2],y=g-x-a*m;(m||y)&&Dk(e,s)&&(d+=y,f+=m),s instanceof ShadowRoot?s=s.host:s=s.parentNode}while(!u&&s!==document.body||u&&(t.contains(s)||t===s));return(c&&(Math.abs(d)<1||!i)||!c&&(Math.abs(f)<1||!i))&&(l=!0),l},dp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Mk=function(e){return[e.deltaX,e.deltaY]},Fk=function(e){return e&&"current"in e?e.current:e},gV=function(e,t){return e[0]===t[0]&&e[1]===t[1]},yV=function(e){return`
378
+ `)},Pk=function(){var e=parseInt(document.body.getAttribute(Ss)||"0",10);return isFinite(e)?e:0},nV=function(){v.useEffect(function(){return document.body.setAttribute(Ss,(Pk()+1).toString()),function(){var e=Pk()-1;e<=0?document.body.removeAttribute(Ss):document.body.setAttribute(Ss,e.toString())}},[])},rV=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;nV();var a=v.useMemo(function(){return Jz(i)},[i]);return v.createElement(eV,{styles:tV(a,!t,i,n?"":"!important")})};function iV(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Nk();return t&&e.setAttribute("nonce",t),e}function aV(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function oV(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var sV=function(){var e=0,t=null;return{add:function(n){e==0&&(t=iV())&&(aV(t,n),oV(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},uV=function(){var e=sV();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},c1=function(){var e=uV(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},d1=!1;if(typeof window<"u")try{var cp=Object.defineProperty({},"passive",{get:function(){return d1=!0,!0}});window.addEventListener("test",cp,cp),window.removeEventListener("test",cp,cp)}catch{d1=!1}var Cs=d1?{passive:!1}:!1,lV=function(e){return e.tagName==="TEXTAREA"},Ik=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!lV(e)&&n[t]==="visible")},cV=function(e){return Ik(e,"overflowY")},dV=function(e){return Ik(e,"overflowX")},Ok=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=Dk(e,r);if(i){var a=Lk(e,r),o=a[1],s=a[2];if(o>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},fV=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},pV=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Dk=function(e,t){return e==="v"?cV(t):dV(t)},Lk=function(e,t){return e==="v"?fV(t):pV(t)},hV=function(e,t){return e==="h"&&t==="rtl"?-1:1},mV=function(e,t,n,r,i){var a=hV(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,u=t.contains(s),l=!1,c=o>0,d=0,f=0;do{var p=Lk(e,s),m=p[0],g=p[1],x=p[2],y=g-x-a*m;(m||y)&&Dk(e,s)&&(d+=y,f+=m),s instanceof ShadowRoot?s=s.host:s=s.parentNode}while(!u&&s!==document.body||u&&(t.contains(s)||t===s));return(c&&(Math.abs(d)<1||!i)||!c&&(Math.abs(f)<1||!i))&&(l=!0),l},dp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Mk=function(e){return[e.deltaX,e.deltaY]},Fk=function(e){return e&&"current"in e?e.current:e},gV=function(e,t){return e[0]===t[0]&&e[1]===t[1]},yV=function(e){return`
379
379
  .block-interactivity-`.concat(e,` {pointer-events: none;}
380
380
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
381
- `)},vV=0,As=[];function wV(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(vV++)[0],a=v.useState(l1)[0],o=v.useRef(e);v.useEffect(function(){o.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var g=lf([e.lockRef.current],(e.shards||[]).map(Fk),!0).filter(Boolean);return g.forEach(function(x){return x.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),g.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=v.useCallback(function(g,x){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!o.current.allowPinchZoom;var y=dp(g),w=n.current,b="deltaX"in g?g.deltaX:w[0]-y[0],T="deltaY"in g?g.deltaY:w[1]-y[1],S,_=g.target,N=Math.abs(b)>Math.abs(T)?"h":"v";if("touches"in g&&N==="h"&&_.type==="range")return!1;var D=Ok(N,_);if(!D)return!0;if(D?S=N:(S=N==="v"?"h":"v",D=Ok(N,_)),!D)return!1;if(!r.current&&"changedTouches"in g&&(b||T)&&(r.current=S),!S)return!0;var V=r.current||S;return mV(V,x,g,V==="h"?b:T,!0)},[]),u=v.useCallback(function(g){var x=g;if(!(!As.length||As[As.length-1]!==a)){var y="deltaY"in x?Mk(x):dp(x),w=t.current.filter(function(S){return S.name===x.type&&(S.target===x.target||x.target===S.shadowParent)&&gV(S.delta,y)})[0];if(w&&w.should){x.cancelable&&x.preventDefault();return}if(!w){var b=(o.current.shards||[]).map(Fk).filter(Boolean).filter(function(S){return S.contains(x.target)}),T=b.length>0?s(x,b[0]):!o.current.noIsolation;T&&x.cancelable&&x.preventDefault()}}},[]),l=v.useCallback(function(g,x,y,w){var b={name:g,delta:x,target:y,should:w,shadowParent:bV(y)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(T){return T!==b})},1)},[]),c=v.useCallback(function(g){n.current=dp(g),r.current=void 0},[]),d=v.useCallback(function(g){l(g.type,Mk(g),g.target,s(g,e.lockRef.current))},[]),f=v.useCallback(function(g){l(g.type,dp(g),g.target,s(g,e.lockRef.current))},[]);v.useEffect(function(){return As.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",u,Cs),document.addEventListener("touchmove",u,Cs),document.addEventListener("touchstart",c,Cs),function(){As=As.filter(function(g){return g!==a}),document.removeEventListener("wheel",u,Cs),document.removeEventListener("touchmove",u,Cs),document.removeEventListener("touchstart",c,Cs)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(a,{styles:yV(i)}):null,p?v.createElement(rV,{gapMode:e.gapMode}):null)}function bV(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const xV=kk(Rk,wV);var Bk=v.forwardRef(function(e,t){return v.createElement(lp,Lt({},e,{ref:t,sideCar:xV}))});Bk.classNames=lp.classNames;var d1=["Enter"," "],EV=["ArrowDown","PageUp","Home"],jk=["ArrowUp","PageDown","End"],TV=[...EV,...jk],_V={ltr:[...d1,"ArrowRight"],rtl:[...d1,"ArrowLeft"]},SV={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Tl="Menu",[_l,CV,AV]=WA(Tl),[ao,Uk]=la(Tl,[AV,uk,vk]),fp=uk(),Hk=vk(),[kV,ks]=ao(Tl),[RV,Sl]=ao(Tl),zk=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=fp(t),[u,l]=v.useState(null),c=v.useRef(!1),d=Wt(a),f=YA(i);return v.useEffect(()=>{const p=()=>{c.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>c.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),E.jsx(gz,{...s,children:E.jsx(kV,{scope:t,open:n,onOpenChange:d,content:u,onContentChange:l,children:E.jsx(RV,{scope:t,onClose:v.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:c,dir:f,modal:o,children:r})})})};zk.displayName=Tl;var NV="MenuAnchor",f1=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=fp(n);return E.jsx(yz,{...i,...r,ref:t})});f1.displayName=NV;var PV="MenuPortal",[Yie,Vk]=ao(PV,{forceMount:void 0}),sr="MenuContent",[IV,p1]=ao(sr),$k=v.forwardRef((e,t)=>{const n=Vk(sr,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=ks(sr,e.__scopeMenu),o=Sl(sr,e.__scopeMenu);return E.jsx(_l.Provider,{scope:e.__scopeMenu,children:E.jsx(np,{present:r||a.open,children:E.jsx(_l.Slot,{scope:e.__scopeMenu,children:o.modal?E.jsx(OV,{...i,ref:t}):E.jsx(DV,{...i,ref:t})})})})}),OV=v.forwardRef((e,t)=>{const n=ks(sr,e.__scopeMenu),r=v.useRef(null),i=Cn(t,r);return v.useEffect(()=>{const a=r.current;if(a)return _k(a)},[]),E.jsx(h1,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Fe(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),DV=v.forwardRef((e,t)=>{const n=ks(sr,e.__scopeMenu);return E.jsx(h1,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),h1=v.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...g}=e,x=ks(sr,n),y=Sl(sr,n),w=fp(n),b=Hk(n),T=CV(n),[S,_]=v.useState(null),N=v.useRef(null),D=Cn(t,N,x.onContentChange),V=v.useRef(0),P=v.useRef(""),$=v.useRef(0),H=v.useRef(null),X=v.useRef("right"),Y=v.useRef(0),ne=m?Bk:v.Fragment,re=m?{as:El,allowPinchZoom:!0}:void 0,ee=B=>{var $e,Ve;const A=P.current+B,ae=T().filter(We=>!We.disabled),he=document.activeElement,O=($e=ae.find(We=>We.ref.current===he))==null?void 0:$e.textValue,Pe=ae.map(We=>We.textValue),ge=YV(Pe,A,O),we=(Ve=ae.find(We=>We.textValue===ge))==null?void 0:Ve.ref.current;(function We(Ge){P.current=Ge,window.clearTimeout(V.current),Ge!==""&&(V.current=window.setTimeout(()=>We(""),1e3))})(A),we&&setTimeout(()=>we.focus())};v.useEffect(()=>()=>window.clearTimeout(V.current),[]),ZA();const F=v.useCallback(B=>{var ae,he;return X.current===((ae=H.current)==null?void 0:ae.side)&&GV(B,(he=H.current)==null?void 0:he.area)},[]);return E.jsx(IV,{scope:n,searchRef:P,onItemEnter:v.useCallback(B=>{F(B)&&B.preventDefault()},[F]),onItemLeave:v.useCallback(B=>{var A;F(B)||((A=N.current)==null||A.focus(),_(null))},[F]),onTriggerLeave:v.useCallback(B=>{F(B)&&B.preventDefault()},[F]),pointerGraceTimerRef:$,onPointerGraceIntentChange:v.useCallback(B=>{H.current=B},[]),children:E.jsx(ne,{...re,children:E.jsx(tk,{asChild:!0,trapped:i,onMountAutoFocus:Fe(a,B=>{var A;B.preventDefault(),(A=N.current)==null||A.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:E.jsx(KA,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:E.jsx(Oz,{asChild:!0,...b,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:_,onEntryFocus:Fe(u,B=>{y.isUsingKeyboardRef.current||B.preventDefault()}),preventScrollOnEntryFocus:!0,children:E.jsx(vz,{role:"menu","aria-orientation":"vertical","data-state":s3(x.open),"data-radix-menu-content":"",dir:y.dir,...w,...g,ref:D,style:{outline:"none",...g.style},onKeyDown:Fe(g.onKeyDown,B=>{const ae=B.target.closest("[data-radix-menu-content]")===B.currentTarget,he=B.ctrlKey||B.altKey||B.metaKey,O=B.key.length===1;ae&&(B.key==="Tab"&&B.preventDefault(),!he&&O&&ee(B.key));const Pe=N.current;if(B.target!==Pe||!TV.includes(B.key))return;B.preventDefault();const we=T().filter($e=>!$e.disabled).map($e=>$e.ref.current);jk.includes(B.key)&&we.reverse(),$V(we)}),onBlur:Fe(e.onBlur,B=>{B.currentTarget.contains(B.target)||(window.clearTimeout(V.current),P.current="")}),onPointerMove:Fe(e.onPointerMove,Al(B=>{const A=B.target,ae=Y.current!==B.clientX;if(B.currentTarget.contains(A)&&ae){const he=B.clientX>Y.current?"right":"left";X.current=he,Y.current=B.clientX}}))})})})})})})});$k.displayName=sr;var LV="MenuGroup",m1=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return E.jsx(An.div,{role:"group",...r,ref:t})});m1.displayName=LV;var MV="MenuLabel",Wk=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return E.jsx(An.div,{...r,ref:t})});Wk.displayName=MV;var pp="MenuItem",Yk="menu.itemSelect",hp=v.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,a=v.useRef(null),o=Sl(pp,e.__scopeMenu),s=p1(pp,e.__scopeMenu),u=Cn(t,a),l=v.useRef(!1),c=()=>{const d=a.current;if(!n&&d){const f=new CustomEvent(Yk,{bubbles:!0,cancelable:!0});d.addEventListener(Yk,p=>r==null?void 0:r(p),{once:!0}),$A(d,f),f.defaultPrevented?l.current=!1:o.onClose()}};return E.jsx(qk,{...i,ref:u,disabled:n,onClick:Fe(e.onClick,c),onPointerDown:d=>{var f;(f=e.onPointerDown)==null||f.call(e,d),l.current=!0},onPointerUp:Fe(e.onPointerUp,d=>{var f;l.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:Fe(e.onKeyDown,d=>{const f=s.searchRef.current!=="";n||f&&d.key===" "||d1.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});hp.displayName=pp;var qk=v.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=p1(pp,n),s=Hk(n),u=v.useRef(null),l=Cn(t,u),[c,d]=v.useState(!1),[f,p]=v.useState("");return v.useEffect(()=>{const m=u.current;m&&p((m.textContent??"").trim())},[a.children]),E.jsx(_l.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:E.jsx(Dz,{asChild:!0,...s,focusable:!r,children:E.jsx(An.div,{role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:l,onPointerMove:Fe(e.onPointerMove,Al(m=>{r?o.onItemLeave(m):(o.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Fe(e.onPointerLeave,Al(m=>o.onItemLeave(m))),onFocus:Fe(e.onFocus,()=>d(!0)),onBlur:Fe(e.onBlur,()=>d(!1))})})})}),FV="MenuCheckboxItem",Gk=v.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return E.jsx(Jk,{scope:e.__scopeMenu,checked:n,children:E.jsx(hp,{role:"menuitemcheckbox","aria-checked":mp(n)?"mixed":n,...i,ref:t,"data-state":y1(n),onSelect:Fe(i.onSelect,()=>r==null?void 0:r(mp(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Gk.displayName=FV;var Kk="MenuRadioGroup",[BV,jV]=ao(Kk,{value:void 0,onValueChange:()=>{}}),Xk=v.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,a=Wt(r);return E.jsx(BV,{scope:e.__scopeMenu,value:n,onValueChange:a,children:E.jsx(m1,{...i,ref:t})})});Xk.displayName=Kk;var Qk="MenuRadioItem",Zk=v.forwardRef((e,t)=>{const{value:n,...r}=e,i=jV(Qk,e.__scopeMenu),a=n===i.value;return E.jsx(Jk,{scope:e.__scopeMenu,checked:a,children:E.jsx(hp,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":y1(a),onSelect:Fe(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});Zk.displayName=Qk;var g1="MenuItemIndicator",[Jk,UV]=ao(g1,{checked:!1}),e3=v.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,a=UV(g1,n);return E.jsx(np,{present:r||mp(a.checked)||a.checked===!0,children:E.jsx(An.span,{...i,ref:t,"data-state":y1(a.checked)})})});e3.displayName=g1;var HV="MenuSeparator",t3=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return E.jsx(An.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});t3.displayName=HV;var zV="MenuArrow",n3=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=fp(n);return E.jsx(wz,{...i,...r,ref:t})});n3.displayName=zV;var VV="MenuSub",[qie,r3]=ao(VV),Cl="MenuSubTrigger",i3=v.forwardRef((e,t)=>{const n=ks(Cl,e.__scopeMenu),r=Sl(Cl,e.__scopeMenu),i=r3(Cl,e.__scopeMenu),a=p1(Cl,e.__scopeMenu),o=v.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:u}=a,l={__scopeMenu:e.__scopeMenu},c=v.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return v.useEffect(()=>c,[c]),v.useEffect(()=>{const d=s.current;return()=>{window.clearTimeout(d),u(null)}},[s,u]),E.jsx(f1,{asChild:!0,...l,children:E.jsx(qk,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":s3(n.open),...e,ref:tp(t,i.onTriggerChange),onClick:d=>{var f;(f=e.onClick)==null||f.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Fe(e.onPointerMove,Al(d=>{a.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),c()},100))})),onPointerLeave:Fe(e.onPointerLeave,Al(d=>{var p,m;c();const f=(p=n.content)==null?void 0:p.getBoundingClientRect();if(f){const g=(m=n.content)==null?void 0:m.dataset.side,x=g==="right",y=x?-5:5,w=f[x?"left":"right"],b=f[x?"right":"left"];a.onPointerGraceIntentChange({area:[{x:d.clientX+y,y:d.clientY},{x:w,y:f.top},{x:b,y:f.top},{x:b,y:f.bottom},{x:w,y:f.bottom}],side:g}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(d),d.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:Fe(e.onKeyDown,d=>{var p;const f=a.searchRef.current!=="";e.disabled||f&&d.key===" "||_V[r.dir].includes(d.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),d.preventDefault())})})})});i3.displayName=Cl;var a3="MenuSubContent",o3=v.forwardRef((e,t)=>{const n=Vk(sr,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=ks(sr,e.__scopeMenu),o=Sl(sr,e.__scopeMenu),s=r3(a3,e.__scopeMenu),u=v.useRef(null),l=Cn(t,u);return E.jsx(_l.Provider,{scope:e.__scopeMenu,children:E.jsx(np,{present:r||a.open,children:E.jsx(_l.Slot,{scope:e.__scopeMenu,children:E.jsx(h1,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:c=>{var d;o.isUsingKeyboardRef.current&&((d=u.current)==null||d.focus()),c.preventDefault()},onCloseAutoFocus:c=>c.preventDefault(),onFocusOutside:Fe(e.onFocusOutside,c=>{c.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:Fe(e.onEscapeKeyDown,c=>{o.onClose(),c.preventDefault()}),onKeyDown:Fe(e.onKeyDown,c=>{var p;const d=c.currentTarget.contains(c.target),f=SV[o.dir].includes(c.key);d&&f&&(a.onOpenChange(!1),(p=s.trigger)==null||p.focus(),c.preventDefault())})})})})})});o3.displayName=a3;function s3(e){return e?"open":"closed"}function mp(e){return e==="indeterminate"}function y1(e){return mp(e)?"indeterminate":e?"checked":"unchecked"}function $V(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function WV(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function YV(e,t,n){const i=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let o=WV(e,Math.max(a,0));i.length===1&&(o=o.filter(l=>l!==n));const u=o.find(l=>l.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function qV(e,t){const{x:n,y:r}=e;let i=!1;for(let a=0,o=t.length-1;a<t.length;o=a++){const s=t[a].x,u=t[a].y,l=t[o].x,c=t[o].y;u>r!=c>r&&n<(l-s)*(r-u)/(c-u)+s&&(i=!i)}return i}function GV(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return qV(n,t)}function Al(e){return t=>t.pointerType==="mouse"?e(t):void 0}var KV=zk,XV=f1,QV=$k,ZV=m1,JV=Wk,e$=hp,t$=Gk,n$=Xk,r$=Zk,i$=e3,a$=t3,o$=n3,s$=i3,u$=o3,v1="DropdownMenu",[l$,Gie]=la(v1,[Uk]),kn=Uk(),[c$,u3]=l$(v1),l3=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,u=kn(t),l=v.useRef(null),[c=!1,d]=Gf({prop:i,defaultProp:a,onChange:o});return E.jsx(c$,{scope:t,triggerId:yl(),triggerRef:l,contentId:yl(),open:c,onOpenChange:d,onOpenToggle:v.useCallback(()=>d(f=>!f),[d]),modal:s,children:E.jsx(KV,{...u,open:c,onOpenChange:d,dir:r,modal:s,children:n})})};l3.displayName=v1;var c3="DropdownMenuTrigger",d3=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=u3(c3,n),o=kn(n);return E.jsx(XV,{asChild:!0,...o,children:E.jsx(An.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:tp(t,a.triggerRef),onPointerDown:Fe(e.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(a.onOpenToggle(),a.open||s.preventDefault())}),onKeyDown:Fe(e.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&a.onOpenToggle(),s.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});d3.displayName=c3;var f3="DropdownMenuContent",p3=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=u3(f3,n),a=kn(n),o=v.useRef(!1);return E.jsx(QV,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:Fe(e.onCloseAutoFocus,s=>{var u;o.current||(u=i.triggerRef.current)==null||u.focus(),o.current=!1,s.preventDefault()}),onInteractOutside:Fe(e.onInteractOutside,s=>{const u=s.detail.originalEvent,l=u.button===0&&u.ctrlKey===!0,c=u.button===2||l;(!i.modal||c)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});p3.displayName=f3;var d$="DropdownMenuGroup",h3=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return E.jsx(ZV,{...i,...r,ref:t})});h3.displayName=d$;var f$="DropdownMenuLabel",m3=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return E.jsx(JV,{...i,...r,ref:t})});m3.displayName=f$;var p$="DropdownMenuItem",g3=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return E.jsx(e$,{...i,...r,ref:t})});g3.displayName=p$;var h$="DropdownMenuCheckboxItem",y3=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return E.jsx(t$,{...i,...r,ref:t})});y3.displayName=h$;var m$="DropdownMenuRadioGroup",g$=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return E.jsx(n$,{...i,...r,ref:t})});g$.displayName=m$;var y$="DropdownMenuRadioItem",v3=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return E.jsx(r$,{...i,...r,ref:t})});v3.displayName=y$;var v$="DropdownMenuItemIndicator",w3=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return E.jsx(i$,{...i,...r,ref:t})});w3.displayName=v$;var w$="DropdownMenuSeparator",b3=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return E.jsx(a$,{...i,...r,ref:t})});b3.displayName=w$;var b$="DropdownMenuArrow",x$=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return E.jsx(o$,{...i,...r,ref:t})});x$.displayName=b$;var E$="DropdownMenuSubTrigger",x3=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return E.jsx(s$,{...i,...r,ref:t})});x3.displayName=E$;var T$="DropdownMenuSubContent",E3=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return E.jsx(u$,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});E3.displayName=T$;var _$=l3,S$=d3,T3=p3,C$=h3,_3=m3,S3=g3,C3=y3,A3=v3,k3=w3,R3=b3,N3=x3,P3=E3;const A$=_$,k$=S$,R$=C$,N$=v.forwardRef(({className:e,inset:t,children:n,...r},i)=>E.jsxs(N3,{ref:i,className:Le("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...r,children:[n,E.jsx(S_,{className:"ml-auto"})]}));N$.displayName=N3.displayName;const P$=v.forwardRef(({className:e,...t},n)=>E.jsx(P3,{ref:n,className:Le("z-50 min-w-[8rem] overflow-hidden rounded-2xl border bg-background p-1 text-foreground shadow-2xl data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));P$.displayName=P3.displayName;const I3=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>E.jsx(T3,{ref:r,sideOffset:t,className:Le("z-50 min-w-[8rem] overflow-hidden rounded-2xl border bg-background p-1 text-foreground shadow-2xl","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));I3.displayName=T3.displayName;const O3=v.forwardRef(({className:e,inset:t,...n},r)=>E.jsx(fn,{children:E.jsx(S3,{ref:r,className:Le("relative flex cursor-default select-none items-center gap-2 rounded-xl px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...n})}));O3.displayName=S3.displayName;const I$=v.forwardRef(({className:e,children:t,checked:n,...r},i)=>E.jsxs(C3,{ref:i,className:Le("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[E.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:E.jsx(k3,{children:E.jsx(uF,{className:"h-4 w-4"})})}),t]}));I$.displayName=C3.displayName;const O$=v.forwardRef(({className:e,children:t,...n},r)=>E.jsxs(A3,{ref:r,className:Le("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[E.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:E.jsx(k3,{children:E.jsx(fF,{className:"h-2 w-2 fill-current"})})}),t]}));O$.displayName=A3.displayName;const D$=v.forwardRef(({className:e,inset:t,...n},r)=>E.jsx(_3,{ref:r,className:Le("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));D$.displayName=_3.displayName;const L$=v.forwardRef(({className:e,...t},n)=>E.jsx(R3,{ref:n,className:Le("-mx-1 my-1 h-px bg-muted",e),...t}));L$.displayName=R3.displayName;function M$({className:e,...t}){return E.jsx("div",{className:Le("animate-pulse rounded-md bg-secondary",e),...t})}function w1(){const{widgetCtx:e}=zn();return{routerState:fl(e.routerCtx.state),toSessionsScreen:e.routerCtx.toSessionsScreen,toChatScreen:e.routerCtx.toChatScreen}}function F$(){const e=Jf(),[t,n]=v.useState(!1),{widgetCtx:r}=zn();return E.jsxs(A$,{open:t,onOpenChange:n,children:[E.jsx(k$,{asChild:!0,children:E.jsx(or,{variant:"ghost",size:"fit",className:"rounded-full",children:E.jsx(pF,{className:"size-4"})})}),E.jsx(I3,{align:"end",className:"min-w-56",children:E.jsx(R$,{children:E.jsxs(O3,{onSelect:()=>{r.resetChat(),n(!1)},children:[E.jsx(us.div,{initial:{opacity:0,x:-4,rotate:360},animate:{opacity:1,x:0,rotate:0},children:E.jsx(vF,{})}),e.get("new-conversation")]})})})]})}function B$(){var i;const{toSessionsScreen:e}=w1(),{data:t,isLoading:n}=Df(),r=xl();return E.jsx("header",{className:"p-2 border-b bg-background",children:E.jsxs("div",{dir:r,className:"flex items-center rtl:flex-row-reverse gap-2",children:[E.jsx(or,{variant:"ghost",size:"fit",className:"rounded-full",onClick:e,children:E.jsx(lF,{className:"size-4"})}),E.jsx("div",{className:"flex-1 pl-2",children:n?E.jsx(M$,{className:"h-4 w-2/3"}):E.jsx("h2",{className:"font-semibold",children:(i=t==null?void 0:t.data)==null?void 0:i.organizationName})}),E.jsx(F$,{})]})})}function j$(e){const t=[];let n=null;return e.forEach(r=>{var i,a,o,s;(!n||((i=n[0])==null?void 0:i.type)!==r.type)&&(n=[],t.push(n)),((a=n[0])==null?void 0:a.type)==="FROM_AGENT"&&r.type==="FROM_AGENT"&&((o=r.agent)==null?void 0:o.id)!==((s=n[0].agent)==null?void 0:s.id)&&(n=[],t.push(n)),n.push(r)}),t}function U$(e){var t;return((t=e==null?void 0:e[0])==null?void 0:t.type)==="FROM_USER"}function H$(e){var t;return((t=e==null?void 0:e[0])==null?void 0:t.type)==="FROM_BOT"}function z$(e){var t;return((t=e==null?void 0:e[0])==null?void 0:t.type)==="FROM_AGENT"}function b1({message:e,Wrapper:t,wrapperProps:n}){const{componentStore:r}=zn(),i=r.getComponent(e.component,!1),a=xl();return i?t?v.createElement(t,{...n,key:e.id,"data-test":`message-wrapper-${e.id}`},E.jsx(i,{...e,id:e.id})):E.jsx("div",{"data-test":`message-${e.id}`,dir:a,children:v.createElement(i,{...e,id:e.id,key:e.id})}):null}function x1({children:e,className:t,messageId:n}){return E.jsx("div",{className:Le("w-fit space-y-2",t),"data-test":`message-wrapper-${n}`,children:E.jsx("div",{"data-test":"message-content-wrapper",className:Le("w-fit p-2 rounded-2xl text-sm","bg-secondary border shadow-sm"),children:e})})}const gp=43200,D3=1440,L3=Symbol.for("constructDateFrom");function M3(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&L3 in e?e[L3](t):e instanceof Date?new e.constructor(t):new Date(t)}function ma(e,t){return M3(e,e)}let V$={};function $$(){return V$}function F3(e){const t=ma(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function E1(e,...t){const n=M3.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function yp(e,t){const n=+ma(e)-+ma(t);return n<0?-1:n>0?1:n}function W$(e,t,n){const[r,i]=E1(n==null?void 0:n.in,e,t),a=r.getFullYear()-i.getFullYear(),o=r.getMonth()-i.getMonth();return a*12+o}function Y$(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function q$(e,t){return+ma(e)-+ma(t)}function G$(e,t){const n=ma(e);return n.setHours(23,59,59,999),n}function K$(e,t){const n=ma(e),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function X$(e,t){const n=ma(e);return+G$(n)==+K$(n)}function Q$(e,t,n){const[r,i,a]=E1(n==null?void 0:n.in,e,e,t),o=yp(i,a),s=Math.abs(W$(i,a));if(s<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-o*s);let u=yp(i,a)===-o;X$(r)&&s===1&&yp(r,a)===1&&(u=!1);const l=o*(s-+u);return l===0?0:l}function Z$(e,t,n){const r=q$(e,t)/1e3;return Y$(n==null?void 0:n.roundingMethod)(r)}const J$={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},eW=(e,t,n)=>{let r;const i=J$[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function T1(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const tW={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},nW={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},rW={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},iW={date:T1({formats:tW,defaultWidth:"full"}),time:T1({formats:nW,defaultWidth:"full"}),dateTime:T1({formats:rW,defaultWidth:"full"})},aW={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},oW=(e,t,n,r)=>aW[e];function kl(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,s=n!=null&&n.width?String(n.width):o;i=e.formattingValues[s]||e.formattingValues[o]}else{const o=e.defaultWidth,s=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[s]||e.values[o]}const a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}const sW={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},uW={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},lW={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},cW={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},dW={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},fW={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},pW={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:kl({values:sW,defaultWidth:"wide"}),quarter:kl({values:uW,defaultWidth:"wide",argumentCallback:e=>e-1}),month:kl({values:lW,defaultWidth:"wide"}),day:kl({values:cW,defaultWidth:"wide"}),dayPeriod:kl({values:dW,defaultWidth:"wide",formattingValues:fW,defaultFormattingWidth:"wide"})};function Rl(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;const o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(s)?mW(s,d=>d.test(o)):hW(s,d=>d.test(o));let l;l=e.valueCallback?e.valueCallback(u):u,l=n.valueCallback?n.valueCallback(l):l;const c=t.slice(o.length);return{value:l,rest:c}}}function hW(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function mW(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function gW(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;const s=t.slice(i.length);return{value:o,rest:s}}}const yW=/^(\d+)(th|st|nd|rd)?/i,vW=/\d+/i,wW={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},bW={any:[/^b/i,/^(a|c)/i]},xW={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},EW={any:[/1/i,/2/i,/3/i,/4/i]},TW={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},_W={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},SW={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},CW={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},AW={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},kW={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},RW={ordinalNumber:gW({matchPattern:yW,parsePattern:vW,valueCallback:e=>parseInt(e,10)}),era:Rl({matchPatterns:wW,defaultMatchWidth:"wide",parsePatterns:bW,defaultParseWidth:"any"}),quarter:Rl({matchPatterns:xW,defaultMatchWidth:"wide",parsePatterns:EW,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Rl({matchPatterns:TW,defaultMatchWidth:"wide",parsePatterns:_W,defaultParseWidth:"any"}),day:Rl({matchPatterns:SW,defaultMatchWidth:"wide",parsePatterns:CW,defaultParseWidth:"any"}),dayPeriod:Rl({matchPatterns:AW,defaultMatchWidth:"any",parsePatterns:kW,defaultParseWidth:"any"})},NW={code:"en-US",formatDistance:eW,formatLong:iW,formatRelative:oW,localize:pW,match:RW,options:{weekStartsOn:0,firstWeekContainsDate:1}};function PW(e,t,n){const r=$$(),i=(n==null?void 0:n.locale)??r.locale??NW,a=2520,o=yp(e,t);if(isNaN(o))throw new RangeError("Invalid time value");const s=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:o}),[u,l]=E1(n==null?void 0:n.in,...o>0?[t,e]:[e,t]),c=Z$(l,u),d=(F3(l)-F3(u))/1e3,f=Math.round((c-d)/60);let p;if(f<2)return n!=null&&n.includeSeconds?c<5?i.formatDistance("lessThanXSeconds",5,s):c<10?i.formatDistance("lessThanXSeconds",10,s):c<20?i.formatDistance("lessThanXSeconds",20,s):c<40?i.formatDistance("halfAMinute",0,s):c<60?i.formatDistance("lessThanXMinutes",1,s):i.formatDistance("xMinutes",1,s):f===0?i.formatDistance("lessThanXMinutes",1,s):i.formatDistance("xMinutes",f,s);if(f<45)return i.formatDistance("xMinutes",f,s);if(f<90)return i.formatDistance("aboutXHours",1,s);if(f<D3){const m=Math.round(f/60);return i.formatDistance("aboutXHours",m,s)}else{if(f<a)return i.formatDistance("xDays",1,s);if(f<gp){const m=Math.round(f/D3);return i.formatDistance("xDays",m,s)}else if(f<gp*2)return p=Math.round(f/gp),i.formatDistance("aboutXMonths",p,s)}if(p=Q$(l,u),p<12){const m=Math.round(f/gp);return i.formatDistance("xMonths",m,s)}else{const m=p%12,g=Math.trunc(p/12);return m<3?i.formatDistance("aboutXYears",g,s):m<9?i.formatDistance("overXYears",g,s):i.formatDistance("almostXYears",g+1,s)}}var _1="Avatar",[IW,Xie]=la(_1),[OW,B3]=IW(_1),j3=v.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,a]=v.useState("idle");return E.jsx(OW,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:a,children:E.jsx(Vn.span,{...r,ref:t})})});j3.displayName=_1;var U3="AvatarImage",H3=v.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...a}=e,o=B3(U3,n),s=DW(r,a.referrerPolicy),u=Wt(l=>{i(l),o.onImageLoadingStatusChange(l)});return ar(()=>{s!=="idle"&&u(s)},[s,u]),s==="loaded"?E.jsx(Vn.img,{...a,ref:t,src:r}):null});H3.displayName=U3;var z3="AvatarFallback",V3=v.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,a=B3(z3,n),[o,s]=v.useState(r===void 0);return v.useEffect(()=>{if(r!==void 0){const u=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(u)}},[r]),o&&a.imageLoadingStatus!=="loaded"?E.jsx(Vn.span,{...i,ref:t}):null});V3.displayName=z3;function DW(e,t){const[n,r]=v.useState("idle");return ar(()=>{if(!e){r("error");return}let i=!0;const a=new window.Image,o=s=>()=>{i&&r(s)};return r("loading"),a.onload=o("loaded"),a.onerror=o("error"),a.src=e,t&&(a.referrerPolicy=t),()=>{i=!1}},[e,t]),n}var $3=j3,W3=H3,Y3=V3;const vp=v.forwardRef(({className:e,...t},n)=>E.jsx($3,{ref:n,className:Le("relative flex size-6 aspect-square shrink-0 overflow-hidden rounded-full border bg-secondary",e),...t}));vp.displayName=$3.displayName;const S1=v.forwardRef(({className:e,...t},n)=>E.jsx(W3,{ref:n,className:Le("aspect-square h-full w-full",e),...t}));S1.displayName=W3.displayName;const q3=v.forwardRef(({className:e,...t},n)=>E.jsx(Y3,{ref:n,className:Le("flex size-full text-sm items-center justify-center rounded-lg",e),...t}));q3.displayName=Y3.displayName;function G3({attachment:e}){const{name:t,size:n,type:r,url:i}=e,a=r.startsWith("image/"),o=r.startsWith("video/"),s=r.startsWith("audio/");return E.jsxs("div",{className:"size-fit gap-2 border shrink-0 rounded-2xl overflow-hidden",children:[a&&E.jsx("img",{loading:"lazy",src:i,className:"object-cover size-16"}),o&&E.jsxs("video",{controls:!0,children:[E.jsx("source",{src:i,type:r}),"Your browser does not support the video tag."]}),s&&E.jsxs("audio",{controls:!0,className:"w-full mt-2 rounded-md border",children:[E.jsx("source",{src:i,type:r}),"Your browser does not support the audio tag."]}),!a&&!o&&!s&&E.jsxs("div",{className:"flex items-center gap-2 p-2",children:[E.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 line-clamp-2 underline hover:text-blue-600",children:t}),E.jsxs("span",{className:"text-sm text-gray-500 whitespace-nowrap",children:[(n/1024).toFixed(2)," KB"]})]})]})}function LW({message:e}){var t;return v.useMemo(()=>e.deliveredAt?PW(new Date(e.deliveredAt),new Date,{addSuffix:!0}):null,[e.deliveredAt]),E.jsxs("div",{className:"flex flex-col items-end gap-1",children:[E.jsx("div",{className:Le("w-fit p-2 rounded-2xl text-sm","bg-primary text-primary-foreground border shadow-sm"),children:e.content}),e.attachments&&e.attachments.length>0&&E.jsx("div",{className:"flex gap-1 flex-wrap justify-end",children:(t=e.attachments)==null?void 0:t.map(n=>E.jsx(G3,{attachment:n},n.id))})]})}function MW({messages:e}){var n,r;const{user:t}=dl();return E.jsxs("div",{className:Le("group","flex flex-col gap-2 justify-end items-end"),children:[E.jsx(vp,{className:"bg-primary text-primary-foreground",children:E.jsx(S1,{src:(n=t==null?void 0:t.data)==null?void 0:n.avatarUrl,alt:((r=t==null?void 0:t.data)==null?void 0:r.name)||"User avatar"})}),e.map(i=>E.jsx(LW,{message:i},i.id))]})}function FW({messages:e,agent:t}){const{sessionState:n}=ys();return E.jsxs("div",{className:Le("flex flex-col items-start gap-2"),children:[E.jsx(vp,{children:E.jsx(S1,{src:(t==null?void 0:t.avatar)??"",alt:"Agent Icon"})}),e.map(r=>{var i;return E.jsx(b1,{message:r,Wrapper:x1,wrapperProps:{messageId:r.id,sessionId:(i=n.session)==null?void 0:i.id}},r.id)})]})}function BW(){var l;const{messagesState:{messages:e}}=pl(),{isAwaitingBotReply:t}=wC(),{componentStore:n}=zn(),r=dl(),i=v.useMemo(()=>j$(e),[e.length]),a=n.getComponent("loading"),o=v.useRef(null);function s(){setTimeout(()=>{const c=o.current;c&&(c.scrollTop=c.scrollHeight)},0)}v.useEffect(()=>{s()},[e]);const u=e.length===0;return E.jsxs("div",{"data-messages":!0,ref:o,className:"max-h-full scroll-smooth relative flex-1 p-2 space-y-2 overflow-auto",children:[u&&(((l=r.initialMessages)==null?void 0:l.map((c,d)=>E.jsx(b1,{message:{component:"bot_message",data:{message:c},id:`initial-${d}`,type:"FROM_BOT",timestamp:Date.now().toString()},Wrapper:x1},d)))??E.jsx(b1,{message:{component:"bot_message",data:{message:"Hello, how can I help?"},id:"default-welcome",type:"FROM_BOT",agent:r.bot,timestamp:Date.now().toString()},Wrapper:x1},"default-welcome")),i.map((c,d)=>{var p,m;if(!((p=c==null?void 0:c[0])==null?void 0:p.type))return null;if(U$(c))return E.jsx(MW,{messages:c},d);if(H$(c)||z$(c)){const g=(m=c[0])==null?void 0:m.agent;return E.jsx(FW,{messages:c,agent:g},d)}return null}),t&&E.jsx(a,{})]})}function K3({className:e}){return E.jsx(yF,{className:Le("size-4 animate-spin",e)})}function jW(){const{messagesState:{isInitialFetchLoading:e}}=pl(),{sessionState:{session:t}}=ys(),{observedElementRef:n}=L0({fallbackHeight:CE});return E.jsx("div",{ref:n,"data-test":"chat-screen",className:Le(Bd.widgetHeight,"w-full flex flex-col overflow-hidden bg-background"),children:E.jsxs("div",{className:"w-full h-full justify-between flex flex-col relative","data-test":"chat-screen-content",children:[E.jsx(B$,{}),E.jsx(Ja,{mode:"wait",children:e?E.jsx(fn,{className:"flex flex-col items-center justify-center w-full flex-1",children:E.jsx(K3,{})},"loading"):E.jsxs(fn,{className:"flex flex-col w-full flex-1 overflow-auto",snapExit:!0,children:[E.jsx(BW,{}),E.jsx(HH,{})]},(t==null?void 0:t.id)||"chat")})]})})}var Be;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const a={};for(const o of i)a[o]=o;return a},e.getValidEnumValues=i=>{const a=e.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),o={};for(const s of a)o[s]=i[s];return e.objectValues(o)},e.objectValues=i=>e.objectKeys(i).map(function(a){return i[a]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&a.push(o);return a},e.find=(i,a)=>{for(const o of i)if(a(o))return o},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,a=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}e.joinValues=r,e.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(Be||(Be={}));var C1;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(C1||(C1={}));const se=Be.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ga=e=>{switch(typeof e){case"undefined":return se.undefined;case"string":return se.string;case"number":return isNaN(e)?se.nan:se.number;case"boolean":return se.boolean;case"function":return se.function;case"bigint":return se.bigint;case"symbol":return se.symbol;case"object":return Array.isArray(e)?se.array:e===null?se.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?se.promise:typeof Map<"u"&&e instanceof Map?se.map:typeof Set<"u"&&e instanceof Set?se.set:typeof Date<"u"&&e instanceof Date?se.date:se.object;default:return se.unknown}},Z=Be.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),UW=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Yn extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(a){return a.message},r={_errors:[]},i=a=>{for(const o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let s=r,u=0;for(;u<o.path.length;){const l=o.path[u];u===o.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(n(o))):s[l]=s[l]||{_errors:[]},s=s[l],u++}}};return i(this),r}static assert(t){if(!(t instanceof Yn))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Be.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Yn.create=e=>new Yn(e);const Rs=(e,t)=>{let n;switch(e.code){case Z.invalid_type:e.received===se.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Z.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Be.jsonStringifyReplacer)}`;break;case Z.unrecognized_keys:n=`Unrecognized key(s) in object: ${Be.joinValues(e.keys,", ")}`;break;case Z.invalid_union:n="Invalid input";break;case Z.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Be.joinValues(e.options)}`;break;case Z.invalid_enum_value:n=`Invalid enum value. Expected ${Be.joinValues(e.options)}, received '${e.received}'`;break;case Z.invalid_arguments:n="Invalid function arguments";break;case Z.invalid_return_type:n="Invalid function return type";break;case Z.invalid_date:n="Invalid date";break;case Z.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Be.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Z.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Z.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Z.custom:n="Invalid input";break;case Z.invalid_intersection_types:n="Intersection results could not be merged";break;case Z.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Z.not_finite:n="Number must be finite";break;default:n=t.defaultError,Be.assertNever(e)}return{message:n}};let X3=Rs;function HW(e){X3=e}function wp(){return X3}const bp=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s="";const u=r.filter(l=>!!l).slice().reverse();for(const l of u)s=l(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}},zW=[];function oe(e,t){const n=wp(),r=bp({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Rs?void 0:Rs].filter(i=>!!i)});e.common.issues.push(r)}class nn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return be;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n){const a=await i.key,o=await i.value;r.push({key:a,value:o})}return nn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:a,value:o}=i;if(a.status==="aborted"||o.status==="aborted")return be;a.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[a.value]=o.value)}return{status:t.value,value:r}}}const be=Object.freeze({status:"aborted"}),Ns=e=>({status:"dirty",value:e}),pn=e=>({status:"valid",value:e}),A1=e=>e.status==="aborted",k1=e=>e.status==="dirty",Nl=e=>e.status==="valid",Pl=e=>typeof Promise<"u"&&e instanceof Promise;function xp(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function Q3(e,t,n,r,i){if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}typeof SuppressedError=="function"&&SuppressedError;var pe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(pe||(pe={}));var Il,Ol;class Yr{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Z3=(e,t)=>{if(Nl(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Yn(e.common.issues);return this._error=n,this._error}}};function Ce(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(o,s)=>{var u,l;const{message:c}=e;return o.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:(u=c??r)!==null&&u!==void 0?u:s.defaultError}:o.code!=="invalid_type"?{message:s.defaultError}:{message:(l=c??n)!==null&&l!==void 0?l:s.defaultError}},description:i}}class Ne{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return ga(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:ga(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new nn,ctx:{common:t.parent.common,data:t.data,parsedType:ga(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Pl(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ga(t)},a=this._parseSync({data:t,path:i.path,parent:i});return Z3(i,a)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ga(t)},i=this._parse({data:t,path:r.path,parent:r}),a=await(Pl(i)?i:Promise.resolve(i));return Z3(r,a)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,a)=>{const o=t(i),s=()=>a.addIssue({code:Z.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new Rr({schema:this,typeName:ve.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Gr.create(this,this._def)}nullable(){return ba.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return kr.create(this,this._def)}promise(){return Ds.create(this,this._def)}or(t){return Fl.create([this,t],this._def)}and(t){return Bl.create(this,t,this._def)}transform(t){return new Rr({...Ce(this._def),schema:this,typeName:ve.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Vl({...Ce(this._def),innerType:this,defaultValue:n,typeName:ve.ZodDefault})}brand(){return new P1({typeName:ve.ZodBranded,type:this,...Ce(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new $l({...Ce(this._def),innerType:this,catchValue:n,typeName:ve.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Wl.create(this,t)}readonly(){return Yl.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const VW=/^c[^\s-]{8,}$/i,$W=/^[0-9a-z]+$/,WW=/^[0-9A-HJKMNP-TV-Z]{26}$/,YW=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,qW=/^[a-z0-9_-]{21}$/i,GW=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,KW=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,XW="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let R1;const QW=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ZW=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,JW=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,J3="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",eY=new RegExp(`^${J3}$`);function eR(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function tY(e){return new RegExp(`^${eR(e)}$`)}function tR(e){let t=`${J3}T${eR(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function nY(e,t){return!!((t==="v4"||!t)&&QW.test(e)||(t==="v6"||!t)&&ZW.test(e))}class Ar extends Ne{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==se.string){const a=this._getOrReturnCtx(t);return oe(a,{code:Z.invalid_type,expected:se.string,received:a.parsedType}),be}const r=new nn;let i;for(const a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:Z.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")t.data.length>a.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:Z.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const o=t.data.length>a.value,s=t.data.length<a.value;(o||s)&&(i=this._getOrReturnCtx(t,i),o?oe(i,{code:Z.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):s&&oe(i,{code:Z.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")KW.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"email",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")R1||(R1=new RegExp(XW,"u")),R1.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"emoji",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")YW.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"uuid",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")qW.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"nanoid",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")VW.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"cuid",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")$W.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"cuid2",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")WW.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"ulid",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),oe(i,{validation:"url",code:Z.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"regex",code:Z.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(t,i),oe(i,{code:Z.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(i=this._getOrReturnCtx(t,i),oe(i,{code:Z.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(i=this._getOrReturnCtx(t,i),oe(i,{code:Z.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?tR(a).test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{code:Z.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?eY.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{code:Z.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?tY(a).test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{code:Z.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?GW.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"duration",code:Z.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?nY(t.data,a.version)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"ip",code:Z.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?JW.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"base64",code:Z.invalid_string,message:a.message}),r.dirty()):Be.assertNever(a);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:Z.invalid_string,...pe.errToObj(r)})}_addCheck(t){return new Ar({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...pe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...pe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...pe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...pe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...pe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...pe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...pe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...pe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...pe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...pe.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...pe.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...pe.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...pe.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...pe.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...pe.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...pe.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...pe.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...pe.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...pe.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...pe.errToObj(n)})}nonempty(t){return this.min(1,pe.errToObj(t))}trim(){return new Ar({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ar({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ar({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Ar.create=e=>{var t;return new Ar({checks:[],typeName:ve.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ce(e)})};function rY(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,a=parseInt(e.toFixed(i).replace(".","")),o=parseInt(t.toFixed(i).replace(".",""));return a%o/Math.pow(10,i)}class ya extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==se.number){const a=this._getOrReturnCtx(t);return oe(a,{code:Z.invalid_type,expected:se.number,received:a.parsedType}),be}let r;const i=new nn;for(const a of this._def.checks)a.kind==="int"?Be.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),oe(r,{code:Z.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),oe(r,{code:Z.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),oe(r,{code:Z.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?rY(t.data,a.value)!==0&&(r=this._getOrReturnCtx(t,r),oe(r,{code:Z.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),oe(r,{code:Z.not_finite,message:a.message}),i.dirty()):Be.assertNever(a);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,pe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,pe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,pe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,pe.toString(n))}setLimit(t,n,r,i){return new ya({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:pe.toString(i)}]})}_addCheck(t){return new ya({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:pe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:pe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:pe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:pe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:pe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:pe.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:pe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:pe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:pe.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Be.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}ya.create=e=>new ya({checks:[],typeName:ve.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Ce(e)});class va extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==se.bigint){const a=this._getOrReturnCtx(t);return oe(a,{code:Z.invalid_type,expected:se.bigint,received:a.parsedType}),be}let r;const i=new nn;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),oe(r,{code:Z.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),oe(r,{code:Z.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),oe(r,{code:Z.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):Be.assertNever(a);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,pe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,pe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,pe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,pe.toString(n))}setLimit(t,n,r,i){return new va({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:pe.toString(i)}]})}_addCheck(t){return new va({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:pe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:pe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:pe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:pe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:pe.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}va.create=e=>{var t;return new va({checks:[],typeName:ve.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ce(e)})};class Dl extends Ne{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==se.boolean){const r=this._getOrReturnCtx(t);return oe(r,{code:Z.invalid_type,expected:se.boolean,received:r.parsedType}),be}return pn(t.data)}}Dl.create=e=>new Dl({typeName:ve.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Ce(e)});class oo extends Ne{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==se.date){const a=this._getOrReturnCtx(t);return oe(a,{code:Z.invalid_type,expected:se.date,received:a.parsedType}),be}if(isNaN(t.data.getTime())){const a=this._getOrReturnCtx(t);return oe(a,{code:Z.invalid_date}),be}const r=new nn;let i;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:Z.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:Z.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):Be.assertNever(a);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new oo({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:pe.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:pe.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}oo.create=e=>new oo({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ve.ZodDate,...Ce(e)});class Ep extends Ne{_parse(t){if(this._getType(t)!==se.symbol){const r=this._getOrReturnCtx(t);return oe(r,{code:Z.invalid_type,expected:se.symbol,received:r.parsedType}),be}return pn(t.data)}}Ep.create=e=>new Ep({typeName:ve.ZodSymbol,...Ce(e)});class Ll extends Ne{_parse(t){if(this._getType(t)!==se.undefined){const r=this._getOrReturnCtx(t);return oe(r,{code:Z.invalid_type,expected:se.undefined,received:r.parsedType}),be}return pn(t.data)}}Ll.create=e=>new Ll({typeName:ve.ZodUndefined,...Ce(e)});class Ml extends Ne{_parse(t){if(this._getType(t)!==se.null){const r=this._getOrReturnCtx(t);return oe(r,{code:Z.invalid_type,expected:se.null,received:r.parsedType}),be}return pn(t.data)}}Ml.create=e=>new Ml({typeName:ve.ZodNull,...Ce(e)});class Ps extends Ne{constructor(){super(...arguments),this._any=!0}_parse(t){return pn(t.data)}}Ps.create=e=>new Ps({typeName:ve.ZodAny,...Ce(e)});class so extends Ne{constructor(){super(...arguments),this._unknown=!0}_parse(t){return pn(t.data)}}so.create=e=>new so({typeName:ve.ZodUnknown,...Ce(e)});class Ti extends Ne{_parse(t){const n=this._getOrReturnCtx(t);return oe(n,{code:Z.invalid_type,expected:se.never,received:n.parsedType}),be}}Ti.create=e=>new Ti({typeName:ve.ZodNever,...Ce(e)});class Tp extends Ne{_parse(t){if(this._getType(t)!==se.undefined){const r=this._getOrReturnCtx(t);return oe(r,{code:Z.invalid_type,expected:se.void,received:r.parsedType}),be}return pn(t.data)}}Tp.create=e=>new Tp({typeName:ve.ZodVoid,...Ce(e)});class kr extends Ne{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==se.array)return oe(n,{code:Z.invalid_type,expected:se.array,received:n.parsedType}),be;if(i.exactLength!==null){const o=n.data.length>i.exactLength.value,s=n.data.length<i.exactLength.value;(o||s)&&(oe(n,{code:o?Z.too_big:Z.too_small,minimum:s?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(oe(n,{code:Z.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(oe(n,{code:Z.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,s)=>i.type._parseAsync(new Yr(n,o,n.path,s)))).then(o=>nn.mergeArray(r,o));const a=[...n.data].map((o,s)=>i.type._parseSync(new Yr(n,o,n.path,s)));return nn.mergeArray(r,a)}get element(){return this._def.type}min(t,n){return new kr({...this._def,minLength:{value:t,message:pe.toString(n)}})}max(t,n){return new kr({...this._def,maxLength:{value:t,message:pe.toString(n)}})}length(t,n){return new kr({...this._def,exactLength:{value:t,message:pe.toString(n)}})}nonempty(t){return this.min(1,t)}}kr.create=(e,t)=>new kr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ve.ZodArray,...Ce(t)});function Is(e){if(e instanceof mt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Gr.create(Is(r))}return new mt({...e._def,shape:()=>t})}else return e instanceof kr?new kr({...e._def,type:Is(e.element)}):e instanceof Gr?Gr.create(Is(e.unwrap())):e instanceof ba?ba.create(Is(e.unwrap())):e instanceof qr?qr.create(e.items.map(t=>Is(t))):e}class mt extends Ne{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Be.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==se.object){const l=this._getOrReturnCtx(t);return oe(l,{code:Z.invalid_type,expected:se.object,received:l.parsedType}),be}const{status:r,ctx:i}=this._processInputParams(t),{shape:a,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof Ti&&this._def.unknownKeys==="strip"))for(const l in i.data)o.includes(l)||s.push(l);const u=[];for(const l of o){const c=a[l],d=i.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new Yr(i,d,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof Ti){const l=this._def.unknownKeys;if(l==="passthrough")for(const c of s)u.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(l==="strict")s.length>0&&(oe(i,{code:Z.unrecognized_keys,keys:s}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const c of s){const d=i.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new Yr(i,d,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const l=[];for(const c of u){const d=await c.key,f=await c.value;l.push({key:d,value:f,alwaysSet:c.alwaysSet})}return l}).then(l=>nn.mergeObjectSync(r,l)):nn.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(t){return pe.errToObj,new mt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,a,o,s;const u=(o=(a=(i=this._def).errorMap)===null||a===void 0?void 0:a.call(i,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(s=pe.errToObj(t).message)!==null&&s!==void 0?s:u}:{message:u}}}:{}})}strip(){return new mt({...this._def,unknownKeys:"strip"})}passthrough(){return new mt({...this._def,unknownKeys:"passthrough"})}extend(t){return new mt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new mt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ve.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new mt({...this._def,catchall:t})}pick(t){const n={};return Be.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new mt({...this._def,shape:()=>n})}omit(t){const n={};return Be.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new mt({...this._def,shape:()=>n})}deepPartial(){return Is(this)}partial(t){const n={};return Be.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new mt({...this._def,shape:()=>n})}required(t){const n={};return Be.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof Gr;)a=a._def.innerType;n[r]=a}}),new mt({...this._def,shape:()=>n})}keyof(){return nR(Be.objectKeys(this.shape))}}mt.create=(e,t)=>new mt({shape:()=>e,unknownKeys:"strip",catchall:Ti.create(),typeName:ve.ZodObject,...Ce(t)}),mt.strictCreate=(e,t)=>new mt({shape:()=>e,unknownKeys:"strict",catchall:Ti.create(),typeName:ve.ZodObject,...Ce(t)}),mt.lazycreate=(e,t)=>new mt({shape:e,unknownKeys:"strip",catchall:Ti.create(),typeName:ve.ZodObject,...Ce(t)});class Fl extends Ne{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(a){for(const s of a)if(s.result.status==="valid")return s.result;for(const s of a)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;const o=a.map(s=>new Yn(s.ctx.common.issues));return oe(n,{code:Z.invalid_union,unionErrors:o}),be}if(n.common.async)return Promise.all(r.map(async a=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(i);{let a;const o=[];for(const u of r){const l={...n,common:{...n.common,issues:[]},parent:null},c=u._parseSync({data:n.data,path:n.path,parent:l});if(c.status==="valid")return c;c.status==="dirty"&&!a&&(a={result:c,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(u=>new Yn(u));return oe(n,{code:Z.invalid_union,unionErrors:s}),be}}get options(){return this._def.options}}Fl.create=(e,t)=>new Fl({options:e,typeName:ve.ZodUnion,...Ce(t)});const _i=e=>e instanceof Ul?_i(e.schema):e instanceof Rr?_i(e.innerType()):e instanceof Hl?[e.value]:e instanceof wa?e.options:e instanceof zl?Be.objectValues(e.enum):e instanceof Vl?_i(e._def.innerType):e instanceof Ll?[void 0]:e instanceof Ml?[null]:e instanceof Gr?[void 0,..._i(e.unwrap())]:e instanceof ba?[null,..._i(e.unwrap())]:e instanceof P1||e instanceof Yl?_i(e.unwrap()):e instanceof $l?_i(e._def.innerType):[];class _p extends Ne{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==se.object)return oe(n,{code:Z.invalid_type,expected:se.object,received:n.parsedType}),be;const r=this.discriminator,i=n.data[r],a=this.optionsMap.get(i);return a?n.common.async?a._parseAsync({data:n.data,path:n.path,parent:n}):a._parseSync({data:n.data,path:n.path,parent:n}):(oe(n,{code:Z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),be)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const a of n){const o=_i(a.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const s of o){if(i.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);i.set(s,a)}}return new _p({typeName:ve.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Ce(r)})}}function N1(e,t){const n=ga(e),r=ga(t);if(e===t)return{valid:!0,data:e};if(n===se.object&&r===se.object){const i=Be.objectKeys(t),a=Be.objectKeys(e).filter(s=>i.indexOf(s)!==-1),o={...e,...t};for(const s of a){const u=N1(e[s],t[s]);if(!u.valid)return{valid:!1};o[s]=u.data}return{valid:!0,data:o}}else if(n===se.array&&r===se.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let a=0;a<e.length;a++){const o=e[a],s=t[a],u=N1(o,s);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return n===se.date&&r===se.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Bl extends Ne{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(a,o)=>{if(A1(a)||A1(o))return be;const s=N1(a.value,o.value);return s.valid?((k1(a)||k1(o))&&n.dirty(),{status:n.value,value:s.data}):(oe(r,{code:Z.invalid_intersection_types}),be)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,o])=>i(a,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Bl.create=(e,t,n)=>new Bl({left:e,right:t,typeName:ve.ZodIntersection,...Ce(n)});class qr extends Ne{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==se.array)return oe(r,{code:Z.invalid_type,expected:se.array,received:r.parsedType}),be;if(r.data.length<this._def.items.length)return oe(r,{code:Z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),be;!this._def.rest&&r.data.length>this._def.items.length&&(oe(r,{code:Z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...r.data].map((o,s)=>{const u=this._def.items[s]||this._def.rest;return u?u._parse(new Yr(r,o,r.path,s)):null}).filter(o=>!!o);return r.common.async?Promise.all(a).then(o=>nn.mergeArray(n,o)):nn.mergeArray(n,a)}get items(){return this._def.items}rest(t){return new qr({...this._def,rest:t})}}qr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new qr({items:e,typeName:ve.ZodTuple,rest:null,...Ce(t)})};class jl extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==se.object)return oe(r,{code:Z.invalid_type,expected:se.object,received:r.parsedType}),be;const i=[],a=this._def.keyType,o=this._def.valueType;for(const s in r.data)i.push({key:a._parse(new Yr(r,s,r.path,s)),value:o._parse(new Yr(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?nn.mergeObjectAsync(n,i):nn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Ne?new jl({keyType:t,valueType:n,typeName:ve.ZodRecord,...Ce(r)}):new jl({keyType:Ar.create(),valueType:t,typeName:ve.ZodRecord,...Ce(n)})}}class Sp extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==se.map)return oe(r,{code:Z.invalid_type,expected:se.map,received:r.parsedType}),be;const i=this._def.keyType,a=this._def.valueType,o=[...r.data.entries()].map(([s,u],l)=>({key:i._parse(new Yr(r,s,r.path,[l,"key"])),value:a._parse(new Yr(r,u,r.path,[l,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const u of o){const l=await u.key,c=await u.value;if(l.status==="aborted"||c.status==="aborted")return be;(l.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(l.value,c.value)}return{status:n.value,value:s}})}else{const s=new Map;for(const u of o){const l=u.key,c=u.value;if(l.status==="aborted"||c.status==="aborted")return be;(l.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(l.value,c.value)}return{status:n.value,value:s}}}}Sp.create=(e,t,n)=>new Sp({valueType:t,keyType:e,typeName:ve.ZodMap,...Ce(n)});class uo extends Ne{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==se.set)return oe(r,{code:Z.invalid_type,expected:se.set,received:r.parsedType}),be;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(oe(r,{code:Z.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(oe(r,{code:Z.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const a=this._def.valueType;function o(u){const l=new Set;for(const c of u){if(c.status==="aborted")return be;c.status==="dirty"&&n.dirty(),l.add(c.value)}return{status:n.value,value:l}}const s=[...r.data.values()].map((u,l)=>a._parse(new Yr(r,u,r.path,l)));return r.common.async?Promise.all(s).then(u=>o(u)):o(s)}min(t,n){return new uo({...this._def,minSize:{value:t,message:pe.toString(n)}})}max(t,n){return new uo({...this._def,maxSize:{value:t,message:pe.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}uo.create=(e,t)=>new uo({valueType:e,minSize:null,maxSize:null,typeName:ve.ZodSet,...Ce(t)});class Os extends Ne{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==se.function)return oe(n,{code:Z.invalid_type,expected:se.function,received:n.parsedType}),be;function r(s,u){return bp({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,wp(),Rs].filter(l=>!!l),issueData:{code:Z.invalid_arguments,argumentsError:u}})}function i(s,u){return bp({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,wp(),Rs].filter(l=>!!l),issueData:{code:Z.invalid_return_type,returnTypeError:u}})}const a={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof Ds){const s=this;return pn(async function(...u){const l=new Yn([]),c=await s._def.args.parseAsync(u,a).catch(p=>{throw l.addIssue(r(u,p)),l}),d=await Reflect.apply(o,this,c);return await s._def.returns._def.type.parseAsync(d,a).catch(p=>{throw l.addIssue(i(d,p)),l})})}else{const s=this;return pn(function(...u){const l=s._def.args.safeParse(u,a);if(!l.success)throw new Yn([r(u,l.error)]);const c=Reflect.apply(o,this,l.data),d=s._def.returns.safeParse(c,a);if(!d.success)throw new Yn([i(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Os({...this._def,args:qr.create(t).rest(so.create())})}returns(t){return new Os({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Os({args:t||qr.create([]).rest(so.create()),returns:n||so.create(),typeName:ve.ZodFunction,...Ce(r)})}}class Ul extends Ne{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Ul.create=(e,t)=>new Ul({getter:e,typeName:ve.ZodLazy,...Ce(t)});class Hl extends Ne{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return oe(n,{received:n.data,code:Z.invalid_literal,expected:this._def.value}),be}return{status:"valid",value:t.data}}get value(){return this._def.value}}Hl.create=(e,t)=>new Hl({value:e,typeName:ve.ZodLiteral,...Ce(t)});function nR(e,t){return new wa({values:e,typeName:ve.ZodEnum,...Ce(t)})}class wa extends Ne{constructor(){super(...arguments),Il.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return oe(n,{expected:Be.joinValues(r),received:n.parsedType,code:Z.invalid_type}),be}if(xp(this,Il)||Q3(this,Il,new Set(this._def.values)),!xp(this,Il).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return oe(n,{received:n.data,code:Z.invalid_enum_value,options:r}),be}return pn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return wa.create(t,{...this._def,...n})}exclude(t,n=this._def){return wa.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}Il=new WeakMap,wa.create=nR;class zl extends Ne{constructor(){super(...arguments),Ol.set(this,void 0)}_parse(t){const n=Be.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==se.string&&r.parsedType!==se.number){const i=Be.objectValues(n);return oe(r,{expected:Be.joinValues(i),received:r.parsedType,code:Z.invalid_type}),be}if(xp(this,Ol)||Q3(this,Ol,new Set(Be.getValidEnumValues(this._def.values))),!xp(this,Ol).has(t.data)){const i=Be.objectValues(n);return oe(r,{received:r.data,code:Z.invalid_enum_value,options:i}),be}return pn(t.data)}get enum(){return this._def.values}}Ol=new WeakMap,zl.create=(e,t)=>new zl({values:e,typeName:ve.ZodNativeEnum,...Ce(t)});class Ds extends Ne{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==se.promise&&n.common.async===!1)return oe(n,{code:Z.invalid_type,expected:se.promise,received:n.parsedType}),be;const r=n.parsedType===se.promise?n.data:Promise.resolve(n.data);return pn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Ds.create=(e,t)=>new Ds({type:e,typeName:ve.ZodPromise,...Ce(t)});class Rr extends Ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ve.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,a={addIssue:o=>{oe(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){const o=i.transform(r.data,a);if(r.common.async)return Promise.resolve(o).then(async s=>{if(n.value==="aborted")return be;const u=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return u.status==="aborted"?be:u.status==="dirty"||n.value==="dirty"?Ns(u.value):u});{if(n.value==="aborted")return be;const s=this._def.schema._parseSync({data:o,path:r.path,parent:r});return s.status==="aborted"?be:s.status==="dirty"||n.value==="dirty"?Ns(s.value):s}}if(i.type==="refinement"){const o=s=>{const u=i.refinement(s,a);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?be:(s.status==="dirty"&&n.dirty(),o(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?be:(s.status==="dirty"&&n.dirty(),o(s.value).then(()=>({status:n.value,value:s.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Nl(o))return o;const s=i.transform(o.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>Nl(o)?Promise.resolve(i.transform(o.value,a)).then(s=>({status:n.value,value:s})):o);Be.assertNever(i)}}Rr.create=(e,t,n)=>new Rr({schema:e,typeName:ve.ZodEffects,effect:t,...Ce(n)}),Rr.createWithPreprocess=(e,t,n)=>new Rr({schema:t,effect:{type:"preprocess",transform:e},typeName:ve.ZodEffects,...Ce(n)});class Gr extends Ne{_parse(t){return this._getType(t)===se.undefined?pn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Gr.create=(e,t)=>new Gr({innerType:e,typeName:ve.ZodOptional,...Ce(t)});class ba extends Ne{_parse(t){return this._getType(t)===se.null?pn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ba.create=(e,t)=>new ba({innerType:e,typeName:ve.ZodNullable,...Ce(t)});class Vl extends Ne{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===se.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Vl.create=(e,t)=>new Vl({innerType:e,typeName:ve.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ce(t)});class $l extends Ne{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Pl(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Yn(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Yn(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}$l.create=(e,t)=>new $l({innerType:e,typeName:ve.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ce(t)});class Cp extends Ne{_parse(t){if(this._getType(t)!==se.nan){const r=this._getOrReturnCtx(t);return oe(r,{code:Z.invalid_type,expected:se.nan,received:r.parsedType}),be}return{status:"valid",value:t.data}}}Cp.create=e=>new Cp({typeName:ve.ZodNaN,...Ce(e)});const iY=Symbol("zod_brand");class P1 extends Ne{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Wl extends Ne{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?be:a.status==="dirty"?(n.dirty(),Ns(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?be:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new Wl({in:t,out:n,typeName:ve.ZodPipeline})}}class Yl extends Ne{_parse(t){const n=this._def.innerType._parse(t),r=i=>(Nl(i)&&(i.value=Object.freeze(i.value)),i);return Pl(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}Yl.create=(e,t)=>new Yl({innerType:e,typeName:ve.ZodReadonly,...Ce(t)});function rR(e,t={},n){return e?Ps.create().superRefine((r,i)=>{var a,o;if(!e(r)){const s=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,u=(o=(a=s.fatal)!==null&&a!==void 0?a:n)!==null&&o!==void 0?o:!0,l=typeof s=="string"?{message:s}:s;i.addIssue({code:"custom",...l,fatal:u})}}):Ps.create()}const aY={object:mt.lazycreate};var ve;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ve||(ve={}));const oY=(e,t={message:`Input not instance of ${e.name}`})=>rR(n=>n instanceof e,t),iR=Ar.create,aR=ya.create,sY=Cp.create,uY=va.create,oR=Dl.create,lY=oo.create,cY=Ep.create,dY=Ll.create,fY=Ml.create,pY=Ps.create,hY=so.create,mY=Ti.create,gY=Tp.create,yY=kr.create,vY=mt.create,wY=mt.strictCreate,bY=Fl.create,xY=_p.create,EY=Bl.create,TY=qr.create,_Y=jl.create,SY=Sp.create,CY=uo.create,AY=Os.create,kY=Ul.create,RY=Hl.create,NY=wa.create,PY=zl.create,IY=Ds.create,sR=Rr.create,OY=Gr.create,DY=ba.create,LY=Rr.createWithPreprocess,MY=Wl.create;var I1=Object.freeze({__proto__:null,defaultErrorMap:Rs,setErrorMap:HW,getErrorMap:wp,makeIssue:bp,EMPTY_PATH:zW,addIssueToContext:oe,ParseStatus:nn,INVALID:be,DIRTY:Ns,OK:pn,isAborted:A1,isDirty:k1,isValid:Nl,isAsync:Pl,get util(){return Be},get objectUtil(){return C1},ZodParsedType:se,getParsedType:ga,ZodType:Ne,datetimeRegex:tR,ZodString:Ar,ZodNumber:ya,ZodBigInt:va,ZodBoolean:Dl,ZodDate:oo,ZodSymbol:Ep,ZodUndefined:Ll,ZodNull:Ml,ZodAny:Ps,ZodUnknown:so,ZodNever:Ti,ZodVoid:Tp,ZodArray:kr,ZodObject:mt,ZodUnion:Fl,ZodDiscriminatedUnion:_p,ZodIntersection:Bl,ZodTuple:qr,ZodRecord:jl,ZodMap:Sp,ZodSet:uo,ZodFunction:Os,ZodLazy:Ul,ZodLiteral:Hl,ZodEnum:wa,ZodNativeEnum:zl,ZodPromise:Ds,ZodEffects:Rr,ZodTransformer:Rr,ZodOptional:Gr,ZodNullable:ba,ZodDefault:Vl,ZodCatch:$l,ZodNaN:Cp,BRAND:iY,ZodBranded:P1,ZodPipeline:Wl,ZodReadonly:Yl,custom:rR,Schema:Ne,ZodSchema:Ne,late:aY,get ZodFirstPartyTypeKind(){return ve},coerce:{string:e=>Ar.create({...e,coerce:!0}),number:e=>ya.create({...e,coerce:!0}),boolean:e=>Dl.create({...e,coerce:!0}),bigint:e=>va.create({...e,coerce:!0}),date:e=>oo.create({...e,coerce:!0})},any:pY,array:yY,bigint:uY,boolean:oR,date:lY,discriminatedUnion:xY,effect:sR,enum:NY,function:AY,instanceof:oY,intersection:EY,lazy:kY,literal:RY,map:SY,nan:sY,nativeEnum:PY,never:mY,null:fY,nullable:DY,number:aR,object:vY,oboolean:()=>oR().optional(),onumber:()=>aR().optional(),optional:OY,ostring:()=>iR().optional(),pipeline:MY,preprocess:LY,promise:IY,record:_Y,set:CY,strictObject:wY,string:iR,symbol:cY,transformer:sR,tuple:TY,undefined:dY,union:bY,unknown:hY,void:gY,NEVER:be,ZodIssueCode:Z,quotelessJson:UW,ZodError:Yn});const O1=v.forwardRef(({className:e,type:t,...n},r)=>{const i=xl();return E.jsx(ep,{ref:r,children:E.jsx("input",{dir:i,type:t,className:Le("flex w-full rounded-xl border border-input bg-background p-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-primary-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 transition","rtl:placeholder:text-right",e),...n})})});O1.displayName="Input";const FY=I1.object({name:I1.string().min(2),email:I1.string().email()});function BY(){var s,u,l;const{createUnverifiedContact:e}=X7(),t=dl(),n=Jf(),{data:r}=Df(),{observedElementRef:i}=L0({fallbackHeight:tL}),[a,o]=jj(async c=>{c.preventDefault();const d=new FormData(c.currentTarget),f=Object.fromEntries(d.entries()),p=FY.safeParse(f);p.success&&await e({email:p.data.email,name:p.data.name})});return E.jsxs("div",{ref:i,"data-test":"welcome-screen",className:Le(Bd.widgetMinHeight,"h-fit bg-primary flex flex-col"),children:[E.jsxs("div",{dir:"auto",className:"flex-1 flex flex-col px-4 py-12 text-start space-y-4 relative z-10","data-test":"welcome-header",children:[E.jsx("div",{className:"flex items-center justify-between w-full mb-2","data-test":"welcome-logo-container",children:(s=t.assets)!=null&&s.organizationLogo?E.jsx("img",{src:(u=t.assets)==null?void 0:u.organizationLogo,alt:"Company Logo",className:"h-8 w-auto object-contain","data-test":"organization-logo"}):E.jsx("h2",{className:"font-bold text-xl text-primary-foreground","data-test":"organization-name",dir:"auto",children:(l=r==null?void 0:r.data)==null?void 0:l.organizationName})}),E.jsxs("div",{className:"space-y-2","data-test":"welcome-content",children:[E.jsx("h1",{className:"text-2xl font-bold text-primary-foreground","data-test":"welcome-title",dir:"auto",children:n.get("welcome-title")}),E.jsx("p",{className:"text-primary-foreground/90 text-sm max-w-[320px] leading-relaxed","data-test":"welcome-description",dir:"auto",children:n.get("welcome-description")})]})]}),E.jsx("div",{className:"p-2 bg-background rounded-t-3xl","data-test":"welcome-form-container",dir:"auto",children:E.jsxs("form",{onSubmit:o,className:"space-y-2","data-test":"welcome-form",children:[E.jsxs("div",{className:"space-y-2",children:[E.jsx(O1,{required:!0,autoFocus:!0,placeholder:n.get("your-name"),name:"name",className:"rounded-3xl pl-3","data-test":"name-input"}),E.jsx(O1,{required:!0,type:"email",placeholder:n.get("your-email"),name:"email",className:"rounded-3xl pl-3","data-test":"email-input"})]}),E.jsxs(or,{disabled:a.loading,className:"w-full rounded-3xl","data-test":"start-chat-button",size:"lg",children:[a.loading?n.get("starting-chat"):n.get("start-chat"),E.jsx(C_,{className:"size-4 rtl:-scale-100"})]})]})})]})}function jY(){const{toChatScreen:e}=w1(),{sessionsState:{data:t,isInitialFetchLoading:n}}=ys(),{observedElementRef:r}=L0({fallbackHeight:CE});return E.jsx("div",{ref:r,className:Le(Bd.widgetHeight,"w-full flex flex-col overflow-hidden bg-background"),children:E.jsx("div",{className:"size-full overflow-scroll p-2",children:E.jsx(Ja,{mode:"wait",children:n?E.jsx(fn,{className:"size-full flex items-center justify-center",children:E.jsx(K3,{})},"loading"):E.jsx(fn,{className:"size-full flex flex-col gap-2 relative",children:t.length?E.jsxs(E.Fragment,{children:[t.map(i=>E.jsxs(or,{variant:"outline",size:"lg",className:"rounded-3xl p-2.5 pr-2 flex text-start justify-between w-full whitespace-normal",onClick:()=>e(i.id),children:[E.jsx("p",{className:"line-clamp-2 overflow-hidden text-ellipsis",children:i.lastMessage}),E.jsx(S_,{className:"size-4 text-muted-foreground shrink-0"})]},i.id)),E.jsx("div",{},"spacer"),E.jsx(or,{size:"lg",className:"mt-auto w-full rounded-3xl sticky bottom-0",onClick:()=>e(),children:"New chat"},"new-session")]}):E.jsxs("div",{className:"size-full flex flex-col gap-2 items-center",children:[E.jsx("div",{className:"flex-1 flex items-center justify-center",children:E.jsx("p",{className:"text-muted-foreground",children:"No conversations yet"})}),E.jsx(or,{size:"lg",className:"w-full rounded-3xl",onClick:()=>e(),children:"Start your first chat"},"new-session")]})},"sessions")})})})}function UY(){Df();const{routerState:{screen:e}}=w1();return E.jsx("div",{className:"bg-background size-full","data-test":"root-screen",children:E.jsx(Ja,{mode:"wait",children:(()=>{switch(e){case"welcome":return E.jsx(fn,{fadeIn:"right",className:"size-full",snapExit:!0,children:E.jsx(BY,{})},e);case"sessions":return E.jsx(fn,{fadeIn:"right",className:"size-full",snapExit:!0,children:E.jsx(jY,{})},e);case"chat":return E.jsx(fn,{fadeIn:"right",className:"size-full",snapExit:!0,children:E.jsx(jW,{})},e);default:return null}})()})})}var D1="focusScope.autoFocusOnMount",L1="focusScope.autoFocusOnUnmount",uR={bubbles:!1,cancelable:!0},HY="FocusScope",lR=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,u]=v.useState(null),l=Wt(i),c=Wt(a),d=v.useRef(null),f=Vr(t,g=>u(g)),p=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let g=function(b){if(p.paused||!s)return;const T=b.target;s.contains(T)?d.current=T:xa(d.current,{select:!0})},x=function(b){if(p.paused||!s)return;const T=b.relatedTarget;T!==null&&(s.contains(T)||xa(d.current,{select:!0}))},y=function(b){if(document.activeElement===document.body)for(const S of b)S.removedNodes.length>0&&xa(s)};document.addEventListener("focusin",g),document.addEventListener("focusout",x);const w=new MutationObserver(y);return s&&w.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",x),w.disconnect()}}},[r,s,p.paused]),v.useEffect(()=>{if(s){fR.add(p);const g=document.activeElement;if(!s.contains(g)){const y=new CustomEvent(D1,uR);s.addEventListener(D1,l),s.dispatchEvent(y),y.defaultPrevented||(zY(qY(cR(s)),{select:!0}),document.activeElement===g&&xa(s))}return()=>{s.removeEventListener(D1,l),setTimeout(()=>{const y=new CustomEvent(L1,uR);s.addEventListener(L1,c),s.dispatchEvent(y),y.defaultPrevented||xa(g??document.body,{select:!0}),s.removeEventListener(L1,c),fR.remove(p)},0)}}},[s,l,c,p]);const m=v.useCallback(g=>{if(!n&&!r||p.paused)return;const x=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,y=document.activeElement;if(x&&y){const w=g.currentTarget,[b,T]=VY(w);b&&T?!g.shiftKey&&y===T?(g.preventDefault(),n&&xa(b,{select:!0})):g.shiftKey&&y===b&&(g.preventDefault(),n&&xa(T,{select:!0})):y===w&&g.preventDefault()}},[n,r,p.paused]);return E.jsx(Vn.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});lR.displayName=HY;function zY(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(xa(r,{select:t}),document.activeElement!==n)return}function VY(e){const t=cR(e),n=dR(t,e),r=dR(t.reverse(),e);return[n,r]}function cR(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function dR(e,t){for(const n of e)if(!$Y(n,{upTo:t}))return n}function $Y(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function WY(e){return e instanceof HTMLInputElement&&"select"in e}function xa(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&WY(e)&&t&&e.select()}}var fR=YY();function YY(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=pR(e,t),e.unshift(t)},remove(t){var n;e=pR(e,t),(n=e[0])==null||n.resume()}}}function pR(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function qY(e){return e.filter(t=>t.tagName!=="A")}var Ap="right-scroll-bar-position",kp="width-before-scroll-bar",GY="with-scroll-bars-hidden",KY="--removed-body-scroll-bar-size";function M1(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function XY(e,t){var n=v.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var QY=typeof window<"u"?v.useLayoutEffect:v.useEffect,hR=new WeakMap;function ZY(e,t){var n=XY(null,function(r){return e.forEach(function(i){return M1(i,r)})});return QY(function(){var r=hR.get(n);if(r){var i=new Set(r),a=new Set(e),o=n.current;i.forEach(function(s){a.has(s)||M1(s,null)}),a.forEach(function(s){i.has(s)||M1(s,o)})}hR.set(n,e)},[e]),n}var mR=Ck(),F1=function(){},Rp=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:F1,onWheelCapture:F1,onTouchMoveCapture:F1}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,u=e.className,l=e.removeScrollBar,c=e.enabled,d=e.shards,f=e.sideCar,p=e.noIsolation,m=e.inert,g=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,w=e.gapMode,b=il(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=f,S=ZY([n,t]),_=Lt(Lt({},b),i);return v.createElement(v.Fragment,null,c&&v.createElement(T,{sideCar:mR,removeScrollBar:l,shards:d,noIsolation:p,inert:m,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:w}),o?v.cloneElement(v.Children.only(s),Lt(Lt({},_),{ref:S})):v.createElement(y,Lt({},_,{className:u,ref:S}),s))});Rp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Rp.classNames={fullWidth:kp,zeroRight:Ap};var JY={left:0,top:0,right:0,gap:0},B1=function(e){return parseInt(e||"",10)||0},eq=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[B1(n),B1(r),B1(i)]},tq=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return JY;var t=eq(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},nq=l1(),Ls="data-scroll-locked",rq=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n="margin"),`
381
+ `)},vV=0,As=[];function wV(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(vV++)[0],a=v.useState(c1)[0],o=v.useRef(e);v.useEffect(function(){o.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var g=lf([e.lockRef.current],(e.shards||[]).map(Fk),!0).filter(Boolean);return g.forEach(function(x){return x.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),g.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=v.useCallback(function(g,x){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!o.current.allowPinchZoom;var y=dp(g),w=n.current,b="deltaX"in g?g.deltaX:w[0]-y[0],T="deltaY"in g?g.deltaY:w[1]-y[1],S,_=g.target,N=Math.abs(b)>Math.abs(T)?"h":"v";if("touches"in g&&N==="h"&&_.type==="range")return!1;var D=Ok(N,_);if(!D)return!0;if(D?S=N:(S=N==="v"?"h":"v",D=Ok(N,_)),!D)return!1;if(!r.current&&"changedTouches"in g&&(b||T)&&(r.current=S),!S)return!0;var V=r.current||S;return mV(V,x,g,V==="h"?b:T,!0)},[]),u=v.useCallback(function(g){var x=g;if(!(!As.length||As[As.length-1]!==a)){var y="deltaY"in x?Mk(x):dp(x),w=t.current.filter(function(S){return S.name===x.type&&(S.target===x.target||x.target===S.shadowParent)&&gV(S.delta,y)})[0];if(w&&w.should){x.cancelable&&x.preventDefault();return}if(!w){var b=(o.current.shards||[]).map(Fk).filter(Boolean).filter(function(S){return S.contains(x.target)}),T=b.length>0?s(x,b[0]):!o.current.noIsolation;T&&x.cancelable&&x.preventDefault()}}},[]),l=v.useCallback(function(g,x,y,w){var b={name:g,delta:x,target:y,should:w,shadowParent:bV(y)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(T){return T!==b})},1)},[]),c=v.useCallback(function(g){n.current=dp(g),r.current=void 0},[]),d=v.useCallback(function(g){l(g.type,Mk(g),g.target,s(g,e.lockRef.current))},[]),f=v.useCallback(function(g){l(g.type,dp(g),g.target,s(g,e.lockRef.current))},[]);v.useEffect(function(){return As.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",u,Cs),document.addEventListener("touchmove",u,Cs),document.addEventListener("touchstart",c,Cs),function(){As=As.filter(function(g){return g!==a}),document.removeEventListener("wheel",u,Cs),document.removeEventListener("touchmove",u,Cs),document.removeEventListener("touchstart",c,Cs)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(a,{styles:yV(i)}):null,p?v.createElement(rV,{gapMode:e.gapMode}):null)}function bV(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const xV=kk(Rk,wV);var Bk=v.forwardRef(function(e,t){return v.createElement(lp,Lt({},e,{ref:t,sideCar:xV}))});Bk.classNames=lp.classNames;var f1=["Enter"," "],EV=["ArrowDown","PageUp","Home"],jk=["ArrowUp","PageDown","End"],TV=[...EV,...jk],_V={ltr:[...f1,"ArrowRight"],rtl:[...f1,"ArrowLeft"]},SV={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Tl="Menu",[_l,CV,AV]=WA(Tl),[ao,Uk]=la(Tl,[AV,uk,vk]),fp=uk(),Hk=vk(),[kV,ks]=ao(Tl),[RV,Sl]=ao(Tl),zk=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=fp(t),[u,l]=v.useState(null),c=v.useRef(!1),d=Wt(a),f=YA(i);return v.useEffect(()=>{const p=()=>{c.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>c.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),E.jsx(gz,{...s,children:E.jsx(kV,{scope:t,open:n,onOpenChange:d,content:u,onContentChange:l,children:E.jsx(RV,{scope:t,onClose:v.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:c,dir:f,modal:o,children:r})})})};zk.displayName=Tl;var NV="MenuAnchor",p1=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=fp(n);return E.jsx(yz,{...i,...r,ref:t})});p1.displayName=NV;var PV="MenuPortal",[Yie,Vk]=ao(PV,{forceMount:void 0}),sr="MenuContent",[IV,h1]=ao(sr),$k=v.forwardRef((e,t)=>{const n=Vk(sr,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=ks(sr,e.__scopeMenu),o=Sl(sr,e.__scopeMenu);return E.jsx(_l.Provider,{scope:e.__scopeMenu,children:E.jsx(np,{present:r||a.open,children:E.jsx(_l.Slot,{scope:e.__scopeMenu,children:o.modal?E.jsx(OV,{...i,ref:t}):E.jsx(DV,{...i,ref:t})})})})}),OV=v.forwardRef((e,t)=>{const n=ks(sr,e.__scopeMenu),r=v.useRef(null),i=Cn(t,r);return v.useEffect(()=>{const a=r.current;if(a)return _k(a)},[]),E.jsx(m1,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Fe(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),DV=v.forwardRef((e,t)=>{const n=ks(sr,e.__scopeMenu);return E.jsx(m1,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),m1=v.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...g}=e,x=ks(sr,n),y=Sl(sr,n),w=fp(n),b=Hk(n),T=CV(n),[S,_]=v.useState(null),N=v.useRef(null),D=Cn(t,N,x.onContentChange),V=v.useRef(0),P=v.useRef(""),$=v.useRef(0),H=v.useRef(null),X=v.useRef("right"),Y=v.useRef(0),ne=m?Bk:v.Fragment,re=m?{as:El,allowPinchZoom:!0}:void 0,ee=B=>{var $e,Ve;const A=P.current+B,ae=T().filter(We=>!We.disabled),he=document.activeElement,O=($e=ae.find(We=>We.ref.current===he))==null?void 0:$e.textValue,Pe=ae.map(We=>We.textValue),ge=YV(Pe,A,O),we=(Ve=ae.find(We=>We.textValue===ge))==null?void 0:Ve.ref.current;(function We(Ge){P.current=Ge,window.clearTimeout(V.current),Ge!==""&&(V.current=window.setTimeout(()=>We(""),1e3))})(A),we&&setTimeout(()=>we.focus())};v.useEffect(()=>()=>window.clearTimeout(V.current),[]),ZA();const F=v.useCallback(B=>{var ae,he;return X.current===((ae=H.current)==null?void 0:ae.side)&&GV(B,(he=H.current)==null?void 0:he.area)},[]);return E.jsx(IV,{scope:n,searchRef:P,onItemEnter:v.useCallback(B=>{F(B)&&B.preventDefault()},[F]),onItemLeave:v.useCallback(B=>{var A;F(B)||((A=N.current)==null||A.focus(),_(null))},[F]),onTriggerLeave:v.useCallback(B=>{F(B)&&B.preventDefault()},[F]),pointerGraceTimerRef:$,onPointerGraceIntentChange:v.useCallback(B=>{H.current=B},[]),children:E.jsx(ne,{...re,children:E.jsx(tk,{asChild:!0,trapped:i,onMountAutoFocus:Fe(a,B=>{var A;B.preventDefault(),(A=N.current)==null||A.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:E.jsx(KA,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:E.jsx(Oz,{asChild:!0,...b,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:_,onEntryFocus:Fe(u,B=>{y.isUsingKeyboardRef.current||B.preventDefault()}),preventScrollOnEntryFocus:!0,children:E.jsx(vz,{role:"menu","aria-orientation":"vertical","data-state":s3(x.open),"data-radix-menu-content":"",dir:y.dir,...w,...g,ref:D,style:{outline:"none",...g.style},onKeyDown:Fe(g.onKeyDown,B=>{const ae=B.target.closest("[data-radix-menu-content]")===B.currentTarget,he=B.ctrlKey||B.altKey||B.metaKey,O=B.key.length===1;ae&&(B.key==="Tab"&&B.preventDefault(),!he&&O&&ee(B.key));const Pe=N.current;if(B.target!==Pe||!TV.includes(B.key))return;B.preventDefault();const we=T().filter($e=>!$e.disabled).map($e=>$e.ref.current);jk.includes(B.key)&&we.reverse(),$V(we)}),onBlur:Fe(e.onBlur,B=>{B.currentTarget.contains(B.target)||(window.clearTimeout(V.current),P.current="")}),onPointerMove:Fe(e.onPointerMove,Al(B=>{const A=B.target,ae=Y.current!==B.clientX;if(B.currentTarget.contains(A)&&ae){const he=B.clientX>Y.current?"right":"left";X.current=he,Y.current=B.clientX}}))})})})})})})});$k.displayName=sr;var LV="MenuGroup",g1=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return E.jsx(An.div,{role:"group",...r,ref:t})});g1.displayName=LV;var MV="MenuLabel",Wk=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return E.jsx(An.div,{...r,ref:t})});Wk.displayName=MV;var pp="MenuItem",Yk="menu.itemSelect",hp=v.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,a=v.useRef(null),o=Sl(pp,e.__scopeMenu),s=h1(pp,e.__scopeMenu),u=Cn(t,a),l=v.useRef(!1),c=()=>{const d=a.current;if(!n&&d){const f=new CustomEvent(Yk,{bubbles:!0,cancelable:!0});d.addEventListener(Yk,p=>r==null?void 0:r(p),{once:!0}),$A(d,f),f.defaultPrevented?l.current=!1:o.onClose()}};return E.jsx(qk,{...i,ref:u,disabled:n,onClick:Fe(e.onClick,c),onPointerDown:d=>{var f;(f=e.onPointerDown)==null||f.call(e,d),l.current=!0},onPointerUp:Fe(e.onPointerUp,d=>{var f;l.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:Fe(e.onKeyDown,d=>{const f=s.searchRef.current!=="";n||f&&d.key===" "||f1.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});hp.displayName=pp;var qk=v.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=h1(pp,n),s=Hk(n),u=v.useRef(null),l=Cn(t,u),[c,d]=v.useState(!1),[f,p]=v.useState("");return v.useEffect(()=>{const m=u.current;m&&p((m.textContent??"").trim())},[a.children]),E.jsx(_l.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:E.jsx(Dz,{asChild:!0,...s,focusable:!r,children:E.jsx(An.div,{role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:l,onPointerMove:Fe(e.onPointerMove,Al(m=>{r?o.onItemLeave(m):(o.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Fe(e.onPointerLeave,Al(m=>o.onItemLeave(m))),onFocus:Fe(e.onFocus,()=>d(!0)),onBlur:Fe(e.onBlur,()=>d(!1))})})})}),FV="MenuCheckboxItem",Gk=v.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return E.jsx(Jk,{scope:e.__scopeMenu,checked:n,children:E.jsx(hp,{role:"menuitemcheckbox","aria-checked":mp(n)?"mixed":n,...i,ref:t,"data-state":v1(n),onSelect:Fe(i.onSelect,()=>r==null?void 0:r(mp(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Gk.displayName=FV;var Kk="MenuRadioGroup",[BV,jV]=ao(Kk,{value:void 0,onValueChange:()=>{}}),Xk=v.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,a=Wt(r);return E.jsx(BV,{scope:e.__scopeMenu,value:n,onValueChange:a,children:E.jsx(g1,{...i,ref:t})})});Xk.displayName=Kk;var Qk="MenuRadioItem",Zk=v.forwardRef((e,t)=>{const{value:n,...r}=e,i=jV(Qk,e.__scopeMenu),a=n===i.value;return E.jsx(Jk,{scope:e.__scopeMenu,checked:a,children:E.jsx(hp,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":v1(a),onSelect:Fe(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});Zk.displayName=Qk;var y1="MenuItemIndicator",[Jk,UV]=ao(y1,{checked:!1}),e3=v.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,a=UV(y1,n);return E.jsx(np,{present:r||mp(a.checked)||a.checked===!0,children:E.jsx(An.span,{...i,ref:t,"data-state":v1(a.checked)})})});e3.displayName=y1;var HV="MenuSeparator",t3=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return E.jsx(An.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});t3.displayName=HV;var zV="MenuArrow",n3=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=fp(n);return E.jsx(wz,{...i,...r,ref:t})});n3.displayName=zV;var VV="MenuSub",[qie,r3]=ao(VV),Cl="MenuSubTrigger",i3=v.forwardRef((e,t)=>{const n=ks(Cl,e.__scopeMenu),r=Sl(Cl,e.__scopeMenu),i=r3(Cl,e.__scopeMenu),a=h1(Cl,e.__scopeMenu),o=v.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:u}=a,l={__scopeMenu:e.__scopeMenu},c=v.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return v.useEffect(()=>c,[c]),v.useEffect(()=>{const d=s.current;return()=>{window.clearTimeout(d),u(null)}},[s,u]),E.jsx(p1,{asChild:!0,...l,children:E.jsx(qk,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":s3(n.open),...e,ref:tp(t,i.onTriggerChange),onClick:d=>{var f;(f=e.onClick)==null||f.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Fe(e.onPointerMove,Al(d=>{a.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),c()},100))})),onPointerLeave:Fe(e.onPointerLeave,Al(d=>{var p,m;c();const f=(p=n.content)==null?void 0:p.getBoundingClientRect();if(f){const g=(m=n.content)==null?void 0:m.dataset.side,x=g==="right",y=x?-5:5,w=f[x?"left":"right"],b=f[x?"right":"left"];a.onPointerGraceIntentChange({area:[{x:d.clientX+y,y:d.clientY},{x:w,y:f.top},{x:b,y:f.top},{x:b,y:f.bottom},{x:w,y:f.bottom}],side:g}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(d),d.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:Fe(e.onKeyDown,d=>{var p;const f=a.searchRef.current!=="";e.disabled||f&&d.key===" "||_V[r.dir].includes(d.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),d.preventDefault())})})})});i3.displayName=Cl;var a3="MenuSubContent",o3=v.forwardRef((e,t)=>{const n=Vk(sr,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=ks(sr,e.__scopeMenu),o=Sl(sr,e.__scopeMenu),s=r3(a3,e.__scopeMenu),u=v.useRef(null),l=Cn(t,u);return E.jsx(_l.Provider,{scope:e.__scopeMenu,children:E.jsx(np,{present:r||a.open,children:E.jsx(_l.Slot,{scope:e.__scopeMenu,children:E.jsx(m1,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:c=>{var d;o.isUsingKeyboardRef.current&&((d=u.current)==null||d.focus()),c.preventDefault()},onCloseAutoFocus:c=>c.preventDefault(),onFocusOutside:Fe(e.onFocusOutside,c=>{c.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:Fe(e.onEscapeKeyDown,c=>{o.onClose(),c.preventDefault()}),onKeyDown:Fe(e.onKeyDown,c=>{var p;const d=c.currentTarget.contains(c.target),f=SV[o.dir].includes(c.key);d&&f&&(a.onOpenChange(!1),(p=s.trigger)==null||p.focus(),c.preventDefault())})})})})})});o3.displayName=a3;function s3(e){return e?"open":"closed"}function mp(e){return e==="indeterminate"}function v1(e){return mp(e)?"indeterminate":e?"checked":"unchecked"}function $V(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function WV(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function YV(e,t,n){const i=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let o=WV(e,Math.max(a,0));i.length===1&&(o=o.filter(l=>l!==n));const u=o.find(l=>l.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function qV(e,t){const{x:n,y:r}=e;let i=!1;for(let a=0,o=t.length-1;a<t.length;o=a++){const s=t[a].x,u=t[a].y,l=t[o].x,c=t[o].y;u>r!=c>r&&n<(l-s)*(r-u)/(c-u)+s&&(i=!i)}return i}function GV(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return qV(n,t)}function Al(e){return t=>t.pointerType==="mouse"?e(t):void 0}var KV=zk,XV=p1,QV=$k,ZV=g1,JV=Wk,e$=hp,t$=Gk,n$=Xk,r$=Zk,i$=e3,a$=t3,o$=n3,s$=i3,u$=o3,w1="DropdownMenu",[l$,Gie]=la(w1,[Uk]),kn=Uk(),[c$,u3]=l$(w1),l3=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,u=kn(t),l=v.useRef(null),[c=!1,d]=Gf({prop:i,defaultProp:a,onChange:o});return E.jsx(c$,{scope:t,triggerId:yl(),triggerRef:l,contentId:yl(),open:c,onOpenChange:d,onOpenToggle:v.useCallback(()=>d(f=>!f),[d]),modal:s,children:E.jsx(KV,{...u,open:c,onOpenChange:d,dir:r,modal:s,children:n})})};l3.displayName=w1;var c3="DropdownMenuTrigger",d3=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=u3(c3,n),o=kn(n);return E.jsx(XV,{asChild:!0,...o,children:E.jsx(An.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:tp(t,a.triggerRef),onPointerDown:Fe(e.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(a.onOpenToggle(),a.open||s.preventDefault())}),onKeyDown:Fe(e.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&a.onOpenToggle(),s.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});d3.displayName=c3;var f3="DropdownMenuContent",p3=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=u3(f3,n),a=kn(n),o=v.useRef(!1);return E.jsx(QV,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:Fe(e.onCloseAutoFocus,s=>{var u;o.current||(u=i.triggerRef.current)==null||u.focus(),o.current=!1,s.preventDefault()}),onInteractOutside:Fe(e.onInteractOutside,s=>{const u=s.detail.originalEvent,l=u.button===0&&u.ctrlKey===!0,c=u.button===2||l;(!i.modal||c)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});p3.displayName=f3;var d$="DropdownMenuGroup",h3=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return E.jsx(ZV,{...i,...r,ref:t})});h3.displayName=d$;var f$="DropdownMenuLabel",m3=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return E.jsx(JV,{...i,...r,ref:t})});m3.displayName=f$;var p$="DropdownMenuItem",g3=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return E.jsx(e$,{...i,...r,ref:t})});g3.displayName=p$;var h$="DropdownMenuCheckboxItem",y3=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return E.jsx(t$,{...i,...r,ref:t})});y3.displayName=h$;var m$="DropdownMenuRadioGroup",g$=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return E.jsx(n$,{...i,...r,ref:t})});g$.displayName=m$;var y$="DropdownMenuRadioItem",v3=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return E.jsx(r$,{...i,...r,ref:t})});v3.displayName=y$;var v$="DropdownMenuItemIndicator",w3=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return E.jsx(i$,{...i,...r,ref:t})});w3.displayName=v$;var w$="DropdownMenuSeparator",b3=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return E.jsx(a$,{...i,...r,ref:t})});b3.displayName=w$;var b$="DropdownMenuArrow",x$=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return E.jsx(o$,{...i,...r,ref:t})});x$.displayName=b$;var E$="DropdownMenuSubTrigger",x3=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return E.jsx(s$,{...i,...r,ref:t})});x3.displayName=E$;var T$="DropdownMenuSubContent",E3=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=kn(n);return E.jsx(u$,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});E3.displayName=T$;var _$=l3,S$=d3,T3=p3,C$=h3,_3=m3,S3=g3,C3=y3,A3=v3,k3=w3,R3=b3,N3=x3,P3=E3;const A$=_$,k$=S$,R$=C$,N$=v.forwardRef(({className:e,inset:t,children:n,...r},i)=>E.jsxs(N3,{ref:i,className:Le("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...r,children:[n,E.jsx(S_,{className:"ml-auto"})]}));N$.displayName=N3.displayName;const P$=v.forwardRef(({className:e,...t},n)=>E.jsx(P3,{ref:n,className:Le("z-50 min-w-[8rem] overflow-hidden rounded-2xl border bg-background p-1 text-foreground shadow-2xl data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));P$.displayName=P3.displayName;const I3=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>E.jsx(T3,{ref:r,sideOffset:t,className:Le("z-50 min-w-[8rem] overflow-hidden rounded-2xl border bg-background p-1 text-foreground shadow-2xl","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));I3.displayName=T3.displayName;const O3=v.forwardRef(({className:e,inset:t,...n},r)=>E.jsx(fn,{children:E.jsx(S3,{ref:r,className:Le("relative flex cursor-default select-none items-center gap-2 rounded-xl px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...n})}));O3.displayName=S3.displayName;const I$=v.forwardRef(({className:e,children:t,checked:n,...r},i)=>E.jsxs(C3,{ref:i,className:Le("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[E.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:E.jsx(k3,{children:E.jsx(uF,{className:"h-4 w-4"})})}),t]}));I$.displayName=C3.displayName;const O$=v.forwardRef(({className:e,children:t,...n},r)=>E.jsxs(A3,{ref:r,className:Le("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[E.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:E.jsx(k3,{children:E.jsx(fF,{className:"h-2 w-2 fill-current"})})}),t]}));O$.displayName=A3.displayName;const D$=v.forwardRef(({className:e,inset:t,...n},r)=>E.jsx(_3,{ref:r,className:Le("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));D$.displayName=_3.displayName;const L$=v.forwardRef(({className:e,...t},n)=>E.jsx(R3,{ref:n,className:Le("-mx-1 my-1 h-px bg-muted",e),...t}));L$.displayName=R3.displayName;function M$({className:e,...t}){return E.jsx("div",{className:Le("animate-pulse rounded-md bg-secondary",e),...t})}function F$(){const e=Jf(),[t,n]=v.useState(!1),{widgetCtx:r}=zn();return E.jsxs(A$,{open:t,onOpenChange:n,children:[E.jsx(k$,{asChild:!0,children:E.jsx(or,{variant:"ghost",size:"fit",className:"rounded-full",children:E.jsx(pF,{className:"size-4"})})}),E.jsx(I3,{align:"end",className:"min-w-56",children:E.jsx(R$,{children:E.jsxs(O3,{onSelect:()=>{r.resetChat(),n(!1)},children:[E.jsx(us.div,{initial:{opacity:0,x:-4,rotate:360},animate:{opacity:1,x:0,rotate:0},children:E.jsx(vF,{})}),e.get("new-conversation")]})})})]})}function B$(){var i;const{toSessionsScreen:e}=Sy(),{data:t,isLoading:n}=Df(),r=xl();return E.jsx("header",{className:"p-2 border-b bg-background",children:E.jsxs("div",{dir:r,className:"flex items-center rtl:flex-row-reverse gap-2",children:[E.jsx(or,{variant:"ghost",size:"fit",className:"rounded-full",onClick:e,children:E.jsx(lF,{className:"size-4"})}),E.jsx("div",{className:"flex-1 pl-2",children:n?E.jsx(M$,{className:"h-4 w-2/3"}):E.jsx("h2",{className:"font-semibold",children:(i=t==null?void 0:t.data)==null?void 0:i.organizationName})}),E.jsx(F$,{})]})})}function j$(e){const t=[];let n=null;return e.forEach(r=>{var i,a,o,s;(!n||((i=n[0])==null?void 0:i.type)!==r.type)&&(n=[],t.push(n)),((a=n[0])==null?void 0:a.type)==="FROM_AGENT"&&r.type==="FROM_AGENT"&&((o=r.agent)==null?void 0:o.id)!==((s=n[0].agent)==null?void 0:s.id)&&(n=[],t.push(n)),n.push(r)}),t}function U$(e){var t;return((t=e==null?void 0:e[0])==null?void 0:t.type)==="FROM_USER"}function H$(e){var t;return((t=e==null?void 0:e[0])==null?void 0:t.type)==="FROM_BOT"}function z$(e){var t;return((t=e==null?void 0:e[0])==null?void 0:t.type)==="FROM_AGENT"}function b1({message:e,Wrapper:t,wrapperProps:n}){const{componentStore:r}=zn(),i=r.getComponent(e.component,!1),a=xl();return i?t?v.createElement(t,{...n,key:e.id,"data-test":`message-wrapper-${e.id}`},E.jsx(i,{...e,id:e.id})):E.jsx("div",{"data-test":`message-${e.id}`,dir:a,children:v.createElement(i,{...e,id:e.id,key:e.id})}):null}function x1({children:e,className:t,messageId:n}){return E.jsx("div",{className:Le("w-fit space-y-2",t),"data-test":`message-wrapper-${n}`,children:E.jsx("div",{"data-test":"message-content-wrapper",className:Le("w-fit p-2 rounded-2xl text-sm","bg-secondary border shadow-sm"),children:e})})}const gp=43200,D3=1440,L3=Symbol.for("constructDateFrom");function M3(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&L3 in e?e[L3](t):e instanceof Date?new e.constructor(t):new Date(t)}function ma(e,t){return M3(e,e)}let V$={};function $$(){return V$}function F3(e){const t=ma(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function E1(e,...t){const n=M3.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function yp(e,t){const n=+ma(e)-+ma(t);return n<0?-1:n>0?1:n}function W$(e,t,n){const[r,i]=E1(n==null?void 0:n.in,e,t),a=r.getFullYear()-i.getFullYear(),o=r.getMonth()-i.getMonth();return a*12+o}function Y$(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function q$(e,t){return+ma(e)-+ma(t)}function G$(e,t){const n=ma(e);return n.setHours(23,59,59,999),n}function K$(e,t){const n=ma(e),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function X$(e,t){const n=ma(e);return+G$(n)==+K$(n)}function Q$(e,t,n){const[r,i,a]=E1(n==null?void 0:n.in,e,e,t),o=yp(i,a),s=Math.abs(W$(i,a));if(s<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-o*s);let u=yp(i,a)===-o;X$(r)&&s===1&&yp(r,a)===1&&(u=!1);const l=o*(s-+u);return l===0?0:l}function Z$(e,t,n){const r=q$(e,t)/1e3;return Y$(n==null?void 0:n.roundingMethod)(r)}const J$={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},eW=(e,t,n)=>{let r;const i=J$[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function T1(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const tW={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},nW={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},rW={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},iW={date:T1({formats:tW,defaultWidth:"full"}),time:T1({formats:nW,defaultWidth:"full"}),dateTime:T1({formats:rW,defaultWidth:"full"})},aW={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},oW=(e,t,n,r)=>aW[e];function kl(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,s=n!=null&&n.width?String(n.width):o;i=e.formattingValues[s]||e.formattingValues[o]}else{const o=e.defaultWidth,s=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[s]||e.values[o]}const a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}const sW={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},uW={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},lW={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},cW={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},dW={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},fW={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},pW={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:kl({values:sW,defaultWidth:"wide"}),quarter:kl({values:uW,defaultWidth:"wide",argumentCallback:e=>e-1}),month:kl({values:lW,defaultWidth:"wide"}),day:kl({values:cW,defaultWidth:"wide"}),dayPeriod:kl({values:dW,defaultWidth:"wide",formattingValues:fW,defaultFormattingWidth:"wide"})};function Rl(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;const o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(s)?mW(s,d=>d.test(o)):hW(s,d=>d.test(o));let l;l=e.valueCallback?e.valueCallback(u):u,l=n.valueCallback?n.valueCallback(l):l;const c=t.slice(o.length);return{value:l,rest:c}}}function hW(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function mW(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function gW(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;const s=t.slice(i.length);return{value:o,rest:s}}}const yW=/^(\d+)(th|st|nd|rd)?/i,vW=/\d+/i,wW={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},bW={any:[/^b/i,/^(a|c)/i]},xW={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},EW={any:[/1/i,/2/i,/3/i,/4/i]},TW={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},_W={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},SW={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},CW={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},AW={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},kW={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},RW={ordinalNumber:gW({matchPattern:yW,parsePattern:vW,valueCallback:e=>parseInt(e,10)}),era:Rl({matchPatterns:wW,defaultMatchWidth:"wide",parsePatterns:bW,defaultParseWidth:"any"}),quarter:Rl({matchPatterns:xW,defaultMatchWidth:"wide",parsePatterns:EW,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Rl({matchPatterns:TW,defaultMatchWidth:"wide",parsePatterns:_W,defaultParseWidth:"any"}),day:Rl({matchPatterns:SW,defaultMatchWidth:"wide",parsePatterns:CW,defaultParseWidth:"any"}),dayPeriod:Rl({matchPatterns:AW,defaultMatchWidth:"any",parsePatterns:kW,defaultParseWidth:"any"})},NW={code:"en-US",formatDistance:eW,formatLong:iW,formatRelative:oW,localize:pW,match:RW,options:{weekStartsOn:0,firstWeekContainsDate:1}};function PW(e,t,n){const r=$$(),i=(n==null?void 0:n.locale)??r.locale??NW,a=2520,o=yp(e,t);if(isNaN(o))throw new RangeError("Invalid time value");const s=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:o}),[u,l]=E1(n==null?void 0:n.in,...o>0?[t,e]:[e,t]),c=Z$(l,u),d=(F3(l)-F3(u))/1e3,f=Math.round((c-d)/60);let p;if(f<2)return n!=null&&n.includeSeconds?c<5?i.formatDistance("lessThanXSeconds",5,s):c<10?i.formatDistance("lessThanXSeconds",10,s):c<20?i.formatDistance("lessThanXSeconds",20,s):c<40?i.formatDistance("halfAMinute",0,s):c<60?i.formatDistance("lessThanXMinutes",1,s):i.formatDistance("xMinutes",1,s):f===0?i.formatDistance("lessThanXMinutes",1,s):i.formatDistance("xMinutes",f,s);if(f<45)return i.formatDistance("xMinutes",f,s);if(f<90)return i.formatDistance("aboutXHours",1,s);if(f<D3){const m=Math.round(f/60);return i.formatDistance("aboutXHours",m,s)}else{if(f<a)return i.formatDistance("xDays",1,s);if(f<gp){const m=Math.round(f/D3);return i.formatDistance("xDays",m,s)}else if(f<gp*2)return p=Math.round(f/gp),i.formatDistance("aboutXMonths",p,s)}if(p=Q$(l,u),p<12){const m=Math.round(f/gp);return i.formatDistance("xMonths",m,s)}else{const m=p%12,g=Math.trunc(p/12);return m<3?i.formatDistance("aboutXYears",g,s):m<9?i.formatDistance("overXYears",g,s):i.formatDistance("almostXYears",g+1,s)}}var _1="Avatar",[IW,Xie]=la(_1),[OW,B3]=IW(_1),j3=v.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,a]=v.useState("idle");return E.jsx(OW,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:a,children:E.jsx(Vn.span,{...r,ref:t})})});j3.displayName=_1;var U3="AvatarImage",H3=v.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...a}=e,o=B3(U3,n),s=DW(r,a.referrerPolicy),u=Wt(l=>{i(l),o.onImageLoadingStatusChange(l)});return ar(()=>{s!=="idle"&&u(s)},[s,u]),s==="loaded"?E.jsx(Vn.img,{...a,ref:t,src:r}):null});H3.displayName=U3;var z3="AvatarFallback",V3=v.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,a=B3(z3,n),[o,s]=v.useState(r===void 0);return v.useEffect(()=>{if(r!==void 0){const u=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(u)}},[r]),o&&a.imageLoadingStatus!=="loaded"?E.jsx(Vn.span,{...i,ref:t}):null});V3.displayName=z3;function DW(e,t){const[n,r]=v.useState("idle");return ar(()=>{if(!e){r("error");return}let i=!0;const a=new window.Image,o=s=>()=>{i&&r(s)};return r("loading"),a.onload=o("loaded"),a.onerror=o("error"),a.src=e,t&&(a.referrerPolicy=t),()=>{i=!1}},[e,t]),n}var $3=j3,W3=H3,Y3=V3;const vp=v.forwardRef(({className:e,...t},n)=>E.jsx($3,{ref:n,className:Le("relative flex size-6 aspect-square shrink-0 overflow-hidden rounded-full border bg-secondary",e),...t}));vp.displayName=$3.displayName;const S1=v.forwardRef(({className:e,...t},n)=>E.jsx(W3,{ref:n,className:Le("aspect-square h-full w-full",e),...t}));S1.displayName=W3.displayName;const q3=v.forwardRef(({className:e,...t},n)=>E.jsx(Y3,{ref:n,className:Le("flex size-full text-sm items-center justify-center rounded-lg",e),...t}));q3.displayName=Y3.displayName;function G3({attachment:e}){const{name:t,size:n,type:r,url:i}=e,a=r.startsWith("image/"),o=r.startsWith("video/"),s=r.startsWith("audio/");return E.jsxs("div",{className:"size-fit gap-2 border shrink-0 rounded-2xl overflow-hidden",children:[a&&E.jsx("img",{loading:"lazy",src:i,className:"object-cover size-16"}),o&&E.jsxs("video",{controls:!0,children:[E.jsx("source",{src:i,type:r}),"Your browser does not support the video tag."]}),s&&E.jsxs("audio",{controls:!0,className:"w-full mt-2 rounded-md border",children:[E.jsx("source",{src:i,type:r}),"Your browser does not support the audio tag."]}),!a&&!o&&!s&&E.jsxs("div",{className:"flex items-center gap-2 p-2",children:[E.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 line-clamp-2 underline hover:text-blue-600",children:t}),E.jsxs("span",{className:"text-sm text-gray-500 whitespace-nowrap",children:[(n/1024).toFixed(2)," KB"]})]})]})}function LW({message:e}){var t;return v.useMemo(()=>e.deliveredAt?PW(new Date(e.deliveredAt),new Date,{addSuffix:!0}):null,[e.deliveredAt]),E.jsxs("div",{className:"flex flex-col items-end gap-1",children:[E.jsx("div",{className:Le("w-fit p-2 rounded-2xl text-sm","bg-primary text-primary-foreground border shadow-sm"),children:e.content}),e.attachments&&e.attachments.length>0&&E.jsx("div",{className:"flex gap-1 flex-wrap justify-end",children:(t=e.attachments)==null?void 0:t.map(n=>E.jsx(G3,{attachment:n},n.id))})]})}function MW({messages:e}){var n,r;const{user:t}=dl();return E.jsxs("div",{className:Le("group","flex flex-col gap-2 justify-end items-end"),children:[E.jsx(vp,{className:"bg-primary text-primary-foreground",children:E.jsx(S1,{src:(n=t==null?void 0:t.data)==null?void 0:n.avatarUrl,alt:((r=t==null?void 0:t.data)==null?void 0:r.name)||"User avatar"})}),e.map(i=>E.jsx(LW,{message:i},i.id))]})}function FW({messages:e,agent:t}){const{sessionState:n}=ys();return E.jsxs("div",{className:Le("flex flex-col items-start gap-2"),children:[E.jsx(vp,{children:E.jsx(S1,{src:(t==null?void 0:t.avatar)??"",alt:"Agent Icon"})}),e.map(r=>{var i;return E.jsx(b1,{message:r,Wrapper:x1,wrapperProps:{messageId:r.id,sessionId:(i=n.session)==null?void 0:i.id}},r.id)})]})}function BW(){var l;const{messagesState:{messages:e}}=pl(),{isAwaitingBotReply:t}=wC(),{componentStore:n}=zn(),r=dl(),i=v.useMemo(()=>j$(e),[e.length]),a=n.getComponent("loading"),o=v.useRef(null);function s(){setTimeout(()=>{const c=o.current;c&&(c.scrollTop=c.scrollHeight)},0)}v.useEffect(()=>{s()},[e]);const u=e.length===0;return E.jsxs("div",{"data-messages":!0,ref:o,className:"max-h-full scroll-smooth relative flex-1 p-2 space-y-2 overflow-auto",children:[u&&(((l=r.initialMessages)==null?void 0:l.map((c,d)=>E.jsx(b1,{message:{component:"bot_message",data:{message:c},id:`initial-${d}`,type:"FROM_BOT",timestamp:Date.now().toString()},Wrapper:x1},d)))??E.jsx(b1,{message:{component:"bot_message",data:{message:"Hello, how can I help?"},id:"default-welcome",type:"FROM_BOT",agent:r.bot,timestamp:Date.now().toString()},Wrapper:x1},"default-welcome")),i.map((c,d)=>{var p,m;if(!((p=c==null?void 0:c[0])==null?void 0:p.type))return null;if(U$(c))return E.jsx(MW,{messages:c},d);if(H$(c)||z$(c)){const g=(m=c[0])==null?void 0:m.agent;return E.jsx(FW,{messages:c,agent:g},d)}return null}),t&&E.jsx(a,{})]})}function K3({className:e}){return E.jsx(yF,{className:Le("size-4 animate-spin",e)})}function jW(){const{messagesState:{isInitialFetchLoading:e}}=pl(),{sessionState:{session:t}}=ys(),{observedElementRef:n}=L0({fallbackHeight:CE});return E.jsx("div",{ref:n,"data-test":"chat-screen",className:Le(Bd.widgetHeight,"w-full flex flex-col overflow-hidden bg-background"),children:E.jsxs("div",{className:"w-full h-full justify-between flex flex-col relative","data-test":"chat-screen-content",children:[E.jsx(B$,{}),E.jsx(Ja,{mode:"wait",children:e?E.jsx(fn,{className:"flex flex-col items-center justify-center w-full flex-1",children:E.jsx(K3,{})},"loading"):E.jsxs(fn,{className:"flex flex-col w-full flex-1 overflow-auto",snapExit:!0,children:[E.jsx(BW,{}),E.jsx(HH,{})]},(t==null?void 0:t.id)||"chat")})]})})}var Be;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const a={};for(const o of i)a[o]=o;return a},e.getValidEnumValues=i=>{const a=e.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),o={};for(const s of a)o[s]=i[s];return e.objectValues(o)},e.objectValues=i=>e.objectKeys(i).map(function(a){return i[a]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&a.push(o);return a},e.find=(i,a)=>{for(const o of i)if(a(o))return o},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,a=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}e.joinValues=r,e.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(Be||(Be={}));var C1;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(C1||(C1={}));const se=Be.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ga=e=>{switch(typeof e){case"undefined":return se.undefined;case"string":return se.string;case"number":return isNaN(e)?se.nan:se.number;case"boolean":return se.boolean;case"function":return se.function;case"bigint":return se.bigint;case"symbol":return se.symbol;case"object":return Array.isArray(e)?se.array:e===null?se.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?se.promise:typeof Map<"u"&&e instanceof Map?se.map:typeof Set<"u"&&e instanceof Set?se.set:typeof Date<"u"&&e instanceof Date?se.date:se.object;default:return se.unknown}},Z=Be.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),UW=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Yn extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(a){return a.message},r={_errors:[]},i=a=>{for(const o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let s=r,u=0;for(;u<o.path.length;){const l=o.path[u];u===o.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(n(o))):s[l]=s[l]||{_errors:[]},s=s[l],u++}}};return i(this),r}static assert(t){if(!(t instanceof Yn))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Be.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Yn.create=e=>new Yn(e);const Rs=(e,t)=>{let n;switch(e.code){case Z.invalid_type:e.received===se.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Z.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Be.jsonStringifyReplacer)}`;break;case Z.unrecognized_keys:n=`Unrecognized key(s) in object: ${Be.joinValues(e.keys,", ")}`;break;case Z.invalid_union:n="Invalid input";break;case Z.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Be.joinValues(e.options)}`;break;case Z.invalid_enum_value:n=`Invalid enum value. Expected ${Be.joinValues(e.options)}, received '${e.received}'`;break;case Z.invalid_arguments:n="Invalid function arguments";break;case Z.invalid_return_type:n="Invalid function return type";break;case Z.invalid_date:n="Invalid date";break;case Z.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Be.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Z.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Z.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Z.custom:n="Invalid input";break;case Z.invalid_intersection_types:n="Intersection results could not be merged";break;case Z.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Z.not_finite:n="Number must be finite";break;default:n=t.defaultError,Be.assertNever(e)}return{message:n}};let X3=Rs;function HW(e){X3=e}function wp(){return X3}const bp=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s="";const u=r.filter(l=>!!l).slice().reverse();for(const l of u)s=l(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}},zW=[];function oe(e,t){const n=wp(),r=bp({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Rs?void 0:Rs].filter(i=>!!i)});e.common.issues.push(r)}class nn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return be;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n){const a=await i.key,o=await i.value;r.push({key:a,value:o})}return nn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:a,value:o}=i;if(a.status==="aborted"||o.status==="aborted")return be;a.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[a.value]=o.value)}return{status:t.value,value:r}}}const be=Object.freeze({status:"aborted"}),Ns=e=>({status:"dirty",value:e}),pn=e=>({status:"valid",value:e}),A1=e=>e.status==="aborted",k1=e=>e.status==="dirty",Nl=e=>e.status==="valid",Pl=e=>typeof Promise<"u"&&e instanceof Promise;function xp(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function Q3(e,t,n,r,i){if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}typeof SuppressedError=="function"&&SuppressedError;var pe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(pe||(pe={}));var Il,Ol;class Yr{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Z3=(e,t)=>{if(Nl(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Yn(e.common.issues);return this._error=n,this._error}}};function Ce(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(o,s)=>{var u,l;const{message:c}=e;return o.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:(u=c??r)!==null&&u!==void 0?u:s.defaultError}:o.code!=="invalid_type"?{message:s.defaultError}:{message:(l=c??n)!==null&&l!==void 0?l:s.defaultError}},description:i}}class Ne{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return ga(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:ga(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new nn,ctx:{common:t.parent.common,data:t.data,parsedType:ga(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Pl(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ga(t)},a=this._parseSync({data:t,path:i.path,parent:i});return Z3(i,a)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ga(t)},i=this._parse({data:t,path:r.path,parent:r}),a=await(Pl(i)?i:Promise.resolve(i));return Z3(r,a)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,a)=>{const o=t(i),s=()=>a.addIssue({code:Z.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new Rr({schema:this,typeName:ve.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Gr.create(this,this._def)}nullable(){return ba.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return kr.create(this,this._def)}promise(){return Ds.create(this,this._def)}or(t){return Fl.create([this,t],this._def)}and(t){return Bl.create(this,t,this._def)}transform(t){return new Rr({...Ce(this._def),schema:this,typeName:ve.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Vl({...Ce(this._def),innerType:this,defaultValue:n,typeName:ve.ZodDefault})}brand(){return new P1({typeName:ve.ZodBranded,type:this,...Ce(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new $l({...Ce(this._def),innerType:this,catchValue:n,typeName:ve.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Wl.create(this,t)}readonly(){return Yl.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const VW=/^c[^\s-]{8,}$/i,$W=/^[0-9a-z]+$/,WW=/^[0-9A-HJKMNP-TV-Z]{26}$/,YW=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,qW=/^[a-z0-9_-]{21}$/i,GW=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,KW=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,XW="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let R1;const QW=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ZW=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,JW=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,J3="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",eY=new RegExp(`^${J3}$`);function eR(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function tY(e){return new RegExp(`^${eR(e)}$`)}function tR(e){let t=`${J3}T${eR(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function nY(e,t){return!!((t==="v4"||!t)&&QW.test(e)||(t==="v6"||!t)&&ZW.test(e))}class Ar extends Ne{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==se.string){const a=this._getOrReturnCtx(t);return oe(a,{code:Z.invalid_type,expected:se.string,received:a.parsedType}),be}const r=new nn;let i;for(const a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:Z.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")t.data.length>a.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:Z.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const o=t.data.length>a.value,s=t.data.length<a.value;(o||s)&&(i=this._getOrReturnCtx(t,i),o?oe(i,{code:Z.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):s&&oe(i,{code:Z.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")KW.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"email",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")R1||(R1=new RegExp(XW,"u")),R1.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"emoji",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")YW.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"uuid",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")qW.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"nanoid",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")VW.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"cuid",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")$W.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"cuid2",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")WW.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"ulid",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),oe(i,{validation:"url",code:Z.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"regex",code:Z.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(t,i),oe(i,{code:Z.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(i=this._getOrReturnCtx(t,i),oe(i,{code:Z.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(i=this._getOrReturnCtx(t,i),oe(i,{code:Z.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?tR(a).test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{code:Z.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?eY.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{code:Z.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?tY(a).test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{code:Z.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?GW.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"duration",code:Z.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?nY(t.data,a.version)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"ip",code:Z.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?JW.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"base64",code:Z.invalid_string,message:a.message}),r.dirty()):Be.assertNever(a);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:Z.invalid_string,...pe.errToObj(r)})}_addCheck(t){return new Ar({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...pe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...pe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...pe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...pe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...pe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...pe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...pe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...pe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...pe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...pe.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...pe.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...pe.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...pe.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...pe.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...pe.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...pe.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...pe.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...pe.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...pe.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...pe.errToObj(n)})}nonempty(t){return this.min(1,pe.errToObj(t))}trim(){return new Ar({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ar({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ar({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Ar.create=e=>{var t;return new Ar({checks:[],typeName:ve.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ce(e)})};function rY(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,a=parseInt(e.toFixed(i).replace(".","")),o=parseInt(t.toFixed(i).replace(".",""));return a%o/Math.pow(10,i)}class ya extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==se.number){const a=this._getOrReturnCtx(t);return oe(a,{code:Z.invalid_type,expected:se.number,received:a.parsedType}),be}let r;const i=new nn;for(const a of this._def.checks)a.kind==="int"?Be.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),oe(r,{code:Z.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),oe(r,{code:Z.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),oe(r,{code:Z.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?rY(t.data,a.value)!==0&&(r=this._getOrReturnCtx(t,r),oe(r,{code:Z.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),oe(r,{code:Z.not_finite,message:a.message}),i.dirty()):Be.assertNever(a);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,pe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,pe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,pe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,pe.toString(n))}setLimit(t,n,r,i){return new ya({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:pe.toString(i)}]})}_addCheck(t){return new ya({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:pe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:pe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:pe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:pe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:pe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:pe.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:pe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:pe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:pe.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Be.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}ya.create=e=>new ya({checks:[],typeName:ve.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Ce(e)});class va extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==se.bigint){const a=this._getOrReturnCtx(t);return oe(a,{code:Z.invalid_type,expected:se.bigint,received:a.parsedType}),be}let r;const i=new nn;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),oe(r,{code:Z.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),oe(r,{code:Z.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),oe(r,{code:Z.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):Be.assertNever(a);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,pe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,pe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,pe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,pe.toString(n))}setLimit(t,n,r,i){return new va({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:pe.toString(i)}]})}_addCheck(t){return new va({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:pe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:pe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:pe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:pe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:pe.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}va.create=e=>{var t;return new va({checks:[],typeName:ve.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ce(e)})};class Dl extends Ne{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==se.boolean){const r=this._getOrReturnCtx(t);return oe(r,{code:Z.invalid_type,expected:se.boolean,received:r.parsedType}),be}return pn(t.data)}}Dl.create=e=>new Dl({typeName:ve.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Ce(e)});class oo extends Ne{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==se.date){const a=this._getOrReturnCtx(t);return oe(a,{code:Z.invalid_type,expected:se.date,received:a.parsedType}),be}if(isNaN(t.data.getTime())){const a=this._getOrReturnCtx(t);return oe(a,{code:Z.invalid_date}),be}const r=new nn;let i;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:Z.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:Z.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):Be.assertNever(a);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new oo({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:pe.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:pe.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}oo.create=e=>new oo({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ve.ZodDate,...Ce(e)});class Ep extends Ne{_parse(t){if(this._getType(t)!==se.symbol){const r=this._getOrReturnCtx(t);return oe(r,{code:Z.invalid_type,expected:se.symbol,received:r.parsedType}),be}return pn(t.data)}}Ep.create=e=>new Ep({typeName:ve.ZodSymbol,...Ce(e)});class Ll extends Ne{_parse(t){if(this._getType(t)!==se.undefined){const r=this._getOrReturnCtx(t);return oe(r,{code:Z.invalid_type,expected:se.undefined,received:r.parsedType}),be}return pn(t.data)}}Ll.create=e=>new Ll({typeName:ve.ZodUndefined,...Ce(e)});class Ml extends Ne{_parse(t){if(this._getType(t)!==se.null){const r=this._getOrReturnCtx(t);return oe(r,{code:Z.invalid_type,expected:se.null,received:r.parsedType}),be}return pn(t.data)}}Ml.create=e=>new Ml({typeName:ve.ZodNull,...Ce(e)});class Ps extends Ne{constructor(){super(...arguments),this._any=!0}_parse(t){return pn(t.data)}}Ps.create=e=>new Ps({typeName:ve.ZodAny,...Ce(e)});class so extends Ne{constructor(){super(...arguments),this._unknown=!0}_parse(t){return pn(t.data)}}so.create=e=>new so({typeName:ve.ZodUnknown,...Ce(e)});class Ti extends Ne{_parse(t){const n=this._getOrReturnCtx(t);return oe(n,{code:Z.invalid_type,expected:se.never,received:n.parsedType}),be}}Ti.create=e=>new Ti({typeName:ve.ZodNever,...Ce(e)});class Tp extends Ne{_parse(t){if(this._getType(t)!==se.undefined){const r=this._getOrReturnCtx(t);return oe(r,{code:Z.invalid_type,expected:se.void,received:r.parsedType}),be}return pn(t.data)}}Tp.create=e=>new Tp({typeName:ve.ZodVoid,...Ce(e)});class kr extends Ne{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==se.array)return oe(n,{code:Z.invalid_type,expected:se.array,received:n.parsedType}),be;if(i.exactLength!==null){const o=n.data.length>i.exactLength.value,s=n.data.length<i.exactLength.value;(o||s)&&(oe(n,{code:o?Z.too_big:Z.too_small,minimum:s?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(oe(n,{code:Z.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(oe(n,{code:Z.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,s)=>i.type._parseAsync(new Yr(n,o,n.path,s)))).then(o=>nn.mergeArray(r,o));const a=[...n.data].map((o,s)=>i.type._parseSync(new Yr(n,o,n.path,s)));return nn.mergeArray(r,a)}get element(){return this._def.type}min(t,n){return new kr({...this._def,minLength:{value:t,message:pe.toString(n)}})}max(t,n){return new kr({...this._def,maxLength:{value:t,message:pe.toString(n)}})}length(t,n){return new kr({...this._def,exactLength:{value:t,message:pe.toString(n)}})}nonempty(t){return this.min(1,t)}}kr.create=(e,t)=>new kr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ve.ZodArray,...Ce(t)});function Is(e){if(e instanceof mt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Gr.create(Is(r))}return new mt({...e._def,shape:()=>t})}else return e instanceof kr?new kr({...e._def,type:Is(e.element)}):e instanceof Gr?Gr.create(Is(e.unwrap())):e instanceof ba?ba.create(Is(e.unwrap())):e instanceof qr?qr.create(e.items.map(t=>Is(t))):e}class mt extends Ne{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Be.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==se.object){const l=this._getOrReturnCtx(t);return oe(l,{code:Z.invalid_type,expected:se.object,received:l.parsedType}),be}const{status:r,ctx:i}=this._processInputParams(t),{shape:a,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof Ti&&this._def.unknownKeys==="strip"))for(const l in i.data)o.includes(l)||s.push(l);const u=[];for(const l of o){const c=a[l],d=i.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new Yr(i,d,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof Ti){const l=this._def.unknownKeys;if(l==="passthrough")for(const c of s)u.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(l==="strict")s.length>0&&(oe(i,{code:Z.unrecognized_keys,keys:s}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const c of s){const d=i.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new Yr(i,d,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const l=[];for(const c of u){const d=await c.key,f=await c.value;l.push({key:d,value:f,alwaysSet:c.alwaysSet})}return l}).then(l=>nn.mergeObjectSync(r,l)):nn.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(t){return pe.errToObj,new mt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,a,o,s;const u=(o=(a=(i=this._def).errorMap)===null||a===void 0?void 0:a.call(i,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(s=pe.errToObj(t).message)!==null&&s!==void 0?s:u}:{message:u}}}:{}})}strip(){return new mt({...this._def,unknownKeys:"strip"})}passthrough(){return new mt({...this._def,unknownKeys:"passthrough"})}extend(t){return new mt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new mt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ve.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new mt({...this._def,catchall:t})}pick(t){const n={};return Be.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new mt({...this._def,shape:()=>n})}omit(t){const n={};return Be.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new mt({...this._def,shape:()=>n})}deepPartial(){return Is(this)}partial(t){const n={};return Be.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new mt({...this._def,shape:()=>n})}required(t){const n={};return Be.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof Gr;)a=a._def.innerType;n[r]=a}}),new mt({...this._def,shape:()=>n})}keyof(){return nR(Be.objectKeys(this.shape))}}mt.create=(e,t)=>new mt({shape:()=>e,unknownKeys:"strip",catchall:Ti.create(),typeName:ve.ZodObject,...Ce(t)}),mt.strictCreate=(e,t)=>new mt({shape:()=>e,unknownKeys:"strict",catchall:Ti.create(),typeName:ve.ZodObject,...Ce(t)}),mt.lazycreate=(e,t)=>new mt({shape:e,unknownKeys:"strip",catchall:Ti.create(),typeName:ve.ZodObject,...Ce(t)});class Fl extends Ne{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(a){for(const s of a)if(s.result.status==="valid")return s.result;for(const s of a)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;const o=a.map(s=>new Yn(s.ctx.common.issues));return oe(n,{code:Z.invalid_union,unionErrors:o}),be}if(n.common.async)return Promise.all(r.map(async a=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(i);{let a;const o=[];for(const u of r){const l={...n,common:{...n.common,issues:[]},parent:null},c=u._parseSync({data:n.data,path:n.path,parent:l});if(c.status==="valid")return c;c.status==="dirty"&&!a&&(a={result:c,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(u=>new Yn(u));return oe(n,{code:Z.invalid_union,unionErrors:s}),be}}get options(){return this._def.options}}Fl.create=(e,t)=>new Fl({options:e,typeName:ve.ZodUnion,...Ce(t)});const _i=e=>e instanceof Ul?_i(e.schema):e instanceof Rr?_i(e.innerType()):e instanceof Hl?[e.value]:e instanceof wa?e.options:e instanceof zl?Be.objectValues(e.enum):e instanceof Vl?_i(e._def.innerType):e instanceof Ll?[void 0]:e instanceof Ml?[null]:e instanceof Gr?[void 0,..._i(e.unwrap())]:e instanceof ba?[null,..._i(e.unwrap())]:e instanceof P1||e instanceof Yl?_i(e.unwrap()):e instanceof $l?_i(e._def.innerType):[];class _p extends Ne{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==se.object)return oe(n,{code:Z.invalid_type,expected:se.object,received:n.parsedType}),be;const r=this.discriminator,i=n.data[r],a=this.optionsMap.get(i);return a?n.common.async?a._parseAsync({data:n.data,path:n.path,parent:n}):a._parseSync({data:n.data,path:n.path,parent:n}):(oe(n,{code:Z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),be)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const a of n){const o=_i(a.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const s of o){if(i.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);i.set(s,a)}}return new _p({typeName:ve.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Ce(r)})}}function N1(e,t){const n=ga(e),r=ga(t);if(e===t)return{valid:!0,data:e};if(n===se.object&&r===se.object){const i=Be.objectKeys(t),a=Be.objectKeys(e).filter(s=>i.indexOf(s)!==-1),o={...e,...t};for(const s of a){const u=N1(e[s],t[s]);if(!u.valid)return{valid:!1};o[s]=u.data}return{valid:!0,data:o}}else if(n===se.array&&r===se.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let a=0;a<e.length;a++){const o=e[a],s=t[a],u=N1(o,s);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return n===se.date&&r===se.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Bl extends Ne{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(a,o)=>{if(A1(a)||A1(o))return be;const s=N1(a.value,o.value);return s.valid?((k1(a)||k1(o))&&n.dirty(),{status:n.value,value:s.data}):(oe(r,{code:Z.invalid_intersection_types}),be)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,o])=>i(a,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Bl.create=(e,t,n)=>new Bl({left:e,right:t,typeName:ve.ZodIntersection,...Ce(n)});class qr extends Ne{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==se.array)return oe(r,{code:Z.invalid_type,expected:se.array,received:r.parsedType}),be;if(r.data.length<this._def.items.length)return oe(r,{code:Z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),be;!this._def.rest&&r.data.length>this._def.items.length&&(oe(r,{code:Z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...r.data].map((o,s)=>{const u=this._def.items[s]||this._def.rest;return u?u._parse(new Yr(r,o,r.path,s)):null}).filter(o=>!!o);return r.common.async?Promise.all(a).then(o=>nn.mergeArray(n,o)):nn.mergeArray(n,a)}get items(){return this._def.items}rest(t){return new qr({...this._def,rest:t})}}qr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new qr({items:e,typeName:ve.ZodTuple,rest:null,...Ce(t)})};class jl extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==se.object)return oe(r,{code:Z.invalid_type,expected:se.object,received:r.parsedType}),be;const i=[],a=this._def.keyType,o=this._def.valueType;for(const s in r.data)i.push({key:a._parse(new Yr(r,s,r.path,s)),value:o._parse(new Yr(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?nn.mergeObjectAsync(n,i):nn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Ne?new jl({keyType:t,valueType:n,typeName:ve.ZodRecord,...Ce(r)}):new jl({keyType:Ar.create(),valueType:t,typeName:ve.ZodRecord,...Ce(n)})}}class Sp extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==se.map)return oe(r,{code:Z.invalid_type,expected:se.map,received:r.parsedType}),be;const i=this._def.keyType,a=this._def.valueType,o=[...r.data.entries()].map(([s,u],l)=>({key:i._parse(new Yr(r,s,r.path,[l,"key"])),value:a._parse(new Yr(r,u,r.path,[l,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const u of o){const l=await u.key,c=await u.value;if(l.status==="aborted"||c.status==="aborted")return be;(l.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(l.value,c.value)}return{status:n.value,value:s}})}else{const s=new Map;for(const u of o){const l=u.key,c=u.value;if(l.status==="aborted"||c.status==="aborted")return be;(l.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(l.value,c.value)}return{status:n.value,value:s}}}}Sp.create=(e,t,n)=>new Sp({valueType:t,keyType:e,typeName:ve.ZodMap,...Ce(n)});class uo extends Ne{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==se.set)return oe(r,{code:Z.invalid_type,expected:se.set,received:r.parsedType}),be;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(oe(r,{code:Z.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(oe(r,{code:Z.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const a=this._def.valueType;function o(u){const l=new Set;for(const c of u){if(c.status==="aborted")return be;c.status==="dirty"&&n.dirty(),l.add(c.value)}return{status:n.value,value:l}}const s=[...r.data.values()].map((u,l)=>a._parse(new Yr(r,u,r.path,l)));return r.common.async?Promise.all(s).then(u=>o(u)):o(s)}min(t,n){return new uo({...this._def,minSize:{value:t,message:pe.toString(n)}})}max(t,n){return new uo({...this._def,maxSize:{value:t,message:pe.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}uo.create=(e,t)=>new uo({valueType:e,minSize:null,maxSize:null,typeName:ve.ZodSet,...Ce(t)});class Os extends Ne{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==se.function)return oe(n,{code:Z.invalid_type,expected:se.function,received:n.parsedType}),be;function r(s,u){return bp({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,wp(),Rs].filter(l=>!!l),issueData:{code:Z.invalid_arguments,argumentsError:u}})}function i(s,u){return bp({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,wp(),Rs].filter(l=>!!l),issueData:{code:Z.invalid_return_type,returnTypeError:u}})}const a={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof Ds){const s=this;return pn(async function(...u){const l=new Yn([]),c=await s._def.args.parseAsync(u,a).catch(p=>{throw l.addIssue(r(u,p)),l}),d=await Reflect.apply(o,this,c);return await s._def.returns._def.type.parseAsync(d,a).catch(p=>{throw l.addIssue(i(d,p)),l})})}else{const s=this;return pn(function(...u){const l=s._def.args.safeParse(u,a);if(!l.success)throw new Yn([r(u,l.error)]);const c=Reflect.apply(o,this,l.data),d=s._def.returns.safeParse(c,a);if(!d.success)throw new Yn([i(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Os({...this._def,args:qr.create(t).rest(so.create())})}returns(t){return new Os({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Os({args:t||qr.create([]).rest(so.create()),returns:n||so.create(),typeName:ve.ZodFunction,...Ce(r)})}}class Ul extends Ne{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Ul.create=(e,t)=>new Ul({getter:e,typeName:ve.ZodLazy,...Ce(t)});class Hl extends Ne{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return oe(n,{received:n.data,code:Z.invalid_literal,expected:this._def.value}),be}return{status:"valid",value:t.data}}get value(){return this._def.value}}Hl.create=(e,t)=>new Hl({value:e,typeName:ve.ZodLiteral,...Ce(t)});function nR(e,t){return new wa({values:e,typeName:ve.ZodEnum,...Ce(t)})}class wa extends Ne{constructor(){super(...arguments),Il.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return oe(n,{expected:Be.joinValues(r),received:n.parsedType,code:Z.invalid_type}),be}if(xp(this,Il)||Q3(this,Il,new Set(this._def.values)),!xp(this,Il).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return oe(n,{received:n.data,code:Z.invalid_enum_value,options:r}),be}return pn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return wa.create(t,{...this._def,...n})}exclude(t,n=this._def){return wa.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}Il=new WeakMap,wa.create=nR;class zl extends Ne{constructor(){super(...arguments),Ol.set(this,void 0)}_parse(t){const n=Be.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==se.string&&r.parsedType!==se.number){const i=Be.objectValues(n);return oe(r,{expected:Be.joinValues(i),received:r.parsedType,code:Z.invalid_type}),be}if(xp(this,Ol)||Q3(this,Ol,new Set(Be.getValidEnumValues(this._def.values))),!xp(this,Ol).has(t.data)){const i=Be.objectValues(n);return oe(r,{received:r.data,code:Z.invalid_enum_value,options:i}),be}return pn(t.data)}get enum(){return this._def.values}}Ol=new WeakMap,zl.create=(e,t)=>new zl({values:e,typeName:ve.ZodNativeEnum,...Ce(t)});class Ds extends Ne{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==se.promise&&n.common.async===!1)return oe(n,{code:Z.invalid_type,expected:se.promise,received:n.parsedType}),be;const r=n.parsedType===se.promise?n.data:Promise.resolve(n.data);return pn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Ds.create=(e,t)=>new Ds({type:e,typeName:ve.ZodPromise,...Ce(t)});class Rr extends Ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ve.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,a={addIssue:o=>{oe(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){const o=i.transform(r.data,a);if(r.common.async)return Promise.resolve(o).then(async s=>{if(n.value==="aborted")return be;const u=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return u.status==="aborted"?be:u.status==="dirty"||n.value==="dirty"?Ns(u.value):u});{if(n.value==="aborted")return be;const s=this._def.schema._parseSync({data:o,path:r.path,parent:r});return s.status==="aborted"?be:s.status==="dirty"||n.value==="dirty"?Ns(s.value):s}}if(i.type==="refinement"){const o=s=>{const u=i.refinement(s,a);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?be:(s.status==="dirty"&&n.dirty(),o(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?be:(s.status==="dirty"&&n.dirty(),o(s.value).then(()=>({status:n.value,value:s.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Nl(o))return o;const s=i.transform(o.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>Nl(o)?Promise.resolve(i.transform(o.value,a)).then(s=>({status:n.value,value:s})):o);Be.assertNever(i)}}Rr.create=(e,t,n)=>new Rr({schema:e,typeName:ve.ZodEffects,effect:t,...Ce(n)}),Rr.createWithPreprocess=(e,t,n)=>new Rr({schema:t,effect:{type:"preprocess",transform:e},typeName:ve.ZodEffects,...Ce(n)});class Gr extends Ne{_parse(t){return this._getType(t)===se.undefined?pn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Gr.create=(e,t)=>new Gr({innerType:e,typeName:ve.ZodOptional,...Ce(t)});class ba extends Ne{_parse(t){return this._getType(t)===se.null?pn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ba.create=(e,t)=>new ba({innerType:e,typeName:ve.ZodNullable,...Ce(t)});class Vl extends Ne{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===se.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Vl.create=(e,t)=>new Vl({innerType:e,typeName:ve.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ce(t)});class $l extends Ne{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Pl(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Yn(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Yn(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}$l.create=(e,t)=>new $l({innerType:e,typeName:ve.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ce(t)});class Cp extends Ne{_parse(t){if(this._getType(t)!==se.nan){const r=this._getOrReturnCtx(t);return oe(r,{code:Z.invalid_type,expected:se.nan,received:r.parsedType}),be}return{status:"valid",value:t.data}}}Cp.create=e=>new Cp({typeName:ve.ZodNaN,...Ce(e)});const iY=Symbol("zod_brand");class P1 extends Ne{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Wl extends Ne{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?be:a.status==="dirty"?(n.dirty(),Ns(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?be:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new Wl({in:t,out:n,typeName:ve.ZodPipeline})}}class Yl extends Ne{_parse(t){const n=this._def.innerType._parse(t),r=i=>(Nl(i)&&(i.value=Object.freeze(i.value)),i);return Pl(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}Yl.create=(e,t)=>new Yl({innerType:e,typeName:ve.ZodReadonly,...Ce(t)});function rR(e,t={},n){return e?Ps.create().superRefine((r,i)=>{var a,o;if(!e(r)){const s=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,u=(o=(a=s.fatal)!==null&&a!==void 0?a:n)!==null&&o!==void 0?o:!0,l=typeof s=="string"?{message:s}:s;i.addIssue({code:"custom",...l,fatal:u})}}):Ps.create()}const aY={object:mt.lazycreate};var ve;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ve||(ve={}));const oY=(e,t={message:`Input not instance of ${e.name}`})=>rR(n=>n instanceof e,t),iR=Ar.create,aR=ya.create,sY=Cp.create,uY=va.create,oR=Dl.create,lY=oo.create,cY=Ep.create,dY=Ll.create,fY=Ml.create,pY=Ps.create,hY=so.create,mY=Ti.create,gY=Tp.create,yY=kr.create,vY=mt.create,wY=mt.strictCreate,bY=Fl.create,xY=_p.create,EY=Bl.create,TY=qr.create,_Y=jl.create,SY=Sp.create,CY=uo.create,AY=Os.create,kY=Ul.create,RY=Hl.create,NY=wa.create,PY=zl.create,IY=Ds.create,sR=Rr.create,OY=Gr.create,DY=ba.create,LY=Rr.createWithPreprocess,MY=Wl.create;var I1=Object.freeze({__proto__:null,defaultErrorMap:Rs,setErrorMap:HW,getErrorMap:wp,makeIssue:bp,EMPTY_PATH:zW,addIssueToContext:oe,ParseStatus:nn,INVALID:be,DIRTY:Ns,OK:pn,isAborted:A1,isDirty:k1,isValid:Nl,isAsync:Pl,get util(){return Be},get objectUtil(){return C1},ZodParsedType:se,getParsedType:ga,ZodType:Ne,datetimeRegex:tR,ZodString:Ar,ZodNumber:ya,ZodBigInt:va,ZodBoolean:Dl,ZodDate:oo,ZodSymbol:Ep,ZodUndefined:Ll,ZodNull:Ml,ZodAny:Ps,ZodUnknown:so,ZodNever:Ti,ZodVoid:Tp,ZodArray:kr,ZodObject:mt,ZodUnion:Fl,ZodDiscriminatedUnion:_p,ZodIntersection:Bl,ZodTuple:qr,ZodRecord:jl,ZodMap:Sp,ZodSet:uo,ZodFunction:Os,ZodLazy:Ul,ZodLiteral:Hl,ZodEnum:wa,ZodNativeEnum:zl,ZodPromise:Ds,ZodEffects:Rr,ZodTransformer:Rr,ZodOptional:Gr,ZodNullable:ba,ZodDefault:Vl,ZodCatch:$l,ZodNaN:Cp,BRAND:iY,ZodBranded:P1,ZodPipeline:Wl,ZodReadonly:Yl,custom:rR,Schema:Ne,ZodSchema:Ne,late:aY,get ZodFirstPartyTypeKind(){return ve},coerce:{string:e=>Ar.create({...e,coerce:!0}),number:e=>ya.create({...e,coerce:!0}),boolean:e=>Dl.create({...e,coerce:!0}),bigint:e=>va.create({...e,coerce:!0}),date:e=>oo.create({...e,coerce:!0})},any:pY,array:yY,bigint:uY,boolean:oR,date:lY,discriminatedUnion:xY,effect:sR,enum:NY,function:AY,instanceof:oY,intersection:EY,lazy:kY,literal:RY,map:SY,nan:sY,nativeEnum:PY,never:mY,null:fY,nullable:DY,number:aR,object:vY,oboolean:()=>oR().optional(),onumber:()=>aR().optional(),optional:OY,ostring:()=>iR().optional(),pipeline:MY,preprocess:LY,promise:IY,record:_Y,set:CY,strictObject:wY,string:iR,symbol:cY,transformer:sR,tuple:TY,undefined:dY,union:bY,unknown:hY,void:gY,NEVER:be,ZodIssueCode:Z,quotelessJson:UW,ZodError:Yn});const O1=v.forwardRef(({className:e,type:t,...n},r)=>{const i=xl();return E.jsx(ep,{ref:r,children:E.jsx("input",{dir:i,type:t,className:Le("flex w-full rounded-xl border border-input bg-background p-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-primary-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 transition","rtl:placeholder:text-right",e),...n})})});O1.displayName="Input";const FY=I1.object({name:I1.string().min(2),email:I1.string().email()});function BY(){var s,u,l;const{createUnverifiedContact:e}=X7(),t=dl(),n=Jf(),{data:r}=Df(),{observedElementRef:i}=L0({fallbackHeight:tL}),[a,o]=jj(async c=>{c.preventDefault();const d=new FormData(c.currentTarget),f=Object.fromEntries(d.entries()),p=FY.safeParse(f);p.success&&await e({email:p.data.email,name:p.data.name})});return E.jsxs("div",{ref:i,"data-test":"welcome-screen",className:Le(Bd.widgetMinHeight,"h-fit bg-primary flex flex-col"),children:[E.jsxs("div",{dir:"auto",className:"flex-1 flex flex-col px-4 py-12 text-start space-y-4 relative z-10","data-test":"welcome-header",children:[E.jsx("div",{className:"flex items-center justify-between w-full mb-2","data-test":"welcome-logo-container",children:(s=t.assets)!=null&&s.organizationLogo?E.jsx("img",{src:(u=t.assets)==null?void 0:u.organizationLogo,alt:"Company Logo",className:"h-8 w-auto object-contain","data-test":"organization-logo"}):E.jsx("h2",{className:"font-bold text-xl text-primary-foreground","data-test":"organization-name",dir:"auto",children:(l=r==null?void 0:r.data)==null?void 0:l.organizationName})}),E.jsxs("div",{className:"space-y-2","data-test":"welcome-content",children:[E.jsx("h1",{className:"text-2xl font-bold text-primary-foreground","data-test":"welcome-title",dir:"auto",children:n.get("welcome-title")}),E.jsx("p",{className:"text-primary-foreground/90 text-sm max-w-[320px] leading-relaxed","data-test":"welcome-description",dir:"auto",children:n.get("welcome-description")})]})]}),E.jsx("div",{className:"p-2 bg-background rounded-t-3xl","data-test":"welcome-form-container",dir:"auto",children:E.jsxs("form",{onSubmit:o,className:"space-y-2","data-test":"welcome-form",children:[E.jsxs("div",{className:"space-y-2",children:[E.jsx(O1,{required:!0,autoFocus:!0,placeholder:n.get("your-name"),name:"name",className:"rounded-3xl pl-3","data-test":"name-input"}),E.jsx(O1,{required:!0,type:"email",placeholder:n.get("your-email"),name:"email",className:"rounded-3xl pl-3","data-test":"email-input"})]}),E.jsxs(or,{disabled:a.loading,className:"w-full rounded-3xl","data-test":"start-chat-button",size:"lg",children:[a.loading?n.get("starting-chat"):n.get("start-chat"),E.jsx(C_,{className:"size-4 rtl:-scale-100"})]})]})})]})}function jY(){const{toChatScreen:e}=Sy(),{sessionsState:{data:t,isInitialFetchLoading:n}}=ys(),{observedElementRef:r}=L0({fallbackHeight:CE});return E.jsx("div",{ref:r,className:Le(Bd.widgetHeight,"w-full flex flex-col overflow-hidden bg-background"),children:E.jsx("div",{className:"size-full overflow-scroll p-2",children:E.jsx(Ja,{mode:"wait",children:n?E.jsx(fn,{className:"size-full flex items-center justify-center",children:E.jsx(K3,{})},"loading"):E.jsx(fn,{className:"size-full flex flex-col gap-2 relative",children:t.length?E.jsxs(E.Fragment,{children:[t.map(i=>E.jsxs(or,{variant:"outline",size:"lg",className:"rounded-3xl p-2.5 pr-2 flex text-start justify-between w-full whitespace-normal",onClick:()=>e(i.id),children:[E.jsx("p",{className:"line-clamp-2 overflow-hidden text-ellipsis",children:i.lastMessage}),E.jsx(S_,{className:"size-4 text-muted-foreground shrink-0"})]},i.id)),E.jsx("div",{},"spacer"),E.jsx(or,{size:"lg",className:"mt-auto w-full rounded-3xl sticky bottom-0",onClick:()=>e(),children:"New chat"},"new-session")]}):E.jsxs("div",{className:"size-full flex flex-col gap-2 items-center",children:[E.jsx("div",{className:"flex-1 flex items-center justify-center",children:E.jsx("p",{className:"text-muted-foreground",children:"No conversations yet"})}),E.jsx(or,{size:"lg",className:"w-full rounded-3xl",onClick:()=>e(),children:"Start your first chat"},"new-session")]})},"sessions")})})})}function UY(){Df();const{routerState:{screen:e}}=Sy();return E.jsx("div",{className:"bg-background size-full","data-test":"root-screen",children:E.jsx(Ja,{mode:"wait",children:(()=>{switch(e){case"welcome":return E.jsx(fn,{fadeIn:"right",className:"size-full",snapExit:!0,children:E.jsx(BY,{})},e);case"sessions":return E.jsx(fn,{fadeIn:"right",className:"size-full",snapExit:!0,children:E.jsx(jY,{})},e);case"chat":return E.jsx(fn,{fadeIn:"right",className:"size-full",snapExit:!0,children:E.jsx(jW,{})},e);default:return null}})()})})}var D1="focusScope.autoFocusOnMount",L1="focusScope.autoFocusOnUnmount",uR={bubbles:!1,cancelable:!0},HY="FocusScope",lR=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,u]=v.useState(null),l=Wt(i),c=Wt(a),d=v.useRef(null),f=Vr(t,g=>u(g)),p=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let g=function(b){if(p.paused||!s)return;const T=b.target;s.contains(T)?d.current=T:xa(d.current,{select:!0})},x=function(b){if(p.paused||!s)return;const T=b.relatedTarget;T!==null&&(s.contains(T)||xa(d.current,{select:!0}))},y=function(b){if(document.activeElement===document.body)for(const S of b)S.removedNodes.length>0&&xa(s)};document.addEventListener("focusin",g),document.addEventListener("focusout",x);const w=new MutationObserver(y);return s&&w.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",x),w.disconnect()}}},[r,s,p.paused]),v.useEffect(()=>{if(s){fR.add(p);const g=document.activeElement;if(!s.contains(g)){const y=new CustomEvent(D1,uR);s.addEventListener(D1,l),s.dispatchEvent(y),y.defaultPrevented||(zY(qY(cR(s)),{select:!0}),document.activeElement===g&&xa(s))}return()=>{s.removeEventListener(D1,l),setTimeout(()=>{const y=new CustomEvent(L1,uR);s.addEventListener(L1,c),s.dispatchEvent(y),y.defaultPrevented||xa(g??document.body,{select:!0}),s.removeEventListener(L1,c),fR.remove(p)},0)}}},[s,l,c,p]);const m=v.useCallback(g=>{if(!n&&!r||p.paused)return;const x=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,y=document.activeElement;if(x&&y){const w=g.currentTarget,[b,T]=VY(w);b&&T?!g.shiftKey&&y===T?(g.preventDefault(),n&&xa(b,{select:!0})):g.shiftKey&&y===b&&(g.preventDefault(),n&&xa(T,{select:!0})):y===w&&g.preventDefault()}},[n,r,p.paused]);return E.jsx(Vn.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});lR.displayName=HY;function zY(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(xa(r,{select:t}),document.activeElement!==n)return}function VY(e){const t=cR(e),n=dR(t,e),r=dR(t.reverse(),e);return[n,r]}function cR(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function dR(e,t){for(const n of e)if(!$Y(n,{upTo:t}))return n}function $Y(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function WY(e){return e instanceof HTMLInputElement&&"select"in e}function xa(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&WY(e)&&t&&e.select()}}var fR=YY();function YY(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=pR(e,t),e.unshift(t)},remove(t){var n;e=pR(e,t),(n=e[0])==null||n.resume()}}}function pR(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function qY(e){return e.filter(t=>t.tagName!=="A")}var Ap="right-scroll-bar-position",kp="width-before-scroll-bar",GY="with-scroll-bars-hidden",KY="--removed-body-scroll-bar-size";function M1(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function XY(e,t){var n=v.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var QY=typeof window<"u"?v.useLayoutEffect:v.useEffect,hR=new WeakMap;function ZY(e,t){var n=XY(null,function(r){return e.forEach(function(i){return M1(i,r)})});return QY(function(){var r=hR.get(n);if(r){var i=new Set(r),a=new Set(e),o=n.current;i.forEach(function(s){a.has(s)||M1(s,null)}),a.forEach(function(s){i.has(s)||M1(s,o)})}hR.set(n,e)},[e]),n}var mR=Ck(),F1=function(){},Rp=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:F1,onWheelCapture:F1,onTouchMoveCapture:F1}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,u=e.className,l=e.removeScrollBar,c=e.enabled,d=e.shards,f=e.sideCar,p=e.noIsolation,m=e.inert,g=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,w=e.gapMode,b=il(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=f,S=ZY([n,t]),_=Lt(Lt({},b),i);return v.createElement(v.Fragment,null,c&&v.createElement(T,{sideCar:mR,removeScrollBar:l,shards:d,noIsolation:p,inert:m,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:w}),o?v.cloneElement(v.Children.only(s),Lt(Lt({},_),{ref:S})):v.createElement(y,Lt({},_,{className:u,ref:S}),s))});Rp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Rp.classNames={fullWidth:kp,zeroRight:Ap};var JY={left:0,top:0,right:0,gap:0},B1=function(e){return parseInt(e||"",10)||0},eq=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[B1(n),B1(r),B1(i)]},tq=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return JY;var t=eq(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},nq=c1(),Ls="data-scroll-locked",rq=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n="margin"),`
382
382
  .`.concat(GY,` {
383
383
  overflow: hidden `).concat(r,`;
384
384
  padding-right: `).concat(s,"px ").concat(r,`;
@@ -418,7 +418,7 @@ to {
418
418
  `)},gR=function(){var e=parseInt(document.body.getAttribute(Ls)||"0",10);return isFinite(e)?e:0},iq=function(){v.useEffect(function(){return document.body.setAttribute(Ls,(gR()+1).toString()),function(){var e=gR()-1;e<=0?document.body.removeAttribute(Ls):document.body.setAttribute(Ls,e.toString())}},[])},aq=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;iq();var a=v.useMemo(function(){return tq(i)},[i]);return v.createElement(nq,{styles:rq(a,!t,i,n?"":"!important")})},j1=!1;if(typeof window<"u")try{var Np=Object.defineProperty({},"passive",{get:function(){return j1=!0,!0}});window.addEventListener("test",Np,Np),window.removeEventListener("test",Np,Np)}catch{j1=!1}var Ms=j1?{passive:!1}:!1,oq=function(e){return e.tagName==="TEXTAREA"},yR=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!oq(e)&&n[t]==="visible")},sq=function(e){return yR(e,"overflowY")},uq=function(e){return yR(e,"overflowX")},vR=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=wR(e,r);if(i){var a=bR(e,r),o=a[1],s=a[2];if(o>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},lq=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},cq=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},wR=function(e,t){return e==="v"?sq(t):uq(t)},bR=function(e,t){return e==="v"?lq(t):cq(t)},dq=function(e,t){return e==="h"&&t==="rtl"?-1:1},fq=function(e,t,n,r,i){var a=dq(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,u=t.contains(s),l=!1,c=o>0,d=0,f=0;do{var p=bR(e,s),m=p[0],g=p[1],x=p[2],y=g-x-a*m;(m||y)&&wR(e,s)&&(d+=y,f+=m),s instanceof ShadowRoot?s=s.host:s=s.parentNode}while(!u&&s!==document.body||u&&(t.contains(s)||t===s));return(c&&(Math.abs(d)<1||!i)||!c&&(Math.abs(f)<1||!i))&&(l=!0),l},Pp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},xR=function(e){return[e.deltaX,e.deltaY]},ER=function(e){return e&&"current"in e?e.current:e},pq=function(e,t){return e[0]===t[0]&&e[1]===t[1]},hq=function(e){return`
419
419
  .block-interactivity-`.concat(e,` {pointer-events: none;}
420
420
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
421
- `)},mq=0,Fs=[];function gq(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(mq++)[0],a=v.useState(l1)[0],o=v.useRef(e);v.useEffect(function(){o.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var g=lf([e.lockRef.current],(e.shards||[]).map(ER),!0).filter(Boolean);return g.forEach(function(x){return x.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),g.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=v.useCallback(function(g,x){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!o.current.allowPinchZoom;var y=Pp(g),w=n.current,b="deltaX"in g?g.deltaX:w[0]-y[0],T="deltaY"in g?g.deltaY:w[1]-y[1],S,_=g.target,N=Math.abs(b)>Math.abs(T)?"h":"v";if("touches"in g&&N==="h"&&_.type==="range")return!1;var D=vR(N,_);if(!D)return!0;if(D?S=N:(S=N==="v"?"h":"v",D=vR(N,_)),!D)return!1;if(!r.current&&"changedTouches"in g&&(b||T)&&(r.current=S),!S)return!0;var V=r.current||S;return fq(V,x,g,V==="h"?b:T,!0)},[]),u=v.useCallback(function(g){var x=g;if(!(!Fs.length||Fs[Fs.length-1]!==a)){var y="deltaY"in x?xR(x):Pp(x),w=t.current.filter(function(S){return S.name===x.type&&(S.target===x.target||x.target===S.shadowParent)&&pq(S.delta,y)})[0];if(w&&w.should){x.cancelable&&x.preventDefault();return}if(!w){var b=(o.current.shards||[]).map(ER).filter(Boolean).filter(function(S){return S.contains(x.target)}),T=b.length>0?s(x,b[0]):!o.current.noIsolation;T&&x.cancelable&&x.preventDefault()}}},[]),l=v.useCallback(function(g,x,y,w){var b={name:g,delta:x,target:y,should:w,shadowParent:yq(y)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(T){return T!==b})},1)},[]),c=v.useCallback(function(g){n.current=Pp(g),r.current=void 0},[]),d=v.useCallback(function(g){l(g.type,xR(g),g.target,s(g,e.lockRef.current))},[]),f=v.useCallback(function(g){l(g.type,Pp(g),g.target,s(g,e.lockRef.current))},[]);v.useEffect(function(){return Fs.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",u,Ms),document.addEventListener("touchmove",u,Ms),document.addEventListener("touchstart",c,Ms),function(){Fs=Fs.filter(function(g){return g!==a}),document.removeEventListener("wheel",u,Ms),document.removeEventListener("touchmove",u,Ms),document.removeEventListener("touchstart",c,Ms)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(a,{styles:hq(i)}):null,p?v.createElement(aq,{gapMode:e.gapMode}):null)}function yq(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const vq=kk(mR,gq);var TR=v.forwardRef(function(e,t){return v.createElement(Rp,Lt({},e,{ref:t,sideCar:vq}))});TR.classNames=Rp.classNames;var U1="Popover",[_R,nae]=la(U1,[Yf]),ql=Yf(),[wq,lo]=_R(U1),SR=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=ql(t),u=v.useRef(null),[l,c]=v.useState(!1),[d=!1,f]=Gf({prop:r,defaultProp:i,onChange:a});return E.jsx(_A,{...s,children:E.jsx(wq,{scope:t,contentId:yl(),triggerRef:u,open:d,onOpenChange:f,onOpenToggle:v.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:l,onCustomAnchorAdd:v.useCallback(()=>c(!0),[]),onCustomAnchorRemove:v.useCallback(()=>c(!1),[]),modal:o,children:n})})};SR.displayName=U1;var CR="PopoverAnchor",bq=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=lo(CR,n),a=ql(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return v.useEffect(()=>(o(),()=>s()),[o,s]),E.jsx($y,{...a,...r,ref:t})});bq.displayName=CR;var AR="PopoverTrigger",kR=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=lo(AR,n),a=ql(n),o=Vr(t,i.triggerRef),s=E.jsx(Vn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":IR(i.open),...r,ref:o,onClick:Sn(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:E.jsx($y,{asChild:!0,...a,children:s})});kR.displayName=AR;var xq="PopoverPortal",[rae,Eq]=_R(xq,{forceMount:void 0}),Bs="PopoverContent",RR=v.forwardRef((e,t)=>{const n=Eq(Bs,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=lo(Bs,e.__scopePopover);return E.jsx(Wy,{present:r||a.open,children:a.modal?E.jsx(Tq,{...i,ref:t}):E.jsx(_q,{...i,ref:t})})});RR.displayName=Bs;var Tq=v.forwardRef((e,t)=>{const n=lo(Bs,e.__scopePopover),r=v.useRef(null),i=Vr(t,r),a=v.useRef(!1);return v.useEffect(()=>{const o=r.current;if(o)return _k(o)},[]),E.jsx(TR,{as:Mf,allowPinchZoom:!0,children:E.jsx(NR,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Sn(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),a.current||(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:Sn(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,u=s.button===0&&s.ctrlKey===!0,l=s.button===2||u;a.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:Sn(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),_q=v.forwardRef((e,t)=>{const n=lo(Bs,e.__scopePopover),r=v.useRef(!1),i=v.useRef(!1);return E.jsx(NR,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,s;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),a.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:a=>{var u,l;(u=e.onInteractOutside)==null||u.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=a.target;((l=n.triggerRef.current)==null?void 0:l.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),NR=v.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:l,onInteractOutside:c,...d}=e,f=lo(Bs,n),p=ql(n);return ZA(),E.jsx(lR,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:E.jsx(Ry,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:c,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:E.jsx(SA,{"data-state":IR(f.open),role:"dialog",id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),PR="PopoverClose",Sq=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=lo(PR,n);return E.jsx(Vn.button,{type:"button",...r,ref:t,onClick:Sn(e.onClick,()=>i.onOpenChange(!1))})});Sq.displayName=PR;var Cq="PopoverArrow",Aq=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=ql(n);return E.jsx(CA,{...i,...r,ref:t})});Aq.displayName=Cq;function IR(e){return e?"open":"closed"}var kq=SR,Rq=RR;function H1(){return H1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},H1.apply(null,arguments)}function Nq(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}var OR,DR;typeof document<"u"&&(OR=document),typeof window<"u"&&(DR=window);var Pq=yn.createContext({document:OR,window:DR}),Iq=["children","head","initialContent","src","mountTarget"],LR=v.forwardRef((e,t)=>{var{children:n,head:r,initialContent:i,src:a,mountTarget:o}=e,s=Nq(e,Iq),[u,l]=v.useState(!1),[c,d]=v.useState(),f=T=>{T&&d(T)};v.useImperativeHandle(t,()=>c,[c]);var p=i||"<!DOCTYPE html><html><head></head><body></body></html>",m=()=>c?c.contentDocument:null,g=()=>{var T=m();return o?T==null?void 0:T.querySelector(o):T==null?void 0:T.body},x=v.useRef(),y=v.useCallback(T=>{x.current=T;var S=()=>setInterval(()=>y(T),500);clearInterval(S()),u||l(!0)},[u]);v.useMemo(()=>{!a&&s.onLoad&&u&&s.onLoad(x.current)},[u]),v.useEffect(()=>{if(c&&!a){var T;(T=c.contentWindow)==null||T.addEventListener("DOMContentLoaded",y)}return()=>{if(c&&!a){var S;(S=c.contentWindow)==null||S.removeEventListener("DOMContentLoaded",y)}}},[c,y]);var w=()=>{var T,S=m(),_=(T=m())==null?void 0:T.head,N=g(),D=(S==null?void 0:S.defaultView)||(S==null?void 0:S.parentView),V=E.jsx(Pq.Provider,{value:{document:S,window:D},children:n});return[_&&r&&Zo.createPortal(r,_),c&&N&&Zo.createPortal(V,N)]},b={};return a?(delete b.srcDoc,b.src=a,b.onLoad=s.onLoad):b.srcDoc=p,E.jsx("iframe",H1({title:s.title,ref:f},s,{onLoad:y},b,{children:u&&w()}))});LR.displayName="IFrame";const MR='@import"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..700;1,14..32,100..700&display=swap";@import"https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap";[data-chat-widget] *,[data-chat-widget] :before,[data-chat-widget] :after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }[data-chat-widget] ::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }[data-chat-widget] *,[data-chat-widget] :before,[data-chat-widget] :after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}[data-chat-widget] :before,[data-chat-widget] :after{--tw-content: ""}[data-chat-widget] html,[data-chat-widget] :host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}[data-chat-widget] body{margin:0;line-height:inherit}[data-chat-widget] hr{height:0;color:inherit;border-top-width:1px}[data-chat-widget] abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}[data-chat-widget] h1,[data-chat-widget] h2,[data-chat-widget] h3,[data-chat-widget] h4,[data-chat-widget] h5,[data-chat-widget] h6{font-size:inherit;font-weight:inherit}[data-chat-widget] a{color:inherit;text-decoration:inherit}[data-chat-widget] b,[data-chat-widget] strong{font-weight:bolder}[data-chat-widget] code,[data-chat-widget] kbd,[data-chat-widget] samp,[data-chat-widget] pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}[data-chat-widget] small{font-size:80%}[data-chat-widget] sub,[data-chat-widget] sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}[data-chat-widget] sub{bottom:-.25em}[data-chat-widget] sup{top:-.5em}[data-chat-widget] table{text-indent:0;border-color:inherit;border-collapse:collapse}[data-chat-widget] button,[data-chat-widget] input,[data-chat-widget] optgroup,[data-chat-widget] select,[data-chat-widget] textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}[data-chat-widget] button,[data-chat-widget] select{text-transform:none}[data-chat-widget] button,[data-chat-widget] input:where([type=button]),[data-chat-widget] input:where([type=reset]),[data-chat-widget] input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}[data-chat-widget] :-moz-focusring{outline:auto}[data-chat-widget] :-moz-ui-invalid{box-shadow:none}[data-chat-widget] progress{vertical-align:baseline}[data-chat-widget] ::-webkit-inner-spin-button,[data-chat-widget] ::-webkit-outer-spin-button{height:auto}[data-chat-widget] [type=search]{-webkit-appearance:textfield;outline-offset:-2px}[data-chat-widget] ::-webkit-search-decoration{-webkit-appearance:none}[data-chat-widget] ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}[data-chat-widget] summary{display:list-item}[data-chat-widget] blockquote,[data-chat-widget] dl,[data-chat-widget] dd,[data-chat-widget] h1,[data-chat-widget] h2,[data-chat-widget] h3,[data-chat-widget] h4,[data-chat-widget] h5,[data-chat-widget] h6,[data-chat-widget] hr,[data-chat-widget] figure,[data-chat-widget] p,[data-chat-widget] pre{margin:0}[data-chat-widget] fieldset{margin:0;padding:0}[data-chat-widget] legend{padding:0}[data-chat-widget] ol,[data-chat-widget] ul,[data-chat-widget] menu{list-style:none;margin:0;padding:0}[data-chat-widget] dialog{padding:0}[data-chat-widget] textarea{resize:vertical}[data-chat-widget] input::-moz-placeholder,[data-chat-widget] textarea::-moz-placeholder{opacity:1;color:#9ca3af}[data-chat-widget] input::placeholder,[data-chat-widget] textarea::placeholder{opacity:1;color:#9ca3af}[data-chat-widget] button,[data-chat-widget] [role=button]{cursor:pointer}[data-chat-widget] :disabled{cursor:default}[data-chat-widget] img,[data-chat-widget] svg,[data-chat-widget] video,[data-chat-widget] canvas,[data-chat-widget] audio,[data-chat-widget] iframe,[data-chat-widget] embed,[data-chat-widget] object{display:block;vertical-align:middle}[data-chat-widget] img,[data-chat-widget] video{max-width:100%;height:auto}[data-chat-widget] [hidden]:where(:not([hidden=until-found])){display:none}[data-chat-widget] *{-ms-overflow-style:none;scrollbar-width:none}[data-chat-widget] *::-webkit-scrollbar{display:none}[data-chat-widget] *{border-color:hsl(var(--opencx-border))}[data-chat-widget] .container{width:100%}@media (min-width: 640px){[data-chat-widget] .container{max-width:640px}}@media (min-width: 768px){[data-chat-widget] .container{max-width:768px}}@media (min-width: 1024px){[data-chat-widget] .container{max-width:1024px}}@media (min-width: 1280px){[data-chat-widget] .container{max-width:1280px}}@media (min-width: 1536px){[data-chat-widget] .container{max-width:1536px}}[data-chat-widget] .prose{color:var(--tw-prose-body);max-width:65ch}[data-chat-widget] .prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}[data-chat-widget] .prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}[data-chat-widget] .prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}[data-chat-widget] .prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}[data-chat-widget] .prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}[data-chat-widget] .prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}[data-chat-widget] .prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}[data-chat-widget] .prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}[data-chat-widget] .prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}[data-chat-widget] .prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}[data-chat-widget] .prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}[data-chat-widget] .prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}[data-chat-widget] .prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}[data-chat-widget] .prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}[data-chat-widget] .prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}[data-chat-widget] .prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}[data-chat-widget] .prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}[data-chat-widget] .prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}[data-chat-widget] .prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}[data-chat-widget] .prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}[data-chat-widget] .prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}[data-chat-widget] .prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}[data-chat-widget] .prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em}[data-chat-widget] .prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}[data-chat-widget] .prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}[data-chat-widget] .prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}[data-chat-widget] .prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900;color:inherit}[data-chat-widget] .prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}[data-chat-widget] .prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:800;color:inherit}[data-chat-widget] .prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}[data-chat-widget] .prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}[data-chat-widget] .prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}[data-chat-widget] .prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}[data-chat-widget] .prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}[data-chat-widget] .prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}[data-chat-widget] .prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}[data-chat-widget] .prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%),0 3px rgb(var(--tw-prose-kbd-shadows) / 10%);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}[data-chat-widget] .prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}[data-chat-widget] .prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:"`"}[data-chat-widget] .prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}[data-chat-widget] .prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}[data-chat-widget] .prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}[data-chat-widget] .prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}[data-chat-widget] .prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}[data-chat-widget] .prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}[data-chat-widget] .prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}[data-chat-widget] .prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}[data-chat-widget] .prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-top:.8571429em;padding-inline-end:1.1428571em;padding-bottom:.8571429em;padding-inline-start:1.1428571em}[data-chat-widget] .prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}[data-chat-widget] .prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}[data-chat-widget] .prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}[data-chat-widget] .prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){width:100%;table-layout:auto;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}[data-chat-widget] .prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}[data-chat-widget] .prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}[data-chat-widget] .prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}[data-chat-widget] .prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}[data-chat-widget] .prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}[data-chat-widget] .prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}[data-chat-widget] .prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}[data-chat-widget] .prose :where(th,td):not(:where([class~=not-prose],[class~=not-prose] *)){text-align:start}[data-chat-widget] .prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}[data-chat-widget] .prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}[data-chat-widget] .prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: 17 24 39;--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}[data-chat-widget] .prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}[data-chat-widget] .prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}[data-chat-widget] .prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}[data-chat-widget] .prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}[data-chat-widget] .prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}[data-chat-widget] .prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}[data-chat-widget] .prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}[data-chat-widget] .prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}[data-chat-widget] .prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}[data-chat-widget] .prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}[data-chat-widget] .prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}[data-chat-widget] .prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}[data-chat-widget] .prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}[data-chat-widget] .prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}[data-chat-widget] .prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}[data-chat-widget] .prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}[data-chat-widget] .prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}[data-chat-widget] .prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}[data-chat-widget] .prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}[data-chat-widget] .prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}[data-chat-widget] .prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}[data-chat-widget] .prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}[data-chat-widget] .prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}[data-chat-widget] .prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}[data-chat-widget] .prose-sm{font-size:.875rem;line-height:1.7142857}[data-chat-widget] .prose-sm :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}[data-chat-widget] .prose-sm :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;line-height:1.5555556;margin-top:.8888889em;margin-bottom:.8888889em}[data-chat-widget] .prose-sm :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-inline-start:1.1111111em}[data-chat-widget] .prose-sm :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2.1428571em;margin-top:0;margin-bottom:.8em;line-height:1.2}[data-chat-widget] .prose-sm :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.4285714em;margin-top:1.6em;margin-bottom:.8em;line-height:1.4}[data-chat-widget] .prose-sm :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;margin-top:1.5555556em;margin-bottom:.4444444em;line-height:1.5555556}[data-chat-widget] .prose-sm :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.4285714em;margin-bottom:.5714286em;line-height:1.4285714}[data-chat-widget] .prose-sm :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}[data-chat-widget] .prose-sm :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}[data-chat-widget] .prose-sm :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}[data-chat-widget] .prose-sm :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}[data-chat-widget] .prose-sm :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;border-radius:.3125rem;padding-top:.1428571em;padding-inline-end:.3571429em;padding-bottom:.1428571em;padding-inline-start:.3571429em}[data-chat-widget] .prose-sm :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em}[data-chat-widget] .prose-sm :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em}[data-chat-widget] .prose-sm :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em}[data-chat-widget] .prose-sm :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.6666667;margin-top:1.6666667em;margin-bottom:1.6666667em;border-radius:.25rem;padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}[data-chat-widget] .prose-sm :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}[data-chat-widget] .prose-sm :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}[data-chat-widget] .prose-sm :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;margin-bottom:.2857143em}[data-chat-widget] .prose-sm :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}[data-chat-widget] .prose-sm :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}[data-chat-widget] .prose-sm :where(.prose-sm>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}[data-chat-widget] .prose-sm :where(.prose-sm>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}[data-chat-widget] .prose-sm :where(.prose-sm>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}[data-chat-widget] .prose-sm :where(.prose-sm>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}[data-chat-widget] .prose-sm :where(.prose-sm>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}[data-chat-widget] .prose-sm :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}[data-chat-widget] .prose-sm :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}[data-chat-widget] .prose-sm :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}[data-chat-widget] .prose-sm :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;padding-inline-start:1.5714286em}[data-chat-widget] .prose-sm :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2.8571429em;margin-bottom:2.8571429em}[data-chat-widget] .prose-sm :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}[data-chat-widget] .prose-sm :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}[data-chat-widget] .prose-sm :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}[data-chat-widget] .prose-sm :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}[data-chat-widget] .prose-sm :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.5}[data-chat-widget] .prose-sm :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}[data-chat-widget] .prose-sm :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}[data-chat-widget] .prose-sm :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}[data-chat-widget] .prose-sm :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}[data-chat-widget] .prose-sm :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}[data-chat-widget] .prose-sm :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}[data-chat-widget] .prose-sm :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}[data-chat-widget] .prose-sm :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}[data-chat-widget] .prose-sm :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.3333333;margin-top:.6666667em}[data-chat-widget] .prose-sm :where(.prose-sm>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}[data-chat-widget] .prose-sm :where(.prose-sm>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}[data-chat-widget] .prose-slate{--tw-prose-body: #334155;--tw-prose-headings: #0f172a;--tw-prose-lead: #475569;--tw-prose-links: #0f172a;--tw-prose-bold: #0f172a;--tw-prose-counters: #64748b;--tw-prose-bullets: #cbd5e1;--tw-prose-hr: #e2e8f0;--tw-prose-quotes: #0f172a;--tw-prose-quote-borders: #e2e8f0;--tw-prose-captions: #64748b;--tw-prose-kbd: #0f172a;--tw-prose-kbd-shadows: 15 23 42;--tw-prose-code: #0f172a;--tw-prose-pre-code: #e2e8f0;--tw-prose-pre-bg: #1e293b;--tw-prose-th-borders: #cbd5e1;--tw-prose-td-borders: #e2e8f0;--tw-prose-invert-body: #cbd5e1;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #94a3b8;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #94a3b8;--tw-prose-invert-bullets: #475569;--tw-prose-invert-hr: #334155;--tw-prose-invert-quotes: #f1f5f9;--tw-prose-invert-quote-borders: #334155;--tw-prose-invert-captions: #94a3b8;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #cbd5e1;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #475569;--tw-prose-invert-td-borders: #334155}[data-chat-widget] .pointer-events-none{pointer-events:none}[data-chat-widget] .visible{visibility:visible}[data-chat-widget] .static{position:static}[data-chat-widget] .fixed{position:fixed}[data-chat-widget] .absolute{position:absolute}[data-chat-widget] .relative{position:relative}[data-chat-widget] .sticky{position:sticky}[data-chat-widget] .inset-0{top:0;right:0;bottom:0;left:0}[data-chat-widget] .bottom-0{bottom:0}[data-chat-widget] .left-2{left:.5rem}[data-chat-widget] .isolate{isolation:isolate}[data-chat-widget] .z-10{z-index:10}[data-chat-widget] .z-50{z-index:50}[data-chat-widget] .-mx-1{margin-left:-.25rem;margin-right:-.25rem}[data-chat-widget] .my-1{margin-top:.25rem;margin-bottom:.25rem}[data-chat-widget] .mb-2{margin-bottom:.5rem}[data-chat-widget] .ml-auto{margin-left:auto}[data-chat-widget] .mt-2{margin-top:.5rem}[data-chat-widget] .mt-auto{margin-top:auto}[data-chat-widget] .line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}[data-chat-widget] .block{display:block}[data-chat-widget] .inline{display:inline}[data-chat-widget] .flex{display:flex}[data-chat-widget] .inline-flex{display:inline-flex}[data-chat-widget] .contents{display:contents}[data-chat-widget] .hidden{display:none}[data-chat-widget] .aspect-square{aspect-ratio:1 / 1}[data-chat-widget] .size-12{width:3rem;height:3rem}[data-chat-widget] .size-16{width:4rem;height:4rem}[data-chat-widget] .size-3{width:.75rem;height:.75rem}[data-chat-widget] .size-3\\.5{width:.875rem;height:.875rem}[data-chat-widget] .size-4{width:1rem;height:1rem}[data-chat-widget] .size-6{width:1.5rem;height:1.5rem}[data-chat-widget] .size-8{width:2rem;height:2rem}[data-chat-widget] .size-fit{width:-moz-fit-content;width:fit-content;height:-moz-fit-content;height:fit-content}[data-chat-widget] .size-full{width:100%;height:100%}[data-chat-widget] .h-10{height:2.5rem}[data-chat-widget] .h-2{height:.5rem}[data-chat-widget] .h-3\\.5{height:.875rem}[data-chat-widget] .h-4{height:1rem}[data-chat-widget] .h-5{height:1.25rem}[data-chat-widget] .h-8{height:2rem}[data-chat-widget] .h-\\[600px\\]{height:600px}[data-chat-widget] .h-fit{height:-moz-fit-content;height:fit-content}[data-chat-widget] .h-full{height:100%}[data-chat-widget] .h-px{height:1px}[data-chat-widget] .max-h-\\[600px\\]{max-height:600px}[data-chat-widget] .max-h-full{max-height:100%}[data-chat-widget] .min-h-12{min-height:3rem}[data-chat-widget] .min-h-\\[400px\\]{min-height:400px}[data-chat-widget] .w-10{width:2.5rem}[data-chat-widget] .w-2{width:.5rem}[data-chat-widget] .w-2\\/3{width:66.666667%}[data-chat-widget] .w-3\\.5{width:.875rem}[data-chat-widget] .w-4{width:1rem}[data-chat-widget] .w-60{width:15rem}[data-chat-widget] .w-9{width:2.25rem}[data-chat-widget] .w-auto{width:auto}[data-chat-widget] .w-fit{width:-moz-fit-content;width:fit-content}[data-chat-widget] .w-full{width:100%}[data-chat-widget] .min-w-56{min-width:14rem}[data-chat-widget] .min-w-\\[8rem\\]{min-width:8rem}[data-chat-widget] .max-w-\\[320px\\]{max-width:320px}[data-chat-widget] .max-w-full{max-width:100%}[data-chat-widget] .max-w-xs{max-width:20rem}[data-chat-widget] .flex-1{flex:1 1 0%}[data-chat-widget] .shrink-0{flex-shrink:0}[data-chat-widget] .translate-x-\\[var\\(--opencx-wobble-x\\)\\]{--tw-translate-x: var(--opencx-wobble-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-chat-widget] .translate-y-\\[var\\(--opencx-wobble-y\\)\\]{--tw-translate-y: var(--opencx-wobble-y);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-chat-widget] .scale-\\[1\\.01\\]{--tw-scale-x: 1.01;--tw-scale-y: 1.01;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-chat-widget] .scale-\\[1\\.02\\]{--tw-scale-x: 1.02;--tw-scale-y: 1.02;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-chat-widget] .scale-\\[1\\.1\\]{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-chat-widget] .scale-\\[1\\]{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}[data-chat-widget] .animate-bounce{animation:bounce 1s infinite}@keyframes pulse{50%{opacity:.5}}[data-chat-widget] .animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}[data-chat-widget] .animate-spin{animation:spin 1s linear infinite}[data-chat-widget] .cursor-default{cursor:default}[data-chat-widget] .cursor-not-allowed{cursor:not-allowed}[data-chat-widget] .cursor-pointer{cursor:pointer}[data-chat-widget] .select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}[data-chat-widget] .resize-none{resize:none}[data-chat-widget] .flex-row{flex-direction:row}[data-chat-widget] .flex-col{flex-direction:column}[data-chat-widget] .flex-wrap{flex-wrap:wrap}[data-chat-widget] .items-start{align-items:flex-start}[data-chat-widget] .items-end{align-items:flex-end}[data-chat-widget] .items-center{align-items:center}[data-chat-widget] .justify-start{justify-content:flex-start}[data-chat-widget] .justify-end{justify-content:flex-end}[data-chat-widget] .justify-center{justify-content:center}[data-chat-widget] .justify-between{justify-content:space-between}[data-chat-widget] .gap-0\\.5{gap:.125rem}[data-chat-widget] .gap-1{gap:.25rem}[data-chat-widget] .gap-2{gap:.5rem}[data-chat-widget] .space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}[data-chat-widget] .space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}[data-chat-widget] .space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}[data-chat-widget] .self-end{align-self:flex-end}[data-chat-widget] .overflow-auto{overflow:auto}[data-chat-widget] .overflow-hidden{overflow:hidden}[data-chat-widget] .overflow-scroll{overflow:scroll}[data-chat-widget] .scroll-smooth{scroll-behavior:smooth}[data-chat-widget] .text-ellipsis{text-overflow:ellipsis}[data-chat-widget] .whitespace-normal{white-space:normal}[data-chat-widget] .whitespace-nowrap{white-space:nowrap}[data-chat-widget] .rounded-2xl{border-radius:1rem}[data-chat-widget] .rounded-3xl{border-radius:1.5rem}[data-chat-widget] .rounded-full{border-radius:9999px}[data-chat-widget] .rounded-lg{border-radius:.5rem}[data-chat-widget] .rounded-md{border-radius:.375rem}[data-chat-widget] .rounded-sm{border-radius:.125rem}[data-chat-widget] .rounded-xl{border-radius:.75rem}[data-chat-widget] .rounded-t-3xl{border-top-left-radius:1.5rem;border-top-right-radius:1.5rem}[data-chat-widget] .border{border-width:1px}[data-chat-widget] .border-2{border-width:2px}[data-chat-widget] .border-b{border-bottom-width:1px}[data-chat-widget] .border-destructive{border-color:hsl(var(--opencx-destructive))}[data-chat-widget] .border-input{border-color:hsl(var(--opencx-input))}[data-chat-widget] .border-primary{border-color:hsl(var(--opencx-primary))}[data-chat-widget] .border-transparent{border-color:transparent}[data-chat-widget] .bg-background{background-color:hsl(var(--opencx-background))}[data-chat-widget] .bg-black\\/50{background-color:#00000080}[data-chat-widget] .bg-destructive{background-color:hsl(var(--opencx-destructive))}[data-chat-widget] .bg-muted{background-color:hsl(var(--opencx-muted))}[data-chat-widget] .bg-primary{background-color:hsl(var(--opencx-primary))}[data-chat-widget] .bg-secondary{background-color:hsl(var(--opencx-secondary))}[data-chat-widget] .bg-transparent{background-color:transparent}[data-chat-widget] .bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}[data-chat-widget] .from-primary\\/50{--tw-gradient-from: hsl(var(--opencx-primary) / .5) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--opencx-primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}[data-chat-widget] .via-primary{--tw-gradient-to: hsl(var(--opencx-primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), hsl(var(--opencx-primary)) var(--tw-gradient-via-position), var(--tw-gradient-to)}[data-chat-widget] .to-primary{--tw-gradient-to: hsl(var(--opencx-primary)) var(--tw-gradient-to-position)}[data-chat-widget] .fill-current{fill:currentColor}[data-chat-widget] .object-contain{-o-object-fit:contain;object-fit:contain}[data-chat-widget] .object-cover{-o-object-fit:cover;object-fit:cover}[data-chat-widget] .p-0{padding:0}[data-chat-widget] .p-1{padding:.25rem}[data-chat-widget] .p-2{padding:.5rem}[data-chat-widget] .p-2\\.5{padding:.625rem}[data-chat-widget] .p-4{padding:1rem}[data-chat-widget] .px-2{padding-left:.5rem;padding-right:.5rem}[data-chat-widget] .px-3{padding-left:.75rem;padding-right:.75rem}[data-chat-widget] .px-4{padding-left:1rem;padding-right:1rem}[data-chat-widget] .py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}[data-chat-widget] .py-12{padding-top:3rem;padding-bottom:3rem}[data-chat-widget] .py-2{padding-top:.5rem;padding-bottom:.5rem}[data-chat-widget] .pl-2{padding-left:.5rem}[data-chat-widget] .pl-3{padding-left:.75rem}[data-chat-widget] .pl-8{padding-left:2rem}[data-chat-widget] .pr-2{padding-right:.5rem}[data-chat-widget] .text-center{text-align:center}[data-chat-widget] .text-start{text-align:start}[data-chat-widget] .align-middle{vertical-align:middle}[data-chat-widget] .font-inter{font-family:Inter,Rubik,serif,sans-serif}[data-chat-widget] .text-2xl{font-size:1.5rem;line-height:2rem}[data-chat-widget] .text-\\[10px\\]{font-size:10px}[data-chat-widget] .text-sm{font-size:.875rem;line-height:1.25rem}[data-chat-widget] .text-xl{font-size:1.25rem;line-height:1.75rem}[data-chat-widget] .text-xs{font-size:.75rem;line-height:1rem}[data-chat-widget] .font-bold{font-weight:700}[data-chat-widget] .font-medium{font-weight:500}[data-chat-widget] .font-semibold{font-weight:600}[data-chat-widget] .leading-relaxed{line-height:1.625}[data-chat-widget] .leading-snug{line-height:1.375}[data-chat-widget] .leading-tight{line-height:1.25}[data-chat-widget] .tracking-widest{letter-spacing:.1em}[data-chat-widget] .text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}[data-chat-widget] .text-destructive{color:hsl(var(--opencx-destructive))}[data-chat-widget] .text-destructive-foreground{color:hsl(var(--opencx-destructive-foreground))}[data-chat-widget] .text-emerald-500{--tw-text-opacity: 1;color:rgb(16 185 129 / var(--tw-text-opacity))}[data-chat-widget] .text-foreground{color:hsl(var(--opencx-foreground))}[data-chat-widget] .text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}[data-chat-widget] .text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity))}[data-chat-widget] .text-muted{color:hsl(var(--opencx-muted))}[data-chat-widget] .text-muted-foreground{color:hsl(var(--opencx-muted-foreground))}[data-chat-widget] .text-primary{color:hsl(var(--opencx-primary))}[data-chat-widget] .text-primary-foreground{color:hsl(var(--opencx-primary-foreground))}[data-chat-widget] .text-primary-foreground\\/90{color:hsl(var(--opencx-primary-foreground) / .9)}[data-chat-widget] .text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}[data-chat-widget] .text-rose-500{--tw-text-opacity: 1;color:rgb(244 63 94 / var(--tw-text-opacity))}[data-chat-widget] .text-secondary-foreground{color:hsl(var(--opencx-secondary-foreground))}[data-chat-widget] .underline{text-decoration-line:underline}[data-chat-widget] .underline-offset-4{text-underline-offset:4px}[data-chat-widget] .antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}[data-chat-widget] .opacity-0{opacity:0}[data-chat-widget] .opacity-50{opacity:.5}[data-chat-widget] .opacity-60{opacity:.6}[data-chat-widget] .shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-chat-widget] .shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-chat-widget] .shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-chat-widget] .shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-chat-widget] .shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-chat-widget] .shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-chat-widget] .shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-chat-widget] .outline-none{outline:2px solid transparent;outline-offset:2px}[data-chat-widget] .outline{outline-style:solid}[data-chat-widget] .ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}[data-chat-widget] .ring-offset-background{--tw-ring-offset-color: hsl(var(--opencx-background))}[data-chat-widget] .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}[data-chat-widget] .transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[data-chat-widget] .transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[data-chat-widget] .transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[data-chat-widget] .transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[data-chat-widget] .ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}[data-chat-widget] .animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}[data-chat-widget] .fade-in-0{--tw-enter-opacity: 0}[data-chat-widget] .zoom-in-95{--tw-enter-scale: .95}[data-chat-widget] .ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}[data-chat-widget] .\\[animation-delay\\:-0\\.15s\\]{animation-delay:-.15s}[data-chat-widget] .\\[animation-delay\\:-0\\.3s\\]{animation-delay:-.3s}[data-chat-widget] .\\[background\\:radial-gradient\\(50\\%_50\\%_at_50\\%_100\\%\\,hsl\\(var\\(--opencx-primary-foreground\\)\\)_-75\\%\\,hsl\\(var\\(--opencx-primary\\)\\)_100\\%\\)\\]{background:radial-gradient(50% 50% at 50% 100%,hsl(var(--opencx-primary-foreground)) -75%,hsl(var(--opencx-primary)))}[data-chat-widget] .required:after{content:" *";color:red}[data-chat-widget] .file\\:border-0::file-selector-button{border-width:0px}[data-chat-widget] .file\\:bg-transparent::file-selector-button{background-color:transparent}[data-chat-widget] .file\\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}[data-chat-widget] .file\\:font-medium::file-selector-button{font-weight:500}[data-chat-widget] .file\\:text-primary-foreground::file-selector-button{color:hsl(var(--opencx-primary-foreground))}[data-chat-widget] .placeholder\\:text-muted-foreground::-moz-placeholder{color:hsl(var(--opencx-muted-foreground))}[data-chat-widget] .placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--opencx-muted-foreground))}[data-chat-widget] .hover\\:bg-accent:hover{background-color:hsl(var(--opencx-accent))}[data-chat-widget] .hover\\:bg-green-50\\/50:hover{background-color:#f0fdf480}[data-chat-widget] .hover\\:bg-red-50\\/50:hover{background-color:#fef2f280}[data-chat-widget] .hover\\:text-accent-foreground:hover{color:hsl(var(--opencx-accent-foreground))}[data-chat-widget] .hover\\:text-blue-600:hover{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity))}[data-chat-widget] .hover\\:text-green-500:hover{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity))}[data-chat-widget] .hover\\:text-primary:hover{color:hsl(var(--opencx-primary))}[data-chat-widget] .hover\\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}[data-chat-widget] .hover\\:underline:hover{text-decoration-line:underline}[data-chat-widget] .focus\\:bg-accent:focus{background-color:hsl(var(--opencx-accent))}[data-chat-widget] .focus\\:text-accent-foreground:focus{color:hsl(var(--opencx-accent-foreground))}[data-chat-widget] .focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}[data-chat-widget] .focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}[data-chat-widget] .focus-visible\\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--opencx-ring))}[data-chat-widget] .focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}[data-chat-widget] .focus-visible\\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--opencx-background))}[data-chat-widget] .active\\:scale-90:active{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-chat-widget] .active\\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-chat-widget] .active\\:shadow-none:active{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-chat-widget] .hover\\:active\\:scale-95:active:hover{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-chat-widget] .disabled\\:pointer-events-none:disabled{pointer-events:none}[data-chat-widget] .disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}[data-chat-widget] .disabled\\:opacity-0:disabled{opacity:0}[data-chat-widget] .disabled\\:opacity-50:disabled{opacity:.5}[data-chat-widget] .group:hover .group-hover\\:opacity-100{opacity:1}[data-chat-widget] .group:hover .group-hover\\:active\\:scale-90:active,[data-chat-widget] .group:active .group-active\\:scale-90{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-chat-widget] .data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}[data-chat-widget] .data-\\[state\\=checked\\]\\:translate-x-4[data-state=checked]{--tw-translate-x: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-chat-widget] .data-\\[state\\=unchecked\\]\\:translate-x-0[data-state=unchecked]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-chat-widget] .data-\\[state\\=checked\\]\\:bg-primary[data-state=checked]{background-color:hsl(var(--opencx-primary))}[data-chat-widget] .data-\\[state\\=open\\]\\:bg-accent[data-state=open]{background-color:hsl(var(--opencx-accent))}[data-chat-widget] .data-\\[state\\=unchecked\\]\\:bg-input[data-state=unchecked]{background-color:hsl(var(--opencx-input))}[data-chat-widget] .data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}[data-chat-widget] .data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}[data-chat-widget] .data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}[data-chat-widget] .data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}[data-chat-widget] .data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}[data-chat-widget] .data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}[data-chat-widget] .data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}[data-chat-widget] .data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}[data-chat-widget] .data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}[data-chat-widget] .data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}[data-chat-widget] .data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}[data-chat-widget] .prose-a\\:underline :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){text-decoration-line:underline}[data-chat-widget] .prose-a\\:decoration-primary :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){text-decoration-color:hsl(var(--opencx-primary))}[data-chat-widget] .rtl\\:-scale-100:where([dir=rtl],[dir=rtl] *){--tw-scale-x: -1;--tw-scale-y: -1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-chat-widget] .rtl\\:flex-row-reverse:where([dir=rtl],[dir=rtl] *){flex-direction:row-reverse}[data-chat-widget] .rtl\\:text-right:where([dir=rtl],[dir=rtl] *){text-align:right}[data-chat-widget] .rtl\\:placeholder\\:text-right:where([dir=rtl],[dir=rtl] *)::-moz-placeholder{text-align:right}[data-chat-widget] .rtl\\:placeholder\\:text-right:where([dir=rtl],[dir=rtl] *)::placeholder{text-align:right}[data-chat-widget] .\\[\\&_span\\]\\:size-1 span{width:.25rem;height:.25rem}[data-chat-widget] .\\[\\&_span\\]\\:bg-secondary-foreground span{background-color:hsl(var(--opencx-secondary-foreground))}[data-chat-widget] .\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}[data-chat-widget] .\\[\\&_svg\\]\\:size-4 svg{width:1rem;height:1rem}[data-chat-widget] .\\[\\&_svg\\]\\:size-6 svg{width:1.5rem;height:1.5rem}[data-chat-widget] .\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}';function Oq({className:e}){return E.jsx("svg",{width:"26",height:"32",viewBox:"0 0 26 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:Le("text-primary-foreground",e),children:E.jsx("path",{d:"M1.34103 25.6132H5.44245C5.74203 25.6228 6.02673 25.7462 6.23867 25.9582C6.45062 26.1703 6.5739 26.4551 6.58348 26.7548V30.8584C6.59305 31.1581 6.71634 31.443 6.92828 31.655C7.14023 31.8671 7.42492 31.9904 7.7245 32H18.2894C18.589 31.9904 18.8737 31.8671 19.0856 31.655C19.2976 31.443 19.4209 31.1581 19.4304 30.8584V26.7548C19.4401 26.4545 19.5638 26.1692 19.7765 25.957C19.9892 25.7449 20.2748 25.6219 20.5749 25.6132H24.659C24.9586 25.6036 25.2433 25.4803 25.4552 25.2682C25.6671 25.0562 25.7904 24.7713 25.8 24.4716V7.52839C25.7904 7.22865 25.6671 6.94381 25.4552 6.73176C25.2433 6.5197 24.9586 6.39635 24.659 6.38677H20.561C20.2603 6.37802 19.9742 6.25457 19.7614 6.04169C19.5487 5.82881 19.4253 5.54261 19.4165 5.24168V1.14161C19.4072 0.84419 19.2858 0.561291 19.0768 0.349589C18.8678 0.137887 18.5865 0.0130193 18.2894 0L7.7245 0C7.42492 0.00957792 7.14023 0.132929 6.92828 0.344983C6.71634 0.557036 6.59305 0.841878 6.58348 1.14161V5.24168C6.57477 5.54203 6.45187 5.82773 6.23983 6.04052C6.0278 6.25331 5.74262 6.37715 5.44245 6.38677H1.34103C1.04144 6.39635 0.756749 6.5197 0.544805 6.73176C0.332861 6.94381 0.209574 7.22865 0.200001 7.52839V24.4716C0.209574 24.7713 0.332861 25.0562 0.544805 25.2682C0.756749 25.4803 1.04144 25.6036 1.34103 25.6132ZM6.58348 24.4716V7.52839C6.59305 7.22865 6.71634 6.94381 6.92828 6.73176C7.14023 6.5197 7.42492 6.39635 7.7245 6.38677H18.2894C18.589 6.39635 18.8737 6.5197 19.0856 6.73176C19.2976 6.94381 19.4209 7.22865 19.4304 7.52839V24.4716C19.4209 24.7713 19.2976 25.0562 19.0856 25.2682C18.8737 25.4803 18.589 25.6036 18.2894 25.6132H7.7245C7.42492 25.6036 7.14023 25.4803 6.92828 25.2682C6.71634 25.0562 6.59305 24.7713 6.58348 24.4716Z",fill:"currentColor"})})}function Dq({isOpen:e}){const{theme:t}=dl();return E.jsx(kR,{"data-testid":"widget-popover-trigger","data-chat-widget":!0,style:{fontSize:"16px",position:"fixed",zIndex:1e7,...AE({primary:t==null?void 0:t.primaryColor}),right:"20px",bottom:"20px"},className:Le("size-12 font-inter flex items-center justify-center"),children:E.jsx(ep,{children:E.jsx("div",{className:Le("relative size-full rounded-full","flex items-center justify-center","transition-all","[background:radial-gradient(50%_50%_at_50%_100%,hsl(var(--opencx-primary-foreground))_-75%,hsl(var(--opencx-primary))_100%)]","text-primary-foreground","shadow-xl","active:scale-90","[&_svg]:size-6"),children:E.jsx(Ja,{mode:"wait",children:e?E.jsx(fn,{snapExit:!0,fadeIn:"up",overrides:{initial:{rotate:45},animate:{rotate:0}},children:E.jsx(A_,{})},"x-icon"):E.jsx(fn,{snapExit:!0,overrides:{initial:{rotate:45},animate:{rotate:0}},children:E.jsx(Oq,{})},"message-icon")})})})})}function Lq(){return E.jsx(Ja,{children:E.jsxs(fn,{"data-test":"loading-container",className:"flex flex-row items-end w-full gap-1 animate-pulse",children:[E.jsx("div",{className:"flex items-center gap-1","data-test":"avatar-container",children:E.jsx(vp,{"data-test":"loading-avatar",children:E.jsx(q3,{"data-test":"avatar-fallback"})})}),E.jsxs("div",{className:"flex items-center [&_span]:bg-secondary-foreground [&_span]:size-1 gap-1 p-2 rounded-xl bg-secondary border","data-test":"loading-dots-container",children:[E.jsx(us.span,{"data-test":"loading-dot-1",className:"rounded-full animate-bounce [animation-delay:-0.3s]"}),E.jsx(us.span,{"data-test":"loading-dot-2",className:"rounded-full animate-bounce [animation-delay:-0.15s]"}),E.jsx(us.span,{"data-test":"loading-dot-3",className:"rounded-full animate-bounce"})]})]})})}function Mq(e){return E.jsx("div",{className:"w-full max-w-full overflow-auto shrink-0","data-test":"fallback-container",children:E.jsx("pre",{dir:"auto",className:"text-xs leading-tight","data-test":"fallback-content",children:JSON.stringify(e,null,1)})})}function FR(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function iae(){}function aae(){}const hn=Ea(/[A-Za-z]/),rn=Ea(/[\dA-Za-z]/),Fq=Ea(/[#-'*+\--9=?A-Z^-~]/);function Ip(e){return e!==null&&(e<32||e===127)}const z1=Ea(/\d/),Bq=Ea(/[\dA-Fa-f]/),jq=Ea(/[!-/:-@[-`{-~]/);function me(e){return e!==null&&e<-2}function Je(e){return e!==null&&(e<0||e===32)}function De(e){return e===-2||e===-1||e===32}const Op=Ea(new RegExp("\\p{P}|\\p{S}","u")),co=Ea(/\s/);function Ea(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Uq(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const Dp=function(e){if(e==null)return $q;if(typeof e=="function")return Lp(e);if(typeof e=="object")return Array.isArray(e)?Hq(e):zq(e);if(typeof e=="string")return Vq(e);throw new Error("Expected function, string, or object as test")};function Hq(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Dp(e[n]);return Lp(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function zq(e){const t=e;return Lp(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function Vq(e){return Lp(t);function t(n){return n&&n.type===e}}function Lp(e){return t;function t(n,r,i){return!!(Wq(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function $q(){return!0}function Wq(e){return e!==null&&typeof e=="object"&&"type"in e}function oae(e){return e}const BR=[],Yq=!0,V1=!1,qq="skip";function jR(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=Dp(i),o=r?-1:1;s(e,void 0,[])();function s(u,l,c){const d=u&&typeof u=="object"?u:{};if(typeof d.type=="string"){const p=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(u.type+(p?"<"+p+">":""))+")"})}return f;function f(){let p=BR,m,g,x;if((!t||a(u,l,c[c.length-1]||void 0))&&(p=Gq(n(u,c)),p[0]===V1))return p;if("children"in u&&u.children){const y=u;if(y.children&&p[0]!==qq)for(g=(r?y.children.length:-1)+o,x=c.concat(y);g>-1&&g<y.children.length;){const w=y.children[g];if(m=s(w,g,x)(),m[0]===V1)return m;g=typeof m[1]=="number"?m[1]:g+o}}return p}}}function Gq(e){return Array.isArray(e)?e:typeof e=="number"?[Yq,e]:e==null?BR:[e]}function Kq(e,t,n){const i=Dp((n||{}).ignore||[]),a=Xq(t);let o=-1;for(;++o<a.length;)jR(e,"text",s);function s(l,c){let d=-1,f;for(;++d<c.length;){const p=c[d],m=f?f.children:void 0;if(i(p,m?m.indexOf(p):void 0,f))return;f=p}if(f)return u(l,c)}function u(l,c){const d=c[c.length-1],f=a[o][0],p=a[o][1];let m=0;const x=d.children.indexOf(l);let y=!1,w=[];f.lastIndex=0;let b=f.exec(l.value);for(;b;){const T=b.index,S={index:b.index,input:b.input,stack:[...c,l]};let _=p(...b,S);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?f.lastIndex=T+1:(m!==T&&w.push({type:"text",value:l.value.slice(m,T)}),Array.isArray(_)?w.push(..._):_&&w.push(_),m=T+b[0].length,y=!0),!f.global)break;b=f.exec(l.value)}return y?(m<l.value.length&&w.push({type:"text",value:l.value.slice(m)}),d.children.splice(x,1,...w)):w=[l],x+w.length}}function Xq(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([Qq(i[0]),Zq(i[1])])}return t}function Qq(e){return typeof e=="string"?new RegExp(Uq(e),"g"):e}function Zq(e){return typeof e=="function"?e:function(){return e}}const $1="phrasing",W1=["autolink","link","image","label"];function Jq(){return{transforms:[oG],enter:{literalAutolink:tG,literalAutolinkEmail:Y1,literalAutolinkHttp:Y1,literalAutolinkWww:Y1},exit:{literalAutolink:aG,literalAutolinkEmail:iG,literalAutolinkHttp:nG,literalAutolinkWww:rG}}}function eG(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:$1,notInConstruct:W1},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:$1,notInConstruct:W1},{character:":",before:"[ps]",after:"\\/",inConstruct:$1,notInConstruct:W1}]}}function tG(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Y1(e){this.config.enter.autolinkProtocol.call(this,e)}function nG(e){this.config.exit.autolinkProtocol.call(this,e)}function rG(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function iG(e){this.config.exit.autolinkEmail.call(this,e)}function aG(e){this.exit(e)}function oG(e){Kq(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,sG],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),uG]],{ignore:["link","linkReference"]})}function sG(e,t,n,r,i){let a="";if(!UR(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!lG(n)))return!1;const o=cG(n+r);if(!o[0])return!1;const s={type:"link",title:null,url:a+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[s,{type:"text",value:o[1]}]:s}function uG(e,t,n,r){return!UR(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function lG(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function cG(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=FR(e,"(");let a=FR(e,")");for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function UR(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||co(n)||Op(n))&&(!t||n!==47)}function Nr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}HR.peek=xG;function dG(){return{enter:{gfmFootnoteDefinition:pG,gfmFootnoteDefinitionLabelString:hG,gfmFootnoteCall:yG,gfmFootnoteCallString:vG},exit:{gfmFootnoteDefinition:gG,gfmFootnoteDefinitionLabelString:mG,gfmFootnoteCall:bG,gfmFootnoteCallString:wG}}}function fG(){return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:EG,footnoteReference:HR}}}function pG(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function hG(){this.buffer()}function mG(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=Nr(this.sliceSerialize(e)).toLowerCase()}function gG(e){this.exit(e)}function yG(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function vG(){this.buffer()}function wG(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=Nr(this.sliceSerialize(e)).toLowerCase()}function bG(e){this.exit(e)}function HR(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const o=n.enter("footnoteReference"),s=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{...i.current(),before:a,after:"]"})),s(),o(),a+=i.move("]"),a}function xG(){return"["}function EG(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const o=n.enter("footnoteDefinition"),s=n.enter("label");return a+=i.move(n.safe(n.associationId(e),{...i.current(),before:a,after:"]"})),s(),a+=i.move("]:"+(e.children&&e.children.length>0?" ":"")),i.shift(4),a+=i.move(n.indentLines(n.containerFlow(e,i.current()),TG)),o(),a}function TG(e,t,n){return t===0?e:(n?"":" ")+e}const _G=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];zR.peek=RG;function SG(){return{canContainEols:["delete"],enter:{strikethrough:AG},exit:{strikethrough:kG}}}function CG(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:_G}],handlers:{delete:zR}}}function AG(e){this.enter({type:"delete",children:[]},e)}function kG(e){this.exit(e)}function zR(e,t,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),a(),o}function RG(){return"~"}function NG(e,t={}){const n=(t.align||[]).concat(),r=t.stringLength||IG,i=[],a=[],o=[],s=[];let u=0,l=-1;for(;++l<e.length;){const m=[],g=[];let x=-1;for(e[l].length>u&&(u=e[l].length);++x<e[l].length;){const y=PG(e[l][x]);if(t.alignDelimiters!==!1){const w=r(y);g[x]=w,(s[x]===void 0||w>s[x])&&(s[x]=w)}m.push(y)}a[l]=m,o[l]=g}let c=-1;if(typeof n=="object"&&"length"in n)for(;++c<u;)i[c]=VR(n[c]);else{const m=VR(n);for(;++c<u;)i[c]=m}c=-1;const d=[],f=[];for(;++c<u;){const m=i[c];let g="",x="";m===99?(g=":",x=":"):m===108?g=":":m===114&&(x=":");let y=t.alignDelimiters===!1?1:Math.max(1,s[c]-g.length-x.length);const w=g+"-".repeat(y)+x;t.alignDelimiters!==!1&&(y=g.length+y+x.length,y>s[c]&&(s[c]=y),f[c]=y),d[c]=w}a.splice(1,0,d),o.splice(1,0,f),l=-1;const p=[];for(;++l<a.length;){const m=a[l],g=o[l];c=-1;const x=[];for(;++c<u;){const y=m[c]||"";let w="",b="";if(t.alignDelimiters!==!1){const T=s[c]-(g[c]||0),S=i[c];S===114?w=" ".repeat(T):S===99?T%2?(w=" ".repeat(T/2+.5),b=" ".repeat(T/2-.5)):(w=" ".repeat(T/2),b=w):b=" ".repeat(T)}t.delimiterStart!==!1&&!c&&x.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&y==="")&&(t.delimiterStart!==!1||c)&&x.push(" "),t.alignDelimiters!==!1&&x.push(w),x.push(y),t.alignDelimiters!==!1&&x.push(b),t.padding!==!1&&x.push(" "),(t.delimiterEnd!==!1||c!==u-1)&&x.push("|")}p.push(t.delimiterEnd===!1?x.join("").replace(/ +$/,""):x.join(""))}return p.join(`
421
+ `)},mq=0,Fs=[];function gq(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(mq++)[0],a=v.useState(c1)[0],o=v.useRef(e);v.useEffect(function(){o.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var g=lf([e.lockRef.current],(e.shards||[]).map(ER),!0).filter(Boolean);return g.forEach(function(x){return x.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),g.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=v.useCallback(function(g,x){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!o.current.allowPinchZoom;var y=Pp(g),w=n.current,b="deltaX"in g?g.deltaX:w[0]-y[0],T="deltaY"in g?g.deltaY:w[1]-y[1],S,_=g.target,N=Math.abs(b)>Math.abs(T)?"h":"v";if("touches"in g&&N==="h"&&_.type==="range")return!1;var D=vR(N,_);if(!D)return!0;if(D?S=N:(S=N==="v"?"h":"v",D=vR(N,_)),!D)return!1;if(!r.current&&"changedTouches"in g&&(b||T)&&(r.current=S),!S)return!0;var V=r.current||S;return fq(V,x,g,V==="h"?b:T,!0)},[]),u=v.useCallback(function(g){var x=g;if(!(!Fs.length||Fs[Fs.length-1]!==a)){var y="deltaY"in x?xR(x):Pp(x),w=t.current.filter(function(S){return S.name===x.type&&(S.target===x.target||x.target===S.shadowParent)&&pq(S.delta,y)})[0];if(w&&w.should){x.cancelable&&x.preventDefault();return}if(!w){var b=(o.current.shards||[]).map(ER).filter(Boolean).filter(function(S){return S.contains(x.target)}),T=b.length>0?s(x,b[0]):!o.current.noIsolation;T&&x.cancelable&&x.preventDefault()}}},[]),l=v.useCallback(function(g,x,y,w){var b={name:g,delta:x,target:y,should:w,shadowParent:yq(y)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(T){return T!==b})},1)},[]),c=v.useCallback(function(g){n.current=Pp(g),r.current=void 0},[]),d=v.useCallback(function(g){l(g.type,xR(g),g.target,s(g,e.lockRef.current))},[]),f=v.useCallback(function(g){l(g.type,Pp(g),g.target,s(g,e.lockRef.current))},[]);v.useEffect(function(){return Fs.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",u,Ms),document.addEventListener("touchmove",u,Ms),document.addEventListener("touchstart",c,Ms),function(){Fs=Fs.filter(function(g){return g!==a}),document.removeEventListener("wheel",u,Ms),document.removeEventListener("touchmove",u,Ms),document.removeEventListener("touchstart",c,Ms)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(a,{styles:hq(i)}):null,p?v.createElement(aq,{gapMode:e.gapMode}):null)}function yq(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const vq=kk(mR,gq);var TR=v.forwardRef(function(e,t){return v.createElement(Rp,Lt({},e,{ref:t,sideCar:vq}))});TR.classNames=Rp.classNames;var U1="Popover",[_R,nae]=la(U1,[Yf]),ql=Yf(),[wq,lo]=_R(U1),SR=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=ql(t),u=v.useRef(null),[l,c]=v.useState(!1),[d=!1,f]=Gf({prop:r,defaultProp:i,onChange:a});return E.jsx(_A,{...s,children:E.jsx(wq,{scope:t,contentId:yl(),triggerRef:u,open:d,onOpenChange:f,onOpenToggle:v.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:l,onCustomAnchorAdd:v.useCallback(()=>c(!0),[]),onCustomAnchorRemove:v.useCallback(()=>c(!1),[]),modal:o,children:n})})};SR.displayName=U1;var CR="PopoverAnchor",bq=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=lo(CR,n),a=ql(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return v.useEffect(()=>(o(),()=>s()),[o,s]),E.jsx(Wy,{...a,...r,ref:t})});bq.displayName=CR;var AR="PopoverTrigger",kR=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=lo(AR,n),a=ql(n),o=Vr(t,i.triggerRef),s=E.jsx(Vn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":IR(i.open),...r,ref:o,onClick:Sn(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:E.jsx(Wy,{asChild:!0,...a,children:s})});kR.displayName=AR;var xq="PopoverPortal",[rae,Eq]=_R(xq,{forceMount:void 0}),Bs="PopoverContent",RR=v.forwardRef((e,t)=>{const n=Eq(Bs,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=lo(Bs,e.__scopePopover);return E.jsx(Yy,{present:r||a.open,children:a.modal?E.jsx(Tq,{...i,ref:t}):E.jsx(_q,{...i,ref:t})})});RR.displayName=Bs;var Tq=v.forwardRef((e,t)=>{const n=lo(Bs,e.__scopePopover),r=v.useRef(null),i=Vr(t,r),a=v.useRef(!1);return v.useEffect(()=>{const o=r.current;if(o)return _k(o)},[]),E.jsx(TR,{as:Mf,allowPinchZoom:!0,children:E.jsx(NR,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Sn(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),a.current||(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:Sn(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,u=s.button===0&&s.ctrlKey===!0,l=s.button===2||u;a.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:Sn(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),_q=v.forwardRef((e,t)=>{const n=lo(Bs,e.__scopePopover),r=v.useRef(!1),i=v.useRef(!1);return E.jsx(NR,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,s;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),a.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:a=>{var u,l;(u=e.onInteractOutside)==null||u.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=a.target;((l=n.triggerRef.current)==null?void 0:l.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),NR=v.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:l,onInteractOutside:c,...d}=e,f=lo(Bs,n),p=ql(n);return ZA(),E.jsx(lR,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:E.jsx(Ny,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:c,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:E.jsx(SA,{"data-state":IR(f.open),role:"dialog",id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),PR="PopoverClose",Sq=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=lo(PR,n);return E.jsx(Vn.button,{type:"button",...r,ref:t,onClick:Sn(e.onClick,()=>i.onOpenChange(!1))})});Sq.displayName=PR;var Cq="PopoverArrow",Aq=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=ql(n);return E.jsx(CA,{...i,...r,ref:t})});Aq.displayName=Cq;function IR(e){return e?"open":"closed"}var kq=SR,Rq=RR;function H1(){return H1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},H1.apply(null,arguments)}function Nq(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}var OR,DR;typeof document<"u"&&(OR=document),typeof window<"u"&&(DR=window);var Pq=yn.createContext({document:OR,window:DR}),Iq=["children","head","initialContent","src","mountTarget"],LR=v.forwardRef((e,t)=>{var{children:n,head:r,initialContent:i,src:a,mountTarget:o}=e,s=Nq(e,Iq),[u,l]=v.useState(!1),[c,d]=v.useState(),f=T=>{T&&d(T)};v.useImperativeHandle(t,()=>c,[c]);var p=i||"<!DOCTYPE html><html><head></head><body></body></html>",m=()=>c?c.contentDocument:null,g=()=>{var T=m();return o?T==null?void 0:T.querySelector(o):T==null?void 0:T.body},x=v.useRef(),y=v.useCallback(T=>{x.current=T;var S=()=>setInterval(()=>y(T),500);clearInterval(S()),u||l(!0)},[u]);v.useMemo(()=>{!a&&s.onLoad&&u&&s.onLoad(x.current)},[u]),v.useEffect(()=>{if(c&&!a){var T;(T=c.contentWindow)==null||T.addEventListener("DOMContentLoaded",y)}return()=>{if(c&&!a){var S;(S=c.contentWindow)==null||S.removeEventListener("DOMContentLoaded",y)}}},[c,y]);var w=()=>{var T,S=m(),_=(T=m())==null?void 0:T.head,N=g(),D=(S==null?void 0:S.defaultView)||(S==null?void 0:S.parentView),V=E.jsx(Pq.Provider,{value:{document:S,window:D},children:n});return[_&&r&&Zo.createPortal(r,_),c&&N&&Zo.createPortal(V,N)]},b={};return a?(delete b.srcDoc,b.src=a,b.onLoad=s.onLoad):b.srcDoc=p,E.jsx("iframe",H1({title:s.title,ref:f},s,{onLoad:y},b,{children:u&&w()}))});LR.displayName="IFrame";const MR='@import"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..700;1,14..32,100..700&display=swap";@import"https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap";[data-chat-widget] *,[data-chat-widget] :before,[data-chat-widget] :after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }[data-chat-widget] ::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }[data-chat-widget] *,[data-chat-widget] :before,[data-chat-widget] :after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}[data-chat-widget] :before,[data-chat-widget] :after{--tw-content: ""}[data-chat-widget] html,[data-chat-widget] :host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}[data-chat-widget] body{margin:0;line-height:inherit}[data-chat-widget] hr{height:0;color:inherit;border-top-width:1px}[data-chat-widget] abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}[data-chat-widget] h1,[data-chat-widget] h2,[data-chat-widget] h3,[data-chat-widget] h4,[data-chat-widget] h5,[data-chat-widget] h6{font-size:inherit;font-weight:inherit}[data-chat-widget] a{color:inherit;text-decoration:inherit}[data-chat-widget] b,[data-chat-widget] strong{font-weight:bolder}[data-chat-widget] code,[data-chat-widget] kbd,[data-chat-widget] samp,[data-chat-widget] pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}[data-chat-widget] small{font-size:80%}[data-chat-widget] sub,[data-chat-widget] sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}[data-chat-widget] sub{bottom:-.25em}[data-chat-widget] sup{top:-.5em}[data-chat-widget] table{text-indent:0;border-color:inherit;border-collapse:collapse}[data-chat-widget] button,[data-chat-widget] input,[data-chat-widget] optgroup,[data-chat-widget] select,[data-chat-widget] textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}[data-chat-widget] button,[data-chat-widget] select{text-transform:none}[data-chat-widget] button,[data-chat-widget] input:where([type=button]),[data-chat-widget] input:where([type=reset]),[data-chat-widget] input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}[data-chat-widget] :-moz-focusring{outline:auto}[data-chat-widget] :-moz-ui-invalid{box-shadow:none}[data-chat-widget] progress{vertical-align:baseline}[data-chat-widget] ::-webkit-inner-spin-button,[data-chat-widget] ::-webkit-outer-spin-button{height:auto}[data-chat-widget] [type=search]{-webkit-appearance:textfield;outline-offset:-2px}[data-chat-widget] ::-webkit-search-decoration{-webkit-appearance:none}[data-chat-widget] ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}[data-chat-widget] summary{display:list-item}[data-chat-widget] blockquote,[data-chat-widget] dl,[data-chat-widget] dd,[data-chat-widget] h1,[data-chat-widget] h2,[data-chat-widget] h3,[data-chat-widget] h4,[data-chat-widget] h5,[data-chat-widget] h6,[data-chat-widget] hr,[data-chat-widget] figure,[data-chat-widget] p,[data-chat-widget] pre{margin:0}[data-chat-widget] fieldset{margin:0;padding:0}[data-chat-widget] legend{padding:0}[data-chat-widget] ol,[data-chat-widget] ul,[data-chat-widget] menu{list-style:none;margin:0;padding:0}[data-chat-widget] dialog{padding:0}[data-chat-widget] textarea{resize:vertical}[data-chat-widget] input::-moz-placeholder,[data-chat-widget] textarea::-moz-placeholder{opacity:1;color:#9ca3af}[data-chat-widget] input::placeholder,[data-chat-widget] textarea::placeholder{opacity:1;color:#9ca3af}[data-chat-widget] button,[data-chat-widget] [role=button]{cursor:pointer}[data-chat-widget] :disabled{cursor:default}[data-chat-widget] img,[data-chat-widget] svg,[data-chat-widget] video,[data-chat-widget] canvas,[data-chat-widget] audio,[data-chat-widget] iframe,[data-chat-widget] embed,[data-chat-widget] object{display:block;vertical-align:middle}[data-chat-widget] img,[data-chat-widget] video{max-width:100%;height:auto}[data-chat-widget] [hidden]:where(:not([hidden=until-found])){display:none}[data-chat-widget] *{-ms-overflow-style:none;scrollbar-width:none}[data-chat-widget] *::-webkit-scrollbar{display:none}[data-chat-widget] *{border-color:hsl(var(--opencx-border))}[data-chat-widget] .container{width:100%}@media (min-width: 640px){[data-chat-widget] .container{max-width:640px}}@media (min-width: 768px){[data-chat-widget] .container{max-width:768px}}@media (min-width: 1024px){[data-chat-widget] .container{max-width:1024px}}@media (min-width: 1280px){[data-chat-widget] .container{max-width:1280px}}@media (min-width: 1536px){[data-chat-widget] .container{max-width:1536px}}[data-chat-widget] .prose{color:var(--tw-prose-body);max-width:65ch}[data-chat-widget] .prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}[data-chat-widget] .prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}[data-chat-widget] .prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}[data-chat-widget] .prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}[data-chat-widget] .prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}[data-chat-widget] .prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}[data-chat-widget] .prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}[data-chat-widget] .prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}[data-chat-widget] .prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}[data-chat-widget] .prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}[data-chat-widget] .prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}[data-chat-widget] .prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}[data-chat-widget] .prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}[data-chat-widget] .prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}[data-chat-widget] .prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}[data-chat-widget] .prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}[data-chat-widget] .prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}[data-chat-widget] .prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}[data-chat-widget] .prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}[data-chat-widget] .prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}[data-chat-widget] .prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}[data-chat-widget] .prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}[data-chat-widget] .prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em}[data-chat-widget] .prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}[data-chat-widget] .prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}[data-chat-widget] .prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}[data-chat-widget] .prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900;color:inherit}[data-chat-widget] .prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}[data-chat-widget] .prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:800;color:inherit}[data-chat-widget] .prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}[data-chat-widget] .prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}[data-chat-widget] .prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}[data-chat-widget] .prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}[data-chat-widget] .prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}[data-chat-widget] .prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}[data-chat-widget] .prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}[data-chat-widget] .prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%),0 3px rgb(var(--tw-prose-kbd-shadows) / 10%);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}[data-chat-widget] .prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}[data-chat-widget] .prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:"`"}[data-chat-widget] .prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}[data-chat-widget] .prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}[data-chat-widget] .prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}[data-chat-widget] .prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}[data-chat-widget] .prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}[data-chat-widget] .prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}[data-chat-widget] .prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}[data-chat-widget] .prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}[data-chat-widget] .prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-top:.8571429em;padding-inline-end:1.1428571em;padding-bottom:.8571429em;padding-inline-start:1.1428571em}[data-chat-widget] .prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}[data-chat-widget] .prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}[data-chat-widget] .prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}[data-chat-widget] .prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){width:100%;table-layout:auto;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}[data-chat-widget] .prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}[data-chat-widget] .prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}[data-chat-widget] .prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}[data-chat-widget] .prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}[data-chat-widget] .prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}[data-chat-widget] .prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}[data-chat-widget] .prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}[data-chat-widget] .prose :where(th,td):not(:where([class~=not-prose],[class~=not-prose] *)){text-align:start}[data-chat-widget] .prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}[data-chat-widget] .prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}[data-chat-widget] .prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: 17 24 39;--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}[data-chat-widget] .prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}[data-chat-widget] .prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}[data-chat-widget] .prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}[data-chat-widget] .prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}[data-chat-widget] .prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}[data-chat-widget] .prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}[data-chat-widget] .prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}[data-chat-widget] .prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}[data-chat-widget] .prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}[data-chat-widget] .prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}[data-chat-widget] .prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}[data-chat-widget] .prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}[data-chat-widget] .prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}[data-chat-widget] .prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}[data-chat-widget] .prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}[data-chat-widget] .prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}[data-chat-widget] .prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}[data-chat-widget] .prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}[data-chat-widget] .prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}[data-chat-widget] .prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}[data-chat-widget] .prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}[data-chat-widget] .prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}[data-chat-widget] .prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}[data-chat-widget] .prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}[data-chat-widget] .prose-sm{font-size:.875rem;line-height:1.7142857}[data-chat-widget] .prose-sm :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}[data-chat-widget] .prose-sm :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;line-height:1.5555556;margin-top:.8888889em;margin-bottom:.8888889em}[data-chat-widget] .prose-sm :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-inline-start:1.1111111em}[data-chat-widget] .prose-sm :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2.1428571em;margin-top:0;margin-bottom:.8em;line-height:1.2}[data-chat-widget] .prose-sm :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.4285714em;margin-top:1.6em;margin-bottom:.8em;line-height:1.4}[data-chat-widget] .prose-sm :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;margin-top:1.5555556em;margin-bottom:.4444444em;line-height:1.5555556}[data-chat-widget] .prose-sm :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.4285714em;margin-bottom:.5714286em;line-height:1.4285714}[data-chat-widget] .prose-sm :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}[data-chat-widget] .prose-sm :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}[data-chat-widget] .prose-sm :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}[data-chat-widget] .prose-sm :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}[data-chat-widget] .prose-sm :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;border-radius:.3125rem;padding-top:.1428571em;padding-inline-end:.3571429em;padding-bottom:.1428571em;padding-inline-start:.3571429em}[data-chat-widget] .prose-sm :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em}[data-chat-widget] .prose-sm :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em}[data-chat-widget] .prose-sm :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em}[data-chat-widget] .prose-sm :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.6666667;margin-top:1.6666667em;margin-bottom:1.6666667em;border-radius:.25rem;padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}[data-chat-widget] .prose-sm :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}[data-chat-widget] .prose-sm :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}[data-chat-widget] .prose-sm :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;margin-bottom:.2857143em}[data-chat-widget] .prose-sm :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}[data-chat-widget] .prose-sm :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}[data-chat-widget] .prose-sm :where(.prose-sm>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}[data-chat-widget] .prose-sm :where(.prose-sm>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}[data-chat-widget] .prose-sm :where(.prose-sm>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}[data-chat-widget] .prose-sm :where(.prose-sm>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}[data-chat-widget] .prose-sm :where(.prose-sm>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}[data-chat-widget] .prose-sm :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}[data-chat-widget] .prose-sm :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}[data-chat-widget] .prose-sm :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}[data-chat-widget] .prose-sm :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;padding-inline-start:1.5714286em}[data-chat-widget] .prose-sm :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2.8571429em;margin-bottom:2.8571429em}[data-chat-widget] .prose-sm :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}[data-chat-widget] .prose-sm :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}[data-chat-widget] .prose-sm :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}[data-chat-widget] .prose-sm :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}[data-chat-widget] .prose-sm :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.5}[data-chat-widget] .prose-sm :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}[data-chat-widget] .prose-sm :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}[data-chat-widget] .prose-sm :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}[data-chat-widget] .prose-sm :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}[data-chat-widget] .prose-sm :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}[data-chat-widget] .prose-sm :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}[data-chat-widget] .prose-sm :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}[data-chat-widget] .prose-sm :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}[data-chat-widget] .prose-sm :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.3333333;margin-top:.6666667em}[data-chat-widget] .prose-sm :where(.prose-sm>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}[data-chat-widget] .prose-sm :where(.prose-sm>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}[data-chat-widget] .prose-slate{--tw-prose-body: #334155;--tw-prose-headings: #0f172a;--tw-prose-lead: #475569;--tw-prose-links: #0f172a;--tw-prose-bold: #0f172a;--tw-prose-counters: #64748b;--tw-prose-bullets: #cbd5e1;--tw-prose-hr: #e2e8f0;--tw-prose-quotes: #0f172a;--tw-prose-quote-borders: #e2e8f0;--tw-prose-captions: #64748b;--tw-prose-kbd: #0f172a;--tw-prose-kbd-shadows: 15 23 42;--tw-prose-code: #0f172a;--tw-prose-pre-code: #e2e8f0;--tw-prose-pre-bg: #1e293b;--tw-prose-th-borders: #cbd5e1;--tw-prose-td-borders: #e2e8f0;--tw-prose-invert-body: #cbd5e1;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #94a3b8;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #94a3b8;--tw-prose-invert-bullets: #475569;--tw-prose-invert-hr: #334155;--tw-prose-invert-quotes: #f1f5f9;--tw-prose-invert-quote-borders: #334155;--tw-prose-invert-captions: #94a3b8;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #cbd5e1;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #475569;--tw-prose-invert-td-borders: #334155}[data-chat-widget] .pointer-events-none{pointer-events:none}[data-chat-widget] .visible{visibility:visible}[data-chat-widget] .static{position:static}[data-chat-widget] .fixed{position:fixed}[data-chat-widget] .absolute{position:absolute}[data-chat-widget] .relative{position:relative}[data-chat-widget] .sticky{position:sticky}[data-chat-widget] .inset-0{top:0;right:0;bottom:0;left:0}[data-chat-widget] .bottom-0{bottom:0}[data-chat-widget] .left-2{left:.5rem}[data-chat-widget] .isolate{isolation:isolate}[data-chat-widget] .z-10{z-index:10}[data-chat-widget] .z-50{z-index:50}[data-chat-widget] .-mx-1{margin-left:-.25rem;margin-right:-.25rem}[data-chat-widget] .my-1{margin-top:.25rem;margin-bottom:.25rem}[data-chat-widget] .mb-2{margin-bottom:.5rem}[data-chat-widget] .ml-auto{margin-left:auto}[data-chat-widget] .mt-2{margin-top:.5rem}[data-chat-widget] .mt-auto{margin-top:auto}[data-chat-widget] .line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}[data-chat-widget] .block{display:block}[data-chat-widget] .inline{display:inline}[data-chat-widget] .flex{display:flex}[data-chat-widget] .inline-flex{display:inline-flex}[data-chat-widget] .contents{display:contents}[data-chat-widget] .hidden{display:none}[data-chat-widget] .aspect-square{aspect-ratio:1 / 1}[data-chat-widget] .size-12{width:3rem;height:3rem}[data-chat-widget] .size-16{width:4rem;height:4rem}[data-chat-widget] .size-3{width:.75rem;height:.75rem}[data-chat-widget] .size-3\\.5{width:.875rem;height:.875rem}[data-chat-widget] .size-4{width:1rem;height:1rem}[data-chat-widget] .size-6{width:1.5rem;height:1.5rem}[data-chat-widget] .size-8{width:2rem;height:2rem}[data-chat-widget] .size-fit{width:-moz-fit-content;width:fit-content;height:-moz-fit-content;height:fit-content}[data-chat-widget] .size-full{width:100%;height:100%}[data-chat-widget] .h-10{height:2.5rem}[data-chat-widget] .h-2{height:.5rem}[data-chat-widget] .h-3\\.5{height:.875rem}[data-chat-widget] .h-4{height:1rem}[data-chat-widget] .h-5{height:1.25rem}[data-chat-widget] .h-8{height:2rem}[data-chat-widget] .h-\\[600px\\]{height:600px}[data-chat-widget] .h-fit{height:-moz-fit-content;height:fit-content}[data-chat-widget] .h-full{height:100%}[data-chat-widget] .h-px{height:1px}[data-chat-widget] .max-h-\\[600px\\]{max-height:600px}[data-chat-widget] .max-h-full{max-height:100%}[data-chat-widget] .min-h-12{min-height:3rem}[data-chat-widget] .min-h-\\[400px\\]{min-height:400px}[data-chat-widget] .w-10{width:2.5rem}[data-chat-widget] .w-2{width:.5rem}[data-chat-widget] .w-2\\/3{width:66.666667%}[data-chat-widget] .w-3\\.5{width:.875rem}[data-chat-widget] .w-4{width:1rem}[data-chat-widget] .w-60{width:15rem}[data-chat-widget] .w-9{width:2.25rem}[data-chat-widget] .w-auto{width:auto}[data-chat-widget] .w-fit{width:-moz-fit-content;width:fit-content}[data-chat-widget] .w-full{width:100%}[data-chat-widget] .min-w-56{min-width:14rem}[data-chat-widget] .min-w-\\[8rem\\]{min-width:8rem}[data-chat-widget] .max-w-\\[320px\\]{max-width:320px}[data-chat-widget] .max-w-full{max-width:100%}[data-chat-widget] .max-w-xs{max-width:20rem}[data-chat-widget] .flex-1{flex:1 1 0%}[data-chat-widget] .shrink-0{flex-shrink:0}[data-chat-widget] .translate-x-\\[var\\(--opencx-wobble-x\\)\\]{--tw-translate-x: var(--opencx-wobble-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-chat-widget] .translate-y-\\[var\\(--opencx-wobble-y\\)\\]{--tw-translate-y: var(--opencx-wobble-y);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-chat-widget] .scale-\\[1\\.01\\]{--tw-scale-x: 1.01;--tw-scale-y: 1.01;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-chat-widget] .scale-\\[1\\.02\\]{--tw-scale-x: 1.02;--tw-scale-y: 1.02;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-chat-widget] .scale-\\[1\\.1\\]{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-chat-widget] .scale-\\[1\\]{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}[data-chat-widget] .animate-bounce{animation:bounce 1s infinite}@keyframes pulse{50%{opacity:.5}}[data-chat-widget] .animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}[data-chat-widget] .animate-spin{animation:spin 1s linear infinite}[data-chat-widget] .cursor-default{cursor:default}[data-chat-widget] .cursor-not-allowed{cursor:not-allowed}[data-chat-widget] .cursor-pointer{cursor:pointer}[data-chat-widget] .select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}[data-chat-widget] .resize-none{resize:none}[data-chat-widget] .flex-row{flex-direction:row}[data-chat-widget] .flex-col{flex-direction:column}[data-chat-widget] .flex-wrap{flex-wrap:wrap}[data-chat-widget] .items-start{align-items:flex-start}[data-chat-widget] .items-end{align-items:flex-end}[data-chat-widget] .items-center{align-items:center}[data-chat-widget] .justify-start{justify-content:flex-start}[data-chat-widget] .justify-end{justify-content:flex-end}[data-chat-widget] .justify-center{justify-content:center}[data-chat-widget] .justify-between{justify-content:space-between}[data-chat-widget] .gap-0\\.5{gap:.125rem}[data-chat-widget] .gap-1{gap:.25rem}[data-chat-widget] .gap-2{gap:.5rem}[data-chat-widget] .space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}[data-chat-widget] .space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}[data-chat-widget] .space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}[data-chat-widget] .self-end{align-self:flex-end}[data-chat-widget] .overflow-auto{overflow:auto}[data-chat-widget] .overflow-hidden{overflow:hidden}[data-chat-widget] .overflow-scroll{overflow:scroll}[data-chat-widget] .scroll-smooth{scroll-behavior:smooth}[data-chat-widget] .text-ellipsis{text-overflow:ellipsis}[data-chat-widget] .whitespace-normal{white-space:normal}[data-chat-widget] .whitespace-nowrap{white-space:nowrap}[data-chat-widget] .rounded-2xl{border-radius:1rem}[data-chat-widget] .rounded-3xl{border-radius:1.5rem}[data-chat-widget] .rounded-full{border-radius:9999px}[data-chat-widget] .rounded-lg{border-radius:.5rem}[data-chat-widget] .rounded-md{border-radius:.375rem}[data-chat-widget] .rounded-sm{border-radius:.125rem}[data-chat-widget] .rounded-xl{border-radius:.75rem}[data-chat-widget] .rounded-t-3xl{border-top-left-radius:1.5rem;border-top-right-radius:1.5rem}[data-chat-widget] .border{border-width:1px}[data-chat-widget] .border-2{border-width:2px}[data-chat-widget] .border-b{border-bottom-width:1px}[data-chat-widget] .border-destructive{border-color:hsl(var(--opencx-destructive))}[data-chat-widget] .border-input{border-color:hsl(var(--opencx-input))}[data-chat-widget] .border-primary{border-color:hsl(var(--opencx-primary))}[data-chat-widget] .border-transparent{border-color:transparent}[data-chat-widget] .bg-background{background-color:hsl(var(--opencx-background))}[data-chat-widget] .bg-black\\/50{background-color:#00000080}[data-chat-widget] .bg-destructive{background-color:hsl(var(--opencx-destructive))}[data-chat-widget] .bg-muted{background-color:hsl(var(--opencx-muted))}[data-chat-widget] .bg-primary{background-color:hsl(var(--opencx-primary))}[data-chat-widget] .bg-secondary{background-color:hsl(var(--opencx-secondary))}[data-chat-widget] .bg-transparent{background-color:transparent}[data-chat-widget] .bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}[data-chat-widget] .from-primary\\/50{--tw-gradient-from: hsl(var(--opencx-primary) / .5) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--opencx-primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}[data-chat-widget] .via-primary{--tw-gradient-to: hsl(var(--opencx-primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), hsl(var(--opencx-primary)) var(--tw-gradient-via-position), var(--tw-gradient-to)}[data-chat-widget] .to-primary{--tw-gradient-to: hsl(var(--opencx-primary)) var(--tw-gradient-to-position)}[data-chat-widget] .fill-current{fill:currentColor}[data-chat-widget] .object-contain{-o-object-fit:contain;object-fit:contain}[data-chat-widget] .object-cover{-o-object-fit:cover;object-fit:cover}[data-chat-widget] .p-0{padding:0}[data-chat-widget] .p-1{padding:.25rem}[data-chat-widget] .p-2{padding:.5rem}[data-chat-widget] .p-2\\.5{padding:.625rem}[data-chat-widget] .p-4{padding:1rem}[data-chat-widget] .px-2{padding-left:.5rem;padding-right:.5rem}[data-chat-widget] .px-3{padding-left:.75rem;padding-right:.75rem}[data-chat-widget] .px-4{padding-left:1rem;padding-right:1rem}[data-chat-widget] .py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}[data-chat-widget] .py-12{padding-top:3rem;padding-bottom:3rem}[data-chat-widget] .py-2{padding-top:.5rem;padding-bottom:.5rem}[data-chat-widget] .pl-2{padding-left:.5rem}[data-chat-widget] .pl-3{padding-left:.75rem}[data-chat-widget] .pl-8{padding-left:2rem}[data-chat-widget] .pr-2{padding-right:.5rem}[data-chat-widget] .text-center{text-align:center}[data-chat-widget] .text-start{text-align:start}[data-chat-widget] .align-middle{vertical-align:middle}[data-chat-widget] .font-inter{font-family:Inter,Rubik,serif,sans-serif}[data-chat-widget] .text-2xl{font-size:1.5rem;line-height:2rem}[data-chat-widget] .text-\\[10px\\]{font-size:10px}[data-chat-widget] .text-sm{font-size:.875rem;line-height:1.25rem}[data-chat-widget] .text-xl{font-size:1.25rem;line-height:1.75rem}[data-chat-widget] .text-xs{font-size:.75rem;line-height:1rem}[data-chat-widget] .font-bold{font-weight:700}[data-chat-widget] .font-medium{font-weight:500}[data-chat-widget] .font-semibold{font-weight:600}[data-chat-widget] .leading-relaxed{line-height:1.625}[data-chat-widget] .leading-snug{line-height:1.375}[data-chat-widget] .leading-tight{line-height:1.25}[data-chat-widget] .tracking-widest{letter-spacing:.1em}[data-chat-widget] .text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}[data-chat-widget] .text-destructive{color:hsl(var(--opencx-destructive))}[data-chat-widget] .text-destructive-foreground{color:hsl(var(--opencx-destructive-foreground))}[data-chat-widget] .text-emerald-500{--tw-text-opacity: 1;color:rgb(16 185 129 / var(--tw-text-opacity))}[data-chat-widget] .text-foreground{color:hsl(var(--opencx-foreground))}[data-chat-widget] .text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}[data-chat-widget] .text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity))}[data-chat-widget] .text-muted{color:hsl(var(--opencx-muted))}[data-chat-widget] .text-muted-foreground{color:hsl(var(--opencx-muted-foreground))}[data-chat-widget] .text-primary{color:hsl(var(--opencx-primary))}[data-chat-widget] .text-primary-foreground{color:hsl(var(--opencx-primary-foreground))}[data-chat-widget] .text-primary-foreground\\/90{color:hsl(var(--opencx-primary-foreground) / .9)}[data-chat-widget] .text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}[data-chat-widget] .text-rose-500{--tw-text-opacity: 1;color:rgb(244 63 94 / var(--tw-text-opacity))}[data-chat-widget] .text-secondary-foreground{color:hsl(var(--opencx-secondary-foreground))}[data-chat-widget] .underline{text-decoration-line:underline}[data-chat-widget] .underline-offset-4{text-underline-offset:4px}[data-chat-widget] .antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}[data-chat-widget] .opacity-0{opacity:0}[data-chat-widget] .opacity-50{opacity:.5}[data-chat-widget] .opacity-60{opacity:.6}[data-chat-widget] .shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-chat-widget] .shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-chat-widget] .shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-chat-widget] .shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-chat-widget] .shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-chat-widget] .shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-chat-widget] .shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-chat-widget] .outline-none{outline:2px solid transparent;outline-offset:2px}[data-chat-widget] .outline{outline-style:solid}[data-chat-widget] .ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}[data-chat-widget] .ring-offset-background{--tw-ring-offset-color: hsl(var(--opencx-background))}[data-chat-widget] .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}[data-chat-widget] .transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[data-chat-widget] .transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[data-chat-widget] .transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[data-chat-widget] .transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[data-chat-widget] .ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}[data-chat-widget] .animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}[data-chat-widget] .fade-in-0{--tw-enter-opacity: 0}[data-chat-widget] .zoom-in-95{--tw-enter-scale: .95}[data-chat-widget] .ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}[data-chat-widget] .\\[animation-delay\\:-0\\.15s\\]{animation-delay:-.15s}[data-chat-widget] .\\[animation-delay\\:-0\\.3s\\]{animation-delay:-.3s}[data-chat-widget] .\\[background\\:radial-gradient\\(50\\%_50\\%_at_50\\%_100\\%\\,hsl\\(var\\(--opencx-primary-foreground\\)\\)_-75\\%\\,hsl\\(var\\(--opencx-primary\\)\\)_100\\%\\)\\]{background:radial-gradient(50% 50% at 50% 100%,hsl(var(--opencx-primary-foreground)) -75%,hsl(var(--opencx-primary)))}[data-chat-widget] .required:after{content:" *";color:red}[data-chat-widget] .file\\:border-0::file-selector-button{border-width:0px}[data-chat-widget] .file\\:bg-transparent::file-selector-button{background-color:transparent}[data-chat-widget] .file\\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}[data-chat-widget] .file\\:font-medium::file-selector-button{font-weight:500}[data-chat-widget] .file\\:text-primary-foreground::file-selector-button{color:hsl(var(--opencx-primary-foreground))}[data-chat-widget] .placeholder\\:text-muted-foreground::-moz-placeholder{color:hsl(var(--opencx-muted-foreground))}[data-chat-widget] .placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--opencx-muted-foreground))}[data-chat-widget] .hover\\:bg-accent:hover{background-color:hsl(var(--opencx-accent))}[data-chat-widget] .hover\\:bg-green-50\\/50:hover{background-color:#f0fdf480}[data-chat-widget] .hover\\:bg-red-50\\/50:hover{background-color:#fef2f280}[data-chat-widget] .hover\\:text-accent-foreground:hover{color:hsl(var(--opencx-accent-foreground))}[data-chat-widget] .hover\\:text-blue-600:hover{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity))}[data-chat-widget] .hover\\:text-green-500:hover{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity))}[data-chat-widget] .hover\\:text-primary:hover{color:hsl(var(--opencx-primary))}[data-chat-widget] .hover\\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}[data-chat-widget] .hover\\:underline:hover{text-decoration-line:underline}[data-chat-widget] .focus\\:bg-accent:focus{background-color:hsl(var(--opencx-accent))}[data-chat-widget] .focus\\:text-accent-foreground:focus{color:hsl(var(--opencx-accent-foreground))}[data-chat-widget] .focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}[data-chat-widget] .focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}[data-chat-widget] .focus-visible\\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--opencx-ring))}[data-chat-widget] .focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}[data-chat-widget] .focus-visible\\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--opencx-background))}[data-chat-widget] .active\\:scale-90:active{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-chat-widget] .active\\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-chat-widget] .active\\:shadow-none:active{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-chat-widget] .hover\\:active\\:scale-95:active:hover{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-chat-widget] .disabled\\:pointer-events-none:disabled{pointer-events:none}[data-chat-widget] .disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}[data-chat-widget] .disabled\\:opacity-0:disabled{opacity:0}[data-chat-widget] .disabled\\:opacity-50:disabled{opacity:.5}[data-chat-widget] .group:hover .group-hover\\:opacity-100{opacity:1}[data-chat-widget] .group:hover .group-hover\\:active\\:scale-90:active,[data-chat-widget] .group:active .group-active\\:scale-90{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-chat-widget] .data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}[data-chat-widget] .data-\\[state\\=checked\\]\\:translate-x-4[data-state=checked]{--tw-translate-x: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-chat-widget] .data-\\[state\\=unchecked\\]\\:translate-x-0[data-state=unchecked]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-chat-widget] .data-\\[state\\=checked\\]\\:bg-primary[data-state=checked]{background-color:hsl(var(--opencx-primary))}[data-chat-widget] .data-\\[state\\=open\\]\\:bg-accent[data-state=open]{background-color:hsl(var(--opencx-accent))}[data-chat-widget] .data-\\[state\\=unchecked\\]\\:bg-input[data-state=unchecked]{background-color:hsl(var(--opencx-input))}[data-chat-widget] .data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}[data-chat-widget] .data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}[data-chat-widget] .data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}[data-chat-widget] .data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}[data-chat-widget] .data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}[data-chat-widget] .data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}[data-chat-widget] .data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}[data-chat-widget] .data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}[data-chat-widget] .data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}[data-chat-widget] .data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}[data-chat-widget] .data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}[data-chat-widget] .prose-a\\:underline :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){text-decoration-line:underline}[data-chat-widget] .prose-a\\:decoration-primary :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){text-decoration-color:hsl(var(--opencx-primary))}[data-chat-widget] .rtl\\:-scale-100:where([dir=rtl],[dir=rtl] *){--tw-scale-x: -1;--tw-scale-y: -1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-chat-widget] .rtl\\:flex-row-reverse:where([dir=rtl],[dir=rtl] *){flex-direction:row-reverse}[data-chat-widget] .rtl\\:text-right:where([dir=rtl],[dir=rtl] *){text-align:right}[data-chat-widget] .rtl\\:placeholder\\:text-right:where([dir=rtl],[dir=rtl] *)::-moz-placeholder{text-align:right}[data-chat-widget] .rtl\\:placeholder\\:text-right:where([dir=rtl],[dir=rtl] *)::placeholder{text-align:right}[data-chat-widget] .\\[\\&_span\\]\\:size-1 span{width:.25rem;height:.25rem}[data-chat-widget] .\\[\\&_span\\]\\:bg-secondary-foreground span{background-color:hsl(var(--opencx-secondary-foreground))}[data-chat-widget] .\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}[data-chat-widget] .\\[\\&_svg\\]\\:size-4 svg{width:1rem;height:1rem}[data-chat-widget] .\\[\\&_svg\\]\\:size-6 svg{width:1.5rem;height:1.5rem}[data-chat-widget] .\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}';function Oq({className:e}){return E.jsx("svg",{width:"26",height:"32",viewBox:"0 0 26 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:Le("text-primary-foreground",e),children:E.jsx("path",{d:"M1.34103 25.6132H5.44245C5.74203 25.6228 6.02673 25.7462 6.23867 25.9582C6.45062 26.1703 6.5739 26.4551 6.58348 26.7548V30.8584C6.59305 31.1581 6.71634 31.443 6.92828 31.655C7.14023 31.8671 7.42492 31.9904 7.7245 32H18.2894C18.589 31.9904 18.8737 31.8671 19.0856 31.655C19.2976 31.443 19.4209 31.1581 19.4304 30.8584V26.7548C19.4401 26.4545 19.5638 26.1692 19.7765 25.957C19.9892 25.7449 20.2748 25.6219 20.5749 25.6132H24.659C24.9586 25.6036 25.2433 25.4803 25.4552 25.2682C25.6671 25.0562 25.7904 24.7713 25.8 24.4716V7.52839C25.7904 7.22865 25.6671 6.94381 25.4552 6.73176C25.2433 6.5197 24.9586 6.39635 24.659 6.38677H20.561C20.2603 6.37802 19.9742 6.25457 19.7614 6.04169C19.5487 5.82881 19.4253 5.54261 19.4165 5.24168V1.14161C19.4072 0.84419 19.2858 0.561291 19.0768 0.349589C18.8678 0.137887 18.5865 0.0130193 18.2894 0L7.7245 0C7.42492 0.00957792 7.14023 0.132929 6.92828 0.344983C6.71634 0.557036 6.59305 0.841878 6.58348 1.14161V5.24168C6.57477 5.54203 6.45187 5.82773 6.23983 6.04052C6.0278 6.25331 5.74262 6.37715 5.44245 6.38677H1.34103C1.04144 6.39635 0.756749 6.5197 0.544805 6.73176C0.332861 6.94381 0.209574 7.22865 0.200001 7.52839V24.4716C0.209574 24.7713 0.332861 25.0562 0.544805 25.2682C0.756749 25.4803 1.04144 25.6036 1.34103 25.6132ZM6.58348 24.4716V7.52839C6.59305 7.22865 6.71634 6.94381 6.92828 6.73176C7.14023 6.5197 7.42492 6.39635 7.7245 6.38677H18.2894C18.589 6.39635 18.8737 6.5197 19.0856 6.73176C19.2976 6.94381 19.4209 7.22865 19.4304 7.52839V24.4716C19.4209 24.7713 19.2976 25.0562 19.0856 25.2682C18.8737 25.4803 18.589 25.6036 18.2894 25.6132H7.7245C7.42492 25.6036 7.14023 25.4803 6.92828 25.2682C6.71634 25.0562 6.59305 24.7713 6.58348 24.4716Z",fill:"currentColor"})})}function Dq({isOpen:e}){const{theme:t}=dl();return E.jsx(kR,{"data-testid":"widget-popover-trigger","data-chat-widget":!0,style:{fontSize:"16px",position:"fixed",zIndex:1e7,...AE({primary:t==null?void 0:t.primaryColor}),right:"20px",bottom:"20px"},className:Le("size-12 font-inter flex items-center justify-center"),children:E.jsx(ep,{children:E.jsx("div",{className:Le("relative size-full rounded-full","flex items-center justify-center","transition-all","[background:radial-gradient(50%_50%_at_50%_100%,hsl(var(--opencx-primary-foreground))_-75%,hsl(var(--opencx-primary))_100%)]","text-primary-foreground","shadow-xl","active:scale-90","[&_svg]:size-6"),children:E.jsx(Ja,{mode:"wait",children:e?E.jsx(fn,{snapExit:!0,fadeIn:"up",overrides:{initial:{rotate:45},animate:{rotate:0}},children:E.jsx(A_,{})},"x-icon"):E.jsx(fn,{snapExit:!0,overrides:{initial:{rotate:45},animate:{rotate:0}},children:E.jsx(Oq,{})},"message-icon")})})})})}function Lq(){return E.jsx(Ja,{children:E.jsxs(fn,{"data-test":"loading-container",className:"flex flex-row items-end w-full gap-1 animate-pulse",children:[E.jsx("div",{className:"flex items-center gap-1","data-test":"avatar-container",children:E.jsx(vp,{"data-test":"loading-avatar",children:E.jsx(q3,{"data-test":"avatar-fallback"})})}),E.jsxs("div",{className:"flex items-center [&_span]:bg-secondary-foreground [&_span]:size-1 gap-1 p-2 rounded-xl bg-secondary border","data-test":"loading-dots-container",children:[E.jsx(us.span,{"data-test":"loading-dot-1",className:"rounded-full animate-bounce [animation-delay:-0.3s]"}),E.jsx(us.span,{"data-test":"loading-dot-2",className:"rounded-full animate-bounce [animation-delay:-0.15s]"}),E.jsx(us.span,{"data-test":"loading-dot-3",className:"rounded-full animate-bounce"})]})]})})}function Mq(e){return E.jsx("div",{className:"w-full max-w-full overflow-auto shrink-0","data-test":"fallback-container",children:E.jsx("pre",{dir:"auto",className:"text-xs leading-tight","data-test":"fallback-content",children:JSON.stringify(e,null,1)})})}function FR(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function iae(){}function aae(){}const hn=Ea(/[A-Za-z]/),rn=Ea(/[\dA-Za-z]/),Fq=Ea(/[#-'*+\--9=?A-Z^-~]/);function Ip(e){return e!==null&&(e<32||e===127)}const z1=Ea(/\d/),Bq=Ea(/[\dA-Fa-f]/),jq=Ea(/[!-/:-@[-`{-~]/);function me(e){return e!==null&&e<-2}function Je(e){return e!==null&&(e<0||e===32)}function De(e){return e===-2||e===-1||e===32}const Op=Ea(new RegExp("\\p{P}|\\p{S}","u")),co=Ea(/\s/);function Ea(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Uq(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const Dp=function(e){if(e==null)return $q;if(typeof e=="function")return Lp(e);if(typeof e=="object")return Array.isArray(e)?Hq(e):zq(e);if(typeof e=="string")return Vq(e);throw new Error("Expected function, string, or object as test")};function Hq(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Dp(e[n]);return Lp(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function zq(e){const t=e;return Lp(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function Vq(e){return Lp(t);function t(n){return n&&n.type===e}}function Lp(e){return t;function t(n,r,i){return!!(Wq(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function $q(){return!0}function Wq(e){return e!==null&&typeof e=="object"&&"type"in e}function oae(e){return e}const BR=[],Yq=!0,V1=!1,qq="skip";function jR(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=Dp(i),o=r?-1:1;s(e,void 0,[])();function s(u,l,c){const d=u&&typeof u=="object"?u:{};if(typeof d.type=="string"){const p=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(u.type+(p?"<"+p+">":""))+")"})}return f;function f(){let p=BR,m,g,x;if((!t||a(u,l,c[c.length-1]||void 0))&&(p=Gq(n(u,c)),p[0]===V1))return p;if("children"in u&&u.children){const y=u;if(y.children&&p[0]!==qq)for(g=(r?y.children.length:-1)+o,x=c.concat(y);g>-1&&g<y.children.length;){const w=y.children[g];if(m=s(w,g,x)(),m[0]===V1)return m;g=typeof m[1]=="number"?m[1]:g+o}}return p}}}function Gq(e){return Array.isArray(e)?e:typeof e=="number"?[Yq,e]:e==null?BR:[e]}function Kq(e,t,n){const i=Dp((n||{}).ignore||[]),a=Xq(t);let o=-1;for(;++o<a.length;)jR(e,"text",s);function s(l,c){let d=-1,f;for(;++d<c.length;){const p=c[d],m=f?f.children:void 0;if(i(p,m?m.indexOf(p):void 0,f))return;f=p}if(f)return u(l,c)}function u(l,c){const d=c[c.length-1],f=a[o][0],p=a[o][1];let m=0;const x=d.children.indexOf(l);let y=!1,w=[];f.lastIndex=0;let b=f.exec(l.value);for(;b;){const T=b.index,S={index:b.index,input:b.input,stack:[...c,l]};let _=p(...b,S);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?f.lastIndex=T+1:(m!==T&&w.push({type:"text",value:l.value.slice(m,T)}),Array.isArray(_)?w.push(..._):_&&w.push(_),m=T+b[0].length,y=!0),!f.global)break;b=f.exec(l.value)}return y?(m<l.value.length&&w.push({type:"text",value:l.value.slice(m)}),d.children.splice(x,1,...w)):w=[l],x+w.length}}function Xq(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([Qq(i[0]),Zq(i[1])])}return t}function Qq(e){return typeof e=="string"?new RegExp(Uq(e),"g"):e}function Zq(e){return typeof e=="function"?e:function(){return e}}const $1="phrasing",W1=["autolink","link","image","label"];function Jq(){return{transforms:[oG],enter:{literalAutolink:tG,literalAutolinkEmail:Y1,literalAutolinkHttp:Y1,literalAutolinkWww:Y1},exit:{literalAutolink:aG,literalAutolinkEmail:iG,literalAutolinkHttp:nG,literalAutolinkWww:rG}}}function eG(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:$1,notInConstruct:W1},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:$1,notInConstruct:W1},{character:":",before:"[ps]",after:"\\/",inConstruct:$1,notInConstruct:W1}]}}function tG(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Y1(e){this.config.enter.autolinkProtocol.call(this,e)}function nG(e){this.config.exit.autolinkProtocol.call(this,e)}function rG(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function iG(e){this.config.exit.autolinkEmail.call(this,e)}function aG(e){this.exit(e)}function oG(e){Kq(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,sG],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),uG]],{ignore:["link","linkReference"]})}function sG(e,t,n,r,i){let a="";if(!UR(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!lG(n)))return!1;const o=cG(n+r);if(!o[0])return!1;const s={type:"link",title:null,url:a+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[s,{type:"text",value:o[1]}]:s}function uG(e,t,n,r){return!UR(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function lG(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function cG(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=FR(e,"(");let a=FR(e,")");for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function UR(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||co(n)||Op(n))&&(!t||n!==47)}function Nr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}HR.peek=xG;function dG(){return{enter:{gfmFootnoteDefinition:pG,gfmFootnoteDefinitionLabelString:hG,gfmFootnoteCall:yG,gfmFootnoteCallString:vG},exit:{gfmFootnoteDefinition:gG,gfmFootnoteDefinitionLabelString:mG,gfmFootnoteCall:bG,gfmFootnoteCallString:wG}}}function fG(){return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:EG,footnoteReference:HR}}}function pG(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function hG(){this.buffer()}function mG(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=Nr(this.sliceSerialize(e)).toLowerCase()}function gG(e){this.exit(e)}function yG(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function vG(){this.buffer()}function wG(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=Nr(this.sliceSerialize(e)).toLowerCase()}function bG(e){this.exit(e)}function HR(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const o=n.enter("footnoteReference"),s=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{...i.current(),before:a,after:"]"})),s(),o(),a+=i.move("]"),a}function xG(){return"["}function EG(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const o=n.enter("footnoteDefinition"),s=n.enter("label");return a+=i.move(n.safe(n.associationId(e),{...i.current(),before:a,after:"]"})),s(),a+=i.move("]:"+(e.children&&e.children.length>0?" ":"")),i.shift(4),a+=i.move(n.indentLines(n.containerFlow(e,i.current()),TG)),o(),a}function TG(e,t,n){return t===0?e:(n?"":" ")+e}const _G=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];zR.peek=RG;function SG(){return{canContainEols:["delete"],enter:{strikethrough:AG},exit:{strikethrough:kG}}}function CG(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:_G}],handlers:{delete:zR}}}function AG(e){this.enter({type:"delete",children:[]},e)}function kG(e){this.exit(e)}function zR(e,t,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),a(),o}function RG(){return"~"}function NG(e,t={}){const n=(t.align||[]).concat(),r=t.stringLength||IG,i=[],a=[],o=[],s=[];let u=0,l=-1;for(;++l<e.length;){const m=[],g=[];let x=-1;for(e[l].length>u&&(u=e[l].length);++x<e[l].length;){const y=PG(e[l][x]);if(t.alignDelimiters!==!1){const w=r(y);g[x]=w,(s[x]===void 0||w>s[x])&&(s[x]=w)}m.push(y)}a[l]=m,o[l]=g}let c=-1;if(typeof n=="object"&&"length"in n)for(;++c<u;)i[c]=VR(n[c]);else{const m=VR(n);for(;++c<u;)i[c]=m}c=-1;const d=[],f=[];for(;++c<u;){const m=i[c];let g="",x="";m===99?(g=":",x=":"):m===108?g=":":m===114&&(x=":");let y=t.alignDelimiters===!1?1:Math.max(1,s[c]-g.length-x.length);const w=g+"-".repeat(y)+x;t.alignDelimiters!==!1&&(y=g.length+y+x.length,y>s[c]&&(s[c]=y),f[c]=y),d[c]=w}a.splice(1,0,d),o.splice(1,0,f),l=-1;const p=[];for(;++l<a.length;){const m=a[l],g=o[l];c=-1;const x=[];for(;++c<u;){const y=m[c]||"";let w="",b="";if(t.alignDelimiters!==!1){const T=s[c]-(g[c]||0),S=i[c];S===114?w=" ".repeat(T):S===99?T%2?(w=" ".repeat(T/2+.5),b=" ".repeat(T/2-.5)):(w=" ".repeat(T/2),b=w):b=" ".repeat(T)}t.delimiterStart!==!1&&!c&&x.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&y==="")&&(t.delimiterStart!==!1||c)&&x.push(" "),t.alignDelimiters!==!1&&x.push(w),x.push(y),t.alignDelimiters!==!1&&x.push(b),t.padding!==!1&&x.push(" "),(t.delimiterEnd!==!1||c!==u-1)&&x.push("|")}p.push(t.delimiterEnd===!1?x.join("").replace(/ +$/,""):x.join(""))}return p.join(`
422
422
  `)}function PG(e){return e==null?"":String(e)}function IG(e){return e.length}function VR(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}const $R={}.hasOwnProperty;function WR(e,t){const n=t||{};function r(i,...a){let o=r.invalid;const s=r.handlers;if(i&&$R.call(i,e)){const u=String(i[e]);o=$R.call(s,u)?s[u]:r.unknown}if(o)return o.call(this,i,...a)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}function OG(e,t,n,r){const i=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const o=n.indentLines(n.containerFlow(e,a.current()),DG);return i(),o}function DG(e,t,n){return">"+(n?"":" ")+e}function LG(e,t){return YR(e,t.inConstruct,!0)&&!YR(e,t.notInConstruct,!1)}function YR(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function qR(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
423
423
  `&&LG(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
424
424
  `}function MG(e,t){const n=String(e);let r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function FG(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function BG(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function jG(e,t,n,r){const i=BG(n),a=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(FG(e,n)){const d=n.enter("codeIndented"),f=n.indentLines(a,UG);return d(),f}const s=n.createTracker(r),u=i.repeat(Math.max(MG(a,i)+1,3)),l=n.enter("codeFenced");let c=s.move(u);if(e.lang){const d=n.enter(`codeFencedLang${o}`);c+=s.move(n.safe(e.lang,{before:c,after:" ",encode:["`"],...s.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${o}`);c+=s.move(" "),c+=s.move(n.safe(e.meta,{before:c,after:`