@kite-copilot/chat-panel 0.2.26 → 0.2.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auto.cjs +77 -64
- package/dist/auto.d.cts +1 -1
- package/dist/auto.d.ts +1 -1
- package/dist/auto.js +1 -1
- package/dist/{chunk-KPTM44LS.js → chunk-LYZAMTWZ.js} +77 -64
- package/dist/{createKiteChat-CGiuk776.d.cts → createKiteChat-CyoN-YV4.d.cts} +2 -10
- package/dist/{createKiteChat-CGiuk776.d.ts → createKiteChat-CyoN-YV4.d.ts} +2 -10
- package/dist/embed.global.js +21 -63
- package/dist/index.cjs +77 -64
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/embed.global.js
CHANGED
|
@@ -1,84 +1,42 @@
|
|
|
1
|
-
"use strict";var KiteChatEmbed=(()=>{var GI=Object.create;var gu=Object.defineProperty;var KI=Object.getOwnPropertyDescriptor;var XI=Object.getOwnPropertyNames;var JI=Object.getPrototypeOf,QI=Object.prototype.hasOwnProperty;var YI=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Zr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ZI=(e,t)=>{for(var r in t)gu(e,r,{get:t[r],enumerable:!0})},Cy=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of XI(t))!QI.call(e,o)&&o!==r&&gu(e,o,{get:()=>t[o],enumerable:!(a=KI(t,o))||a.enumerable});return e};var D=(e,t,r)=>(r=e!=null?GI(JI(e)):{},Cy(t||!e||!e.__esModule?gu(r,"default",{value:e,enumerable:!0}):r,e)),ek=e=>Cy(gu({},"__esModule",{value:!0}),e);var Ny=Zr(ne=>{"use strict";var xi=Symbol.for("react.element"),tk=Symbol.for("react.portal"),rk=Symbol.for("react.fragment"),ak=Symbol.for("react.strict_mode"),ok=Symbol.for("react.profiler"),nk=Symbol.for("react.provider"),sk=Symbol.for("react.context"),ik=Symbol.for("react.forward_ref"),lk=Symbol.for("react.suspense"),uk=Symbol.for("react.memo"),ck=Symbol.for("react.lazy"),by=Symbol.iterator;function dk(e){return e===null||typeof e!="object"?null:(e=by&&e[by]||e["@@iterator"],typeof e=="function"?e:null)}var ky={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Py=Object.assign,Ty={};function In(e,t,r){this.props=e,this.context=t,this.refs=Ty,this.updater=r||ky}In.prototype.isReactComponent={};In.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};In.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function _y(){}_y.prototype=In.prototype;function rp(e,t,r){this.props=e,this.context=t,this.refs=Ty,this.updater=r||ky}var ap=rp.prototype=new _y;ap.constructor=rp;Py(ap,In.prototype);ap.isPureReactComponent=!0;var Ly=Array.isArray,Ay=Object.prototype.hasOwnProperty,op={current:null},Ry={key:!0,ref:!0,__self:!0,__source:!0};function Ey(e,t,r){var a,o={},n=null,s=null;if(t!=null)for(a in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(n=""+t.key),t)Ay.call(t,a)&&!Ry.hasOwnProperty(a)&&(o[a]=t[a]);var i=arguments.length-2;if(i===1)o.children=r;else if(1<i){for(var l=Array(i),u=0;u<i;u++)l[u]=arguments[u+2];o.children=l}if(e&&e.defaultProps)for(a in i=e.defaultProps,i)o[a]===void 0&&(o[a]=i[a]);return{$$typeof:xi,type:e,key:n,ref:s,props:o,_owner:op.current}}function fk(e,t){return{$$typeof:xi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function np(e){return typeof e=="object"&&e!==null&&e.$$typeof===xi}function pk(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var Iy=/\/+/g;function tp(e,t){return typeof e=="object"&&e!==null&&e.key!=null?pk(""+e.key):t.toString(36)}function vu(e,t,r,a,o){var n=typeof e;(n==="undefined"||n==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(n){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case xi:case tk:s=!0}}if(s)return s=e,o=o(s),e=a===""?"."+tp(s,0):a,Ly(o)?(r="",e!=null&&(r=e.replace(Iy,"$&/")+"/"),vu(o,t,r,"",function(u){return u})):o!=null&&(np(o)&&(o=fk(o,r+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(Iy,"$&/")+"/")+e)),t.push(o)),1;if(s=0,a=a===""?".":a+":",Ly(e))for(var i=0;i<e.length;i++){n=e[i];var l=a+tp(n,i);s+=vu(n,t,r,l,o)}else if(l=dk(e),typeof l=="function")for(e=l.call(e),i=0;!(n=e.next()).done;)n=n.value,l=a+tp(n,i++),s+=vu(n,t,r,l,o);else if(n==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function yu(e,t,r){if(e==null)return e;var a=[],o=0;return vu(e,a,"","",function(n){return t.call(r,n,o++)}),a}function hk(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Lt={current:null},xu={transition:null},mk={ReactCurrentDispatcher:Lt,ReactCurrentBatchConfig:xu,ReactCurrentOwner:op};function Dy(){throw Error("act(...) is not supported in production builds of React.")}ne.Children={map:yu,forEach:function(e,t,r){yu(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return yu(e,function(){t++}),t},toArray:function(e){return yu(e,function(t){return t})||[]},only:function(e){if(!np(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ne.Component=In;ne.Fragment=rk;ne.Profiler=ok;ne.PureComponent=rp;ne.StrictMode=ak;ne.Suspense=lk;ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=mk;ne.act=Dy;ne.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var a=Py({},e.props),o=e.key,n=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(n=t.ref,s=op.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var i=e.type.defaultProps;for(l in t)Ay.call(t,l)&&!Ry.hasOwnProperty(l)&&(a[l]=t[l]===void 0&&i!==void 0?i[l]:t[l])}var l=arguments.length-2;if(l===1)a.children=r;else if(1<l){i=Array(l);for(var u=0;u<l;u++)i[u]=arguments[u+2];a.children=i}return{$$typeof:xi,type:e.type,key:o,ref:n,props:a,_owner:s}};ne.createContext=function(e){return e={$$typeof:sk,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:nk,_context:e},e.Consumer=e};ne.createElement=Ey;ne.createFactory=function(e){var t=Ey.bind(null,e);return t.type=e,t};ne.createRef=function(){return{current:null}};ne.forwardRef=function(e){return{$$typeof:ik,render:e}};ne.isValidElement=np;ne.lazy=function(e){return{$$typeof:ck,_payload:{_status:-1,_result:e},_init:hk}};ne.memo=function(e,t){return{$$typeof:uk,type:e,compare:t===void 0?null:t}};ne.startTransition=function(e){var t=xu.transition;xu.transition={};try{e()}finally{xu.transition=t}};ne.unstable_act=Dy;ne.useCallback=function(e,t){return Lt.current.useCallback(e,t)};ne.useContext=function(e){return Lt.current.useContext(e)};ne.useDebugValue=function(){};ne.useDeferredValue=function(e){return Lt.current.useDeferredValue(e)};ne.useEffect=function(e,t){return Lt.current.useEffect(e,t)};ne.useId=function(){return Lt.current.useId()};ne.useImperativeHandle=function(e,t,r){return Lt.current.useImperativeHandle(e,t,r)};ne.useInsertionEffect=function(e,t){return Lt.current.useInsertionEffect(e,t)};ne.useLayoutEffect=function(e,t){return Lt.current.useLayoutEffect(e,t)};ne.useMemo=function(e,t){return Lt.current.useMemo(e,t)};ne.useReducer=function(e,t,r){return Lt.current.useReducer(e,t,r)};ne.useRef=function(e){return Lt.current.useRef(e)};ne.useState=function(e){return Lt.current.useState(e)};ne.useSyncExternalStore=function(e,t,r){return Lt.current.useSyncExternalStore(e,t,r)};ne.useTransition=function(){return Lt.current.useTransition()};ne.version="18.3.1"});var Y=Zr((TD,My)=>{"use strict";My.exports=Ny()});var $y=Zr(xe=>{"use strict";function up(e,t){var r=e.length;e.push(t);e:for(;0<r;){var a=r-1>>>1,o=e[a];if(0<wu(o,t))e[a]=t,e[r]=o,r=a;else break e}}function yr(e){return e.length===0?null:e[0]}function Cu(e){if(e.length===0)return null;var t=e[0],r=e.pop();if(r!==t){e[0]=r;e:for(var a=0,o=e.length,n=o>>>1;a<n;){var s=2*(a+1)-1,i=e[s],l=s+1,u=e[l];if(0>wu(i,r))l<o&&0>wu(u,i)?(e[a]=u,e[l]=r,a=l):(e[a]=i,e[s]=r,a=s);else if(l<o&&0>wu(u,r))e[a]=u,e[l]=r,a=l;else break e}}return t}function wu(e,t){var r=e.sortIndex-t.sortIndex;return r!==0?r:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(Oy=performance,xe.unstable_now=function(){return Oy.now()}):(sp=Date,By=sp.now(),xe.unstable_now=function(){return sp.now()-By});var Oy,sp,By,Rr=[],Aa=[],gk=1,sr=null,gt=3,bu=!1,Po=!1,Si=!1,Vy=typeof setTimeout=="function"?setTimeout:null,jy=typeof clearTimeout=="function"?clearTimeout:null,Fy=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function cp(e){for(var t=yr(Aa);t!==null;){if(t.callback===null)Cu(Aa);else if(t.startTime<=e)Cu(Aa),t.sortIndex=t.expirationTime,up(Rr,t);else break;t=yr(Aa)}}function dp(e){if(Si=!1,cp(e),!Po)if(yr(Rr)!==null)Po=!0,pp(fp);else{var t=yr(Aa);t!==null&&hp(dp,t.startTime-e)}}function fp(e,t){Po=!1,Si&&(Si=!1,jy(Ci),Ci=-1),bu=!0;var r=gt;try{for(cp(t),sr=yr(Rr);sr!==null&&(!(sr.expirationTime>t)||e&&!zy());){var a=sr.callback;if(typeof a=="function"){sr.callback=null,gt=sr.priorityLevel;var o=a(sr.expirationTime<=t);t=xe.unstable_now(),typeof o=="function"?sr.callback=o:sr===yr(Rr)&&Cu(Rr),cp(t)}else Cu(Rr);sr=yr(Rr)}if(sr!==null)var n=!0;else{var s=yr(Aa);s!==null&&hp(dp,s.startTime-t),n=!1}return n}finally{sr=null,gt=r,bu=!1}}var Lu=!1,Su=null,Ci=-1,qy=5,Hy=-1;function zy(){return!(xe.unstable_now()-Hy<qy)}function ip(){if(Su!==null){var e=xe.unstable_now();Hy=e;var t=!0;try{t=Su(!0,e)}finally{t?wi():(Lu=!1,Su=null)}}else Lu=!1}var wi;typeof Fy=="function"?wi=function(){Fy(ip)}:typeof MessageChannel<"u"?(lp=new MessageChannel,Uy=lp.port2,lp.port1.onmessage=ip,wi=function(){Uy.postMessage(null)}):wi=function(){Vy(ip,0)};var lp,Uy;function pp(e){Su=e,Lu||(Lu=!0,wi())}function hp(e,t){Ci=Vy(function(){e(xe.unstable_now())},t)}xe.unstable_IdlePriority=5;xe.unstable_ImmediatePriority=1;xe.unstable_LowPriority=4;xe.unstable_NormalPriority=3;xe.unstable_Profiling=null;xe.unstable_UserBlockingPriority=2;xe.unstable_cancelCallback=function(e){e.callback=null};xe.unstable_continueExecution=function(){Po||bu||(Po=!0,pp(fp))};xe.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):qy=0<e?Math.floor(1e3/e):5};xe.unstable_getCurrentPriorityLevel=function(){return gt};xe.unstable_getFirstCallbackNode=function(){return yr(Rr)};xe.unstable_next=function(e){switch(gt){case 1:case 2:case 3:var t=3;break;default:t=gt}var r=gt;gt=t;try{return e()}finally{gt=r}};xe.unstable_pauseExecution=function(){};xe.unstable_requestPaint=function(){};xe.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=gt;gt=e;try{return t()}finally{gt=r}};xe.unstable_scheduleCallback=function(e,t,r){var a=xe.unstable_now();switch(typeof r=="object"&&r!==null?(r=r.delay,r=typeof r=="number"&&0<r?a+r:a):r=a,e){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return o=r+o,e={id:gk++,callback:t,priorityLevel:e,startTime:r,expirationTime:o,sortIndex:-1},r>a?(e.sortIndex=r,up(Aa,e),yr(Rr)===null&&e===yr(Aa)&&(Si?(jy(Ci),Ci=-1):Si=!0,hp(dp,r-a))):(e.sortIndex=o,up(Rr,e),Po||bu||(Po=!0,pp(fp))),e};xe.unstable_shouldYield=zy;xe.unstable_wrapCallback=function(e){var t=gt;return function(){var r=gt;gt=t;try{return e.apply(this,arguments)}finally{gt=r}}}});var Gy=Zr((AD,Wy)=>{"use strict";Wy.exports=$y()});var Q0=Zr(Kt=>{"use strict";var yk=Y(),Wt=Gy();function R(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var ex=new Set,zi={};function Vo(e,t){Wn(e,t),Wn(e+"Capture",t)}function Wn(e,t){for(zi[e]=t,e=0;e<t.length;e++)ex.add(t[e])}var na=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bp=Object.prototype.hasOwnProperty,vk=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Ky={},Xy={};function xk(e){return Bp.call(Xy,e)?!0:Bp.call(Ky,e)?!1:vk.test(e)?Xy[e]=!0:(Ky[e]=!0,!1)}function wk(e,t,r,a){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return a?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Sk(e,t,r,a){if(t===null||typeof t>"u"||wk(e,t,r,a))return!0;if(a)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Pt(e,t,r,a,o,n,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=a,this.attributeNamespace=o,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=n,this.removeEmptyString=s}var it={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){it[e]=new Pt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];it[t]=new Pt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){it[e]=new Pt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){it[e]=new Pt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){it[e]=new Pt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){it[e]=new Pt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){it[e]=new Pt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){it[e]=new Pt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){it[e]=new Pt(e,5,!1,e.toLowerCase(),null,!1,!1)});var _h=/[\-:]([a-z])/g;function Ah(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(_h,Ah);it[t]=new Pt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(_h,Ah);it[t]=new Pt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(_h,Ah);it[t]=new Pt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){it[e]=new Pt(e,1,!1,e.toLowerCase(),null,!1,!1)});it.xlinkHref=new Pt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){it[e]=new Pt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Rh(e,t,r,a){var o=it.hasOwnProperty(t)?it[t]:null;(o!==null?o.type!==0:a||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Sk(t,r,o,a)&&(r=null),a||o===null?xk(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):o.mustUseProperty?e[o.propertyName]=r===null?o.type===3?!1:"":r:(t=o.attributeName,a=o.attributeNamespace,r===null?e.removeAttribute(t):(o=o.type,r=o===3||o===4&&r===!0?"":""+r,a?e.setAttributeNS(a,t,r):e.setAttribute(t,r))))}var ua=yk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Iu=Symbol.for("react.element"),Tn=Symbol.for("react.portal"),_n=Symbol.for("react.fragment"),Eh=Symbol.for("react.strict_mode"),Fp=Symbol.for("react.profiler"),tx=Symbol.for("react.provider"),rx=Symbol.for("react.context"),Dh=Symbol.for("react.forward_ref"),Up=Symbol.for("react.suspense"),Vp=Symbol.for("react.suspense_list"),Nh=Symbol.for("react.memo"),Ea=Symbol.for("react.lazy"),ax=Symbol.for("react.offscreen"),Jy=Symbol.iterator;function bi(e){return e===null||typeof e!="object"?null:(e=Jy&&e[Jy]||e["@@iterator"],typeof e=="function"?e:null)}var Ee=Object.assign,mp;function Ri(e){if(mp===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);mp=t&&t[1]||""}return`
|
|
2
|
-
`+
|
|
3
|
-
`),n=
|
|
1
|
+
"use strict";var KiteChatEmbed=(()=>{var kS=Object.create;var Ji=Object.defineProperty;var bS=Object.getOwnPropertyDescriptor;var PS=Object.getOwnPropertyNames;var TS=Object.getPrototypeOf,AS=Object.prototype.hasOwnProperty;var RS=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,a)=>(typeof require<"u"?require:t)[a]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Na=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),DS=(e,t)=>{for(var a in t)Ji(e,a,{get:t[a],enumerable:!0})},ih=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of PS(t))!AS.call(e,o)&&o!==a&&Ji(e,o,{get:()=>t[o],enumerable:!(r=bS(t,o))||r.enumerable});return e};var E=(e,t,a)=>(a=e!=null?kS(TS(e)):{},ih(t||!e||!e.__esModule?Ji(a,"default",{value:e,enumerable:!0}):a,e)),MS=e=>ih(Ji({},"__esModule",{value:!0}),e);var vh=Na(te=>{"use strict";var ys=Symbol.for("react.element"),NS=Symbol.for("react.portal"),ES=Symbol.for("react.fragment"),FS=Symbol.for("react.strict_mode"),BS=Symbol.for("react.profiler"),OS=Symbol.for("react.provider"),VS=Symbol.for("react.context"),US=Symbol.for("react.forward_ref"),_S=Symbol.for("react.suspense"),zS=Symbol.for("react.memo"),HS=Symbol.for("react.lazy"),lh=Symbol.iterator;function qS(e){return e===null||typeof e!="object"?null:(e=lh&&e[lh]||e["@@iterator"],typeof e=="function"?e:null)}var ch={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},fh=Object.assign,ph={};function Fo(e,t,a){this.props=e,this.context=t,this.refs=ph,this.updater=a||ch}Fo.prototype.isReactComponent={};Fo.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Fo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function mh(){}mh.prototype=Fo.prototype;function gc(e,t,a){this.props=e,this.context=t,this.refs=ph,this.updater=a||ch}var xc=gc.prototype=new mh;xc.constructor=gc;fh(xc,Fo.prototype);xc.isPureReactComponent=!0;var uh=Array.isArray,hh=Object.prototype.hasOwnProperty,yc={current:null},gh={key:!0,ref:!0,__self:!0,__source:!0};function xh(e,t,a){var r,o={},n=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(n=""+t.key),t)hh.call(t,r)&&!gh.hasOwnProperty(r)&&(o[r]=t[r]);var i=arguments.length-2;if(i===1)o.children=a;else if(1<i){for(var l=Array(i),u=0;u<i;u++)l[u]=arguments[u+2];o.children=l}if(e&&e.defaultProps)for(r in i=e.defaultProps,i)o[r]===void 0&&(o[r]=i[r]);return{$$typeof:ys,type:e,key:n,ref:s,props:o,_owner:yc.current}}function WS(e,t){return{$$typeof:ys,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function vc(e){return typeof e=="object"&&e!==null&&e.$$typeof===ys}function GS(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var dh=/\/+/g;function hc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?GS(""+e.key):t.toString(36)}function tl(e,t,a,r,o){var n=typeof e;(n==="undefined"||n==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(n){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case ys:case NS:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+hc(s,0):r,uh(o)?(a="",e!=null&&(a=e.replace(dh,"$&/")+"/"),tl(o,t,a,"",function(u){return u})):o!=null&&(vc(o)&&(o=WS(o,a+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(dh,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",uh(e))for(var i=0;i<e.length;i++){n=e[i];var l=r+hc(n,i);s+=tl(n,t,a,l,o)}else if(l=qS(e),typeof l=="function")for(e=l.call(e),i=0;!(n=e.next()).done;)n=n.value,l=r+hc(n,i++),s+=tl(n,t,a,l,o);else if(n==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function el(e,t,a){if(e==null)return e;var r=[],o=0;return tl(e,r,"","",function(n){return t.call(a,n,o++)}),r}function jS(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(a){(e._status===0||e._status===-1)&&(e._status=1,e._result=a)},function(a){(e._status===0||e._status===-1)&&(e._status=2,e._result=a)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var ct={current:null},al={transition:null},KS={ReactCurrentDispatcher:ct,ReactCurrentBatchConfig:al,ReactCurrentOwner:yc};function yh(){throw Error("act(...) is not supported in production builds of React.")}te.Children={map:el,forEach:function(e,t,a){el(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return el(e,function(){t++}),t},toArray:function(e){return el(e,function(t){return t})||[]},only:function(e){if(!vc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};te.Component=Fo;te.Fragment=ES;te.Profiler=BS;te.PureComponent=gc;te.StrictMode=FS;te.Suspense=_S;te.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=KS;te.act=yh;te.cloneElement=function(e,t,a){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=fh({},e.props),o=e.key,n=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(n=t.ref,s=yc.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var i=e.type.defaultProps;for(l in t)hh.call(t,l)&&!gh.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&i!==void 0?i[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=a;else if(1<l){i=Array(l);for(var u=0;u<l;u++)i[u]=arguments[u+2];r.children=i}return{$$typeof:ys,type:e.type,key:o,ref:n,props:r,_owner:s}};te.createContext=function(e){return e={$$typeof:VS,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:OS,_context:e},e.Consumer=e};te.createElement=xh;te.createFactory=function(e){var t=xh.bind(null,e);return t.type=e,t};te.createRef=function(){return{current:null}};te.forwardRef=function(e){return{$$typeof:US,render:e}};te.isValidElement=vc;te.lazy=function(e){return{$$typeof:HS,_payload:{_status:-1,_result:e},_init:jS}};te.memo=function(e,t){return{$$typeof:zS,type:e,compare:t===void 0?null:t}};te.startTransition=function(e){var t=al.transition;al.transition={};try{e()}finally{al.transition=t}};te.unstable_act=yh;te.useCallback=function(e,t){return ct.current.useCallback(e,t)};te.useContext=function(e){return ct.current.useContext(e)};te.useDebugValue=function(){};te.useDeferredValue=function(e){return ct.current.useDeferredValue(e)};te.useEffect=function(e,t){return ct.current.useEffect(e,t)};te.useId=function(){return ct.current.useId()};te.useImperativeHandle=function(e,t,a){return ct.current.useImperativeHandle(e,t,a)};te.useInsertionEffect=function(e,t){return ct.current.useInsertionEffect(e,t)};te.useLayoutEffect=function(e,t){return ct.current.useLayoutEffect(e,t)};te.useMemo=function(e,t){return ct.current.useMemo(e,t)};te.useReducer=function(e,t,a){return ct.current.useReducer(e,t,a)};te.useRef=function(e){return ct.current.useRef(e)};te.useState=function(e){return ct.current.useState(e)};te.useSyncExternalStore=function(e,t,a){return ct.current.useSyncExternalStore(e,t,a)};te.useTransition=function(){return ct.current.useTransition()};te.version="18.3.1"});var $=Na((TT,Lh)=>{"use strict";Lh.exports=vh()});var Rh=Na(he=>{"use strict";function Ic(e,t){var a=e.length;e.push(t);e:for(;0<a;){var r=a-1>>>1,o=e[r];if(0<rl(o,t))e[r]=t,e[a]=o,a=r;else break e}}function ea(e){return e.length===0?null:e[0]}function nl(e){if(e.length===0)return null;var t=e[0],a=e.pop();if(a!==t){e[0]=a;e:for(var r=0,o=e.length,n=o>>>1;r<n;){var s=2*(r+1)-1,i=e[s],l=s+1,u=e[l];if(0>rl(i,a))l<o&&0>rl(u,i)?(e[r]=u,e[l]=a,r=l):(e[r]=i,e[s]=a,r=s);else if(l<o&&0>rl(u,a))e[r]=u,e[l]=a,r=l;else break e}}return t}function rl(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(Ch=performance,he.unstable_now=function(){return Ch.now()}):(Lc=Date,Sh=Lc.now(),he.unstable_now=function(){return Lc.now()-Sh});var Ch,Lc,Sh,ma=[],sr=[],$S=1,Wt=null,at=3,sl=!1,Zr=!1,Ls=!1,kh=typeof setTimeout=="function"?setTimeout:null,bh=typeof clearTimeout=="function"?clearTimeout:null,Ih=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function wc(e){for(var t=ea(sr);t!==null;){if(t.callback===null)nl(sr);else if(t.startTime<=e)nl(sr),t.sortIndex=t.expirationTime,Ic(ma,t);else break;t=ea(sr)}}function kc(e){if(Ls=!1,wc(e),!Zr)if(ea(ma)!==null)Zr=!0,Pc(bc);else{var t=ea(sr);t!==null&&Tc(kc,t.startTime-e)}}function bc(e,t){Zr=!1,Ls&&(Ls=!1,bh(Cs),Cs=-1),sl=!0;var a=at;try{for(wc(t),Wt=ea(ma);Wt!==null&&(!(Wt.expirationTime>t)||e&&!Ah());){var r=Wt.callback;if(typeof r=="function"){Wt.callback=null,at=Wt.priorityLevel;var o=r(Wt.expirationTime<=t);t=he.unstable_now(),typeof o=="function"?Wt.callback=o:Wt===ea(ma)&&nl(ma),wc(t)}else nl(ma);Wt=ea(ma)}if(Wt!==null)var n=!0;else{var s=ea(sr);s!==null&&Tc(kc,s.startTime-t),n=!1}return n}finally{Wt=null,at=a,sl=!1}}var il=!1,ol=null,Cs=-1,Ph=5,Th=-1;function Ah(){return!(he.unstable_now()-Th<Ph)}function Cc(){if(ol!==null){var e=he.unstable_now();Th=e;var t=!0;try{t=ol(!0,e)}finally{t?vs():(il=!1,ol=null)}}else il=!1}var vs;typeof Ih=="function"?vs=function(){Ih(Cc)}:typeof MessageChannel<"u"?(Sc=new MessageChannel,wh=Sc.port2,Sc.port1.onmessage=Cc,vs=function(){wh.postMessage(null)}):vs=function(){kh(Cc,0)};var Sc,wh;function Pc(e){ol=e,il||(il=!0,vs())}function Tc(e,t){Cs=kh(function(){e(he.unstable_now())},t)}he.unstable_IdlePriority=5;he.unstable_ImmediatePriority=1;he.unstable_LowPriority=4;he.unstable_NormalPriority=3;he.unstable_Profiling=null;he.unstable_UserBlockingPriority=2;he.unstable_cancelCallback=function(e){e.callback=null};he.unstable_continueExecution=function(){Zr||sl||(Zr=!0,Pc(bc))};he.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Ph=0<e?Math.floor(1e3/e):5};he.unstable_getCurrentPriorityLevel=function(){return at};he.unstable_getFirstCallbackNode=function(){return ea(ma)};he.unstable_next=function(e){switch(at){case 1:case 2:case 3:var t=3;break;default:t=at}var a=at;at=t;try{return e()}finally{at=a}};he.unstable_pauseExecution=function(){};he.unstable_requestPaint=function(){};he.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=at;at=e;try{return t()}finally{at=a}};he.unstable_scheduleCallback=function(e,t,a){var r=he.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?r+a:r):a=r,e){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return o=a+o,e={id:$S++,callback:t,priorityLevel:e,startTime:a,expirationTime:o,sortIndex:-1},a>r?(e.sortIndex=a,Ic(sr,e),ea(ma)===null&&e===ea(sr)&&(Ls?(bh(Cs),Cs=-1):Ls=!0,Tc(kc,a-r))):(e.sortIndex=o,Ic(ma,e),Zr||sl||(Zr=!0,Pc(bc))),e};he.unstable_shouldYield=Ah;he.unstable_wrapCallback=function(e){var t=at;return function(){var a=at;at=t;try{return e.apply(this,arguments)}finally{at=a}}}});var Mh=Na((RT,Dh)=>{"use strict";Dh.exports=Rh()});var By=Na(Ft=>{"use strict";var XS=$(),Nt=Mh();function D(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,a=1;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Ug=new Set,qs={};function fo(e,t){an(e,t),an(e+"Capture",t)}function an(e,t){for(qs[e]=t,e=0;e<t.length;e++)Ug.add(t[e])}var Ua=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Yc=Object.prototype.hasOwnProperty,QS=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Nh={},Eh={};function YS(e){return Yc.call(Eh,e)?!0:Yc.call(Nh,e)?!1:QS.test(e)?Eh[e]=!0:(Nh[e]=!0,!1)}function ZS(e,t,a,r){if(a!==null&&a.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:a!==null?!a.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function JS(e,t,a,r){if(t===null||typeof t>"u"||ZS(e,t,a,r))return!0;if(r)return!1;if(a!==null)switch(a.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function mt(e,t,a,r,o,n,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=a,this.propertyName=e,this.type=t,this.sanitizeURL=n,this.removeEmptyString=s}var Ye={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ye[e]=new mt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ye[t]=new mt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ye[e]=new mt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ye[e]=new mt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ye[e]=new mt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ye[e]=new mt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ye[e]=new mt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ye[e]=new mt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ye[e]=new mt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Wf=/[\-:]([a-z])/g;function Gf(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Wf,Gf);Ye[t]=new mt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Wf,Gf);Ye[t]=new mt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Wf,Gf);Ye[t]=new mt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ye[e]=new mt(e,1,!1,e.toLowerCase(),null,!1,!1)});Ye.xlinkHref=new mt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ye[e]=new mt(e,1,!1,e.toLowerCase(),null,!0,!0)});function jf(e,t,a,r){var o=Ye.hasOwnProperty(t)?Ye[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(JS(t,a,o,r)&&(a=null),r||o===null?YS(t)&&(a===null?e.removeAttribute(t):e.setAttribute(t,""+a)):o.mustUseProperty?e[o.propertyName]=a===null?o.type===3?!1:"":a:(t=o.attributeName,r=o.attributeNamespace,a===null?e.removeAttribute(t):(o=o.type,a=o===3||o===4&&a===!0?"":""+a,r?e.setAttributeNS(r,t,a):e.setAttribute(t,a))))}var qa=XS.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ll=Symbol.for("react.element"),Vo=Symbol.for("react.portal"),Uo=Symbol.for("react.fragment"),Kf=Symbol.for("react.strict_mode"),Zc=Symbol.for("react.profiler"),_g=Symbol.for("react.provider"),zg=Symbol.for("react.context"),$f=Symbol.for("react.forward_ref"),Jc=Symbol.for("react.suspense"),ef=Symbol.for("react.suspense_list"),Xf=Symbol.for("react.memo"),lr=Symbol.for("react.lazy"),Hg=Symbol.for("react.offscreen"),Fh=Symbol.iterator;function Ss(e){return e===null||typeof e!="object"?null:(e=Fh&&e[Fh]||e["@@iterator"],typeof e=="function"?e:null)}var be=Object.assign,Ac;function Rs(e){if(Ac===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Ac=t&&t[1]||""}return`
|
|
2
|
+
`+Ac+e}var Rc=!1;function Dc(e,t){if(!e||Rc)return"";Rc=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var o=u.stack.split(`
|
|
3
|
+
`),n=r.stack.split(`
|
|
4
4
|
`),s=o.length-1,i=n.length-1;1<=s&&0<=i&&o[s]!==n[i];)i--;for(;1<=s&&0<=i;s--,i--)if(o[s]!==n[i]){if(s!==1||i!==1)do if(s--,i--,0>i||o[s]!==n[i]){var l=`
|
|
5
|
-
`+o[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=i);break}}}finally{gp=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Ri(e):""}function Ck(e){switch(e.tag){case 5:return Ri(e.type);case 16:return Ri("Lazy");case 13:return Ri("Suspense");case 19:return Ri("SuspenseList");case 0:case 2:case 15:return e=yp(e.type,!1),e;case 11:return e=yp(e.type.render,!1),e;case 1:return e=yp(e.type,!0),e;default:return""}}function jp(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 _n:return"Fragment";case Tn:return"Portal";case Fp:return"Profiler";case Eh:return"StrictMode";case Up:return"Suspense";case Vp:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case rx:return(e.displayName||"Context")+".Consumer";case tx:return(e._context.displayName||"Context")+".Provider";case Dh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Nh:return t=e.displayName||null,t!==null?t:jp(e.type)||"Memo";case Ea:t=e._payload,e=e._init;try{return jp(e(t))}catch{}}return null}function bk(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 jp(t);case 8:return t===Eh?"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 Wa(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ox(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Lk(e){var t=ox(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),a=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var o=r.get,n=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){a=""+s,n.call(this,s)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(s){a=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ku(e){e._valueTracker||(e._valueTracker=Lk(e))}function nx(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),a="";return e&&(a=ox(e)?e.checked?"true":"false":e.value),e=a,e!==r?(t.setValue(e),!0):!1}function ec(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 qp(e,t){var r=t.checked;return Ee({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Qy(e,t){var r=t.defaultValue==null?"":t.defaultValue,a=t.checked!=null?t.checked:t.defaultChecked;r=Wa(t.value!=null?t.value:r),e._wrapperState={initialChecked:a,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function sx(e,t){t=t.checked,t!=null&&Rh(e,"checked",t,!1)}function Hp(e,t){sx(e,t);var r=Wa(t.value),a=t.type;if(r!=null)a==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(a==="submit"||a==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?zp(e,t.type,r):t.hasOwnProperty("defaultValue")&&zp(e,t.type,Wa(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Yy(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var a=t.type;if(!(a!=="submit"&&a!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function zp(e,t,r){(t!=="number"||ec(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Ei=Array.isArray;function Vn(e,t,r,a){if(e=e.options,t){t={};for(var o=0;o<r.length;o++)t["$"+r[o]]=!0;for(r=0;r<e.length;r++)o=t.hasOwnProperty("$"+e[r].value),e[r].selected!==o&&(e[r].selected=o),o&&a&&(e[r].defaultSelected=!0)}else{for(r=""+Wa(r),t=null,o=0;o<e.length;o++){if(e[o].value===r){e[o].selected=!0,a&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function $p(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(R(91));return Ee({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Zy(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(R(92));if(Ei(r)){if(1<r.length)throw Error(R(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Wa(r)}}function ix(e,t){var r=Wa(t.value),a=Wa(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),a!=null&&(e.defaultValue=""+a)}function ev(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function lx(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 Wp(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?lx(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Pu,ux=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,a,o){MSApp.execUnsafeLocalFunction(function(){return e(t,r,a,o)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Pu=Pu||document.createElement("div"),Pu.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Pu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function $i(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Mi={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},Ik=["Webkit","ms","Moz","O"];Object.keys(Mi).forEach(function(e){Ik.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Mi[t]=Mi[e]})});function cx(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Mi.hasOwnProperty(e)&&Mi[e]?(""+t).trim():t+"px"}function dx(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var a=r.indexOf("--")===0,o=cx(r,t[r],a);r==="float"&&(r="cssFloat"),a?e.setProperty(r,o):e[r]=o}}var kk=Ee({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 Gp(e,t){if(t){if(kk[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(R(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(R(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(R(61))}if(t.style!=null&&typeof t.style!="object")throw Error(R(62))}}function Kp(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 Xp=null;function Mh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Jp=null,jn=null,qn=null;function tv(e){if(e=ul(e)){if(typeof Jp!="function")throw Error(R(280));var t=e.stateNode;t&&(t=Tc(t),Jp(e.stateNode,e.type,t))}}function fx(e){jn?qn?qn.push(e):qn=[e]:jn=e}function px(){if(jn){var e=jn,t=qn;if(qn=jn=null,tv(e),t)for(e=0;e<t.length;e++)tv(t[e])}}function hx(e,t){return e(t)}function mx(){}var vp=!1;function gx(e,t,r){if(vp)return e(t,r);vp=!0;try{return hx(e,t,r)}finally{vp=!1,(jn!==null||qn!==null)&&(mx(),px())}}function Wi(e,t){var r=e.stateNode;if(r===null)return null;var a=Tc(r);if(a===null)return null;r=a[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":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(R(231,t,typeof r));return r}var Qp=!1;if(na)try{kn={},Object.defineProperty(kn,"passive",{get:function(){Qp=!0}}),window.addEventListener("test",kn,kn),window.removeEventListener("test",kn,kn)}catch{Qp=!1}var kn;function Pk(e,t,r,a,o,n,s,i,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(c){this.onError(c)}}var Oi=!1,tc=null,rc=!1,Yp=null,Tk={onError:function(e){Oi=!0,tc=e}};function _k(e,t,r,a,o,n,s,i,l){Oi=!1,tc=null,Pk.apply(Tk,arguments)}function Ak(e,t,r,a,o,n,s,i,l){if(_k.apply(this,arguments),Oi){if(Oi){var u=tc;Oi=!1,tc=null}else throw Error(R(198));rc||(rc=!0,Yp=u)}}function jo(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function yx(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 rv(e){if(jo(e)!==e)throw Error(R(188))}function Rk(e){var t=e.alternate;if(!t){if(t=jo(e),t===null)throw Error(R(188));return t!==e?null:e}for(var r=e,a=t;;){var o=r.return;if(o===null)break;var n=o.alternate;if(n===null){if(a=o.return,a!==null){r=a;continue}break}if(o.child===n.child){for(n=o.child;n;){if(n===r)return rv(o),e;if(n===a)return rv(o),t;n=n.sibling}throw Error(R(188))}if(r.return!==a.return)r=o,a=n;else{for(var s=!1,i=o.child;i;){if(i===r){s=!0,r=o,a=n;break}if(i===a){s=!0,a=o,r=n;break}i=i.sibling}if(!s){for(i=n.child;i;){if(i===r){s=!0,r=n,a=o;break}if(i===a){s=!0,a=n,r=o;break}i=i.sibling}if(!s)throw Error(R(189))}}if(r.alternate!==a)throw Error(R(190))}if(r.tag!==3)throw Error(R(188));return r.stateNode.current===r?e:t}function vx(e){return e=Rk(e),e!==null?xx(e):null}function xx(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=xx(e);if(t!==null)return t;e=e.sibling}return null}var wx=Wt.unstable_scheduleCallback,av=Wt.unstable_cancelCallback,Ek=Wt.unstable_shouldYield,Dk=Wt.unstable_requestPaint,Ve=Wt.unstable_now,Nk=Wt.unstable_getCurrentPriorityLevel,Oh=Wt.unstable_ImmediatePriority,Sx=Wt.unstable_UserBlockingPriority,ac=Wt.unstable_NormalPriority,Mk=Wt.unstable_LowPriority,Cx=Wt.unstable_IdlePriority,Lc=null,Mr=null;function Ok(e){if(Mr&&typeof Mr.onCommitFiberRoot=="function")try{Mr.onCommitFiberRoot(Lc,e,void 0,(e.current.flags&128)===128)}catch{}}var Cr=Math.clz32?Math.clz32:Uk,Bk=Math.log,Fk=Math.LN2;function Uk(e){return e>>>=0,e===0?32:31-(Bk(e)/Fk|0)|0}var Tu=64,_u=4194304;function Di(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 oc(e,t){var r=e.pendingLanes;if(r===0)return 0;var a=0,o=e.suspendedLanes,n=e.pingedLanes,s=r&268435455;if(s!==0){var i=s&~o;i!==0?a=Di(i):(n&=s,n!==0&&(a=Di(n)))}else s=r&~o,s!==0?a=Di(s):n!==0&&(a=Di(n));if(a===0)return 0;if(t!==0&&t!==a&&(t&o)===0&&(o=a&-a,n=t&-t,o>=n||o===16&&(n&4194240)!==0))return t;if((a&4)!==0&&(a|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=a;0<t;)r=31-Cr(t),o=1<<r,a|=e[r],t&=~o;return a}function Vk(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 jk(e,t){for(var r=e.suspendedLanes,a=e.pingedLanes,o=e.expirationTimes,n=e.pendingLanes;0<n;){var s=31-Cr(n),i=1<<s,l=o[s];l===-1?((i&r)===0||(i&a)!==0)&&(o[s]=Vk(i,t)):l<=t&&(e.expiredLanes|=i),n&=~i}}function Zp(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function bx(){var e=Tu;return Tu<<=1,(Tu&4194240)===0&&(Tu=64),e}function xp(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function il(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Cr(t),e[t]=r}function qk(e,t){var r=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 a=e.eventTimes;for(e=e.expirationTimes;0<r;){var o=31-Cr(r),n=1<<o;t[o]=0,a[o]=-1,e[o]=-1,r&=~n}}function Bh(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var a=31-Cr(r),o=1<<a;o&t|e[a]&t&&(e[a]|=t),r&=~o}}var me=0;function Lx(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Ix,Fh,kx,Px,Tx,eh=!1,Au=[],Fa=null,Ua=null,Va=null,Gi=new Map,Ki=new Map,Na=[],Hk="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 ov(e,t){switch(e){case"focusin":case"focusout":Fa=null;break;case"dragenter":case"dragleave":Ua=null;break;case"mouseover":case"mouseout":Va=null;break;case"pointerover":case"pointerout":Gi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ki.delete(t.pointerId)}}function Li(e,t,r,a,o,n){return e===null||e.nativeEvent!==n?(e={blockedOn:t,domEventName:r,eventSystemFlags:a,nativeEvent:n,targetContainers:[o]},t!==null&&(t=ul(t),t!==null&&Fh(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function zk(e,t,r,a,o){switch(t){case"focusin":return Fa=Li(Fa,e,t,r,a,o),!0;case"dragenter":return Ua=Li(Ua,e,t,r,a,o),!0;case"mouseover":return Va=Li(Va,e,t,r,a,o),!0;case"pointerover":var n=o.pointerId;return Gi.set(n,Li(Gi.get(n)||null,e,t,r,a,o)),!0;case"gotpointercapture":return n=o.pointerId,Ki.set(n,Li(Ki.get(n)||null,e,t,r,a,o)),!0}return!1}function _x(e){var t=Ao(e.target);if(t!==null){var r=jo(t);if(r!==null){if(t=r.tag,t===13){if(t=yx(r),t!==null){e.blockedOn=t,Tx(e.priority,function(){kx(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function zu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=th(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var a=new r.constructor(r.type,r);Xp=a,r.target.dispatchEvent(a),Xp=null}else return t=ul(r),t!==null&&Fh(t),e.blockedOn=r,!1;t.shift()}return!0}function nv(e,t,r){zu(e)&&r.delete(t)}function $k(){eh=!1,Fa!==null&&zu(Fa)&&(Fa=null),Ua!==null&&zu(Ua)&&(Ua=null),Va!==null&&zu(Va)&&(Va=null),Gi.forEach(nv),Ki.forEach(nv)}function Ii(e,t){e.blockedOn===t&&(e.blockedOn=null,eh||(eh=!0,Wt.unstable_scheduleCallback(Wt.unstable_NormalPriority,$k)))}function Xi(e){function t(o){return Ii(o,e)}if(0<Au.length){Ii(Au[0],e);for(var r=1;r<Au.length;r++){var a=Au[r];a.blockedOn===e&&(a.blockedOn=null)}}for(Fa!==null&&Ii(Fa,e),Ua!==null&&Ii(Ua,e),Va!==null&&Ii(Va,e),Gi.forEach(t),Ki.forEach(t),r=0;r<Na.length;r++)a=Na[r],a.blockedOn===e&&(a.blockedOn=null);for(;0<Na.length&&(r=Na[0],r.blockedOn===null);)_x(r),r.blockedOn===null&&Na.shift()}var Hn=ua.ReactCurrentBatchConfig,nc=!0;function Wk(e,t,r,a){var o=me,n=Hn.transition;Hn.transition=null;try{me=1,Uh(e,t,r,a)}finally{me=o,Hn.transition=n}}function Gk(e,t,r,a){var o=me,n=Hn.transition;Hn.transition=null;try{me=4,Uh(e,t,r,a)}finally{me=o,Hn.transition=n}}function Uh(e,t,r,a){if(nc){var o=th(e,t,r,a);if(o===null)kp(e,t,a,sc,r),ov(e,a);else if(zk(o,e,t,r,a))a.stopPropagation();else if(ov(e,a),t&4&&-1<Hk.indexOf(e)){for(;o!==null;){var n=ul(o);if(n!==null&&Ix(n),n=th(e,t,r,a),n===null&&kp(e,t,a,sc,r),n===o)break;o=n}o!==null&&a.stopPropagation()}else kp(e,t,a,null,r)}}var sc=null;function th(e,t,r,a){if(sc=null,e=Mh(a),e=Ao(e),e!==null)if(t=jo(e),t===null)e=null;else if(r=t.tag,r===13){if(e=yx(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return sc=e,null}function Ax(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(Nk()){case Oh:return 1;case Sx:return 4;case ac:case Mk:return 16;case Cx:return 536870912;default:return 16}default:return 16}}var Oa=null,Vh=null,$u=null;function Rx(){if($u)return $u;var e,t=Vh,r=t.length,a,o="value"in Oa?Oa.value:Oa.textContent,n=o.length;for(e=0;e<r&&t[e]===o[e];e++);var s=r-e;for(a=1;a<=s&&t[r-a]===o[n-a];a++);return $u=o.slice(e,1<a?1-a:void 0)}function Wu(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 Ru(){return!0}function sv(){return!1}function Gt(e){function t(r,a,o,n,s){this._reactName=r,this._targetInst=o,this.type=a,this.nativeEvent=n,this.target=s,this.currentTarget=null;for(var i in e)e.hasOwnProperty(i)&&(r=e[i],this[i]=r?r(n):n[i]);return this.isDefaultPrevented=(n.defaultPrevented!=null?n.defaultPrevented:n.returnValue===!1)?Ru:sv,this.isPropagationStopped=sv,this}return Ee(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Ru)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Ru)},persist:function(){},isPersistent:Ru}),t}var Zn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jh=Gt(Zn),ll=Ee({},Zn,{view:0,detail:0}),Kk=Gt(ll),wp,Sp,ki,Ic=Ee({},ll,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qh,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!==ki&&(ki&&e.type==="mousemove"?(wp=e.screenX-ki.screenX,Sp=e.screenY-ki.screenY):Sp=wp=0,ki=e),wp)},movementY:function(e){return"movementY"in e?e.movementY:Sp}}),iv=Gt(Ic),Xk=Ee({},Ic,{dataTransfer:0}),Jk=Gt(Xk),Qk=Ee({},ll,{relatedTarget:0}),Cp=Gt(Qk),Yk=Ee({},Zn,{animationName:0,elapsedTime:0,pseudoElement:0}),Zk=Gt(Yk),eP=Ee({},Zn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),tP=Gt(eP),rP=Ee({},Zn,{data:0}),lv=Gt(rP),aP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},oP={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"},nP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function sP(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=nP[e])?!!t[e]:!1}function qh(){return sP}var iP=Ee({},ll,{key:function(e){if(e.key){var t=aP[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Wu(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?oP[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qh,charCode:function(e){return e.type==="keypress"?Wu(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Wu(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),lP=Gt(iP),uP=Ee({},Ic,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),uv=Gt(uP),cP=Ee({},ll,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qh}),dP=Gt(cP),fP=Ee({},Zn,{propertyName:0,elapsedTime:0,pseudoElement:0}),pP=Gt(fP),hP=Ee({},Ic,{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}),mP=Gt(hP),gP=[9,13,27,32],Hh=na&&"CompositionEvent"in window,Bi=null;na&&"documentMode"in document&&(Bi=document.documentMode);var yP=na&&"TextEvent"in window&&!Bi,Ex=na&&(!Hh||Bi&&8<Bi&&11>=Bi),cv=" ",dv=!1;function Dx(e,t){switch(e){case"keyup":return gP.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nx(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var An=!1;function vP(e,t){switch(e){case"compositionend":return Nx(t);case"keypress":return t.which!==32?null:(dv=!0,cv);case"textInput":return e=t.data,e===cv&&dv?null:e;default:return null}}function xP(e,t){if(An)return e==="compositionend"||!Hh&&Dx(e,t)?(e=Rx(),$u=Vh=Oa=null,An=!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 Ex&&t.locale!=="ko"?null:t.data;default:return null}}var wP={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 fv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!wP[e.type]:t==="textarea"}function Mx(e,t,r,a){fx(a),t=ic(t,"onChange"),0<t.length&&(r=new jh("onChange","change",null,r,a),e.push({event:r,listeners:t}))}var Fi=null,Ji=null;function SP(e){Wx(e,0)}function kc(e){var t=Dn(e);if(nx(t))return e}function CP(e,t){if(e==="change")return t}var Ox=!1;na&&(na?(Du="oninput"in document,Du||(bp=document.createElement("div"),bp.setAttribute("oninput","return;"),Du=typeof bp.oninput=="function"),Eu=Du):Eu=!1,Ox=Eu&&(!document.documentMode||9<document.documentMode));var Eu,Du,bp;function pv(){Fi&&(Fi.detachEvent("onpropertychange",Bx),Ji=Fi=null)}function Bx(e){if(e.propertyName==="value"&&kc(Ji)){var t=[];Mx(t,Ji,e,Mh(e)),gx(SP,t)}}function bP(e,t,r){e==="focusin"?(pv(),Fi=t,Ji=r,Fi.attachEvent("onpropertychange",Bx)):e==="focusout"&&pv()}function LP(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return kc(Ji)}function IP(e,t){if(e==="click")return kc(t)}function kP(e,t){if(e==="input"||e==="change")return kc(t)}function PP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Lr=typeof Object.is=="function"?Object.is:PP;function Qi(e,t){if(Lr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(a=0;a<r.length;a++){var o=r[a];if(!Bp.call(t,o)||!Lr(e[o],t[o]))return!1}return!0}function hv(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function mv(e,t){var r=hv(e);e=0;for(var a;r;){if(r.nodeType===3){if(a=e+r.textContent.length,e<=t&&a>=t)return{node:r,offset:t-e};e=a}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=hv(r)}}function Fx(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Fx(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ux(){for(var e=window,t=ec();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=ec(e.document)}return t}function zh(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 TP(e){var t=Ux(),r=e.focusedElem,a=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Fx(r.ownerDocument.documentElement,r)){if(a!==null&&zh(r)){if(t=a.start,e=a.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=r.textContent.length,n=Math.min(a.start,o);a=a.end===void 0?n:Math.min(a.end,o),!e.extend&&n>a&&(o=a,a=n,n=o),o=mv(r,n);var s=mv(r,a);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),n>a?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var _P=na&&"documentMode"in document&&11>=document.documentMode,Rn=null,rh=null,Ui=null,ah=!1;function gv(e,t,r){var a=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;ah||Rn==null||Rn!==ec(a)||(a=Rn,"selectionStart"in a&&zh(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Ui&&Qi(Ui,a)||(Ui=a,a=ic(rh,"onSelect"),0<a.length&&(t=new jh("onSelect","select",null,t,r),e.push({event:t,listeners:a}),t.target=Rn)))}function Nu(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var En={animationend:Nu("Animation","AnimationEnd"),animationiteration:Nu("Animation","AnimationIteration"),animationstart:Nu("Animation","AnimationStart"),transitionend:Nu("Transition","TransitionEnd")},Lp={},Vx={};na&&(Vx=document.createElement("div").style,"AnimationEvent"in window||(delete En.animationend.animation,delete En.animationiteration.animation,delete En.animationstart.animation),"TransitionEvent"in window||delete En.transitionend.transition);function Pc(e){if(Lp[e])return Lp[e];if(!En[e])return e;var t=En[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Vx)return Lp[e]=t[r];return e}var jx=Pc("animationend"),qx=Pc("animationiteration"),Hx=Pc("animationstart"),zx=Pc("transitionend"),$x=new Map,yv="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 Ka(e,t){$x.set(e,t),Vo(t,[e])}for(Mu=0;Mu<yv.length;Mu++)Ou=yv[Mu],vv=Ou.toLowerCase(),xv=Ou[0].toUpperCase()+Ou.slice(1),Ka(vv,"on"+xv);var Ou,vv,xv,Mu;Ka(jx,"onAnimationEnd");Ka(qx,"onAnimationIteration");Ka(Hx,"onAnimationStart");Ka("dblclick","onDoubleClick");Ka("focusin","onFocus");Ka("focusout","onBlur");Ka(zx,"onTransitionEnd");Wn("onMouseEnter",["mouseout","mouseover"]);Wn("onMouseLeave",["mouseout","mouseover"]);Wn("onPointerEnter",["pointerout","pointerover"]);Wn("onPointerLeave",["pointerout","pointerover"]);Vo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Vo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Vo("onBeforeInput",["compositionend","keypress","textInput","paste"]);Vo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Vo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Vo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ni="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(" "),AP=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ni));function wv(e,t,r){var a=e.type||"unknown-event";e.currentTarget=r,Ak(a,t,void 0,e),e.currentTarget=null}function Wx(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var a=e[r],o=a.event;a=a.listeners;e:{var n=void 0;if(t)for(var s=a.length-1;0<=s;s--){var i=a[s],l=i.instance,u=i.currentTarget;if(i=i.listener,l!==n&&o.isPropagationStopped())break e;wv(o,i,u),n=l}else for(s=0;s<a.length;s++){if(i=a[s],l=i.instance,u=i.currentTarget,i=i.listener,l!==n&&o.isPropagationStopped())break e;wv(o,i,u),n=l}}}if(rc)throw e=Yp,rc=!1,Yp=null,e}function Le(e,t){var r=t[lh];r===void 0&&(r=t[lh]=new Set);var a=e+"__bubble";r.has(a)||(Gx(t,e,2,!1),r.add(a))}function Ip(e,t,r){var a=0;t&&(a|=4),Gx(r,e,a,t)}var Bu="_reactListening"+Math.random().toString(36).slice(2);function Yi(e){if(!e[Bu]){e[Bu]=!0,ex.forEach(function(r){r!=="selectionchange"&&(AP.has(r)||Ip(r,!1,e),Ip(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Bu]||(t[Bu]=!0,Ip("selectionchange",!1,t))}}function Gx(e,t,r,a){switch(Ax(t)){case 1:var o=Wk;break;case 4:o=Gk;break;default:o=Uh}r=o.bind(null,t,r,e),o=void 0,!Qp||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),a?o!==void 0?e.addEventListener(t,r,{capture:!0,passive:o}):e.addEventListener(t,r,!0):o!==void 0?e.addEventListener(t,r,{passive:o}):e.addEventListener(t,r,!1)}function kp(e,t,r,a,o){var n=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var s=a.tag;if(s===3||s===4){var i=a.stateNode.containerInfo;if(i===o||i.nodeType===8&&i.parentNode===o)break;if(s===4)for(s=a.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===o||l.nodeType===8&&l.parentNode===o))return;s=s.return}for(;i!==null;){if(s=Ao(i),s===null)return;if(l=s.tag,l===5||l===6){a=n=s;continue e}i=i.parentNode}}a=a.return}gx(function(){var u=n,c=Mh(r),d=[];e:{var f=$x.get(e);if(f!==void 0){var p=jh,v=e;switch(e){case"keypress":if(Wu(r)===0)break e;case"keydown":case"keyup":p=lP;break;case"focusin":v="focus",p=Cp;break;case"focusout":v="blur",p=Cp;break;case"beforeblur":case"afterblur":p=Cp;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=iv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=Jk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=dP;break;case jx:case qx:case Hx:p=Zk;break;case zx:p=pP;break;case"scroll":p=Kk;break;case"wheel":p=mP;break;case"copy":case"cut":case"paste":p=tP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=uv}var x=(t&4)!==0,C=!x&&e==="scroll",g=x?f!==null?f+"Capture":null:f;x=[];for(var m=u,y;m!==null;){y=m;var b=y.stateNode;if(y.tag===5&&b!==null&&(y=b,g!==null&&(b=Wi(m,g),b!=null&&x.push(Zi(m,b,y)))),C)break;m=m.return}0<x.length&&(f=new p(f,v,null,r,c),d.push({event:f,listeners:x}))}}if((t&7)===0){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&r!==Xp&&(v=r.relatedTarget||r.fromElement)&&(Ao(v)||v[sa]))break e;if((p||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,p?(v=r.relatedTarget||r.toElement,p=u,v=v?Ao(v):null,v!==null&&(C=jo(v),v!==C||v.tag!==5&&v.tag!==6)&&(v=null)):(p=null,v=u),p!==v)){if(x=iv,b="onMouseLeave",g="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(x=uv,b="onPointerLeave",g="onPointerEnter",m="pointer"),C=p==null?f:Dn(p),y=v==null?f:Dn(v),f=new x(b,m+"leave",p,r,c),f.target=C,f.relatedTarget=y,b=null,Ao(c)===u&&(x=new x(g,m+"enter",v,r,c),x.target=y,x.relatedTarget=C,b=x),C=b,p&&v)t:{for(x=p,g=v,m=0,y=x;y;y=Pn(y))m++;for(y=0,b=g;b;b=Pn(b))y++;for(;0<m-y;)x=Pn(x),m--;for(;0<y-m;)g=Pn(g),y--;for(;m--;){if(x===g||g!==null&&x===g.alternate)break t;x=Pn(x),g=Pn(g)}x=null}else x=null;p!==null&&Sv(d,f,p,x,!1),v!==null&&C!==null&&Sv(d,C,v,x,!0)}}e:{if(f=u?Dn(u):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var L=CP;else if(fv(f))if(Ox)L=kP;else{L=LP;var k=bP}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(L=IP);if(L&&(L=L(e,u))){Mx(d,L,r,c);break e}k&&k(e,f,u),e==="focusout"&&(k=f._wrapperState)&&k.controlled&&f.type==="number"&&zp(f,"number",f.value)}switch(k=u?Dn(u):window,e){case"focusin":(fv(k)||k.contentEditable==="true")&&(Rn=k,rh=u,Ui=null);break;case"focusout":Ui=rh=Rn=null;break;case"mousedown":ah=!0;break;case"contextmenu":case"mouseup":case"dragend":ah=!1,gv(d,r,c);break;case"selectionchange":if(_P)break;case"keydown":case"keyup":gv(d,r,c)}var _;if(Hh)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else An?Dx(e,r)&&(T="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(T="onCompositionStart");T&&(Ex&&r.locale!=="ko"&&(An||T!=="onCompositionStart"?T==="onCompositionEnd"&&An&&(_=Rx()):(Oa=c,Vh="value"in Oa?Oa.value:Oa.textContent,An=!0)),k=ic(u,T),0<k.length&&(T=new lv(T,e,null,r,c),d.push({event:T,listeners:k}),_?T.data=_:(_=Nx(r),_!==null&&(T.data=_)))),(_=yP?vP(e,r):xP(e,r))&&(u=ic(u,"onBeforeInput"),0<u.length&&(c=new lv("onBeforeInput","beforeinput",null,r,c),d.push({event:c,listeners:u}),c.data=_))}Wx(d,t)})}function Zi(e,t,r){return{instance:e,listener:t,currentTarget:r}}function ic(e,t){for(var r=t+"Capture",a=[];e!==null;){var o=e,n=o.stateNode;o.tag===5&&n!==null&&(o=n,n=Wi(e,r),n!=null&&a.unshift(Zi(e,n,o)),n=Wi(e,t),n!=null&&a.push(Zi(e,n,o))),e=e.return}return a}function Pn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Sv(e,t,r,a,o){for(var n=t._reactName,s=[];r!==null&&r!==a;){var i=r,l=i.alternate,u=i.stateNode;if(l!==null&&l===a)break;i.tag===5&&u!==null&&(i=u,o?(l=Wi(r,n),l!=null&&s.unshift(Zi(r,l,i))):o||(l=Wi(r,n),l!=null&&s.push(Zi(r,l,i)))),r=r.return}s.length!==0&&e.push({event:t,listeners:s})}var RP=/\r\n?/g,EP=/\u0000|\uFFFD/g;function Cv(e){return(typeof e=="string"?e:""+e).replace(RP,`
|
|
6
|
-
`).replace(EP,"")}function Fu(e,t,r){if(t=Cv(t),Cv(e)!==t&&r)throw Error(R(425))}function lc(){}var oh=null,nh=null;function sh(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 ih=typeof setTimeout=="function"?setTimeout:void 0,DP=typeof clearTimeout=="function"?clearTimeout:void 0,bv=typeof Promise=="function"?Promise:void 0,NP=typeof queueMicrotask=="function"?queueMicrotask:typeof bv<"u"?function(e){return bv.resolve(null).then(e).catch(MP)}:ih;function MP(e){setTimeout(function(){throw e})}function Pp(e,t){var r=t,a=0;do{var o=r.nextSibling;if(e.removeChild(r),o&&o.nodeType===8)if(r=o.data,r==="/$"){if(a===0){e.removeChild(o),Xi(t);return}a--}else r!=="$"&&r!=="$?"&&r!=="$!"||a++;r=o}while(r);Xi(t)}function ja(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 Lv(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var es=Math.random().toString(36).slice(2),Nr="__reactFiber$"+es,el="__reactProps$"+es,sa="__reactContainer$"+es,lh="__reactEvents$"+es,OP="__reactListeners$"+es,BP="__reactHandles$"+es;function Ao(e){var t=e[Nr];if(t)return t;for(var r=e.parentNode;r;){if(t=r[sa]||r[Nr]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Lv(e);e!==null;){if(r=e[Nr])return r;e=Lv(e)}return t}e=r,r=e.parentNode}return null}function ul(e){return e=e[Nr]||e[sa],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Dn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(R(33))}function Tc(e){return e[el]||null}var uh=[],Nn=-1;function Xa(e){return{current:e}}function Ie(e){0>Nn||(e.current=uh[Nn],uh[Nn]=null,Nn--)}function we(e,t){Nn++,uh[Nn]=e.current,e.current=t}var Ga={},wt=Xa(Ga),Dt=Xa(!1),Mo=Ga;function Gn(e,t){var r=e.type.contextTypes;if(!r)return Ga;var a=e.stateNode;if(a&&a.__reactInternalMemoizedUnmaskedChildContext===t)return a.__reactInternalMemoizedMaskedChildContext;var o={},n;for(n in r)o[n]=t[n];return a&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Nt(e){return e=e.childContextTypes,e!=null}function uc(){Ie(Dt),Ie(wt)}function Iv(e,t,r){if(wt.current!==Ga)throw Error(R(168));we(wt,t),we(Dt,r)}function Kx(e,t,r){var a=e.stateNode;if(t=t.childContextTypes,typeof a.getChildContext!="function")return r;a=a.getChildContext();for(var o in a)if(!(o in t))throw Error(R(108,bk(e)||"Unknown",o));return Ee({},r,a)}function cc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ga,Mo=wt.current,we(wt,e),we(Dt,Dt.current),!0}function kv(e,t,r){var a=e.stateNode;if(!a)throw Error(R(169));r?(e=Kx(e,t,Mo),a.__reactInternalMemoizedMergedChildContext=e,Ie(Dt),Ie(wt),we(wt,e)):Ie(Dt),we(Dt,r)}var ta=null,_c=!1,Tp=!1;function Xx(e){ta===null?ta=[e]:ta.push(e)}function FP(e){_c=!0,Xx(e)}function Ja(){if(!Tp&&ta!==null){Tp=!0;var e=0,t=me;try{var r=ta;for(me=1;e<r.length;e++){var a=r[e];do a=a(!0);while(a!==null)}ta=null,_c=!1}catch(o){throw ta!==null&&(ta=ta.slice(e+1)),wx(Oh,Ja),o}finally{me=t,Tp=!1}}return null}var Mn=[],On=0,dc=null,fc=0,ir=[],lr=0,Oo=null,ra=1,aa="";function To(e,t){Mn[On++]=fc,Mn[On++]=dc,dc=e,fc=t}function Jx(e,t,r){ir[lr++]=ra,ir[lr++]=aa,ir[lr++]=Oo,Oo=e;var a=ra;e=aa;var o=32-Cr(a)-1;a&=~(1<<o),r+=1;var n=32-Cr(t)+o;if(30<n){var s=o-o%5;n=(a&(1<<s)-1).toString(32),a>>=s,o-=s,ra=1<<32-Cr(t)+o|r<<o|a,aa=n+e}else ra=1<<n|r<<o|a,aa=e}function $h(e){e.return!==null&&(To(e,1),Jx(e,1,0))}function Wh(e){for(;e===dc;)dc=Mn[--On],Mn[On]=null,fc=Mn[--On],Mn[On]=null;for(;e===Oo;)Oo=ir[--lr],ir[lr]=null,aa=ir[--lr],ir[lr]=null,ra=ir[--lr],ir[lr]=null}var $t=null,zt=null,_e=!1,Sr=null;function Qx(e,t){var r=ur(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function Pv(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,$t=e,zt=ja(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,$t=e,zt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Oo!==null?{id:ra,overflow:aa}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=ur(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,$t=e,zt=null,!0):!1;default:return!1}}function ch(e){return(e.mode&1)!==0&&(e.flags&128)===0}function dh(e){if(_e){var t=zt;if(t){var r=t;if(!Pv(e,t)){if(ch(e))throw Error(R(418));t=ja(r.nextSibling);var a=$t;t&&Pv(e,t)?Qx(a,r):(e.flags=e.flags&-4097|2,_e=!1,$t=e)}}else{if(ch(e))throw Error(R(418));e.flags=e.flags&-4097|2,_e=!1,$t=e}}}function Tv(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;$t=e}function Uu(e){if(e!==$t)return!1;if(!_e)return Tv(e),_e=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!sh(e.type,e.memoizedProps)),t&&(t=zt)){if(ch(e))throw Yx(),Error(R(418));for(;t;)Qx(e,t),t=ja(t.nextSibling)}if(Tv(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(R(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){zt=ja(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}zt=null}}else zt=$t?ja(e.stateNode.nextSibling):null;return!0}function Yx(){for(var e=zt;e;)e=ja(e.nextSibling)}function Kn(){zt=$t=null,_e=!1}function Gh(e){Sr===null?Sr=[e]:Sr.push(e)}var UP=ua.ReactCurrentBatchConfig;function Pi(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(R(309));var a=r.stateNode}if(!a)throw Error(R(147,e));var o=a,n=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===n?t.ref:(t=function(s){var i=o.refs;s===null?delete i[n]:i[n]=s},t._stringRef=n,t)}if(typeof e!="string")throw Error(R(284));if(!r._owner)throw Error(R(290,e))}return e}function Vu(e,t){throw e=Object.prototype.toString.call(t),Error(R(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function _v(e){var t=e._init;return t(e._payload)}function Zx(e){function t(g,m){if(e){var y=g.deletions;y===null?(g.deletions=[m],g.flags|=16):y.push(m)}}function r(g,m){if(!e)return null;for(;m!==null;)t(g,m),m=m.sibling;return null}function a(g,m){for(g=new Map;m!==null;)m.key!==null?g.set(m.key,m):g.set(m.index,m),m=m.sibling;return g}function o(g,m){return g=$a(g,m),g.index=0,g.sibling=null,g}function n(g,m,y){return g.index=y,e?(y=g.alternate,y!==null?(y=y.index,y<m?(g.flags|=2,m):y):(g.flags|=2,m)):(g.flags|=1048576,m)}function s(g){return e&&g.alternate===null&&(g.flags|=2),g}function i(g,m,y,b){return m===null||m.tag!==6?(m=Mp(y,g.mode,b),m.return=g,m):(m=o(m,y),m.return=g,m)}function l(g,m,y,b){var L=y.type;return L===_n?c(g,m,y.props.children,b,y.key):m!==null&&(m.elementType===L||typeof L=="object"&&L!==null&&L.$$typeof===Ea&&_v(L)===m.type)?(b=o(m,y.props),b.ref=Pi(g,m,y),b.return=g,b):(b=Zu(y.type,y.key,y.props,null,g.mode,b),b.ref=Pi(g,m,y),b.return=g,b)}function u(g,m,y,b){return m===null||m.tag!==4||m.stateNode.containerInfo!==y.containerInfo||m.stateNode.implementation!==y.implementation?(m=Op(y,g.mode,b),m.return=g,m):(m=o(m,y.children||[]),m.return=g,m)}function c(g,m,y,b,L){return m===null||m.tag!==7?(m=No(y,g.mode,b,L),m.return=g,m):(m=o(m,y),m.return=g,m)}function d(g,m,y){if(typeof m=="string"&&m!==""||typeof m=="number")return m=Mp(""+m,g.mode,y),m.return=g,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Iu:return y=Zu(m.type,m.key,m.props,null,g.mode,y),y.ref=Pi(g,null,m),y.return=g,y;case Tn:return m=Op(m,g.mode,y),m.return=g,m;case Ea:var b=m._init;return d(g,b(m._payload),y)}if(Ei(m)||bi(m))return m=No(m,g.mode,y,null),m.return=g,m;Vu(g,m)}return null}function f(g,m,y,b){var L=m!==null?m.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return L!==null?null:i(g,m,""+y,b);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Iu:return y.key===L?l(g,m,y,b):null;case Tn:return y.key===L?u(g,m,y,b):null;case Ea:return L=y._init,f(g,m,L(y._payload),b)}if(Ei(y)||bi(y))return L!==null?null:c(g,m,y,b,null);Vu(g,y)}return null}function p(g,m,y,b,L){if(typeof b=="string"&&b!==""||typeof b=="number")return g=g.get(y)||null,i(m,g,""+b,L);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Iu:return g=g.get(b.key===null?y:b.key)||null,l(m,g,b,L);case Tn:return g=g.get(b.key===null?y:b.key)||null,u(m,g,b,L);case Ea:var k=b._init;return p(g,m,y,k(b._payload),L)}if(Ei(b)||bi(b))return g=g.get(y)||null,c(m,g,b,L,null);Vu(m,b)}return null}function v(g,m,y,b){for(var L=null,k=null,_=m,T=m=0,M=null;_!==null&&T<y.length;T++){_.index>T?(M=_,_=null):M=_.sibling;var B=f(g,_,y[T],b);if(B===null){_===null&&(_=M);break}e&&_&&B.alternate===null&&t(g,_),m=n(B,m,T),k===null?L=B:k.sibling=B,k=B,_=M}if(T===y.length)return r(g,_),_e&&To(g,T),L;if(_===null){for(;T<y.length;T++)_=d(g,y[T],b),_!==null&&(m=n(_,m,T),k===null?L=_:k.sibling=_,k=_);return _e&&To(g,T),L}for(_=a(g,_);T<y.length;T++)M=p(_,g,T,y[T],b),M!==null&&(e&&M.alternate!==null&&_.delete(M.key===null?T:M.key),m=n(M,m,T),k===null?L=M:k.sibling=M,k=M);return e&&_.forEach(function(W){return t(g,W)}),_e&&To(g,T),L}function x(g,m,y,b){var L=bi(y);if(typeof L!="function")throw Error(R(150));if(y=L.call(y),y==null)throw Error(R(151));for(var k=L=null,_=m,T=m=0,M=null,B=y.next();_!==null&&!B.done;T++,B=y.next()){_.index>T?(M=_,_=null):M=_.sibling;var W=f(g,_,B.value,b);if(W===null){_===null&&(_=M);break}e&&_&&W.alternate===null&&t(g,_),m=n(W,m,T),k===null?L=W:k.sibling=W,k=W,_=M}if(B.done)return r(g,_),_e&&To(g,T),L;if(_===null){for(;!B.done;T++,B=y.next())B=d(g,B.value,b),B!==null&&(m=n(B,m,T),k===null?L=B:k.sibling=B,k=B);return _e&&To(g,T),L}for(_=a(g,_);!B.done;T++,B=y.next())B=p(_,g,T,B.value,b),B!==null&&(e&&B.alternate!==null&&_.delete(B.key===null?T:B.key),m=n(B,m,T),k===null?L=B:k.sibling=B,k=B);return e&&_.forEach(function(ce){return t(g,ce)}),_e&&To(g,T),L}function C(g,m,y,b){if(typeof y=="object"&&y!==null&&y.type===_n&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Iu:e:{for(var L=y.key,k=m;k!==null;){if(k.key===L){if(L=y.type,L===_n){if(k.tag===7){r(g,k.sibling),m=o(k,y.props.children),m.return=g,g=m;break e}}else if(k.elementType===L||typeof L=="object"&&L!==null&&L.$$typeof===Ea&&_v(L)===k.type){r(g,k.sibling),m=o(k,y.props),m.ref=Pi(g,k,y),m.return=g,g=m;break e}r(g,k);break}else t(g,k);k=k.sibling}y.type===_n?(m=No(y.props.children,g.mode,b,y.key),m.return=g,g=m):(b=Zu(y.type,y.key,y.props,null,g.mode,b),b.ref=Pi(g,m,y),b.return=g,g=b)}return s(g);case Tn:e:{for(k=y.key;m!==null;){if(m.key===k)if(m.tag===4&&m.stateNode.containerInfo===y.containerInfo&&m.stateNode.implementation===y.implementation){r(g,m.sibling),m=o(m,y.children||[]),m.return=g,g=m;break e}else{r(g,m);break}else t(g,m);m=m.sibling}m=Op(y,g.mode,b),m.return=g,g=m}return s(g);case Ea:return k=y._init,C(g,m,k(y._payload),b)}if(Ei(y))return v(g,m,y,b);if(bi(y))return x(g,m,y,b);Vu(g,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,m!==null&&m.tag===6?(r(g,m.sibling),m=o(m,y),m.return=g,g=m):(r(g,m),m=Mp(y,g.mode,b),m.return=g,g=m),s(g)):r(g,m)}return C}var Xn=Zx(!0),e0=Zx(!1),pc=Xa(null),hc=null,Bn=null,Kh=null;function Xh(){Kh=Bn=hc=null}function Jh(e){var t=pc.current;Ie(pc),e._currentValue=t}function fh(e,t,r){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===r)break;e=e.return}}function zn(e,t){hc=e,Kh=Bn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Et=!0),e.firstContext=null)}function dr(e){var t=e._currentValue;if(Kh!==e)if(e={context:e,memoizedValue:t,next:null},Bn===null){if(hc===null)throw Error(R(308));Bn=e,hc.dependencies={lanes:0,firstContext:e}}else Bn=Bn.next=e;return t}var Ro=null;function Qh(e){Ro===null?Ro=[e]:Ro.push(e)}function t0(e,t,r,a){var o=t.interleaved;return o===null?(r.next=r,Qh(t)):(r.next=o.next,o.next=r),t.interleaved=r,ia(e,a)}function ia(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Da=!1;function Yh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function r0(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 oa(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function qa(e,t,r){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(ue&2)!==0){var o=a.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),a.pending=t,ia(e,r)}return o=a.interleaved,o===null?(t.next=t,Qh(a)):(t.next=o.next,o.next=t),a.interleaved=t,ia(e,r)}function Gu(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var a=t.lanes;a&=e.pendingLanes,r|=a,t.lanes=r,Bh(e,r)}}function Av(e,t){var r=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,r===a)){var o=null,n=null;if(r=r.firstBaseUpdate,r!==null){do{var s={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};n===null?o=n=s:n=n.next=s,r=r.next}while(r!==null);n===null?o=n=t:n=n.next=t}else o=n=t;r={baseState:a.baseState,firstBaseUpdate:o,lastBaseUpdate:n,shared:a.shared,effects:a.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function mc(e,t,r,a){var o=e.updateQueue;Da=!1;var n=o.firstBaseUpdate,s=o.lastBaseUpdate,i=o.shared.pending;if(i!==null){o.shared.pending=null;var l=i,u=l.next;l.next=null,s===null?n=u:s.next=u,s=l;var c=e.alternate;c!==null&&(c=c.updateQueue,i=c.lastBaseUpdate,i!==s&&(i===null?c.firstBaseUpdate=u:i.next=u,c.lastBaseUpdate=l))}if(n!==null){var d=o.baseState;s=0,c=u=l=null,i=n;do{var f=i.lane,p=i.eventTime;if((a&f)===f){c!==null&&(c=c.next={eventTime:p,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var v=e,x=i;switch(f=t,p=r,x.tag){case 1:if(v=x.payload,typeof v=="function"){d=v.call(p,d,f);break e}d=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=x.payload,f=typeof v=="function"?v.call(p,d,f):v,f==null)break e;d=Ee({},d,f);break e;case 2:Da=!0}}i.callback!==null&&i.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[i]:f.push(i))}else p={eventTime:p,lane:f,tag:i.tag,payload:i.payload,callback:i.callback,next:null},c===null?(u=c=p,l=d):c=c.next=p,s|=f;if(i=i.next,i===null){if(i=o.shared.pending,i===null)break;f=i,i=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(c===null&&(l=d),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=c,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else n===null&&(o.shared.lanes=0);Fo|=s,e.lanes=s,e.memoizedState=d}}function Rv(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var a=e[t],o=a.callback;if(o!==null){if(a.callback=null,a=r,typeof o!="function")throw Error(R(191,o));o.call(a)}}}var cl={},Or=Xa(cl),tl=Xa(cl),rl=Xa(cl);function Eo(e){if(e===cl)throw Error(R(174));return e}function Zh(e,t){switch(we(rl,t),we(tl,e),we(Or,cl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Wp(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Wp(t,e)}Ie(Or),we(Or,t)}function Jn(){Ie(Or),Ie(tl),Ie(rl)}function a0(e){Eo(rl.current);var t=Eo(Or.current),r=Wp(t,e.type);t!==r&&(we(tl,e),we(Or,r))}function em(e){tl.current===e&&(Ie(Or),Ie(tl))}var Ae=Xa(0);function gc(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var _p=[];function tm(){for(var e=0;e<_p.length;e++)_p[e]._workInProgressVersionPrimary=null;_p.length=0}var Ku=ua.ReactCurrentDispatcher,Ap=ua.ReactCurrentBatchConfig,Bo=0,Re=null,Ge=null,Ze=null,yc=!1,Vi=!1,al=0,VP=0;function yt(){throw Error(R(321))}function rm(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Lr(e[r],t[r]))return!1;return!0}function am(e,t,r,a,o,n){if(Bo=n,Re=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ku.current=e===null||e.memoizedState===null?zP:$P,e=r(a,o),Vi){n=0;do{if(Vi=!1,al=0,25<=n)throw Error(R(301));n+=1,Ze=Ge=null,t.updateQueue=null,Ku.current=WP,e=r(a,o)}while(Vi)}if(Ku.current=vc,t=Ge!==null&&Ge.next!==null,Bo=0,Ze=Ge=Re=null,yc=!1,t)throw Error(R(300));return e}function om(){var e=al!==0;return al=0,e}function Dr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ze===null?Re.memoizedState=Ze=e:Ze=Ze.next=e,Ze}function fr(){if(Ge===null){var e=Re.alternate;e=e!==null?e.memoizedState:null}else e=Ge.next;var t=Ze===null?Re.memoizedState:Ze.next;if(t!==null)Ze=t,Ge=e;else{if(e===null)throw Error(R(310));Ge=e,e={memoizedState:Ge.memoizedState,baseState:Ge.baseState,baseQueue:Ge.baseQueue,queue:Ge.queue,next:null},Ze===null?Re.memoizedState=Ze=e:Ze=Ze.next=e}return Ze}function ol(e,t){return typeof t=="function"?t(e):t}function Rp(e){var t=fr(),r=t.queue;if(r===null)throw Error(R(311));r.lastRenderedReducer=e;var a=Ge,o=a.baseQueue,n=r.pending;if(n!==null){if(o!==null){var s=o.next;o.next=n.next,n.next=s}a.baseQueue=o=n,r.pending=null}if(o!==null){n=o.next,a=a.baseState;var i=s=null,l=null,u=n;do{var c=u.lane;if((Bo&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),a=u.hasEagerState?u.eagerState:e(a,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(i=l=d,s=a):l=l.next=d,Re.lanes|=c,Fo|=c}u=u.next}while(u!==null&&u!==n);l===null?s=a:l.next=i,Lr(a,t.memoizedState)||(Et=!0),t.memoizedState=a,t.baseState=s,t.baseQueue=l,r.lastRenderedState=a}if(e=r.interleaved,e!==null){o=e;do n=o.lane,Re.lanes|=n,Fo|=n,o=o.next;while(o!==e)}else o===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Ep(e){var t=fr(),r=t.queue;if(r===null)throw Error(R(311));r.lastRenderedReducer=e;var a=r.dispatch,o=r.pending,n=t.memoizedState;if(o!==null){r.pending=null;var s=o=o.next;do n=e(n,s.action),s=s.next;while(s!==o);Lr(n,t.memoizedState)||(Et=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),r.lastRenderedState=n}return[n,a]}function o0(){}function n0(e,t){var r=Re,a=fr(),o=t(),n=!Lr(a.memoizedState,o);if(n&&(a.memoizedState=o,Et=!0),a=a.queue,nm(l0.bind(null,r,a,e),[e]),a.getSnapshot!==t||n||Ze!==null&&Ze.memoizedState.tag&1){if(r.flags|=2048,nl(9,i0.bind(null,r,a,o,t),void 0,null),et===null)throw Error(R(349));(Bo&30)!==0||s0(r,t,o)}return o}function s0(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Re.updateQueue,t===null?(t={lastEffect:null,stores:null},Re.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function i0(e,t,r,a){t.value=r,t.getSnapshot=a,u0(t)&&c0(e)}function l0(e,t,r){return r(function(){u0(t)&&c0(e)})}function u0(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Lr(e,r)}catch{return!0}}function c0(e){var t=ia(e,1);t!==null&&br(t,e,1,-1)}function Ev(e){var t=Dr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ol,lastRenderedState:e},t.queue=e,e=e.dispatch=HP.bind(null,Re,e),[t.memoizedState,e]}function nl(e,t,r,a){return e={tag:e,create:t,destroy:r,deps:a,next:null},t=Re.updateQueue,t===null?(t={lastEffect:null,stores:null},Re.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(a=r.next,r.next=e,e.next=a,t.lastEffect=e)),e}function d0(){return fr().memoizedState}function Xu(e,t,r,a){var o=Dr();Re.flags|=e,o.memoizedState=nl(1|t,r,void 0,a===void 0?null:a)}function Ac(e,t,r,a){var o=fr();a=a===void 0?null:a;var n=void 0;if(Ge!==null){var s=Ge.memoizedState;if(n=s.destroy,a!==null&&rm(a,s.deps)){o.memoizedState=nl(t,r,n,a);return}}Re.flags|=e,o.memoizedState=nl(1|t,r,n,a)}function Dv(e,t){return Xu(8390656,8,e,t)}function nm(e,t){return Ac(2048,8,e,t)}function f0(e,t){return Ac(4,2,e,t)}function p0(e,t){return Ac(4,4,e,t)}function h0(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 m0(e,t,r){return r=r!=null?r.concat([e]):null,Ac(4,4,h0.bind(null,t,e),r)}function sm(){}function g0(e,t){var r=fr();t=t===void 0?null:t;var a=r.memoizedState;return a!==null&&t!==null&&rm(t,a[1])?a[0]:(r.memoizedState=[e,t],e)}function y0(e,t){var r=fr();t=t===void 0?null:t;var a=r.memoizedState;return a!==null&&t!==null&&rm(t,a[1])?a[0]:(e=e(),r.memoizedState=[e,t],e)}function v0(e,t,r){return(Bo&21)===0?(e.baseState&&(e.baseState=!1,Et=!0),e.memoizedState=r):(Lr(r,t)||(r=bx(),Re.lanes|=r,Fo|=r,e.baseState=!0),t)}function jP(e,t){var r=me;me=r!==0&&4>r?r:4,e(!0);var a=Ap.transition;Ap.transition={};try{e(!1),t()}finally{me=r,Ap.transition=a}}function x0(){return fr().memoizedState}function qP(e,t,r){var a=za(e);if(r={lane:a,action:r,hasEagerState:!1,eagerState:null,next:null},w0(e))S0(t,r);else if(r=t0(e,t,r,a),r!==null){var o=kt();br(r,e,a,o),C0(r,t,a)}}function HP(e,t,r){var a=za(e),o={lane:a,action:r,hasEagerState:!1,eagerState:null,next:null};if(w0(e))S0(t,o);else{var n=e.alternate;if(e.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var s=t.lastRenderedState,i=n(s,r);if(o.hasEagerState=!0,o.eagerState=i,Lr(i,s)){var l=t.interleaved;l===null?(o.next=o,Qh(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}r=t0(e,t,o,a),r!==null&&(o=kt(),br(r,e,a,o),C0(r,t,a))}}function w0(e){var t=e.alternate;return e===Re||t!==null&&t===Re}function S0(e,t){Vi=yc=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function C0(e,t,r){if((r&4194240)!==0){var a=t.lanes;a&=e.pendingLanes,r|=a,t.lanes=r,Bh(e,r)}}var vc={readContext:dr,useCallback:yt,useContext:yt,useEffect:yt,useImperativeHandle:yt,useInsertionEffect:yt,useLayoutEffect:yt,useMemo:yt,useReducer:yt,useRef:yt,useState:yt,useDebugValue:yt,useDeferredValue:yt,useTransition:yt,useMutableSource:yt,useSyncExternalStore:yt,useId:yt,unstable_isNewReconciler:!1},zP={readContext:dr,useCallback:function(e,t){return Dr().memoizedState=[e,t===void 0?null:t],e},useContext:dr,useEffect:Dv,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Xu(4194308,4,h0.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Xu(4194308,4,e,t)},useInsertionEffect:function(e,t){return Xu(4,2,e,t)},useMemo:function(e,t){var r=Dr();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var a=Dr();return t=r!==void 0?r(t):t,a.memoizedState=a.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},a.queue=e,e=e.dispatch=qP.bind(null,Re,e),[a.memoizedState,e]},useRef:function(e){var t=Dr();return e={current:e},t.memoizedState=e},useState:Ev,useDebugValue:sm,useDeferredValue:function(e){return Dr().memoizedState=e},useTransition:function(){var e=Ev(!1),t=e[0];return e=jP.bind(null,e[1]),Dr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var a=Re,o=Dr();if(_e){if(r===void 0)throw Error(R(407));r=r()}else{if(r=t(),et===null)throw Error(R(349));(Bo&30)!==0||s0(a,t,r)}o.memoizedState=r;var n={value:r,getSnapshot:t};return o.queue=n,Dv(l0.bind(null,a,n,e),[e]),a.flags|=2048,nl(9,i0.bind(null,a,n,r,t),void 0,null),r},useId:function(){var e=Dr(),t=et.identifierPrefix;if(_e){var r=aa,a=ra;r=(a&~(1<<32-Cr(a)-1)).toString(32)+r,t=":"+t+"R"+r,r=al++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=VP++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},$P={readContext:dr,useCallback:g0,useContext:dr,useEffect:nm,useImperativeHandle:m0,useInsertionEffect:f0,useLayoutEffect:p0,useMemo:y0,useReducer:Rp,useRef:d0,useState:function(){return Rp(ol)},useDebugValue:sm,useDeferredValue:function(e){var t=fr();return v0(t,Ge.memoizedState,e)},useTransition:function(){var e=Rp(ol)[0],t=fr().memoizedState;return[e,t]},useMutableSource:o0,useSyncExternalStore:n0,useId:x0,unstable_isNewReconciler:!1},WP={readContext:dr,useCallback:g0,useContext:dr,useEffect:nm,useImperativeHandle:m0,useInsertionEffect:f0,useLayoutEffect:p0,useMemo:y0,useReducer:Ep,useRef:d0,useState:function(){return Ep(ol)},useDebugValue:sm,useDeferredValue:function(e){var t=fr();return Ge===null?t.memoizedState=e:v0(t,Ge.memoizedState,e)},useTransition:function(){var e=Ep(ol)[0],t=fr().memoizedState;return[e,t]},useMutableSource:o0,useSyncExternalStore:n0,useId:x0,unstable_isNewReconciler:!1};function xr(e,t){if(e&&e.defaultProps){t=Ee({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function ph(e,t,r,a){t=e.memoizedState,r=r(a,t),r=r==null?t:Ee({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Rc={isMounted:function(e){return(e=e._reactInternals)?jo(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var a=kt(),o=za(e),n=oa(a,o);n.payload=t,r!=null&&(n.callback=r),t=qa(e,n,o),t!==null&&(br(t,e,o,a),Gu(t,e,o))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var a=kt(),o=za(e),n=oa(a,o);n.tag=1,n.payload=t,r!=null&&(n.callback=r),t=qa(e,n,o),t!==null&&(br(t,e,o,a),Gu(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=kt(),a=za(e),o=oa(r,a);o.tag=2,t!=null&&(o.callback=t),t=qa(e,o,a),t!==null&&(br(t,e,a,r),Gu(t,e,a))}};function Nv(e,t,r,a,o,n,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,n,s):t.prototype&&t.prototype.isPureReactComponent?!Qi(r,a)||!Qi(o,n):!0}function b0(e,t,r){var a=!1,o=Ga,n=t.contextType;return typeof n=="object"&&n!==null?n=dr(n):(o=Nt(t)?Mo:wt.current,a=t.contextTypes,n=(a=a!=null)?Gn(e,o):Ga),t=new t(r,n),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Rc,e.stateNode=t,t._reactInternals=e,a&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=n),t}function Mv(e,t,r,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,a),t.state!==e&&Rc.enqueueReplaceState(t,t.state,null)}function hh(e,t,r,a){var o=e.stateNode;o.props=r,o.state=e.memoizedState,o.refs={},Yh(e);var n=t.contextType;typeof n=="object"&&n!==null?o.context=dr(n):(n=Nt(t)?Mo:wt.current,o.context=Gn(e,n)),o.state=e.memoizedState,n=t.getDerivedStateFromProps,typeof n=="function"&&(ph(e,t,n,r),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Rc.enqueueReplaceState(o,o.state,null),mc(e,r,o,a),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Qn(e,t){try{var r="",a=t;do r+=Ck(a),a=a.return;while(a);var o=r}catch(n){o=`
|
|
5
|
+
`+o[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=i);break}}}finally{Rc=!1,Error.prepareStackTrace=a}return(e=e?e.displayName||e.name:"")?Rs(e):""}function eI(e){switch(e.tag){case 5:return Rs(e.type);case 16:return Rs("Lazy");case 13:return Rs("Suspense");case 19:return Rs("SuspenseList");case 0:case 2:case 15:return e=Dc(e.type,!1),e;case 11:return e=Dc(e.type.render,!1),e;case 1:return e=Dc(e.type,!0),e;default:return""}}function tf(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 Uo:return"Fragment";case Vo:return"Portal";case Zc:return"Profiler";case Kf:return"StrictMode";case Jc:return"Suspense";case ef:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case zg:return(e.displayName||"Context")+".Consumer";case _g:return(e._context.displayName||"Context")+".Provider";case $f:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Xf:return t=e.displayName||null,t!==null?t:tf(e.type)||"Memo";case lr:t=e._payload,e=e._init;try{return tf(e(t))}catch{}}return null}function tI(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 tf(t);case 8:return t===Kf?"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 Sr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function qg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function aI(e){var t=qg(e)?"checked":"value",a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var o=a.get,n=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,n.call(this,s)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ul(e){e._valueTracker||(e._valueTracker=aI(e))}function Wg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=qg(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function Ol(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 af(e,t){var a=t.checked;return be({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??e._wrapperState.initialChecked})}function Bh(e,t){var a=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;a=Sr(t.value!=null?t.value:a),e._wrapperState={initialChecked:r,initialValue:a,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Gg(e,t){t=t.checked,t!=null&&jf(e,"checked",t,!1)}function rf(e,t){Gg(e,t);var a=Sr(t.value),r=t.type;if(a!=null)r==="number"?(a===0&&e.value===""||e.value!=a)&&(e.value=""+a):e.value!==""+a&&(e.value=""+a);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?of(e,t.type,a):t.hasOwnProperty("defaultValue")&&of(e,t.type,Sr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Oh(e,t,a){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,a||t===e.value||(e.value=t),e.defaultValue=t}a=e.name,a!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,a!==""&&(e.name=a)}function of(e,t,a){(t!=="number"||Ol(e.ownerDocument)!==e)&&(a==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+a&&(e.defaultValue=""+a))}var Ds=Array.isArray;function Qo(e,t,a,r){if(e=e.options,t){t={};for(var o=0;o<a.length;o++)t["$"+a[o]]=!0;for(a=0;a<e.length;a++)o=t.hasOwnProperty("$"+e[a].value),e[a].selected!==o&&(e[a].selected=o),o&&r&&(e[a].defaultSelected=!0)}else{for(a=""+Sr(a),t=null,o=0;o<e.length;o++){if(e[o].value===a){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function nf(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(D(91));return be({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Vh(e,t){var a=t.value;if(a==null){if(a=t.children,t=t.defaultValue,a!=null){if(t!=null)throw Error(D(92));if(Ds(a)){if(1<a.length)throw Error(D(93));a=a[0]}t=a}t==null&&(t=""),a=t}e._wrapperState={initialValue:Sr(a)}}function jg(e,t){var a=Sr(t.value),r=Sr(t.defaultValue);a!=null&&(a=""+a,a!==e.value&&(e.value=a),t.defaultValue==null&&e.defaultValue!==a&&(e.defaultValue=a)),r!=null&&(e.defaultValue=""+r)}function Uh(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Kg(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 sf(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Kg(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var dl,$g=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,a,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,a,r,o)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(dl=dl||document.createElement("div"),dl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=dl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ws(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Es={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},rI=["Webkit","ms","Moz","O"];Object.keys(Es).forEach(function(e){rI.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Es[t]=Es[e]})});function Xg(e,t,a){return t==null||typeof t=="boolean"||t===""?"":a||typeof t!="number"||t===0||Es.hasOwnProperty(e)&&Es[e]?(""+t).trim():t+"px"}function Qg(e,t){e=e.style;for(var a in t)if(t.hasOwnProperty(a)){var r=a.indexOf("--")===0,o=Xg(a,t[a],r);a==="float"&&(a="cssFloat"),r?e.setProperty(a,o):e[a]=o}}var oI=be({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 lf(e,t){if(t){if(oI[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(D(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(D(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(D(61))}if(t.style!=null&&typeof t.style!="object")throw Error(D(62))}}function uf(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var df=null;function Qf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var cf=null,Yo=null,Zo=null;function _h(e){if(e=li(e)){if(typeof cf!="function")throw Error(D(280));var t=e.stateNode;t&&(t=cu(t),cf(e.stateNode,e.type,t))}}function Yg(e){Yo?Zo?Zo.push(e):Zo=[e]:Yo=e}function Zg(){if(Yo){var e=Yo,t=Zo;if(Zo=Yo=null,_h(e),t)for(e=0;e<t.length;e++)_h(t[e])}}function Jg(e,t){return e(t)}function ex(){}var Mc=!1;function tx(e,t,a){if(Mc)return e(t,a);Mc=!0;try{return Jg(e,t,a)}finally{Mc=!1,(Yo!==null||Zo!==null)&&(ex(),Zg())}}function Gs(e,t){var a=e.stateNode;if(a===null)return null;var r=cu(a);if(r===null)return null;a=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(a&&typeof a!="function")throw Error(D(231,t,typeof a));return a}var ff=!1;if(Ua)try{Bo={},Object.defineProperty(Bo,"passive",{get:function(){ff=!0}}),window.addEventListener("test",Bo,Bo),window.removeEventListener("test",Bo,Bo)}catch{ff=!1}var Bo;function nI(e,t,a,r,o,n,s,i,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(a,u)}catch(d){this.onError(d)}}var Fs=!1,Vl=null,Ul=!1,pf=null,sI={onError:function(e){Fs=!0,Vl=e}};function iI(e,t,a,r,o,n,s,i,l){Fs=!1,Vl=null,nI.apply(sI,arguments)}function lI(e,t,a,r,o,n,s,i,l){if(iI.apply(this,arguments),Fs){if(Fs){var u=Vl;Fs=!1,Vl=null}else throw Error(D(198));Ul||(Ul=!0,pf=u)}}function po(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function ax(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 zh(e){if(po(e)!==e)throw Error(D(188))}function uI(e){var t=e.alternate;if(!t){if(t=po(e),t===null)throw Error(D(188));return t!==e?null:e}for(var a=e,r=t;;){var o=a.return;if(o===null)break;var n=o.alternate;if(n===null){if(r=o.return,r!==null){a=r;continue}break}if(o.child===n.child){for(n=o.child;n;){if(n===a)return zh(o),e;if(n===r)return zh(o),t;n=n.sibling}throw Error(D(188))}if(a.return!==r.return)a=o,r=n;else{for(var s=!1,i=o.child;i;){if(i===a){s=!0,a=o,r=n;break}if(i===r){s=!0,r=o,a=n;break}i=i.sibling}if(!s){for(i=n.child;i;){if(i===a){s=!0,a=n,r=o;break}if(i===r){s=!0,r=n,a=o;break}i=i.sibling}if(!s)throw Error(D(189))}}if(a.alternate!==r)throw Error(D(190))}if(a.tag!==3)throw Error(D(188));return a.stateNode.current===a?e:t}function rx(e){return e=uI(e),e!==null?ox(e):null}function ox(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ox(e);if(t!==null)return t;e=e.sibling}return null}var nx=Nt.unstable_scheduleCallback,Hh=Nt.unstable_cancelCallback,dI=Nt.unstable_shouldYield,cI=Nt.unstable_requestPaint,Me=Nt.unstable_now,fI=Nt.unstable_getCurrentPriorityLevel,Yf=Nt.unstable_ImmediatePriority,sx=Nt.unstable_UserBlockingPriority,_l=Nt.unstable_NormalPriority,pI=Nt.unstable_LowPriority,ix=Nt.unstable_IdlePriority,iu=null,ya=null;function mI(e){if(ya&&typeof ya.onCommitFiberRoot=="function")try{ya.onCommitFiberRoot(iu,e,void 0,(e.current.flags&128)===128)}catch{}}var na=Math.clz32?Math.clz32:xI,hI=Math.log,gI=Math.LN2;function xI(e){return e>>>=0,e===0?32:31-(hI(e)/gI|0)|0}var cl=64,fl=4194304;function Ms(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 zl(e,t){var a=e.pendingLanes;if(a===0)return 0;var r=0,o=e.suspendedLanes,n=e.pingedLanes,s=a&268435455;if(s!==0){var i=s&~o;i!==0?r=Ms(i):(n&=s,n!==0&&(r=Ms(n)))}else s=a&~o,s!==0?r=Ms(s):n!==0&&(r=Ms(n));if(r===0)return 0;if(t!==0&&t!==r&&(t&o)===0&&(o=r&-r,n=t&-t,o>=n||o===16&&(n&4194240)!==0))return t;if((r&4)!==0&&(r|=a&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)a=31-na(t),o=1<<a,r|=e[a],t&=~o;return r}function yI(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 vI(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,n=e.pendingLanes;0<n;){var s=31-na(n),i=1<<s,l=o[s];l===-1?((i&a)===0||(i&r)!==0)&&(o[s]=yI(i,t)):l<=t&&(e.expiredLanes|=i),n&=~i}}function mf(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function lx(){var e=cl;return cl<<=1,(cl&4194240)===0&&(cl=64),e}function Nc(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function si(e,t,a){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-na(t),e[t]=a}function LI(e,t){var a=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<a;){var o=31-na(a),n=1<<o;t[o]=0,r[o]=-1,e[o]=-1,a&=~n}}function Zf(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-na(a),o=1<<r;o&t|e[r]&t&&(e[r]|=t),a&=~o}}var fe=0;function ux(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var dx,Jf,cx,fx,px,hf=!1,pl=[],mr=null,hr=null,gr=null,js=new Map,Ks=new Map,dr=[],CI="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 qh(e,t){switch(e){case"focusin":case"focusout":mr=null;break;case"dragenter":case"dragleave":hr=null;break;case"mouseover":case"mouseout":gr=null;break;case"pointerover":case"pointerout":js.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ks.delete(t.pointerId)}}function Is(e,t,a,r,o,n){return e===null||e.nativeEvent!==n?(e={blockedOn:t,domEventName:a,eventSystemFlags:r,nativeEvent:n,targetContainers:[o]},t!==null&&(t=li(t),t!==null&&Jf(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function SI(e,t,a,r,o){switch(t){case"focusin":return mr=Is(mr,e,t,a,r,o),!0;case"dragenter":return hr=Is(hr,e,t,a,r,o),!0;case"mouseover":return gr=Is(gr,e,t,a,r,o),!0;case"pointerover":var n=o.pointerId;return js.set(n,Is(js.get(n)||null,e,t,a,r,o)),!0;case"gotpointercapture":return n=o.pointerId,Ks.set(n,Is(Ks.get(n)||null,e,t,a,r,o)),!0}return!1}function mx(e){var t=to(e.target);if(t!==null){var a=po(t);if(a!==null){if(t=a.tag,t===13){if(t=ax(a),t!==null){e.blockedOn=t,px(e.priority,function(){cx(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Pl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=gf(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);df=r,a.target.dispatchEvent(r),df=null}else return t=li(a),t!==null&&Jf(t),e.blockedOn=a,!1;t.shift()}return!0}function Wh(e,t,a){Pl(e)&&a.delete(t)}function II(){hf=!1,mr!==null&&Pl(mr)&&(mr=null),hr!==null&&Pl(hr)&&(hr=null),gr!==null&&Pl(gr)&&(gr=null),js.forEach(Wh),Ks.forEach(Wh)}function ws(e,t){e.blockedOn===t&&(e.blockedOn=null,hf||(hf=!0,Nt.unstable_scheduleCallback(Nt.unstable_NormalPriority,II)))}function $s(e){function t(o){return ws(o,e)}if(0<pl.length){ws(pl[0],e);for(var a=1;a<pl.length;a++){var r=pl[a];r.blockedOn===e&&(r.blockedOn=null)}}for(mr!==null&&ws(mr,e),hr!==null&&ws(hr,e),gr!==null&&ws(gr,e),js.forEach(t),Ks.forEach(t),a=0;a<dr.length;a++)r=dr[a],r.blockedOn===e&&(r.blockedOn=null);for(;0<dr.length&&(a=dr[0],a.blockedOn===null);)mx(a),a.blockedOn===null&&dr.shift()}var Jo=qa.ReactCurrentBatchConfig,Hl=!0;function wI(e,t,a,r){var o=fe,n=Jo.transition;Jo.transition=null;try{fe=1,ep(e,t,a,r)}finally{fe=o,Jo.transition=n}}function kI(e,t,a,r){var o=fe,n=Jo.transition;Jo.transition=null;try{fe=4,ep(e,t,a,r)}finally{fe=o,Jo.transition=n}}function ep(e,t,a,r){if(Hl){var o=gf(e,t,a,r);if(o===null)_c(e,t,r,ql,a),qh(e,r);else if(SI(o,e,t,a,r))r.stopPropagation();else if(qh(e,r),t&4&&-1<CI.indexOf(e)){for(;o!==null;){var n=li(o);if(n!==null&&dx(n),n=gf(e,t,a,r),n===null&&_c(e,t,r,ql,a),n===o)break;o=n}o!==null&&r.stopPropagation()}else _c(e,t,r,null,a)}}var ql=null;function gf(e,t,a,r){if(ql=null,e=Qf(r),e=to(e),e!==null)if(t=po(e),t===null)e=null;else if(a=t.tag,a===13){if(e=ax(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return ql=e,null}function hx(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(fI()){case Yf:return 1;case sx:return 4;case _l:case pI:return 16;case ix:return 536870912;default:return 16}default:return 16}}var fr=null,tp=null,Tl=null;function gx(){if(Tl)return Tl;var e,t=tp,a=t.length,r,o="value"in fr?fr.value:fr.textContent,n=o.length;for(e=0;e<a&&t[e]===o[e];e++);var s=a-e;for(r=1;r<=s&&t[a-r]===o[n-r];r++);return Tl=o.slice(e,1<r?1-r:void 0)}function Al(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 ml(){return!0}function Gh(){return!1}function Et(e){function t(a,r,o,n,s){this._reactName=a,this._targetInst=o,this.type=r,this.nativeEvent=n,this.target=s,this.currentTarget=null;for(var i in e)e.hasOwnProperty(i)&&(a=e[i],this[i]=a?a(n):n[i]);return this.isDefaultPrevented=(n.defaultPrevented!=null?n.defaultPrevented:n.returnValue===!1)?ml:Gh,this.isPropagationStopped=Gh,this}return be(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=ml)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=ml)},persist:function(){},isPersistent:ml}),t}var dn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ap=Et(dn),ii=be({},dn,{view:0,detail:0}),bI=Et(ii),Ec,Fc,ks,lu=be({},ii,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rp,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!==ks&&(ks&&e.type==="mousemove"?(Ec=e.screenX-ks.screenX,Fc=e.screenY-ks.screenY):Fc=Ec=0,ks=e),Ec)},movementY:function(e){return"movementY"in e?e.movementY:Fc}}),jh=Et(lu),PI=be({},lu,{dataTransfer:0}),TI=Et(PI),AI=be({},ii,{relatedTarget:0}),Bc=Et(AI),RI=be({},dn,{animationName:0,elapsedTime:0,pseudoElement:0}),DI=Et(RI),MI=be({},dn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),NI=Et(MI),EI=be({},dn,{data:0}),Kh=Et(EI),FI={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},BI={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"},OI={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function VI(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=OI[e])?!!t[e]:!1}function rp(){return VI}var UI=be({},ii,{key:function(e){if(e.key){var t=FI[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Al(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?BI[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rp,charCode:function(e){return e.type==="keypress"?Al(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Al(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),_I=Et(UI),zI=be({},lu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$h=Et(zI),HI=be({},ii,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rp}),qI=Et(HI),WI=be({},dn,{propertyName:0,elapsedTime:0,pseudoElement:0}),GI=Et(WI),jI=be({},lu,{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}),KI=Et(jI),$I=[9,13,27,32],op=Ua&&"CompositionEvent"in window,Bs=null;Ua&&"documentMode"in document&&(Bs=document.documentMode);var XI=Ua&&"TextEvent"in window&&!Bs,xx=Ua&&(!op||Bs&&8<Bs&&11>=Bs),Xh=" ",Qh=!1;function yx(e,t){switch(e){case"keyup":return $I.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vx(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var _o=!1;function QI(e,t){switch(e){case"compositionend":return vx(t);case"keypress":return t.which!==32?null:(Qh=!0,Xh);case"textInput":return e=t.data,e===Xh&&Qh?null:e;default:return null}}function YI(e,t){if(_o)return e==="compositionend"||!op&&yx(e,t)?(e=gx(),Tl=tp=fr=null,_o=!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 xx&&t.locale!=="ko"?null:t.data;default:return null}}var ZI={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 Yh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ZI[e.type]:t==="textarea"}function Lx(e,t,a,r){Yg(r),t=Wl(t,"onChange"),0<t.length&&(a=new ap("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var Os=null,Xs=null;function JI(e){Dx(e,0)}function uu(e){var t=qo(e);if(Wg(t))return e}function ew(e,t){if(e==="change")return t}var Cx=!1;Ua&&(Ua?(gl="oninput"in document,gl||(Oc=document.createElement("div"),Oc.setAttribute("oninput","return;"),gl=typeof Oc.oninput=="function"),hl=gl):hl=!1,Cx=hl&&(!document.documentMode||9<document.documentMode));var hl,gl,Oc;function Zh(){Os&&(Os.detachEvent("onpropertychange",Sx),Xs=Os=null)}function Sx(e){if(e.propertyName==="value"&&uu(Xs)){var t=[];Lx(t,Xs,e,Qf(e)),tx(JI,t)}}function tw(e,t,a){e==="focusin"?(Zh(),Os=t,Xs=a,Os.attachEvent("onpropertychange",Sx)):e==="focusout"&&Zh()}function aw(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return uu(Xs)}function rw(e,t){if(e==="click")return uu(t)}function ow(e,t){if(e==="input"||e==="change")return uu(t)}function nw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ia=typeof Object.is=="function"?Object.is:nw;function Qs(e,t){if(ia(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),r=Object.keys(t);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var o=a[r];if(!Yc.call(t,o)||!ia(e[o],t[o]))return!1}return!0}function Jh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function eg(e,t){var a=Jh(e);e=0;for(var r;a;){if(a.nodeType===3){if(r=e+a.textContent.length,e<=t&&r>=t)return{node:a,offset:t-e};e=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Jh(a)}}function Ix(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ix(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wx(){for(var e=window,t=Ol();t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Ol(e.document)}return t}function np(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 sw(e){var t=wx(),a=e.focusedElem,r=e.selectionRange;if(t!==a&&a&&a.ownerDocument&&Ix(a.ownerDocument.documentElement,a)){if(r!==null&&np(a)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in a)a.selectionStart=t,a.selectionEnd=Math.min(e,a.value.length);else if(e=(t=a.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=a.textContent.length,n=Math.min(r.start,o);r=r.end===void 0?n:Math.min(r.end,o),!e.extend&&n>r&&(o=r,r=n,n=o),o=eg(a,n);var s=eg(a,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),n>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=a;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof a.focus=="function"&&a.focus(),a=0;a<t.length;a++)e=t[a],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var iw=Ua&&"documentMode"in document&&11>=document.documentMode,zo=null,xf=null,Vs=null,yf=!1;function tg(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;yf||zo==null||zo!==Ol(r)||(r=zo,"selectionStart"in r&&np(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}),Vs&&Qs(Vs,r)||(Vs=r,r=Wl(xf,"onSelect"),0<r.length&&(t=new ap("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=zo)))}function xl(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Ho={animationend:xl("Animation","AnimationEnd"),animationiteration:xl("Animation","AnimationIteration"),animationstart:xl("Animation","AnimationStart"),transitionend:xl("Transition","TransitionEnd")},Vc={},kx={};Ua&&(kx=document.createElement("div").style,"AnimationEvent"in window||(delete Ho.animationend.animation,delete Ho.animationiteration.animation,delete Ho.animationstart.animation),"TransitionEvent"in window||delete Ho.transitionend.transition);function du(e){if(Vc[e])return Vc[e];if(!Ho[e])return e;var t=Ho[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in kx)return Vc[e]=t[a];return e}var bx=du("animationend"),Px=du("animationiteration"),Tx=du("animationstart"),Ax=du("transitionend"),Rx=new Map,ag="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 wr(e,t){Rx.set(e,t),fo(t,[e])}for(yl=0;yl<ag.length;yl++)vl=ag[yl],rg=vl.toLowerCase(),og=vl[0].toUpperCase()+vl.slice(1),wr(rg,"on"+og);var vl,rg,og,yl;wr(bx,"onAnimationEnd");wr(Px,"onAnimationIteration");wr(Tx,"onAnimationStart");wr("dblclick","onDoubleClick");wr("focusin","onFocus");wr("focusout","onBlur");wr(Ax,"onTransitionEnd");an("onMouseEnter",["mouseout","mouseover"]);an("onMouseLeave",["mouseout","mouseover"]);an("onPointerEnter",["pointerout","pointerover"]);an("onPointerLeave",["pointerout","pointerover"]);fo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));fo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));fo("onBeforeInput",["compositionend","keypress","textInput","paste"]);fo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));fo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));fo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ns="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(" "),lw=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ns));function ng(e,t,a){var r=e.type||"unknown-event";e.currentTarget=a,lI(r,t,void 0,e),e.currentTarget=null}function Dx(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var r=e[a],o=r.event;r=r.listeners;e:{var n=void 0;if(t)for(var s=r.length-1;0<=s;s--){var i=r[s],l=i.instance,u=i.currentTarget;if(i=i.listener,l!==n&&o.isPropagationStopped())break e;ng(o,i,u),n=l}else for(s=0;s<r.length;s++){if(i=r[s],l=i.instance,u=i.currentTarget,i=i.listener,l!==n&&o.isPropagationStopped())break e;ng(o,i,u),n=l}}}if(Ul)throw e=pf,Ul=!1,pf=null,e}function ye(e,t){var a=t[If];a===void 0&&(a=t[If]=new Set);var r=e+"__bubble";a.has(r)||(Mx(t,e,2,!1),a.add(r))}function Uc(e,t,a){var r=0;t&&(r|=4),Mx(a,e,r,t)}var Ll="_reactListening"+Math.random().toString(36).slice(2);function Ys(e){if(!e[Ll]){e[Ll]=!0,Ug.forEach(function(a){a!=="selectionchange"&&(lw.has(a)||Uc(a,!1,e),Uc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ll]||(t[Ll]=!0,Uc("selectionchange",!1,t))}}function Mx(e,t,a,r){switch(hx(t)){case 1:var o=wI;break;case 4:o=kI;break;default:o=ep}a=o.bind(null,t,a,e),o=void 0,!ff||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,a,{capture:!0,passive:o}):e.addEventListener(t,a,!0):o!==void 0?e.addEventListener(t,a,{passive:o}):e.addEventListener(t,a,!1)}function _c(e,t,a,r,o){var n=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var i=r.stateNode.containerInfo;if(i===o||i.nodeType===8&&i.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===o||l.nodeType===8&&l.parentNode===o))return;s=s.return}for(;i!==null;){if(s=to(i),s===null)return;if(l=s.tag,l===5||l===6){r=n=s;continue e}i=i.parentNode}}r=r.return}tx(function(){var u=n,d=Qf(a),c=[];e:{var p=Rx.get(e);if(p!==void 0){var g=ap,L=e;switch(e){case"keypress":if(Al(a)===0)break e;case"keydown":case"keyup":g=_I;break;case"focusin":L="focus",g=Bc;break;case"focusout":L="blur",g=Bc;break;case"beforeblur":case"afterblur":g=Bc;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=jh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=TI;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=qI;break;case bx:case Px:case Tx:g=DI;break;case Ax:g=GI;break;case"scroll":g=bI;break;case"wheel":g=KI;break;case"copy":case"cut":case"paste":g=NI;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=$h}var C=(t&4)!==0,w=!C&&e==="scroll",h=C?p!==null?p+"Capture":null:p;C=[];for(var m=u,x;m!==null;){x=m;var S=x.stateNode;if(x.tag===5&&S!==null&&(x=S,h!==null&&(S=Gs(m,h),S!=null&&C.push(Zs(m,S,x)))),w)break;m=m.return}0<C.length&&(p=new g(p,L,null,a,d),c.push({event:p,listeners:C}))}}if((t&7)===0){e:{if(p=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",p&&a!==df&&(L=a.relatedTarget||a.fromElement)&&(to(L)||L[_a]))break e;if((g||p)&&(p=d.window===d?d:(p=d.ownerDocument)?p.defaultView||p.parentWindow:window,g?(L=a.relatedTarget||a.toElement,g=u,L=L?to(L):null,L!==null&&(w=po(L),L!==w||L.tag!==5&&L.tag!==6)&&(L=null)):(g=null,L=u),g!==L)){if(C=jh,S="onMouseLeave",h="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(C=$h,S="onPointerLeave",h="onPointerEnter",m="pointer"),w=g==null?p:qo(g),x=L==null?p:qo(L),p=new C(S,m+"leave",g,a,d),p.target=w,p.relatedTarget=x,S=null,to(d)===u&&(C=new C(h,m+"enter",L,a,d),C.target=x,C.relatedTarget=w,S=C),w=S,g&&L)t:{for(C=g,h=L,m=0,x=C;x;x=Oo(x))m++;for(x=0,S=h;S;S=Oo(S))x++;for(;0<m-x;)C=Oo(C),m--;for(;0<x-m;)h=Oo(h),x--;for(;m--;){if(C===h||h!==null&&C===h.alternate)break t;C=Oo(C),h=Oo(h)}C=null}else C=null;g!==null&&sg(c,p,g,C,!1),L!==null&&w!==null&&sg(c,w,L,C,!0)}}e:{if(p=u?qo(u):window,g=p.nodeName&&p.nodeName.toLowerCase(),g==="select"||g==="input"&&p.type==="file")var k=ew;else if(Yh(p))if(Cx)k=ow;else{k=aw;var A=tw}else(g=p.nodeName)&&g.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(k=rw);if(k&&(k=k(e,u))){Lx(c,k,a,d);break e}A&&A(e,p,u),e==="focusout"&&(A=p._wrapperState)&&A.controlled&&p.type==="number"&&of(p,"number",p.value)}switch(A=u?qo(u):window,e){case"focusin":(Yh(A)||A.contentEditable==="true")&&(zo=A,xf=u,Vs=null);break;case"focusout":Vs=xf=zo=null;break;case"mousedown":yf=!0;break;case"contextmenu":case"mouseup":case"dragend":yf=!1,tg(c,a,d);break;case"selectionchange":if(iw)break;case"keydown":case"keyup":tg(c,a,d)}var P;if(op)e:{switch(e){case"compositionstart":var R="onCompositionStart";break e;case"compositionend":R="onCompositionEnd";break e;case"compositionupdate":R="onCompositionUpdate";break e}R=void 0}else _o?yx(e,a)&&(R="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(R="onCompositionStart");R&&(xx&&a.locale!=="ko"&&(_o||R!=="onCompositionStart"?R==="onCompositionEnd"&&_o&&(P=gx()):(fr=d,tp="value"in fr?fr.value:fr.textContent,_o=!0)),A=Wl(u,R),0<A.length&&(R=new Kh(R,e,null,a,d),c.push({event:R,listeners:A}),P?R.data=P:(P=vx(a),P!==null&&(R.data=P)))),(P=XI?QI(e,a):YI(e,a))&&(u=Wl(u,"onBeforeInput"),0<u.length&&(d=new Kh("onBeforeInput","beforeinput",null,a,d),c.push({event:d,listeners:u}),d.data=P))}Dx(c,t)})}function Zs(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Wl(e,t){for(var a=t+"Capture",r=[];e!==null;){var o=e,n=o.stateNode;o.tag===5&&n!==null&&(o=n,n=Gs(e,a),n!=null&&r.unshift(Zs(e,n,o)),n=Gs(e,t),n!=null&&r.push(Zs(e,n,o))),e=e.return}return r}function Oo(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function sg(e,t,a,r,o){for(var n=t._reactName,s=[];a!==null&&a!==r;){var i=a,l=i.alternate,u=i.stateNode;if(l!==null&&l===r)break;i.tag===5&&u!==null&&(i=u,o?(l=Gs(a,n),l!=null&&s.unshift(Zs(a,l,i))):o||(l=Gs(a,n),l!=null&&s.push(Zs(a,l,i)))),a=a.return}s.length!==0&&e.push({event:t,listeners:s})}var uw=/\r\n?/g,dw=/\u0000|\uFFFD/g;function ig(e){return(typeof e=="string"?e:""+e).replace(uw,`
|
|
6
|
+
`).replace(dw,"")}function Cl(e,t,a){if(t=ig(t),ig(e)!==t&&a)throw Error(D(425))}function Gl(){}var vf=null,Lf=null;function Cf(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 Sf=typeof setTimeout=="function"?setTimeout:void 0,cw=typeof clearTimeout=="function"?clearTimeout:void 0,lg=typeof Promise=="function"?Promise:void 0,fw=typeof queueMicrotask=="function"?queueMicrotask:typeof lg<"u"?function(e){return lg.resolve(null).then(e).catch(pw)}:Sf;function pw(e){setTimeout(function(){throw e})}function zc(e,t){var a=t,r=0;do{var o=a.nextSibling;if(e.removeChild(a),o&&o.nodeType===8)if(a=o.data,a==="/$"){if(r===0){e.removeChild(o),$s(t);return}r--}else a!=="$"&&a!=="$?"&&a!=="$!"||r++;a=o}while(a);$s(t)}function xr(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 ug(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"){if(t===0)return e;t--}else a==="/$"&&t++}e=e.previousSibling}return null}var cn=Math.random().toString(36).slice(2),xa="__reactFiber$"+cn,Js="__reactProps$"+cn,_a="__reactContainer$"+cn,If="__reactEvents$"+cn,mw="__reactListeners$"+cn,hw="__reactHandles$"+cn;function to(e){var t=e[xa];if(t)return t;for(var a=e.parentNode;a;){if(t=a[_a]||a[xa]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=ug(e);e!==null;){if(a=e[xa])return a;e=ug(e)}return t}e=a,a=e.parentNode}return null}function li(e){return e=e[xa]||e[_a],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function qo(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(D(33))}function cu(e){return e[Js]||null}var wf=[],Wo=-1;function kr(e){return{current:e}}function ve(e){0>Wo||(e.current=wf[Wo],wf[Wo]=null,Wo--)}function ge(e,t){Wo++,wf[Wo]=e.current,e.current=t}var Ir={},st=kr(Ir),Lt=kr(!1),so=Ir;function rn(e,t){var a=e.type.contextTypes;if(!a)return Ir;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},n;for(n in a)o[n]=t[n];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ct(e){return e=e.childContextTypes,e!=null}function jl(){ve(Lt),ve(st)}function dg(e,t,a){if(st.current!==Ir)throw Error(D(168));ge(st,t),ge(Lt,a)}function Nx(e,t,a){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return a;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(D(108,tI(e)||"Unknown",o));return be({},a,r)}function Kl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ir,so=st.current,ge(st,e),ge(Lt,Lt.current),!0}function cg(e,t,a){var r=e.stateNode;if(!r)throw Error(D(169));a?(e=Nx(e,t,so),r.__reactInternalMemoizedMergedChildContext=e,ve(Lt),ve(st),ge(st,e)):ve(Lt),ge(Lt,a)}var Fa=null,fu=!1,Hc=!1;function Ex(e){Fa===null?Fa=[e]:Fa.push(e)}function gw(e){fu=!0,Ex(e)}function br(){if(!Hc&&Fa!==null){Hc=!0;var e=0,t=fe;try{var a=Fa;for(fe=1;e<a.length;e++){var r=a[e];do r=r(!0);while(r!==null)}Fa=null,fu=!1}catch(o){throw Fa!==null&&(Fa=Fa.slice(e+1)),nx(Yf,br),o}finally{fe=t,Hc=!1}}return null}var Go=[],jo=0,$l=null,Xl=0,Gt=[],jt=0,io=null,Ba=1,Oa="";function Jr(e,t){Go[jo++]=Xl,Go[jo++]=$l,$l=e,Xl=t}function Fx(e,t,a){Gt[jt++]=Ba,Gt[jt++]=Oa,Gt[jt++]=io,io=e;var r=Ba;e=Oa;var o=32-na(r)-1;r&=~(1<<o),a+=1;var n=32-na(t)+o;if(30<n){var s=o-o%5;n=(r&(1<<s)-1).toString(32),r>>=s,o-=s,Ba=1<<32-na(t)+o|a<<o|r,Oa=n+e}else Ba=1<<n|a<<o|r,Oa=e}function sp(e){e.return!==null&&(Jr(e,1),Fx(e,1,0))}function ip(e){for(;e===$l;)$l=Go[--jo],Go[jo]=null,Xl=Go[--jo],Go[jo]=null;for(;e===io;)io=Gt[--jt],Gt[jt]=null,Oa=Gt[--jt],Gt[jt]=null,Ba=Gt[--jt],Gt[jt]=null}var Mt=null,Dt=null,Ie=!1,oa=null;function Bx(e,t){var a=Kt(5,null,null,0);a.elementType="DELETED",a.stateNode=t,a.return=e,t=e.deletions,t===null?(e.deletions=[a],e.flags|=16):t.push(a)}function fg(e,t){switch(e.tag){case 5:var a=e.type;return t=t.nodeType!==1||a.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Mt=e,Dt=xr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Mt=e,Dt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(a=io!==null?{id:Ba,overflow:Oa}:null,e.memoizedState={dehydrated:t,treeContext:a,retryLane:1073741824},a=Kt(18,null,null,0),a.stateNode=t,a.return=e,e.child=a,Mt=e,Dt=null,!0):!1;default:return!1}}function kf(e){return(e.mode&1)!==0&&(e.flags&128)===0}function bf(e){if(Ie){var t=Dt;if(t){var a=t;if(!fg(e,t)){if(kf(e))throw Error(D(418));t=xr(a.nextSibling);var r=Mt;t&&fg(e,t)?Bx(r,a):(e.flags=e.flags&-4097|2,Ie=!1,Mt=e)}}else{if(kf(e))throw Error(D(418));e.flags=e.flags&-4097|2,Ie=!1,Mt=e}}}function pg(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Mt=e}function Sl(e){if(e!==Mt)return!1;if(!Ie)return pg(e),Ie=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Cf(e.type,e.memoizedProps)),t&&(t=Dt)){if(kf(e))throw Ox(),Error(D(418));for(;t;)Bx(e,t),t=xr(t.nextSibling)}if(pg(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(D(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"){if(t===0){Dt=xr(e.nextSibling);break e}t--}else a!=="$"&&a!=="$!"&&a!=="$?"||t++}e=e.nextSibling}Dt=null}}else Dt=Mt?xr(e.stateNode.nextSibling):null;return!0}function Ox(){for(var e=Dt;e;)e=xr(e.nextSibling)}function on(){Dt=Mt=null,Ie=!1}function lp(e){oa===null?oa=[e]:oa.push(e)}var xw=qa.ReactCurrentBatchConfig;function bs(e,t,a){if(e=a.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(a._owner){if(a=a._owner,a){if(a.tag!==1)throw Error(D(309));var r=a.stateNode}if(!r)throw Error(D(147,e));var o=r,n=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===n?t.ref:(t=function(s){var i=o.refs;s===null?delete i[n]:i[n]=s},t._stringRef=n,t)}if(typeof e!="string")throw Error(D(284));if(!a._owner)throw Error(D(290,e))}return e}function Il(e,t){throw e=Object.prototype.toString.call(t),Error(D(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function mg(e){var t=e._init;return t(e._payload)}function Vx(e){function t(h,m){if(e){var x=h.deletions;x===null?(h.deletions=[m],h.flags|=16):x.push(m)}}function a(h,m){if(!e)return null;for(;m!==null;)t(h,m),m=m.sibling;return null}function r(h,m){for(h=new Map;m!==null;)m.key!==null?h.set(m.key,m):h.set(m.index,m),m=m.sibling;return h}function o(h,m){return h=Cr(h,m),h.index=0,h.sibling=null,h}function n(h,m,x){return h.index=x,e?(x=h.alternate,x!==null?(x=x.index,x<m?(h.flags|=2,m):x):(h.flags|=2,m)):(h.flags|=1048576,m)}function s(h){return e&&h.alternate===null&&(h.flags|=2),h}function i(h,m,x,S){return m===null||m.tag!==6?(m=Xc(x,h.mode,S),m.return=h,m):(m=o(m,x),m.return=h,m)}function l(h,m,x,S){var k=x.type;return k===Uo?d(h,m,x.props.children,S,x.key):m!==null&&(m.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===lr&&mg(k)===m.type)?(S=o(m,x.props),S.ref=bs(h,m,x),S.return=h,S):(S=Bl(x.type,x.key,x.props,null,h.mode,S),S.ref=bs(h,m,x),S.return=h,S)}function u(h,m,x,S){return m===null||m.tag!==4||m.stateNode.containerInfo!==x.containerInfo||m.stateNode.implementation!==x.implementation?(m=Qc(x,h.mode,S),m.return=h,m):(m=o(m,x.children||[]),m.return=h,m)}function d(h,m,x,S,k){return m===null||m.tag!==7?(m=no(x,h.mode,S,k),m.return=h,m):(m=o(m,x),m.return=h,m)}function c(h,m,x){if(typeof m=="string"&&m!==""||typeof m=="number")return m=Xc(""+m,h.mode,x),m.return=h,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case ll:return x=Bl(m.type,m.key,m.props,null,h.mode,x),x.ref=bs(h,null,m),x.return=h,x;case Vo:return m=Qc(m,h.mode,x),m.return=h,m;case lr:var S=m._init;return c(h,S(m._payload),x)}if(Ds(m)||Ss(m))return m=no(m,h.mode,x,null),m.return=h,m;Il(h,m)}return null}function p(h,m,x,S){var k=m!==null?m.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return k!==null?null:i(h,m,""+x,S);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case ll:return x.key===k?l(h,m,x,S):null;case Vo:return x.key===k?u(h,m,x,S):null;case lr:return k=x._init,p(h,m,k(x._payload),S)}if(Ds(x)||Ss(x))return k!==null?null:d(h,m,x,S,null);Il(h,x)}return null}function g(h,m,x,S,k){if(typeof S=="string"&&S!==""||typeof S=="number")return h=h.get(x)||null,i(m,h,""+S,k);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case ll:return h=h.get(S.key===null?x:S.key)||null,l(m,h,S,k);case Vo:return h=h.get(S.key===null?x:S.key)||null,u(m,h,S,k);case lr:var A=S._init;return g(h,m,x,A(S._payload),k)}if(Ds(S)||Ss(S))return h=h.get(x)||null,d(m,h,S,k,null);Il(m,S)}return null}function L(h,m,x,S){for(var k=null,A=null,P=m,R=m=0,M=null;P!==null&&R<x.length;R++){P.index>R?(M=P,P=null):M=P.sibling;var O=p(h,P,x[R],S);if(O===null){P===null&&(P=M);break}e&&P&&O.alternate===null&&t(h,P),m=n(O,m,R),A===null?k=O:A.sibling=O,A=O,P=M}if(R===x.length)return a(h,P),Ie&&Jr(h,R),k;if(P===null){for(;R<x.length;R++)P=c(h,x[R],S),P!==null&&(m=n(P,m,R),A===null?k=P:A.sibling=P,A=P);return Ie&&Jr(h,R),k}for(P=r(h,P);R<x.length;R++)M=g(P,h,R,x[R],S),M!==null&&(e&&M.alternate!==null&&P.delete(M.key===null?R:M.key),m=n(M,m,R),A===null?k=M:A.sibling=M,A=M);return e&&P.forEach(function(pe){return t(h,pe)}),Ie&&Jr(h,R),k}function C(h,m,x,S){var k=Ss(x);if(typeof k!="function")throw Error(D(150));if(x=k.call(x),x==null)throw Error(D(151));for(var A=k=null,P=m,R=m=0,M=null,O=x.next();P!==null&&!O.done;R++,O=x.next()){P.index>R?(M=P,P=null):M=P.sibling;var pe=p(h,P,O.value,S);if(pe===null){P===null&&(P=M);break}e&&P&&pe.alternate===null&&t(h,P),m=n(pe,m,R),A===null?k=pe:A.sibling=pe,A=pe,P=M}if(O.done)return a(h,P),Ie&&Jr(h,R),k;if(P===null){for(;!O.done;R++,O=x.next())O=c(h,O.value,S),O!==null&&(m=n(O,m,R),A===null?k=O:A.sibling=O,A=O);return Ie&&Jr(h,R),k}for(P=r(h,P);!O.done;R++,O=x.next())O=g(P,h,R,O.value,S),O!==null&&(e&&O.alternate!==null&&P.delete(O.key===null?R:O.key),m=n(O,m,R),A===null?k=O:A.sibling=O,A=O);return e&&P.forEach(function(se){return t(h,se)}),Ie&&Jr(h,R),k}function w(h,m,x,S){if(typeof x=="object"&&x!==null&&x.type===Uo&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case ll:e:{for(var k=x.key,A=m;A!==null;){if(A.key===k){if(k=x.type,k===Uo){if(A.tag===7){a(h,A.sibling),m=o(A,x.props.children),m.return=h,h=m;break e}}else if(A.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===lr&&mg(k)===A.type){a(h,A.sibling),m=o(A,x.props),m.ref=bs(h,A,x),m.return=h,h=m;break e}a(h,A);break}else t(h,A);A=A.sibling}x.type===Uo?(m=no(x.props.children,h.mode,S,x.key),m.return=h,h=m):(S=Bl(x.type,x.key,x.props,null,h.mode,S),S.ref=bs(h,m,x),S.return=h,h=S)}return s(h);case Vo:e:{for(A=x.key;m!==null;){if(m.key===A)if(m.tag===4&&m.stateNode.containerInfo===x.containerInfo&&m.stateNode.implementation===x.implementation){a(h,m.sibling),m=o(m,x.children||[]),m.return=h,h=m;break e}else{a(h,m);break}else t(h,m);m=m.sibling}m=Qc(x,h.mode,S),m.return=h,h=m}return s(h);case lr:return A=x._init,w(h,m,A(x._payload),S)}if(Ds(x))return L(h,m,x,S);if(Ss(x))return C(h,m,x,S);Il(h,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,m!==null&&m.tag===6?(a(h,m.sibling),m=o(m,x),m.return=h,h=m):(a(h,m),m=Xc(x,h.mode,S),m.return=h,h=m),s(h)):a(h,m)}return w}var nn=Vx(!0),Ux=Vx(!1),Ql=kr(null),Yl=null,Ko=null,up=null;function dp(){up=Ko=Yl=null}function cp(e){var t=Ql.current;ve(Ql),e._currentValue=t}function Pf(e,t,a){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===a)break;e=e.return}}function en(e,t){Yl=e,up=Ko=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(vt=!0),e.firstContext=null)}function Xt(e){var t=e._currentValue;if(up!==e)if(e={context:e,memoizedValue:t,next:null},Ko===null){if(Yl===null)throw Error(D(308));Ko=e,Yl.dependencies={lanes:0,firstContext:e}}else Ko=Ko.next=e;return t}var ao=null;function fp(e){ao===null?ao=[e]:ao.push(e)}function _x(e,t,a,r){var o=t.interleaved;return o===null?(a.next=a,fp(t)):(a.next=o.next,o.next=a),t.interleaved=a,za(e,r)}function za(e,t){e.lanes|=t;var a=e.alternate;for(a!==null&&(a.lanes|=t),a=e,e=e.return;e!==null;)e.childLanes|=t,a=e.alternate,a!==null&&(a.childLanes|=t),a=e,e=e.return;return a.tag===3?a.stateNode:null}var ur=!1;function pp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function zx(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 Va(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function yr(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(ie&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,za(e,a)}return o=r.interleaved,o===null?(t.next=t,fp(r)):(t.next=o.next,o.next=t),r.interleaved=t,za(e,a)}function Rl(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,Zf(e,a)}}function hg(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var o=null,n=null;if(a=a.firstBaseUpdate,a!==null){do{var s={eventTime:a.eventTime,lane:a.lane,tag:a.tag,payload:a.payload,callback:a.callback,next:null};n===null?o=n=s:n=n.next=s,a=a.next}while(a!==null);n===null?o=n=t:n=n.next=t}else o=n=t;a={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:n,shared:r.shared,effects:r.effects},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}function Zl(e,t,a,r){var o=e.updateQueue;ur=!1;var n=o.firstBaseUpdate,s=o.lastBaseUpdate,i=o.shared.pending;if(i!==null){o.shared.pending=null;var l=i,u=l.next;l.next=null,s===null?n=u:s.next=u,s=l;var d=e.alternate;d!==null&&(d=d.updateQueue,i=d.lastBaseUpdate,i!==s&&(i===null?d.firstBaseUpdate=u:i.next=u,d.lastBaseUpdate=l))}if(n!==null){var c=o.baseState;s=0,d=u=l=null,i=n;do{var p=i.lane,g=i.eventTime;if((r&p)===p){d!==null&&(d=d.next={eventTime:g,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var L=e,C=i;switch(p=t,g=a,C.tag){case 1:if(L=C.payload,typeof L=="function"){c=L.call(g,c,p);break e}c=L;break e;case 3:L.flags=L.flags&-65537|128;case 0:if(L=C.payload,p=typeof L=="function"?L.call(g,c,p):L,p==null)break e;c=be({},c,p);break e;case 2:ur=!0}}i.callback!==null&&i.lane!==0&&(e.flags|=64,p=o.effects,p===null?o.effects=[i]:p.push(i))}else g={eventTime:g,lane:p,tag:i.tag,payload:i.payload,callback:i.callback,next:null},d===null?(u=d=g,l=c):d=d.next=g,s|=p;if(i=i.next,i===null){if(i=o.shared.pending,i===null)break;p=i,i=p.next,p.next=null,o.lastBaseUpdate=p,o.shared.pending=null}}while(!0);if(d===null&&(l=c),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=d,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else n===null&&(o.shared.lanes=0);uo|=s,e.lanes=s,e.memoizedState=c}}function gg(e,t,a){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=a,typeof o!="function")throw Error(D(191,o));o.call(r)}}}var ui={},va=kr(ui),ei=kr(ui),ti=kr(ui);function ro(e){if(e===ui)throw Error(D(174));return e}function mp(e,t){switch(ge(ti,t),ge(ei,e),ge(va,ui),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:sf(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=sf(t,e)}ve(va),ge(va,t)}function sn(){ve(va),ve(ei),ve(ti)}function Hx(e){ro(ti.current);var t=ro(va.current),a=sf(t,e.type);t!==a&&(ge(ei,e),ge(va,a))}function hp(e){ei.current===e&&(ve(va),ve(ei))}var we=kr(0);function Jl(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||a.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var qc=[];function gp(){for(var e=0;e<qc.length;e++)qc[e]._workInProgressVersionPrimary=null;qc.length=0}var Dl=qa.ReactCurrentDispatcher,Wc=qa.ReactCurrentBatchConfig,lo=0,ke=null,Ve=null,We=null,eu=!1,Us=!1,ai=0,yw=0;function rt(){throw Error(D(321))}function xp(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!ia(e[a],t[a]))return!1;return!0}function yp(e,t,a,r,o,n){if(lo=n,ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Dl.current=e===null||e.memoizedState===null?Sw:Iw,e=a(r,o),Us){n=0;do{if(Us=!1,ai=0,25<=n)throw Error(D(301));n+=1,We=Ve=null,t.updateQueue=null,Dl.current=ww,e=a(r,o)}while(Us)}if(Dl.current=tu,t=Ve!==null&&Ve.next!==null,lo=0,We=Ve=ke=null,eu=!1,t)throw Error(D(300));return e}function vp(){var e=ai!==0;return ai=0,e}function ga(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return We===null?ke.memoizedState=We=e:We=We.next=e,We}function Qt(){if(Ve===null){var e=ke.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=We===null?ke.memoizedState:We.next;if(t!==null)We=t,Ve=e;else{if(e===null)throw Error(D(310));Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},We===null?ke.memoizedState=We=e:We=We.next=e}return We}function ri(e,t){return typeof t=="function"?t(e):t}function Gc(e){var t=Qt(),a=t.queue;if(a===null)throw Error(D(311));a.lastRenderedReducer=e;var r=Ve,o=r.baseQueue,n=a.pending;if(n!==null){if(o!==null){var s=o.next;o.next=n.next,n.next=s}r.baseQueue=o=n,a.pending=null}if(o!==null){n=o.next,r=r.baseState;var i=s=null,l=null,u=n;do{var d=u.lane;if((lo&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var c={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(i=l=c,s=r):l=l.next=c,ke.lanes|=d,uo|=d}u=u.next}while(u!==null&&u!==n);l===null?s=r:l.next=i,ia(r,t.memoizedState)||(vt=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,a.lastRenderedState=r}if(e=a.interleaved,e!==null){o=e;do n=o.lane,ke.lanes|=n,uo|=n,o=o.next;while(o!==e)}else o===null&&(a.lanes=0);return[t.memoizedState,a.dispatch]}function jc(e){var t=Qt(),a=t.queue;if(a===null)throw Error(D(311));a.lastRenderedReducer=e;var r=a.dispatch,o=a.pending,n=t.memoizedState;if(o!==null){a.pending=null;var s=o=o.next;do n=e(n,s.action),s=s.next;while(s!==o);ia(n,t.memoizedState)||(vt=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),a.lastRenderedState=n}return[n,r]}function qx(){}function Wx(e,t){var a=ke,r=Qt(),o=t(),n=!ia(r.memoizedState,o);if(n&&(r.memoizedState=o,vt=!0),r=r.queue,Lp(Kx.bind(null,a,r,e),[e]),r.getSnapshot!==t||n||We!==null&&We.memoizedState.tag&1){if(a.flags|=2048,oi(9,jx.bind(null,a,r,o,t),void 0,null),Ge===null)throw Error(D(349));(lo&30)!==0||Gx(a,t,o)}return o}function Gx(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=ke.updateQueue,t===null?(t={lastEffect:null,stores:null},ke.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function jx(e,t,a,r){t.value=a,t.getSnapshot=r,$x(t)&&Xx(e)}function Kx(e,t,a){return a(function(){$x(t)&&Xx(e)})}function $x(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!ia(e,a)}catch{return!0}}function Xx(e){var t=za(e,1);t!==null&&sa(t,e,1,-1)}function xg(e){var t=ga();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ri,lastRenderedState:e},t.queue=e,e=e.dispatch=Cw.bind(null,ke,e),[t.memoizedState,e]}function oi(e,t,a,r){return e={tag:e,create:t,destroy:a,deps:r,next:null},t=ke.updateQueue,t===null?(t={lastEffect:null,stores:null},ke.updateQueue=t,t.lastEffect=e.next=e):(a=t.lastEffect,a===null?t.lastEffect=e.next=e:(r=a.next,a.next=e,e.next=r,t.lastEffect=e)),e}function Qx(){return Qt().memoizedState}function Ml(e,t,a,r){var o=ga();ke.flags|=e,o.memoizedState=oi(1|t,a,void 0,r===void 0?null:r)}function pu(e,t,a,r){var o=Qt();r=r===void 0?null:r;var n=void 0;if(Ve!==null){var s=Ve.memoizedState;if(n=s.destroy,r!==null&&xp(r,s.deps)){o.memoizedState=oi(t,a,n,r);return}}ke.flags|=e,o.memoizedState=oi(1|t,a,n,r)}function yg(e,t){return Ml(8390656,8,e,t)}function Lp(e,t){return pu(2048,8,e,t)}function Yx(e,t){return pu(4,2,e,t)}function Zx(e,t){return pu(4,4,e,t)}function Jx(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 ey(e,t,a){return a=a!=null?a.concat([e]):null,pu(4,4,Jx.bind(null,t,e),a)}function Cp(){}function ty(e,t){var a=Qt();t=t===void 0?null:t;var r=a.memoizedState;return r!==null&&t!==null&&xp(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function ay(e,t){var a=Qt();t=t===void 0?null:t;var r=a.memoizedState;return r!==null&&t!==null&&xp(t,r[1])?r[0]:(e=e(),a.memoizedState=[e,t],e)}function ry(e,t,a){return(lo&21)===0?(e.baseState&&(e.baseState=!1,vt=!0),e.memoizedState=a):(ia(a,t)||(a=lx(),ke.lanes|=a,uo|=a,e.baseState=!0),t)}function vw(e,t){var a=fe;fe=a!==0&&4>a?a:4,e(!0);var r=Wc.transition;Wc.transition={};try{e(!1),t()}finally{fe=a,Wc.transition=r}}function oy(){return Qt().memoizedState}function Lw(e,t,a){var r=Lr(e);if(a={lane:r,action:a,hasEagerState:!1,eagerState:null,next:null},ny(e))sy(t,a);else if(a=_x(e,t,a,r),a!==null){var o=pt();sa(a,e,r,o),iy(a,t,r)}}function Cw(e,t,a){var r=Lr(e),o={lane:r,action:a,hasEagerState:!1,eagerState:null,next:null};if(ny(e))sy(t,o);else{var n=e.alternate;if(e.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var s=t.lastRenderedState,i=n(s,a);if(o.hasEagerState=!0,o.eagerState=i,ia(i,s)){var l=t.interleaved;l===null?(o.next=o,fp(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}a=_x(e,t,o,r),a!==null&&(o=pt(),sa(a,e,r,o),iy(a,t,r))}}function ny(e){var t=e.alternate;return e===ke||t!==null&&t===ke}function sy(e,t){Us=eu=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function iy(e,t,a){if((a&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,Zf(e,a)}}var tu={readContext:Xt,useCallback:rt,useContext:rt,useEffect:rt,useImperativeHandle:rt,useInsertionEffect:rt,useLayoutEffect:rt,useMemo:rt,useReducer:rt,useRef:rt,useState:rt,useDebugValue:rt,useDeferredValue:rt,useTransition:rt,useMutableSource:rt,useSyncExternalStore:rt,useId:rt,unstable_isNewReconciler:!1},Sw={readContext:Xt,useCallback:function(e,t){return ga().memoizedState=[e,t===void 0?null:t],e},useContext:Xt,useEffect:yg,useImperativeHandle:function(e,t,a){return a=a!=null?a.concat([e]):null,Ml(4194308,4,Jx.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Ml(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ml(4,2,e,t)},useMemo:function(e,t){var a=ga();return t=t===void 0?null:t,e=e(),a.memoizedState=[e,t],e},useReducer:function(e,t,a){var r=ga();return t=a!==void 0?a(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=Lw.bind(null,ke,e),[r.memoizedState,e]},useRef:function(e){var t=ga();return e={current:e},t.memoizedState=e},useState:xg,useDebugValue:Cp,useDeferredValue:function(e){return ga().memoizedState=e},useTransition:function(){var e=xg(!1),t=e[0];return e=vw.bind(null,e[1]),ga().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,a){var r=ke,o=ga();if(Ie){if(a===void 0)throw Error(D(407));a=a()}else{if(a=t(),Ge===null)throw Error(D(349));(lo&30)!==0||Gx(r,t,a)}o.memoizedState=a;var n={value:a,getSnapshot:t};return o.queue=n,yg(Kx.bind(null,r,n,e),[e]),r.flags|=2048,oi(9,jx.bind(null,r,n,a,t),void 0,null),a},useId:function(){var e=ga(),t=Ge.identifierPrefix;if(Ie){var a=Oa,r=Ba;a=(r&~(1<<32-na(r)-1)).toString(32)+a,t=":"+t+"R"+a,a=ai++,0<a&&(t+="H"+a.toString(32)),t+=":"}else a=yw++,t=":"+t+"r"+a.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Iw={readContext:Xt,useCallback:ty,useContext:Xt,useEffect:Lp,useImperativeHandle:ey,useInsertionEffect:Yx,useLayoutEffect:Zx,useMemo:ay,useReducer:Gc,useRef:Qx,useState:function(){return Gc(ri)},useDebugValue:Cp,useDeferredValue:function(e){var t=Qt();return ry(t,Ve.memoizedState,e)},useTransition:function(){var e=Gc(ri)[0],t=Qt().memoizedState;return[e,t]},useMutableSource:qx,useSyncExternalStore:Wx,useId:oy,unstable_isNewReconciler:!1},ww={readContext:Xt,useCallback:ty,useContext:Xt,useEffect:Lp,useImperativeHandle:ey,useInsertionEffect:Yx,useLayoutEffect:Zx,useMemo:ay,useReducer:jc,useRef:Qx,useState:function(){return jc(ri)},useDebugValue:Cp,useDeferredValue:function(e){var t=Qt();return Ve===null?t.memoizedState=e:ry(t,Ve.memoizedState,e)},useTransition:function(){var e=jc(ri)[0],t=Qt().memoizedState;return[e,t]},useMutableSource:qx,useSyncExternalStore:Wx,useId:oy,unstable_isNewReconciler:!1};function aa(e,t){if(e&&e.defaultProps){t=be({},t),e=e.defaultProps;for(var a in e)t[a]===void 0&&(t[a]=e[a]);return t}return t}function Tf(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:be({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var mu={isMounted:function(e){return(e=e._reactInternals)?po(e)===e:!1},enqueueSetState:function(e,t,a){e=e._reactInternals;var r=pt(),o=Lr(e),n=Va(r,o);n.payload=t,a!=null&&(n.callback=a),t=yr(e,n,o),t!==null&&(sa(t,e,o,r),Rl(t,e,o))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=pt(),o=Lr(e),n=Va(r,o);n.tag=1,n.payload=t,a!=null&&(n.callback=a),t=yr(e,n,o),t!==null&&(sa(t,e,o,r),Rl(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=pt(),r=Lr(e),o=Va(a,r);o.tag=2,t!=null&&(o.callback=t),t=yr(e,o,r),t!==null&&(sa(t,e,r,a),Rl(t,e,r))}};function vg(e,t,a,r,o,n,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,n,s):t.prototype&&t.prototype.isPureReactComponent?!Qs(a,r)||!Qs(o,n):!0}function ly(e,t,a){var r=!1,o=Ir,n=t.contextType;return typeof n=="object"&&n!==null?n=Xt(n):(o=Ct(t)?so:st.current,r=t.contextTypes,n=(r=r!=null)?rn(e,o):Ir),t=new t(a,n),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=mu,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=n),t}function Lg(e,t,a,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,r),t.state!==e&&mu.enqueueReplaceState(t,t.state,null)}function Af(e,t,a,r){var o=e.stateNode;o.props=a,o.state=e.memoizedState,o.refs={},pp(e);var n=t.contextType;typeof n=="object"&&n!==null?o.context=Xt(n):(n=Ct(t)?so:st.current,o.context=rn(e,n)),o.state=e.memoizedState,n=t.getDerivedStateFromProps,typeof n=="function"&&(Tf(e,t,n,a),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&mu.enqueueReplaceState(o,o.state,null),Zl(e,a,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function ln(e,t){try{var a="",r=t;do a+=eI(r),r=r.return;while(r);var o=a}catch(n){o=`
|
|
7
7
|
Error generating stack: `+n.message+`
|
|
8
|
-
`+n.stack}return{value:e,source:t,stack:o,digest:null}}function Dp(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function mh(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var GP=typeof WeakMap=="function"?WeakMap:Map;function L0(e,t,r){r=oa(-1,r),r.tag=3,r.payload={element:null};var a=t.value;return r.callback=function(){wc||(wc=!0,Ih=a),mh(e,t)},r}function I0(e,t,r){r=oa(-1,r),r.tag=3;var a=e.type.getDerivedStateFromError;if(typeof a=="function"){var o=t.value;r.payload=function(){return a(o)},r.callback=function(){mh(e,t)}}var n=e.stateNode;return n!==null&&typeof n.componentDidCatch=="function"&&(r.callback=function(){mh(e,t),typeof a!="function"&&(Ha===null?Ha=new Set([this]):Ha.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),r}function Ov(e,t,r){var a=e.pingCache;if(a===null){a=e.pingCache=new GP;var o=new Set;a.set(t,o)}else o=a.get(t),o===void 0&&(o=new Set,a.set(t,o));o.has(r)||(o.add(r),e=iT.bind(null,e,t,r),t.then(e,e))}function Bv(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 Fv(e,t,r,a,o){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=oa(-1,1),t.tag=2,qa(r,t,1))),r.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var KP=ua.ReactCurrentOwner,Et=!1;function It(e,t,r,a){t.child=e===null?e0(t,null,r,a):Xn(t,e.child,r,a)}function Uv(e,t,r,a,o){r=r.render;var n=t.ref;return zn(t,o),a=am(e,t,r,a,n,o),r=om(),e!==null&&!Et?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,la(e,t,o)):(_e&&r&&$h(t),t.flags|=1,It(e,t,a,o),t.child)}function Vv(e,t,r,a,o){if(e===null){var n=r.type;return typeof n=="function"&&!hm(n)&&n.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=n,k0(e,t,n,a,o)):(e=Zu(r.type,null,a,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(n=e.child,(e.lanes&o)===0){var s=n.memoizedProps;if(r=r.compare,r=r!==null?r:Qi,r(s,a)&&e.ref===t.ref)return la(e,t,o)}return t.flags|=1,e=$a(n,a),e.ref=t.ref,e.return=t,t.child=e}function k0(e,t,r,a,o){if(e!==null){var n=e.memoizedProps;if(Qi(n,a)&&e.ref===t.ref)if(Et=!1,t.pendingProps=a=n,(e.lanes&o)!==0)(e.flags&131072)!==0&&(Et=!0);else return t.lanes=e.lanes,la(e,t,o)}return gh(e,t,r,a,o)}function P0(e,t,r){var a=t.pendingProps,o=a.children,n=e!==null?e.memoizedState:null;if(a.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},we(Un,Ht),Ht|=r;else{if((r&1073741824)===0)return e=n!==null?n.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,we(Un,Ht),Ht|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},a=n!==null?n.baseLanes:r,we(Un,Ht),Ht|=a}else n!==null?(a=n.baseLanes|r,t.memoizedState=null):a=r,we(Un,Ht),Ht|=a;return It(e,t,o,r),t.child}function T0(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function gh(e,t,r,a,o){var n=Nt(r)?Mo:wt.current;return n=Gn(t,n),zn(t,o),r=am(e,t,r,a,n,o),a=om(),e!==null&&!Et?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,la(e,t,o)):(_e&&a&&$h(t),t.flags|=1,It(e,t,r,o),t.child)}function jv(e,t,r,a,o){if(Nt(r)){var n=!0;cc(t)}else n=!1;if(zn(t,o),t.stateNode===null)Ju(e,t),b0(t,r,a),hh(t,r,a,o),a=!0;else if(e===null){var s=t.stateNode,i=t.memoizedProps;s.props=i;var l=s.context,u=r.contextType;typeof u=="object"&&u!==null?u=dr(u):(u=Nt(r)?Mo:wt.current,u=Gn(t,u));var c=r.getDerivedStateFromProps,d=typeof c=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(i!==a||l!==u)&&Mv(t,s,a,u),Da=!1;var f=t.memoizedState;s.state=f,mc(t,a,s,o),l=t.memoizedState,i!==a||f!==l||Dt.current||Da?(typeof c=="function"&&(ph(t,r,c,a),l=t.memoizedState),(i=Da||Nv(t,r,i,a,f,l,u))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=l),s.props=a,s.state=l,s.context=u,a=i):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{s=t.stateNode,r0(e,t),i=t.memoizedProps,u=t.type===t.elementType?i:xr(t.type,i),s.props=u,d=t.pendingProps,f=s.context,l=r.contextType,typeof l=="object"&&l!==null?l=dr(l):(l=Nt(r)?Mo:wt.current,l=Gn(t,l));var p=r.getDerivedStateFromProps;(c=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(i!==d||f!==l)&&Mv(t,s,a,l),Da=!1,f=t.memoizedState,s.state=f,mc(t,a,s,o);var v=t.memoizedState;i!==d||f!==v||Dt.current||Da?(typeof p=="function"&&(ph(t,r,p,a),v=t.memoizedState),(u=Da||Nv(t,r,u,a,f,v,l)||!1)?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(a,v,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(a,v,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=v),s.props=a,s.state=v,s.context=l,a=u):(typeof s.componentDidUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),a=!1)}return yh(e,t,r,a,n,o)}function yh(e,t,r,a,o,n){T0(e,t);var s=(t.flags&128)!==0;if(!a&&!s)return o&&kv(t,r,!1),la(e,t,n);a=t.stateNode,KP.current=t;var i=s&&typeof r.getDerivedStateFromError!="function"?null:a.render();return t.flags|=1,e!==null&&s?(t.child=Xn(t,e.child,null,n),t.child=Xn(t,null,i,n)):It(e,t,i,n),t.memoizedState=a.state,o&&kv(t,r,!0),t.child}function _0(e){var t=e.stateNode;t.pendingContext?Iv(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Iv(e,t.context,!1),Zh(e,t.containerInfo)}function qv(e,t,r,a,o){return Kn(),Gh(o),t.flags|=256,It(e,t,r,a),t.child}var vh={dehydrated:null,treeContext:null,retryLane:0};function xh(e){return{baseLanes:e,cachePool:null,transitions:null}}function A0(e,t,r){var a=t.pendingProps,o=Ae.current,n=!1,s=(t.flags&128)!==0,i;if((i=s)||(i=e!==null&&e.memoizedState===null?!1:(o&2)!==0),i?(n=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),we(Ae,o&1),e===null)return dh(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(s=a.children,e=a.fallback,n?(a=t.mode,n=t.child,s={mode:"hidden",children:s},(a&1)===0&&n!==null?(n.childLanes=0,n.pendingProps=s):n=Nc(s,a,0,null),e=No(e,a,r,null),n.return=t,e.return=t,n.sibling=e,t.child=n,t.child.memoizedState=xh(r),t.memoizedState=vh,e):im(t,s));if(o=e.memoizedState,o!==null&&(i=o.dehydrated,i!==null))return XP(e,t,s,a,i,o,r);if(n){n=a.fallback,s=t.mode,o=e.child,i=o.sibling;var l={mode:"hidden",children:a.children};return(s&1)===0&&t.child!==o?(a=t.child,a.childLanes=0,a.pendingProps=l,t.deletions=null):(a=$a(o,l),a.subtreeFlags=o.subtreeFlags&14680064),i!==null?n=$a(i,n):(n=No(n,s,r,null),n.flags|=2),n.return=t,a.return=t,a.sibling=n,t.child=a,a=n,n=t.child,s=e.child.memoizedState,s=s===null?xh(r):{baseLanes:s.baseLanes|r,cachePool:null,transitions:s.transitions},n.memoizedState=s,n.childLanes=e.childLanes&~r,t.memoizedState=vh,a}return n=e.child,e=n.sibling,a=$a(n,{mode:"visible",children:a.children}),(t.mode&1)===0&&(a.lanes=r),a.return=t,a.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=a,t.memoizedState=null,a}function im(e,t){return t=Nc({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ju(e,t,r,a){return a!==null&&Gh(a),Xn(t,e.child,null,r),e=im(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function XP(e,t,r,a,o,n,s){if(r)return t.flags&256?(t.flags&=-257,a=Dp(Error(R(422))),ju(e,t,s,a)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(n=a.fallback,o=t.mode,a=Nc({mode:"visible",children:a.children},o,0,null),n=No(n,o,s,null),n.flags|=2,a.return=t,n.return=t,a.sibling=n,t.child=a,(t.mode&1)!==0&&Xn(t,e.child,null,s),t.child.memoizedState=xh(s),t.memoizedState=vh,n);if((t.mode&1)===0)return ju(e,t,s,null);if(o.data==="$!"){if(a=o.nextSibling&&o.nextSibling.dataset,a)var i=a.dgst;return a=i,n=Error(R(419)),a=Dp(n,a,void 0),ju(e,t,s,a)}if(i=(s&e.childLanes)!==0,Et||i){if(a=et,a!==null){switch(s&-s){case 4:o=2;break;case 16:o=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:o=32;break;case 536870912:o=268435456;break;default:o=0}o=(o&(a.suspendedLanes|s))!==0?0:o,o!==0&&o!==n.retryLane&&(n.retryLane=o,ia(e,o),br(a,e,o,-1))}return pm(),a=Dp(Error(R(421))),ju(e,t,s,a)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=lT.bind(null,e),o._reactRetry=t,null):(e=n.treeContext,zt=ja(o.nextSibling),$t=t,_e=!0,Sr=null,e!==null&&(ir[lr++]=ra,ir[lr++]=aa,ir[lr++]=Oo,ra=e.id,aa=e.overflow,Oo=t),t=im(t,a.children),t.flags|=4096,t)}function Hv(e,t,r){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),fh(e.return,t,r)}function Np(e,t,r,a,o){var n=e.memoizedState;n===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:r,tailMode:o}:(n.isBackwards=t,n.rendering=null,n.renderingStartTime=0,n.last=a,n.tail=r,n.tailMode=o)}function R0(e,t,r){var a=t.pendingProps,o=a.revealOrder,n=a.tail;if(It(e,t,a.children,r),a=Ae.current,(a&2)!==0)a=a&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Hv(e,r,t);else if(e.tag===19)Hv(e,r,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}a&=1}if(we(Ae,a),(t.mode&1)===0)t.memoizedState=null;else switch(o){case"forwards":for(r=t.child,o=null;r!==null;)e=r.alternate,e!==null&&gc(e)===null&&(o=r),r=r.sibling;r=o,r===null?(o=t.child,t.child=null):(o=r.sibling,r.sibling=null),Np(t,!1,o,r,n);break;case"backwards":for(r=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&gc(e)===null){t.child=o;break}e=o.sibling,o.sibling=r,r=o,o=e}Np(t,!0,r,null,n);break;case"together":Np(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ju(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function la(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Fo|=t.lanes,(r&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(R(153));if(t.child!==null){for(e=t.child,r=$a(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=$a(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function JP(e,t,r){switch(t.tag){case 3:_0(t),Kn();break;case 5:a0(t);break;case 1:Nt(t.type)&&cc(t);break;case 4:Zh(t,t.stateNode.containerInfo);break;case 10:var a=t.type._context,o=t.memoizedProps.value;we(pc,a._currentValue),a._currentValue=o;break;case 13:if(a=t.memoizedState,a!==null)return a.dehydrated!==null?(we(Ae,Ae.current&1),t.flags|=128,null):(r&t.child.childLanes)!==0?A0(e,t,r):(we(Ae,Ae.current&1),e=la(e,t,r),e!==null?e.sibling:null);we(Ae,Ae.current&1);break;case 19:if(a=(r&t.childLanes)!==0,(e.flags&128)!==0){if(a)return R0(e,t,r);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),we(Ae,Ae.current),a)break;return null;case 22:case 23:return t.lanes=0,P0(e,t,r)}return la(e,t,r)}var E0,wh,D0,N0;E0=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};wh=function(){};D0=function(e,t,r,a){var o=e.memoizedProps;if(o!==a){e=t.stateNode,Eo(Or.current);var n=null;switch(r){case"input":o=qp(e,o),a=qp(e,a),n=[];break;case"select":o=Ee({},o,{value:void 0}),a=Ee({},a,{value:void 0}),n=[];break;case"textarea":o=$p(e,o),a=$p(e,a),n=[];break;default:typeof o.onClick!="function"&&typeof a.onClick=="function"&&(e.onclick=lc)}Gp(r,a);var s;r=null;for(u in o)if(!a.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var i=o[u];for(s in i)i.hasOwnProperty(s)&&(r||(r={}),r[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(zi.hasOwnProperty(u)?n||(n=[]):(n=n||[]).push(u,null));for(u in a){var l=a[u];if(i=o?.[u],a.hasOwnProperty(u)&&l!==i&&(l!=null||i!=null))if(u==="style")if(i){for(s in i)!i.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(r||(r={}),r[s]="");for(s in l)l.hasOwnProperty(s)&&i[s]!==l[s]&&(r||(r={}),r[s]=l[s])}else r||(n||(n=[]),n.push(u,r)),r=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,i=i?i.__html:void 0,l!=null&&i!==l&&(n=n||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(n=n||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(zi.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Le("scroll",e),n||i===l||(n=[])):(n=n||[]).push(u,l))}r&&(n=n||[]).push("style",r);var u=n;(t.updateQueue=u)&&(t.flags|=4)}};N0=function(e,t,r,a){r!==a&&(t.flags|=4)};function Ti(e,t){if(!_e)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function vt(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,a=0;if(t)for(var o=e.child;o!==null;)r|=o.lanes|o.childLanes,a|=o.subtreeFlags&14680064,a|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)r|=o.lanes|o.childLanes,a|=o.subtreeFlags,a|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=a,e.childLanes=r,t}function QP(e,t,r){var a=t.pendingProps;switch(Wh(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vt(t),null;case 1:return Nt(t.type)&&uc(),vt(t),null;case 3:return a=t.stateNode,Jn(),Ie(Dt),Ie(wt),tm(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Uu(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Sr!==null&&(Th(Sr),Sr=null))),wh(e,t),vt(t),null;case 5:em(t);var o=Eo(rl.current);if(r=t.type,e!==null&&t.stateNode!=null)D0(e,t,r,a,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!a){if(t.stateNode===null)throw Error(R(166));return vt(t),null}if(e=Eo(Or.current),Uu(t)){a=t.stateNode,r=t.type;var n=t.memoizedProps;switch(a[Nr]=t,a[el]=n,e=(t.mode&1)!==0,r){case"dialog":Le("cancel",a),Le("close",a);break;case"iframe":case"object":case"embed":Le("load",a);break;case"video":case"audio":for(o=0;o<Ni.length;o++)Le(Ni[o],a);break;case"source":Le("error",a);break;case"img":case"image":case"link":Le("error",a),Le("load",a);break;case"details":Le("toggle",a);break;case"input":Qy(a,n),Le("invalid",a);break;case"select":a._wrapperState={wasMultiple:!!n.multiple},Le("invalid",a);break;case"textarea":Zy(a,n),Le("invalid",a)}Gp(r,n),o=null;for(var s in n)if(n.hasOwnProperty(s)){var i=n[s];s==="children"?typeof i=="string"?a.textContent!==i&&(n.suppressHydrationWarning!==!0&&Fu(a.textContent,i,e),o=["children",i]):typeof i=="number"&&a.textContent!==""+i&&(n.suppressHydrationWarning!==!0&&Fu(a.textContent,i,e),o=["children",""+i]):zi.hasOwnProperty(s)&&i!=null&&s==="onScroll"&&Le("scroll",a)}switch(r){case"input":ku(a),Yy(a,n,!0);break;case"textarea":ku(a),ev(a);break;case"select":case"option":break;default:typeof n.onClick=="function"&&(a.onclick=lc)}a=o,t.updateQueue=a,a!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=lx(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=s.createElement("div"),e.innerHTML="<script></script>",e=e.removeChild(e.firstChild)):typeof a.is=="string"?e=s.createElement(r,{is:a.is}):(e=s.createElement(r),r==="select"&&(s=e,a.multiple?s.multiple=!0:a.size&&(s.size=a.size))):e=s.createElementNS(e,r),e[Nr]=t,e[el]=a,E0(e,t,!1,!1),t.stateNode=e;e:{switch(s=Kp(r,a),r){case"dialog":Le("cancel",e),Le("close",e),o=a;break;case"iframe":case"object":case"embed":Le("load",e),o=a;break;case"video":case"audio":for(o=0;o<Ni.length;o++)Le(Ni[o],e);o=a;break;case"source":Le("error",e),o=a;break;case"img":case"image":case"link":Le("error",e),Le("load",e),o=a;break;case"details":Le("toggle",e),o=a;break;case"input":Qy(e,a),o=qp(e,a),Le("invalid",e);break;case"option":o=a;break;case"select":e._wrapperState={wasMultiple:!!a.multiple},o=Ee({},a,{value:void 0}),Le("invalid",e);break;case"textarea":Zy(e,a),o=$p(e,a),Le("invalid",e);break;default:o=a}Gp(r,o),i=o;for(n in i)if(i.hasOwnProperty(n)){var l=i[n];n==="style"?dx(e,l):n==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&ux(e,l)):n==="children"?typeof l=="string"?(r!=="textarea"||l!=="")&&$i(e,l):typeof l=="number"&&$i(e,""+l):n!=="suppressContentEditableWarning"&&n!=="suppressHydrationWarning"&&n!=="autoFocus"&&(zi.hasOwnProperty(n)?l!=null&&n==="onScroll"&&Le("scroll",e):l!=null&&Rh(e,n,l,s))}switch(r){case"input":ku(e),Yy(e,a,!1);break;case"textarea":ku(e),ev(e);break;case"option":a.value!=null&&e.setAttribute("value",""+Wa(a.value));break;case"select":e.multiple=!!a.multiple,n=a.value,n!=null?Vn(e,!!a.multiple,n,!1):a.defaultValue!=null&&Vn(e,!!a.multiple,a.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=lc)}switch(r){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}}a&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return vt(t),null;case 6:if(e&&t.stateNode!=null)N0(e,t,e.memoizedProps,a);else{if(typeof a!="string"&&t.stateNode===null)throw Error(R(166));if(r=Eo(rl.current),Eo(Or.current),Uu(t)){if(a=t.stateNode,r=t.memoizedProps,a[Nr]=t,(n=a.nodeValue!==r)&&(e=$t,e!==null))switch(e.tag){case 3:Fu(a.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Fu(a.nodeValue,r,(e.mode&1)!==0)}n&&(t.flags|=4)}else a=(r.nodeType===9?r:r.ownerDocument).createTextNode(a),a[Nr]=t,t.stateNode=a}return vt(t),null;case 13:if(Ie(Ae),a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(_e&&zt!==null&&(t.mode&1)!==0&&(t.flags&128)===0)Yx(),Kn(),t.flags|=98560,n=!1;else if(n=Uu(t),a!==null&&a.dehydrated!==null){if(e===null){if(!n)throw Error(R(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(R(317));n[Nr]=t}else Kn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;vt(t),n=!1}else Sr!==null&&(Th(Sr),Sr=null),n=!0;if(!n)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=r,t):(a=a!==null,a!==(e!==null&&e.memoizedState!==null)&&a&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Ae.current&1)!==0?Ke===0&&(Ke=3):pm())),t.updateQueue!==null&&(t.flags|=4),vt(t),null);case 4:return Jn(),wh(e,t),e===null&&Yi(t.stateNode.containerInfo),vt(t),null;case 10:return Jh(t.type._context),vt(t),null;case 17:return Nt(t.type)&&uc(),vt(t),null;case 19:if(Ie(Ae),n=t.memoizedState,n===null)return vt(t),null;if(a=(t.flags&128)!==0,s=n.rendering,s===null)if(a)Ti(n,!1);else{if(Ke!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=gc(e),s!==null){for(t.flags|=128,Ti(n,!1),a=s.updateQueue,a!==null&&(t.updateQueue=a,t.flags|=4),t.subtreeFlags=0,a=r,r=t.child;r!==null;)n=r,e=a,n.flags&=14680066,s=n.alternate,s===null?(n.childLanes=0,n.lanes=e,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=s.childLanes,n.lanes=s.lanes,n.child=s.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=s.memoizedProps,n.memoizedState=s.memoizedState,n.updateQueue=s.updateQueue,n.type=s.type,e=s.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return we(Ae,Ae.current&1|2),t.child}e=e.sibling}n.tail!==null&&Ve()>Yn&&(t.flags|=128,a=!0,Ti(n,!1),t.lanes=4194304)}else{if(!a)if(e=gc(s),e!==null){if(t.flags|=128,a=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Ti(n,!0),n.tail===null&&n.tailMode==="hidden"&&!s.alternate&&!_e)return vt(t),null}else 2*Ve()-n.renderingStartTime>Yn&&r!==1073741824&&(t.flags|=128,a=!0,Ti(n,!1),t.lanes=4194304);n.isBackwards?(s.sibling=t.child,t.child=s):(r=n.last,r!==null?r.sibling=s:t.child=s,n.last=s)}return n.tail!==null?(t=n.tail,n.rendering=t,n.tail=t.sibling,n.renderingStartTime=Ve(),t.sibling=null,r=Ae.current,we(Ae,a?r&1|2:r&1),t):(vt(t),null);case 22:case 23:return fm(),a=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==a&&(t.flags|=8192),a&&(t.mode&1)!==0?(Ht&1073741824)!==0&&(vt(t),t.subtreeFlags&6&&(t.flags|=8192)):vt(t),null;case 24:return null;case 25:return null}throw Error(R(156,t.tag))}function YP(e,t){switch(Wh(t),t.tag){case 1:return Nt(t.type)&&uc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Jn(),Ie(Dt),Ie(wt),tm(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return em(t),null;case 13:if(Ie(Ae),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(R(340));Kn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ie(Ae),null;case 4:return Jn(),null;case 10:return Jh(t.type._context),null;case 22:case 23:return fm(),null;case 24:return null;default:return null}}var qu=!1,xt=!1,ZP=typeof WeakSet=="function"?WeakSet:Set,F=null;function Fn(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(a){Oe(e,t,a)}else r.current=null}function Sh(e,t,r){try{r()}catch(a){Oe(e,t,a)}}var zv=!1;function eT(e,t){if(oh=nc,e=Ux(),zh(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var a=r.getSelection&&r.getSelection();if(a&&a.rangeCount!==0){r=a.anchorNode;var o=a.anchorOffset,n=a.focusNode;a=a.focusOffset;try{r.nodeType,n.nodeType}catch{r=null;break e}var s=0,i=-1,l=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var p;d!==r||o!==0&&d.nodeType!==3||(i=s+o),d!==n||a!==0&&d.nodeType!==3||(l=s+a),d.nodeType===3&&(s+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===r&&++u===o&&(i=s),f===n&&++c===a&&(l=s),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}r=i===-1||l===-1?null:{start:i,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(nh={focusedElem:e,selectionRange:r},nc=!1,F=t;F!==null;)if(t=F,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,F=e;else for(;F!==null;){t=F;try{var v=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var x=v.memoizedProps,C=v.memoizedState,g=t.stateNode,m=g.getSnapshotBeforeUpdate(t.elementType===t.type?x:xr(t.type,x),C);g.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(R(163))}}catch(b){Oe(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,F=e;break}F=t.return}return v=zv,zv=!1,v}function ji(e,t,r){var a=t.updateQueue;if(a=a!==null?a.lastEffect:null,a!==null){var o=a=a.next;do{if((o.tag&e)===e){var n=o.destroy;o.destroy=void 0,n!==void 0&&Sh(t,r,n)}o=o.next}while(o!==a)}}function Ec(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var a=r.create;r.destroy=a()}r=r.next}while(r!==t)}}function Ch(e){var t=e.ref;if(t!==null){var r=e.stateNode;e.tag,e=r,typeof t=="function"?t(e):t.current=e}}function M0(e){var t=e.alternate;t!==null&&(e.alternate=null,M0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Nr],delete t[el],delete t[lh],delete t[OP],delete t[BP])),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 O0(e){return e.tag===5||e.tag===3||e.tag===4}function $v(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||O0(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 bh(e,t,r){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=lc));else if(a!==4&&(e=e.child,e!==null))for(bh(e,t,r),e=e.sibling;e!==null;)bh(e,t,r),e=e.sibling}function Lh(e,t,r){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(a!==4&&(e=e.child,e!==null))for(Lh(e,t,r),e=e.sibling;e!==null;)Lh(e,t,r),e=e.sibling}var nt=null,wr=!1;function Ra(e,t,r){for(r=r.child;r!==null;)B0(e,t,r),r=r.sibling}function B0(e,t,r){if(Mr&&typeof Mr.onCommitFiberUnmount=="function")try{Mr.onCommitFiberUnmount(Lc,r)}catch{}switch(r.tag){case 5:xt||Fn(r,t);case 6:var a=nt,o=wr;nt=null,Ra(e,t,r),nt=a,wr=o,nt!==null&&(wr?(e=nt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):nt.removeChild(r.stateNode));break;case 18:nt!==null&&(wr?(e=nt,r=r.stateNode,e.nodeType===8?Pp(e.parentNode,r):e.nodeType===1&&Pp(e,r),Xi(e)):Pp(nt,r.stateNode));break;case 4:a=nt,o=wr,nt=r.stateNode.containerInfo,wr=!0,Ra(e,t,r),nt=a,wr=o;break;case 0:case 11:case 14:case 15:if(!xt&&(a=r.updateQueue,a!==null&&(a=a.lastEffect,a!==null))){o=a=a.next;do{var n=o,s=n.destroy;n=n.tag,s!==void 0&&((n&2)!==0||(n&4)!==0)&&Sh(r,t,s),o=o.next}while(o!==a)}Ra(e,t,r);break;case 1:if(!xt&&(Fn(r,t),a=r.stateNode,typeof a.componentWillUnmount=="function"))try{a.props=r.memoizedProps,a.state=r.memoizedState,a.componentWillUnmount()}catch(i){Oe(r,t,i)}Ra(e,t,r);break;case 21:Ra(e,t,r);break;case 22:r.mode&1?(xt=(a=xt)||r.memoizedState!==null,Ra(e,t,r),xt=a):Ra(e,t,r);break;default:Ra(e,t,r)}}function Wv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new ZP),t.forEach(function(a){var o=uT.bind(null,e,a);r.has(a)||(r.add(a),a.then(o,o))})}}function vr(e,t){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a];try{var n=e,s=t,i=s;e:for(;i!==null;){switch(i.tag){case 5:nt=i.stateNode,wr=!1;break e;case 3:nt=i.stateNode.containerInfo,wr=!0;break e;case 4:nt=i.stateNode.containerInfo,wr=!0;break e}i=i.return}if(nt===null)throw Error(R(160));B0(n,s,o),nt=null,wr=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(u){Oe(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)F0(t,e),t=t.sibling}function F0(e,t){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(vr(t,e),Er(e),a&4){try{ji(3,e,e.return),Ec(3,e)}catch(x){Oe(e,e.return,x)}try{ji(5,e,e.return)}catch(x){Oe(e,e.return,x)}}break;case 1:vr(t,e),Er(e),a&512&&r!==null&&Fn(r,r.return);break;case 5:if(vr(t,e),Er(e),a&512&&r!==null&&Fn(r,r.return),e.flags&32){var o=e.stateNode;try{$i(o,"")}catch(x){Oe(e,e.return,x)}}if(a&4&&(o=e.stateNode,o!=null)){var n=e.memoizedProps,s=r!==null?r.memoizedProps:n,i=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{i==="input"&&n.type==="radio"&&n.name!=null&&sx(o,n),Kp(i,s);var u=Kp(i,n);for(s=0;s<l.length;s+=2){var c=l[s],d=l[s+1];c==="style"?dx(o,d):c==="dangerouslySetInnerHTML"?ux(o,d):c==="children"?$i(o,d):Rh(o,c,d,u)}switch(i){case"input":Hp(o,n);break;case"textarea":ix(o,n);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!n.multiple;var p=n.value;p!=null?Vn(o,!!n.multiple,p,!1):f!==!!n.multiple&&(n.defaultValue!=null?Vn(o,!!n.multiple,n.defaultValue,!0):Vn(o,!!n.multiple,n.multiple?[]:"",!1))}o[el]=n}catch(x){Oe(e,e.return,x)}}break;case 6:if(vr(t,e),Er(e),a&4){if(e.stateNode===null)throw Error(R(162));o=e.stateNode,n=e.memoizedProps;try{o.nodeValue=n}catch(x){Oe(e,e.return,x)}}break;case 3:if(vr(t,e),Er(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Xi(t.containerInfo)}catch(x){Oe(e,e.return,x)}break;case 4:vr(t,e),Er(e);break;case 13:vr(t,e),Er(e),o=e.child,o.flags&8192&&(n=o.memoizedState!==null,o.stateNode.isHidden=n,!n||o.alternate!==null&&o.alternate.memoizedState!==null||(cm=Ve())),a&4&&Wv(e);break;case 22:if(c=r!==null&&r.memoizedState!==null,e.mode&1?(xt=(u=xt)||c,vr(t,e),xt=u):vr(t,e),Er(e),a&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&(e.mode&1)!==0)for(F=e,c=e.child;c!==null;){for(d=F=c;F!==null;){switch(f=F,p=f.child,f.tag){case 0:case 11:case 14:case 15:ji(4,f,f.return);break;case 1:Fn(f,f.return);var v=f.stateNode;if(typeof v.componentWillUnmount=="function"){a=f,r=f.return;try{t=a,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(x){Oe(a,r,x)}}break;case 5:Fn(f,f.return);break;case 22:if(f.memoizedState!==null){Kv(d);continue}}p!==null?(p.return=f,F=p):Kv(d)}c=c.sibling}e:for(c=null,d=e;;){if(d.tag===5){if(c===null){c=d;try{o=d.stateNode,u?(n=o.style,typeof n.setProperty=="function"?n.setProperty("display","none","important"):n.display="none"):(i=d.stateNode,l=d.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,i.style.display=cx("display",s))}catch(x){Oe(e,e.return,x)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(x){Oe(e,e.return,x)}}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:vr(t,e),Er(e),a&4&&Wv(e);break;case 21:break;default:vr(t,e),Er(e)}}function Er(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(O0(r)){var a=r;break e}r=r.return}throw Error(R(160))}switch(a.tag){case 5:var o=a.stateNode;a.flags&32&&($i(o,""),a.flags&=-33);var n=$v(e);Lh(e,n,o);break;case 3:case 4:var s=a.stateNode.containerInfo,i=$v(e);bh(e,i,s);break;default:throw Error(R(161))}}catch(l){Oe(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function tT(e,t,r){F=e,U0(e,t,r)}function U0(e,t,r){for(var a=(e.mode&1)!==0;F!==null;){var o=F,n=o.child;if(o.tag===22&&a){var s=o.memoizedState!==null||qu;if(!s){var i=o.alternate,l=i!==null&&i.memoizedState!==null||xt;i=qu;var u=xt;if(qu=s,(xt=l)&&!u)for(F=o;F!==null;)s=F,l=s.child,s.tag===22&&s.memoizedState!==null?Xv(o):l!==null?(l.return=s,F=l):Xv(o);for(;n!==null;)F=n,U0(n,t,r),n=n.sibling;F=o,qu=i,xt=u}Gv(e,t,r)}else(o.subtreeFlags&8772)!==0&&n!==null?(n.return=o,F=n):Gv(e,t,r)}}function Gv(e){for(;F!==null;){var t=F;if((t.flags&8772)!==0){var r=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:xt||Ec(5,t);break;case 1:var a=t.stateNode;if(t.flags&4&&!xt)if(r===null)a.componentDidMount();else{var o=t.elementType===t.type?r.memoizedProps:xr(t.type,r.memoizedProps);a.componentDidUpdate(o,r.memoizedState,a.__reactInternalSnapshotBeforeUpdate)}var n=t.updateQueue;n!==null&&Rv(t,n,a);break;case 3:var s=t.updateQueue;if(s!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Rv(t,s,r)}break;case 5:var i=t.stateNode;if(r===null&&t.flags&4){r=i;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&r.focus();break;case"img":l.src&&(r.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&Xi(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(R(163))}xt||t.flags&512&&Ch(t)}catch(f){Oe(t,t.return,f)}}if(t===e){F=null;break}if(r=t.sibling,r!==null){r.return=t.return,F=r;break}F=t.return}}function Kv(e){for(;F!==null;){var t=F;if(t===e){F=null;break}var r=t.sibling;if(r!==null){r.return=t.return,F=r;break}F=t.return}}function Xv(e){for(;F!==null;){var t=F;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Ec(4,t)}catch(l){Oe(t,r,l)}break;case 1:var a=t.stateNode;if(typeof a.componentDidMount=="function"){var o=t.return;try{a.componentDidMount()}catch(l){Oe(t,o,l)}}var n=t.return;try{Ch(t)}catch(l){Oe(t,n,l)}break;case 5:var s=t.return;try{Ch(t)}catch(l){Oe(t,s,l)}}}catch(l){Oe(t,t.return,l)}if(t===e){F=null;break}var i=t.sibling;if(i!==null){i.return=t.return,F=i;break}F=t.return}}var rT=Math.ceil,xc=ua.ReactCurrentDispatcher,lm=ua.ReactCurrentOwner,cr=ua.ReactCurrentBatchConfig,ue=0,et=null,He=null,st=0,Ht=0,Un=Xa(0),Ke=0,sl=null,Fo=0,Dc=0,um=0,qi=null,Rt=null,cm=0,Yn=1/0,ea=null,wc=!1,Ih=null,Ha=null,Hu=!1,Ba=null,Sc=0,Hi=0,kh=null,Qu=-1,Yu=0;function kt(){return(ue&6)!==0?Ve():Qu!==-1?Qu:Qu=Ve()}function za(e){return(e.mode&1)===0?1:(ue&2)!==0&&st!==0?st&-st:UP.transition!==null?(Yu===0&&(Yu=bx()),Yu):(e=me,e!==0||(e=window.event,e=e===void 0?16:Ax(e.type)),e)}function br(e,t,r,a){if(50<Hi)throw Hi=0,kh=null,Error(R(185));il(e,r,a),((ue&2)===0||e!==et)&&(e===et&&((ue&2)===0&&(Dc|=r),Ke===4&&Ma(e,st)),Mt(e,a),r===1&&ue===0&&(t.mode&1)===0&&(Yn=Ve()+500,_c&&Ja()))}function Mt(e,t){var r=e.callbackNode;jk(e,t);var a=oc(e,e===et?st:0);if(a===0)r!==null&&av(r),e.callbackNode=null,e.callbackPriority=0;else if(t=a&-a,e.callbackPriority!==t){if(r!=null&&av(r),t===1)e.tag===0?FP(Jv.bind(null,e)):Xx(Jv.bind(null,e)),NP(function(){(ue&6)===0&&Ja()}),r=null;else{switch(Lx(a)){case 1:r=Oh;break;case 4:r=Sx;break;case 16:r=ac;break;case 536870912:r=Cx;break;default:r=ac}r=G0(r,V0.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function V0(e,t){if(Qu=-1,Yu=0,(ue&6)!==0)throw Error(R(327));var r=e.callbackNode;if($n()&&e.callbackNode!==r)return null;var a=oc(e,e===et?st:0);if(a===0)return null;if((a&30)!==0||(a&e.expiredLanes)!==0||t)t=Cc(e,a);else{t=a;var o=ue;ue|=2;var n=q0();(et!==e||st!==t)&&(ea=null,Yn=Ve()+500,Do(e,t));do try{nT();break}catch(i){j0(e,i)}while(!0);Xh(),xc.current=n,ue=o,He!==null?t=0:(et=null,st=0,t=Ke)}if(t!==0){if(t===2&&(o=Zp(e),o!==0&&(a=o,t=Ph(e,o))),t===1)throw r=sl,Do(e,0),Ma(e,a),Mt(e,Ve()),r;if(t===6)Ma(e,a);else{if(o=e.current.alternate,(a&30)===0&&!aT(o)&&(t=Cc(e,a),t===2&&(n=Zp(e),n!==0&&(a=n,t=Ph(e,n))),t===1))throw r=sl,Do(e,0),Ma(e,a),Mt(e,Ve()),r;switch(e.finishedWork=o,e.finishedLanes=a,t){case 0:case 1:throw Error(R(345));case 2:_o(e,Rt,ea);break;case 3:if(Ma(e,a),(a&130023424)===a&&(t=cm+500-Ve(),10<t)){if(oc(e,0)!==0)break;if(o=e.suspendedLanes,(o&a)!==a){kt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=ih(_o.bind(null,e,Rt,ea),t);break}_o(e,Rt,ea);break;case 4:if(Ma(e,a),(a&4194240)===a)break;for(t=e.eventTimes,o=-1;0<a;){var s=31-Cr(a);n=1<<s,s=t[s],s>o&&(o=s),a&=~n}if(a=o,a=Ve()-a,a=(120>a?120:480>a?480:1080>a?1080:1920>a?1920:3e3>a?3e3:4320>a?4320:1960*rT(a/1960))-a,10<a){e.timeoutHandle=ih(_o.bind(null,e,Rt,ea),a);break}_o(e,Rt,ea);break;case 5:_o(e,Rt,ea);break;default:throw Error(R(329))}}}return Mt(e,Ve()),e.callbackNode===r?V0.bind(null,e):null}function Ph(e,t){var r=qi;return e.current.memoizedState.isDehydrated&&(Do(e,t).flags|=256),e=Cc(e,t),e!==2&&(t=Rt,Rt=r,t!==null&&Th(t)),e}function Th(e){Rt===null?Rt=e:Rt.push.apply(Rt,e)}function aT(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var a=0;a<r.length;a++){var o=r[a],n=o.getSnapshot;o=o.value;try{if(!Lr(n(),o))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;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 Ma(e,t){for(t&=~um,t&=~Dc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Cr(t),a=1<<r;e[r]=-1,t&=~a}}function Jv(e){if((ue&6)!==0)throw Error(R(327));$n();var t=oc(e,0);if((t&1)===0)return Mt(e,Ve()),null;var r=Cc(e,t);if(e.tag!==0&&r===2){var a=Zp(e);a!==0&&(t=a,r=Ph(e,a))}if(r===1)throw r=sl,Do(e,0),Ma(e,t),Mt(e,Ve()),r;if(r===6)throw Error(R(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,_o(e,Rt,ea),Mt(e,Ve()),null}function dm(e,t){var r=ue;ue|=1;try{return e(t)}finally{ue=r,ue===0&&(Yn=Ve()+500,_c&&Ja())}}function Uo(e){Ba!==null&&Ba.tag===0&&(ue&6)===0&&$n();var t=ue;ue|=1;var r=cr.transition,a=me;try{if(cr.transition=null,me=1,e)return e()}finally{me=a,cr.transition=r,ue=t,(ue&6)===0&&Ja()}}function fm(){Ht=Un.current,Ie(Un)}function Do(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,DP(r)),He!==null)for(r=He.return;r!==null;){var a=r;switch(Wh(a),a.tag){case 1:a=a.type.childContextTypes,a!=null&&uc();break;case 3:Jn(),Ie(Dt),Ie(wt),tm();break;case 5:em(a);break;case 4:Jn();break;case 13:Ie(Ae);break;case 19:Ie(Ae);break;case 10:Jh(a.type._context);break;case 22:case 23:fm()}r=r.return}if(et=e,He=e=$a(e.current,null),st=Ht=t,Ke=0,sl=null,um=Dc=Fo=0,Rt=qi=null,Ro!==null){for(t=0;t<Ro.length;t++)if(r=Ro[t],a=r.interleaved,a!==null){r.interleaved=null;var o=a.next,n=r.pending;if(n!==null){var s=n.next;n.next=o,a.next=s}r.pending=a}Ro=null}return e}function j0(e,t){do{var r=He;try{if(Xh(),Ku.current=vc,yc){for(var a=Re.memoizedState;a!==null;){var o=a.queue;o!==null&&(o.pending=null),a=a.next}yc=!1}if(Bo=0,Ze=Ge=Re=null,Vi=!1,al=0,lm.current=null,r===null||r.return===null){Ke=1,sl=t,He=null;break}e:{var n=e,s=r.return,i=r,l=t;if(t=st,i.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=i,d=c.tag;if((c.mode&1)===0&&(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=Bv(s);if(p!==null){p.flags&=-257,Fv(p,s,i,n,t),p.mode&1&&Ov(n,u,t),t=p,l=u;var v=t.updateQueue;if(v===null){var x=new Set;x.add(l),t.updateQueue=x}else v.add(l);break e}else{if((t&1)===0){Ov(n,u,t),pm();break e}l=Error(R(426))}}else if(_e&&i.mode&1){var C=Bv(s);if(C!==null){(C.flags&65536)===0&&(C.flags|=256),Fv(C,s,i,n,t),Gh(Qn(l,i));break e}}n=l=Qn(l,i),Ke!==4&&(Ke=2),qi===null?qi=[n]:qi.push(n),n=s;do{switch(n.tag){case 3:n.flags|=65536,t&=-t,n.lanes|=t;var g=L0(n,l,t);Av(n,g);break e;case 1:i=l;var m=n.type,y=n.stateNode;if((n.flags&128)===0&&(typeof m.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Ha===null||!Ha.has(y)))){n.flags|=65536,t&=-t,n.lanes|=t;var b=I0(n,i,t);Av(n,b);break e}}n=n.return}while(n!==null)}z0(r)}catch(L){t=L,He===r&&r!==null&&(He=r=r.return);continue}break}while(!0)}function q0(){var e=xc.current;return xc.current=vc,e===null?vc:e}function pm(){(Ke===0||Ke===3||Ke===2)&&(Ke=4),et===null||(Fo&268435455)===0&&(Dc&268435455)===0||Ma(et,st)}function Cc(e,t){var r=ue;ue|=2;var a=q0();(et!==e||st!==t)&&(ea=null,Do(e,t));do try{oT();break}catch(o){j0(e,o)}while(!0);if(Xh(),ue=r,xc.current=a,He!==null)throw Error(R(261));return et=null,st=0,Ke}function oT(){for(;He!==null;)H0(He)}function nT(){for(;He!==null&&!Ek();)H0(He)}function H0(e){var t=W0(e.alternate,e,Ht);e.memoizedProps=e.pendingProps,t===null?z0(e):He=t,lm.current=null}function z0(e){var t=e;do{var r=t.alternate;if(e=t.return,(t.flags&32768)===0){if(r=QP(r,t,Ht),r!==null){He=r;return}}else{if(r=YP(r,t),r!==null){r.flags&=32767,He=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ke=6,He=null;return}}if(t=t.sibling,t!==null){He=t;return}He=t=e}while(t!==null);Ke===0&&(Ke=5)}function _o(e,t,r){var a=me,o=cr.transition;try{cr.transition=null,me=1,sT(e,t,r,a)}finally{cr.transition=o,me=a}return null}function sT(e,t,r,a){do $n();while(Ba!==null);if((ue&6)!==0)throw Error(R(327));r=e.finishedWork;var o=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(R(177));e.callbackNode=null,e.callbackPriority=0;var n=r.lanes|r.childLanes;if(qk(e,n),e===et&&(He=et=null,st=0),(r.subtreeFlags&2064)===0&&(r.flags&2064)===0||Hu||(Hu=!0,G0(ac,function(){return $n(),null})),n=(r.flags&15990)!==0,(r.subtreeFlags&15990)!==0||n){n=cr.transition,cr.transition=null;var s=me;me=1;var i=ue;ue|=4,lm.current=null,eT(e,r),F0(r,e),TP(nh),nc=!!oh,nh=oh=null,e.current=r,tT(r,e,o),Dk(),ue=i,me=s,cr.transition=n}else e.current=r;if(Hu&&(Hu=!1,Ba=e,Sc=o),n=e.pendingLanes,n===0&&(Ha=null),Ok(r.stateNode,a),Mt(e,Ve()),t!==null)for(a=e.onRecoverableError,r=0;r<t.length;r++)o=t[r],a(o.value,{componentStack:o.stack,digest:o.digest});if(wc)throw wc=!1,e=Ih,Ih=null,e;return(Sc&1)!==0&&e.tag!==0&&$n(),n=e.pendingLanes,(n&1)!==0?e===kh?Hi++:(Hi=0,kh=e):Hi=0,Ja(),null}function $n(){if(Ba!==null){var e=Lx(Sc),t=cr.transition,r=me;try{if(cr.transition=null,me=16>e?16:e,Ba===null)var a=!1;else{if(e=Ba,Ba=null,Sc=0,(ue&6)!==0)throw Error(R(331));var o=ue;for(ue|=4,F=e.current;F!==null;){var n=F,s=n.child;if((F.flags&16)!==0){var i=n.deletions;if(i!==null){for(var l=0;l<i.length;l++){var u=i[l];for(F=u;F!==null;){var c=F;switch(c.tag){case 0:case 11:case 15:ji(8,c,n)}var d=c.child;if(d!==null)d.return=c,F=d;else for(;F!==null;){c=F;var f=c.sibling,p=c.return;if(M0(c),c===u){F=null;break}if(f!==null){f.return=p,F=f;break}F=p}}}var v=n.alternate;if(v!==null){var x=v.child;if(x!==null){v.child=null;do{var C=x.sibling;x.sibling=null,x=C}while(x!==null)}}F=n}}if((n.subtreeFlags&2064)!==0&&s!==null)s.return=n,F=s;else e:for(;F!==null;){if(n=F,(n.flags&2048)!==0)switch(n.tag){case 0:case 11:case 15:ji(9,n,n.return)}var g=n.sibling;if(g!==null){g.return=n.return,F=g;break e}F=n.return}}var m=e.current;for(F=m;F!==null;){s=F;var y=s.child;if((s.subtreeFlags&2064)!==0&&y!==null)y.return=s,F=y;else e:for(s=m;F!==null;){if(i=F,(i.flags&2048)!==0)try{switch(i.tag){case 0:case 11:case 15:Ec(9,i)}}catch(L){Oe(i,i.return,L)}if(i===s){F=null;break e}var b=i.sibling;if(b!==null){b.return=i.return,F=b;break e}F=i.return}}if(ue=o,Ja(),Mr&&typeof Mr.onPostCommitFiberRoot=="function")try{Mr.onPostCommitFiberRoot(Lc,e)}catch{}a=!0}return a}finally{me=r,cr.transition=t}}return!1}function Qv(e,t,r){t=Qn(r,t),t=L0(e,t,1),e=qa(e,t,1),t=kt(),e!==null&&(il(e,1,t),Mt(e,t))}function Oe(e,t,r){if(e.tag===3)Qv(e,e,r);else for(;t!==null;){if(t.tag===3){Qv(t,e,r);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Ha===null||!Ha.has(a))){e=Qn(r,e),e=I0(t,e,1),t=qa(t,e,1),e=kt(),t!==null&&(il(t,1,e),Mt(t,e));break}}t=t.return}}function iT(e,t,r){var a=e.pingCache;a!==null&&a.delete(t),t=kt(),e.pingedLanes|=e.suspendedLanes&r,et===e&&(st&r)===r&&(Ke===4||Ke===3&&(st&130023424)===st&&500>Ve()-cm?Do(e,0):um|=r),Mt(e,t)}function $0(e,t){t===0&&((e.mode&1)===0?t=1:(t=_u,_u<<=1,(_u&130023424)===0&&(_u=4194304)));var r=kt();e=ia(e,t),e!==null&&(il(e,t,r),Mt(e,r))}function lT(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),$0(e,r)}function uT(e,t){var r=0;switch(e.tag){case 13:var a=e.stateNode,o=e.memoizedState;o!==null&&(r=o.retryLane);break;case 19:a=e.stateNode;break;default:throw Error(R(314))}a!==null&&a.delete(t),$0(e,r)}var W0;W0=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Dt.current)Et=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return Et=!1,JP(e,t,r);Et=(e.flags&131072)!==0}else Et=!1,_e&&(t.flags&1048576)!==0&&Jx(t,fc,t.index);switch(t.lanes=0,t.tag){case 2:var a=t.type;Ju(e,t),e=t.pendingProps;var o=Gn(t,wt.current);zn(t,r),o=am(null,t,a,e,o,r);var n=om();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Nt(a)?(n=!0,cc(t)):n=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Yh(t),o.updater=Rc,t.stateNode=o,o._reactInternals=t,hh(t,a,e,r),t=yh(null,t,a,!0,n,r)):(t.tag=0,_e&&n&&$h(t),It(null,t,o,r),t=t.child),t;case 16:a=t.elementType;e:{switch(Ju(e,t),e=t.pendingProps,o=a._init,a=o(a._payload),t.type=a,o=t.tag=dT(a),e=xr(a,e),o){case 0:t=gh(null,t,a,e,r);break e;case 1:t=jv(null,t,a,e,r);break e;case 11:t=Uv(null,t,a,e,r);break e;case 14:t=Vv(null,t,a,xr(a.type,e),r);break e}throw Error(R(306,a,""))}return t;case 0:return a=t.type,o=t.pendingProps,o=t.elementType===a?o:xr(a,o),gh(e,t,a,o,r);case 1:return a=t.type,o=t.pendingProps,o=t.elementType===a?o:xr(a,o),jv(e,t,a,o,r);case 3:e:{if(_0(t),e===null)throw Error(R(387));a=t.pendingProps,n=t.memoizedState,o=n.element,r0(e,t),mc(t,a,null,r);var s=t.memoizedState;if(a=s.element,n.isDehydrated)if(n={element:a,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=n,t.memoizedState=n,t.flags&256){o=Qn(Error(R(423)),t),t=qv(e,t,a,r,o);break e}else if(a!==o){o=Qn(Error(R(424)),t),t=qv(e,t,a,r,o);break e}else for(zt=ja(t.stateNode.containerInfo.firstChild),$t=t,_e=!0,Sr=null,r=e0(t,null,a,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Kn(),a===o){t=la(e,t,r);break e}It(e,t,a,r)}t=t.child}return t;case 5:return a0(t),e===null&&dh(t),a=t.type,o=t.pendingProps,n=e!==null?e.memoizedProps:null,s=o.children,sh(a,o)?s=null:n!==null&&sh(a,n)&&(t.flags|=32),T0(e,t),It(e,t,s,r),t.child;case 6:return e===null&&dh(t),null;case 13:return A0(e,t,r);case 4:return Zh(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Xn(t,null,a,r):It(e,t,a,r),t.child;case 11:return a=t.type,o=t.pendingProps,o=t.elementType===a?o:xr(a,o),Uv(e,t,a,o,r);case 7:return It(e,t,t.pendingProps,r),t.child;case 8:return It(e,t,t.pendingProps.children,r),t.child;case 12:return It(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(a=t.type._context,o=t.pendingProps,n=t.memoizedProps,s=o.value,we(pc,a._currentValue),a._currentValue=s,n!==null)if(Lr(n.value,s)){if(n.children===o.children&&!Dt.current){t=la(e,t,r);break e}}else for(n=t.child,n!==null&&(n.return=t);n!==null;){var i=n.dependencies;if(i!==null){s=n.child;for(var l=i.firstContext;l!==null;){if(l.context===a){if(n.tag===1){l=oa(-1,r&-r),l.tag=2;var u=n.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}n.lanes|=r,l=n.alternate,l!==null&&(l.lanes|=r),fh(n.return,r,t),i.lanes|=r;break}l=l.next}}else if(n.tag===10)s=n.type===t.type?null:n.child;else if(n.tag===18){if(s=n.return,s===null)throw Error(R(341));s.lanes|=r,i=s.alternate,i!==null&&(i.lanes|=r),fh(s,r,t),s=n.sibling}else s=n.child;if(s!==null)s.return=n;else for(s=n;s!==null;){if(s===t){s=null;break}if(n=s.sibling,n!==null){n.return=s.return,s=n;break}s=s.return}n=s}It(e,t,o.children,r),t=t.child}return t;case 9:return o=t.type,a=t.pendingProps.children,zn(t,r),o=dr(o),a=a(o),t.flags|=1,It(e,t,a,r),t.child;case 14:return a=t.type,o=xr(a,t.pendingProps),o=xr(a.type,o),Vv(e,t,a,o,r);case 15:return k0(e,t,t.type,t.pendingProps,r);case 17:return a=t.type,o=t.pendingProps,o=t.elementType===a?o:xr(a,o),Ju(e,t),t.tag=1,Nt(a)?(e=!0,cc(t)):e=!1,zn(t,r),b0(t,a,o),hh(t,a,o,r),yh(null,t,a,!0,e,r);case 19:return R0(e,t,r);case 22:return P0(e,t,r)}throw Error(R(156,t.tag))};function G0(e,t){return wx(e,t)}function cT(e,t,r,a){this.tag=e,this.key=r,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=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ur(e,t,r,a){return new cT(e,t,r,a)}function hm(e){return e=e.prototype,!(!e||!e.isReactComponent)}function dT(e){if(typeof e=="function")return hm(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Dh)return 11;if(e===Nh)return 14}return 2}function $a(e,t){var r=e.alternate;return r===null?(r=ur(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Zu(e,t,r,a,o,n){var s=2;if(a=e,typeof e=="function")hm(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case _n:return No(r.children,o,n,t);case Eh:s=8,o|=8;break;case Fp:return e=ur(12,r,t,o|2),e.elementType=Fp,e.lanes=n,e;case Up:return e=ur(13,r,t,o),e.elementType=Up,e.lanes=n,e;case Vp:return e=ur(19,r,t,o),e.elementType=Vp,e.lanes=n,e;case ax:return Nc(r,o,n,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case tx:s=10;break e;case rx:s=9;break e;case Dh:s=11;break e;case Nh:s=14;break e;case Ea:s=16,a=null;break e}throw Error(R(130,e==null?e:typeof e,""))}return t=ur(s,r,t,o),t.elementType=e,t.type=a,t.lanes=n,t}function No(e,t,r,a){return e=ur(7,e,a,t),e.lanes=r,e}function Nc(e,t,r,a){return e=ur(22,e,a,t),e.elementType=ax,e.lanes=r,e.stateNode={isHidden:!1},e}function Mp(e,t,r){return e=ur(6,e,null,t),e.lanes=r,e}function Op(e,t,r){return t=ur(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function fT(e,t,r,a,o){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=xp(0),this.expirationTimes=xp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xp(0),this.identifierPrefix=a,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function mm(e,t,r,a,o,n,s,i,l){return e=new fT(e,t,r,i,l),t===1?(t=1,n===!0&&(t|=8)):t=0,n=ur(3,null,null,t),e.current=n,n.stateNode=e,n.memoizedState={element:a,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Yh(n),e}function pT(e,t,r){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Tn,key:a==null?null:""+a,children:e,containerInfo:t,implementation:r}}function K0(e){if(!e)return Ga;e=e._reactInternals;e:{if(jo(e)!==e||e.tag!==1)throw Error(R(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Nt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(R(171))}if(e.tag===1){var r=e.type;if(Nt(r))return Kx(e,r,t)}return t}function X0(e,t,r,a,o,n,s,i,l){return e=mm(r,a,!0,e,o,n,s,i,l),e.context=K0(null),r=e.current,a=kt(),o=za(r),n=oa(a,o),n.callback=t??null,qa(r,n,o),e.current.lanes=o,il(e,o,a),Mt(e,a),e}function Mc(e,t,r,a){var o=t.current,n=kt(),s=za(o);return r=K0(r),t.context===null?t.context=r:t.pendingContext=r,t=oa(n,s),t.payload={element:e},a=a===void 0?null:a,a!==null&&(t.callback=a),e=qa(o,t,s),e!==null&&(br(e,o,s,n),Gu(e,o,s)),s}function bc(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function Yv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function gm(e,t){Yv(e,t),(e=e.alternate)&&Yv(e,t)}function hT(){return null}var J0=typeof reportError=="function"?reportError:function(e){console.error(e)};function ym(e){this._internalRoot=e}Oc.prototype.render=ym.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(R(409));Mc(e,t,null,null)};Oc.prototype.unmount=ym.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Uo(function(){Mc(null,e,null,null)}),t[sa]=null}};function Oc(e){this._internalRoot=e}Oc.prototype.unstable_scheduleHydration=function(e){if(e){var t=Px();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Na.length&&t!==0&&t<Na[r].priority;r++);Na.splice(r,0,e),r===0&&_x(e)}};function vm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Bc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Zv(){}function mT(e,t,r,a,o){if(o){if(typeof a=="function"){var n=a;a=function(){var u=bc(s);n.call(u)}}var s=X0(t,a,e,0,null,!1,!1,"",Zv);return e._reactRootContainer=s,e[sa]=s.current,Yi(e.nodeType===8?e.parentNode:e),Uo(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof a=="function"){var i=a;a=function(){var u=bc(l);i.call(u)}}var l=mm(e,0,!1,null,null,!1,!1,"",Zv);return e._reactRootContainer=l,e[sa]=l.current,Yi(e.nodeType===8?e.parentNode:e),Uo(function(){Mc(t,l,r,a)}),l}function Fc(e,t,r,a,o){var n=r._reactRootContainer;if(n){var s=n;if(typeof o=="function"){var i=o;o=function(){var l=bc(s);i.call(l)}}Mc(t,s,e,o)}else s=mT(r,t,e,o,a);return bc(s)}Ix=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Di(t.pendingLanes);r!==0&&(Bh(t,r|1),Mt(t,Ve()),(ue&6)===0&&(Yn=Ve()+500,Ja()))}break;case 13:Uo(function(){var a=ia(e,1);if(a!==null){var o=kt();br(a,e,1,o)}}),gm(e,1)}};Fh=function(e){if(e.tag===13){var t=ia(e,134217728);if(t!==null){var r=kt();br(t,e,134217728,r)}gm(e,134217728)}};kx=function(e){if(e.tag===13){var t=za(e),r=ia(e,t);if(r!==null){var a=kt();br(r,e,t,a)}gm(e,t)}};Px=function(){return me};Tx=function(e,t){var r=me;try{return me=e,t()}finally{me=r}};Jp=function(e,t,r){switch(t){case"input":if(Hp(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var a=r[t];if(a!==e&&a.form===e.form){var o=Tc(a);if(!o)throw Error(R(90));nx(a),Hp(a,o)}}}break;case"textarea":ix(e,r);break;case"select":t=r.value,t!=null&&Vn(e,!!r.multiple,t,!1)}};hx=dm;mx=Uo;var gT={usingClientEntryPoint:!1,Events:[ul,Dn,Tc,fx,px,dm]},_i={findFiberByHostInstance:Ao,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},yT={bundleType:_i.bundleType,version:_i.version,rendererPackageName:_i.rendererPackageName,rendererConfig:_i.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ua.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=vx(e),e===null?null:e.stateNode},findFiberByHostInstance:_i.findFiberByHostInstance||hT,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Ai=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Ai.isDisabled&&Ai.supportsFiber))try{Lc=Ai.inject(yT),Mr=Ai}catch{}var Ai;Kt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=gT;Kt.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!vm(t))throw Error(R(200));return pT(e,t,null,r)};Kt.createRoot=function(e,t){if(!vm(e))throw Error(R(299));var r=!1,a="",o=J0;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=mm(e,1,!1,null,null,r,!1,a,o),e[sa]=t.current,Yi(e.nodeType===8?e.parentNode:e),new ym(t)};Kt.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(R(188)):(e=Object.keys(e).join(","),Error(R(268,e)));return e=vx(t),e=e===null?null:e.stateNode,e};Kt.flushSync=function(e){return Uo(e)};Kt.hydrate=function(e,t,r){if(!Bc(t))throw Error(R(200));return Fc(null,e,t,!0,r)};Kt.hydrateRoot=function(e,t,r){if(!vm(e))throw Error(R(405));var a=r!=null&&r.hydratedSources||null,o=!1,n="",s=J0;if(r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(n=r.identifierPrefix),r.onRecoverableError!==void 0&&(s=r.onRecoverableError)),t=X0(t,null,e,1,r??null,o,!1,n,s),e[sa]=t.current,Yi(e),a)for(e=0;e<a.length;e++)r=a[e],o=r._getVersion,o=o(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,o]:t.mutableSourceEagerHydrationData.push(r,o);return new Oc(t)};Kt.render=function(e,t,r){if(!Bc(t))throw Error(R(200));return Fc(null,e,t,!1,r)};Kt.unmountComponentAtNode=function(e){if(!Bc(e))throw Error(R(40));return e._reactRootContainer?(Uo(function(){Fc(null,null,e,!1,function(){e._reactRootContainer=null,e[sa]=null})}),!0):!1};Kt.unstable_batchedUpdates=dm;Kt.unstable_renderSubtreeIntoContainer=function(e,t,r,a){if(!Bc(r))throw Error(R(200));if(e==null||e._reactInternals===void 0)throw Error(R(38));return Fc(e,t,r,!1,a)};Kt.version="18.3.1-next-f1338f8080-20240426"});var xm=Zr((ED,Z0)=>{"use strict";function Y0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Y0)}catch(e){console.error(e)}}Y0(),Z0.exports=Q0()});var tw=Zr(wm=>{"use strict";var ew=xm();wm.createRoot=ew.createRoot,wm.hydrateRoot=ew.hydrateRoot;var DD});var dw=Zr(Vc=>{"use strict";var XT=Y(),JT=Symbol.for("react.element"),QT=Symbol.for("react.fragment"),YT=Object.prototype.hasOwnProperty,ZT=XT.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,e_={key:!0,ref:!0,__self:!0,__source:!0};function cw(e,t,r){var a,o={},n=null,s=null;r!==void 0&&(n=""+r),t.key!==void 0&&(n=""+t.key),t.ref!==void 0&&(s=t.ref);for(a in t)YT.call(t,a)&&!e_.hasOwnProperty(a)&&(o[a]=t[a]);if(e&&e.defaultProps)for(a in t=e.defaultProps,t)o[a]===void 0&&(o[a]=t[a]);return{$$typeof:JT,type:e,key:n,ref:s,props:o,_owner:ZT.current}}Vc.Fragment=QT;Vc.jsx=cw;Vc.jsxs=cw});var de=Zr((jD,fw)=>{"use strict";fw.exports=dw()});var bD={};ZI(bD,{initKiteChat:()=>dy});var Xr=D(Y(),1),OI=D(tw(),1);var z=D(Y(),1);function rw(e){var t,r,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=rw(e[t]))&&(a&&(a+=" "),a+=r)}else for(r in e)e[r]&&(a&&(a+=" "),a+=r);return a}function Uc(){for(var e,t,r=0,a="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=rw(e))&&(a&&(a+=" "),a+=t);return a}var vT=e=>{let t=wT(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:s=>{let i=s.split("-");return i[0]===""&&i.length!==1&&i.shift(),nw(i,t)||xT(s)},getConflictingClassGroupIds:(s,i)=>{let l=r[s]||[];return i&&a[s]?[...l,...a[s]]:l}}},nw=(e,t)=>{if(e.length===0)return t.classGroupId;let r=e[0],a=t.nextPart.get(r),o=a?nw(e.slice(1),a):void 0;if(o)return o;if(t.validators.length===0)return;let n=e.join("-");return t.validators.find(({validator:s})=>s(n))?.classGroupId},aw=/^\[(.+)\]$/,xT=e=>{if(aw.test(e)){let t=aw.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},wT=e=>{let{theme:t,prefix:r}=e,a={nextPart:new Map,validators:[]};return CT(Object.entries(e.classGroups),r).forEach(([n,s])=>{Cm(s,a,n,t)}),a},Cm=(e,t,r,a)=>{e.forEach(o=>{if(typeof o=="string"){let n=o===""?t:ow(t,o);n.classGroupId=r;return}if(typeof o=="function"){if(ST(o)){Cm(o(a),t,r,a);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([n,s])=>{Cm(s,ow(t,n),r,a)})})},ow=(e,t)=>{let r=e;return t.split("-").forEach(a=>{r.nextPart.has(a)||r.nextPart.set(a,{nextPart:new Map,validators:[]}),r=r.nextPart.get(a)}),r},ST=e=>e.isThemeGetter,CT=(e,t)=>t?e.map(([r,a])=>{let o=a.map(n=>typeof n=="string"?t+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([s,i])=>[t+s,i])):n);return[r,o]}):e,bT=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,a=new Map,o=(n,s)=>{r.set(n,s),t++,t>e&&(t=0,a=r,r=new Map)};return{get(n){let s=r.get(n);if(s!==void 0)return s;if((s=a.get(n))!==void 0)return o(n,s),s},set(n,s){r.has(n)?r.set(n,s):o(n,s)}}};var LT=e=>{let{separator:t,experimentalParseClassName:r}=e,a=t.length===1,o=t[0],n=t.length,s=i=>{let l=[],u=0,c=0,d;for(let C=0;C<i.length;C++){let g=i[C];if(u===0){if(g===o&&(a||i.slice(C,C+n)===t)){l.push(i.slice(c,C)),c=C+n;continue}if(g==="/"){d=C;continue}}g==="["?u++:g==="]"&&u--}let f=l.length===0?i:i.substring(c),p=f.startsWith("!"),v=p?f.substring(1):f,x=d&&d>c?d-c:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:v,maybePostfixModifierPosition:x}};return r?i=>r({className:i,parseClassName:s}):s},IT=e=>{if(e.length<=1)return e;let t=[],r=[];return e.forEach(a=>{a[0]==="["?(t.push(...r.sort(),a),r=[]):r.push(a)}),t.push(...r.sort()),t},kT=e=>({cache:bT(e.cacheSize),parseClassName:LT(e),...vT(e)}),PT=/\s+/,TT=(e,t)=>{let{parseClassName:r,getClassGroupId:a,getConflictingClassGroupIds:o}=t,n=[],s=e.trim().split(PT),i="";for(let l=s.length-1;l>=0;l-=1){let u=s[l],{modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=r(u),v=!!p,x=a(v?f.substring(0,p):f);if(!x){if(!v){i=u+(i.length>0?" "+i:i);continue}if(x=a(f),!x){i=u+(i.length>0?" "+i:i);continue}v=!1}let C=IT(c).join(":"),g=d?C+"!":C,m=g+x;if(n.includes(m))continue;n.push(m);let y=o(x,v);for(let b=0;b<y.length;++b){let L=y[b];n.push(g+L)}i=u+(i.length>0?" "+i:i)}return i};function _T(){let e=0,t,r,a="";for(;e<arguments.length;)(t=arguments[e++])&&(r=sw(t))&&(a&&(a+=" "),a+=r);return a}var sw=e=>{if(typeof e=="string")return e;let t,r="";for(let a=0;a<e.length;a++)e[a]&&(t=sw(e[a]))&&(r&&(r+=" "),r+=t);return r};function AT(e,...t){let r,a,o,n=s;function s(l){let u=t.reduce((c,d)=>d(c),e());return r=kT(u),a=r.cache.get,o=r.cache.set,n=i,i(l)}function i(l){let u=a(l);if(u)return u;let c=TT(l,r);return o(l,c),c}return function(){return n(_T.apply(null,arguments))}}var ke=e=>{let t=r=>r[e]||[];return t.isThemeGetter=!0,t},iw=/^\[(?:([a-z-]+):)?(.+)\]$/i,RT=/^\d+\/\d+$/,ET=new Set(["px","full","screen"]),DT=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,NT=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,MT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,OT=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,BT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ca=e=>ts(e)||ET.has(e)||RT.test(e),Qa=e=>rs(e,"length",$T),ts=e=>!!e&&!Number.isNaN(Number(e)),Sm=e=>rs(e,"number",ts),dl=e=>!!e&&Number.isInteger(Number(e)),FT=e=>e.endsWith("%")&&ts(e.slice(0,-1)),ee=e=>iw.test(e),Ya=e=>DT.test(e),UT=new Set(["length","size","percentage"]),VT=e=>rs(e,UT,lw),jT=e=>rs(e,"position",lw),qT=new Set(["image","url"]),HT=e=>rs(e,qT,GT),zT=e=>rs(e,"",WT),fl=()=>!0,rs=(e,t,r)=>{let a=iw.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):r(a[2]):!1},$T=e=>NT.test(e)&&!MT.test(e),lw=()=>!1,WT=e=>OT.test(e),GT=e=>BT.test(e);var KT=()=>{let e=ke("colors"),t=ke("spacing"),r=ke("blur"),a=ke("brightness"),o=ke("borderColor"),n=ke("borderRadius"),s=ke("borderSpacing"),i=ke("borderWidth"),l=ke("contrast"),u=ke("grayscale"),c=ke("hueRotate"),d=ke("invert"),f=ke("gap"),p=ke("gradientColorStops"),v=ke("gradientColorStopPositions"),x=ke("inset"),C=ke("margin"),g=ke("opacity"),m=ke("padding"),y=ke("saturate"),b=ke("scale"),L=ke("sepia"),k=ke("skew"),_=ke("space"),T=ke("translate"),M=()=>["auto","contain","none"],B=()=>["auto","hidden","clip","visible","scroll"],W=()=>["auto",ee,t],ce=()=>[ee,t],ge=()=>["",ca,Qa],ft=()=>["auto",ts,ee],mi=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Jr=()=>["solid","dashed","dotted","double","none"],be=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],pt=()=>["start","end","center","between","around","evenly","stretch"],ht=()=>["","0",ee],Ta=()=>["auto","avoid","all","avoid-page","page","left","right","column"],nr=()=>[ts,ee];return{cacheSize:500,separator:":",theme:{colors:[fl],spacing:[ca,Qa],blur:["none","",Ya,ee],brightness:nr(),borderColor:[e],borderRadius:["none","","full",Ya,ee],borderSpacing:ce(),borderWidth:ge(),contrast:nr(),grayscale:ht(),hueRotate:nr(),invert:ht(),gap:ce(),gradientColorStops:[e],gradientColorStopPositions:[FT,Qa],inset:W(),margin:W(),opacity:nr(),padding:ce(),saturate:nr(),scale:nr(),sepia:ht(),skew:nr(),space:ce(),translate:ce()},classGroups:{aspect:[{aspect:["auto","square","video",ee]}],container:["container"],columns:[{columns:[Ya]}],"break-after":[{"break-after":Ta()}],"break-before":[{"break-before":Ta()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...mi(),ee]}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",dl,ee]}],basis:[{basis:W()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ee]}],grow:[{grow:ht()}],shrink:[{shrink:ht()}],order:[{order:["first","last","none",dl,ee]}],"grid-cols":[{"grid-cols":[fl]}],"col-start-end":[{col:["auto",{span:["full",dl,ee]},ee]}],"col-start":[{"col-start":ft()}],"col-end":[{"col-end":ft()}],"grid-rows":[{"grid-rows":[fl]}],"row-start-end":[{row:["auto",{span:[dl,ee]},ee]}],"row-start":[{"row-start":ft()}],"row-end":[{"row-end":ft()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ee]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ee]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...pt()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...pt(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...pt(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[m]}],px:[{px:[m]}],py:[{py:[m]}],ps:[{ps:[m]}],pe:[{pe:[m]}],pt:[{pt:[m]}],pr:[{pr:[m]}],pb:[{pb:[m]}],pl:[{pl:[m]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ee,t]}],"min-w":[{"min-w":[ee,t,"min","max","fit"]}],"max-w":[{"max-w":[ee,t,"none","full","min","max","fit","prose",{screen:[Ya]},Ya]}],h:[{h:[ee,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ee,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ee,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ee,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ya,Qa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Sm]}],"font-family":[{font:[fl]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ee]}],"line-clamp":[{"line-clamp":["none",ts,Sm]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ca,ee]}],"list-image":[{"list-image":["none",ee]}],"list-style-type":[{list:["none","disc","decimal",ee]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Jr(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ca,Qa]}],"underline-offset":[{"underline-offset":["auto",ca,ee]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:ce()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ee]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ee]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...mi(),jT]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",VT]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},HT]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-b":[{"rounded-b":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-ee":[{"rounded-ee":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...Jr(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:Jr()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...Jr()]}],"outline-offset":[{"outline-offset":[ca,ee]}],"outline-w":[{outline:[ca,Qa]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ge()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[ca,Qa]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ya,zT]}],"shadow-color":[{shadow:[fl]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...be(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":be()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[a]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Ya,ee]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[y]}],sepia:[{sepia:[L]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[L]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ee]}],duration:[{duration:nr()}],ease:[{ease:["linear","in","out","in-out",ee]}],delay:[{delay:nr()}],animate:[{animate:["none","spin","ping","pulse","bounce",ee]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[dl,ee]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ee]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ee]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ce()}],"scroll-mx":[{"scroll-mx":ce()}],"scroll-my":[{"scroll-my":ce()}],"scroll-ms":[{"scroll-ms":ce()}],"scroll-me":[{"scroll-me":ce()}],"scroll-mt":[{"scroll-mt":ce()}],"scroll-mr":[{"scroll-mr":ce()}],"scroll-mb":[{"scroll-mb":ce()}],"scroll-ml":[{"scroll-ml":ce()}],"scroll-p":[{"scroll-p":ce()}],"scroll-px":[{"scroll-px":ce()}],"scroll-py":[{"scroll-py":ce()}],"scroll-ps":[{"scroll-ps":ce()}],"scroll-pe":[{"scroll-pe":ce()}],"scroll-pt":[{"scroll-pt":ce()}],"scroll-pr":[{"scroll-pr":ce()}],"scroll-pb":[{"scroll-pb":ce()}],"scroll-pl":[{"scroll-pl":ce()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ee]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ca,Qa,Sm]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var uw=AT(KT);function Xt(...e){return uw(Uc(e))}var pw=D(de(),1);function De({className:e,type:t,...r}){return(0,pw.jsx)("input",{type:t,"data-slot":"input",className:Xt("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}var ze=D(Y(),1);var mw=D(Y(),1);function hw(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function pl(...e){return t=>{let r=!1,a=e.map(o=>{let n=hw(o,t);return!r&&typeof n=="function"&&(r=!0),n});if(r)return()=>{for(let o=0;o<a.length;o++){let n=a[o];typeof n=="function"?n():hw(e[o],null)}}}}function da(...e){return mw.useCallback(pl(...e),e)}var jc=D(de(),1),t_=Symbol.for("react.lazy"),qc=ze[" use ".trim().toString()];function r_(e){return typeof e=="object"&&e!==null&&"then"in e}function gw(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===t_&&"_payload"in e&&r_(e._payload)}function a_(e){let t=o_(e),r=ze.forwardRef((a,o)=>{let{children:n,...s}=a;gw(n)&&typeof qc=="function"&&(n=qc(n._payload));let i=ze.Children.toArray(n),l=i.find(s_);if(l){let u=l.props.children,c=i.map(d=>d===l?ze.Children.count(u)>1?ze.Children.only(null):ze.isValidElement(u)?u.props.children:null:d);return(0,jc.jsx)(t,{...s,ref:o,children:ze.isValidElement(u)?ze.cloneElement(u,void 0,c):null})}return(0,jc.jsx)(t,{...s,ref:o,children:n})});return r.displayName=`${e}.Slot`,r}var yw=a_("Slot");function o_(e){let t=ze.forwardRef((r,a)=>{let{children:o,...n}=r;if(gw(o)&&typeof qc=="function"&&(o=qc(o._payload)),ze.isValidElement(o)){let s=l_(o),i=i_(n,o.props);return o.type!==ze.Fragment&&(i.ref=a?pl(a,s):s),ze.cloneElement(o,i)}return ze.Children.count(o)>1?ze.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var n_=Symbol("radix.slottable");function s_(e){return ze.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===n_}function i_(e,t){let r={...t};for(let a in t){let o=e[a],n=t[a];/^on[A-Z]/.test(a)?o&&n?r[a]=(...i)=>{let l=n(...i);return o(...i),l}:o&&(r[a]=o):a==="style"?r[a]={...o,...n}:a==="className"&&(r[a]=[o,n].filter(Boolean).join(" "))}return{...e,...r}}function l_(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var vw=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,xw=Uc,ww=(e,t)=>r=>{var a;if(t?.variants==null)return xw(e,r?.class,r?.className);let{variants:o,defaultVariants:n}=t,s=Object.keys(o).map(u=>{let c=r?.[u],d=n?.[u];if(c===null)return null;let f=vw(c)||vw(d);return o[u][f]}),i=r&&Object.entries(r).reduce((u,c)=>{let[d,f]=c;return f===void 0||(u[d]=f),u},{}),l=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((u,c)=>{let{class:d,className:f,...p}=c;return Object.entries(p).every(v=>{let[x,C]=v;return Array.isArray(C)?C.includes({...n,...i}[x]):{...n,...i}[x]===C})?[...u,d,f]:u},[]);return xw(e,s,l,r?.class,r?.className)};var Sw=D(de(),1),u_=ww("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Ot({className:e,variant:t,size:r,asChild:a=!1,...o}){return(0,Sw.jsx)(a?yw:"button",{"data-slot":"button",className:Xt(u_({variant:t,size:r,className:e})),...o})}var Gw=D(Y(),1);var $=D(Y(),1);var bw=D(Y(),1),m_=D(xm(),1);var Xe=D(Y(),1);var Hc=D(de(),1);function Cw(e){let t=c_(e),r=Xe.forwardRef((a,o)=>{let{children:n,...s}=a,i=Xe.Children.toArray(n),l=i.find(f_);if(l){let u=l.props.children,c=i.map(d=>d===l?Xe.Children.count(u)>1?Xe.Children.only(null):Xe.isValidElement(u)?u.props.children:null:d);return(0,Hc.jsx)(t,{...s,ref:o,children:Xe.isValidElement(u)?Xe.cloneElement(u,void 0,c):null})}return(0,Hc.jsx)(t,{...s,ref:o,children:n})});return r.displayName=`${e}.Slot`,r}function c_(e){let t=Xe.forwardRef((r,a)=>{let{children:o,...n}=r;if(Xe.isValidElement(o)){let s=h_(o),i=p_(n,o.props);return o.type!==Xe.Fragment&&(i.ref=a?pl(a,s):s),Xe.cloneElement(o,i)}return Xe.Children.count(o)>1?Xe.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var d_=Symbol("radix.slottable");function f_(e){return Xe.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===d_}function p_(e,t){let r={...t};for(let a in t){let o=e[a],n=t[a];/^on[A-Z]/.test(a)?o&&n?r[a]=(...i)=>{let l=n(...i);return o(...i),l}:o&&(r[a]=o):a==="style"?r[a]={...o,...n}:a==="className"&&(r[a]=[o,n].filter(Boolean).join(" "))}return{...e,...r}}function h_(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Lw=D(de(),1),g_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],as=g_.reduce((e,t)=>{let r=Cw(`Primitive.${t}`),a=bw.forwardRef((o,n)=>{let{asChild:s,...i}=o,l=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,Lw.jsx)(l,{...i,ref:n})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});var Bt=D(Y(),1);var Iw=D(Y(),1),hl=globalThis?.document?Iw.useLayoutEffect:()=>{};var kw=D(Y(),1);function y_(e,t){return kw.useReducer((r,a)=>t[r][a]??r,e)}var os=e=>{let{present:t,children:r}=e,a=v_(t),o=typeof r=="function"?r({present:a.isPresent}):Bt.Children.only(r),n=da(a.ref,x_(o));return typeof r=="function"||a.isPresent?Bt.cloneElement(o,{ref:n}):null};os.displayName="Presence";function v_(e){let[t,r]=Bt.useState(),a=Bt.useRef(null),o=Bt.useRef(e),n=Bt.useRef("none"),s=e?"mounted":"unmounted",[i,l]=y_(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return Bt.useEffect(()=>{let u=zc(a.current);n.current=i==="mounted"?u:"none"},[i]),hl(()=>{let u=a.current,c=o.current;if(c!==e){let f=n.current,p=zc(u);e?l("MOUNT"):p==="none"||u?.display==="none"?l("UNMOUNT"):l(c&&f!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),hl(()=>{if(t){let u,c=t.ownerDocument.defaultView??window,d=p=>{let x=zc(a.current).includes(CSS.escape(p.animationName));if(p.target===t&&x&&(l("ANIMATION_END"),!o.current)){let C=t.style.animationFillMode;t.style.animationFillMode="forwards",u=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},f=p=>{p.target===t&&(n.current=zc(a.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{c.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:Bt.useCallback(u=>{a.current=u?getComputedStyle(u):null,r(u)},[])}}function zc(e){return e?.animationName||"none"}function x_(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var fa=D(Y(),1),Pw=D(de(),1);function Tw(e,t=[]){let r=[];function a(n,s){let i=fa.createContext(s),l=r.length;r=[...r,s];let u=d=>{let{scope:f,children:p,...v}=d,x=f?.[e]?.[l]||i,C=fa.useMemo(()=>v,Object.values(v));return(0,Pw.jsx)(x.Provider,{value:C,children:p})};u.displayName=n+"Provider";function c(d,f){let p=f?.[e]?.[l]||i,v=fa.useContext(p);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${n}\``)}return[u,c]}let o=()=>{let n=r.map(s=>fa.createContext(s));return function(i){let l=i?.[e]||n;return fa.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[a,w_(o,...t)]}function w_(...e){let t=e[0];if(e.length===1)return t;let r=()=>{let a=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(n){let s=a.reduce((i,{useScope:l,scopeName:u})=>{let d=l(n)[`__scope${u}`];return{...i,...d}},{});return fa.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var ns=D(Y(),1);function Za(e){let t=ns.useRef(e);return ns.useEffect(()=>{t.current=e}),ns.useMemo(()=>(...r)=>t.current?.(...r),[])}var $c=D(Y(),1),S_=D(de(),1),C_=$c.createContext(void 0);function _w(e){let t=$c.useContext(C_);return e||t||"ltr"}function Aw(e,[t,r]){return Math.min(r,Math.max(t,e))}var dN=!!(typeof window<"u"&&window.document&&window.document.createElement);function eo(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}var Ew=D(Y(),1),pe=D(de(),1);function b_(e,t){return Ew.useReducer((r,a)=>t[r][a]??r,e)}var bm="ScrollArea",[Dw,CN]=Tw(bm),[L_,pr]=Dw(bm),Nw=$.forwardRef((e,t)=>{let{__scopeScrollArea:r,type:a="hover",dir:o,scrollHideDelay:n=600,...s}=e,[i,l]=$.useState(null),[u,c]=$.useState(null),[d,f]=$.useState(null),[p,v]=$.useState(null),[x,C]=$.useState(null),[g,m]=$.useState(0),[y,b]=$.useState(0),[L,k]=$.useState(!1),[_,T]=$.useState(!1),M=da(t,W=>l(W)),B=_w(o);return(0,pe.jsx)(L_,{scope:r,type:a,dir:B,scrollHideDelay:n,scrollArea:i,viewport:u,onViewportChange:c,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:v,scrollbarXEnabled:L,onScrollbarXEnabledChange:k,scrollbarY:x,onScrollbarYChange:C,scrollbarYEnabled:_,onScrollbarYEnabledChange:T,onCornerWidthChange:m,onCornerHeightChange:b,children:(0,pe.jsx)(as.div,{dir:B,...s,ref:M,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":y+"px",...e.style}})})});Nw.displayName=bm;var Mw="ScrollAreaViewport",Ow=$.forwardRef((e,t)=>{let{__scopeScrollArea:r,children:a,nonce:o,...n}=e,s=pr(Mw,r),i=$.useRef(null),l=da(t,i,s.onViewportChange);return(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),(0,pe.jsx)(as.div,{"data-radix-scroll-area-viewport":"",...n,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:(0,pe.jsx)("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:a})})]})});Ow.displayName=Mw;var Br="ScrollAreaScrollbar",Lm=$.forwardRef((e,t)=>{let{forceMount:r,...a}=e,o=pr(Br,e.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:s}=o,i=e.orientation==="horizontal";return $.useEffect(()=>(i?n(!0):s(!0),()=>{i?n(!1):s(!1)}),[i,n,s]),o.type==="hover"?(0,pe.jsx)(I_,{...a,ref:t,forceMount:r}):o.type==="scroll"?(0,pe.jsx)(k_,{...a,ref:t,forceMount:r}):o.type==="auto"?(0,pe.jsx)(Bw,{...a,ref:t,forceMount:r}):o.type==="always"?(0,pe.jsx)(Im,{...a,ref:t}):null});Lm.displayName=Br;var I_=$.forwardRef((e,t)=>{let{forceMount:r,...a}=e,o=pr(Br,e.__scopeScrollArea),[n,s]=$.useState(!1);return $.useEffect(()=>{let i=o.scrollArea,l=0;if(i){let u=()=>{window.clearTimeout(l),s(!0)},c=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return i.addEventListener("pointerenter",u),i.addEventListener("pointerleave",c),()=>{window.clearTimeout(l),i.removeEventListener("pointerenter",u),i.removeEventListener("pointerleave",c)}}},[o.scrollArea,o.scrollHideDelay]),(0,pe.jsx)(os,{present:r||n,children:(0,pe.jsx)(Bw,{"data-state":n?"visible":"hidden",...a,ref:t})})}),k_=$.forwardRef((e,t)=>{let{forceMount:r,...a}=e,o=pr(Br,e.__scopeScrollArea),n=e.orientation==="horizontal",s=Xc(()=>l("SCROLL_END"),100),[i,l]=b_("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return $.useEffect(()=>{if(i==="idle"){let u=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[i,o.scrollHideDelay,l]),$.useEffect(()=>{let u=o.viewport,c=n?"scrollLeft":"scrollTop";if(u){let d=u[c],f=()=>{let p=u[c];d!==p&&(l("SCROLL"),s()),d=p};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[o.viewport,n,l,s]),(0,pe.jsx)(os,{present:r||i!=="hidden",children:(0,pe.jsx)(Im,{"data-state":i==="hidden"?"hidden":"visible",...a,ref:t,onPointerEnter:eo(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:eo(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),Bw=$.forwardRef((e,t)=>{let r=pr(Br,e.__scopeScrollArea),{forceMount:a,...o}=e,[n,s]=$.useState(!1),i=e.orientation==="horizontal",l=Xc(()=>{if(r.viewport){let u=r.viewport.offsetWidth<r.viewport.scrollWidth,c=r.viewport.offsetHeight<r.viewport.scrollHeight;s(i?u:c)}},10);return ss(r.viewport,l),ss(r.content,l),(0,pe.jsx)(os,{present:a||n,children:(0,pe.jsx)(Im,{"data-state":n?"visible":"hidden",...o,ref:t})})}),Im=$.forwardRef((e,t)=>{let{orientation:r="vertical",...a}=e,o=pr(Br,e.__scopeScrollArea),n=$.useRef(null),s=$.useRef(0),[i,l]=$.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=jw(i.viewport,i.content),c={...a,sizes:i,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:f=>n.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function d(f,p){return E_(f,s.current,i,p)}return r==="horizontal"?(0,pe.jsx)(P_,{...c,ref:t,onThumbPositionChange:()=>{if(o.viewport&&n.current){let f=o.viewport.scrollLeft,p=Rw(f,i,o.dir);n.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollLeft=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollLeft=d(f,o.dir))}}):r==="vertical"?(0,pe.jsx)(T_,{...c,ref:t,onThumbPositionChange:()=>{if(o.viewport&&n.current){let f=o.viewport.scrollTop,p=Rw(f,i);n.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollTop=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollTop=d(f))}}):null}),P_=$.forwardRef((e,t)=>{let{sizes:r,onSizesChange:a,...o}=e,n=pr(Br,e.__scopeScrollArea),[s,i]=$.useState(),l=$.useRef(null),u=da(t,l,n.onScrollbarXChange);return $.useEffect(()=>{l.current&&i(getComputedStyle(l.current))},[l]),(0,pe.jsx)(Uw,{"data-orientation":"horizontal",...o,ref:u,sizes:r,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Kc(r)+"px",...e.style},onThumbPointerDown:c=>e.onThumbPointerDown(c.x),onDragScroll:c=>e.onDragScroll(c.x),onWheelScroll:(c,d)=>{if(n.viewport){let f=n.viewport.scrollLeft+c.deltaX;e.onWheelScroll(f),Hw(f,d)&&c.preventDefault()}},onResize:()=>{l.current&&n.viewport&&s&&a({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Gc(s.paddingLeft),paddingEnd:Gc(s.paddingRight)}})}})}),T_=$.forwardRef((e,t)=>{let{sizes:r,onSizesChange:a,...o}=e,n=pr(Br,e.__scopeScrollArea),[s,i]=$.useState(),l=$.useRef(null),u=da(t,l,n.onScrollbarYChange);return $.useEffect(()=>{l.current&&i(getComputedStyle(l.current))},[l]),(0,pe.jsx)(Uw,{"data-orientation":"vertical",...o,ref:u,sizes:r,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Kc(r)+"px",...e.style},onThumbPointerDown:c=>e.onThumbPointerDown(c.y),onDragScroll:c=>e.onDragScroll(c.y),onWheelScroll:(c,d)=>{if(n.viewport){let f=n.viewport.scrollTop+c.deltaY;e.onWheelScroll(f),Hw(f,d)&&c.preventDefault()}},onResize:()=>{l.current&&n.viewport&&s&&a({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Gc(s.paddingTop),paddingEnd:Gc(s.paddingBottom)}})}})}),[__,Fw]=Dw(Br),Uw=$.forwardRef((e,t)=>{let{__scopeScrollArea:r,sizes:a,hasThumb:o,onThumbChange:n,onThumbPointerUp:s,onThumbPointerDown:i,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:c,onResize:d,...f}=e,p=pr(Br,r),[v,x]=$.useState(null),C=da(t,M=>x(M)),g=$.useRef(null),m=$.useRef(""),y=p.viewport,b=a.content-a.viewport,L=Za(c),k=Za(l),_=Xc(d,10);function T(M){if(g.current){let B=M.clientX-g.current.left,W=M.clientY-g.current.top;u({x:B,y:W})}}return $.useEffect(()=>{let M=B=>{let W=B.target;v?.contains(W)&&L(B,b)};return document.addEventListener("wheel",M,{passive:!1}),()=>document.removeEventListener("wheel",M,{passive:!1})},[y,v,b,L]),$.useEffect(k,[a,k]),ss(v,_),ss(p.content,_),(0,pe.jsx)(__,{scope:r,scrollbar:v,hasThumb:o,onThumbChange:Za(n),onThumbPointerUp:Za(s),onThumbPositionChange:k,onThumbPointerDown:Za(i),children:(0,pe.jsx)(as.div,{...f,ref:C,style:{position:"absolute",...f.style},onPointerDown:eo(e.onPointerDown,M=>{M.button===0&&(M.target.setPointerCapture(M.pointerId),g.current=v.getBoundingClientRect(),m.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),T(M))}),onPointerMove:eo(e.onPointerMove,T),onPointerUp:eo(e.onPointerUp,M=>{let B=M.target;B.hasPointerCapture(M.pointerId)&&B.releasePointerCapture(M.pointerId),document.body.style.webkitUserSelect=m.current,p.viewport&&(p.viewport.style.scrollBehavior=""),g.current=null})})})}),Wc="ScrollAreaThumb",km=$.forwardRef((e,t)=>{let{forceMount:r,...a}=e,o=Fw(Wc,e.__scopeScrollArea);return(0,pe.jsx)(os,{present:r||o.hasThumb,children:(0,pe.jsx)(A_,{ref:t,...a})})}),A_=$.forwardRef((e,t)=>{let{__scopeScrollArea:r,style:a,...o}=e,n=pr(Wc,r),s=Fw(Wc,r),{onThumbPositionChange:i}=s,l=da(t,d=>s.onThumbChange(d)),u=$.useRef(void 0),c=Xc(()=>{u.current&&(u.current(),u.current=void 0)},100);return $.useEffect(()=>{let d=n.viewport;if(d){let f=()=>{if(c(),!u.current){let p=D_(d,i);u.current=p,i()}};return i(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[n.viewport,c,i]),(0,pe.jsx)(as.div,{"data-state":s.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...a},onPointerDownCapture:eo(e.onPointerDownCapture,d=>{let p=d.target.getBoundingClientRect(),v=d.clientX-p.left,x=d.clientY-p.top;s.onThumbPointerDown({x:v,y:x})}),onPointerUp:eo(e.onPointerUp,s.onThumbPointerUp)})});km.displayName=Wc;var Pm="ScrollAreaCorner",Vw=$.forwardRef((e,t)=>{let r=pr(Pm,e.__scopeScrollArea),a=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&a?(0,pe.jsx)(R_,{...e,ref:t}):null});Vw.displayName=Pm;var R_=$.forwardRef((e,t)=>{let{__scopeScrollArea:r,...a}=e,o=pr(Pm,r),[n,s]=$.useState(0),[i,l]=$.useState(0),u=!!(n&&i);return ss(o.scrollbarX,()=>{let c=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(c),l(c)}),ss(o.scrollbarY,()=>{let c=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(c),s(c)}),u?(0,pe.jsx)(as.div,{...a,ref:t,style:{width:n,height:i,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Gc(e){return e?parseInt(e,10):0}function jw(e,t){let r=e/t;return isNaN(r)?0:r}function Kc(e){let t=jw(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,a=(e.scrollbar.size-r)*t;return Math.max(a,18)}function E_(e,t,r,a="ltr"){let o=Kc(r),n=o/2,s=t||n,i=o-s,l=r.scrollbar.paddingStart+s,u=r.scrollbar.size-r.scrollbar.paddingEnd-i,c=r.content-r.viewport,d=a==="ltr"?[0,c]:[c*-1,0];return qw([l,u],d)(e)}function Rw(e,t,r="ltr"){let a=Kc(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,n=t.scrollbar.size-o,s=t.content-t.viewport,i=n-a,l=r==="ltr"?[0,s]:[s*-1,0],u=Aw(e,l);return qw([0,s],[0,i])(u)}function qw(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let a=(t[1]-t[0])/(e[1]-e[0]);return t[0]+a*(r-e[0])}}function Hw(e,t){return e>0&&e<t}var D_=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},a=0;return(function o(){let n={left:e.scrollLeft,top:e.scrollTop},s=r.left!==n.left,i=r.top!==n.top;(s||i)&&t(),r=n,a=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(a)};function Xc(e,t){let r=Za(e),a=$.useRef(0);return $.useEffect(()=>()=>window.clearTimeout(a.current),[]),$.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(r,t)},[r,t])}function ss(e,t){let r=Za(t);hl(()=>{let a=0;if(e){let o=new ResizeObserver(()=>{cancelAnimationFrame(a),a=window.requestAnimationFrame(r)});return o.observe(e),()=>{window.cancelAnimationFrame(a),o.unobserve(e)}}},[e,r])}var zw=Nw,$w=Ow;var Ww=Vw;var to=D(de(),1),Tm=Gw.forwardRef(({className:e,children:t,...r},a)=>(0,to.jsxs)(zw,{"data-slot":"scroll-area",className:Xt("relative",e),...r,children:[(0,to.jsx)($w,{ref:a,"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),(0,to.jsx)(M_,{}),(0,to.jsx)(Ww,{})]}));Tm.displayName="ScrollArea";function M_({className:e,orientation:t="vertical",...r}){return(0,to.jsx)(Lm,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Xt("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...r,children:(0,to.jsx)(km,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}var Qc=D(Y());var Kw=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),O_=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,a)=>a?a.toUpperCase():r.toLowerCase()),_m=e=>{let t=O_(e);return t.charAt(0).toUpperCase()+t.slice(1)},Jc=(...e)=>e.filter((t,r,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===r).join(" ").trim(),Xw=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var ml=D(Y());var Jw={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var Qw=(0,ml.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:a,className:o="",children:n,iconNode:s,...i},l)=>(0,ml.createElement)("svg",{ref:l,...Jw,width:t,height:t,stroke:e,strokeWidth:a?Number(r)*24/Number(t):r,className:Jc("lucide",o),...!n&&!Xw(i)&&{"aria-hidden":"true"},...i},[...s.map(([u,c])=>(0,ml.createElement)(u,c)),...Array.isArray(n)?n:[n]]));var V=(e,t)=>{let r=(0,Qc.forwardRef)(({className:a,...o},n)=>(0,Qc.createElement)(Qw,{ref:n,iconNode:t,className:Jc(`lucide-${Kw(_m(e))}`,`lucide-${e}`,a),...o}));return r.displayName=_m(e),r};var B_=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],gl=V("activity",B_);var F_=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],is=V("arrow-left",F_);var U_=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],yl=V("arrow-up",U_);var V_=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],vl=V("calendar",V_);var j_=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],xl=V("chevron-down",j_);var q_=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Ir=V("circle-alert",q_);var H_=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],tt=V("circle-check",H_);var z_=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],kr=V("circle-x",z_);var $_=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],qo=V("clock",$_);var W_=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],pa=V("command",W_);var G_=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],ha=V("corner-down-left",G_);var K_=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Ho=V("credit-card",K_);var X_=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],zo=V("crown",X_);var J_=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],$o=V("dollar-sign",J_);var Q_=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],ls=V("file-spreadsheet",Q_);var Y_=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],us=V("key",Y_);var Z_=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],wl=V("laptop",Z_);var eA=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Jt=V("loader-circle",eA);var tA=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],cs=V("mail",tA);var rA=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],ds=V("map-pin",rA);var aA=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],Sl=V("paperclip",aA);var oA=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],fs=V("refresh-cw",oA);var nA=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Wo=V("search",nA);var sA=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],ps=V("shield",sA);var iA=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],Cl=V("smartphone",iA);var lA=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Fr=V("sparkles",lA);var uA=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],Ft=V("square-pen",uA);var cA=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],bl=V("trending-up",cA);var dA=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],hs=V("users",dA);var fA=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ro=V("x",fA);var pA=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Ll=V("zap",pA);var Be=D(de(),1);function Yw({phase:e,progressSteps:t=[]}){return(0,Be.jsxs)("div",{className:"mb-3 rounded-lg bg-muted/40 px-3 py-3 text-xs text-muted-foreground transition-colors",children:[e==="thinking"&&t.length===0&&(0,Be.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Be.jsx)(Jt,{className:"h-3.5 w-3.5 animate-spin"}),(0,Be.jsx)("span",{children:"Thinking\u2026"})]}),e==="searching"&&(0,Be.jsxs)("div",{className:"space-y-2 animate-in fade-in-0 duration-300",children:[(0,Be.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Be.jsx)(Wo,{className:"h-3.5 w-3.5 opacity-70"}),(0,Be.jsx)("span",{children:"Searching across pages\u2026"})]}),(0,Be.jsxs)("ul",{className:"ml-6 list-disc space-y-1",children:[(0,Be.jsx)("li",{className:"opacity-90",children:"Checking recent changes"}),(0,Be.jsx)("li",{className:"opacity-90",children:"Scanning documentation"}),(0,Be.jsx)("li",{className:"opacity-90",children:"Summarizing relevant sections"})]})]}),(e==="thinking"||e==="executing"||e==="responding")&&t.length>0&&(0,Be.jsxs)("div",{className:"space-y-2 animate-in fade-in-0 duration-200",children:[t.map((r,a)=>(0,Be.jsxs)("div",{className:`flex items-center gap-2 transition-opacity duration-200 ${r.completed?"opacity-60":"opacity-100"}`,children:[r.completed?(0,Be.jsx)(tt,{className:"h-3.5 w-3.5 text-green-500 flex-shrink-0"}):(0,Be.jsx)(Jt,{className:"h-3.5 w-3.5 animate-spin flex-shrink-0"}),(0,Be.jsx)("span",{className:r.completed?"line-through":"",children:r.message})]},a)),e==="responding"&&(0,Be.jsxs)("div",{className:"flex items-center gap-2 opacity-100 animate-in fade-in-0 duration-200",children:[(0,Be.jsx)(Jt,{className:"h-3.5 w-3.5 animate-spin flex-shrink-0"}),(0,Be.jsx)("span",{children:"Preparing response..."})]})]})]})}var Zw=D(Y(),1);var Pr=D(de(),1);function eS({title:e,links:t}){let[r,a]=Zw.useState(!1);return(0,Pr.jsxs)("div",{className:"text-xs text-muted-foreground",children:[(0,Pr.jsx)("button",{type:"button",onClick:()=>a(o=>!o),className:"flex w-full items-center gap-2 px-0 py-0","aria-expanded":r,children:(0,Pr.jsxs)("div",{className:"flex items-center gap-1.5",children:[r?(0,Pr.jsx)(xl,{className:"h-3 w-3 opacity-70"}):(0,Pr.jsx)(Wo,{className:"h-3 w-3 opacity-70"}),(0,Pr.jsx)("span",{children:e})]})}),r&&t.length>0&&(0,Pr.jsx)("ul",{className:"ml-5 mt-1 space-y-0.5",children:t.map(o=>(0,Pr.jsx)("li",{children:(0,Pr.jsx)("a",{href:o.href,target:"_blank",rel:"noreferrer",className:"text-primary hover:underline",children:o.label})},o.href))})]})}var kl=D(de(),1),Ur=D(Y(),1);var tS=D(Y(),1),ms=(0,tS.createContext)({});var rS=D(Y(),1);function gs(e){let t=(0,rS.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Rm=D(de(),1),iS=D(Y(),1),Go=D(Y(),1);var aS=D(Y(),1),ao=(0,aS.createContext)(null);var nS=D(de(),1),Yc=D(Y(),1),ma=D(Y(),1);var oS=D(Y(),1),ys=(0,oS.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});var Am=class extends Yc.Component{getSnapshotBeforeUpdate(t){let r=this.props.childRef.current;if(r&&t.isPresent&&!this.props.isPresent){let a=this.props.sizeRef.current;a.height=r.offsetHeight||0,a.width=r.offsetWidth||0,a.top=r.offsetTop,a.left=r.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}};function sS({children:e,isPresent:t}){let r=(0,ma.useId)(),a=(0,ma.useRef)(null),o=(0,ma.useRef)({width:0,height:0,top:0,left:0}),{nonce:n}=(0,ma.useContext)(ys);return(0,ma.useInsertionEffect)(()=>{let{width:s,height:i,top:l,left:u}=o.current;if(t||!a.current||!s||!i)return;a.current.dataset.motionPopId=r;let c=document.createElement("style");return n&&(c.nonce=n),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`
|
|
9
|
-
[data-motion-pop-id="${
|
|
8
|
+
`+n.stack}return{value:e,source:t,stack:o,digest:null}}function Kc(e,t,a){return{value:e,source:null,stack:a??null,digest:t??null}}function Rf(e,t){try{console.error(t.value)}catch(a){setTimeout(function(){throw a})}}var kw=typeof WeakMap=="function"?WeakMap:Map;function uy(e,t,a){a=Va(-1,a),a.tag=3,a.payload={element:null};var r=t.value;return a.callback=function(){ru||(ru=!0,_f=r),Rf(e,t)},a}function dy(e,t,a){a=Va(-1,a),a.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;a.payload=function(){return r(o)},a.callback=function(){Rf(e,t)}}var n=e.stateNode;return n!==null&&typeof n.componentDidCatch=="function"&&(a.callback=function(){Rf(e,t),typeof r!="function"&&(vr===null?vr=new Set([this]):vr.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),a}function Cg(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new kw;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(a)||(o.add(a),e=Uw.bind(null,e,t,a),t.then(e,e))}function Sg(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 Ig(e,t,a,r,o){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,a.flags|=131072,a.flags&=-52805,a.tag===1&&(a.alternate===null?a.tag=17:(t=Va(-1,1),t.tag=2,yr(a,t,1))),a.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var bw=qa.ReactCurrentOwner,vt=!1;function ft(e,t,a,r){t.child=e===null?Ux(t,null,a,r):nn(t,e.child,a,r)}function wg(e,t,a,r,o){a=a.render;var n=t.ref;return en(t,o),r=yp(e,t,a,r,n,o),a=vp(),e!==null&&!vt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Ha(e,t,o)):(Ie&&a&&sp(t),t.flags|=1,ft(e,t,r,o),t.child)}function kg(e,t,a,r,o){if(e===null){var n=a.type;return typeof n=="function"&&!Ap(n)&&n.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(t.tag=15,t.type=n,cy(e,t,n,r,o)):(e=Bl(a.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(n=e.child,(e.lanes&o)===0){var s=n.memoizedProps;if(a=a.compare,a=a!==null?a:Qs,a(s,r)&&e.ref===t.ref)return Ha(e,t,o)}return t.flags|=1,e=Cr(n,r),e.ref=t.ref,e.return=t,t.child=e}function cy(e,t,a,r,o){if(e!==null){var n=e.memoizedProps;if(Qs(n,r)&&e.ref===t.ref)if(vt=!1,t.pendingProps=r=n,(e.lanes&o)!==0)(e.flags&131072)!==0&&(vt=!0);else return t.lanes=e.lanes,Ha(e,t,o)}return Df(e,t,a,r,o)}function fy(e,t,a){var r=t.pendingProps,o=r.children,n=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ge(Xo,Rt),Rt|=a;else{if((a&1073741824)===0)return e=n!==null?n.baseLanes|a:a,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ge(Xo,Rt),Rt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=n!==null?n.baseLanes:a,ge(Xo,Rt),Rt|=r}else n!==null?(r=n.baseLanes|a,t.memoizedState=null):r=a,ge(Xo,Rt),Rt|=r;return ft(e,t,o,a),t.child}function py(e,t){var a=t.ref;(e===null&&a!==null||e!==null&&e.ref!==a)&&(t.flags|=512,t.flags|=2097152)}function Df(e,t,a,r,o){var n=Ct(a)?so:st.current;return n=rn(t,n),en(t,o),a=yp(e,t,a,r,n,o),r=vp(),e!==null&&!vt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Ha(e,t,o)):(Ie&&r&&sp(t),t.flags|=1,ft(e,t,a,o),t.child)}function bg(e,t,a,r,o){if(Ct(a)){var n=!0;Kl(t)}else n=!1;if(en(t,o),t.stateNode===null)Nl(e,t),ly(t,a,r),Af(t,a,r,o),r=!0;else if(e===null){var s=t.stateNode,i=t.memoizedProps;s.props=i;var l=s.context,u=a.contextType;typeof u=="object"&&u!==null?u=Xt(u):(u=Ct(a)?so:st.current,u=rn(t,u));var d=a.getDerivedStateFromProps,c=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function";c||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(i!==r||l!==u)&&Lg(t,s,r,u),ur=!1;var p=t.memoizedState;s.state=p,Zl(t,r,s,o),l=t.memoizedState,i!==r||p!==l||Lt.current||ur?(typeof d=="function"&&(Tf(t,a,d,r),l=t.memoizedState),(i=ur||vg(t,a,i,r,p,l,u))?(c||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=u,r=i):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,zx(e,t),i=t.memoizedProps,u=t.type===t.elementType?i:aa(t.type,i),s.props=u,c=t.pendingProps,p=s.context,l=a.contextType,typeof l=="object"&&l!==null?l=Xt(l):(l=Ct(a)?so:st.current,l=rn(t,l));var g=a.getDerivedStateFromProps;(d=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(i!==c||p!==l)&&Lg(t,s,r,l),ur=!1,p=t.memoizedState,s.state=p,Zl(t,r,s,o);var L=t.memoizedState;i!==c||p!==L||Lt.current||ur?(typeof g=="function"&&(Tf(t,a,g,r),L=t.memoizedState),(u=ur||vg(t,a,u,r,p,L,l)||!1)?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,L,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,L,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=L),s.props=r,s.state=L,s.context=l,r=u):(typeof s.componentDidUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return Mf(e,t,a,r,n,o)}function Mf(e,t,a,r,o,n){py(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&cg(t,a,!1),Ha(e,t,n);r=t.stateNode,bw.current=t;var i=s&&typeof a.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=nn(t,e.child,null,n),t.child=nn(t,null,i,n)):ft(e,t,i,n),t.memoizedState=r.state,o&&cg(t,a,!0),t.child}function my(e){var t=e.stateNode;t.pendingContext?dg(e,t.pendingContext,t.pendingContext!==t.context):t.context&&dg(e,t.context,!1),mp(e,t.containerInfo)}function Pg(e,t,a,r,o){return on(),lp(o),t.flags|=256,ft(e,t,a,r),t.child}var Nf={dehydrated:null,treeContext:null,retryLane:0};function Ef(e){return{baseLanes:e,cachePool:null,transitions:null}}function hy(e,t,a){var r=t.pendingProps,o=we.current,n=!1,s=(t.flags&128)!==0,i;if((i=s)||(i=e!==null&&e.memoizedState===null?!1:(o&2)!==0),i?(n=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),ge(we,o&1),e===null)return bf(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(s=r.children,e=r.fallback,n?(r=t.mode,n=t.child,s={mode:"hidden",children:s},(r&1)===0&&n!==null?(n.childLanes=0,n.pendingProps=s):n=xu(s,r,0,null),e=no(e,r,a,null),n.return=t,e.return=t,n.sibling=e,t.child=n,t.child.memoizedState=Ef(a),t.memoizedState=Nf,e):Sp(t,s));if(o=e.memoizedState,o!==null&&(i=o.dehydrated,i!==null))return Pw(e,t,s,r,i,o,a);if(n){n=r.fallback,s=t.mode,o=e.child,i=o.sibling;var l={mode:"hidden",children:r.children};return(s&1)===0&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Cr(o,l),r.subtreeFlags=o.subtreeFlags&14680064),i!==null?n=Cr(i,n):(n=no(n,s,a,null),n.flags|=2),n.return=t,r.return=t,r.sibling=n,t.child=r,r=n,n=t.child,s=e.child.memoizedState,s=s===null?Ef(a):{baseLanes:s.baseLanes|a,cachePool:null,transitions:s.transitions},n.memoizedState=s,n.childLanes=e.childLanes&~a,t.memoizedState=Nf,r}return n=e.child,e=n.sibling,r=Cr(n,{mode:"visible",children:r.children}),(t.mode&1)===0&&(r.lanes=a),r.return=t,r.sibling=null,e!==null&&(a=t.deletions,a===null?(t.deletions=[e],t.flags|=16):a.push(e)),t.child=r,t.memoizedState=null,r}function Sp(e,t){return t=xu({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function wl(e,t,a,r){return r!==null&&lp(r),nn(t,e.child,null,a),e=Sp(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Pw(e,t,a,r,o,n,s){if(a)return t.flags&256?(t.flags&=-257,r=Kc(Error(D(422))),wl(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(n=r.fallback,o=t.mode,r=xu({mode:"visible",children:r.children},o,0,null),n=no(n,o,s,null),n.flags|=2,r.return=t,n.return=t,r.sibling=n,t.child=r,(t.mode&1)!==0&&nn(t,e.child,null,s),t.child.memoizedState=Ef(s),t.memoizedState=Nf,n);if((t.mode&1)===0)return wl(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var i=r.dgst;return r=i,n=Error(D(419)),r=Kc(n,r,void 0),wl(e,t,s,r)}if(i=(s&e.childLanes)!==0,vt||i){if(r=Ge,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=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:o=32;break;case 536870912:o=268435456;break;default:o=0}o=(o&(r.suspendedLanes|s))!==0?0:o,o!==0&&o!==n.retryLane&&(n.retryLane=o,za(e,o),sa(r,e,o,-1))}return Tp(),r=Kc(Error(D(421))),wl(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=_w.bind(null,e),o._reactRetry=t,null):(e=n.treeContext,Dt=xr(o.nextSibling),Mt=t,Ie=!0,oa=null,e!==null&&(Gt[jt++]=Ba,Gt[jt++]=Oa,Gt[jt++]=io,Ba=e.id,Oa=e.overflow,io=t),t=Sp(t,r.children),t.flags|=4096,t)}function Tg(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Pf(e.return,t,a)}function $c(e,t,a,r,o){var n=e.memoizedState;n===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:o}:(n.isBackwards=t,n.rendering=null,n.renderingStartTime=0,n.last=r,n.tail=a,n.tailMode=o)}function gy(e,t,a){var r=t.pendingProps,o=r.revealOrder,n=r.tail;if(ft(e,t,r.children,a),r=we.current,(r&2)!==0)r=r&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Tg(e,a,t);else if(e.tag===19)Tg(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ge(we,r),(t.mode&1)===0)t.memoizedState=null;else switch(o){case"forwards":for(a=t.child,o=null;a!==null;)e=a.alternate,e!==null&&Jl(e)===null&&(o=a),a=a.sibling;a=o,a===null?(o=t.child,t.child=null):(o=a.sibling,a.sibling=null),$c(t,!1,o,a,n);break;case"backwards":for(a=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Jl(e)===null){t.child=o;break}e=o.sibling,o.sibling=a,a=o,o=e}$c(t,!0,a,null,n);break;case"together":$c(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Nl(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ha(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),uo|=t.lanes,(a&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(D(153));if(t.child!==null){for(e=t.child,a=Cr(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Cr(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Tw(e,t,a){switch(t.tag){case 3:my(t),on();break;case 5:Hx(t);break;case 1:Ct(t.type)&&Kl(t);break;case 4:mp(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ge(Ql,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ge(we,we.current&1),t.flags|=128,null):(a&t.child.childLanes)!==0?hy(e,t,a):(ge(we,we.current&1),e=Ha(e,t,a),e!==null?e.sibling:null);ge(we,we.current&1);break;case 19:if(r=(a&t.childLanes)!==0,(e.flags&128)!==0){if(r)return gy(e,t,a);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ge(we,we.current),r)break;return null;case 22:case 23:return t.lanes=0,fy(e,t,a)}return Ha(e,t,a)}var xy,Ff,yy,vy;xy=function(e,t){for(var a=t.child;a!==null;){if(a.tag===5||a.tag===6)e.appendChild(a.stateNode);else if(a.tag!==4&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return;a=a.return}a.sibling.return=a.return,a=a.sibling}};Ff=function(){};yy=function(e,t,a,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,ro(va.current);var n=null;switch(a){case"input":o=af(e,o),r=af(e,r),n=[];break;case"select":o=be({},o,{value:void 0}),r=be({},r,{value:void 0}),n=[];break;case"textarea":o=nf(e,o),r=nf(e,r),n=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Gl)}lf(a,r);var s;a=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var i=o[u];for(s in i)i.hasOwnProperty(s)&&(a||(a={}),a[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(qs.hasOwnProperty(u)?n||(n=[]):(n=n||[]).push(u,null));for(u in r){var l=r[u];if(i=o?.[u],r.hasOwnProperty(u)&&l!==i&&(l!=null||i!=null))if(u==="style")if(i){for(s in i)!i.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(a||(a={}),a[s]="");for(s in l)l.hasOwnProperty(s)&&i[s]!==l[s]&&(a||(a={}),a[s]=l[s])}else a||(n||(n=[]),n.push(u,a)),a=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,i=i?i.__html:void 0,l!=null&&i!==l&&(n=n||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(n=n||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(qs.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&ye("scroll",e),n||i===l||(n=[])):(n=n||[]).push(u,l))}a&&(n=n||[]).push("style",a);var u=n;(t.updateQueue=u)&&(t.flags|=4)}};vy=function(e,t,a,r){a!==r&&(t.flags|=4)};function Ps(e,t){if(!Ie)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ot(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var o=e.child;o!==null;)a|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)a|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function Aw(e,t,a){var r=t.pendingProps;switch(ip(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ot(t),null;case 1:return Ct(t.type)&&jl(),ot(t),null;case 3:return r=t.stateNode,sn(),ve(Lt),ve(st),gp(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Sl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,oa!==null&&(qf(oa),oa=null))),Ff(e,t),ot(t),null;case 5:hp(t);var o=ro(ti.current);if(a=t.type,e!==null&&t.stateNode!=null)yy(e,t,a,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(D(166));return ot(t),null}if(e=ro(va.current),Sl(t)){r=t.stateNode,a=t.type;var n=t.memoizedProps;switch(r[xa]=t,r[Js]=n,e=(t.mode&1)!==0,a){case"dialog":ye("cancel",r),ye("close",r);break;case"iframe":case"object":case"embed":ye("load",r);break;case"video":case"audio":for(o=0;o<Ns.length;o++)ye(Ns[o],r);break;case"source":ye("error",r);break;case"img":case"image":case"link":ye("error",r),ye("load",r);break;case"details":ye("toggle",r);break;case"input":Bh(r,n),ye("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!n.multiple},ye("invalid",r);break;case"textarea":Vh(r,n),ye("invalid",r)}lf(a,n),o=null;for(var s in n)if(n.hasOwnProperty(s)){var i=n[s];s==="children"?typeof i=="string"?r.textContent!==i&&(n.suppressHydrationWarning!==!0&&Cl(r.textContent,i,e),o=["children",i]):typeof i=="number"&&r.textContent!==""+i&&(n.suppressHydrationWarning!==!0&&Cl(r.textContent,i,e),o=["children",""+i]):qs.hasOwnProperty(s)&&i!=null&&s==="onScroll"&&ye("scroll",r)}switch(a){case"input":ul(r),Oh(r,n,!0);break;case"textarea":ul(r),Uh(r);break;case"select":case"option":break;default:typeof n.onClick=="function"&&(r.onclick=Gl)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Kg(a)),e==="http://www.w3.org/1999/xhtml"?a==="script"?(e=s.createElement("div"),e.innerHTML="<script></script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(a,{is:r.is}):(e=s.createElement(a),a==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,a),e[xa]=t,e[Js]=r,xy(e,t,!1,!1),t.stateNode=e;e:{switch(s=uf(a,r),a){case"dialog":ye("cancel",e),ye("close",e),o=r;break;case"iframe":case"object":case"embed":ye("load",e),o=r;break;case"video":case"audio":for(o=0;o<Ns.length;o++)ye(Ns[o],e);o=r;break;case"source":ye("error",e),o=r;break;case"img":case"image":case"link":ye("error",e),ye("load",e),o=r;break;case"details":ye("toggle",e),o=r;break;case"input":Bh(e,r),o=af(e,r),ye("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=be({},r,{value:void 0}),ye("invalid",e);break;case"textarea":Vh(e,r),o=nf(e,r),ye("invalid",e);break;default:o=r}lf(a,o),i=o;for(n in i)if(i.hasOwnProperty(n)){var l=i[n];n==="style"?Qg(e,l):n==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&$g(e,l)):n==="children"?typeof l=="string"?(a!=="textarea"||l!=="")&&Ws(e,l):typeof l=="number"&&Ws(e,""+l):n!=="suppressContentEditableWarning"&&n!=="suppressHydrationWarning"&&n!=="autoFocus"&&(qs.hasOwnProperty(n)?l!=null&&n==="onScroll"&&ye("scroll",e):l!=null&&jf(e,n,l,s))}switch(a){case"input":ul(e),Oh(e,r,!1);break;case"textarea":ul(e),Uh(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Sr(r.value));break;case"select":e.multiple=!!r.multiple,n=r.value,n!=null?Qo(e,!!r.multiple,n,!1):r.defaultValue!=null&&Qo(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Gl)}switch(a){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 ot(t),null;case 6:if(e&&t.stateNode!=null)vy(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(D(166));if(a=ro(ti.current),ro(va.current),Sl(t)){if(r=t.stateNode,a=t.memoizedProps,r[xa]=t,(n=r.nodeValue!==a)&&(e=Mt,e!==null))switch(e.tag){case 3:Cl(r.nodeValue,a,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Cl(r.nodeValue,a,(e.mode&1)!==0)}n&&(t.flags|=4)}else r=(a.nodeType===9?a:a.ownerDocument).createTextNode(r),r[xa]=t,t.stateNode=r}return ot(t),null;case 13:if(ve(we),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ie&&Dt!==null&&(t.mode&1)!==0&&(t.flags&128)===0)Ox(),on(),t.flags|=98560,n=!1;else if(n=Sl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!n)throw Error(D(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(D(317));n[xa]=t}else on(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ot(t),n=!1}else oa!==null&&(qf(oa),oa=null),n=!0;if(!n)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=a,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(we.current&1)!==0?Ue===0&&(Ue=3):Tp())),t.updateQueue!==null&&(t.flags|=4),ot(t),null);case 4:return sn(),Ff(e,t),e===null&&Ys(t.stateNode.containerInfo),ot(t),null;case 10:return cp(t.type._context),ot(t),null;case 17:return Ct(t.type)&&jl(),ot(t),null;case 19:if(ve(we),n=t.memoizedState,n===null)return ot(t),null;if(r=(t.flags&128)!==0,s=n.rendering,s===null)if(r)Ps(n,!1);else{if(Ue!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=Jl(e),s!==null){for(t.flags|=128,Ps(n,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=a,a=t.child;a!==null;)n=a,e=r,n.flags&=14680066,s=n.alternate,s===null?(n.childLanes=0,n.lanes=e,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=s.childLanes,n.lanes=s.lanes,n.child=s.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=s.memoizedProps,n.memoizedState=s.memoizedState,n.updateQueue=s.updateQueue,n.type=s.type,e=s.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),a=a.sibling;return ge(we,we.current&1|2),t.child}e=e.sibling}n.tail!==null&&Me()>un&&(t.flags|=128,r=!0,Ps(n,!1),t.lanes=4194304)}else{if(!r)if(e=Jl(s),e!==null){if(t.flags|=128,r=!0,a=e.updateQueue,a!==null&&(t.updateQueue=a,t.flags|=4),Ps(n,!0),n.tail===null&&n.tailMode==="hidden"&&!s.alternate&&!Ie)return ot(t),null}else 2*Me()-n.renderingStartTime>un&&a!==1073741824&&(t.flags|=128,r=!0,Ps(n,!1),t.lanes=4194304);n.isBackwards?(s.sibling=t.child,t.child=s):(a=n.last,a!==null?a.sibling=s:t.child=s,n.last=s)}return n.tail!==null?(t=n.tail,n.rendering=t,n.tail=t.sibling,n.renderingStartTime=Me(),t.sibling=null,a=we.current,ge(we,r?a&1|2:a&1),t):(ot(t),null);case 22:case 23:return Pp(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(Rt&1073741824)!==0&&(ot(t),t.subtreeFlags&6&&(t.flags|=8192)):ot(t),null;case 24:return null;case 25:return null}throw Error(D(156,t.tag))}function Rw(e,t){switch(ip(t),t.tag){case 1:return Ct(t.type)&&jl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return sn(),ve(Lt),ve(st),gp(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return hp(t),null;case 13:if(ve(we),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(D(340));on()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ve(we),null;case 4:return sn(),null;case 10:return cp(t.type._context),null;case 22:case 23:return Pp(),null;case 24:return null;default:return null}}var kl=!1,nt=!1,Dw=typeof WeakSet=="function"?WeakSet:Set,U=null;function $o(e,t){var a=e.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(r){Te(e,t,r)}else a.current=null}function Bf(e,t,a){try{a()}catch(r){Te(e,t,r)}}var Ag=!1;function Mw(e,t){if(vf=Hl,e=wx(),np(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var o=r.anchorOffset,n=r.focusNode;r=r.focusOffset;try{a.nodeType,n.nodeType}catch{a=null;break e}var s=0,i=-1,l=-1,u=0,d=0,c=e,p=null;t:for(;;){for(var g;c!==a||o!==0&&c.nodeType!==3||(i=s+o),c!==n||r!==0&&c.nodeType!==3||(l=s+r),c.nodeType===3&&(s+=c.nodeValue.length),(g=c.firstChild)!==null;)p=c,c=g;for(;;){if(c===e)break t;if(p===a&&++u===o&&(i=s),p===n&&++d===r&&(l=s),(g=c.nextSibling)!==null)break;c=p,p=c.parentNode}c=g}a=i===-1||l===-1?null:{start:i,end:l}}else a=null}a=a||{start:0,end:0}}else a=null;for(Lf={focusedElem:e,selectionRange:a},Hl=!1,U=t;U!==null;)if(t=U,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,U=e;else for(;U!==null;){t=U;try{var L=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(L!==null){var C=L.memoizedProps,w=L.memoizedState,h=t.stateNode,m=h.getSnapshotBeforeUpdate(t.elementType===t.type?C:aa(t.type,C),w);h.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(D(163))}}catch(S){Te(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,U=e;break}U=t.return}return L=Ag,Ag=!1,L}function _s(e,t,a){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var n=o.destroy;o.destroy=void 0,n!==void 0&&Bf(t,a,n)}o=o.next}while(o!==r)}}function hu(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var a=t=t.next;do{if((a.tag&e)===e){var r=a.create;a.destroy=r()}a=a.next}while(a!==t)}}function Of(e){var t=e.ref;if(t!==null){var a=e.stateNode;e.tag,e=a,typeof t=="function"?t(e):t.current=e}}function Ly(e){var t=e.alternate;t!==null&&(e.alternate=null,Ly(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[xa],delete t[Js],delete t[If],delete t[mw],delete t[hw])),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 Cy(e){return e.tag===5||e.tag===3||e.tag===4}function Rg(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Cy(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 Vf(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.nodeType===8?a.parentNode.insertBefore(e,t):a.insertBefore(e,t):(a.nodeType===8?(t=a.parentNode,t.insertBefore(e,a)):(t=a,t.appendChild(e)),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Gl));else if(r!==4&&(e=e.child,e!==null))for(Vf(e,t,a),e=e.sibling;e!==null;)Vf(e,t,a),e=e.sibling}function Uf(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Uf(e,t,a),e=e.sibling;e!==null;)Uf(e,t,a),e=e.sibling}var Xe=null,ra=!1;function ir(e,t,a){for(a=a.child;a!==null;)Sy(e,t,a),a=a.sibling}function Sy(e,t,a){if(ya&&typeof ya.onCommitFiberUnmount=="function")try{ya.onCommitFiberUnmount(iu,a)}catch{}switch(a.tag){case 5:nt||$o(a,t);case 6:var r=Xe,o=ra;Xe=null,ir(e,t,a),Xe=r,ra=o,Xe!==null&&(ra?(e=Xe,a=a.stateNode,e.nodeType===8?e.parentNode.removeChild(a):e.removeChild(a)):Xe.removeChild(a.stateNode));break;case 18:Xe!==null&&(ra?(e=Xe,a=a.stateNode,e.nodeType===8?zc(e.parentNode,a):e.nodeType===1&&zc(e,a),$s(e)):zc(Xe,a.stateNode));break;case 4:r=Xe,o=ra,Xe=a.stateNode.containerInfo,ra=!0,ir(e,t,a),Xe=r,ra=o;break;case 0:case 11:case 14:case 15:if(!nt&&(r=a.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var n=o,s=n.destroy;n=n.tag,s!==void 0&&((n&2)!==0||(n&4)!==0)&&Bf(a,t,s),o=o.next}while(o!==r)}ir(e,t,a);break;case 1:if(!nt&&($o(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=a.memoizedProps,r.state=a.memoizedState,r.componentWillUnmount()}catch(i){Te(a,t,i)}ir(e,t,a);break;case 21:ir(e,t,a);break;case 22:a.mode&1?(nt=(r=nt)||a.memoizedState!==null,ir(e,t,a),nt=r):ir(e,t,a);break;default:ir(e,t,a)}}function Dg(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var a=e.stateNode;a===null&&(a=e.stateNode=new Dw),t.forEach(function(r){var o=zw.bind(null,e,r);a.has(r)||(a.add(r),r.then(o,o))})}}function ta(e,t){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var o=a[r];try{var n=e,s=t,i=s;e:for(;i!==null;){switch(i.tag){case 5:Xe=i.stateNode,ra=!1;break e;case 3:Xe=i.stateNode.containerInfo,ra=!0;break e;case 4:Xe=i.stateNode.containerInfo,ra=!0;break e}i=i.return}if(Xe===null)throw Error(D(160));Sy(n,s,o),Xe=null,ra=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(u){Te(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Iy(t,e),t=t.sibling}function Iy(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ta(t,e),ha(e),r&4){try{_s(3,e,e.return),hu(3,e)}catch(C){Te(e,e.return,C)}try{_s(5,e,e.return)}catch(C){Te(e,e.return,C)}}break;case 1:ta(t,e),ha(e),r&512&&a!==null&&$o(a,a.return);break;case 5:if(ta(t,e),ha(e),r&512&&a!==null&&$o(a,a.return),e.flags&32){var o=e.stateNode;try{Ws(o,"")}catch(C){Te(e,e.return,C)}}if(r&4&&(o=e.stateNode,o!=null)){var n=e.memoizedProps,s=a!==null?a.memoizedProps:n,i=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{i==="input"&&n.type==="radio"&&n.name!=null&&Gg(o,n),uf(i,s);var u=uf(i,n);for(s=0;s<l.length;s+=2){var d=l[s],c=l[s+1];d==="style"?Qg(o,c):d==="dangerouslySetInnerHTML"?$g(o,c):d==="children"?Ws(o,c):jf(o,d,c,u)}switch(i){case"input":rf(o,n);break;case"textarea":jg(o,n);break;case"select":var p=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!n.multiple;var g=n.value;g!=null?Qo(o,!!n.multiple,g,!1):p!==!!n.multiple&&(n.defaultValue!=null?Qo(o,!!n.multiple,n.defaultValue,!0):Qo(o,!!n.multiple,n.multiple?[]:"",!1))}o[Js]=n}catch(C){Te(e,e.return,C)}}break;case 6:if(ta(t,e),ha(e),r&4){if(e.stateNode===null)throw Error(D(162));o=e.stateNode,n=e.memoizedProps;try{o.nodeValue=n}catch(C){Te(e,e.return,C)}}break;case 3:if(ta(t,e),ha(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{$s(t.containerInfo)}catch(C){Te(e,e.return,C)}break;case 4:ta(t,e),ha(e);break;case 13:ta(t,e),ha(e),o=e.child,o.flags&8192&&(n=o.memoizedState!==null,o.stateNode.isHidden=n,!n||o.alternate!==null&&o.alternate.memoizedState!==null||(kp=Me())),r&4&&Dg(e);break;case 22:if(d=a!==null&&a.memoizedState!==null,e.mode&1?(nt=(u=nt)||d,ta(t,e),nt=u):ta(t,e),ha(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&(e.mode&1)!==0)for(U=e,d=e.child;d!==null;){for(c=U=d;U!==null;){switch(p=U,g=p.child,p.tag){case 0:case 11:case 14:case 15:_s(4,p,p.return);break;case 1:$o(p,p.return);var L=p.stateNode;if(typeof L.componentWillUnmount=="function"){r=p,a=p.return;try{t=r,L.props=t.memoizedProps,L.state=t.memoizedState,L.componentWillUnmount()}catch(C){Te(r,a,C)}}break;case 5:$o(p,p.return);break;case 22:if(p.memoizedState!==null){Ng(c);continue}}g!==null?(g.return=p,U=g):Ng(c)}d=d.sibling}e:for(d=null,c=e;;){if(c.tag===5){if(d===null){d=c;try{o=c.stateNode,u?(n=o.style,typeof n.setProperty=="function"?n.setProperty("display","none","important"):n.display="none"):(i=c.stateNode,l=c.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,i.style.display=Xg("display",s))}catch(C){Te(e,e.return,C)}}}else if(c.tag===6){if(d===null)try{c.stateNode.nodeValue=u?"":c.memoizedProps}catch(C){Te(e,e.return,C)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===e)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===e)break e;for(;c.sibling===null;){if(c.return===null||c.return===e)break e;d===c&&(d=null),c=c.return}d===c&&(d=null),c.sibling.return=c.return,c=c.sibling}}break;case 19:ta(t,e),ha(e),r&4&&Dg(e);break;case 21:break;default:ta(t,e),ha(e)}}function ha(e){var t=e.flags;if(t&2){try{e:{for(var a=e.return;a!==null;){if(Cy(a)){var r=a;break e}a=a.return}throw Error(D(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Ws(o,""),r.flags&=-33);var n=Rg(e);Uf(e,n,o);break;case 3:case 4:var s=r.stateNode.containerInfo,i=Rg(e);Vf(e,i,s);break;default:throw Error(D(161))}}catch(l){Te(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Nw(e,t,a){U=e,wy(e,t,a)}function wy(e,t,a){for(var r=(e.mode&1)!==0;U!==null;){var o=U,n=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||kl;if(!s){var i=o.alternate,l=i!==null&&i.memoizedState!==null||nt;i=kl;var u=nt;if(kl=s,(nt=l)&&!u)for(U=o;U!==null;)s=U,l=s.child,s.tag===22&&s.memoizedState!==null?Eg(o):l!==null?(l.return=s,U=l):Eg(o);for(;n!==null;)U=n,wy(n,t,a),n=n.sibling;U=o,kl=i,nt=u}Mg(e,t,a)}else(o.subtreeFlags&8772)!==0&&n!==null?(n.return=o,U=n):Mg(e,t,a)}}function Mg(e){for(;U!==null;){var t=U;if((t.flags&8772)!==0){var a=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:nt||hu(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!nt)if(a===null)r.componentDidMount();else{var o=t.elementType===t.type?a.memoizedProps:aa(t.type,a.memoizedProps);r.componentDidUpdate(o,a.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var n=t.updateQueue;n!==null&&gg(t,n,r);break;case 3:var s=t.updateQueue;if(s!==null){if(a=null,t.child!==null)switch(t.child.tag){case 5:a=t.child.stateNode;break;case 1:a=t.child.stateNode}gg(t,s,a)}break;case 5:var i=t.stateNode;if(a===null&&t.flags&4){a=i;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&a.focus();break;case"img":l.src&&(a.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var c=d.dehydrated;c!==null&&$s(c)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(D(163))}nt||t.flags&512&&Of(t)}catch(p){Te(t,t.return,p)}}if(t===e){U=null;break}if(a=t.sibling,a!==null){a.return=t.return,U=a;break}U=t.return}}function Ng(e){for(;U!==null;){var t=U;if(t===e){U=null;break}var a=t.sibling;if(a!==null){a.return=t.return,U=a;break}U=t.return}}function Eg(e){for(;U!==null;){var t=U;try{switch(t.tag){case 0:case 11:case 15:var a=t.return;try{hu(4,t)}catch(l){Te(t,a,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){Te(t,o,l)}}var n=t.return;try{Of(t)}catch(l){Te(t,n,l)}break;case 5:var s=t.return;try{Of(t)}catch(l){Te(t,s,l)}}}catch(l){Te(t,t.return,l)}if(t===e){U=null;break}var i=t.sibling;if(i!==null){i.return=t.return,U=i;break}U=t.return}}var Ew=Math.ceil,au=qa.ReactCurrentDispatcher,Ip=qa.ReactCurrentOwner,$t=qa.ReactCurrentBatchConfig,ie=0,Ge=null,Fe=null,Qe=0,Rt=0,Xo=kr(0),Ue=0,ni=null,uo=0,gu=0,wp=0,zs=null,yt=null,kp=0,un=1/0,Ea=null,ru=!1,_f=null,vr=null,bl=!1,pr=null,ou=0,Hs=0,zf=null,El=-1,Fl=0;function pt(){return(ie&6)!==0?Me():El!==-1?El:El=Me()}function Lr(e){return(e.mode&1)===0?1:(ie&2)!==0&&Qe!==0?Qe&-Qe:xw.transition!==null?(Fl===0&&(Fl=lx()),Fl):(e=fe,e!==0||(e=window.event,e=e===void 0?16:hx(e.type)),e)}function sa(e,t,a,r){if(50<Hs)throw Hs=0,zf=null,Error(D(185));si(e,a,r),((ie&2)===0||e!==Ge)&&(e===Ge&&((ie&2)===0&&(gu|=a),Ue===4&&cr(e,Qe)),St(e,r),a===1&&ie===0&&(t.mode&1)===0&&(un=Me()+500,fu&&br()))}function St(e,t){var a=e.callbackNode;vI(e,t);var r=zl(e,e===Ge?Qe:0);if(r===0)a!==null&&Hh(a),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(a!=null&&Hh(a),t===1)e.tag===0?gw(Fg.bind(null,e)):Ex(Fg.bind(null,e)),fw(function(){(ie&6)===0&&br()}),a=null;else{switch(ux(r)){case 1:a=Yf;break;case 4:a=sx;break;case 16:a=_l;break;case 536870912:a=ix;break;default:a=_l}a=My(a,ky.bind(null,e))}e.callbackPriority=t,e.callbackNode=a}}function ky(e,t){if(El=-1,Fl=0,(ie&6)!==0)throw Error(D(327));var a=e.callbackNode;if(tn()&&e.callbackNode!==a)return null;var r=zl(e,e===Ge?Qe:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=nu(e,r);else{t=r;var o=ie;ie|=2;var n=Py();(Ge!==e||Qe!==t)&&(Ea=null,un=Me()+500,oo(e,t));do try{Ow();break}catch(i){by(e,i)}while(!0);dp(),au.current=n,ie=o,Fe!==null?t=0:(Ge=null,Qe=0,t=Ue)}if(t!==0){if(t===2&&(o=mf(e),o!==0&&(r=o,t=Hf(e,o))),t===1)throw a=ni,oo(e,0),cr(e,r),St(e,Me()),a;if(t===6)cr(e,r);else{if(o=e.current.alternate,(r&30)===0&&!Fw(o)&&(t=nu(e,r),t===2&&(n=mf(e),n!==0&&(r=n,t=Hf(e,n))),t===1))throw a=ni,oo(e,0),cr(e,r),St(e,Me()),a;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(D(345));case 2:eo(e,yt,Ea);break;case 3:if(cr(e,r),(r&130023424)===r&&(t=kp+500-Me(),10<t)){if(zl(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){pt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Sf(eo.bind(null,e,yt,Ea),t);break}eo(e,yt,Ea);break;case 4:if(cr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-na(r);n=1<<s,s=t[s],s>o&&(o=s),r&=~n}if(r=o,r=Me()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Ew(r/1960))-r,10<r){e.timeoutHandle=Sf(eo.bind(null,e,yt,Ea),r);break}eo(e,yt,Ea);break;case 5:eo(e,yt,Ea);break;default:throw Error(D(329))}}}return St(e,Me()),e.callbackNode===a?ky.bind(null,e):null}function Hf(e,t){var a=zs;return e.current.memoizedState.isDehydrated&&(oo(e,t).flags|=256),e=nu(e,t),e!==2&&(t=yt,yt=a,t!==null&&qf(t)),e}function qf(e){yt===null?yt=e:yt.push.apply(yt,e)}function Fw(e){for(var t=e;;){if(t.flags&16384){var a=t.updateQueue;if(a!==null&&(a=a.stores,a!==null))for(var r=0;r<a.length;r++){var o=a[r],n=o.getSnapshot;o=o.value;try{if(!ia(n(),o))return!1}catch{return!1}}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function cr(e,t){for(t&=~wp,t&=~gu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var a=31-na(t),r=1<<a;e[a]=-1,t&=~r}}function Fg(e){if((ie&6)!==0)throw Error(D(327));tn();var t=zl(e,0);if((t&1)===0)return St(e,Me()),null;var a=nu(e,t);if(e.tag!==0&&a===2){var r=mf(e);r!==0&&(t=r,a=Hf(e,r))}if(a===1)throw a=ni,oo(e,0),cr(e,t),St(e,Me()),a;if(a===6)throw Error(D(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,eo(e,yt,Ea),St(e,Me()),null}function bp(e,t){var a=ie;ie|=1;try{return e(t)}finally{ie=a,ie===0&&(un=Me()+500,fu&&br())}}function co(e){pr!==null&&pr.tag===0&&(ie&6)===0&&tn();var t=ie;ie|=1;var a=$t.transition,r=fe;try{if($t.transition=null,fe=1,e)return e()}finally{fe=r,$t.transition=a,ie=t,(ie&6)===0&&br()}}function Pp(){Rt=Xo.current,ve(Xo)}function oo(e,t){e.finishedWork=null,e.finishedLanes=0;var a=e.timeoutHandle;if(a!==-1&&(e.timeoutHandle=-1,cw(a)),Fe!==null)for(a=Fe.return;a!==null;){var r=a;switch(ip(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&jl();break;case 3:sn(),ve(Lt),ve(st),gp();break;case 5:hp(r);break;case 4:sn();break;case 13:ve(we);break;case 19:ve(we);break;case 10:cp(r.type._context);break;case 22:case 23:Pp()}a=a.return}if(Ge=e,Fe=e=Cr(e.current,null),Qe=Rt=t,Ue=0,ni=null,wp=gu=uo=0,yt=zs=null,ao!==null){for(t=0;t<ao.length;t++)if(a=ao[t],r=a.interleaved,r!==null){a.interleaved=null;var o=r.next,n=a.pending;if(n!==null){var s=n.next;n.next=o,r.next=s}a.pending=r}ao=null}return e}function by(e,t){do{var a=Fe;try{if(dp(),Dl.current=tu,eu){for(var r=ke.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}eu=!1}if(lo=0,We=Ve=ke=null,Us=!1,ai=0,Ip.current=null,a===null||a.return===null){Ue=1,ni=t,Fe=null;break}e:{var n=e,s=a.return,i=a,l=t;if(t=Qe,i.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,d=i,c=d.tag;if((d.mode&1)===0&&(c===0||c===11||c===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var g=Sg(s);if(g!==null){g.flags&=-257,Ig(g,s,i,n,t),g.mode&1&&Cg(n,u,t),t=g,l=u;var L=t.updateQueue;if(L===null){var C=new Set;C.add(l),t.updateQueue=C}else L.add(l);break e}else{if((t&1)===0){Cg(n,u,t),Tp();break e}l=Error(D(426))}}else if(Ie&&i.mode&1){var w=Sg(s);if(w!==null){(w.flags&65536)===0&&(w.flags|=256),Ig(w,s,i,n,t),lp(ln(l,i));break e}}n=l=ln(l,i),Ue!==4&&(Ue=2),zs===null?zs=[n]:zs.push(n),n=s;do{switch(n.tag){case 3:n.flags|=65536,t&=-t,n.lanes|=t;var h=uy(n,l,t);hg(n,h);break e;case 1:i=l;var m=n.type,x=n.stateNode;if((n.flags&128)===0&&(typeof m.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(vr===null||!vr.has(x)))){n.flags|=65536,t&=-t,n.lanes|=t;var S=dy(n,i,t);hg(n,S);break e}}n=n.return}while(n!==null)}Ay(a)}catch(k){t=k,Fe===a&&a!==null&&(Fe=a=a.return);continue}break}while(!0)}function Py(){var e=au.current;return au.current=tu,e===null?tu:e}function Tp(){(Ue===0||Ue===3||Ue===2)&&(Ue=4),Ge===null||(uo&268435455)===0&&(gu&268435455)===0||cr(Ge,Qe)}function nu(e,t){var a=ie;ie|=2;var r=Py();(Ge!==e||Qe!==t)&&(Ea=null,oo(e,t));do try{Bw();break}catch(o){by(e,o)}while(!0);if(dp(),ie=a,au.current=r,Fe!==null)throw Error(D(261));return Ge=null,Qe=0,Ue}function Bw(){for(;Fe!==null;)Ty(Fe)}function Ow(){for(;Fe!==null&&!dI();)Ty(Fe)}function Ty(e){var t=Dy(e.alternate,e,Rt);e.memoizedProps=e.pendingProps,t===null?Ay(e):Fe=t,Ip.current=null}function Ay(e){var t=e;do{var a=t.alternate;if(e=t.return,(t.flags&32768)===0){if(a=Aw(a,t,Rt),a!==null){Fe=a;return}}else{if(a=Rw(a,t),a!==null){a.flags&=32767,Fe=a;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ue=6,Fe=null;return}}if(t=t.sibling,t!==null){Fe=t;return}Fe=t=e}while(t!==null);Ue===0&&(Ue=5)}function eo(e,t,a){var r=fe,o=$t.transition;try{$t.transition=null,fe=1,Vw(e,t,a,r)}finally{$t.transition=o,fe=r}return null}function Vw(e,t,a,r){do tn();while(pr!==null);if((ie&6)!==0)throw Error(D(327));a=e.finishedWork;var o=e.finishedLanes;if(a===null)return null;if(e.finishedWork=null,e.finishedLanes=0,a===e.current)throw Error(D(177));e.callbackNode=null,e.callbackPriority=0;var n=a.lanes|a.childLanes;if(LI(e,n),e===Ge&&(Fe=Ge=null,Qe=0),(a.subtreeFlags&2064)===0&&(a.flags&2064)===0||bl||(bl=!0,My(_l,function(){return tn(),null})),n=(a.flags&15990)!==0,(a.subtreeFlags&15990)!==0||n){n=$t.transition,$t.transition=null;var s=fe;fe=1;var i=ie;ie|=4,Ip.current=null,Mw(e,a),Iy(a,e),sw(Lf),Hl=!!vf,Lf=vf=null,e.current=a,Nw(a,e,o),cI(),ie=i,fe=s,$t.transition=n}else e.current=a;if(bl&&(bl=!1,pr=e,ou=o),n=e.pendingLanes,n===0&&(vr=null),mI(a.stateNode,r),St(e,Me()),t!==null)for(r=e.onRecoverableError,a=0;a<t.length;a++)o=t[a],r(o.value,{componentStack:o.stack,digest:o.digest});if(ru)throw ru=!1,e=_f,_f=null,e;return(ou&1)!==0&&e.tag!==0&&tn(),n=e.pendingLanes,(n&1)!==0?e===zf?Hs++:(Hs=0,zf=e):Hs=0,br(),null}function tn(){if(pr!==null){var e=ux(ou),t=$t.transition,a=fe;try{if($t.transition=null,fe=16>e?16:e,pr===null)var r=!1;else{if(e=pr,pr=null,ou=0,(ie&6)!==0)throw Error(D(331));var o=ie;for(ie|=4,U=e.current;U!==null;){var n=U,s=n.child;if((U.flags&16)!==0){var i=n.deletions;if(i!==null){for(var l=0;l<i.length;l++){var u=i[l];for(U=u;U!==null;){var d=U;switch(d.tag){case 0:case 11:case 15:_s(8,d,n)}var c=d.child;if(c!==null)c.return=d,U=c;else for(;U!==null;){d=U;var p=d.sibling,g=d.return;if(Ly(d),d===u){U=null;break}if(p!==null){p.return=g,U=p;break}U=g}}}var L=n.alternate;if(L!==null){var C=L.child;if(C!==null){L.child=null;do{var w=C.sibling;C.sibling=null,C=w}while(C!==null)}}U=n}}if((n.subtreeFlags&2064)!==0&&s!==null)s.return=n,U=s;else e:for(;U!==null;){if(n=U,(n.flags&2048)!==0)switch(n.tag){case 0:case 11:case 15:_s(9,n,n.return)}var h=n.sibling;if(h!==null){h.return=n.return,U=h;break e}U=n.return}}var m=e.current;for(U=m;U!==null;){s=U;var x=s.child;if((s.subtreeFlags&2064)!==0&&x!==null)x.return=s,U=x;else e:for(s=m;U!==null;){if(i=U,(i.flags&2048)!==0)try{switch(i.tag){case 0:case 11:case 15:hu(9,i)}}catch(k){Te(i,i.return,k)}if(i===s){U=null;break e}var S=i.sibling;if(S!==null){S.return=i.return,U=S;break e}U=i.return}}if(ie=o,br(),ya&&typeof ya.onPostCommitFiberRoot=="function")try{ya.onPostCommitFiberRoot(iu,e)}catch{}r=!0}return r}finally{fe=a,$t.transition=t}}return!1}function Bg(e,t,a){t=ln(a,t),t=uy(e,t,1),e=yr(e,t,1),t=pt(),e!==null&&(si(e,1,t),St(e,t))}function Te(e,t,a){if(e.tag===3)Bg(e,e,a);else for(;t!==null;){if(t.tag===3){Bg(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(vr===null||!vr.has(r))){e=ln(a,e),e=dy(t,e,1),t=yr(t,e,1),e=pt(),t!==null&&(si(t,1,e),St(t,e));break}}t=t.return}}function Uw(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),t=pt(),e.pingedLanes|=e.suspendedLanes&a,Ge===e&&(Qe&a)===a&&(Ue===4||Ue===3&&(Qe&130023424)===Qe&&500>Me()-kp?oo(e,0):wp|=a),St(e,t)}function Ry(e,t){t===0&&((e.mode&1)===0?t=1:(t=fl,fl<<=1,(fl&130023424)===0&&(fl=4194304)));var a=pt();e=za(e,t),e!==null&&(si(e,t,a),St(e,a))}function _w(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Ry(e,a)}function zw(e,t){var a=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(a=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(D(314))}r!==null&&r.delete(t),Ry(e,a)}var Dy;Dy=function(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps||Lt.current)vt=!0;else{if((e.lanes&a)===0&&(t.flags&128)===0)return vt=!1,Tw(e,t,a);vt=(e.flags&131072)!==0}else vt=!1,Ie&&(t.flags&1048576)!==0&&Fx(t,Xl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Nl(e,t),e=t.pendingProps;var o=rn(t,st.current);en(t,a),o=yp(null,t,r,e,o,a);var n=vp();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ct(r)?(n=!0,Kl(t)):n=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,pp(t),o.updater=mu,t.stateNode=o,o._reactInternals=t,Af(t,r,e,a),t=Mf(null,t,r,!0,n,a)):(t.tag=0,Ie&&n&&sp(t),ft(null,t,o,a),t=t.child),t;case 16:r=t.elementType;e:{switch(Nl(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=qw(r),e=aa(r,e),o){case 0:t=Df(null,t,r,e,a);break e;case 1:t=bg(null,t,r,e,a);break e;case 11:t=wg(null,t,r,e,a);break e;case 14:t=kg(null,t,r,aa(r.type,e),a);break e}throw Error(D(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:aa(r,o),Df(e,t,r,o,a);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:aa(r,o),bg(e,t,r,o,a);case 3:e:{if(my(t),e===null)throw Error(D(387));r=t.pendingProps,n=t.memoizedState,o=n.element,zx(e,t),Zl(t,r,null,a);var s=t.memoizedState;if(r=s.element,n.isDehydrated)if(n={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=n,t.memoizedState=n,t.flags&256){o=ln(Error(D(423)),t),t=Pg(e,t,r,a,o);break e}else if(r!==o){o=ln(Error(D(424)),t),t=Pg(e,t,r,a,o);break e}else for(Dt=xr(t.stateNode.containerInfo.firstChild),Mt=t,Ie=!0,oa=null,a=Ux(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(on(),r===o){t=Ha(e,t,a);break e}ft(e,t,r,a)}t=t.child}return t;case 5:return Hx(t),e===null&&bf(t),r=t.type,o=t.pendingProps,n=e!==null?e.memoizedProps:null,s=o.children,Cf(r,o)?s=null:n!==null&&Cf(r,n)&&(t.flags|=32),py(e,t),ft(e,t,s,a),t.child;case 6:return e===null&&bf(t),null;case 13:return hy(e,t,a);case 4:return mp(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=nn(t,null,r,a):ft(e,t,r,a),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:aa(r,o),wg(e,t,r,o,a);case 7:return ft(e,t,t.pendingProps,a),t.child;case 8:return ft(e,t,t.pendingProps.children,a),t.child;case 12:return ft(e,t,t.pendingProps.children,a),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,n=t.memoizedProps,s=o.value,ge(Ql,r._currentValue),r._currentValue=s,n!==null)if(ia(n.value,s)){if(n.children===o.children&&!Lt.current){t=Ha(e,t,a);break e}}else for(n=t.child,n!==null&&(n.return=t);n!==null;){var i=n.dependencies;if(i!==null){s=n.child;for(var l=i.firstContext;l!==null;){if(l.context===r){if(n.tag===1){l=Va(-1,a&-a),l.tag=2;var u=n.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}n.lanes|=a,l=n.alternate,l!==null&&(l.lanes|=a),Pf(n.return,a,t),i.lanes|=a;break}l=l.next}}else if(n.tag===10)s=n.type===t.type?null:n.child;else if(n.tag===18){if(s=n.return,s===null)throw Error(D(341));s.lanes|=a,i=s.alternate,i!==null&&(i.lanes|=a),Pf(s,a,t),s=n.sibling}else s=n.child;if(s!==null)s.return=n;else for(s=n;s!==null;){if(s===t){s=null;break}if(n=s.sibling,n!==null){n.return=s.return,s=n;break}s=s.return}n=s}ft(e,t,o.children,a),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,en(t,a),o=Xt(o),r=r(o),t.flags|=1,ft(e,t,r,a),t.child;case 14:return r=t.type,o=aa(r,t.pendingProps),o=aa(r.type,o),kg(e,t,r,o,a);case 15:return cy(e,t,t.type,t.pendingProps,a);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:aa(r,o),Nl(e,t),t.tag=1,Ct(r)?(e=!0,Kl(t)):e=!1,en(t,a),ly(t,r,o),Af(t,r,o,a),Mf(null,t,r,!0,e,a);case 19:return gy(e,t,a);case 22:return fy(e,t,a)}throw Error(D(156,t.tag))};function My(e,t){return nx(e,t)}function Hw(e,t,a,r){this.tag=e,this.key=a,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 Kt(e,t,a,r){return new Hw(e,t,a,r)}function Ap(e){return e=e.prototype,!(!e||!e.isReactComponent)}function qw(e){if(typeof e=="function")return Ap(e)?1:0;if(e!=null){if(e=e.$$typeof,e===$f)return 11;if(e===Xf)return 14}return 2}function Cr(e,t){var a=e.alternate;return a===null?(a=Kt(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&14680064,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a}function Bl(e,t,a,r,o,n){var s=2;if(r=e,typeof e=="function")Ap(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Uo:return no(a.children,o,n,t);case Kf:s=8,o|=8;break;case Zc:return e=Kt(12,a,t,o|2),e.elementType=Zc,e.lanes=n,e;case Jc:return e=Kt(13,a,t,o),e.elementType=Jc,e.lanes=n,e;case ef:return e=Kt(19,a,t,o),e.elementType=ef,e.lanes=n,e;case Hg:return xu(a,o,n,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case _g:s=10;break e;case zg:s=9;break e;case $f:s=11;break e;case Xf:s=14;break e;case lr:s=16,r=null;break e}throw Error(D(130,e==null?e:typeof e,""))}return t=Kt(s,a,t,o),t.elementType=e,t.type=r,t.lanes=n,t}function no(e,t,a,r){return e=Kt(7,e,r,t),e.lanes=a,e}function xu(e,t,a,r){return e=Kt(22,e,r,t),e.elementType=Hg,e.lanes=a,e.stateNode={isHidden:!1},e}function Xc(e,t,a){return e=Kt(6,e,null,t),e.lanes=a,e}function Qc(e,t,a){return t=Kt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ww(e,t,a,r,o){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=Nc(0),this.expirationTimes=Nc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Nc(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Rp(e,t,a,r,o,n,s,i,l){return e=new Ww(e,t,a,i,l),t===1?(t=1,n===!0&&(t|=8)):t=0,n=Kt(3,null,null,t),e.current=n,n.stateNode=e,n.memoizedState={element:r,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},pp(n),e}function Gw(e,t,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Vo,key:r==null?null:""+r,children:e,containerInfo:t,implementation:a}}function Ny(e){if(!e)return Ir;e=e._reactInternals;e:{if(po(e)!==e||e.tag!==1)throw Error(D(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ct(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(D(171))}if(e.tag===1){var a=e.type;if(Ct(a))return Nx(e,a,t)}return t}function Ey(e,t,a,r,o,n,s,i,l){return e=Rp(a,r,!0,e,o,n,s,i,l),e.context=Ny(null),a=e.current,r=pt(),o=Lr(a),n=Va(r,o),n.callback=t??null,yr(a,n,o),e.current.lanes=o,si(e,o,r),St(e,r),e}function yu(e,t,a,r){var o=t.current,n=pt(),s=Lr(o);return a=Ny(a),t.context===null?t.context=a:t.pendingContext=a,t=Va(n,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=yr(o,t,s),e!==null&&(sa(e,o,s,n),Rl(e,o,s)),s}function su(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function Og(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Dp(e,t){Og(e,t),(e=e.alternate)&&Og(e,t)}function jw(){return null}var Fy=typeof reportError=="function"?reportError:function(e){console.error(e)};function Mp(e){this._internalRoot=e}vu.prototype.render=Mp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(D(409));yu(e,t,null,null)};vu.prototype.unmount=Mp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;co(function(){yu(null,e,null,null)}),t[_a]=null}};function vu(e){this._internalRoot=e}vu.prototype.unstable_scheduleHydration=function(e){if(e){var t=fx();e={blockedOn:null,target:e,priority:t};for(var a=0;a<dr.length&&t!==0&&t<dr[a].priority;a++);dr.splice(a,0,e),a===0&&mx(e)}};function Np(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Lu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Vg(){}function Kw(e,t,a,r,o){if(o){if(typeof r=="function"){var n=r;r=function(){var u=su(s);n.call(u)}}var s=Ey(t,r,e,0,null,!1,!1,"",Vg);return e._reactRootContainer=s,e[_a]=s.current,Ys(e.nodeType===8?e.parentNode:e),co(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var i=r;r=function(){var u=su(l);i.call(u)}}var l=Rp(e,0,!1,null,null,!1,!1,"",Vg);return e._reactRootContainer=l,e[_a]=l.current,Ys(e.nodeType===8?e.parentNode:e),co(function(){yu(t,l,a,r)}),l}function Cu(e,t,a,r,o){var n=a._reactRootContainer;if(n){var s=n;if(typeof o=="function"){var i=o;o=function(){var l=su(s);i.call(l)}}yu(t,s,e,o)}else s=Kw(a,t,e,o,r);return su(s)}dx=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var a=Ms(t.pendingLanes);a!==0&&(Zf(t,a|1),St(t,Me()),(ie&6)===0&&(un=Me()+500,br()))}break;case 13:co(function(){var r=za(e,1);if(r!==null){var o=pt();sa(r,e,1,o)}}),Dp(e,1)}};Jf=function(e){if(e.tag===13){var t=za(e,134217728);if(t!==null){var a=pt();sa(t,e,134217728,a)}Dp(e,134217728)}};cx=function(e){if(e.tag===13){var t=Lr(e),a=za(e,t);if(a!==null){var r=pt();sa(a,e,t,r)}Dp(e,t)}};fx=function(){return fe};px=function(e,t){var a=fe;try{return fe=e,t()}finally{fe=a}};cf=function(e,t,a){switch(t){case"input":if(rf(e,a),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<a.length;t++){var r=a[t];if(r!==e&&r.form===e.form){var o=cu(r);if(!o)throw Error(D(90));Wg(r),rf(r,o)}}}break;case"textarea":jg(e,a);break;case"select":t=a.value,t!=null&&Qo(e,!!a.multiple,t,!1)}};Jg=bp;ex=co;var $w={usingClientEntryPoint:!1,Events:[li,qo,cu,Yg,Zg,bp]},Ts={findFiberByHostInstance:to,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Xw={bundleType:Ts.bundleType,version:Ts.version,rendererPackageName:Ts.rendererPackageName,rendererConfig:Ts.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:qa.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=rx(e),e===null?null:e.stateNode},findFiberByHostInstance:Ts.findFiberByHostInstance||jw,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(As=__REACT_DEVTOOLS_GLOBAL_HOOK__,!As.isDisabled&&As.supportsFiber))try{iu=As.inject(Xw),ya=As}catch{}var As;Ft.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$w;Ft.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Np(t))throw Error(D(200));return Gw(e,t,null,a)};Ft.createRoot=function(e,t){if(!Np(e))throw Error(D(299));var a=!1,r="",o=Fy;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Rp(e,1,!1,null,null,a,!1,r,o),e[_a]=t.current,Ys(e.nodeType===8?e.parentNode:e),new Mp(t)};Ft.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(D(188)):(e=Object.keys(e).join(","),Error(D(268,e)));return e=rx(t),e=e===null?null:e.stateNode,e};Ft.flushSync=function(e){return co(e)};Ft.hydrate=function(e,t,a){if(!Lu(t))throw Error(D(200));return Cu(null,e,t,!0,a)};Ft.hydrateRoot=function(e,t,a){if(!Np(e))throw Error(D(405));var r=a!=null&&a.hydratedSources||null,o=!1,n="",s=Fy;if(a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(n=a.identifierPrefix),a.onRecoverableError!==void 0&&(s=a.onRecoverableError)),t=Ey(t,null,e,1,a??null,o,!1,n,s),e[_a]=t.current,Ys(e),r)for(e=0;e<r.length;e++)a=r[e],o=a._getVersion,o=o(a._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[a,o]:t.mutableSourceEagerHydrationData.push(a,o);return new vu(t)};Ft.render=function(e,t,a){if(!Lu(t))throw Error(D(200));return Cu(null,e,t,!1,a)};Ft.unmountComponentAtNode=function(e){if(!Lu(e))throw Error(D(40));return e._reactRootContainer?(co(function(){Cu(null,null,e,!1,function(){e._reactRootContainer=null,e[_a]=null})}),!0):!1};Ft.unstable_batchedUpdates=bp;Ft.unstable_renderSubtreeIntoContainer=function(e,t,a,r){if(!Lu(a))throw Error(D(200));if(e==null||e._reactInternals===void 0)throw Error(D(38));return Cu(e,t,a,!1,r)};Ft.version="18.3.1-next-f1338f8080-20240426"});var Ep=Na((MT,Vy)=>{"use strict";function Oy(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Oy)}catch(e){console.error(e)}}Oy(),Vy.exports=By()});var _y=Na(Fp=>{"use strict";var Uy=Ep();Fp.createRoot=Uy.createRoot,Fp.hydrateRoot=Uy.hydrateRoot;var NT});var Qy=Na(Iu=>{"use strict";var Pk=$(),Tk=Symbol.for("react.element"),Ak=Symbol.for("react.fragment"),Rk=Object.prototype.hasOwnProperty,Dk=Pk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Mk={key:!0,ref:!0,__self:!0,__source:!0};function Xy(e,t,a){var r,o={},n=null,s=null;a!==void 0&&(n=""+a),t.key!==void 0&&(n=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)Rk.call(t,r)&&!Mk.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:Tk,type:e,key:n,ref:s,props:o,_owner:Dk.current}}Iu.Fragment=Ak;Iu.jsx=Xy;Iu.jsxs=Xy});var le=Na((zT,Yy)=>{"use strict";Yy.exports=Qy()});var IT={};DS(IT,{initKiteChat:()=>Qm});var Ra=E($(),1),hS=E(_y(),1);var G=E($(),1);function zy(e){var t,a,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(a=zy(e[t]))&&(r&&(r+=" "),r+=a)}else for(a in e)e[a]&&(r&&(r+=" "),r+=a);return r}function Su(){for(var e,t,a=0,r="",o=arguments.length;a<o;a++)(e=arguments[a])&&(t=zy(e))&&(r&&(r+=" "),r+=t);return r}var Qw=e=>{let t=Zw(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{let i=s.split("-");return i[0]===""&&i.length!==1&&i.shift(),Wy(i,t)||Yw(s)},getConflictingClassGroupIds:(s,i)=>{let l=a[s]||[];return i&&r[s]?[...l,...r[s]]:l}}},Wy=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],r=t.nextPart.get(a),o=r?Wy(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;let n=e.join("-");return t.validators.find(({validator:s})=>s(n))?.classGroupId},Hy=/^\[(.+)\]$/,Yw=e=>{if(Hy.test(e)){let t=Hy.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},Zw=e=>{let{theme:t,prefix:a}=e,r={nextPart:new Map,validators:[]};return ek(Object.entries(e.classGroups),a).forEach(([n,s])=>{Op(s,r,n,t)}),r},Op=(e,t,a,r)=>{e.forEach(o=>{if(typeof o=="string"){let n=o===""?t:qy(t,o);n.classGroupId=a;return}if(typeof o=="function"){if(Jw(o)){Op(o(r),t,a,r);return}t.validators.push({validator:o,classGroupId:a});return}Object.entries(o).forEach(([n,s])=>{Op(s,qy(t,n),a,r)})})},qy=(e,t)=>{let a=e;return t.split("-").forEach(r=>{a.nextPart.has(r)||a.nextPart.set(r,{nextPart:new Map,validators:[]}),a=a.nextPart.get(r)}),a},Jw=e=>e.isThemeGetter,ek=(e,t)=>t?e.map(([a,r])=>{let o=r.map(n=>typeof n=="string"?t+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([s,i])=>[t+s,i])):n);return[a,o]}):e,tk=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,r=new Map,o=(n,s)=>{a.set(n,s),t++,t>e&&(t=0,r=a,a=new Map)};return{get(n){let s=a.get(n);if(s!==void 0)return s;if((s=r.get(n))!==void 0)return o(n,s),s},set(n,s){a.has(n)?a.set(n,s):o(n,s)}}};var ak=e=>{let{separator:t,experimentalParseClassName:a}=e,r=t.length===1,o=t[0],n=t.length,s=i=>{let l=[],u=0,d=0,c;for(let w=0;w<i.length;w++){let h=i[w];if(u===0){if(h===o&&(r||i.slice(w,w+n)===t)){l.push(i.slice(d,w)),d=w+n;continue}if(h==="/"){c=w;continue}}h==="["?u++:h==="]"&&u--}let p=l.length===0?i:i.substring(d),g=p.startsWith("!"),L=g?p.substring(1):p,C=c&&c>d?c-d:void 0;return{modifiers:l,hasImportantModifier:g,baseClassName:L,maybePostfixModifierPosition:C}};return a?i=>a({className:i,parseClassName:s}):s},rk=e=>{if(e.length<=1)return e;let t=[],a=[];return e.forEach(r=>{r[0]==="["?(t.push(...a.sort(),r),a=[]):a.push(r)}),t.push(...a.sort()),t},ok=e=>({cache:tk(e.cacheSize),parseClassName:ak(e),...Qw(e)}),nk=/\s+/,sk=(e,t)=>{let{parseClassName:a,getClassGroupId:r,getConflictingClassGroupIds:o}=t,n=[],s=e.trim().split(nk),i="";for(let l=s.length-1;l>=0;l-=1){let u=s[l],{modifiers:d,hasImportantModifier:c,baseClassName:p,maybePostfixModifierPosition:g}=a(u),L=!!g,C=r(L?p.substring(0,g):p);if(!C){if(!L){i=u+(i.length>0?" "+i:i);continue}if(C=r(p),!C){i=u+(i.length>0?" "+i:i);continue}L=!1}let w=rk(d).join(":"),h=c?w+"!":w,m=h+C;if(n.includes(m))continue;n.push(m);let x=o(C,L);for(let S=0;S<x.length;++S){let k=x[S];n.push(h+k)}i=u+(i.length>0?" "+i:i)}return i};function ik(){let e=0,t,a,r="";for(;e<arguments.length;)(t=arguments[e++])&&(a=Gy(t))&&(r&&(r+=" "),r+=a);return r}var Gy=e=>{if(typeof e=="string")return e;let t,a="";for(let r=0;r<e.length;r++)e[r]&&(t=Gy(e[r]))&&(a&&(a+=" "),a+=t);return a};function lk(e,...t){let a,r,o,n=s;function s(l){let u=t.reduce((d,c)=>c(d),e());return a=ok(u),r=a.cache.get,o=a.cache.set,n=i,i(l)}function i(l){let u=r(l);if(u)return u;let d=sk(l,a);return o(l,d),d}return function(){return n(ik.apply(null,arguments))}}var Le=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},jy=/^\[(?:([a-z-]+):)?(.+)\]$/i,uk=/^\d+\/\d+$/,dk=new Set(["px","full","screen"]),ck=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,fk=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,pk=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,mk=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hk=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Wa=e=>fn(e)||dk.has(e)||uk.test(e),Pr=e=>pn(e,"length",Ik),fn=e=>!!e&&!Number.isNaN(Number(e)),Bp=e=>pn(e,"number",fn),di=e=>!!e&&Number.isInteger(Number(e)),gk=e=>e.endsWith("%")&&fn(e.slice(0,-1)),Y=e=>jy.test(e),Tr=e=>ck.test(e),xk=new Set(["length","size","percentage"]),yk=e=>pn(e,xk,Ky),vk=e=>pn(e,"position",Ky),Lk=new Set(["image","url"]),Ck=e=>pn(e,Lk,kk),Sk=e=>pn(e,"",wk),ci=()=>!0,pn=(e,t,a)=>{let r=jy.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):a(r[2]):!1},Ik=e=>fk.test(e)&&!pk.test(e),Ky=()=>!1,wk=e=>mk.test(e),kk=e=>hk.test(e);var bk=()=>{let e=Le("colors"),t=Le("spacing"),a=Le("blur"),r=Le("brightness"),o=Le("borderColor"),n=Le("borderRadius"),s=Le("borderSpacing"),i=Le("borderWidth"),l=Le("contrast"),u=Le("grayscale"),d=Le("hueRotate"),c=Le("invert"),p=Le("gap"),g=Le("gradientColorStops"),L=Le("gradientColorStopPositions"),C=Le("inset"),w=Le("margin"),h=Le("opacity"),m=Le("padding"),x=Le("saturate"),S=Le("scale"),k=Le("sepia"),A=Le("skew"),P=Le("space"),R=Le("translate"),M=()=>["auto","contain","none"],O=()=>["auto","hidden","clip","visible","scroll"],pe=()=>["auto",Y,t],se=()=>[Y,t],Zt=()=>["",Wa,Pr],fa=()=>["auto",fn,Y],pa=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Xr=()=>["solid","dashed","dotted","double","none"],Re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],dt=()=>["start","end","center","between","around","evenly","stretch"],qt=()=>["","0",Y],oe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$e=()=>[fn,Y];return{cacheSize:500,separator:":",theme:{colors:[ci],spacing:[Wa,Pr],blur:["none","",Tr,Y],brightness:$e(),borderColor:[e],borderRadius:["none","","full",Tr,Y],borderSpacing:se(),borderWidth:Zt(),contrast:$e(),grayscale:qt(),hueRotate:$e(),invert:qt(),gap:se(),gradientColorStops:[e],gradientColorStopPositions:[gk,Pr],inset:pe(),margin:pe(),opacity:$e(),padding:se(),saturate:$e(),scale:$e(),sepia:qt(),skew:$e(),space:se(),translate:se()},classGroups:{aspect:[{aspect:["auto","square","video",Y]}],container:["container"],columns:[{columns:[Tr]}],"break-after":[{"break-after":oe()}],"break-before":[{"break-before":oe()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...pa(),Y]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[C]}],"inset-x":[{"inset-x":[C]}],"inset-y":[{"inset-y":[C]}],start:[{start:[C]}],end:[{end:[C]}],top:[{top:[C]}],right:[{right:[C]}],bottom:[{bottom:[C]}],left:[{left:[C]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",di,Y]}],basis:[{basis:pe()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Y]}],grow:[{grow:qt()}],shrink:[{shrink:qt()}],order:[{order:["first","last","none",di,Y]}],"grid-cols":[{"grid-cols":[ci]}],"col-start-end":[{col:["auto",{span:["full",di,Y]},Y]}],"col-start":[{"col-start":fa()}],"col-end":[{"col-end":fa()}],"grid-rows":[{"grid-rows":[ci]}],"row-start-end":[{row:["auto",{span:[di,Y]},Y]}],"row-start":[{"row-start":fa()}],"row-end":[{"row-end":fa()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Y]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Y]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...dt()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...dt(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...dt(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[m]}],px:[{px:[m]}],py:[{py:[m]}],ps:[{ps:[m]}],pe:[{pe:[m]}],pt:[{pt:[m]}],pr:[{pr:[m]}],pb:[{pb:[m]}],pl:[{pl:[m]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Y,t]}],"min-w":[{"min-w":[Y,t,"min","max","fit"]}],"max-w":[{"max-w":[Y,t,"none","full","min","max","fit","prose",{screen:[Tr]},Tr]}],h:[{h:[Y,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Y,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Y,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Y,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Tr,Pr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Bp]}],"font-family":[{font:[ci]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Y]}],"line-clamp":[{"line-clamp":["none",fn,Bp]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Wa,Y]}],"list-image":[{"list-image":["none",Y]}],"list-style-type":[{list:["none","disc","decimal",Y]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[h]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[h]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Xr(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Wa,Pr]}],"underline-offset":[{"underline-offset":["auto",Wa,Y]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:se()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Y]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Y]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[h]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...pa(),vk]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",yk]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Ck]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[L]}],"gradient-via-pos":[{via:[L]}],"gradient-to-pos":[{to:[L]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-b":[{"rounded-b":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-ee":[{"rounded-ee":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[h]}],"border-style":[{border:[...Xr(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[h]}],"divide-style":[{divide:Xr()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...Xr()]}],"outline-offset":[{"outline-offset":[Wa,Y]}],"outline-w":[{outline:[Wa,Pr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Zt()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[h]}],"ring-offset-w":[{"ring-offset":[Wa,Pr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Tr,Sk]}],"shadow-color":[{shadow:[ci]}],opacity:[{opacity:[h]}],"mix-blend":[{"mix-blend":[...Re(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Re()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Tr,Y]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[c]}],saturate:[{saturate:[x]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[c]}],"backdrop-opacity":[{"backdrop-opacity":[h]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Y]}],duration:[{duration:$e()}],ease:[{ease:["linear","in","out","in-out",Y]}],delay:[{delay:$e()}],animate:[{animate:["none","spin","ping","pulse","bounce",Y]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[di,Y]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[A]}],"skew-y":[{"skew-y":[A]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Y]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Y]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":se()}],"scroll-mx":[{"scroll-mx":se()}],"scroll-my":[{"scroll-my":se()}],"scroll-ms":[{"scroll-ms":se()}],"scroll-me":[{"scroll-me":se()}],"scroll-mt":[{"scroll-mt":se()}],"scroll-mr":[{"scroll-mr":se()}],"scroll-mb":[{"scroll-mb":se()}],"scroll-ml":[{"scroll-ml":se()}],"scroll-p":[{"scroll-p":se()}],"scroll-px":[{"scroll-px":se()}],"scroll-py":[{"scroll-py":se()}],"scroll-ps":[{"scroll-ps":se()}],"scroll-pe":[{"scroll-pe":se()}],"scroll-pt":[{"scroll-pt":se()}],"scroll-pr":[{"scroll-pr":se()}],"scroll-pb":[{"scroll-pb":se()}],"scroll-pl":[{"scroll-pl":se()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Y]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Wa,Pr,Bp]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var $y=lk(bk);function Bt(...e){return $y(Su(e))}var Zy=E(le(),1);function Pe({className:e,type:t,...a}){return(0,Zy.jsx)("input",{type:t,"data-slot":"input",className:Bt("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...a})}var Be=E($(),1);var ev=E($(),1);function Jy(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function fi(...e){return t=>{let a=!1,r=e.map(o=>{let n=Jy(o,t);return!a&&typeof n=="function"&&(a=!0),n});if(a)return()=>{for(let o=0;o<r.length;o++){let n=r[o];typeof n=="function"?n():Jy(e[o],null)}}}}function Ga(...e){return ev.useCallback(fi(...e),e)}var wu=E(le(),1),Nk=Symbol.for("react.lazy"),ku=Be[" use ".trim().toString()];function Ek(e){return typeof e=="object"&&e!==null&&"then"in e}function tv(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Nk&&"_payload"in e&&Ek(e._payload)}function Fk(e){let t=Bk(e),a=Be.forwardRef((r,o)=>{let{children:n,...s}=r;tv(n)&&typeof ku=="function"&&(n=ku(n._payload));let i=Be.Children.toArray(n),l=i.find(Vk);if(l){let u=l.props.children,d=i.map(c=>c===l?Be.Children.count(u)>1?Be.Children.only(null):Be.isValidElement(u)?u.props.children:null:c);return(0,wu.jsx)(t,{...s,ref:o,children:Be.isValidElement(u)?Be.cloneElement(u,void 0,d):null})}return(0,wu.jsx)(t,{...s,ref:o,children:n})});return a.displayName=`${e}.Slot`,a}var av=Fk("Slot");function Bk(e){let t=Be.forwardRef((a,r)=>{let{children:o,...n}=a;if(tv(o)&&typeof ku=="function"&&(o=ku(o._payload)),Be.isValidElement(o)){let s=_k(o),i=Uk(n,o.props);return o.type!==Be.Fragment&&(i.ref=r?fi(r,s):s),Be.cloneElement(o,i)}return Be.Children.count(o)>1?Be.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ok=Symbol("radix.slottable");function Vk(e){return Be.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ok}function Uk(e,t){let a={...t};for(let r in t){let o=e[r],n=t[r];/^on[A-Z]/.test(r)?o&&n?a[r]=(...i)=>{let l=n(...i);return o(...i),l}:o&&(a[r]=o):r==="style"?a[r]={...o,...n}:r==="className"&&(a[r]=[o,n].filter(Boolean).join(" "))}return{...e,...a}}function _k(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var rv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ov=Su,nv=(e,t)=>a=>{var r;if(t?.variants==null)return ov(e,a?.class,a?.className);let{variants:o,defaultVariants:n}=t,s=Object.keys(o).map(u=>{let d=a?.[u],c=n?.[u];if(d===null)return null;let p=rv(d)||rv(c);return o[u][p]}),i=a&&Object.entries(a).reduce((u,d)=>{let[c,p]=d;return p===void 0||(u[c]=p),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:c,className:p,...g}=d;return Object.entries(g).every(L=>{let[C,w]=L;return Array.isArray(w)?w.includes({...n,...i}[C]):{...n,...i}[C]===w})?[...u,c,p]:u},[]);return ov(e,s,l,a?.class,a?.className)};var sv=E(le(),1),zk=nv("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function It({className:e,variant:t,size:a,asChild:r=!1,...o}){return(0,sv.jsx)(r?av:"button",{"data-slot":"button",className:Bt(zk({variant:t,size:a,className:e})),...o})}var Mv=E($(),1);var W=E($(),1);var lv=E($(),1),Kk=E(Ep(),1);var _e=E($(),1);var bu=E(le(),1);function iv(e){let t=Hk(e),a=_e.forwardRef((r,o)=>{let{children:n,...s}=r,i=_e.Children.toArray(n),l=i.find(Wk);if(l){let u=l.props.children,d=i.map(c=>c===l?_e.Children.count(u)>1?_e.Children.only(null):_e.isValidElement(u)?u.props.children:null:c);return(0,bu.jsx)(t,{...s,ref:o,children:_e.isValidElement(u)?_e.cloneElement(u,void 0,d):null})}return(0,bu.jsx)(t,{...s,ref:o,children:n})});return a.displayName=`${e}.Slot`,a}function Hk(e){let t=_e.forwardRef((a,r)=>{let{children:o,...n}=a;if(_e.isValidElement(o)){let s=jk(o),i=Gk(n,o.props);return o.type!==_e.Fragment&&(i.ref=r?fi(r,s):s),_e.cloneElement(o,i)}return _e.Children.count(o)>1?_e.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var qk=Symbol("radix.slottable");function Wk(e){return _e.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===qk}function Gk(e,t){let a={...t};for(let r in t){let o=e[r],n=t[r];/^on[A-Z]/.test(r)?o&&n?a[r]=(...i)=>{let l=n(...i);return o(...i),l}:o&&(a[r]=o):r==="style"?a[r]={...o,...n}:r==="className"&&(a[r]=[o,n].filter(Boolean).join(" "))}return{...e,...a}}function jk(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var uv=E(le(),1),$k=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],mn=$k.reduce((e,t)=>{let a=iv(`Primitive.${t}`),r=lv.forwardRef((o,n)=>{let{asChild:s,...i}=o,l=s?a:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,uv.jsx)(l,{...i,ref:n})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});var wt=E($(),1);var dv=E($(),1),pi=globalThis?.document?dv.useLayoutEffect:()=>{};var cv=E($(),1);function Xk(e,t){return cv.useReducer((a,r)=>t[a][r]??a,e)}var hn=e=>{let{present:t,children:a}=e,r=Qk(t),o=typeof a=="function"?a({present:r.isPresent}):wt.Children.only(a),n=Ga(r.ref,Yk(o));return typeof a=="function"||r.isPresent?wt.cloneElement(o,{ref:n}):null};hn.displayName="Presence";function Qk(e){let[t,a]=wt.useState(),r=wt.useRef(null),o=wt.useRef(e),n=wt.useRef("none"),s=e?"mounted":"unmounted",[i,l]=Xk(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return wt.useEffect(()=>{let u=Pu(r.current);n.current=i==="mounted"?u:"none"},[i]),pi(()=>{let u=r.current,d=o.current;if(d!==e){let p=n.current,g=Pu(u);e?l("MOUNT"):g==="none"||u?.display==="none"?l("UNMOUNT"):l(d&&p!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),pi(()=>{if(t){let u,d=t.ownerDocument.defaultView??window,c=g=>{let C=Pu(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&C&&(l("ANIMATION_END"),!o.current)){let w=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},p=g=>{g.target===t&&(n.current=Pu(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:wt.useCallback(u=>{r.current=u?getComputedStyle(u):null,a(u)},[])}}function Pu(e){return e?.animationName||"none"}function Yk(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var ja=E($(),1),fv=E(le(),1);function pv(e,t=[]){let a=[];function r(n,s){let i=ja.createContext(s),l=a.length;a=[...a,s];let u=c=>{let{scope:p,children:g,...L}=c,C=p?.[e]?.[l]||i,w=ja.useMemo(()=>L,Object.values(L));return(0,fv.jsx)(C.Provider,{value:w,children:g})};u.displayName=n+"Provider";function d(c,p){let g=p?.[e]?.[l]||i,L=ja.useContext(g);if(L)return L;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${n}\``)}return[u,d]}let o=()=>{let n=a.map(s=>ja.createContext(s));return function(i){let l=i?.[e]||n;return ja.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[r,Zk(o,...t)]}function Zk(...e){let t=e[0];if(e.length===1)return t;let a=()=>{let r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(n){let s=r.reduce((i,{useScope:l,scopeName:u})=>{let c=l(n)[`__scope${u}`];return{...i,...c}},{});return ja.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return a.scopeName=t.scopeName,a}var gn=E($(),1);function Ar(e){let t=gn.useRef(e);return gn.useEffect(()=>{t.current=e}),gn.useMemo(()=>(...a)=>t.current?.(...a),[])}var Tu=E($(),1),Jk=E(le(),1),eb=Tu.createContext(void 0);function mv(e){let t=Tu.useContext(eb);return e||t||"ltr"}function hv(e,[t,a]){return Math.min(a,Math.max(t,e))}var cA=!!(typeof window<"u"&&window.document&&window.document.createElement);function Rr(e,t,{checkForDefaultPrevented:a=!0}={}){return function(o){if(e?.(o),a===!1||!o.defaultPrevented)return t?.(o)}}var xv=E($(),1),de=E(le(),1);function tb(e,t){return xv.useReducer((a,r)=>t[a][r]??a,e)}var Vp="ScrollArea",[yv,SA]=pv(Vp),[ab,Yt]=yv(Vp),vv=W.forwardRef((e,t)=>{let{__scopeScrollArea:a,type:r="hover",dir:o,scrollHideDelay:n=600,...s}=e,[i,l]=W.useState(null),[u,d]=W.useState(null),[c,p]=W.useState(null),[g,L]=W.useState(null),[C,w]=W.useState(null),[h,m]=W.useState(0),[x,S]=W.useState(0),[k,A]=W.useState(!1),[P,R]=W.useState(!1),M=Ga(t,pe=>l(pe)),O=mv(o);return(0,de.jsx)(ab,{scope:a,type:r,dir:O,scrollHideDelay:n,scrollArea:i,viewport:u,onViewportChange:d,content:c,onContentChange:p,scrollbarX:g,onScrollbarXChange:L,scrollbarXEnabled:k,onScrollbarXEnabledChange:A,scrollbarY:C,onScrollbarYChange:w,scrollbarYEnabled:P,onScrollbarYEnabledChange:R,onCornerWidthChange:m,onCornerHeightChange:S,children:(0,de.jsx)(mn.div,{dir:O,...s,ref:M,style:{position:"relative","--radix-scroll-area-corner-width":h+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})})});vv.displayName=Vp;var Lv="ScrollAreaViewport",Cv=W.forwardRef((e,t)=>{let{__scopeScrollArea:a,children:r,nonce:o,...n}=e,s=Yt(Lv,a),i=W.useRef(null),l=Ga(t,i,s.onViewportChange);return(0,de.jsxs)(de.Fragment,{children:[(0,de.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),(0,de.jsx)(mn.div,{"data-radix-scroll-area-viewport":"",...n,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:(0,de.jsx)("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Cv.displayName=Lv;var La="ScrollAreaScrollbar",Up=W.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=Yt(La,e.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:s}=o,i=e.orientation==="horizontal";return W.useEffect(()=>(i?n(!0):s(!0),()=>{i?n(!1):s(!1)}),[i,n,s]),o.type==="hover"?(0,de.jsx)(rb,{...r,ref:t,forceMount:a}):o.type==="scroll"?(0,de.jsx)(ob,{...r,ref:t,forceMount:a}):o.type==="auto"?(0,de.jsx)(Sv,{...r,ref:t,forceMount:a}):o.type==="always"?(0,de.jsx)(_p,{...r,ref:t}):null});Up.displayName=La;var rb=W.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=Yt(La,e.__scopeScrollArea),[n,s]=W.useState(!1);return W.useEffect(()=>{let i=o.scrollArea,l=0;if(i){let u=()=>{window.clearTimeout(l),s(!0)},d=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return i.addEventListener("pointerenter",u),i.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),i.removeEventListener("pointerenter",u),i.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),(0,de.jsx)(hn,{present:a||n,children:(0,de.jsx)(Sv,{"data-state":n?"visible":"hidden",...r,ref:t})})}),ob=W.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=Yt(La,e.__scopeScrollArea),n=e.orientation==="horizontal",s=Mu(()=>l("SCROLL_END"),100),[i,l]=tb("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return W.useEffect(()=>{if(i==="idle"){let u=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[i,o.scrollHideDelay,l]),W.useEffect(()=>{let u=o.viewport,d=n?"scrollLeft":"scrollTop";if(u){let c=u[d],p=()=>{let g=u[d];c!==g&&(l("SCROLL"),s()),c=g};return u.addEventListener("scroll",p),()=>u.removeEventListener("scroll",p)}},[o.viewport,n,l,s]),(0,de.jsx)(hn,{present:a||i!=="hidden",children:(0,de.jsx)(_p,{"data-state":i==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Rr(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:Rr(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),Sv=W.forwardRef((e,t)=>{let a=Yt(La,e.__scopeScrollArea),{forceMount:r,...o}=e,[n,s]=W.useState(!1),i=e.orientation==="horizontal",l=Mu(()=>{if(a.viewport){let u=a.viewport.offsetWidth<a.viewport.scrollWidth,d=a.viewport.offsetHeight<a.viewport.scrollHeight;s(i?u:d)}},10);return xn(a.viewport,l),xn(a.content,l),(0,de.jsx)(hn,{present:r||n,children:(0,de.jsx)(_p,{"data-state":n?"visible":"hidden",...o,ref:t})})}),_p=W.forwardRef((e,t)=>{let{orientation:a="vertical",...r}=e,o=Yt(La,e.__scopeScrollArea),n=W.useRef(null),s=W.useRef(0),[i,l]=W.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=bv(i.viewport,i.content),d={...r,sizes:i,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:p=>n.current=p,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:p=>s.current=p};function c(p,g){return db(p,s.current,i,g)}return a==="horizontal"?(0,de.jsx)(nb,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&n.current){let p=o.viewport.scrollLeft,g=gv(p,i,o.dir);n.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollLeft=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollLeft=c(p,o.dir))}}):a==="vertical"?(0,de.jsx)(sb,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&n.current){let p=o.viewport.scrollTop,g=gv(p,i);n.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollTop=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollTop=c(p))}}):null}),nb=W.forwardRef((e,t)=>{let{sizes:a,onSizesChange:r,...o}=e,n=Yt(La,e.__scopeScrollArea),[s,i]=W.useState(),l=W.useRef(null),u=Ga(t,l,n.onScrollbarXChange);return W.useEffect(()=>{l.current&&i(getComputedStyle(l.current))},[l]),(0,de.jsx)(wv,{"data-orientation":"horizontal",...o,ref:u,sizes:a,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Du(a)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,c)=>{if(n.viewport){let p=n.viewport.scrollLeft+d.deltaX;e.onWheelScroll(p),Tv(p,c)&&d.preventDefault()}},onResize:()=>{l.current&&n.viewport&&s&&r({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Ru(s.paddingLeft),paddingEnd:Ru(s.paddingRight)}})}})}),sb=W.forwardRef((e,t)=>{let{sizes:a,onSizesChange:r,...o}=e,n=Yt(La,e.__scopeScrollArea),[s,i]=W.useState(),l=W.useRef(null),u=Ga(t,l,n.onScrollbarYChange);return W.useEffect(()=>{l.current&&i(getComputedStyle(l.current))},[l]),(0,de.jsx)(wv,{"data-orientation":"vertical",...o,ref:u,sizes:a,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Du(a)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,c)=>{if(n.viewport){let p=n.viewport.scrollTop+d.deltaY;e.onWheelScroll(p),Tv(p,c)&&d.preventDefault()}},onResize:()=>{l.current&&n.viewport&&s&&r({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Ru(s.paddingTop),paddingEnd:Ru(s.paddingBottom)}})}})}),[ib,Iv]=yv(La),wv=W.forwardRef((e,t)=>{let{__scopeScrollArea:a,sizes:r,hasThumb:o,onThumbChange:n,onThumbPointerUp:s,onThumbPointerDown:i,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:d,onResize:c,...p}=e,g=Yt(La,a),[L,C]=W.useState(null),w=Ga(t,M=>C(M)),h=W.useRef(null),m=W.useRef(""),x=g.viewport,S=r.content-r.viewport,k=Ar(d),A=Ar(l),P=Mu(c,10);function R(M){if(h.current){let O=M.clientX-h.current.left,pe=M.clientY-h.current.top;u({x:O,y:pe})}}return W.useEffect(()=>{let M=O=>{let pe=O.target;L?.contains(pe)&&k(O,S)};return document.addEventListener("wheel",M,{passive:!1}),()=>document.removeEventListener("wheel",M,{passive:!1})},[x,L,S,k]),W.useEffect(A,[r,A]),xn(L,P),xn(g.content,P),(0,de.jsx)(ib,{scope:a,scrollbar:L,hasThumb:o,onThumbChange:Ar(n),onThumbPointerUp:Ar(s),onThumbPositionChange:A,onThumbPointerDown:Ar(i),children:(0,de.jsx)(mn.div,{...p,ref:w,style:{position:"absolute",...p.style},onPointerDown:Rr(e.onPointerDown,M=>{M.button===0&&(M.target.setPointerCapture(M.pointerId),h.current=L.getBoundingClientRect(),m.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),R(M))}),onPointerMove:Rr(e.onPointerMove,R),onPointerUp:Rr(e.onPointerUp,M=>{let O=M.target;O.hasPointerCapture(M.pointerId)&&O.releasePointerCapture(M.pointerId),document.body.style.webkitUserSelect=m.current,g.viewport&&(g.viewport.style.scrollBehavior=""),h.current=null})})})}),Au="ScrollAreaThumb",zp=W.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=Iv(Au,e.__scopeScrollArea);return(0,de.jsx)(hn,{present:a||o.hasThumb,children:(0,de.jsx)(lb,{ref:t,...r})})}),lb=W.forwardRef((e,t)=>{let{__scopeScrollArea:a,style:r,...o}=e,n=Yt(Au,a),s=Iv(Au,a),{onThumbPositionChange:i}=s,l=Ga(t,c=>s.onThumbChange(c)),u=W.useRef(void 0),d=Mu(()=>{u.current&&(u.current(),u.current=void 0)},100);return W.useEffect(()=>{let c=n.viewport;if(c){let p=()=>{if(d(),!u.current){let g=cb(c,i);u.current=g,i()}};return i(),c.addEventListener("scroll",p),()=>c.removeEventListener("scroll",p)}},[n.viewport,d,i]),(0,de.jsx)(mn.div,{"data-state":s.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Rr(e.onPointerDownCapture,c=>{let g=c.target.getBoundingClientRect(),L=c.clientX-g.left,C=c.clientY-g.top;s.onThumbPointerDown({x:L,y:C})}),onPointerUp:Rr(e.onPointerUp,s.onThumbPointerUp)})});zp.displayName=Au;var Hp="ScrollAreaCorner",kv=W.forwardRef((e,t)=>{let a=Yt(Hp,e.__scopeScrollArea),r=!!(a.scrollbarX&&a.scrollbarY);return a.type!=="scroll"&&r?(0,de.jsx)(ub,{...e,ref:t}):null});kv.displayName=Hp;var ub=W.forwardRef((e,t)=>{let{__scopeScrollArea:a,...r}=e,o=Yt(Hp,a),[n,s]=W.useState(0),[i,l]=W.useState(0),u=!!(n&&i);return xn(o.scrollbarX,()=>{let d=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(d),l(d)}),xn(o.scrollbarY,()=>{let d=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(d),s(d)}),u?(0,de.jsx)(mn.div,{...r,ref:t,style:{width:n,height:i,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Ru(e){return e?parseInt(e,10):0}function bv(e,t){let a=e/t;return isNaN(a)?0:a}function Du(e){let t=bv(e.viewport,e.content),a=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-a)*t;return Math.max(r,18)}function db(e,t,a,r="ltr"){let o=Du(a),n=o/2,s=t||n,i=o-s,l=a.scrollbar.paddingStart+s,u=a.scrollbar.size-a.scrollbar.paddingEnd-i,d=a.content-a.viewport,c=r==="ltr"?[0,d]:[d*-1,0];return Pv([l,u],c)(e)}function gv(e,t,a="ltr"){let r=Du(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,n=t.scrollbar.size-o,s=t.content-t.viewport,i=n-r,l=a==="ltr"?[0,s]:[s*-1,0],u=hv(e,l);return Pv([0,s],[0,i])(u)}function Pv(e,t){return a=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(a-e[0])}}function Tv(e,t){return e>0&&e<t}var cb=(e,t=()=>{})=>{let a={left:e.scrollLeft,top:e.scrollTop},r=0;return(function o(){let n={left:e.scrollLeft,top:e.scrollTop},s=a.left!==n.left,i=a.top!==n.top;(s||i)&&t(),a=n,r=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(r)};function Mu(e,t){let a=Ar(e),r=W.useRef(0);return W.useEffect(()=>()=>window.clearTimeout(r.current),[]),W.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(a,t)},[a,t])}function xn(e,t){let a=Ar(t);pi(()=>{let r=0;if(e){let o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(a)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,a])}var Av=vv,Rv=Cv;var Dv=kv;var Dr=E(le(),1),qp=Mv.forwardRef(({className:e,children:t,...a},r)=>(0,Dr.jsxs)(Av,{"data-slot":"scroll-area",className:Bt("relative",e),...a,children:[(0,Dr.jsx)(Rv,{ref:r,"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),(0,Dr.jsx)(pb,{}),(0,Dr.jsx)(Dv,{})]}));qp.displayName="ScrollArea";function pb({className:e,orientation:t="vertical",...a}){return(0,Dr.jsx)(Up,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Bt("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...a,children:(0,Dr.jsx)(zp,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}var Eu=E($());var Nv=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),mb=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,r)=>r?r.toUpperCase():a.toLowerCase()),Wp=e=>{let t=mb(e);return t.charAt(0).toUpperCase()+t.slice(1)},Nu=(...e)=>e.filter((t,a,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===a).join(" ").trim(),Ev=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var mi=E($());var Fv={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var Bv=(0,mi.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:o="",children:n,iconNode:s,...i},l)=>(0,mi.createElement)("svg",{ref:l,...Fv,width:t,height:t,stroke:e,strokeWidth:r?Number(a)*24/Number(t):a,className:Nu("lucide",o),...!n&&!Ev(i)&&{"aria-hidden":"true"},...i},[...s.map(([u,d])=>(0,mi.createElement)(u,d)),...Array.isArray(n)?n:[n]]));var _=(e,t)=>{let a=(0,Eu.forwardRef)(({className:r,...o},n)=>(0,Eu.createElement)(Bv,{ref:n,iconNode:t,className:Nu(`lucide-${Nv(Wp(e))}`,`lucide-${e}`,r),...o}));return a.displayName=Wp(e),a};var hb=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],hi=_("activity",hb);var gb=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],yn=_("arrow-left",gb);var xb=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],gi=_("arrow-up",xb);var yb=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],xi=_("calendar",yb);var vb=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],yi=_("chevron-down",vb);var Lb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],la=_("circle-alert",Lb);var Cb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],je=_("circle-check",Cb);var Sb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],ua=_("circle-x",Sb);var Ib=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],mo=_("clock",Ib);var wb=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],Ka=_("command",wb);var kb=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],$a=_("corner-down-left",kb);var bb=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],ho=_("credit-card",bb);var Pb=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],go=_("crown",Pb);var Tb=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],xo=_("dollar-sign",Tb);var Ab=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],vn=_("file-spreadsheet",Ab);var Rb=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],Ln=_("key",Rb);var Db=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],vi=_("laptop",Db);var Mb=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ot=_("loader-circle",Mb);var Nb=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],Cn=_("mail",Nb);var Eb=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],Sn=_("map-pin",Eb);var Fb=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],Li=_("paperclip",Fb);var Bb=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],In=_("refresh-cw",Bb);var Ob=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],yo=_("search",Ob);var Vb=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],wn=_("shield",Vb);var Ub=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],Ci=_("smartphone",Ub);var _b=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Ca=_("sparkles",_b);var zb=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],kt=_("square-pen",zb);var Hb=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Si=_("trending-up",Hb);var qb=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],kn=_("users",qb);var Wb=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Mr=_("x",Wb);var Gb=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Ii=_("zap",Gb);var Ae=E(le(),1);function Ov({phase:e,progressSteps:t=[]}){return(0,Ae.jsxs)("div",{className:"mb-3 rounded-lg bg-muted/40 px-3 py-3 text-xs text-muted-foreground transition-colors",children:[e==="thinking"&&t.length===0&&(0,Ae.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ae.jsx)(Ot,{className:"h-3.5 w-3.5 animate-spin"}),(0,Ae.jsx)("span",{children:"Thinking\u2026"})]}),e==="searching"&&(0,Ae.jsxs)("div",{className:"space-y-2 animate-in fade-in-0 duration-300",children:[(0,Ae.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ae.jsx)(yo,{className:"h-3.5 w-3.5 opacity-70"}),(0,Ae.jsx)("span",{children:"Searching across pages\u2026"})]}),(0,Ae.jsxs)("ul",{className:"ml-6 list-disc space-y-1",children:[(0,Ae.jsx)("li",{className:"opacity-90",children:"Checking recent changes"}),(0,Ae.jsx)("li",{className:"opacity-90",children:"Scanning documentation"}),(0,Ae.jsx)("li",{className:"opacity-90",children:"Summarizing relevant sections"})]})]}),(e==="thinking"||e==="executing"||e==="responding")&&t.length>0&&(0,Ae.jsxs)("div",{className:"space-y-2 animate-in fade-in-0 duration-200",children:[t.map((a,r)=>(0,Ae.jsxs)("div",{className:`flex items-center gap-2 transition-opacity duration-200 ${a.completed?"opacity-60":"opacity-100"}`,children:[a.completed?(0,Ae.jsx)(je,{className:"h-3.5 w-3.5 text-green-500 flex-shrink-0"}):(0,Ae.jsx)(Ot,{className:"h-3.5 w-3.5 animate-spin flex-shrink-0"}),(0,Ae.jsx)("span",{className:a.completed?"line-through":"",children:a.message})]},r)),e==="responding"&&(0,Ae.jsxs)("div",{className:"flex items-center gap-2 opacity-100 animate-in fade-in-0 duration-200",children:[(0,Ae.jsx)(Ot,{className:"h-3.5 w-3.5 animate-spin flex-shrink-0"}),(0,Ae.jsx)("span",{children:"Preparing response..."})]})]})]})}var Vv=E($(),1);var da=E(le(),1);function Uv({title:e,links:t}){let[a,r]=Vv.useState(!1);return(0,da.jsxs)("div",{className:"text-xs text-muted-foreground",children:[(0,da.jsx)("button",{type:"button",onClick:()=>r(o=>!o),className:"flex w-full items-center gap-2 px-0 py-0","aria-expanded":a,children:(0,da.jsxs)("div",{className:"flex items-center gap-1.5",children:[a?(0,da.jsx)(yi,{className:"h-3 w-3 opacity-70"}):(0,da.jsx)(yo,{className:"h-3 w-3 opacity-70"}),(0,da.jsx)("span",{children:e})]})}),a&&t.length>0&&(0,da.jsx)("ul",{className:"ml-5 mt-1 space-y-0.5",children:t.map(o=>(0,da.jsx)("li",{children:(0,da.jsx)("a",{href:o.href,target:"_blank",rel:"noreferrer",className:"text-primary hover:underline",children:o.label})},o.href))})]})}var ki=E(le(),1),Sa=E($(),1);var _v=E($(),1),bn=(0,_v.createContext)({});var zv=E($(),1);function Pn(e){let t=(0,zv.useRef)(null);return t.current===null&&(t.current=e()),t.current}var jp=E(le(),1),jv=E($(),1),vo=E($(),1);var Hv=E($(),1),Nr=(0,Hv.createContext)(null);var Wv=E(le(),1),Fu=E($(),1),Xa=E($(),1);var qv=E($(),1),Tn=(0,qv.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});var Gp=class extends Fu.Component{getSnapshotBeforeUpdate(t){let a=this.props.childRef.current;if(a&&t.isPresent&&!this.props.isPresent){let r=this.props.sizeRef.current;r.height=a.offsetHeight||0,r.width=a.offsetWidth||0,r.top=a.offsetTop,r.left=a.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}};function Gv({children:e,isPresent:t}){let a=(0,Xa.useId)(),r=(0,Xa.useRef)(null),o=(0,Xa.useRef)({width:0,height:0,top:0,left:0}),{nonce:n}=(0,Xa.useContext)(Tn);return(0,Xa.useInsertionEffect)(()=>{let{width:s,height:i,top:l,left:u}=o.current;if(t||!r.current||!s||!i)return;r.current.dataset.motionPopId=a;let d=document.createElement("style");return n&&(d.nonce=n),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(`
|
|
9
|
+
[data-motion-pop-id="${a}"] {
|
|
10
10
|
position: absolute !important;
|
|
11
11
|
width: ${s}px !important;
|
|
12
12
|
height: ${i}px !important;
|
|
13
13
|
top: ${l}px !important;
|
|
14
14
|
left: ${u}px !important;
|
|
15
15
|
}
|
|
16
|
-
`),()=>{document.head.removeChild(c)}},[t]),(0,nS.jsx)(Am,{isPresent:t,childRef:a,sizeRef:o,children:Yc.cloneElement(e,{ref:a})})}var lS=({children:e,initial:t,isPresent:r,onExitComplete:a,custom:o,presenceAffectsLayout:n,mode:s})=>{let i=gs(hA),l=(0,Go.useId)(),u=(0,Go.useCallback)(d=>{i.set(d,!0);for(let f of i.values())if(!f)return;a&&a()},[i,a]),c=(0,Go.useMemo)(()=>({id:l,initial:t,isPresent:r,custom:o,onExitComplete:u,register:d=>(i.set(d,!1),()=>i.delete(d))}),n?[Math.random(),u]:[r,u]);return(0,Go.useMemo)(()=>{i.forEach((d,f)=>i.set(f,!1))},[r]),iS.useEffect(()=>{!r&&!i.size&&a&&a()},[r]),s==="popLayout"&&(e=(0,Rm.jsx)(sS,{isPresent:r,children:e})),(0,Rm.jsx)(ao.Provider,{value:c,children:e})};function hA(){return new Map}var oo=D(Y(),1);function Zc(e=!0){let t=(0,oo.useContext)(ao);if(t===null)return[!0,null];let{isPresent:r,onExitComplete:a,register:o}=t,n=(0,oo.useId)();(0,oo.useEffect)(()=>{e&&o(n)},[e]);let s=(0,oo.useCallback)(()=>e&&a&&a(n),[n,a,e]);return!r&&a?[!1,s]:[!0]}var ed=D(Y(),1),Il=e=>e.key||"";function Em(e){let t=[];return ed.Children.forEach(e,r=>{(0,ed.isValidElement)(r)&&t.push(r)}),t}var td=D(Y(),1);var vs=typeof window<"u";var rd=vs?td.useLayoutEffect:td.useEffect;var Dm=({children:e,custom:t,initial:r=!0,onExitComplete:a,presenceAffectsLayout:o=!0,mode:n="sync",propagate:s=!1})=>{let[i,l]=Zc(s),u=(0,Ur.useMemo)(()=>Em(e),[e]),c=s&&!i?[]:u.map(Il),d=(0,Ur.useRef)(!0),f=(0,Ur.useRef)(u),p=gs(()=>new Map),[v,x]=(0,Ur.useState)(u),[C,g]=(0,Ur.useState)(u);rd(()=>{d.current=!1,f.current=u;for(let b=0;b<C.length;b++){let L=Il(C[b]);c.includes(L)?p.delete(L):p.get(L)!==!0&&p.set(L,!1)}},[C,c.length,c.join("-")]);let m=[];if(u!==v){let b=[...u];for(let L=0;L<C.length;L++){let k=C[L],_=Il(k);c.includes(_)||(b.splice(L,0,k),m.push(k))}n==="wait"&&m.length&&(b=m),g(Em(b)),x(u);return}let{forceRender:y}=(0,Ur.useContext)(ms);return(0,kl.jsx)(kl.Fragment,{children:C.map(b=>{let L=Il(b),k=s&&!i?!1:u===C||c.includes(L),_=()=>{if(p.has(L))p.set(L,!0);else return;let T=!0;p.forEach(M=>{M||(T=!1)}),T&&(y?.(),g(f.current),s&&l?.(),a&&a())};return(0,kl.jsx)(lS,{isPresent:k,initial:!d.current||r?void 0:!1,custom:k?void 0:t,presenceAffectsLayout:o,mode:n,onExitComplete:k?void 0:_,children:b},L)})})};var ve=e=>e;var ga=ve,Tr=ve;function Ko(e){let t;return()=>(t===void 0&&(t=e()),t)}var Qt=(e,t,r)=>{let a=t-e;return a===0?1:(r-e)/a};var je=e=>e*1e3,lt=e=>e/1e3;var xs={skipAnimations:!1,useManualTiming:!1};function uS(e){let t=new Set,r=new Set,a=!1,o=!1,n=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1};function i(u){n.has(u)&&(l.schedule(u),e()),u(s)}let l={schedule:(u,c=!1,d=!1)=>{let p=d&&a?t:r;return c&&n.add(u),p.has(u)||p.add(u),u},cancel:u=>{r.delete(u),n.delete(u)},process:u=>{if(s=u,a){o=!0;return}a=!0,[t,r]=[r,t],t.forEach(i),t.clear(),a=!1,o&&(o=!1,l.process(u))}};return l}var ad=["read","resolveKeyframes","update","preRender","render","postRender"],mA=40;function od(e,t){let r=!1,a=!0,o={delta:0,timestamp:0,isProcessing:!1},n=()=>r=!0,s=ad.reduce((g,m)=>(g[m]=uS(n),g),{}),{read:i,resolveKeyframes:l,update:u,preRender:c,render:d,postRender:f}=s,p=()=>{let g=xs.useManualTiming?o.timestamp:performance.now();r=!1,o.delta=a?1e3/60:Math.max(Math.min(g-o.timestamp,mA),1),o.timestamp=g,o.isProcessing=!0,i.process(o),l.process(o),u.process(o),c.process(o),d.process(o),f.process(o),o.isProcessing=!1,r&&t&&(a=!1,e(p))},v=()=>{r=!0,a=!0,o.isProcessing||e(p)};return{schedule:ad.reduce((g,m)=>{let y=s[m];return g[m]=(b,L=!1,k=!1)=>(r||v(),y.schedule(b,L,k)),g},{}),cancel:g=>{for(let m=0;m<ad.length;m++)s[ad[m]].cancel(g)},state:o,steps:s}}var{schedule:te,cancel:Yt,state:qe,steps:nd}=od(typeof requestAnimationFrame<"u"?requestAnimationFrame:ve,!0);var cS=D(Y(),1),sd=(0,cS.createContext)({strict:!1});var dS={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"]},ya={};for(let e in dS)ya[e]={isEnabled:t=>dS[e].some(r=>!!t[r])};function fS(e){for(let t in e)ya[t]={...ya[t],...e[t]}}var gA=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 Pl(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||gA.has(e)}var pS=e=>!Pl(e);function yA(e){e&&(pS=t=>t.startsWith("on")?!Pl(t):e(t))}try{yA(YI("@emotion/is-prop-valid").default)}catch{}function hS(e,t,r){let a={};for(let o in e)o==="values"&&typeof e.values=="object"||(pS(o)||r===!0&&Pl(o)||!t&&!Pl(o)||e.draggable&&o.startsWith("onDrag"))&&(a[o]=e[o]);return a}function mS(e){if(typeof Proxy>"u")return e;let t=new Map,r=(...a)=>e(...a);return new Proxy(r,{get:(a,o)=>o==="create"?e:(t.has(o)||t.set(o,e(o)),t.get(o))})}var fd=D(de(),1);var Cs=D(Y(),1);var gS=D(Y(),1),no=(0,gS.createContext)({});var ud=D(Y(),1);function va(e){return typeof e=="string"||Array.isArray(e)}function so(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}var id=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Tl=["initial",...id];function Xo(e){return so(e.animate)||Tl.some(t=>va(e[t]))}function ld(e){return!!(Xo(e)||e.variants)}function yS(e,t){if(Xo(e)){let{initial:r,animate:a}=e;return{initial:r===!1||va(r)?r:void 0,animate:va(a)?a:void 0}}return e.inherit!==!1?t:{}}function xS(e){let{initial:t,animate:r}=yS(e,(0,ud.useContext)(no));return(0,ud.useMemo)(()=>({initial:t,animate:r}),[vS(t),vS(r)])}function vS(e){return Array.isArray(e)?e.join(" "):e}var wS=Symbol.for("motionComponentSymbol");var SS=D(Y(),1);function xa(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function CS(e,t,r){return(0,SS.useCallback)(a=>{a&&e.onMount&&e.onMount(a),t&&(a?t.mount(a):t.unmount()),r&&(typeof r=="function"?r(a):xa(r)&&(r.current=a))},[t])}var Ut=D(Y(),1);var ws=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase();var vA="framerAppearId",cd="data-"+ws(vA);var{schedule:Ss,cancel:q2}=od(queueMicrotask,!1);var bS=D(Y(),1),dd=(0,bS.createContext)({});function LS(e,t,r,a,o){var n,s;let{visualElement:i}=(0,Ut.useContext)(no),l=(0,Ut.useContext)(sd),u=(0,Ut.useContext)(ao),c=(0,Ut.useContext)(ys).reducedMotion,d=(0,Ut.useRef)(null);a=a||l.renderer,!d.current&&a&&(d.current=a(e,{visualState:t,parent:i,props:r,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:c}));let f=d.current,p=(0,Ut.useContext)(dd);f&&!f.projection&&o&&(f.type==="html"||f.type==="svg")&&xA(d.current,r,o,p);let v=(0,Ut.useRef)(!1);(0,Ut.useInsertionEffect)(()=>{f&&v.current&&f.update(r,u)});let x=r[cd],C=(0,Ut.useRef)(!!x&&!(!((n=window.MotionHandoffIsComplete)===null||n===void 0)&&n.call(window,x))&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,x)));return rd(()=>{f&&(v.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),Ss.render(f.render),C.current&&f.animationState&&f.animationState.animateChanges())}),(0,Ut.useEffect)(()=>{f&&(!C.current&&f.animationState&&f.animationState.animateChanges(),C.current&&(queueMicrotask(()=>{var g;(g=window.MotionHandoffMarkAsComplete)===null||g===void 0||g.call(window,x)}),C.current=!1))}),f}function xA(e,t,r,a){let{layoutId:o,layout:n,drag:s,dragConstraints:i,layoutScroll:l,layoutRoot:u}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:IS(e.parent)),e.projection.setOptions({layoutId:o,layout:n,alwaysMeasureLayout:!!s||i&&xa(i),visualElement:e,animationType:typeof n=="string"?n:"both",initialPromotionConfig:a,layoutScroll:l,layoutRoot:u})}function IS(e){if(e)return e.options.allowProjection!==!1?e.projection:IS(e.parent)}function kS({preloadedFeatures:e,createVisualElement:t,useRender:r,useVisualState:a,Component:o}){var n,s;e&&fS(e);function i(u,c){let d,f={...(0,Cs.useContext)(ys),...u,layoutId:wA(u)},{isStatic:p}=f,v=xS(u),x=a(u,p);if(!p&&vs){SA(f,e);let C=CA(f);d=C.MeasureLayout,v.visualElement=LS(o,x,f,t,C.ProjectionNode)}return(0,fd.jsxs)(no.Provider,{value:v,children:[d&&v.visualElement?(0,fd.jsx)(d,{visualElement:v.visualElement,...f}):null,r(o,u,CS(x,v.visualElement,c),x,p,v.visualElement)]})}i.displayName=`motion.${typeof o=="string"?o:`create(${(s=(n=o.displayName)!==null&&n!==void 0?n:o.name)!==null&&s!==void 0?s:""})`}`;let l=(0,Cs.forwardRef)(i);return l[wS]=o,l}function wA({layoutId:e}){let t=(0,Cs.useContext)(ms).id;return t&&e!==void 0?t+"-"+e:e}function SA(e,t){let r=(0,Cs.useContext)(sd).strict}function CA(e){let{drag:t,layout:r}=ya;if(!t&&!r)return{};let a={...t,...r};return{MeasureLayout:t?.isEnabled(e)||r?.isEnabled(e)?a.MeasureLayout:void 0,ProjectionNode:a.ProjectionNode}}var PS=["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 bs(e){return typeof e!="string"||e.includes("-")?!1:!!(PS.indexOf(e)>-1||/[A-Z]/u.test(e))}var Nm=D(Y(),1);function TS(e){let t=[{},{}];return e?.values.forEach((r,a)=>{t[0][a]=r.get(),t[1][a]=r.getVelocity()}),t}function Ls(e,t,r,a){if(typeof t=="function"){let[o,n]=TS(a);t=t(r!==void 0?r:e.custom,o,n)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){let[o,n]=TS(a);t=t(r!==void 0?r:e.custom,o,n)}return t}var _l=e=>Array.isArray(e);var _S=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),AS=e=>_l(e)?e[e.length-1]||0:e;var Se=e=>!!(e&&e.getVelocity);function Is(e){let t=Se(e)?e.get():e;return _S(t)?t.toValue():t}function bA({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:r},a,o,n){let s={latestValues:LA(a,o,n,e),renderState:t()};return r&&(s.onMount=i=>r({props:a,current:i,...s}),s.onUpdate=i=>r(i)),s}var pd=e=>(t,r)=>{let a=(0,Nm.useContext)(no),o=(0,Nm.useContext)(ao),n=()=>bA(e,t,a,o);return r?n():gs(n)};function LA(e,t,r,a){let o={},n=a(e,{});for(let f in n)o[f]=Is(n[f]);let{initial:s,animate:i}=e,l=Xo(e),u=ld(e);t&&u&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),i===void 0&&(i=t.animate));let c=r?r.initial===!1:!1;c=c||s===!1;let d=c?i:s;if(d&&typeof d!="boolean"&&!so(d)){let f=Array.isArray(d)?d:[d];for(let p=0;p<f.length;p++){let v=Ls(e,f[p]);if(v){let{transitionEnd:x,transition:C,...g}=v;for(let m in g){let y=g[m];if(Array.isArray(y)){let b=c?y.length-1:0;y=y[b]}y!==null&&(o[m]=y)}for(let m in x)o[m]=x[m]}}}return o}var Vr=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Vt=new Set(Vr);var RS=e=>t=>typeof t=="string"&&t.startsWith(e),hd=RS("--"),IA=RS("var(--"),ks=e=>IA(e)?kA.test(e.split("/*")[0].trim()):!1,kA=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;var md=(e,t)=>t&&typeof e=="number"?t.transform(e):e;var ut=(e,t,r)=>r>t?t:r<e?e:r;var jr={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},wa={...jr,transform:e=>ut(0,1,e)},Al={...jr,default:1};var Rl=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),qr=Rl("deg"),Tt=Rl("%"),H=Rl("px"),ES=Rl("vh"),DS=Rl("vw"),Mm={...Tt,parse:e=>Tt.parse(e)/100,transform:e=>Tt.transform(e*100)};var NS={borderWidth:H,borderTopWidth:H,borderRightWidth:H,borderBottomWidth:H,borderLeftWidth:H,borderRadius:H,radius:H,borderTopLeftRadius:H,borderTopRightRadius:H,borderBottomRightRadius:H,borderBottomLeftRadius:H,width:H,maxWidth:H,height:H,maxHeight:H,top:H,right:H,bottom:H,left:H,padding:H,paddingTop:H,paddingRight:H,paddingBottom:H,paddingLeft:H,margin:H,marginTop:H,marginRight:H,marginBottom:H,marginLeft:H,backgroundPositionX:H,backgroundPositionY:H};var MS={rotate:qr,rotateX:qr,rotateY:qr,rotateZ:qr,scale:Al,scaleX:Al,scaleY:Al,scaleZ:Al,skew:qr,skewX:qr,skewY:qr,distance:H,translateX:H,translateY:H,translateZ:H,x:H,y:H,z:H,perspective:H,transformPerspective:H,opacity:wa,originX:Mm,originY:Mm,originZ:H};var Om={...jr,transform:Math.round};var Ps={...NS,...MS,zIndex:Om,size:H,fillOpacity:wa,strokeOpacity:wa,numOctaves:Om};var PA={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},TA=Vr.length;function OS(e,t,r){let a="",o=!0;for(let n=0;n<TA;n++){let s=Vr[n],i=e[s];if(i===void 0)continue;let l=!0;if(typeof i=="number"?l=i===(s.startsWith("scale")?1:0):l=parseFloat(i)===0,!l||r){let u=md(i,Ps[s]);if(!l){o=!1;let c=PA[s]||s;a+=`${c}(${u}) `}r&&(t[s]=u)}}return a=a.trim(),r?a=r(t,o?"":a):o&&(a="none"),a}function Ts(e,t,r){let{style:a,vars:o,transformOrigin:n}=e,s=!1,i=!1;for(let l in t){let u=t[l];if(Vt.has(l)){s=!0;continue}else if(hd(l)){o[l]=u;continue}else{let c=md(u,Ps[l]);l.startsWith("origin")?(i=!0,n[l]=c):a[l]=c}}if(t.transform||(s||r?a.transform=OS(t,e.transform,r):a.transform&&(a.transform="none")),i){let{originX:l="50%",originY:u="50%",originZ:c=0}=n;a.transformOrigin=`${l} ${u} ${c}`}}var _A={offset:"stroke-dashoffset",array:"stroke-dasharray"},AA={offset:"strokeDashoffset",array:"strokeDasharray"};function BS(e,t,r=1,a=0,o=!0){e.pathLength=1;let n=o?_A:AA;e[n.offset]=H.transform(-a);let s=H.transform(t),i=H.transform(r);e[n.array]=`${s} ${i}`}function FS(e,t,r){return typeof e=="string"?e:H.transform(t+r*e)}function US(e,t,r){let a=FS(t,e.x,e.width),o=FS(r,e.y,e.height);return`${a} ${o}`}function _s(e,{attrX:t,attrY:r,attrScale:a,originX:o,originY:n,pathLength:s,pathSpacing:i=1,pathOffset:l=0,...u},c,d){if(Ts(e,u,d),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:f,style:p,dimensions:v}=e;f.transform&&(v&&(p.transform=f.transform),delete f.transform),v&&(o!==void 0||n!==void 0||p.transform)&&(p.transformOrigin=US(v,o!==void 0?o:.5,n!==void 0?n:.5)),t!==void 0&&(f.x=t),r!==void 0&&(f.y=r),a!==void 0&&(f.scale=a),s!==void 0&&BS(f,s,i,l,!1)}var As=()=>({style:{},transform:{},transformOrigin:{},vars:{}});var gd=()=>({...As(),attrs:{}});var Rs=e=>typeof e=="string"&&e.toLowerCase()==="svg";function yd(e,{style:t,vars:r},a,o){Object.assign(e.style,t,o&&o.getProjectionStyles(a));for(let n in r)e.style.setProperty(n,r[n])}var vd=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 xd(e,t,r,a){yd(e,t,void 0,a);for(let o in t.attrs)e.setAttribute(vd.has(o)?o:ws(o),t.attrs[o])}var Es={};function VS(e){Object.assign(Es,e)}function wd(e,{layout:t,layoutId:r}){return Vt.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!Es[e]||e==="opacity")}function Ds(e,t,r){var a;let{style:o}=e,n={};for(let s in o)(Se(o[s])||t.style&&Se(t.style[s])||wd(s,e)||((a=r?.getValue(s))===null||a===void 0?void 0:a.liveStyle)!==void 0)&&(n[s]=o[s]);return n}function Sd(e,t,r){let a=Ds(e,t,r);for(let o in e)if(Se(e[o])||Se(t[o])){let n=Vr.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;a[n]=e[o]}return a}function RA(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}var jS=["x","y","width","height","cx","cy","r"],qS={useVisualState:pd({scrapeMotionValuesFromProps:Sd,createRenderState:gd,onUpdate:({props:e,prevProps:t,current:r,renderState:a,latestValues:o})=>{if(!r)return;let n=!!e.drag;if(!n){for(let i in o)if(Vt.has(i)){n=!0;break}}if(!n)return;let s=!t;if(t)for(let i=0;i<jS.length;i++){let l=jS[i];e[l]!==t[l]&&(s=!0)}s&&te.read(()=>{RA(r,a),te.render(()=>{_s(a,o,Rs(r.tagName),e.transformTemplate),xd(r,a)})})}})};var HS={useVisualState:pd({scrapeMotionValuesFromProps:Ds,createRenderState:As})};var Ns=D(Y(),1);var zS=D(Y(),1);function Bm(e,t,r){for(let a in t)!Se(t[a])&&!wd(a,r)&&(e[a]=t[a])}function EA({transformTemplate:e},t){return(0,zS.useMemo)(()=>{let r=As();return Ts(r,t,e),Object.assign({},r.vars,r.style)},[t])}function DA(e,t){let r=e.style||{},a={};return Bm(a,r,e),Object.assign(a,EA(e,t)),a}function $S(e,t){let r={},a=DA(e,t);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,a.userSelect=a.WebkitUserSelect=a.WebkitTouchCallout="none",a.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=a,r}var WS=D(Y(),1);function GS(e,t,r,a){let o=(0,WS.useMemo)(()=>{let n=gd();return _s(n,t,Rs(a),e.transformTemplate),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let n={};Bm(n,e.style,e),o.style={...n,...o.style}}return o}function KS(e=!1){return(r,a,o,{latestValues:n},s)=>{let l=(bs(r)?GS:$S)(a,n,s,r),u=hS(a,typeof r=="string",e),c=r!==Ns.Fragment?{...u,...l,ref:o}:{},{children:d}=a,f=(0,Ns.useMemo)(()=>Se(d)?d.get():d,[d]);return(0,Ns.createElement)(r,{...c,children:f})}}function XS(e,t){return function(a,{forwardMotionProps:o}={forwardMotionProps:!1}){let s={...bs(a)?qS:HS,preloadedFeatures:e,useRender:KS(o),createVisualElement:t,Component:a};return kS(s)}}function Fm(e,t){if(!Array.isArray(t))return!1;let r=t.length;if(r!==e.length)return!1;for(let a=0;a<r;a++)if(t[a]!==e[a])return!1;return!0}function io(e,t,r){let a=e.getProps();return Ls(a,t,r!==void 0?r:a.custom,e)}var Um=Ko(()=>window.ScrollTimeline!==void 0);var El=class{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,r){for(let a=0;a<this.animations.length;a++)this.animations[a][t]=r}attachTimeline(t,r){let a=this.animations.map(o=>{if(Um()&&o.attachTimeline)return o.attachTimeline(t);if(typeof r=="function")return r(o)});return()=>{a.forEach((o,n)=>{o&&o(),this.animations[n].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 r=0;r<this.animations.length;r++)t=Math.max(t,this.animations[r].duration);return t}runAll(t){this.animations.forEach(r=>r[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}};var Dl=class extends El{then(t,r){return Promise.all(this.animations).then(t).catch(r)}};function lo(e,t){return e?e[t]||e.default||e:void 0}function Ms(e){let t=0,r=50,a=e.next(t);for(;!a.done&&t<2e4;)t+=r,a=e.next(t);return t>=2e4?1/0:t}function uo(e){return typeof e=="function"}function Nl(e,t){e.timeline=t,e.onfinish=null}var Os=e=>Array.isArray(e)&&typeof e[0]=="number";var jm={linearEasing:void 0};function JS(e,t){let r=Ko(e);return()=>{var a;return(a=jm[t])!==null&&a!==void 0?a:r()}}var co=JS(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");var Ml=(e,t,r=10)=>{let a="",o=Math.max(Math.round(t/r),2);for(let n=0;n<o;n++)a+=e(Qt(0,o-1,n))+", ";return`linear(${a.substring(0,a.length-2)})`};function bd(e){return!!(typeof e=="function"&&co()||!e||typeof e=="string"&&(e in Cd||co())||Os(e)||Array.isArray(e)&&e.every(bd))}var Bs=([e,t,r,a])=>`cubic-bezier(${e}, ${t}, ${r}, ${a})`,Cd={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Bs([0,.65,.55,1]),circOut:Bs([.55,0,1,.45]),backIn:Bs([.31,.01,.66,-.59]),backOut:Bs([.33,1.53,.69,.99])};function Fs(e,t){if(e)return typeof e=="function"&&co()?Ml(e,t):Os(e)?Bs(e):Array.isArray(e)?e.map(r=>Fs(r,t)||Cd.easeOut):Cd[e]}var Zt={x:!1,y:!1};function Us(){return Zt.x||Zt.y}function qm(e,t,r){var a;if(e instanceof Element)return[e];if(typeof e=="string"){let o=document;t&&(o=t.current);let n=(a=r?.[e])!==null&&a!==void 0?a:o.querySelectorAll(e);return n?Array.from(n):[]}return Array.from(e)}function Ld(e,t){let r=qm(e),a=new AbortController,o={passive:!0,...t,signal:a.signal};return[r,o,()=>a.abort()]}function QS(e){return t=>{t.pointerType==="touch"||Us()||e(t)}}function Hm(e,t,r={}){let[a,o,n]=Ld(e,r),s=QS(i=>{let{target:l}=i,u=t(i);if(typeof u!="function"||!l)return;let c=QS(d=>{u(d),l.removeEventListener("pointerleave",c)});l.addEventListener("pointerleave",c,o)});return a.forEach(i=>{i.addEventListener("pointerenter",s,o)}),n}var Id=(e,t)=>t?e===t?!0:Id(e,t.parentElement):!1;var Jo=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;var NA=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function YS(e){return NA.has(e.tagName)||e.tabIndex!==-1}var Qo=new WeakSet;function ZS(e){return t=>{t.key==="Enter"&&e(t)}}function zm(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}var eC=(e,t)=>{let r=e.currentTarget;if(!r)return;let a=ZS(()=>{if(Qo.has(r))return;zm(r,"down");let o=ZS(()=>{zm(r,"up")}),n=()=>zm(r,"cancel");r.addEventListener("keyup",o,t),r.addEventListener("blur",n,t)});r.addEventListener("keydown",a,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",a),t)};function tC(e){return Jo(e)&&!Us()}function $m(e,t,r={}){let[a,o,n]=Ld(e,r),s=i=>{let l=i.currentTarget;if(!tC(i)||Qo.has(l))return;Qo.add(l);let u=t(i),c=(p,v)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),!(!tC(p)||!Qo.has(l))&&(Qo.delete(l),typeof u=="function"&&u(p,{success:v}))},d=p=>{c(p,r.useGlobalTarget||Id(l,p.target))},f=p=>{c(p,!1)};window.addEventListener("pointerup",d,o),window.addEventListener("pointercancel",f,o)};return a.forEach(i=>{!YS(i)&&i.getAttribute("tabindex")===null&&(i.tabIndex=0),(r.useGlobalTarget?window:i).addEventListener("pointerdown",s,o),i.addEventListener("focus",u=>eC(u,o),o)}),n}function Wm(e){return e==="x"||e==="y"?Zt[e]?null:(Zt[e]=!0,()=>{Zt[e]=!1}):Zt.x||Zt.y?null:(Zt.x=Zt.y=!0,()=>{Zt.x=Zt.y=!1})}var kd=new Set(["width","height","top","left","right","bottom",...Vr]);var Pd;function OA(){Pd=void 0}var St={now:()=>(Pd===void 0&&St.set(qe.isProcessing||xs.useManualTiming?qe.timestamp:performance.now()),Pd),set:e=>{Pd=e,queueMicrotask(OA)}};function Vs(e,t){e.indexOf(t)===-1&&e.push(t)}function js(e,t){let r=e.indexOf(t);r>-1&&e.splice(r,1)}var fo=class{constructor(){this.subscriptions=[]}add(t){return Vs(this.subscriptions,t),()=>js(this.subscriptions,t)}notify(t,r,a){let o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,r,a);else for(let n=0;n<o;n++){let s=this.subscriptions[n];s&&s(t,r,a)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};function Td(e,t){return t?e*(1e3/t):0}var aC=30,BA=e=>!isNaN(parseFloat(e)),oC={current:void 0},Gm=class{constructor(t,r={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(a,o=!0)=>{let n=St.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(a),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),o&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=r.owner}setCurrent(t){this.current=t,this.updatedAt=St.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=BA(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,r){this.events[t]||(this.events[t]=new fo);let a=this.events[t].add(r);return t==="change"?()=>{a(),te.read(()=>{this.events.change.getSize()||this.stop()})}:a}clearListeners(){for(let t in this.events)this.events[t].clear()}attach(t,r){this.passiveEffect=t,this.stopPassiveEffect=r}set(t,r=!0){!r||!this.passiveEffect?this.updateAndNotify(t,r):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,r,a){this.set(r),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-a}jump(t,r=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return oC.current&&oC.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let t=St.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>aC)return 0;let r=Math.min(this.updatedAt-this.prevUpdatedAt,aC);return Td(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(t){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=t(r),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 Sa(e,t){return new Gm(e,t)}function FA(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,Sa(r))}function nC(e,t){let r=io(e,t),{transitionEnd:a={},transition:o={},...n}=r||{};n={...n,...a};for(let s in n){let i=AS(n[s]);FA(e,s,i)}}function sC(e){return!!(Se(e)&&e.add)}function Ol(e,t){let r=e.getValue("willChange");if(sC(r))return r.add(t)}function _d(e){return e.props[cd]}var Ad={current:!1};var iC=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,UA=1e-7,VA=12;function jA(e,t,r,a,o){let n,s,i=0;do s=t+(r-t)/2,n=iC(s,a,o)-e,n>0?r=s:t=s;while(Math.abs(n)>UA&&++i<VA);return s}function po(e,t,r,a){if(e===t&&r===a)return ve;let o=n=>jA(n,0,1,e,r);return n=>n===0||n===1?n:iC(o(n),t,a)}var Rd=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2;var Ed=e=>t=>1-e(1-t);var Km=po(.33,1.53,.69,.99),Bl=Ed(Km),Dd=Rd(Bl);var Nd=e=>(e*=2)<1?.5*Bl(e):.5*(2-Math.pow(2,-10*(e-1)));var Md=e=>1-Math.sin(Math.acos(e)),Od=Ed(Md),Bd=Rd(Md);var Fd=e=>/^0[^.\s]+$/u.test(e);function lC(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Fd(e):!0}var ho=e=>Math.round(e*1e5)/1e5;var qs=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function uC(e){return e==null}var cC=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var Hs=(e,t)=>r=>!!(typeof r=="string"&&cC.test(r)&&r.startsWith(e)||t&&!uC(r)&&Object.prototype.hasOwnProperty.call(r,t)),Ud=(e,t,r)=>a=>{if(typeof a!="string")return a;let[o,n,s,i]=a.match(qs);return{[e]:parseFloat(o),[t]:parseFloat(n),[r]:parseFloat(s),alpha:i!==void 0?parseFloat(i):1}};var qA=e=>ut(0,255,e),Xm={...jr,transform:e=>Math.round(qA(e))},Hr={test:Hs("rgb","red"),parse:Ud("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:a=1})=>"rgba("+Xm.transform(e)+", "+Xm.transform(t)+", "+Xm.transform(r)+", "+ho(wa.transform(a))+")"};function HA(e){let t="",r="",a="",o="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),a=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),a=e.substring(3,4),o=e.substring(4,5),t+=t,r+=r,a+=a,o+=o),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(a,16),alpha:o?parseInt(o,16)/255:1}}var Fl={test:Hs("#"),parse:HA,transform:Hr.transform};var mo={test:Hs("hsl","hue"),parse:Ud("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:a=1})=>"hsla("+Math.round(e)+", "+Tt.transform(ho(t))+", "+Tt.transform(ho(r))+", "+ho(wa.transform(a))+")"};var $e={test:e=>Hr.test(e)||Fl.test(e)||mo.test(e),parse:e=>Hr.test(e)?Hr.parse(e):mo.test(e)?mo.parse(e):Fl.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Hr.transform(e):mo.transform(e)};var dC=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function zA(e){var t,r;return isNaN(e)&&typeof e=="string"&&(((t=e.match(qs))===null||t===void 0?void 0:t.length)||0)+(((r=e.match(dC))===null||r===void 0?void 0:r.length)||0)>0}var pC="number",hC="color",$A="var",WA="var(",fC="${}",GA=/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 Yo(e){let t=e.toString(),r=[],a={color:[],number:[],var:[]},o=[],n=0,i=t.replace(GA,l=>($e.test(l)?(a.color.push(n),o.push(hC),r.push($e.parse(l))):l.startsWith(WA)?(a.var.push(n),o.push($A),r.push(l)):(a.number.push(n),o.push(pC),r.push(parseFloat(l))),++n,fC)).split(fC);return{values:r,split:i,indexes:a,types:o}}function mC(e){return Yo(e).values}function gC(e){let{split:t,types:r}=Yo(e),a=t.length;return o=>{let n="";for(let s=0;s<a;s++)if(n+=t[s],o[s]!==void 0){let i=r[s];i===pC?n+=ho(o[s]):i===hC?n+=$e.transform(o[s]):n+=o[s]}return n}}var KA=e=>typeof e=="number"?0:e;function XA(e){let t=mC(e);return gC(e)(t.map(KA))}var _t={test:zA,parse:mC,createTransformer:gC,getAnimatableNone:XA};var JA=new Set(["brightness","contrast","saturate","opacity"]);function QA(e){let[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;let[a]=r.match(qs)||[];if(!a)return e;let o=r.replace(a,""),n=JA.has(t)?1:0;return a!==r&&(n*=100),t+"("+n+o+")"}var YA=/\b([a-z-]*)\(.*?\)/gu,Ul={..._t,getAnimatableNone:e=>{let t=e.match(YA);return t?t.map(QA).join(" "):e}};var ZA={...Ps,color:$e,backgroundColor:$e,outlineColor:$e,fill:$e,stroke:$e,borderColor:$e,borderTopColor:$e,borderRightColor:$e,borderBottomColor:$e,borderLeftColor:$e,filter:Ul,WebkitFilter:Ul},zs=e=>ZA[e];function Vd(e,t){let r=zs(e);return r!==Ul&&(r=_t),r.getAnimatableNone?r.getAnimatableNone(t):void 0}var eR=new Set(["auto","none","0"]);function yC(e,t,r){let a=0,o;for(;a<e.length&&!o;){let n=e[a];typeof n=="string"&&!eR.has(n)&&Yo(n).values.length&&(o=e[a]),a++}if(o&&r)for(let n of t)e[n]=Vd(r,o)}var Jm=e=>e===jr||e===H,vC=(e,t)=>parseFloat(e.split(", ")[t]),xC=(e,t)=>(r,{transform:a})=>{if(a==="none"||!a)return 0;let o=a.match(/^matrix3d\((.+)\)$/u);if(o)return vC(o[1],t);{let n=a.match(/^matrix\((.+)\)$/u);return n?vC(n[1],e):0}},tR=new Set(["x","y","z"]),rR=Vr.filter(e=>!tR.has(e));function wC(e){let t=[];return rR.forEach(r=>{let a=e.getValue(r);a!==void 0&&(t.push([r,a.get()]),a.set(r.startsWith("scale")?1:0))}),t}var Zo={width:({x:e},{paddingLeft:t="0",paddingRight:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),height:({y:e},{paddingTop:t="0",paddingBottom:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),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:xC(4,13),y:xC(5,14)};Zo.translateX=Zo.x;Zo.translateY=Zo.y;var en=new Set,Qm=!1,Ym=!1;function SC(){if(Ym){let e=Array.from(en).filter(a=>a.needsMeasurement),t=new Set(e.map(a=>a.element)),r=new Map;t.forEach(a=>{let o=wC(a);o.length&&(r.set(a,o),a.render())}),e.forEach(a=>a.measureInitialState()),t.forEach(a=>{a.render();let o=r.get(a);o&&o.forEach(([n,s])=>{var i;(i=a.getValue(n))===null||i===void 0||i.set(s)})}),e.forEach(a=>a.measureEndState()),e.forEach(a=>{a.suspendedScrollY!==void 0&&window.scrollTo(0,a.suspendedScrollY)})}Ym=!1,Qm=!1,en.forEach(e=>e.complete()),en.clear()}function CC(){en.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Ym=!0)})}function bC(){CC(),SC()}var go=class{constructor(t,r,a,o,n,s=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=r,this.name=a,this.motionValue=o,this.element=n,this.isAsync=s}scheduleResolve(){this.isScheduled=!0,this.isAsync?(en.add(this),Qm||(Qm=!0,te.read(CC),te.resolveKeyframes(SC))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:t,name:r,element:a,motionValue:o}=this;for(let n=0;n<t.length;n++)if(t[n]===null)if(n===0){let s=o?.get(),i=t[t.length-1];if(s!==void 0)t[0]=s;else if(a&&r){let l=a.readValue(r,i);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=i),o&&s===void 0&&o.set(t[0])}else t[n]=t[n-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),en.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,en.delete(this))}resume(){this.isComplete||this.scheduleResolve()}};var jd=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);var aR=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function oR(e){let t=aR.exec(e);if(!t)return[,];let[,r,a,o]=t;return[`--${r??a}`,o]}var nR=4;function Zm(e,t,r=1){Tr(r<=nR,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);let[a,o]=oR(e);if(!a)return;let n=window.getComputedStyle(t).getPropertyValue(a);if(n){let s=n.trim();return jd(s)?parseFloat(s):s}return ks(o)?Zm(o,t,r+1):o}var qd=e=>t=>t.test(e);var LC={test:e=>e==="auto",parse:e=>e};var eg=[jr,H,Tt,qr,DS,ES,LC],tg=e=>eg.find(qd(e));var $s=class extends go{constructor(t,r,a,o,n){super(t,r,a,o,n,!0)}readKeyframes(){let{unresolvedKeyframes:t,element:r,name:a}=this;if(!r||!r.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let u=t[l];if(typeof u=="string"&&(u=u.trim(),ks(u))){let c=Zm(u,r.current);c!==void 0&&(t[l]=c),l===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!kd.has(a)||t.length!==2)return;let[o,n]=t,s=tg(o),i=tg(n);if(s!==i)if(Jm(s)&&Jm(i))for(let l=0;l<t.length;l++){let u=t[l];typeof u=="string"&&(t[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){let{unresolvedKeyframes:t,name:r}=this,a=[];for(let o=0;o<t.length;o++)lC(t[o])&&a.push(o);a.length&&yC(t,a,r)}measureInitialState(){let{element:t,unresolvedKeyframes:r,name:a}=this;if(!t||!t.current)return;a==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Zo[a](t.measureViewportBox(),window.getComputedStyle(t.current)),r[0]=this.measuredOrigin;let o=r[r.length-1];o!==void 0&&t.getValue(a,o).jump(o,!1)}measureEndState(){var t;let{element:r,name:a,unresolvedKeyframes:o}=this;if(!r||!r.current)return;let n=r.getValue(a);n&&n.jump(this.measuredOrigin,!1);let s=o.length-1,i=o[s];o[s]=Zo[a](r.measureViewportBox(),window.getComputedStyle(r.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,u])=>{r.getValue(l).set(u)}),this.resolveNoneKeyframes()}};var rg=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(_t.test(e)||e==="0")&&!e.startsWith("url("));function sR(e){let t=e[0];if(e.length===1)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}function IC(e,t,r,a){let o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;let n=e[e.length-1],s=rg(o,t),i=rg(n,t);return ga(s===i,`You are trying to animate ${t} from "${o}" to "${n}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${n} via the \`style\` property.`),!s||!i?!1:sR(e)||(r==="spring"||uo(r))&&a}var iR=e=>e!==null;function yo(e,{repeat:t,repeatType:r="loop"},a){let o=e.filter(iR),n=t&&r!=="loop"&&t%2===1?0:o.length-1;return!n||a===void 0?o[n]:a}var lR=40,Ws=class{constructor({autoplay:t=!0,delay:r=0,type:a="keyframes",repeat:o=0,repeatDelay:n=0,repeatType:s="loop",...i}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=St.now(),this.options={autoplay:t,delay:r,type:a,repeat:o,repeatDelay:n,repeatType:s,...i},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>lR?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&bC(),this._resolved}onKeyframesResolved(t,r){this.resolvedAt=St.now(),this.hasAttemptedResolve=!0;let{name:a,type:o,velocity:n,delay:s,onComplete:i,onUpdate:l,isGenerator:u}=this.options;if(!u&&!IC(t,a,o,n))if(Ad.current||!s){l&&l(yo(t,this.options,r)),i&&i(),this.resolveFinishedPromise();return}else this.options.duration=0;let c=this.initPlayback(t,r);c!==!1&&(this._resolved={keyframes:t,finalKeyframe:r,...c},this.onPostResolved())}onPostResolved(){}then(t,r){return this.currentFinishedPromise.then(t,r)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}};var le=(e,t,r)=>e+(t-e)*r;function ag(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function kC({hue:e,saturation:t,lightness:r,alpha:a}){e/=360,t/=100,r/=100;let o=0,n=0,s=0;if(!t)o=n=s=r;else{let i=r<.5?r*(1+t):r+t-r*t,l=2*r-i;o=ag(l,i,e+1/3),n=ag(l,i,e),s=ag(l,i,e-1/3)}return{red:Math.round(o*255),green:Math.round(n*255),blue:Math.round(s*255),alpha:a}}function Gs(e,t){return r=>r>0?t:e}var og=(e,t,r)=>{let a=e*e,o=r*(t*t-a)+a;return o<0?0:Math.sqrt(o)},uR=[Fl,Hr,mo],cR=e=>uR.find(t=>t.test(e));function PC(e){let t=cR(e);if(ga(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let r=t.parse(e);return t===mo&&(r=kC(r)),r}var ng=(e,t)=>{let r=PC(e),a=PC(t);if(!r||!a)return Gs(e,t);let o={...r};return n=>(o.red=og(r.red,a.red,n),o.green=og(r.green,a.green,n),o.blue=og(r.blue,a.blue,n),o.alpha=le(r.alpha,a.alpha,n),Hr.transform(o))};var dR=(e,t)=>r=>t(e(r)),zr=(...e)=>e.reduce(dR);var Hd=new Set(["none","hidden"]);function TC(e,t){return Hd.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function fR(e,t){return r=>le(e,t,r)}function zd(e){return typeof e=="number"?fR:typeof e=="string"?ks(e)?Gs:$e.test(e)?ng:mR:Array.isArray(e)?_C:typeof e=="object"?$e.test(e)?ng:pR:Gs}function _C(e,t){let r=[...e],a=r.length,o=e.map((n,s)=>zd(n)(n,t[s]));return n=>{for(let s=0;s<a;s++)r[s]=o[s](n);return r}}function pR(e,t){let r={...e,...t},a={};for(let o in r)e[o]!==void 0&&t[o]!==void 0&&(a[o]=zd(e[o])(e[o],t[o]));return o=>{for(let n in a)r[n]=a[n](o);return r}}function hR(e,t){var r;let a=[],o={color:0,var:0,number:0};for(let n=0;n<t.values.length;n++){let s=t.types[n],i=e.indexes[s][o[s]],l=(r=e.values[i])!==null&&r!==void 0?r:0;a[n]=l,o[s]++}return a}var mR=(e,t)=>{let r=_t.createTransformer(t),a=Yo(e),o=Yo(t);return a.indexes.var.length===o.indexes.var.length&&a.indexes.color.length===o.indexes.color.length&&a.indexes.number.length>=o.indexes.number.length?Hd.has(e)&&!o.values.length||Hd.has(t)&&!a.values.length?TC(e,t):zr(_C(hR(a,o),o.values),r):(ga(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Gs(e,t))};function $d(e,t,r){return typeof e=="number"&&typeof t=="number"&&typeof r=="number"?le(e,t,r):zd(e)(e,t)}var gR=5;function Wd(e,t,r){let a=Math.max(t-gR,0);return Td(r-e(a),t-a)}var Pe={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};var sg=.001;function AC({duration:e=Pe.duration,bounce:t=Pe.bounce,velocity:r=Pe.velocity,mass:a=Pe.mass}){let o,n;ga(e<=je(Pe.maxDuration),"Spring duration must be 10 seconds or less");let s=1-t;s=ut(Pe.minDamping,Pe.maxDamping,s),e=ut(Pe.minDuration,Pe.maxDuration,lt(e)),s<1?(o=u=>{let c=u*s,d=c*e,f=c-r,p=Gd(u,s),v=Math.exp(-d);return sg-f/p*v},n=u=>{let d=u*s*e,f=d*r+r,p=Math.pow(s,2)*Math.pow(u,2)*e,v=Math.exp(-d),x=Gd(Math.pow(u,2),s);return(-o(u)+sg>0?-1:1)*((f-p)*v)/x}):(o=u=>{let c=Math.exp(-u*e),d=(u-r)*e+1;return-sg+c*d},n=u=>{let c=Math.exp(-u*e),d=(r-u)*(e*e);return c*d});let i=5/e,l=vR(o,n,i);if(e=je(e),isNaN(l))return{stiffness:Pe.stiffness,damping:Pe.damping,duration:e};{let u=Math.pow(l,2)*a;return{stiffness:u,damping:s*2*Math.sqrt(a*u),duration:e}}}var yR=12;function vR(e,t,r){let a=r;for(let o=1;o<yR;o++)a=a-e(a)/t(a);return a}function Gd(e,t){return e*Math.sqrt(1-t*t)}var xR=["duration","bounce"],wR=["stiffness","damping","mass"];function RC(e,t){return t.some(r=>e[r]!==void 0)}function SR(e){let t={velocity:Pe.velocity,stiffness:Pe.stiffness,damping:Pe.damping,mass:Pe.mass,isResolvedFromDuration:!1,...e};if(!RC(e,wR)&&RC(e,xR))if(e.visualDuration){let r=e.visualDuration,a=2*Math.PI/(r*1.2),o=a*a,n=2*ut(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Pe.mass,stiffness:o,damping:n}}else{let r=AC(e);t={...t,...r,mass:Pe.mass},t.isResolvedFromDuration=!0}return t}function Kd(e=Pe.visualDuration,t=Pe.bounce){let r=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:a,restDelta:o}=r,n=r.keyframes[0],s=r.keyframes[r.keyframes.length-1],i={done:!1,value:n},{stiffness:l,damping:u,mass:c,duration:d,velocity:f,isResolvedFromDuration:p}=SR({...r,velocity:-lt(r.velocity||0)}),v=f||0,x=u/(2*Math.sqrt(l*c)),C=s-n,g=lt(Math.sqrt(l/c)),m=Math.abs(C)<5;a||(a=m?Pe.restSpeed.granular:Pe.restSpeed.default),o||(o=m?Pe.restDelta.granular:Pe.restDelta.default);let y;if(x<1){let L=Gd(g,x);y=k=>{let _=Math.exp(-x*g*k);return s-_*((v+x*g*C)/L*Math.sin(L*k)+C*Math.cos(L*k))}}else if(x===1)y=L=>s-Math.exp(-g*L)*(C+(v+g*C)*L);else{let L=g*Math.sqrt(x*x-1);y=k=>{let _=Math.exp(-x*g*k),T=Math.min(L*k,300);return s-_*((v+x*g*C)*Math.sinh(T)+L*C*Math.cosh(T))/L}}let b={calculatedDuration:p&&d||null,next:L=>{let k=y(L);if(p)i.done=L>=d;else{let _=0;x<1&&(_=L===0?je(v):Wd(y,L,k));let T=Math.abs(_)<=a,M=Math.abs(s-k)<=o;i.done=T&&M}return i.value=i.done?s:k,i},toString:()=>{let L=Math.min(Ms(b),2e4),k=Ml(_=>b.next(L*_).value,L,30);return L+"ms "+k}};return b}function ig({keyframes:e,velocity:t=0,power:r=.8,timeConstant:a=325,bounceDamping:o=10,bounceStiffness:n=500,modifyTarget:s,min:i,max:l,restDelta:u=.5,restSpeed:c}){let d=e[0],f={done:!1,value:d},p=T=>i!==void 0&&T<i||l!==void 0&&T>l,v=T=>i===void 0?l:l===void 0||Math.abs(i-T)<Math.abs(l-T)?i:l,x=r*t,C=d+x,g=s===void 0?C:s(C);g!==C&&(x=g-d);let m=T=>-x*Math.exp(-T/a),y=T=>g+m(T),b=T=>{let M=m(T),B=y(T);f.done=Math.abs(M)<=u,f.value=f.done?g:B},L,k,_=T=>{p(f.value)&&(L=T,k=Kd({keyframes:[f.value,v(f.value)],velocity:Wd(y,T,f.value),damping:o,stiffness:n,restDelta:u,restSpeed:c}))};return _(0),{calculatedDuration:null,next:T=>{let M=!1;return!k&&L===void 0&&(M=!0,b(T),_(T)),L!==void 0&&T>=L?k.next(T-L):(!M&&b(T),f)}}}var EC=po(.42,0,1,1),DC=po(0,0,.58,1),Xd=po(.42,0,.58,1);var NC=e=>Array.isArray(e)&&typeof e[0]!="number";var MC={linear:ve,easeIn:EC,easeInOut:Xd,easeOut:DC,circIn:Md,circInOut:Bd,circOut:Od,backIn:Bl,backInOut:Dd,backOut:Km,anticipate:Nd},lg=e=>{if(Os(e)){Tr(e.length===4,"Cubic bezier arrays must contain four numerical values.");let[t,r,a,o]=e;return po(t,r,a,o)}else if(typeof e=="string")return Tr(MC[e]!==void 0,`Invalid easing type '${e}'`),MC[e];return e};function CR(e,t,r){let a=[],o=r||$d,n=e.length-1;for(let s=0;s<n;s++){let i=o(e[s],e[s+1]);if(t){let l=Array.isArray(t)?t[s]||ve:t;i=zr(l,i)}a.push(i)}return a}function OC(e,t,{clamp:r=!0,ease:a,mixer:o}={}){let n=e.length;if(Tr(n===t.length,"Both input and output ranges must be the same length"),n===1)return()=>t[0];if(n===2&&t[0]===t[1])return()=>t[1];let s=e[0]===e[1];e[0]>e[n-1]&&(e=[...e].reverse(),t=[...t].reverse());let i=CR(t,a,o),l=i.length,u=c=>{if(s&&c<e[0])return t[0];let d=0;if(l>1)for(;d<e.length-2&&!(c<e[d+1]);d++);let f=Qt(e[d],e[d+1],c);return i[d](f)};return r?c=>u(ut(e[0],e[n-1],c)):u}function BC(e,t){let r=e[e.length-1];for(let a=1;a<=t;a++){let o=Qt(0,t,a);e.push(le(r,1,o))}}function FC(e){let t=[0];return BC(t,e.length-1),t}function UC(e,t){return e.map(r=>r*t)}function bR(e,t){return e.map(()=>t||Xd).splice(0,e.length-1)}function Vl({duration:e=300,keyframes:t,times:r,ease:a="easeInOut"}){let o=NC(a)?a.map(lg):lg(a),n={done:!1,value:t[0]},s=UC(r&&r.length===t.length?r:FC(t),e),i=OC(s,t,{ease:Array.isArray(o)?o:bR(t,o)});return{calculatedDuration:e,next:l=>(n.value=i(l),n.done=l>=e,n)}}var VC=e=>{let t=({timestamp:r})=>e(r);return{start:()=>te.update(t,!0),stop:()=>Yt(t),now:()=>qe.isProcessing?qe.timestamp:St.now()}};var LR={decay:ig,inertia:ig,tween:Vl,keyframes:Vl,spring:Kd},IR=e=>e/100,tn=class extends Ws{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();let{onStop:l}=this.options;l&&l()};let{name:r,motionValue:a,element:o,keyframes:n}=this.options,s=o?.KeyframeResolver||go,i=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new s(n,i,r,a,o),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){let{type:r="keyframes",repeat:a=0,repeatDelay:o=0,repeatType:n,velocity:s=0}=this.options,i=uo(r)?r:LR[r]||Vl,l,u;i!==Vl&&typeof t[0]!="number"&&(l=zr(IR,$d(t[0],t[1])),t=[0,100]);let c=i({...this.options,keyframes:t});n==="mirror"&&(u=i({...this.options,keyframes:[...t].reverse(),velocity:-s})),c.calculatedDuration===null&&(c.calculatedDuration=Ms(c));let{calculatedDuration:d}=c,f=d+o,p=f*(a+1)-o;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:d,resolvedDuration:f,totalDuration:p}}onPostResolved(){let{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,r=!1){let{resolved:a}=this;if(!a){let{keyframes:T}=this.options;return{done:!0,value:T[T.length-1]}}let{finalKeyframe:o,generator:n,mirroredGenerator:s,mapPercentToKeyframes:i,keyframes:l,calculatedDuration:u,totalDuration:c,resolvedDuration:d}=a;if(this.startTime===null)return n.next(0);let{delay:f,repeat:p,repeatType:v,repeatDelay:x,onUpdate:C}=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)),r?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;let g=this.currentTime-f*(this.speed>=0?1:-1),m=this.speed>=0?g<0:g>c;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let y=this.currentTime,b=n;if(p){let T=Math.min(this.currentTime,c)/d,M=Math.floor(T),B=T%1;!B&&T>=1&&(B=1),B===1&&M--,M=Math.min(M,p+1),M%2&&(v==="reverse"?(B=1-B,x&&(B-=x/d)):v==="mirror"&&(b=s)),y=ut(0,1,B)*d}let L=m?{done:!1,value:l[0]}:b.next(y);i&&(L.value=i(L.value));let{done:k}=L;!m&&u!==null&&(k=this.speed>=0?this.currentTime>=c:this.currentTime<=0);let _=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return _&&o!==void 0&&(L.value=yo(l,this.options,o)),C&&C(L.value),_&&this.finish(),L}get duration(){let{resolved:t}=this;return t?lt(t.calculatedDuration):0}get time(){return lt(this.currentTime)}set time(t){t=je(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){let r=this.playbackSpeed!==t;this.playbackSpeed=t,r&&(this.time=lt(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;let{driver:t=VC,onPlay:r,startTime:a}=this.options;this.driver||(this.driver=t(n=>this.tick(n))),r&&r();let o=this.driver.now();this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=o):this.startTime=a??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";let{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)}};var jC=new Set(["opacity","clipPath","filter","transform"]);function qC(e,t,r,{delay:a=0,duration:o=300,repeat:n=0,repeatType:s="loop",ease:i="easeInOut",times:l}={}){let u={[t]:r};l&&(u.offset=l);let c=Fs(i,o);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:a,duration:o,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:n+1,direction:s==="reverse"?"alternate":"normal"})}var HC=Ko(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));var Jd=10,kR=2e4;function PR(e){return uo(e.type)||e.type==="spring"||!bd(e.ease)}function TR(e,t){let r=new tn({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0}),a={done:!1,value:e[0]},o=[],n=0;for(;!a.done&&n<kR;)a=r.sample(n),o.push(a.value),n+=Jd;return{times:void 0,keyframes:o,duration:n-Jd,ease:"linear"}}var zC={anticipate:Nd,backInOut:Dd,circInOut:Bd};function _R(e){return e in zC}var jl=class extends Ws{constructor(t){super(t);let{name:r,motionValue:a,element:o,keyframes:n}=this.options;this.resolver=new $s(n,(s,i)=>this.onKeyframesResolved(s,i),r,a,o),this.resolver.scheduleResolve()}initPlayback(t,r){let{duration:a=300,times:o,ease:n,type:s,motionValue:i,name:l,startTime:u}=this.options;if(!i.owner||!i.owner.current)return!1;if(typeof n=="string"&&co()&&_R(n)&&(n=zC[n]),PR(this.options)){let{onComplete:d,onUpdate:f,motionValue:p,element:v,...x}=this.options,C=TR(t,x);t=C.keyframes,t.length===1&&(t[1]=t[0]),a=C.duration,o=C.times,n=C.ease,s="keyframes"}let c=qC(i.owner.current,l,t,{...this.options,duration:a,times:o,ease:n});return c.startTime=u??this.calcStartTime(),this.pendingTimeline?(Nl(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{let{onComplete:d}=this.options;i.set(yo(t,this.options,r)),d&&d(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:a,times:o,type:s,ease:n,keyframes:t}}get duration(){let{resolved:t}=this;if(!t)return 0;let{duration:r}=t;return lt(r)}get time(){let{resolved:t}=this;if(!t)return 0;let{animation:r}=t;return lt(r.currentTime||0)}set time(t){let{resolved:r}=this;if(!r)return;let{animation:a}=r;a.currentTime=je(t)}get speed(){let{resolved:t}=this;if(!t)return 1;let{animation:r}=t;return r.playbackRate}set speed(t){let{resolved:r}=this;if(!r)return;let{animation:a}=r;a.playbackRate=t}get state(){let{resolved:t}=this;if(!t)return"idle";let{animation:r}=t;return r.playState}get startTime(){let{resolved:t}=this;if(!t)return null;let{animation:r}=t;return r.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{let{resolved:r}=this;if(!r)return ve;let{animation:a}=r;Nl(a,t)}return ve}play(){if(this.isStopped)return;let{resolved:t}=this;if(!t)return;let{animation:r}=t;r.playState==="finished"&&this.updateFinishedPromise(),r.play()}pause(){let{resolved:t}=this;if(!t)return;let{animation:r}=t;r.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();let{resolved:t}=this;if(!t)return;let{animation:r,keyframes:a,duration:o,type:n,ease:s,times:i}=t;if(r.playState==="idle"||r.playState==="finished")return;if(this.time){let{motionValue:u,onUpdate:c,onComplete:d,element:f,...p}=this.options,v=new tn({...p,keyframes:a,duration:o,type:n,ease:s,times:i,isGenerator:!0}),x=je(this.time);u.setWithVelocity(v.sample(x-Jd).value,v.sample(x).value,Jd)}let{onStop:l}=this.options;l&&l(),this.cancel()}complete(){let{resolved:t}=this;t&&t.animation.finish()}cancel(){let{resolved:t}=this;t&&t.animation.cancel()}static supports(t){let{motionValue:r,name:a,repeatDelay:o,repeatType:n,damping:s,type:i}=t;if(!r||!r.owner||!(r.owner.current instanceof HTMLElement))return!1;let{onUpdate:l,transformTemplate:u}=r.owner.getProps();return HC()&&a&&jC.has(a)&&!l&&!u&&!o&&n!=="mirror"&&s!==0&&i!=="inertia"}};var AR={type:"spring",stiffness:500,damping:25,restSpeed:10},RR=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),ER={type:"keyframes",duration:.8},DR={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},$C=(e,{keyframes:t})=>t.length>2?ER:Vt.has(e)?e.startsWith("scale")?RR(t[1]):AR:DR;function WC({when:e,delay:t,delayChildren:r,staggerChildren:a,staggerDirection:o,repeat:n,repeatType:s,repeatDelay:i,from:l,elapsed:u,...c}){return!!Object.keys(c).length}var Ks=(e,t,r,a={},o,n)=>s=>{let i=lo(a,e)||{},l=i.delay||a.delay||0,{elapsed:u=0}=a;u=u-je(l);let c={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...i,delay:-u,onUpdate:f=>{t.set(f),i.onUpdate&&i.onUpdate(f)},onComplete:()=>{s(),i.onComplete&&i.onComplete()},name:e,motionValue:t,element:n?void 0:o};WC(i)||(c={...c,...$C(e,c)}),c.duration&&(c.duration=je(c.duration)),c.repeatDelay&&(c.repeatDelay=je(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)),(Ad.current||xs.skipAnimations)&&(d=!0,c.duration=0,c.delay=0),d&&!n&&t.get()!==void 0){let f=yo(c.keyframes,i);if(f!==void 0)return te.update(()=>{c.onUpdate(f),c.onComplete()}),new Dl([])}return!n&&jl.supports(c)?new jl(c):new tn(c)};function NR({protectedKeys:e,needsAnimating:t},r){let a=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,a}function Qd(e,t,{delay:r=0,transitionOverride:a,type:o}={}){var n;let{transition:s=e.getDefaultTransition(),transitionEnd:i,...l}=t;a&&(s=a);let u=[],c=o&&e.animationState&&e.animationState.getState()[o];for(let d in l){let f=e.getValue(d,(n=e.latestValues[d])!==null&&n!==void 0?n:null),p=l[d];if(p===void 0||c&&NR(c,d))continue;let v={delay:r,...lo(s||{},d)},x=!1;if(window.MotionHandoffAnimation){let g=_d(e);if(g){let m=window.MotionHandoffAnimation(g,d,te);m!==null&&(v.startTime=m,x=!0)}}Ol(e,d),f.start(Ks(d,f,p,e.shouldReduceMotion&&kd.has(d)?{type:!1}:v,e,x));let C=f.animation;C&&u.push(C)}return i&&Promise.all(u).then(()=>{te.update(()=>{i&&nC(e,i)})}),u}function Yd(e,t,r={}){var a;let o=io(e,t,r.type==="exit"?(a=e.presenceContext)===null||a===void 0?void 0:a.custom:void 0),{transition:n=e.getDefaultTransition()||{}}=o||{};r.transitionOverride&&(n=r.transitionOverride);let s=o?()=>Promise.all(Qd(e,o,r)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(u=0)=>{let{delayChildren:c=0,staggerChildren:d,staggerDirection:f}=n;return MR(e,t,c+u,d,f,r)}:()=>Promise.resolve(),{when:l}=n;if(l){let[u,c]=l==="beforeChildren"?[s,i]:[i,s];return u().then(()=>c())}else return Promise.all([s(),i(r.delay)])}function MR(e,t,r=0,a=0,o=1,n){let s=[],i=(e.variantChildren.size-1)*a,l=o===1?(u=0)=>u*a:(u=0)=>i-u*a;return Array.from(e.variantChildren).sort(OR).forEach((u,c)=>{u.notify("AnimationStart",t),s.push(Yd(u,t,{...n,delay:r+l(c)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(s)}function OR(e,t){return e.sortNodePosition(t)}function GC(e,t,r={}){e.notify("AnimationStart",t);let a;if(Array.isArray(t)){let o=t.map(n=>Yd(e,n,r));a=Promise.all(o)}else if(typeof t=="string")a=Yd(e,t,r);else{let o=typeof t=="function"?io(e,t,r.custom):t;a=Promise.all(Qd(e,o,r))}return a.then(()=>{e.notify("AnimationComplete",t)})}var BR=Tl.length;function ug(e){if(!e)return;if(!e.isControllingVariants){let r=e.parent?ug(e.parent)||{}:{};return e.props.initial!==void 0&&(r.initial=e.props.initial),r}let t={};for(let r=0;r<BR;r++){let a=Tl[r],o=e.props[a];(va(o)||o===!1)&&(t[a]=o)}return t}var FR=[...id].reverse(),UR=id.length;function VR(e){return t=>Promise.all(t.map(({animation:r,options:a})=>GC(e,r,a)))}function XC(e){let t=VR(e),r=KC(),a=!0,o=l=>(u,c)=>{var d;let f=io(e,c,l==="exit"?(d=e.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(f){let{transition:p,transitionEnd:v,...x}=f;u={...u,...x,...v}}return u};function n(l){t=l(e)}function s(l){let{props:u}=e,c=ug(e.parent)||{},d=[],f=new Set,p={},v=1/0;for(let C=0;C<UR;C++){let g=FR[C],m=r[g],y=u[g]!==void 0?u[g]:c[g],b=va(y),L=g===l?m.isActive:null;L===!1&&(v=C);let k=y===c[g]&&y!==u[g]&&b;if(k&&a&&e.manuallyAnimateOnMount&&(k=!1),m.protectedKeys={...p},!m.isActive&&L===null||!y&&!m.prevProp||so(y)||typeof y=="boolean")continue;let _=jR(m.prevProp,y),T=_||g===l&&m.isActive&&!k&&b||C>v&&b,M=!1,B=Array.isArray(y)?y:[y],W=B.reduce(o(g),{});L===!1&&(W={});let{prevResolvedValues:ce={}}=m,ge={...ce,...W},ft=be=>{T=!0,f.has(be)&&(M=!0,f.delete(be)),m.needsAnimating[be]=!0;let pt=e.getValue(be);pt&&(pt.liveStyle=!1)};for(let be in ge){let pt=W[be],ht=ce[be];if(p.hasOwnProperty(be))continue;let Ta=!1;_l(pt)&&_l(ht)?Ta=!Fm(pt,ht):Ta=pt!==ht,Ta?pt!=null?ft(be):f.add(be):pt!==void 0&&f.has(be)?ft(be):m.protectedKeys[be]=!0}m.prevProp=y,m.prevResolvedValues=W,m.isActive&&(p={...p,...W}),a&&e.blockInitialAnimation&&(T=!1),T&&(!(k&&_)||M)&&d.push(...B.map(be=>({animation:be,options:{type:g}})))}if(f.size){let C={};f.forEach(g=>{let m=e.getBaseTarget(g),y=e.getValue(g);y&&(y.liveStyle=!0),C[g]=m??null}),d.push({animation:C})}let x=!!d.length;return a&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(x=!1),a=!1,x?t(d):Promise.resolve()}function i(l,u){var c;if(r[l].isActive===u)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(l,u)}),r[l].isActive=u;let d=s(l);for(let f in r)r[f].protectedKeys={};return d}return{animateChanges:s,setActive:i,setAnimateFunction:n,getState:()=>r,reset:()=>{r=KC(),a=!0}}}function jR(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Fm(t,e):!1}function rn(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function KC(){return{animate:rn(!0),whileInView:rn(),whileHover:rn(),whileTap:rn(),whileDrag:rn(),whileFocus:rn(),exit:rn()}}var rt=class{constructor(t){this.isMounted=!1,this.node=t}update(){}};var Zd=class extends rt{constructor(t){super(t),t.animationState||(t.animationState=XC(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();so(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:t}=this.node.getProps(),{animate:r}=this.node.prevProps||{};t!==r&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}};var qR=0,ef=class extends rt{constructor(){super(...arguments),this.id=qR++}update(){if(!this.node.presenceContext)return;let{isPresent:t,onExitComplete:r}=this.node.presenceContext,{isPresent:a}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===a)return;let o=this.node.animationState.setActive("exit",!t);r&&!t&&o.then(()=>r(this.id))}mount(){let{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}};var JC={animation:{Feature:Zd},exit:{Feature:ef}};function Ca(e,t,r,a={passive:!0}){return e.addEventListener(t,r,a),()=>e.removeEventListener(t,r)}function ba(e){return{point:{x:e.pageX,y:e.pageY}}}var QC=e=>t=>Jo(t)&&e(t,ba(t));function vo(e,t,r,a){return Ca(e,t,QC(r),a)}var YC=(e,t)=>Math.abs(e-t);function ZC(e,t){let r=YC(e.x,t.x),a=YC(e.y,t.y);return Math.sqrt(r**2+a**2)}var Xs=class{constructor(t,r,{transformPagePoint:a,contextWindow:o,dragSnapToOrigin:n=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let d=dg(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,p=ZC(d.offset,{x:0,y:0})>=3;if(!f&&!p)return;let{point:v}=d,{timestamp:x}=qe;this.history.push({...v,timestamp:x});let{onStart:C,onMove:g}=this.handlers;f||(C&&C(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=cg(f,this.transformPagePoint),te.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();let{onEnd:p,onSessionEnd:v,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let C=dg(d.type==="pointercancel"?this.lastMoveEventInfo:cg(f,this.transformPagePoint),this.history);this.startEvent&&p&&p(d,C),v&&v(d,C)},!Jo(t))return;this.dragSnapToOrigin=n,this.handlers=r,this.transformPagePoint=a,this.contextWindow=o||window;let s=ba(t),i=cg(s,this.transformPagePoint),{point:l}=i,{timestamp:u}=qe;this.history=[{...l,timestamp:u}];let{onSessionStart:c}=r;c&&c(t,dg(i,this.history)),this.removeListeners=zr(vo(this.contextWindow,"pointermove",this.handlePointerMove),vo(this.contextWindow,"pointerup",this.handlePointerUp),vo(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Yt(this.updatePoint)}};function cg(e,t){return t?{point:t(e.point)}:e}function eb(e,t){return{x:e.x-t.x,y:e.y-t.y}}function dg({point:e},t){return{point:e,delta:eb(e,tb(t)),offset:eb(e,HR(t)),velocity:zR(t,.1)}}function HR(e){return e[0]}function tb(e){return e[e.length-1]}function zR(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,a=null,o=tb(e);for(;r>=0&&(a=e[r],!(o.timestamp-a.timestamp>je(t)));)r--;if(!a)return{x:0,y:0};let n=lt(o.timestamp-a.timestamp);if(n===0)return{x:0,y:0};let s={x:(o.x-a.x)/n,y:(o.y-a.y)/n};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}var nb=1e-4,$R=1-nb,WR=1+nb,sb=.01,GR=0-sb,KR=0+sb;function ct(e){return e.max-e.min}function ib(e,t,r){return Math.abs(e-t)<=r}function rb(e,t,r,a=.5){e.origin=a,e.originPoint=le(t.min,t.max,e.origin),e.scale=ct(r)/ct(t),e.translate=le(r.min,r.max,e.origin)-e.originPoint,(e.scale>=$R&&e.scale<=WR||isNaN(e.scale))&&(e.scale=1),(e.translate>=GR&&e.translate<=KR||isNaN(e.translate))&&(e.translate=0)}function Js(e,t,r,a){rb(e.x,t.x,r.x,a?a.originX:void 0),rb(e.y,t.y,r.y,a?a.originY:void 0)}function ab(e,t,r){e.min=r.min+t.min,e.max=e.min+ct(t)}function lb(e,t,r){ab(e.x,t.x,r.x),ab(e.y,t.y,r.y)}function ob(e,t,r){e.min=t.min-r.min,e.max=e.min+ct(t)}function Qs(e,t,r){ob(e.x,t.x,r.x),ob(e.y,t.y,r.y)}function pb(e,{min:t,max:r},a){return t!==void 0&&e<t?e=a?le(t,e,a.min):Math.max(e,t):r!==void 0&&e>r&&(e=a?le(r,e,a.max):Math.min(e,r)),e}function ub(e,t,r){return{min:t!==void 0?e.min+t:void 0,max:r!==void 0?e.max+r-(e.max-e.min):void 0}}function hb(e,{top:t,left:r,bottom:a,right:o}){return{x:ub(e.x,r,o),y:ub(e.y,t,a)}}function cb(e,t){let r=t.min-e.min,a=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,a]=[a,r]),{min:r,max:a}}function mb(e,t){return{x:cb(e.x,t.x),y:cb(e.y,t.y)}}function gb(e,t){let r=.5,a=ct(e),o=ct(t);return o>a?r=Qt(t.min,t.max-a,e.min):a>o&&(r=Qt(e.min,e.max-o,t.min)),ut(0,1,r)}function yb(e,t){let r={};return t.min!==void 0&&(r.min=t.min-e.min),t.max!==void 0&&(r.max=t.max-e.min),r}var tf=.35;function vb(e=tf){return e===!1?e=0:e===!0&&(e=tf),{x:db(e,"left","right"),y:db(e,"top","bottom")}}function db(e,t,r){return{min:fb(e,t),max:fb(e,r)}}function fb(e,t){return typeof e=="number"?e:e[t]||0}var xb=()=>({translate:0,scale:1,origin:0,originPoint:0}),an=()=>({x:xb(),y:xb()}),wb=()=>({min:0,max:0}),Te=()=>({x:wb(),y:wb()});function jt(e){return[e("x"),e("y")]}function rf({top:e,left:t,right:r,bottom:a}){return{x:{min:t,max:r},y:{min:e,max:a}}}function Sb({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Cb(e,t){if(!t)return e;let r=t({x:e.left,y:e.top}),a=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:a.y,right:a.x}}function fg(e){return e===void 0||e===1}function af({scale:e,scaleX:t,scaleY:r}){return!fg(e)||!fg(t)||!fg(r)}function La(e){return af(e)||pg(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function pg(e){return bb(e.x)||bb(e.y)}function bb(e){return e&&e!=="0%"}function ql(e,t,r){let a=e-r,o=t*a;return r+o}function Lb(e,t,r,a,o){return o!==void 0&&(e=ql(e,o,a)),ql(e,r,a)+t}function hg(e,t=0,r=1,a,o){e.min=Lb(e.min,t,r,a,o),e.max=Lb(e.max,t,r,a,o)}function mg(e,{x:t,y:r}){hg(e.x,t.translate,t.scale,t.originPoint),hg(e.y,r.translate,r.scale,r.originPoint)}var Ib=.999999999999,kb=1.0000000000001;function Tb(e,t,r,a=!1){let o=r.length;if(!o)return;t.x=t.y=1;let n,s;for(let i=0;i<o;i++){n=r[i],s=n.projectionDelta;let{visualElement:l}=n.options;l&&l.props.style&&l.props.style.display==="contents"||(a&&n.options.layoutScroll&&n.scroll&&n!==n.root&&on(e,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,mg(e,s)),a&&La(n.latestValues)&&on(e,n.latestValues))}t.x<kb&&t.x>Ib&&(t.x=1),t.y<kb&&t.y>Ib&&(t.y=1)}function xo(e,t){e.min=e.min+t,e.max=e.max+t}function Pb(e,t,r,a,o=.5){let n=le(e.min,e.max,o);hg(e,t,r,n,a)}function on(e,t){Pb(e.x,t.x,t.scaleX,t.scale,t.originX),Pb(e.y,t.y,t.scaleY,t.scale,t.originY)}function gg(e,t){return rf(Cb(e.getBoundingClientRect(),t))}function _b(e,t,r){let a=gg(e,r),{scroll:o}=t;return o&&(xo(a.x,o.offset.x),xo(a.y,o.offset.y)),a}var of=({current:e})=>e?e.ownerDocument.defaultView:null;var XR=new WeakMap,sf=class{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Te(),this.visualElement=t}start(t,{snapToCursor:r=!1}={}){let{presenceContext:a}=this.visualElement;if(a&&a.isPresent===!1)return;let o=c=>{let{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),r&&this.snapToCursor(ba(c).point)},n=(c,d)=>{let{drag:f,dragPropagation:p,onDragStart:v}=this.getProps();if(f&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Wm(f),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),jt(C=>{let g=this.getAxisMotionValue(C).get()||0;if(Tt.test(g)){let{projection:m}=this.visualElement;if(m&&m.layout){let y=m.layout.layoutBox[C];y&&(g=ct(y)*(parseFloat(g)/100))}}this.originPoint[C]=g}),v&&te.postRender(()=>v(c,d)),Ol(this.visualElement,"transform");let{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},s=(c,d)=>{let{dragPropagation:f,dragDirectionLock:p,onDirectionLock:v,onDrag:x}=this.getProps();if(!f&&!this.openDragLock)return;let{offset:C}=d;if(p&&this.currentDirection===null){this.currentDirection=JR(C),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",d.point,C),this.updateAxis("y",d.point,C),this.visualElement.render(),x&&x(c,d)},i=(c,d)=>this.stop(c,d),l=()=>jt(c=>{var d;return this.getAnimationState(c)==="paused"&&((d=this.getAxisMotionValue(c).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Xs(t,{onSessionStart:o,onStart:n,onMove:s,onSessionEnd:i,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:of(this.visualElement)})}stop(t,r){let a=this.isDragging;if(this.cancel(),!a)return;let{velocity:o}=r;this.startAnimation(o);let{onDragEnd:n}=this.getProps();n&&te.postRender(()=>n(t,r))}cancel(){this.isDragging=!1;let{projection:t,animationState:r}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:a}=this.getProps();!a&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",!1)}updateAxis(t,r,a){let{drag:o}=this.getProps();if(!a||!nf(t,o,this.currentDirection))return;let n=this.getAxisMotionValue(t),s=this.originPoint[t]+a[t];this.constraints&&this.constraints[t]&&(s=pb(s,this.constraints[t],this.elastic[t])),n.set(s)}resolveConstraints(){var t;let{dragConstraints:r,dragElastic:a}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,n=this.constraints;r&&xa(r)?this.constraints||(this.constraints=this.resolveRefConstraints()):r&&o?this.constraints=hb(o.layoutBox,r):this.constraints=!1,this.elastic=vb(a),n!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&jt(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=yb(o.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){let{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!xa(t))return!1;let a=t.current;Tr(a!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");let{projection:o}=this.visualElement;if(!o||!o.layout)return!1;let n=_b(a,o.root,this.visualElement.getTransformPagePoint()),s=mb(o.layout.layoutBox,n);if(r){let i=r(Sb(s));this.hasMutatedConstraints=!!i,i&&(s=rf(i))}return s}startAnimation(t){let{drag:r,dragMomentum:a,dragElastic:o,dragTransition:n,dragSnapToOrigin:s,onDragTransitionEnd:i}=this.getProps(),l=this.constraints||{},u=jt(c=>{if(!nf(c,r,this.currentDirection))return;let d=l&&l[c]||{};s&&(d={min:0,max:0});let f=o?200:1e6,p=o?40:1e7,v={type:"inertia",velocity:a?t[c]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...n,...d};return this.startAxisValueAnimation(c,v)});return Promise.all(u).then(i)}startAxisValueAnimation(t,r){let a=this.getAxisMotionValue(t);return Ol(this.visualElement,t),a.start(Ks(t,a,0,r,this.visualElement,!1))}stopAnimation(){jt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){jt(t=>{var r;return(r=this.getAxisMotionValue(t).animation)===null||r===void 0?void 0:r.pause()})}getAnimationState(t){var r;return(r=this.getAxisMotionValue(t).animation)===null||r===void 0?void 0:r.state}getAxisMotionValue(t){let r=`_drag${t.toUpperCase()}`,a=this.visualElement.getProps(),o=a[r];return o||this.visualElement.getValue(t,(a.initial?a.initial[t]:void 0)||0)}snapToCursor(t){jt(r=>{let{drag:a}=this.getProps();if(!nf(r,a,this.currentDirection))return;let{projection:o}=this.visualElement,n=this.getAxisMotionValue(r);if(o&&o.layout){let{min:s,max:i}=o.layout.layoutBox[r];n.set(t[r]-le(s,i,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:t,dragConstraints:r}=this.getProps(),{projection:a}=this.visualElement;if(!xa(r)||!a||!this.constraints)return;this.stopAnimation();let o={x:0,y:0};jt(s=>{let i=this.getAxisMotionValue(s);if(i&&this.constraints!==!1){let l=i.get();o[s]=gb({min:l,max:l},this.constraints[s])}});let{transformTemplate:n}=this.visualElement.getProps();this.visualElement.current.style.transform=n?n({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.resolveConstraints(),jt(s=>{if(!nf(s,t,null))return;let i=this.getAxisMotionValue(s),{min:l,max:u}=this.constraints[s];i.set(le(l,u,o[s]))})}addListeners(){if(!this.visualElement.current)return;XR.set(this.visualElement,this);let t=this.visualElement.current,r=vo(t,"pointerdown",l=>{let{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),a=()=>{let{dragConstraints:l}=this.getProps();xa(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,n=o.addEventListener("measure",a);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),te.read(a);let s=Ca(window,"resize",()=>this.scalePositionWithinConstraints()),i=o.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(jt(c=>{let d=this.getAxisMotionValue(c);d&&(this.originPoint[c]+=l[c].translate,d.set(d.get()+l[c].translate))}),this.visualElement.render())}));return()=>{s(),r(),n(),i&&i()}}getProps(){let t=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:a=!1,dragPropagation:o=!1,dragConstraints:n=!1,dragElastic:s=tf,dragMomentum:i=!0}=t;return{...t,drag:r,dragDirectionLock:a,dragPropagation:o,dragConstraints:n,dragElastic:s,dragMomentum:i}}};function nf(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function JR(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}var lf=class extends rt{constructor(t){super(t),this.removeGroupControls=ve,this.removeListeners=ve,this.controls=new sf(t)}mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ve}unmount(){this.removeGroupControls(),this.removeListeners()}};var Ab=e=>(t,r)=>{e&&te.postRender(()=>e(t,r))},uf=class extends rt{constructor(){super(...arguments),this.removePointerDownListener=ve}onPointerDown(t){this.session=new Xs(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:of(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:r,onPan:a,onPanEnd:o}=this.node.getProps();return{onSessionStart:Ab(t),onStart:Ab(r),onMove:a,onEnd:(n,s)=>{delete this.session,o&&te.postRender(()=>o(n,s))}}}mount(){this.removePointerDownListener=vo(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};var Db=D(de(),1),Hl=D(Y(),1);var Ys={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Rb(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Zs={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(H.test(e))e=parseFloat(e);else return e;let r=Rb(e,t.target.x),a=Rb(e,t.target.y);return`${r}% ${a}%`}};var Eb={correct:(e,{treeScale:t,projectionDelta:r})=>{let a=e,o=_t.parse(e);if(o.length>5)return a;let n=_t.createTransformer(e),s=typeof o[0]!="number"?1:0,i=r.x.scale*t.x,l=r.y.scale*t.y;o[0+s]/=i,o[1+s]/=l;let u=le(i,l,.5);return typeof o[2+s]=="number"&&(o[2+s]/=u),typeof o[3+s]=="number"&&(o[3+s]/=u),n(o)}};var yg=class extends Hl.Component{componentDidMount(){let{visualElement:t,layoutGroup:r,switchLayoutGroup:a,layoutId:o}=this.props,{projection:n}=t;VS(QR),n&&(r.group&&r.group.add(n),a&&a.register&&o&&a.register(n),n.root.didUpdate(),n.addEventListener("animationComplete",()=>{this.safeToRemove()}),n.setOptions({...n.options,onExitComplete:()=>this.safeToRemove()})),Ys.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){let{layoutDependency:r,visualElement:a,drag:o,isPresent:n}=this.props,s=a.projection;return s&&(s.isPresent=n,o||t.layoutDependency!==r||r===void 0?s.willUpdate():this.safeToRemove(),t.isPresent!==n&&(n?s.promote():s.relegate()||te.postRender(()=>{let i=s.getStack();(!i||!i.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Ss.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:t,layoutGroup:r,switchLayoutGroup:a}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(o),a&&a.deregister&&a.deregister(o))}safeToRemove(){let{safeToRemove:t}=this.props;t&&t()}render(){return null}};function cf(e){let[t,r]=Zc(),a=(0,Hl.useContext)(ms);return(0,Db.jsx)(yg,{...e,layoutGroup:a,switchLayoutGroup:(0,Hl.useContext)(dd),isPresent:t,safeToRemove:r})}var QR={borderRadius:{...Zs,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Zs,borderTopRightRadius:Zs,borderBottomLeftRadius:Zs,borderBottomRightRadius:Zs,boxShadow:Eb};function Nb(e,t,r){let a=Se(e)?e:Sa(e);return a.start(Ks("",a,t,r)),a.animation}function Mb(e){return e instanceof SVGElement&&e.tagName!=="svg"}var Ob=(e,t)=>e.depth-t.depth;var df=class{constructor(){this.children=[],this.isDirty=!1}add(t){Vs(this.children,t),this.isDirty=!0}remove(t){js(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Ob),this.isDirty=!1,this.children.forEach(t)}};function Bb(e,t){let r=St.now(),a=({timestamp:o})=>{let n=o-r;n>=t&&(Yt(a),e(n-t))};return te.read(a,!0),()=>Yt(a)}var jb=["TopLeft","TopRight","BottomLeft","BottomRight"],YR=jb.length,Fb=e=>typeof e=="string"?parseFloat(e):e,Ub=e=>typeof e=="number"||H.test(e);function qb(e,t,r,a,o,n){o?(e.opacity=le(0,r.opacity!==void 0?r.opacity:1,ZR(a)),e.opacityExit=le(t.opacity!==void 0?t.opacity:1,0,e1(a))):n&&(e.opacity=le(t.opacity!==void 0?t.opacity:1,r.opacity!==void 0?r.opacity:1,a));for(let s=0;s<YR;s++){let i=`border${jb[s]}Radius`,l=Vb(t,i),u=Vb(r,i);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||Ub(l)===Ub(u)?(e[i]=Math.max(le(Fb(l),Fb(u),a),0),(Tt.test(u)||Tt.test(l))&&(e[i]+="%")):e[i]=u}(t.rotate||r.rotate)&&(e.rotate=le(t.rotate||0,r.rotate||0,a))}function Vb(e,t){return e[t]!==void 0?e[t]:e.borderRadius}var ZR=Hb(0,.5,Od),e1=Hb(.5,.95,ve);function Hb(e,t,r){return a=>a<e?0:a>t?1:r(Qt(e,t,a))}function zb(e,t){e.min=t.min,e.max=t.max}function er(e,t){zb(e.x,t.x),zb(e.y,t.y)}function vg(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function $b(e,t,r,a,o){return e-=t,e=ql(e,1/r,a),o!==void 0&&(e=ql(e,1/o,a)),e}function t1(e,t=0,r=1,a=.5,o,n=e,s=e){if(Tt.test(t)&&(t=parseFloat(t),t=le(s.min,s.max,t/100)-s.min),typeof t!="number")return;let i=le(n.min,n.max,a);e===n&&(i-=t),e.min=$b(e.min,t,r,i,o),e.max=$b(e.max,t,r,i,o)}function Wb(e,t,[r,a,o],n,s){t1(e,t[r],t[a],t[o],t.scale,n,s)}var r1=["x","scaleX","originX"],a1=["y","scaleY","originY"];function xg(e,t,r,a){Wb(e.x,t,r1,r?r.x:void 0,a?a.x:void 0),Wb(e.y,t,a1,r?r.y:void 0,a?a.y:void 0)}function Gb(e){return e.translate===0&&e.scale===1}function wg(e){return Gb(e.x)&&Gb(e.y)}function Kb(e,t){return e.min===t.min&&e.max===t.max}function Jb(e,t){return Kb(e.x,t.x)&&Kb(e.y,t.y)}function Xb(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Sg(e,t){return Xb(e.x,t.x)&&Xb(e.y,t.y)}function Cg(e){return ct(e.x)/ct(e.y)}function bg(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var ff=class{constructor(){this.members=[]}add(t){Vs(this.members,t),t.scheduleRender()}remove(t){if(js(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){let r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(t){let r=this.members.findIndex(o=>t===o);if(r===0)return!1;let a;for(let o=r;o>=0;o--){let n=this.members[o];if(n.isPresent!==!1){a=n;break}}return a?(this.promote(a),!0):!1}promote(t,r){let a=this.lead;if(t!==a&&(this.prevLead=a,this.lead=t,t.show(),a)){a.instance&&a.scheduleRender(),t.scheduleRender(),t.resumeFrom=a,r&&(t.resumeFrom.preserveOpacity=!0),a.snapshot&&(t.snapshot=a.snapshot,t.snapshot.latestValues=a.animationValues||a.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);let{crossfade:o}=t.options;o===!1&&a.hide()}}exitAnimationComplete(){this.members.forEach(t=>{let{options:r,resumingFrom:a}=t;r.onExitComplete&&r.onExitComplete(),a&&a.options.onExitComplete&&a.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}};function Qb(e,t,r){let a="",o=e.x.translate/t.x,n=e.y.translate/t.y,s=r?.z||0;if((o||n||s)&&(a=`translate3d(${o}px, ${n}px, ${s}px) `),(t.x!==1||t.y!==1)&&(a+=`scale(${1/t.x}, ${1/t.y}) `),r){let{transformPerspective:u,rotate:c,rotateX:d,rotateY:f,skewX:p,skewY:v}=r;u&&(a=`perspective(${u}px) ${a}`),c&&(a+=`rotate(${c}deg) `),d&&(a+=`rotateX(${d}deg) `),f&&(a+=`rotateY(${f}deg) `),p&&(a+=`skewX(${p}deg) `),v&&(a+=`skewY(${v}deg) `)}let i=e.x.scale*t.x,l=e.y.scale*t.y;return(i!==1||l!==1)&&(a+=`scale(${i}, ${l})`),a||"none"}var nn={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},zl=typeof window<"u"&&window.MotionDebug!==void 0,Lg=["","X","Y","Z"],o1={visibility:"hidden"},Yb=1e3,n1=0;function Ig(e,t,r,a){let{latestValues:o}=t;o[e]&&(r[e]=o[e],t.setStaticValue(e,0),a&&(a[e]=0))}function sL(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let r=_d(t);if(window.MotionHasOptimisedAnimation(r,"transform")){let{layout:o,layoutId:n}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",te,!(o||n))}let{parent:a}=e;a&&!a.hasCheckedOptimisedAppear&&sL(a)}function pf({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:a,resetTransform:o}){return class{constructor(s={},i=t?.()){this.id=n1++,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,zl&&(nn.totalNodes=nn.resolvedTargetDeltas=nn.recalculatedProjection=0),this.nodes.forEach(l1),this.nodes.forEach(p1),this.nodes.forEach(h1),this.nodes.forEach(u1),zl&&window.MotionDebug.record(nn)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new df)}addEventListener(s,i){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new fo),this.eventHandlers.get(s).add(i)}notifyListeners(s,...i){let l=this.eventHandlers.get(s);l&&l.notify(...i)}hasListeners(s){return this.eventHandlers.has(s)}mount(s,i=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Mb(s),this.instance=s;let{layoutId:l,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),i&&(u||l)&&(this.isLayoutDirty=!0),e){let d,f=()=>this.root.updateBlockedByResize=!1;e(s,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=Bb(f,250),Ys.hasAnimatedSinceResize&&(Ys.hasAnimatedSinceResize=!1,this.nodes.forEach(eL))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeTargetChanged:p,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let x=this.options.transition||c.getDefaultTransition()||x1,{onLayoutAnimationStart:C,onLayoutAnimationComplete:g}=c.getProps(),m=!this.targetLayout||!Sg(this.targetLayout,v)||p,y=!f&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||y||f&&(m||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,y);let b={...lo(x,"layout"),onPlay:C,onComplete:g};(c.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b)}else f||eL(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Yt(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(m1),this.animationId++)}getTransformTemplate(){let{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&sL(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){let d=this.path[c];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}let{layoutId:i,layout:l}=this.options;if(i===void 0&&!l)return;let u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Zb);return}this.isUpdating||this.nodes.forEach(d1),this.isUpdating=!1,this.nodes.forEach(f1),this.nodes.forEach(s1),this.nodes.forEach(i1),this.clearAllSnapshots();let i=St.now();qe.delta=ut(0,1e3/60,i-qe.timestamp),qe.timestamp=i,qe.isProcessing=!0,nd.update.process(qe),nd.preRender.process(qe),nd.render.process(qe),qe.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ss.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(c1),this.sharedNodes.forEach(g1)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,te.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){te.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 l=0;l<this.path.length;l++)this.path[l].updateScroll();let s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Te(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:i}=this.options;i&&i.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let i=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(i=!1),i){let l=a(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!o)return;let s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,i=this.projectionDelta&&!wg(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;s&&(i||La(this.latestValues)||c)&&(o(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){let i=this.measurePageBox(),l=this.removeElementScroll(i);return s&&(l=this.removeTransform(l)),w1(l),{animationId:this.root.animationId,measuredBox:i,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var s;let{visualElement:i}=this.options;if(!i)return Te();let l=i.measureViewportBox();if(!(((s=this.scroll)===null||s===void 0?void 0:s.wasRoot)||this.path.some(S1))){let{scroll:c}=this.root;c&&(xo(l.x,c.offset.x),xo(l.y,c.offset.y))}return l}removeElementScroll(s){var i;let l=Te();if(er(l,s),!((i=this.scroll)===null||i===void 0)&&i.wasRoot)return l;for(let u=0;u<this.path.length;u++){let c=this.path[u],{scroll:d,options:f}=c;c!==this.root&&d&&f.layoutScroll&&(d.wasRoot&&er(l,s),xo(l.x,d.offset.x),xo(l.y,d.offset.y))}return l}applyTransform(s,i=!1){let l=Te();er(l,s);for(let u=0;u<this.path.length;u++){let c=this.path[u];!i&&c.options.layoutScroll&&c.scroll&&c!==c.root&&on(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),La(c.latestValues)&&on(l,c.latestValues)}return La(this.latestValues)&&on(l,this.latestValues),l}removeTransform(s){let i=Te();er(i,s);for(let l=0;l<this.path.length;l++){let u=this.path[l];if(!u.instance||!La(u.latestValues))continue;af(u.latestValues)&&u.updateSnapshot();let c=Te(),d=u.measurePageBox();er(c,d),xg(i,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return La(this.latestValues)&&xg(i,this.latestValues),i}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.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!==qe.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var i;let l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);let u=!!this.resumingFrom||this!==l;if(!(s||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((i=this.parent)===null||i===void 0)&&i.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=qe.timestamp,!this.targetDelta&&!this.relativeTarget){let p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Te(),this.relativeTargetOrigin=Te(),Qs(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),er(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Te(),this.targetWithTransforms=Te()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),lb(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):er(this.target,this.layout.layoutBox),mg(this.target,this.targetDelta)):er(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;let p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Te(),this.relativeTargetOrigin=Te(),Qs(this.relativeTargetOrigin,this.target,p.target),er(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}zl&&nn.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||af(this.parent.latestValues)||pg(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 s;let i=this.getLead(),l=!!this.resumingFrom||this!==i,u=!0;if((this.isProjectionDirty||!((s=this.parent)===null||s===void 0)&&s.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===qe.timestamp&&(u=!1),u)return;let{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;er(this.layoutCorrected,this.layout.layoutBox);let f=this.treeScale.x,p=this.treeScale.y;Tb(this.layoutCorrected,this.treeScale,this.path,l),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=Te());let{target:v}=i;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(vg(this.prevProjectionDelta.x,this.projectionDelta.x),vg(this.prevProjectionDelta.y,this.projectionDelta.y)),Js(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==p||!bg(this.projectionDelta.x,this.prevProjectionDelta.x)||!bg(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v)),zl&&nn.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){var i;if((i=this.options.visualElement)===null||i===void 0||i.scheduleRender(),s){let l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=an(),this.projectionDelta=an(),this.projectionDeltaWithTransform=an()}setAnimationOrigin(s,i=!1){let l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},d=an();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!i;let f=Te(),p=l?l.source:void 0,v=this.layout?this.layout.source:void 0,x=p!==v,C=this.getStack(),g=!C||C.members.length<=1,m=!!(x&&!g&&this.options.crossfade===!0&&!this.path.some(v1));this.animationProgress=0;let y;this.mixTargetDelta=b=>{let L=b/1e3;tL(d.x,s.x,L),tL(d.y,s.y,L),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Qs(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),y1(this.relativeTarget,this.relativeTargetOrigin,f,L),y&&Jb(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=Te()),er(y,this.relativeTarget)),x&&(this.animationValues=c,qb(c,u,this.latestValues,L,m,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=L},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Yt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=te.update(()=>{Ys.hasAnimatedSinceResize=!0,this.currentAnimation=Nb(0,Yb,{...s,onUpdate:i=>{this.mixTargetDelta(i),s.onUpdate&&s.onUpdate(i)},onComplete:()=>{s.onComplete&&s.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);let s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Yb),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let s=this.getLead(),{targetWithTransforms:i,target:l,layout:u,latestValues:c}=s;if(!(!i||!l||!u)){if(this!==s&&this.layout&&u&&iL(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Te();let d=ct(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+d;let f=ct(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+f}er(i,l),on(i,c),Js(this.projectionDeltaWithTransform,this.layoutCorrected,i,c)}}registerSharedNode(s,i){this.sharedNodes.has(s)||this.sharedNodes.set(s,new ff),this.sharedNodes.get(s).add(i);let u=i.options.initialPromotionConfig;i.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(i):void 0})}isLead(){let s=this.getStack();return s?s.lead===this:!0}getLead(){var s;let{layoutId:i}=this.options;return i?((s=this.getStack())===null||s===void 0?void 0:s.lead)||this:this}getPrevLead(){var s;let{layoutId:i}=this.options;return i?(s=this.getStack())===null||s===void 0?void 0:s.prevLead:void 0}getStack(){let{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:i,preserveFollowOpacity:l}={}){let u=this.getStack();u&&u.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),i&&this.setOptions({transition:i})}relegate(){let s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){let{visualElement:s}=this.options;if(!s)return;let i=!1,{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(i=!0),!i)return;let u={};l.z&&Ig("z",s,u,this.animationValues);for(let c=0;c<Lg.length;c++)Ig(`rotate${Lg[c]}`,s,u,this.animationValues),Ig(`skew${Lg[c]}`,s,u,this.animationValues);s.render();for(let c in u)s.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);s.scheduleRender()}getProjectionStyles(s){var i,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return o1;let u={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=Is(s?.pointerEvents)||"",u.transform=c?c(this.latestValues,""):"none",u;let d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){let x={};return this.options.layoutId&&(x.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,x.pointerEvents=Is(s?.pointerEvents)||""),this.hasProjected&&!La(this.latestValues)&&(x.transform=c?c({},""):"none",this.hasProjected=!1),x}let f=d.animationValues||d.latestValues;this.applyTransformsToTarget(),u.transform=Qb(this.projectionDeltaWithTransform,this.treeScale,f),c&&(u.transform=c(f,u.transform));let{x:p,y:v}=this.projectionDelta;u.transformOrigin=`${p.origin*100}% ${v.origin*100}% 0`,d.animationValues?u.opacity=d===this?(l=(i=f.opacity)!==null&&i!==void 0?i:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:u.opacity=d===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(let x in Es){if(f[x]===void 0)continue;let{correct:C,applyTo:g}=Es[x],m=u.transform==="none"?f[x]:C(f[x],d);if(g){let y=g.length;for(let b=0;b<y;b++)u[g[b]]=m}else u[x]=m}return this.options.layoutId&&(u.pointerEvents=d===this?Is(s?.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var i;return(i=s.currentAnimation)===null||i===void 0?void 0:i.stop()}),this.root.nodes.forEach(Zb),this.root.sharedNodes.clear()}}}function s1(e){e.updateLayout()}function i1(e){var t;let r=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&r&&e.hasListeners("didUpdate")){let{layoutBox:a,measuredBox:o}=e.layout,{animationType:n}=e.options,s=r.source!==e.layout.source;n==="size"?jt(d=>{let f=s?r.measuredBox[d]:r.layoutBox[d],p=ct(f);f.min=a[d].min,f.max=f.min+p}):iL(n,r.layoutBox,a)&&jt(d=>{let f=s?r.measuredBox[d]:r.layoutBox[d],p=ct(a[d]);f.max=f.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+p)});let i=an();Js(i,a,r.layoutBox);let l=an();s?Js(l,e.applyTransform(o,!0),r.measuredBox):Js(l,a,r.layoutBox);let u=!wg(i),c=!1;if(!e.resumeFrom){let d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){let{snapshot:f,layout:p}=d;if(f&&p){let v=Te();Qs(v,r.layoutBox,f.layoutBox);let x=Te();Qs(x,a,p.layoutBox),Sg(v,x)||(c=!0),d.options.layoutRoot&&(e.relativeTarget=x,e.relativeTargetOrigin=v,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:a,snapshot:r,delta:l,layoutDelta:i,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(e.isLead()){let{onExitComplete:a}=e.options;a&&a()}e.options.transition=void 0}function l1(e){zl&&nn.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 u1(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function c1(e){e.clearSnapshot()}function Zb(e){e.clearMeasurements()}function d1(e){e.isLayoutDirty=!1}function f1(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function eL(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function p1(e){e.resolveTargetDelta()}function h1(e){e.calcProjection()}function m1(e){e.resetSkewAndRotation()}function g1(e){e.removeLeadSnapshot()}function tL(e,t,r){e.translate=le(t.translate,0,r),e.scale=le(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function rL(e,t,r,a){e.min=le(t.min,r.min,a),e.max=le(t.max,r.max,a)}function y1(e,t,r,a){rL(e.x,t.x,r.x,a),rL(e.y,t.y,r.y,a)}function v1(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var x1={duration:.45,ease:[.4,0,.1,1]},aL=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),oL=aL("applewebkit/")&&!aL("chrome/")?Math.round:ve;function nL(e){e.min=oL(e.min),e.max=oL(e.max)}function w1(e){nL(e.x),nL(e.y)}function iL(e,t,r){return e==="position"||e==="preserve-aspect"&&!ib(Cg(t),Cg(r),.2)}function S1(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}var lL=pf({attachResizeListener:(e,t)=>Ca(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0});var kg={current:void 0},hf=pf({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!kg.current){let e=new lL({});e.mount(window),e.setOptions({layoutScroll:!0}),kg.current=e}return kg.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"});var uL={pan:{Feature:uf},drag:{Feature:lf,ProjectionNode:hf,MeasureLayout:cf}};function cL(e,t,r){let{props:a}=e;e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",r==="Start");let o="onHover"+r,n=a[o];n&&te.postRender(()=>n(t,ba(t)))}var mf=class extends rt{mount(){let{current:t}=this.node;t&&(this.unmount=Hm(t,r=>(cL(this.node,r,"Start"),a=>cL(this.node,a,"End"))))}unmount(){}};var gf=class extends rt{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=zr(Ca(this.node.current,"focus",()=>this.onFocus()),Ca(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function dL(e,t,r){let{props:a}=e;e.animationState&&a.whileTap&&e.animationState.setActive("whileTap",r==="Start");let o="onTap"+(r==="End"?"":r),n=a[o];n&&te.postRender(()=>n(t,ba(t)))}var yf=class extends rt{mount(){let{current:t}=this.node;t&&(this.unmount=$m(t,r=>(dL(this.node,r,"Start"),(a,{success:o})=>dL(this.node,a,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}};var Tg=new WeakMap,Pg=new WeakMap,C1=e=>{let t=Tg.get(e.target);t&&t(e)},b1=e=>{e.forEach(C1)};function L1({root:e,...t}){let r=e||document;Pg.has(r)||Pg.set(r,{});let a=Pg.get(r),o=JSON.stringify(t);return a[o]||(a[o]=new IntersectionObserver(b1,{root:e,...t})),a[o]}function fL(e,t,r){let a=L1(t);return Tg.set(e,r),a.observe(e),()=>{Tg.delete(e),a.unobserve(e)}}var I1={some:0,all:1},vf=class extends rt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:t={}}=this.node.getProps(),{root:r,margin:a,amount:o="some",once:n}=t,s={root:r?r.current:void 0,rootMargin:a,threshold:typeof o=="number"?o:I1[o]},i=l=>{let{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,n&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);let{onViewportEnter:c,onViewportLeave:d}=this.node.getProps(),f=u?c:d;f&&f(l)};return fL(this.node.current,s,i)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;let{props:t,prevProps:r}=this.node;["amount","margin","root"].some(k1(t,r))&&this.startObserver()}unmount(){}};function k1({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}var pL={inView:{Feature:vf},tap:{Feature:yf},focus:{Feature:gf},hover:{Feature:mf}};var hL={layout:{ProjectionNode:hf,MeasureLayout:cf}};var xL=D(Y(),1);var $l={current:null},xf={current:!1};function mL(){if(xf.current=!0,!!vs)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>$l.current=e.matches;e.addListener(t),t()}else $l.current=!1}var P1=[...eg,$e,_t],gL=e=>P1.find(qd(e));var _g=new WeakMap;function yL(e,t,r){for(let a in t){let o=t[a],n=r[a];if(Se(o))e.addValue(a,o);else if(Se(n))e.addValue(a,Sa(o,{owner:e}));else if(n!==o)if(e.hasValue(a)){let s=e.getValue(a);s.liveStyle===!0?s.jump(o):s.hasAnimated||s.set(o)}else{let s=e.getStaticValue(a);e.addValue(a,Sa(s!==void 0?s:o,{owner:e}))}}for(let a in r)t[a]===void 0&&e.removeValue(a);return t}var vL=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],wf=class{scrapeMotionValuesFromProps(t,r,a){return{}}constructor({parent:t,props:r,presenceContext:a,reducedMotionConfig:o,blockInitialAnimation:n,visualState:s},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=go,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=()=>{let p=St.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,te.render(this.render,!1,!0))};let{latestValues:l,renderState:u,onUpdate:c}=s;this.onUpdate=c,this.latestValues=l,this.baseTarget={...l},this.initialValues=r.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=r,this.presenceContext=a,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=i,this.blockInitialAnimation=!!n,this.isControllingVariants=Xo(r),this.isVariantNode=ld(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);let{willChange:d,...f}=this.scrapeMotionValuesFromProps(r,{},this);for(let p in f){let v=f[p];l[p]!==void 0&&Se(v)&&v.set(l[p],!1)}}mount(t){this.current=t,_g.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((r,a)=>this.bindToMotionValue(a,r)),xf.current||mL(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:$l.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){_g.delete(this.current),this.projection&&this.projection.unmount(),Yt(this.notifyUpdate),Yt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(let t in this.events)this.events[t].clear();for(let t in this.features){let r=this.features[t];r&&(r.unmount(),r.isMounted=!1)}this.current=null}bindToMotionValue(t,r){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();let a=Vt.has(t),o=r.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&te.preRender(this.notifyUpdate),a&&this.projection&&(this.projection.isTransformDirty=!0)}),n=r.on("renderRequest",this.scheduleRender),s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,r)),this.valueSubscriptions.set(t,()=>{o(),n(),s&&s(),r.owner&&r.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 ya){let r=ya[t];if(!r)continue;let{isEnabled:a,Feature:o}=r;if(!this.features[t]&&o&&a(this.props)&&(this.features[t]=new o(this)),this.features[t]){let n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Te()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,r){this.latestValues[t]=r}update(t,r){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let a=0;a<vL.length;a++){let o=vL[a];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);let n="on"+o,s=t[n];s&&(this.propEventSubscriptions[o]=this.on(o,s))}this.prevMotionValues=yL(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){let r=this.getClosestVariantNode();if(r)return r.variantChildren&&r.variantChildren.add(t),()=>r.variantChildren.delete(t)}addValue(t,r){let a=this.values.get(t);r!==a&&(a&&this.removeValue(t),this.bindToMotionValue(t,r),this.values.set(t,r),this.latestValues[t]=r.get())}removeValue(t){this.values.delete(t);let r=this.valueSubscriptions.get(t);r&&(r(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,r){if(this.props.values&&this.props.values[t])return this.props.values[t];let a=this.values.get(t);return a===void 0&&r!==void 0&&(a=Sa(r===null?void 0:r,{owner:this}),this.addValue(t,a)),a}readValue(t,r){var a;let o=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(a=this.getBaseTargetFromProps(this.props,t))!==null&&a!==void 0?a:this.readValueFromInstance(this.current,t,this.options);return o!=null&&(typeof o=="string"&&(jd(o)||Fd(o))?o=parseFloat(o):!gL(o)&&_t.test(r)&&(o=Vd(t,r)),this.setBaseTarget(t,Se(o)?o.get():o)),Se(o)?o.get():o}setBaseTarget(t,r){this.baseTarget[t]=r}getBaseTarget(t){var r;let{initial:a}=this.props,o;if(typeof a=="string"||typeof a=="object"){let s=Ls(this.props,a,(r=this.presenceContext)===null||r===void 0?void 0:r.custom);s&&(o=s[t])}if(a&&o!==void 0)return o;let n=this.getBaseTargetFromProps(this.props,t);return n!==void 0&&!Se(n)?n:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,r){return this.events[t]||(this.events[t]=new fo),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}};var ei=class extends wf{constructor(){super(...arguments),this.KeyframeResolver=$s}sortInstanceNodePosition(t,r){return t.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(t,r){return t.style?t.style[r]:void 0}removeValueFromRenderState(t,{vars:r,style:a}){delete r[t],delete a[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:t}=this.props;Se(t)&&(this.childSubscription=t.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}};function T1(e){return window.getComputedStyle(e)}var Sf=class extends ei{constructor(){super(...arguments),this.type="html",this.renderInstance=yd}readValueFromInstance(t,r){if(Vt.has(r)){let a=zs(r);return a&&a.default||0}else{let a=T1(t),o=(hd(r)?a.getPropertyValue(r):a[r])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:r}){return gg(t,r)}build(t,r,a){Ts(t,r,a.transformTemplate)}scrapeMotionValuesFromProps(t,r,a){return Ds(t,r,a)}};var Cf=class extends ei{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Te}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(Vt.has(r)){let a=zs(r);return a&&a.default||0}return r=vd.has(r)?r:ws(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,a){return Sd(t,r,a)}build(t,r,a){_s(t,r,this.isSVGTag,a.transformTemplate)}renderInstance(t,r,a,o){xd(t,r,a,o)}mount(t){this.isSVGTag=Rs(t.tagName),super.mount(t)}};var wL=(e,t)=>bs(e)?new Cf(t):new Sf(t,{allowProjection:e!==xL.Fragment});var SL=XS({...JC,...pL,...uL,...hL},wL);var Ag=mS(SL);var Wl=D(de(),1);function CL({x:e,y:t,visible:r,onClick:a=!1}){return(0,Wl.jsx)(Dm,{children:r&&(0,Wl.jsx)(Ag.div,{className:"fixed pointer-events-none z-[9999]",initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1,x:e,y:t},exit:{opacity:0,scale:.5},transition:{type:"spring",stiffness:200,damping:20},style:{left:0,top:0},children:(0,Wl.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Wl.jsx)("path",{d:"M3 3L10.07 19.97L12.58 12.58L19.97 10.07L3 3Z",fill:"#C4B5FD"})})})})}var ti=D(Y(),1);function bL(){let[e,t]=ti.useState({x:0,y:0,visible:!1,onClick:!1}),r=ti.useCallback(n=>{let s=document.querySelector(n.selector);if(s){let i=s.getBoundingClientRect(),l=n.offset?.x||0,u=n.offset?.y||0;t({x:i.left+i.width/2+l,y:i.top+i.height/2+u,visible:!0,onClick:n.onClick||!1})}},[]),a=ti.useCallback(()=>{t(n=>({...n,visible:!1}))},[]),o=ti.useCallback(()=>{t(n=>({...n,visible:!0}))},[]);return{cursorState:e,moveTo:r,hide:a,show:o}}var ri=D(de(),1);function Ct({className:e,...t}){return(0,ri.jsx)("div",{"data-slot":"card",className:Xt("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function $r({className:e,...t}){return(0,ri.jsx)("div",{"data-slot":"card-header",className:Xt("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function Wr({className:e,...t}){return(0,ri.jsx)("div",{"data-slot":"card-title",className:Xt("leading-none font-semibold",e),...t})}function Rg({className:e,...t}){return(0,ri.jsx)("div",{"data-slot":"card-description",className:Xt("text-muted-foreground text-sm",e),...t})}function bt({className:e,...t}){return(0,ri.jsx)("div",{"data-slot":"card-content",className:Xt("px-6",e),...t})}var w=D(de(),1),Eg=e=>new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),bf=(e,t="USD")=>new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e),Dg=e=>{switch(e){case"Enterprise":return zo;case"Professional":return Ll;default:return gl}},Lf=e=>{switch(e){case"Enterprise":return"bg-purple-50 text-purple-700 border-purple-200";case"Professional":return"bg-blue-50 text-blue-700 border-blue-200";default:return"bg-gray-50 text-gray-700 border-gray-200"}};function Gl({status:e,type:t="default"}){let a=(()=>{let n=e.toLowerCase();if(t==="transaction")switch(n){case"paid":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:tt};case"failed":return{color:"bg-red-50 text-red-700 border-red-200",icon:kr};case"pending":return{color:"bg-amber-50 text-amber-700 border-amber-200",icon:qo};case"refunded":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:fs};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:Ir}}if(t==="subscription")switch(n){case"active":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:tt};case"cancelled":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:kr};case"past_due":return{color:"bg-red-50 text-red-700 border-red-200",icon:Ir};case"trialing":return{color:"bg-blue-50 text-blue-700 border-blue-200",icon:qo};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:Ir}}switch(n){case"active":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:tt};case"inactive":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:kr};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:Ir}}})(),o=a.icon;return(0,w.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium border ${a.color}`,children:[(0,w.jsx)(o,{className:"h-3 w-3"}),e]})}function _1({subscription:e}){let t=Dg(e.plan);return(0,w.jsxs)(Ct,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,w.jsx)("div",{className:`h-1 ${e.status==="active"?"bg-emerald-500":e.status==="past_due"?"bg-red-500":"bg-slate-300"}`}),(0,w.jsx)($r,{className:"pb-3",children:(0,w.jsxs)("div",{className:"flex items-start justify-between",children:[(0,w.jsxs)("div",{className:"space-y-1",children:[(0,w.jsxs)(Wr,{className:"text-base font-semibold text-gray-900 flex items-center gap-2",children:[(0,w.jsx)(Ho,{className:"h-4 w-4 text-gray-500"}),e.id]}),e.customer_email&&(0,w.jsxs)(Rg,{className:"text-sm text-gray-500 flex items-center gap-1.5",children:[(0,w.jsx)(cs,{className:"h-3 w-3"}),e.customer_email]})]}),(0,w.jsx)(Gl,{status:e.status,type:"subscription"})]})}),(0,w.jsx)(bt,{className:"pt-0",children:(0,w.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,w.jsxs)("div",{className:"space-y-3",children:[(0,w.jsxs)("div",{children:[(0,w.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Plan"}),(0,w.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium border ${Lf(e.plan)}`,children:[(0,w.jsx)(t,{className:"h-3 w-3"}),e.plan]})]}),(0,w.jsxs)("div",{children:[(0,w.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Billing"}),(0,w.jsxs)("div",{className:"text-sm font-medium text-gray-900",children:[bf(e.amount,e.currency)," / ",e.billing_cycle]})]})]}),(0,w.jsxs)("div",{className:"space-y-3",children:[(0,w.jsxs)("div",{children:[(0,w.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Current Period"}),(0,w.jsxs)("div",{className:"text-sm text-gray-700",children:[Eg(e.current_period_start)," - ",Eg(e.current_period_end)]})]}),(0,w.jsxs)("div",{children:[(0,w.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Created"}),(0,w.jsx)("div",{className:"text-sm text-gray-700",children:Eg(e.created_at)})]})]})]})})]})}function A1({subscriptions:e,maxItems:t=5}){let r=e.slice(0,t),a=e.length>t;return e.length===0?(0,w.jsx)(Ct,{className:"border-gray-200 shadow-sm bg-white",children:(0,w.jsxs)(bt,{className:"py-8 text-center",children:[(0,w.jsx)(Ho,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,w.jsx)("p",{className:"text-sm text-gray-500",children:"No subscriptions found"})]})}):(0,w.jsxs)(Ct,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,w.jsx)($r,{className:"pb-2 border-b border-gray-100",children:(0,w.jsxs)(Wr,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,w.jsx)(Ho,{className:"h-4 w-4"}),e.length," Subscription",e.length!==1?"s":""]})}),(0,w.jsxs)(bt,{className:"p-0",children:[(0,w.jsx)("div",{className:"divide-y divide-gray-100",children:r.map(o=>{let n=Dg(o.plan);return(0,w.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,w.jsxs)("div",{className:"flex items-center justify-between",children:[(0,w.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,w.jsx)("div",{className:`p-2 rounded-lg ${Lf(o.plan).replace("text-","text-").replace("border-","bg-").split(" ")[0]}`,children:(0,w.jsx)(n,{className:"h-4 w-4"})}),(0,w.jsxs)("div",{className:"min-w-0",children:[(0,w.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:o.customer_email||o.customer_id}),(0,w.jsxs)("div",{className:"text-xs text-gray-500",children:[o.plan," \xB7 ",bf(o.amount,o.currency),"/",o.billing_cycle]})]})]}),(0,w.jsx)(Gl,{status:o.status,type:"subscription"})]})},o.id)})}),a&&(0,w.jsx)("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-100 text-center",children:(0,w.jsxs)("span",{className:"text-xs text-gray-500",children:["+",e.length-t," more subscription",e.length-t!==1?"s":""]})})]})]})}function R1({customer:e}){let t=Dg(e.subscription);return(0,w.jsxs)(Ct,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,w.jsx)("div",{className:`h-1 ${e.status==="active"?"bg-emerald-500":"bg-slate-300"}`}),(0,w.jsx)($r,{className:"pb-3",children:(0,w.jsxs)("div",{className:"flex items-start justify-between",children:[(0,w.jsx)("div",{className:"flex items-center gap-3",children:(0,w.jsxs)("div",{children:[(0,w.jsx)(Wr,{className:"text-base font-semibold text-gray-900",children:e.name}),(0,w.jsxs)(Rg,{className:"text-sm text-gray-500 flex items-center gap-1",children:[(0,w.jsx)(cs,{className:"h-3 w-3"}),e.email]})]})}),(0,w.jsx)(Gl,{status:e.status,type:"customer"})]})}),(0,w.jsx)(bt,{className:"pt-0",children:(0,w.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,w.jsxs)("div",{className:"space-y-3",children:[(0,w.jsxs)("div",{children:[(0,w.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Plan"}),(0,w.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium border ${Lf(e.subscription)}`,children:[(0,w.jsx)(t,{className:"h-3 w-3"}),e.subscription]})]}),(0,w.jsxs)("div",{children:[(0,w.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Revenue"}),(0,w.jsxs)("div",{className:"text-sm font-medium text-gray-900 flex items-center gap-1",children:[(0,w.jsx)($o,{className:"h-3 w-3 text-emerald-500"}),e.revenue]})]})]}),(0,w.jsxs)("div",{className:"space-y-3",children:[(0,w.jsxs)("div",{children:[(0,w.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Location"}),(0,w.jsxs)("div",{className:"text-sm text-gray-700 flex items-center gap-1",children:[(0,w.jsx)(ds,{className:"h-3 w-3 text-gray-400"}),e.location||"Not specified"]})]}),(0,w.jsxs)("div",{children:[(0,w.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Customer Since"}),(0,w.jsxs)("div",{className:"text-sm text-gray-700 flex items-center gap-1",children:[(0,w.jsx)(vl,{className:"h-3 w-3 text-gray-400"}),e.joinDate]})]})]})]})})]})}function E1({customers:e,maxItems:t=5}){let r=e.slice(0,t),a=e.length>t;return e.length===0?(0,w.jsx)(Ct,{className:"border-gray-200 shadow-sm bg-white",children:(0,w.jsxs)(bt,{className:"py-8 text-center",children:[(0,w.jsx)(hs,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,w.jsx)("p",{className:"text-sm text-gray-500",children:"No customers found"})]})}):(0,w.jsxs)(Ct,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,w.jsx)($r,{className:"pb-2 border-b border-gray-100",children:(0,w.jsxs)(Wr,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,w.jsx)(hs,{className:"h-4 w-4"}),e.length," Customer",e.length!==1?"s":""]})}),(0,w.jsxs)(bt,{className:"p-0",children:[(0,w.jsx)("div",{className:"divide-y divide-gray-100",children:r.map(o=>(0,w.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,w.jsxs)("div",{className:"flex items-center justify-between",children:[(0,w.jsx)("div",{className:"flex items-center gap-3 min-w-0",children:(0,w.jsxs)("div",{className:"min-w-0",children:[(0,w.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:o.name}),(0,w.jsx)("div",{className:"text-xs text-gray-500 truncate",children:o.email})]})}),(0,w.jsxs)("div",{className:"flex items-center gap-2",children:[(0,w.jsx)("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${Lf(o.subscription)}`,children:o.subscription}),(0,w.jsx)(Gl,{status:o.status,type:"customer"})]})]})},o.id))}),a&&(0,w.jsx)("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-100 text-center",children:(0,w.jsxs)("span",{className:"text-xs text-gray-500",children:["+",e.length-t," more customer",e.length-t!==1?"s":""]})})]})]})}function LL({transactions:e,maxItems:t=5}){let r=e.slice(0,t),a=e.length>t;return e.length===0?(0,w.jsx)(Ct,{className:"border-gray-200 shadow-sm bg-white",children:(0,w.jsxs)(bt,{className:"py-8 text-center",children:[(0,w.jsx)($o,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,w.jsx)("p",{className:"text-sm text-gray-500",children:"No transactions found"})]})}):(0,w.jsxs)(Ct,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,w.jsx)($r,{className:"pb-2 border-b border-gray-100",children:(0,w.jsxs)(Wr,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,w.jsx)($o,{className:"h-4 w-4"}),e.length," Transaction",e.length!==1?"s":""]})}),(0,w.jsxs)(bt,{className:"p-0",children:[(0,w.jsx)("div",{className:"divide-y divide-gray-100",children:r.map(o=>(0,w.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,w.jsxs)("div",{className:"flex items-center justify-between",children:[(0,w.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,w.jsx)("div",{className:`p-2 rounded-lg ${o.status==="paid"?"bg-emerald-50":o.status==="failed"?"bg-red-50":o.status==="refunded"?"bg-slate-50":"bg-amber-50"}`,children:o.status==="paid"?(0,w.jsx)(tt,{className:"h-4 w-4 text-emerald-600"}):o.status==="failed"?(0,w.jsx)(kr,{className:"h-4 w-4 text-red-600"}):o.status==="refunded"?(0,w.jsx)(fs,{className:"h-4 w-4 text-slate-600"}):(0,w.jsx)(qo,{className:"h-4 w-4 text-amber-600"})}),(0,w.jsxs)("div",{className:"min-w-0",children:[(0,w.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:o.customer}),(0,w.jsxs)("div",{className:"text-xs text-gray-500",children:[o.date,o.decline_reason&&(0,w.jsxs)("span",{className:"text-red-500 ml-2",children:["\xB7 ",o.decline_reason]})]})]})]}),(0,w.jsxs)("div",{className:"flex items-center gap-3",children:[(0,w.jsxs)("span",{className:`text-sm font-semibold ${o.status==="paid"?"text-emerald-600":o.status==="failed"?"text-red-600":o.status==="refunded"?"text-slate-600":"text-amber-600"}`,children:[o.status==="refunded"?"-":"",o.amount]}),(0,w.jsx)(Gl,{status:o.status,type:"transaction"})]})]})},o.id))}),a&&(0,w.jsx)("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-100 text-center",children:(0,w.jsxs)("span",{className:"text-xs text-gray-500",children:["+",e.length-t," more transaction",e.length-t!==1?"s":""]})})]})]})}function D1({apiKeys:e}){return e.length===0?(0,w.jsx)(Ct,{className:"border-gray-200 shadow-sm bg-white",children:(0,w.jsxs)(bt,{className:"py-8 text-center",children:[(0,w.jsx)(us,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,w.jsx)("p",{className:"text-sm text-gray-500",children:"No API keys found"})]})}):(0,w.jsxs)(Ct,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,w.jsx)($r,{className:"pb-2 border-b border-gray-100",children:(0,w.jsxs)(Wr,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,w.jsx)(us,{className:"h-4 w-4"}),e.length," API Key",e.length!==1?"s":""]})}),(0,w.jsx)(bt,{className:"p-0",children:(0,w.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((t,r)=>(0,w.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,w.jsxs)("div",{className:"flex items-center justify-between",children:[(0,w.jsxs)("div",{className:"min-w-0",children:[(0,w.jsx)("div",{className:"text-sm font-medium text-gray-900",children:t.name}),(0,w.jsxs)("div",{className:"text-xs text-gray-500 font-mono",children:[t.key.slice(0,12),"...",t.key.slice(-4)]})]}),(0,w.jsxs)("div",{className:"text-xs text-gray-500",children:["Last used: ",t.lastUsed]})]})},r))})})]})}function N1({sessions:e}){let t=r=>{let a=r.toLowerCase();return a.includes("mobile")||a.includes("iphone")||a.includes("android")?Cl:wl};return e.length===0?(0,w.jsx)(Ct,{className:"border-gray-200 shadow-sm bg-white",children:(0,w.jsxs)(bt,{className:"py-8 text-center",children:[(0,w.jsx)(ps,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,w.jsx)("p",{className:"text-sm text-gray-500",children:"No active sessions"})]})}):(0,w.jsxs)(Ct,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,w.jsx)($r,{className:"pb-2 border-b border-gray-100",children:(0,w.jsxs)(Wr,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,w.jsx)(ps,{className:"h-4 w-4"}),e.length," Active Session",e.length!==1?"s":""]})}),(0,w.jsx)(bt,{className:"p-0",children:(0,w.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((r,a)=>{let o=t(r.device);return(0,w.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,w.jsxs)("div",{className:"flex items-center justify-between",children:[(0,w.jsxs)("div",{className:"flex items-center gap-3",children:[(0,w.jsx)("div",{className:"p-2 rounded-lg bg-gray-100",children:(0,w.jsx)(o,{className:"h-4 w-4 text-gray-600"})}),(0,w.jsxs)("div",{children:[(0,w.jsx)("div",{className:"text-sm font-medium text-gray-900",children:r.device}),(0,w.jsxs)("div",{className:"text-xs text-gray-500 flex items-center gap-1",children:[(0,w.jsx)(ds,{className:"h-3 w-3"}),r.location]})]})]}),(0,w.jsx)("div",{className:"text-xs text-gray-500",children:r.time})]})},a)})})})]})}function M1({stats:e}){return(0,w.jsxs)(Ct,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,w.jsx)($r,{className:"pb-2 border-b border-gray-100",children:(0,w.jsxs)(Wr,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,w.jsx)(bl,{className:"h-4 w-4"}),"Dashboard Overview"]})}),(0,w.jsx)(bt,{className:"p-4",children:(0,w.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[e.revenue&&(0,w.jsxs)("div",{className:"p-3 rounded-lg bg-emerald-50 border border-emerald-100",children:[(0,w.jsx)("div",{className:"text-xs text-emerald-600 font-medium mb-1",children:"Revenue"}),(0,w.jsx)("div",{className:"text-lg font-bold text-emerald-700",children:bf(e.revenue.total)}),e.revenue.change!==0&&(0,w.jsxs)("div",{className:`text-xs ${e.revenue.change>0?"text-emerald-600":"text-red-600"}`,children:[e.revenue.change>0?"+":"",e.revenue.change,"% from last period"]})]}),e.subscriptions&&(0,w.jsxs)("div",{className:"p-3 rounded-lg bg-blue-50 border border-blue-100",children:[(0,w.jsx)("div",{className:"text-xs text-blue-600 font-medium mb-1",children:"Subscriptions"}),(0,w.jsxs)("div",{className:"text-lg font-bold text-blue-700",children:[e.subscriptions.active," active"]}),(0,w.jsxs)("div",{className:"text-xs text-blue-600",children:[e.subscriptions.total," total"]})]}),e.customers&&(0,w.jsxs)("div",{className:"p-3 rounded-lg bg-purple-50 border border-purple-100",children:[(0,w.jsx)("div",{className:"text-xs text-purple-600 font-medium mb-1",children:"Customers"}),(0,w.jsx)("div",{className:"text-lg font-bold text-purple-700",children:e.customers.total}),e.customers.new>0&&(0,w.jsxs)("div",{className:"text-xs text-purple-600",children:["+",e.customers.new," new this period"]})]}),e.transactions&&(0,w.jsxs)("div",{className:"p-3 rounded-lg bg-amber-50 border border-amber-100",children:[(0,w.jsx)("div",{className:"text-xs text-amber-600 font-medium mb-1",children:"Transactions"}),(0,w.jsxs)("div",{className:"text-lg font-bold text-amber-700",children:[e.transactions.successful," successful"]}),e.transactions.failed>0&&(0,w.jsxs)("div",{className:"text-xs text-red-600",children:[e.transactions.failed," failed"]})]})]})})]})}function O1({customers:e}){return e.length===0?(0,w.jsx)(Ct,{className:"border-gray-200 shadow-sm bg-white",children:(0,w.jsxs)(bt,{className:"py-8 text-center",children:[(0,w.jsx)(zo,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,w.jsx)("p",{className:"text-sm text-gray-500",children:"No top customers data"})]})}):(0,w.jsxs)(Ct,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,w.jsx)($r,{className:"pb-2 border-b border-gray-100",children:(0,w.jsxs)(Wr,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,w.jsx)(zo,{className:"h-4 w-4 text-amber-500"}),"Top Customers"]})}),(0,w.jsx)(bt,{className:"p-0",children:(0,w.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((t,r)=>(0,w.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,w.jsxs)("div",{className:"flex items-center justify-between",children:[(0,w.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,w.jsx)("div",{className:`h-6 w-6 rounded-full flex items-center justify-center text-xs font-bold ${r===0?"bg-amber-100 text-amber-700":r===1?"bg-slate-100 text-slate-700":r===2?"bg-orange-100 text-orange-700":"bg-gray-100 text-gray-700"}`,children:r+1}),(0,w.jsxs)("div",{className:"min-w-0",children:[(0,w.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:t.name}),(0,w.jsx)("div",{className:"text-xs text-gray-500 truncate",children:t.email})]})]}),(0,w.jsx)("div",{className:"text-sm font-semibold text-emerald-600",children:typeof t.revenue=="number"?bf(t.revenue):t.revenue})]})},r))})})]})}function IL({type:e,data:t}){if(!t)return null;switch(e){case"subscription":return(0,w.jsx)(_1,{subscription:t});case"subscriptions":let r=t.subscriptions||t||[];return(0,w.jsx)(A1,{subscriptions:Array.isArray(r)?r:[r]});case"customer":return(0,w.jsx)(R1,{customer:t.customer||t});case"customers":let a=t.customers||t||[];return(0,w.jsx)(E1,{customers:Array.isArray(a)?a:[a]});case"transactions":let o=t.transactions||t||[];return(0,w.jsx)(LL,{transactions:Array.isArray(o)?o:[o]});case"transaction":return(0,w.jsx)(LL,{transactions:[t],maxItems:1});case"dashboard_stats":return(0,w.jsx)(M1,{stats:t});case"top_customers":let n=t.customers||t||[];return(0,w.jsx)(O1,{customers:Array.isArray(n)?n:[n]});case"api_keys":let s=t.api_keys||t||[];return(0,w.jsx)(D1,{apiKeys:Array.isArray(s)?s:[s]});case"sessions":let i=t.sessions||t||[];return(0,w.jsx)(N1,{sessions:Array.isArray(i)?i:[i]});default:return null}}function sn(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(r[a[o]]=e[a[o]]);return r}function kL(e,t,r,a){function o(n){return n instanceof r?n:new r(function(s){s(n)})}return new(r||(r=Promise))(function(n,s){function i(c){try{u(a.next(c))}catch(d){s(d)}}function l(c){try{u(a.throw(c))}catch(d){s(d)}}function u(c){c.done?n(c.value):o(c.value).then(i,l)}u((a=a.apply(e,t||[])).next())})}var PL=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);var ai=class extends Error{constructor(t,r="FunctionsError",a){super(t),this.name=r,this.context=a}},Kl=class extends ai{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}},oi=class extends ai{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}},ni=class extends ai{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}},Xl;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(Xl||(Xl={}));var Jl=class{constructor(t,{headers:r={},customFetch:a,region:o=Xl.Any}={}){this.url=t,this.headers=r,this.region=o,this.fetch=PL(a)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return kL(this,arguments,void 0,function*(r,a={}){var o;let n,s;try{let{headers:i,method:l,body:u,signal:c,timeout:d}=a,f={},{region:p}=a;p||(p=this.region);let v=new URL(`${this.url}/${r}`);p&&p!=="any"&&(f["x-region"]=p,v.searchParams.set("forceFunctionRegion",p));let x;u&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)?typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(f["Content-Type"]="application/octet-stream",x=u):typeof u=="string"?(f["Content-Type"]="text/plain",x=u):typeof FormData<"u"&&u instanceof FormData?x=u:(f["Content-Type"]="application/json",x=JSON.stringify(u)):u&&typeof u!="string"&&!(typeof Blob<"u"&&u instanceof Blob)&&!(u instanceof ArrayBuffer)&&!(typeof FormData<"u"&&u instanceof FormData)?x=JSON.stringify(u):x=u;let C=c;d&&(s=new AbortController,n=setTimeout(()=>s.abort(),d),c?(C=s.signal,c.addEventListener("abort",()=>s.abort())):C=s.signal);let g=yield this.fetch(v.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},f),this.headers),i),body:x,signal:C}).catch(L=>{throw new Kl(L)}),m=g.headers.get("x-relay-error");if(m&&m==="true")throw new oi(g);if(!g.ok)throw new ni(g);let y=((o=g.headers.get("Content-Type"))!==null&&o!==void 0?o:"text/plain").split(";")[0].trim(),b;return y==="application/json"?b=yield g.json():y==="application/octet-stream"||y==="application/pdf"?b=yield g.blob():y==="text/event-stream"?b=g:y==="multipart/form-data"?b=yield g.formData():b=yield g.text(),{data:b,error:null,response:g}}catch(i){return{data:null,error:i,response:i instanceof ni||i instanceof oi?i.context:void 0}}finally{n&&clearTimeout(n)}})}};var _L=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}},B1=class{constructor(e){var t,r;this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(r=e.isMaybeSingle)!==null&&r!==void 0?r:!1,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}then(e,t){var r=this;this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");let a=this.fetch,o=a(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async n=>{let s=null,i=null,l=null,u=n.status,c=n.statusText;if(n.ok){var d,f;if(r.method!=="HEAD"){var p;let g=await n.text();g===""||(r.headers.get("Accept")==="text/csv"||r.headers.get("Accept")&&(!((p=r.headers.get("Accept"))===null||p===void 0)&&p.includes("application/vnd.pgrst.plan+text"))?i=g:i=JSON.parse(g))}let x=(d=r.headers.get("Prefer"))===null||d===void 0?void 0:d.match(/count=(exact|planned|estimated)/),C=(f=n.headers.get("content-range"))===null||f===void 0?void 0:f.split("/");x&&C&&C.length>1&&(l=parseInt(C[1])),r.isMaybeSingle&&r.method==="GET"&&Array.isArray(i)&&(i.length>1?(s={code:"PGRST116",details:`Results contain ${i.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},i=null,l=null,u=406,c="Not Acceptable"):i.length===1?i=i[0]:i=null)}else{var v;let x=await n.text();try{s=JSON.parse(x),Array.isArray(s)&&n.status===404&&(i=[],s=null,u=200,c="OK")}catch{n.status===404&&x===""?(u=204,c="No Content"):s={message:x}}if(s&&r.isMaybeSingle&&(!(s==null||(v=s.details)===null||v===void 0)&&v.includes("0 rows"))&&(s=null,u=200,c="OK"),s&&r.shouldThrowOnError)throw new _L(s)}return{error:s,data:i,count:l,status:u,statusText:c}});return this.shouldThrowOnError||(o=o.catch(n=>{var s;let i="",l=n?.cause;if(l){var u,c,d,f;let v=(u=l?.message)!==null&&u!==void 0?u:"",x=(c=l?.code)!==null&&c!==void 0?c:"";i=`${(d=n?.name)!==null&&d!==void 0?d:"FetchError"}: ${n?.message}`,i+=`
|
|
17
|
-
|
|
18
|
-
Caused by: ${(f=l?.name)!==null&&f!==void 0?f:"Error"}: ${v}`,x&&(i+=` (${x})`),l?.stack&&(i+=`
|
|
19
|
-
${l.stack}`)}else{var p;i=(p=n?.stack)!==null&&p!==void 0?p:""}return{error:{message:`${(s=n?.name)!==null&&s!==void 0?s:"FetchError"}: ${n?.message}`,details:i,hint:"",code:""},data:null,count:null,status:0,statusText:""}})),o.then(e,t)}returns(){return this}overrideTypes(){return this}},F1=class extends B1{select(e){let t=!1,r=(e??"*").split("").map(a=>/\s/.test(a)&&!t?"":(a==='"'&&(t=!t),a)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:r,foreignTable:a,referencedTable:o=a}={}){let n=o?`${o}.order`:"order",s=this.url.searchParams.get(n);return this.url.searchParams.set(n,`${s?`${s},`:""}${e}.${t?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:r=t}={}){let a=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(a,`${e}`),this}range(e,t,{foreignTable:r,referencedTable:a=r}={}){let o=typeof a>"u"?"offset":`${a}.offset`,n=typeof a>"u"?"limit":`${a}.limit`;return this.url.searchParams.set(o,`${e}`),this.url.searchParams.set(n,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:t=!1,settings:r=!1,buffers:a=!1,wal:o=!1,format:n="text"}={}){var s;let i=[e?"analyze":null,t?"verbose":null,r?"settings":null,a?"buffers":null,o?"wal":null].filter(Boolean).join("|"),l=(s=this.headers.get("Accept"))!==null&&s!==void 0?s:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${n}; for="${l}"; options=${i};`),n==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}},TL=new RegExp("[,()]"),si=class extends F1{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){let r=Array.from(new Set(t)).map(a=>typeof a=="string"&&TL.test(a)?`"${a}"`:`${a}`).join(",");return this.url.searchParams.append(e,`in.(${r})`),this}notIn(e,t){let r=Array.from(new Set(t)).map(a=>typeof a=="string"&&TL.test(a)?`"${a}"`:`${a}`).join(",");return this.url.searchParams.append(e,`not.in.(${r})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:r,type:a}={}){let o="";a==="plain"?o="pl":a==="phrase"?o="ph":a==="websearch"&&(o="w");let n=r===void 0?"":`(${r})`;return this.url.searchParams.append(e,`${o}fts${n}.${t}`),this}match(e){return Object.entries(e).forEach(([t,r])=>{this.url.searchParams.append(t,`eq.${r}`)}),this}not(e,t,r){return this.url.searchParams.append(e,`not.${t}.${r}`),this}or(e,{foreignTable:t,referencedTable:r=t}={}){let a=r?`${r}.or`:"or";return this.url.searchParams.append(a,`(${e})`),this}filter(e,t,r){return this.url.searchParams.append(e,`${t}.${r}`),this}},U1=class{constructor(e,{headers:t={},schema:r,fetch:a}){this.url=e,this.headers=new Headers(t),this.schema=r,this.fetch=a}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){let{head:r=!1,count:a}=t??{},o=r?"HEAD":"GET",n=!1,s=(e??"*").split("").map(u=>/\s/.test(u)&&!n?"":(u==='"'&&(n=!n),u)).join(""),{url:i,headers:l}=this.cloneRequestState();return i.searchParams.set("select",s),a&&l.append("Prefer",`count=${a}`),new si({method:o,url:i,headers:l,schema:this.schema,fetch:this.fetch})}insert(e,{count:t,defaultToNull:r=!0}={}){var a;let o="POST",{url:n,headers:s}=this.cloneRequestState();if(t&&s.append("Prefer",`count=${t}`),r||s.append("Prefer","missing=default"),Array.isArray(e)){let i=e.reduce((l,u)=>l.concat(Object.keys(u)),[]);if(i.length>0){let l=[...new Set(i)].map(u=>`"${u}"`);n.searchParams.set("columns",l.join(","))}}return new si({method:o,url:n,headers:s,schema:this.schema,body:e,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}upsert(e,{onConflict:t,ignoreDuplicates:r=!1,count:a,defaultToNull:o=!0}={}){var n;let s="POST",{url:i,headers:l}=this.cloneRequestState();if(l.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),t!==void 0&&i.searchParams.set("on_conflict",t),a&&l.append("Prefer",`count=${a}`),o||l.append("Prefer","missing=default"),Array.isArray(e)){let u=e.reduce((c,d)=>c.concat(Object.keys(d)),[]);if(u.length>0){let c=[...new Set(u)].map(d=>`"${d}"`);i.searchParams.set("columns",c.join(","))}}return new si({method:s,url:i,headers:l,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch})}update(e,{count:t}={}){var r;let a="PATCH",{url:o,headers:n}=this.cloneRequestState();return t&&n.append("Prefer",`count=${t}`),new si({method:a,url:o,headers:n,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch})}delete({count:e}={}){var t;let r="DELETE",{url:a,headers:o}=this.cloneRequestState();return e&&o.append("Prefer",`count=${e}`),new si({method:r,url:a,headers:o,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch})}},AL=class RL{constructor(t,{headers:r={},schema:a,fetch:o}={}){this.url=t,this.headers=new Headers(r),this.schemaName=a,this.fetch=o}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new U1(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(t){return new RL(this.url,{headers:this.headers,schema:t,fetch:this.fetch})}rpc(t,r={},{head:a=!1,get:o=!1,count:n}={}){var s;let i,l=new URL(`${this.url}/rpc/${t}`),u,c=p=>p!==null&&typeof p=="object"&&(!Array.isArray(p)||p.some(c)),d=a&&Object.values(r).some(c);d?(i="POST",u=r):a||o?(i=a?"HEAD":"GET",Object.entries(r).filter(([p,v])=>v!==void 0).map(([p,v])=>[p,Array.isArray(v)?`{${v.join(",")}}`:`${v}`]).forEach(([p,v])=>{l.searchParams.append(p,v)})):(i="POST",u=r);let f=new Headers(this.headers);return d?f.set("Prefer",n?`count=${n},return=minimal`:"return=minimal"):n&&f.set("Prefer",`count=${n}`),new si({method:i,url:l,headers:f,schema:this.schemaName,body:u,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch})}};var Ng=class{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};let r=globalThis.process;if(r){let a=r.versions;if(a&&a.node){let o=a.node,n=parseInt(o.replace(/^v/,"").split(".")[0]);return n>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${n} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${n} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
|
|
20
|
-
import ws from "ws"
|
|
21
|
-
new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){let t=this.detectEnvironment();if(t.constructor)return t.constructor;let r=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(r+=`
|
|
22
|
-
|
|
23
|
-
Suggested solution: ${t.workaround}`),new Error(r)}static createWebSocket(t,r){let a=this.getWebSocketConstructor();return new a(t,r)}static isWebSocketSupported(){try{let t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}},Mg=Ng;var EL="2.90.1";var DL=`realtime-js/${EL}`,Og="1.0.0",NL="2.0.0",Bg=Og;var Ql=1e4,ML=1e3,OL=100,Ia;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(Ia||(Ia={}));var We;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(We||(We={}));var tr;(function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"})(tr||(tr={}));var If;(function(e){e.websocket="websocket"})(If||(If={}));var wo;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(wo||(wo={}));var Yl=class{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,r){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(t));let a=[t.join_ref,t.ref,t.topic,t.event,t.payload];return r(JSON.stringify(a))}_binaryEncodeUserBroadcastPush(t){var r;return this._isArrayBuffer((r=t.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var r,a;let o=(a=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&a!==void 0?a:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,o)}_encodeJsonUserBroadcastPush(t){var r,a;let o=(a=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&a!==void 0?a:{},s=new TextEncoder().encode(JSON.stringify(o)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,s)}_encodeUserBroadcastPush(t,r,a){var o,n;let s=t.topic,i=(o=t.ref)!==null&&o!==void 0?o:"",l=(n=t.join_ref)!==null&&n!==void 0?n:"",u=t.payload.event,c=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},d=Object.keys(c).length===0?"":JSON.stringify(c);if(l.length>255)throw new Error(`joinRef length ${l.length} exceeds maximum of 255`);if(i.length>255)throw new Error(`ref length ${i.length} exceeds maximum of 255`);if(s.length>255)throw new Error(`topic length ${s.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`userEvent length ${u.length} exceeds maximum of 255`);if(d.length>255)throw new Error(`metadata length ${d.length} exceeds maximum of 255`);let f=this.USER_BROADCAST_PUSH_META_LENGTH+l.length+i.length+s.length+u.length+d.length,p=new ArrayBuffer(this.HEADER_LENGTH+f),v=new DataView(p),x=0;v.setUint8(x++,this.KINDS.userBroadcastPush),v.setUint8(x++,l.length),v.setUint8(x++,i.length),v.setUint8(x++,s.length),v.setUint8(x++,u.length),v.setUint8(x++,d.length),v.setUint8(x++,r),Array.from(l,g=>v.setUint8(x++,g.charCodeAt(0))),Array.from(i,g=>v.setUint8(x++,g.charCodeAt(0))),Array.from(s,g=>v.setUint8(x++,g.charCodeAt(0))),Array.from(u,g=>v.setUint8(x++,g.charCodeAt(0))),Array.from(d,g=>v.setUint8(x++,g.charCodeAt(0)));var C=new Uint8Array(p.byteLength+a.byteLength);return C.set(new Uint8Array(p),0),C.set(new Uint8Array(a),p.byteLength),C.buffer}decode(t,r){if(this._isArrayBuffer(t)){let a=this._binaryDecode(t);return r(a)}if(typeof t=="string"){let a=JSON.parse(t),[o,n,s,i,l]=a;return r({join_ref:o,ref:n,topic:s,event:i,payload:l})}return r({})}_binaryDecode(t){let r=new DataView(t),a=r.getUint8(0),o=new TextDecoder;if(a===this.KINDS.userBroadcast)return this._decodeUserBroadcast(t,r,o)}_decodeUserBroadcast(t,r,a){let o=r.getUint8(1),n=r.getUint8(2),s=r.getUint8(3),i=r.getUint8(4),l=this.HEADER_LENGTH+4,u=a.decode(t.slice(l,l+o));l=l+o;let c=a.decode(t.slice(l,l+n));l=l+n;let d=a.decode(t.slice(l,l+s));l=l+s;let f=t.slice(l,t.byteLength),p=i===this.JSON_ENCODING?JSON.parse(a.decode(f)):f,v={type:this.BROADCAST_EVENT,event:c,payload:p};return s>0&&(v.meta=JSON.parse(d)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST_EVENT,payload:v}}_isArrayBuffer(t){var r;return t instanceof ArrayBuffer||((r=t?.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(t,r){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([a])=>r.includes(a)))}};var ln=class{constructor(t,r){this.callback=t,this.timerCalc=r,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=r}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}};var Ce;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(Ce||(Ce={}));var Ug=(e,t,r={})=>{var a;let o=(a=r.skipTypes)!==null&&a!==void 0?a:[];return t?Object.keys(t).reduce((n,s)=>(n[s]=V1(s,e,t,o),n),{}):{}},V1=(e,t,r,a)=>{let o=t.find(i=>i.name===e),n=o?.type,s=r[e];return n&&!a.includes(n)?BL(n,s):Fg(s)},BL=(e,t)=>{if(e.charAt(0)==="_"){let r=e.slice(1,e.length);return z1(t,r)}switch(e){case Ce.bool:return j1(t);case Ce.float4:case Ce.float8:case Ce.int2:case Ce.int4:case Ce.int8:case Ce.numeric:case Ce.oid:return q1(t);case Ce.json:case Ce.jsonb:return H1(t);case Ce.timestamp:return $1(t);case Ce.abstime:case Ce.date:case Ce.daterange:case Ce.int4range:case Ce.int8range:case Ce.money:case Ce.reltime:case Ce.text:case Ce.time:case Ce.timestamptz:case Ce.timetz:case Ce.tsrange:case Ce.tstzrange:return Fg(t);default:return Fg(t)}},Fg=e=>e,j1=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},q1=e=>{if(typeof e=="string"){let t=parseFloat(e);if(!Number.isNaN(t))return t}return e},H1=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},z1=(e,t)=>{if(typeof e!="string")return e;let r=e.length-1,a=e[r];if(e[0]==="{"&&a==="}"){let n,s=e.slice(1,r);try{n=JSON.parse("["+s+"]")}catch{n=s?s.split(","):[]}return n.map(i=>BL(t,i))}return e},$1=e=>typeof e=="string"?e.replace(" ","T"):e,kf=e=>{let t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};var un=class{constructor(t,r,a={},o=Ql){this.channel=t,this.event=r,this.payload=a,this.timeout=o,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(t){this.timeout=t,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(t){this.payload=Object.assign(Object.assign({},this.payload),t)}receive(t,r){var a;return this._hasReceived(t)&&r((a=this.receivedResp)===null||a===void 0?void 0:a.response),this.recHooks.push({status:t,callback:r}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);let t=r=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=r,this._matchReceive(r)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,r){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,response:r})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:t,response:r}){this.recHooks.filter(a=>a.status===t).forEach(a=>a.callback(r))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}};var Vg;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(Vg||(Vg={}));var ii=class e{constructor(t,r){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};let a=r?.events||{state:"presence_state",diff:"presence_diff"};this.channel._on(a.state,{},o=>{let{onJoin:n,onLeave:s,onSync:i}=this.caller;this.joinRef=this.channel._joinRef(),this.state=e.syncState(this.state,o,n,s),this.pendingDiffs.forEach(l=>{this.state=e.syncDiff(this.state,l,n,s)}),this.pendingDiffs=[],i()}),this.channel._on(a.diff,{},o=>{let{onJoin:n,onLeave:s,onSync:i}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(o):(this.state=e.syncDiff(this.state,o,n,s),i())}),this.onJoin((o,n,s)=>{this.channel._trigger("presence",{event:"join",key:o,currentPresences:n,newPresences:s})}),this.onLeave((o,n,s)=>{this.channel._trigger("presence",{event:"leave",key:o,currentPresences:n,leftPresences:s})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,r,a,o){let n=this.cloneDeep(t),s=this.transformState(r),i={},l={};return this.map(n,(u,c)=>{s[u]||(l[u]=c)}),this.map(s,(u,c)=>{let d=n[u];if(d){let f=c.map(C=>C.presence_ref),p=d.map(C=>C.presence_ref),v=c.filter(C=>p.indexOf(C.presence_ref)<0),x=d.filter(C=>f.indexOf(C.presence_ref)<0);v.length>0&&(i[u]=v),x.length>0&&(l[u]=x)}else i[u]=c}),this.syncDiff(n,{joins:i,leaves:l},a,o)}static syncDiff(t,r,a,o){let{joins:n,leaves:s}={joins:this.transformState(r.joins),leaves:this.transformState(r.leaves)};return a||(a=()=>{}),o||(o=()=>{}),this.map(n,(i,l)=>{var u;let c=(u=t[i])!==null&&u!==void 0?u:[];if(t[i]=this.cloneDeep(l),c.length>0){let d=t[i].map(p=>p.presence_ref),f=c.filter(p=>d.indexOf(p.presence_ref)<0);t[i].unshift(...f)}a(i,c,l)}),this.map(s,(i,l)=>{let u=t[i];if(!u)return;let c=l.map(d=>d.presence_ref);u=u.filter(d=>c.indexOf(d.presence_ref)<0),t[i]=u,o(i,u,l),u.length===0&&delete t[i]}),t}static map(t,r){return Object.getOwnPropertyNames(t).map(a=>r(a,t[a]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((r,a)=>{let o=t[a];return"metas"in o?r[a]=o.metas.map(n=>(n.presence_ref=n.phx_ref,delete n.phx_ref,delete n.phx_ref_prev,n)):r[a]=o,r},{})}static cloneDeep(t){return JSON.parse(JSON.stringify(t))}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}};var jg;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(jg||(jg={}));var li;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(li||(li={}));var Gr;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Gr||(Gr={}));var ui=class e{constructor(t,r={config:{}},a){var o,n;if(this.topic=t,this.params=r,this.socket=a,this.bindings={},this.state=We.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.timeout=this.socket.timeout,this.joinPush=new un(this,tr.join,this.params,this.timeout),this.rejoinTimer=new ln(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=We.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(s=>s.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=We.closed,this.socket._remove(this)}),this._onError(s=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,s),this.state=We.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=We.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",s=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,s),this.state=We.errored,this.rejoinTimer.scheduleTimeout())}),this._on(tr.reply,{},(s,i)=>{this._trigger(this._replyEventName(i),s)}),this.presence=new ii(this),this.broadcastEndpointURL=kf(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((n=(o=this.params.config)===null||o===void 0?void 0:o.broadcast)===null||n===void 0)&&n.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(t,r=this.timeout){var a,o,n;if(this.socket.isConnected()||this.socket.connect(),this.state==We.closed){let{config:{broadcast:s,presence:i,private:l}}=this.params,u=(o=(a=this.bindings.postgres_changes)===null||a===void 0?void 0:a.map(p=>p.filter))!==null&&o!==void 0?o:[],c=!!this.bindings[li.PRESENCE]&&this.bindings[li.PRESENCE].length>0||((n=this.params.config.presence)===null||n===void 0?void 0:n.enabled)===!0,d={},f={broadcast:s,presence:Object.assign(Object.assign({},i),{enabled:c}),postgres_changes:u,private:l};this.socket.accessTokenValue&&(d.access_token=this.socket.accessTokenValue),this._onError(p=>t?.(Gr.CHANNEL_ERROR,p)),this._onClose(()=>t?.(Gr.CLOSED)),this.updateJoinPayload(Object.assign({config:f},d)),this.joinedOnce=!0,this._rejoin(r),this.joinPush.receive("ok",async({postgres_changes:p})=>{var v;if(this.socket._isManualToken()||this.socket.setAuth(),p===void 0){t?.(Gr.SUBSCRIBED);return}else{let x=this.bindings.postgres_changes,C=(v=x?.length)!==null&&v!==void 0?v:0,g=[];for(let m=0;m<C;m++){let y=x[m],{filter:{event:b,schema:L,table:k,filter:_}}=y,T=p&&p[m];if(T&&T.event===b&&e.isFilterValueEqual(T.schema,L)&&e.isFilterValueEqual(T.table,k)&&e.isFilterValueEqual(T.filter,_))g.push(Object.assign(Object.assign({},y),{id:T.id}));else{this.unsubscribe(),this.state=We.errored,t?.(Gr.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=g,t&&t(Gr.SUBSCRIBED);return}}).receive("error",p=>{this.state=We.errored,t?.(Gr.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(p).join(", ")||"error")))}).receive("timeout",()=>{t?.(Gr.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(t,r={}){return await this.send({type:"presence",event:"track",payload:t},r.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,r,a){return this.state===We.joined&&t===li.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(async()=>await this.subscribe())),this._on(t,r,a)}async httpSend(t,r,a={}){var o;if(r==null)return Promise.reject("Payload is required for httpSend()");let n={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(n.Authorization=`Bearer ${this.socket.accessTokenValue}`);let s={method:"POST",headers:n,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:r,private:this.private}]})},i=await this._fetchWithTimeout(this.broadcastEndpointURL,s,(o=a.timeout)!==null&&o!==void 0?o:this.timeout);if(i.status===202)return{success:!0};let l=i.statusText;try{let u=await i.json();l=u.error||u.message||l}catch{}return Promise.reject(new Error(l))}async send(t,r={}){var a,o;if(!this._canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");let{event:n,payload:s}=t,i={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);let l={method:"POST",headers:i,body:JSON.stringify({messages:[{topic:this.subTopic,event:n,payload:s,private:this.private}]})};try{let u=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(a=r.timeout)!==null&&a!==void 0?a:this.timeout);return await((o=u.body)===null||o===void 0?void 0:o.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(n=>{var s,i,l;let u=this._push(t.type,t,r.timeout||this.timeout);t.type==="broadcast"&&!(!((l=(i=(s=this.params)===null||s===void 0?void 0:s.config)===null||i===void 0?void 0:i.broadcast)===null||l===void 0)&&l.ack)&&n("ok"),u.receive("ok",()=>n("ok")),u.receive("error",()=>n("error")),u.receive("timeout",()=>n("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=We.leaving;let r=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(tr.close,"leave",this._joinRef())};this.joinPush.destroy();let a=null;return new Promise(o=>{a=new un(this,tr.leave,{},t),a.receive("ok",()=>{r(),o("ok")}).receive("timeout",()=>{r(),o("timed out")}).receive("error",()=>{o("error")}),a.send(),this._canPush()||a.trigger("ok",{})}).finally(()=>{a?.destroy()})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=We.closed,this.bindings={}}async _fetchWithTimeout(t,r,a){let o=new AbortController,n=setTimeout(()=>o.abort(),a),s=await this.socket.fetch(t,Object.assign(Object.assign({},r),{signal:o.signal}));return clearTimeout(n),s}_push(t,r,a=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let o=new un(this,t,r,a);return this._canPush()?o.send():this._addToPushBuffer(o),o}_addToPushBuffer(t){if(t.startTimeout(),this.pushBuffer.push(t),this.pushBuffer.length>OL){let r=this.pushBuffer.shift();r&&(r.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${r.event}`,r.payload))}}_onMessage(t,r,a){return r}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,r,a){var o,n;let s=t.toLocaleLowerCase(),{close:i,error:l,leave:u,join:c}=tr;if(a&&[i,l,u,c].indexOf(s)>=0&&a!==this._joinRef())return;let f=this._onMessage(s,r,a);if(r&&!f)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(s)?(o=this.bindings.postgres_changes)===null||o===void 0||o.filter(p=>{var v,x,C;return((v=p.filter)===null||v===void 0?void 0:v.event)==="*"||((C=(x=p.filter)===null||x===void 0?void 0:x.event)===null||C===void 0?void 0:C.toLocaleLowerCase())===s}).map(p=>p.callback(f,a)):(n=this.bindings[s])===null||n===void 0||n.filter(p=>{var v,x,C,g,m,y,b,L;if(["broadcast","presence","postgres_changes"].includes(s))if("id"in p){let k=p.id,_=(v=p.filter)===null||v===void 0?void 0:v.event;return k&&((x=r.ids)===null||x===void 0?void 0:x.includes(k))&&(_==="*"||_?.toLocaleLowerCase()===((C=r.data)===null||C===void 0?void 0:C.type.toLocaleLowerCase()))&&(!(!((g=p.filter)===null||g===void 0)&&g.table)||p.filter.table===((m=r.data)===null||m===void 0?void 0:m.table))}else{let k=(b=(y=p?.filter)===null||y===void 0?void 0:y.event)===null||b===void 0?void 0:b.toLocaleLowerCase();return k==="*"||k===((L=r?.event)===null||L===void 0?void 0:L.toLocaleLowerCase())}else return p.type.toLocaleLowerCase()===s}).map(p=>{if(typeof f=="object"&&"ids"in f){let v=f.data,{schema:x,table:C,commit_timestamp:g,type:m,errors:y}=v;f=Object.assign(Object.assign({},{schema:x,table:C,commit_timestamp:g,eventType:m,new:{},old:{},errors:y}),this._getPayloadRecords(v))}p.callback(f,a)})}_isClosed(){return this.state===We.closed}_isJoined(){return this.state===We.joined}_isJoining(){return this.state===We.joining}_isLeaving(){return this.state===We.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,r,a){let o=t.toLocaleLowerCase(),n={type:o,filter:r,callback:a};return this.bindings[o]?this.bindings[o].push(n):this.bindings[o]=[n],this}_off(t,r){let a=t.toLocaleLowerCase();return this.bindings[a]&&(this.bindings[a]=this.bindings[a].filter(o=>{var n;return!(((n=o.type)===null||n===void 0?void 0:n.toLocaleLowerCase())===a&&e.isEqual(o.filter,r))})),this}static isEqual(t,r){if(Object.keys(t).length!==Object.keys(r).length)return!1;for(let a in t)if(t[a]!==r[a])return!1;return!0}static isFilterValueEqual(t,r){return(t??void 0)===(r??void 0)}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(tr.close,{},t)}_onError(t){this._on(tr.error,{},r=>t(r))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=We.joining,this.joinPush.resend(t))}_getPayloadRecords(t){let r={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(r.new=Ug(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(r.old=Ug(t.columns,t.old_record)),r}};var qg=()=>{},Pf={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},G1=[1e3,2e3,5e3,1e4],K1=1e4,X1=`
|
|
24
|
-
addEventListener("message", (e) => {
|
|
25
|
-
if (e.data.event === "start") {
|
|
26
|
-
setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
|
|
27
|
-
}
|
|
28
|
-
});`,ci=class{constructor(t,r){var a;if(this.accessTokenValue=null,this.apiKey=null,this._manuallySetToken=!1,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=Ql,this.transport=null,this.heartbeatIntervalMs=Pf.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=qg,this.ref=0,this.reconnectTimer=null,this.vsn=Bg,this.logger=qg,this.conn=null,this.sendBuffer=[],this.serializer=new Yl,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._heartbeatSentAt=null,this._resolveFetch=o=>o?(...n)=>o(...n):(...n)=>fetch(...n),!(!((a=r?.params)===null||a===void 0)&&a.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey,this.endPoint=`${t}/${If.websocket}`,this.httpEndpoint=kf(t),this._initializeOptions(r),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(r?.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=Mg.createWebSocket(this.endpointURL())}catch(t){this._setConnectionState("disconnected");let r=t.message;throw r.includes("Node.js")?new Error(`${r}
|
|
29
|
-
|
|
30
|
-
To use Realtime in Node.js, you need to provide a WebSocket implementation:
|
|
31
|
-
|
|
32
|
-
Option 1: Use Node.js 22+ which has native WebSocket support
|
|
33
|
-
Option 2: Install and provide the "ws" package:
|
|
34
|
-
|
|
35
|
-
npm install ws
|
|
36
|
-
|
|
37
|
-
import ws from "ws"
|
|
38
|
-
const client = new RealtimeClient(url, {
|
|
39
|
-
...options,
|
|
40
|
-
transport: ws
|
|
41
|
-
})`):new Error(`WebSocket not available: ${r}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(t,r){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){let a=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(a),this._setConnectionState("disconnected")},typeof this.conn.close=="function"&&(t?this.conn.close(t,r??""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(t){let r=await t.unsubscribe();return this.channels.length===0&&this.disconnect(),r}async removeAllChannels(){let t=await Promise.all(this.channels.map(r=>r.unsubscribe()));return this.channels=[],this.disconnect(),t}log(t,r,a){this.logger(t,r,a)}connectionState(){switch(this.conn&&this.conn.readyState){case Ia.connecting:return wo.Connecting;case Ia.open:return wo.Open;case Ia.closing:return wo.Closing;default:return wo.Closed}}isConnected(){return this.connectionState()===wo.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(t,r={config:{}}){let a=`realtime:${t}`,o=this.getChannels().find(n=>n.topic===a);if(o)return o;{let n=new ui(`realtime:${t}`,r,this);return this.channels.push(n),n}}push(t){let{topic:r,event:a,payload:o,ref:n}=t,s=()=>{this.encode(t,i=>{var l;(l=this.conn)===null||l===void 0||l.send(i)})};this.log("push",`${r} ${a} (${n})`,o),this.isConnected()?s():this.sendBuffer.push(s)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){var t;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(r){this.log("error","error in heartbeat callback",r)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this._heartbeatSentAt=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(r){this.log("error","error in heartbeat callback",r)}this._wasManualDisconnect=!1,(t=this.conn)===null||t===void 0||t.close(ML,"heartbeat timeout"),setTimeout(()=>{var r;this.isConnected()||(r=this.reconnectTimer)===null||r===void 0||r.scheduleTimeout()},Pf.HEARTBEAT_TIMEOUT_FALLBACK);return}this._heartbeatSentAt=Date.now(),this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(r){this.log("error","error in heartbeat callback",r)}this._setAuthSafely("heartbeat")}onHeartbeat(t){this.heartbeatCallback=t}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}_makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}_leaveOpenTopic(t){let r=this.channels.find(a=>a.topic===t&&(a._isJoined()||a._isJoining()));r&&(this.log("transport",`leaving duplicate topic "${t}"`),r.unsubscribe())}_remove(t){this.channels=this.channels.filter(r=>r.topic!==t.topic)}_onConnMessage(t){this.decode(t.data,r=>{if(r.topic==="phoenix"&&r.event==="phx_reply"&&r.ref&&r.ref===this.pendingHeartbeatRef){let u=this._heartbeatSentAt?Date.now()-this._heartbeatSentAt:void 0;try{this.heartbeatCallback(r.payload.status==="ok"?"ok":"error",u)}catch(c){this.log("error","error in heartbeat callback",c)}this._heartbeatSentAt=null,this.pendingHeartbeatRef=null}let{topic:a,event:o,payload:n,ref:s}=r,i=s?`(${s})`:"",l=n.status||"";this.log("receive",`${l} ${a} ${o} ${i}`.trim(),n),this.channels.filter(u=>u._isMember(a)).forEach(u=>u._trigger(o,n,s)),this._triggerStateCallbacks("message",r)})}_clearTimer(t){var r;t==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):t==="reconnect"&&((r=this.reconnectTimer)===null||r===void 0||r.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=t=>this._onConnError(t),this.conn.onmessage=t=>this._onConnMessage(t),this.conn.onclose=t=>this._onConnClose(t),this.conn.readyState===Ia.open&&this._onConnOpen())}_teardownConnection(){if(this.conn){if(this.conn.readyState===Ia.open||this.conn.readyState===Ia.connecting)try{this.conn.close()}catch(t){this.log("error","Error closing connection",t)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this._terminateWorker(),this.channels.forEach(t=>t.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.flushSendBuffer()}).catch(r=>{this.log("error","error waiting for auth on connect",r),this.flushSendBuffer()}),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");let t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this._terminateWorker()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_onConnClose(t){var r;this._setConnectionState("disconnected"),this.log("transport","close",t),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(r=this.reconnectTimer)===null||r===void 0||r.scheduleTimeout(),this._triggerStateCallbacks("close",t)}_onConnError(t){this._setConnectionState("disconnected"),this.log("transport",`${t}`),this._triggerChanError(),this._triggerStateCallbacks("error",t)}_triggerChanError(){this.channels.forEach(t=>t._trigger(tr.error))}_appendParams(t,r){if(Object.keys(r).length===0)return t;let a=t.match(/\?/)?"&":"?",o=new URLSearchParams(r);return`${t}${a}${o}`}_workerObjectUrl(t){let r;if(t)r=t;else{let a=new Blob([X1],{type:"application/javascript"});r=URL.createObjectURL(a)}return r}_setConnectionState(t,r=!1){this._connectionState=t,t==="connecting"?this._wasManualDisconnect=!1:t==="disconnecting"&&(this._wasManualDisconnect=r)}async _performAuth(t=null){let r,a=!1;if(t)r=t,a=!0;else if(this.accessToken)try{r=await this.accessToken()}catch(o){this.log("error","Error fetching access token from callback",o),r=this.accessTokenValue}else r=this.accessTokenValue;a?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(o=>{let n={access_token:r,version:DL};r&&o.updateJoinPayload(n),o.joinedOnce&&o._isJoined()&&o._push(tr.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(r=>{this.log("error",`Error setting auth in ${t}`,r)})}_triggerStateCallbacks(t,r){try{this.stateChangeCallbacks[t].forEach(a=>{try{a(r)}catch(o){this.log("error",`error in ${t} callback`,o)}})}catch(a){this.log("error",`error triggering ${t} callbacks`,a)}}_setupReconnectionTimer(){this.reconnectTimer=new ln(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},Pf.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(t){var r,a,o,n,s,i,l,u,c,d,f,p;switch(this.transport=(r=t?.transport)!==null&&r!==void 0?r:null,this.timeout=(a=t?.timeout)!==null&&a!==void 0?a:Ql,this.heartbeatIntervalMs=(o=t?.heartbeatIntervalMs)!==null&&o!==void 0?o:Pf.HEARTBEAT_INTERVAL,this.worker=(n=t?.worker)!==null&&n!==void 0?n:!1,this.accessToken=(s=t?.accessToken)!==null&&s!==void 0?s:null,this.heartbeatCallback=(i=t?.heartbeatCallback)!==null&&i!==void 0?i:qg,this.vsn=(l=t?.vsn)!==null&&l!==void 0?l:Bg,t?.params&&(this.params=t.params),t?.logger&&(this.logger=t.logger),(t?.logLevel||t?.log_level)&&(this.logLevel=t.logLevel||t.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(u=t?.reconnectAfterMs)!==null&&u!==void 0?u:(v=>G1[v-1]||K1),this.vsn){case Og:this.encode=(c=t?.encode)!==null&&c!==void 0?c:((v,x)=>x(JSON.stringify(v))),this.decode=(d=t?.decode)!==null&&d!==void 0?d:((v,x)=>x(JSON.parse(v)));break;case NL:this.encode=(f=t?.encode)!==null&&f!==void 0?f:this.serializer.encode.bind(this.serializer),this.decode=(p=t?.decode)!==null&&p!==void 0?p:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t?.workerUrl}}};var Zl=class extends Error{constructor(e,t){super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&t.icebergType?.includes("CommitState")===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function J1(e,t,r){let a=new URL(t,e);if(r)for(let[o,n]of Object.entries(r))n!==void 0&&a.searchParams.set(o,n);return a.toString()}async function Q1(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function Y1(e){let t=e.fetchImpl??globalThis.fetch;return{async request({method:r,path:a,query:o,body:n,headers:s}){let i=J1(e.baseUrl,a,o),l=await Q1(e.auth),u=await t(i,{method:r,headers:{...n?{"Content-Type":"application/json"}:{},...l,...s},body:n?JSON.stringify(n):void 0}),c=await u.text(),d=(u.headers.get("content-type")||"").includes("application/json"),f=d&&c?JSON.parse(c):c;if(!u.ok){let p=d?f:void 0,v=p?.error;throw new Zl(v?.message??`Request failed with status ${u.status}`,{status:u.status,icebergType:v?.type,icebergCode:v?.code,details:p})}return{status:u.status,headers:u.headers,data:f}}}}function Tf(e){return e.join("")}var Z1=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){let t=e?{parent:Tf(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(a=>({namespace:a}))}async createNamespace(e,t){let r={namespace:e.namespace,properties:t?.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Tf(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Tf(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Tf(e.namespace)}`}),!0}catch(t){if(t instanceof Zl&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(r){if(r instanceof Zl&&r.status===409)return;throw r}}};function di(e){return e.join("")}var eE=class{constructor(e,t="",r){this.client=e,this.prefix=t,this.accessDelegation=r}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${di(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){let r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${di(e.namespace)}/tables`,body:t,headers:r})).data.metadata}async updateTable(e,t){let r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${di(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${di(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String(t?.purge??!1)}})}async loadTable(e){let t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${di(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){let t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${di(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(r){if(r instanceof Zl&&r.status===404)return!1;throw r}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(r){if(r instanceof Zl&&r.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw r}}},FL=class{constructor(e){let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);let r=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=Y1({baseUrl:r,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=e.accessDelegation?.join(","),this.namespaceOps=new Z1(this.client,t),this.tableOps=new eE(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}};var _f=class extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}};function Ne(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var tE=class extends _f{constructor(e,t,r){super(e),this.name="StorageApiError",this.status=t,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},$g=class extends _f{constructor(e,t){super(e),this.name="StorageUnknownError",this.originalError=t}},Kg=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),rE=()=>Response,Wg=e=>{if(Array.isArray(e))return e.map(r=>Wg(r));if(typeof e=="function"||e!==Object(e))return e;let t={};return Object.entries(e).forEach(([r,a])=>{let o=r.replace(/([-_][a-z])/gi,n=>n.toUpperCase().replace(/[-_]/g,""));t[o]=Wg(a)}),t},aE=e=>{if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},oE=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e);function eu(e){"@babel/helpers - typeof";return eu=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},eu(e)}function nE(e,t){if(eu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t||"default");if(eu(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sE(e){var t=nE(e,"string");return eu(t)=="symbol"?t:t+""}function iE(e,t,r){return(t=sE(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function UL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,a)}return r}function X(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?UL(Object(r),!0).forEach(function(a){iE(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):UL(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}var Hg=e=>{var t;return e.msg||e.message||e.error_description||(typeof e.error=="string"?e.error:(t=e.error)===null||t===void 0?void 0:t.message)||JSON.stringify(e)},lE=async(e,t,r)=>{e instanceof await rE()&&!r?.noResolveJson?e.json().then(a=>{let o=e.status||500,n=a?.statusCode||o+"";t(new tE(Hg(a),o,n))}).catch(a=>{t(new $g(Hg(a),a))}):t(new $g(Hg(e),e))},uE=(e,t,r,a)=>{let o={method:e,headers:t?.headers||{}};return e==="GET"||!a?o:(aE(a)?(o.headers=X({"Content-Type":"application/json"},t?.headers),o.body=JSON.stringify(a)):o.body=a,t?.duplex&&(o.duplex=t.duplex),X(X({},o),r))};async function ru(e,t,r,a,o,n){return new Promise((s,i)=>{e(r,uE(t,a,o,n)).then(l=>{if(!l.ok)throw l;return a?.noResolveJson?l:l.json()}).then(l=>s(l)).catch(l=>lE(l,i,a))})}async function tu(e,t,r,a){return ru(e,"GET",t,r,a)}async function _r(e,t,r,a,o){return ru(e,"POST",t,a,o,r)}async function Gg(e,t,r,a,o){return ru(e,"PUT",t,a,o,r)}async function cE(e,t,r,a){return ru(e,"HEAD",t,X(X({},r),{},{noResolveJson:!0}),a)}async function Xg(e,t,r,a,o){return ru(e,"DELETE",t,a,o,r)}var dE=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t}then(e,t){return this.execute().then(e,t)}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(Ne(t))return{data:null,error:t};throw t}}},qL;qL=Symbol.toStringTag;var fE=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[qL]="BlobDownloadBuilder",this.promise=null}asStream(){return new dE(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(Ne(t))return{data:null,error:t};throw t}}},pE={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},VL={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},hE=class{constructor(e,t={},r,a){this.shouldThrowOnError=!1,this.url=e,this.headers=t,this.bucketId=r,this.fetch=Kg(a)}throwOnError(){return this.shouldThrowOnError=!0,this}async uploadOrUpdate(e,t,r,a){var o=this;try{let n,s=X(X({},VL),a),i=X(X({},o.headers),e==="POST"&&{"x-upsert":String(s.upsert)}),l=s.metadata;typeof Blob<"u"&&r instanceof Blob?(n=new FormData,n.append("cacheControl",s.cacheControl),l&&n.append("metadata",o.encodeMetadata(l)),n.append("",r)):typeof FormData<"u"&&r instanceof FormData?(n=r,n.has("cacheControl")||n.append("cacheControl",s.cacheControl),l&&!n.has("metadata")&&n.append("metadata",o.encodeMetadata(l))):(n=r,i["cache-control"]=`max-age=${s.cacheControl}`,i["content-type"]=s.contentType,l&&(i["x-metadata"]=o.toBase64(o.encodeMetadata(l))),(typeof ReadableStream<"u"&&n instanceof ReadableStream||n&&typeof n=="object"&&"pipe"in n&&typeof n.pipe=="function")&&!s.duplex&&(s.duplex="half")),a?.headers&&(i=X(X({},i),a.headers));let u=o._removeEmptyFolders(t),c=o._getFinalPath(u),d=await(e=="PUT"?Gg:_r)(o.fetch,`${o.url}/object/${c}`,n,X({headers:i},s?.duplex?{duplex:s.duplex}:{}));return{data:{path:u,id:d.Id,fullPath:d.Key},error:null}}catch(n){if(o.shouldThrowOnError)throw n;if(Ne(n))return{data:null,error:n};throw n}}async upload(e,t,r){return this.uploadOrUpdate("POST",e,t,r)}async uploadToSignedUrl(e,t,r,a){var o=this;let n=o._removeEmptyFolders(e),s=o._getFinalPath(n),i=new URL(o.url+`/object/upload/sign/${s}`);i.searchParams.set("token",t);try{let l,u=X({upsert:VL.upsert},a),c=X(X({},o.headers),{"x-upsert":String(u.upsert)});return typeof Blob<"u"&&r instanceof Blob?(l=new FormData,l.append("cacheControl",u.cacheControl),l.append("",r)):typeof FormData<"u"&&r instanceof FormData?(l=r,l.append("cacheControl",u.cacheControl)):(l=r,c["cache-control"]=`max-age=${u.cacheControl}`,c["content-type"]=u.contentType),{data:{path:n,fullPath:(await Gg(o.fetch,i.toString(),l,{headers:c})).Key},error:null}}catch(l){if(o.shouldThrowOnError)throw l;if(Ne(l))return{data:null,error:l};throw l}}async createSignedUploadUrl(e,t){var r=this;try{let a=r._getFinalPath(e),o=X({},r.headers);t?.upsert&&(o["x-upsert"]="true");let n=await _r(r.fetch,`${r.url}/object/upload/sign/${a}`,{},{headers:o}),s=new URL(r.url+n.url),i=s.searchParams.get("token");if(!i)throw new _f("No token returned by API");return{data:{signedUrl:s.toString(),path:e,token:i},error:null}}catch(a){if(r.shouldThrowOnError)throw a;if(Ne(a))return{data:null,error:a};throw a}}async update(e,t,r){return this.uploadOrUpdate("PUT",e,t,r)}async move(e,t,r){var a=this;try{return{data:await _r(a.fetch,`${a.url}/object/move`,{bucketId:a.bucketId,sourceKey:e,destinationKey:t,destinationBucket:r?.destinationBucket},{headers:a.headers}),error:null}}catch(o){if(a.shouldThrowOnError)throw o;if(Ne(o))return{data:null,error:o};throw o}}async copy(e,t,r){var a=this;try{return{data:{path:(await _r(a.fetch,`${a.url}/object/copy`,{bucketId:a.bucketId,sourceKey:e,destinationKey:t,destinationBucket:r?.destinationBucket},{headers:a.headers})).Key},error:null}}catch(o){if(a.shouldThrowOnError)throw o;if(Ne(o))return{data:null,error:o};throw o}}async createSignedUrl(e,t,r){var a=this;try{let o=a._getFinalPath(e),n=await _r(a.fetch,`${a.url}/object/sign/${o}`,X({expiresIn:t},r?.transform?{transform:r.transform}:{}),{headers:a.headers}),s=r?.download?`&download=${r.download===!0?"":r.download}`:"";return n={signedUrl:encodeURI(`${a.url}${n.signedURL}${s}`)},{data:n,error:null}}catch(o){if(a.shouldThrowOnError)throw o;if(Ne(o))return{data:null,error:o};throw o}}async createSignedUrls(e,t,r){var a=this;try{let o=await _r(a.fetch,`${a.url}/object/sign/${a.bucketId}`,{expiresIn:t,paths:e},{headers:a.headers}),n=r?.download?`&download=${r.download===!0?"":r.download}`:"";return{data:o.map(s=>X(X({},s),{},{signedUrl:s.signedURL?encodeURI(`${a.url}${s.signedURL}${n}`):null})),error:null}}catch(o){if(a.shouldThrowOnError)throw o;if(Ne(o))return{data:null,error:o};throw o}}download(e,t){let r=typeof t?.transform<"u"?"render/image/authenticated":"object",a=this.transformOptsToQueryString(t?.transform||{}),o=a?`?${a}`:"",n=this._getFinalPath(e),s=()=>tu(this.fetch,`${this.url}/${r}/${n}${o}`,{headers:this.headers,noResolveJson:!0});return new fE(s,this.shouldThrowOnError)}async info(e){var t=this;let r=t._getFinalPath(e);try{return{data:Wg(await tu(t.fetch,`${t.url}/object/info/${r}`,{headers:t.headers})),error:null}}catch(a){if(t.shouldThrowOnError)throw a;if(Ne(a))return{data:null,error:a};throw a}}async exists(e){var t=this;let r=t._getFinalPath(e);try{return await cE(t.fetch,`${t.url}/object/${r}`,{headers:t.headers}),{data:!0,error:null}}catch(a){if(t.shouldThrowOnError)throw a;if(Ne(a)&&a instanceof $g){let o=a.originalError;if([400,404].includes(o?.status))return{data:!1,error:a}}throw a}}getPublicUrl(e,t){let r=this._getFinalPath(e),a=[],o=t?.download?`download=${t.download===!0?"":t.download}`:"";o!==""&&a.push(o);let n=typeof t?.transform<"u"?"render/image":"object",s=this.transformOptsToQueryString(t?.transform||{});s!==""&&a.push(s);let i=a.join("&");return i!==""&&(i=`?${i}`),{data:{publicUrl:encodeURI(`${this.url}/${n}/public/${r}${i}`)}}}async remove(e){var t=this;try{return{data:await Xg(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Ne(r))return{data:null,error:r};throw r}}async list(e,t,r){var a=this;try{let o=X(X(X({},pE),t),{},{prefix:e||""});return{data:await _r(a.fetch,`${a.url}/object/list/${a.bucketId}`,o,{headers:a.headers},r),error:null}}catch(o){if(a.shouldThrowOnError)throw o;if(Ne(o))return{data:null,error:o};throw o}}async listV2(e,t){var r=this;try{let a=X({},e);return{data:await _r(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,a,{headers:r.headers},t),error:null}}catch(a){if(r.shouldThrowOnError)throw a;if(Ne(a))return{data:null,error:a};throw a}}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){let t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}},HL="2.90.1",zL={"X-Client-Info":`storage-js/${HL}`},mE=class{constructor(e,t={},r,a){this.shouldThrowOnError=!1;let o=new URL(e);a?.useNewHostname&&/supabase\.(co|in|red)$/.test(o.hostname)&&!o.hostname.includes("storage.supabase.")&&(o.hostname=o.hostname.replace("supabase.","storage.supabase.")),this.url=o.href.replace(/\/$/,""),this.headers=X(X({},zL),t),this.fetch=Kg(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async listBuckets(e){var t=this;try{let r=t.listBucketOptionsToQueryString(e);return{data:await tu(t.fetch,`${t.url}/bucket${r}`,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Ne(r))return{data:null,error:r};throw r}}async getBucket(e){var t=this;try{return{data:await tu(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Ne(r))return{data:null,error:r};throw r}}async createBucket(e,t={public:!1}){var r=this;try{return{data:await _r(r.fetch,`${r.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}),error:null}}catch(a){if(r.shouldThrowOnError)throw a;if(Ne(a))return{data:null,error:a};throw a}}async updateBucket(e,t){var r=this;try{return{data:await Gg(r.fetch,`${r.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}),error:null}}catch(a){if(r.shouldThrowOnError)throw a;if(Ne(a))return{data:null,error:a};throw a}}async emptyBucket(e){var t=this;try{return{data:await _r(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Ne(r))return{data:null,error:r};throw r}}async deleteBucket(e){var t=this;try{return{data:await Xg(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Ne(r))return{data:null,error:r};throw r}}listBucketOptionsToQueryString(e){let t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},gE=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=X(X({},zL),t),this.fetch=Kg(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async createBucket(e){var t=this;try{return{data:await _r(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Ne(r))return{data:null,error:r};throw r}}async listBuckets(e){var t=this;try{let r=new URLSearchParams;e?.limit!==void 0&&r.set("limit",e.limit.toString()),e?.offset!==void 0&&r.set("offset",e.offset.toString()),e?.sortColumn&&r.set("sortColumn",e.sortColumn),e?.sortOrder&&r.set("sortOrder",e.sortOrder),e?.search&&r.set("search",e.search);let a=r.toString(),o=a?`${t.url}/bucket?${a}`:`${t.url}/bucket`;return{data:await tu(t.fetch,o,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Ne(r))return{data:null,error:r};throw r}}async deleteBucket(e){var t=this;try{return{data:await Xg(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Ne(r))return{data:null,error:r};throw r}}from(e){var t=this;if(!oE(e))throw new _f("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");let r=new FL({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),a=this.shouldThrowOnError;return new Proxy(r,{get(o,n){let s=o[n];return typeof s!="function"?s:async(...i)=>{try{return{data:await s.apply(o,i),error:null}}catch(l){if(a)throw l;return{data:null,error:l}}}}})}},Jg={"X-Client-Info":`storage-js/${HL}`,"Content-Type":"application/json"},$L=class extends Error{constructor(e){super(e),this.__isStorageVectorsError=!0,this.name="StorageVectorsError"}};function rr(e){return typeof e=="object"&&e!==null&&"__isStorageVectorsError"in e}var zg=class extends $L{constructor(e,t,r){super(e),this.name="StorageVectorsApiError",this.status=t,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},yE=class extends $L{constructor(e,t){super(e),this.name="StorageVectorsUnknownError",this.originalError=t}};var Qg=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);var vE=e=>{if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)};var jL=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),xE=async(e,t,r)=>{if(e&&typeof e=="object"&&"status"in e&&"ok"in e&&typeof e.status=="number"&&!r?.noResolveJson){let a=e.status||500,o=e;if(typeof o.json=="function")o.json().then(n=>{let s=n?.statusCode||n?.code||a+"";t(new zg(jL(n),a,s))}).catch(()=>{let n=a+"";t(new zg(o.statusText||`HTTP ${a} error`,a,n))});else{let n=a+"";t(new zg(o.statusText||`HTTP ${a} error`,a,n))}}else t(new yE(jL(e),e))},wE=(e,t,r,a)=>{let o={method:e,headers:t?.headers||{}};return e==="GET"||!a?o:(vE(a)?(o.headers=X({"Content-Type":"application/json"},t?.headers),o.body=JSON.stringify(a)):o.body=a,X(X({},o),r))};async function SE(e,t,r,a,o,n){return new Promise((s,i)=>{e(r,wE(t,a,o,n)).then(l=>{if(!l.ok)throw l;if(a?.noResolveJson)return l;let u=l.headers.get("content-type");return!u||!u.includes("application/json")?{}:l.json()}).then(l=>s(l)).catch(l=>xE(l,i,a))})}async function ar(e,t,r,a,o){return SE(e,"POST",t,a,o,r)}var CE=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=X(X({},Jg),t),this.fetch=Qg(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async createIndex(e){var t=this;try{return{data:await ar(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(rr(r))return{data:null,error:r};throw r}}async getIndex(e,t){var r=this;try{return{data:await ar(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers}),error:null}}catch(a){if(r.shouldThrowOnError)throw a;if(rr(a))return{data:null,error:a};throw a}}async listIndexes(e){var t=this;try{return{data:await ar(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(rr(r))return{data:null,error:r};throw r}}async deleteIndex(e,t){var r=this;try{return{data:await ar(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers})||{},error:null}}catch(a){if(r.shouldThrowOnError)throw a;if(rr(a))return{data:null,error:a};throw a}}},bE=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=X(X({},Jg),t),this.fetch=Qg(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async putVectors(e){var t=this;try{if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return{data:await ar(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(rr(r))return{data:null,error:r};throw r}}async getVectors(e){var t=this;try{return{data:await ar(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(rr(r))return{data:null,error:r};throw r}}async listVectors(e){var t=this;try{if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return{data:await ar(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(rr(r))return{data:null,error:r};throw r}}async queryVectors(e){var t=this;try{return{data:await ar(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(rr(r))return{data:null,error:r};throw r}}async deleteVectors(e){var t=this;try{if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return{data:await ar(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(rr(r))return{data:null,error:r};throw r}}},LE=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=X(X({},Jg),t),this.fetch=Qg(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async createBucket(e){var t=this;try{return{data:await ar(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(rr(r))return{data:null,error:r};throw r}}async getBucket(e){var t=this;try{return{data:await ar(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(rr(r))return{data:null,error:r};throw r}}async listBuckets(e={}){var t=this;try{return{data:await ar(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(rr(r))return{data:null,error:r};throw r}}async deleteBucket(e){var t=this;try{return{data:await ar(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(rr(r))return{data:null,error:r};throw r}}},IE=class extends LE{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new kE(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,r=this;return t().call(r,e)}async getBucket(e){var t=()=>super.getBucket,r=this;return t().call(r,e)}async listBuckets(e={}){var t=()=>super.listBuckets,r=this;return t().call(r,e)}async deleteBucket(e){var t=()=>super.deleteBucket,r=this;return t().call(r,e)}},kE=class extends CE{constructor(e,t,r,a){super(e,t,a),this.vectorBucketName=r}async createIndex(e){var t=()=>super.createIndex,r=this;return t().call(r,X(X({},e),{},{vectorBucketName:r.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,r=this;return t().call(r,X(X({},e),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,r=this;return t().call(r,r.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,r=this;return t().call(r,r.vectorBucketName,e)}index(e){return new PE(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},PE=class extends bE{constructor(e,t,r,a,o){super(e,t,o),this.vectorBucketName=r,this.indexName=a}async putVectors(e){var t=()=>super.putVectors,r=this;return t().call(r,X(X({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(e){var t=()=>super.getVectors,r=this;return t().call(r,X(X({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,r=this;return t().call(r,X(X({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,r=this;return t().call(r,X(X({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,r=this;return t().call(r,X(X({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},WL=class extends mE{constructor(e,t={},r,a){super(e,t,r,a)}from(e){return new hE(this.url,this.headers,e,this.fetch)}get vectors(){return new IE(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new gE(this.url+"/iceberg",this.headers,this.fetch)}};var Af="2.90.1";var cn=30*1e3,Rf=3,Ef=Rf*cn,GL="http://localhost:9999",KL="supabase.auth.token";var XL={"X-Client-Info":`gotrue-js/${Af}`};var au="X-Supabase-Api-Version",Yg={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},JL=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,QL=600*1e3;var So=class extends Error{constructor(t,r,a){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=a}};function j(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}var Df=class extends So{constructor(t,r,a){super(t,r,a),this.name="AuthApiError",this.status=r,this.code=a}};function YL(e){return j(e)&&e.name==="AuthApiError"}var hr=class extends So{constructor(t,r){super(t),this.name="AuthUnknownError",this.originalError=r}},Ar=class extends So{constructor(t,r,a,o){super(t,a,o),this.name=r,this.status=a}},dt=class extends Ar{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};function ZL(e){return j(e)&&e.name==="AuthSessionMissingError"}var ka=class extends Ar{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}},dn=class extends Ar{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}},fn=class extends Ar{constructor(t,r=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}};function eI(e){return j(e)&&e.name==="AuthImplicitGrantRedirectError"}var ou=class extends Ar{constructor(t,r=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}},Nf=class extends Ar{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}};var fi=class extends Ar{constructor(t,r){super(t,"AuthRetryableFetchError",r,void 0)}};function Mf(e){return j(e)&&e.name==="AuthRetryableFetchError"}var nu=class extends Ar{constructor(t,r,a){super(t,"AuthWeakPasswordError",r,"weak_password"),this.reasons=a}};var pn=class extends Ar{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}};var Of="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),tI=`
|
|
42
|
-
\r=`.split(""),TE=(()=>{let e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<tI.length;t+=1)e[tI[t].charCodeAt(0)]=-2;for(let t=0;t<Of.length;t+=1)e[Of[t].charCodeAt(0)]=t;return e})();function rI(e,t,r){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){let a=t.queue>>t.queuedBits-6&63;r(Of[a]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){let a=t.queue>>t.queuedBits-6&63;r(Of[a]),t.queuedBits-=6}}function aI(e,t,r){let a=TE[e];if(a>-1)for(t.queue=t.queue<<6|a,t.queuedBits+=6;t.queuedBits>=8;)r(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(a===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function Zg(e){let t=[],r=s=>{t.push(String.fromCodePoint(s))},a={utf8seq:0,codepoint:0},o={queue:0,queuedBits:0},n=s=>{RE(s,a,r)};for(let s=0;s<e.length;s+=1)aI(e.charCodeAt(s),o,n);return t.join("")}function _E(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function AE(e,t){for(let r=0;r<e.length;r+=1){let a=e.charCodeAt(r);if(a>55295&&a<=56319){let o=(a-55296)*1024&65535;a=(e.charCodeAt(r+1)-56320&65535|o)+65536,r+=1}_E(a,t)}}function RE(e,t,r){if(t.utf8seq===0){if(e<=127){r(e);return}for(let a=1;a<6;a+=1)if((e>>7-a&1)===0){t.utf8seq=a;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&r(t.codepoint)}}function Co(e){let t=[],r={queue:0,queuedBits:0},a=o=>{t.push(o)};for(let o=0;o<e.length;o+=1)aI(e.charCodeAt(o),r,a);return new Uint8Array(t)}function oI(e){let t=[];return AE(e,r=>t.push(r)),new Uint8Array(t)}function Pa(e){let t=[],r={queue:0,queuedBits:0},a=o=>{t.push(o)};return e.forEach(o=>rI(o,r,a)),rI(null,r,a),t.join("")}function nI(e){return Math.round(Date.now()/1e3)+e}function sI(){return Symbol("auth-callback")}var Je=()=>typeof window<"u"&&typeof document<"u",hn={tested:!1,writable:!1},Bf=()=>{if(!Je())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(hn.tested)return hn.writable;let e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),hn.tested=!0,hn.writable=!0}catch{hn.tested=!0,hn.writable=!1}return hn.writable};function iI(e){let t={},r=new URL(e);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((o,n)=>{t[n]=o})}catch{}return r.searchParams.forEach((a,o)=>{t[o]=a}),t}var Ff=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),lI=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",mn=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},bo=async(e,t)=>{let r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch{return r}},at=async(e,t)=>{await e.removeItem(t)},su=class e{constructor(){this.promise=new e.promiseConstructor((t,r)=>{this.resolve=t,this.reject=r})}};su.promiseConstructor=Promise;function Uf(e){let t=e.split(".");if(t.length!==3)throw new pn("Invalid JWT structure");for(let a=0;a<t.length;a++)if(!JL.test(t[a]))throw new pn("JWT not in base64url format");return{header:JSON.parse(Zg(t[0])),payload:JSON.parse(Zg(t[1])),signature:Co(t[2]),raw:{header:t[0],payload:t[1]}}}async function uI(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function cI(e,t){return new Promise((a,o)=>{(async()=>{for(let n=0;n<1/0;n++)try{let s=await e(n);if(!t(n,null,s)){a(s);return}}catch(s){if(!t(n,s)){o(s);return}}})()})}function EE(e){return("0"+e.toString(16)).substr(-2)}function DE(){let t=new Uint32Array(56);if(typeof crypto>"u"){let r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",a=r.length,o="";for(let n=0;n<56;n++)o+=r.charAt(Math.floor(Math.random()*a));return o}return crypto.getRandomValues(t),Array.from(t,EE).join("")}async function NE(e){let r=new TextEncoder().encode(e),a=await crypto.subtle.digest("SHA-256",r),o=new Uint8Array(a);return Array.from(o).map(n=>String.fromCharCode(n)).join("")}async function ME(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;let r=await NE(e);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function gn(e,t,r=!1){let a=DE(),o=a;r&&(o+="/PASSWORD_RECOVERY"),await mn(e,`${t}-code-verifier`,o);let n=await ME(a);return[n,a===n?"plain":"s256"]}var OE=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function dI(e){let t=e.headers.get(au);if(!t||!t.match(OE))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function fI(e){if(!e)throw new Error("Missing exp claim");let t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function pI(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}var BE=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function yn(e){if(!BE.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Vf(){let e={};return new Proxy(e,{get:(t,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){let a=r.toString();if(a==="Symbol(Symbol.toPrimitive)"||a==="Symbol(Symbol.toStringTag)"||a==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function hI(e,t){return new Proxy(e,{get:(r,a,o)=>{if(a==="__isInsecureUserWarningProxy")return!0;if(typeof a=="symbol"){let n=a.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="Symbol(util.inspect.custom)"||n==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,a,o)}return!t.value&&typeof a=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(r,a,o)}})}function ey(e){return JSON.parse(JSON.stringify(e))}var vn=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),FE=[502,503,504];async function mI(e){var t;if(!lI(e))throw new fi(vn(e),0);if(FE.includes(e.status))throw new fi(vn(e),e.status);let r;try{r=await e.json()}catch(n){throw new hr(vn(n),n)}let a,o=dI(e);if(o&&o.getTime()>=Yg["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?a=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(a=r.error_code),a){if(a==="weak_password")throw new nu(vn(r),e.status,((t=r.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(a==="session_not_found")throw new dt}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((n,s)=>n&&typeof s=="string",!0))throw new nu(vn(r),e.status,r.weak_password.reasons);throw new Df(vn(r),e.status||500,a)}var UE=(e,t,r,a)=>{let o={method:e,headers:t?.headers||{}};return e==="GET"?o:(o.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t?.headers),o.body=JSON.stringify(a),Object.assign(Object.assign({},o),r))};async function K(e,t,r,a){var o;let n=Object.assign({},a?.headers);n[au]||(n[au]=Yg["2024-01-01"].name),a?.jwt&&(n.Authorization=`Bearer ${a.jwt}`);let s=(o=a?.query)!==null&&o!==void 0?o:{};a?.redirectTo&&(s.redirect_to=a.redirectTo);let i=Object.keys(s).length?"?"+new URLSearchParams(s).toString():"",l=await VE(e,t,r+i,{headers:n,noResolveJson:a?.noResolveJson},{},a?.body);return a?.xform?a?.xform(l):{data:Object.assign({},l),error:null}}async function VE(e,t,r,a,o,n){let s=UE(t,a,o,n),i;try{i=await e(r,Object.assign({},s))}catch(l){throw console.error(l),new fi(vn(l),0)}if(i.ok||await mI(i),a?.noResolveJson)return i;try{return await i.json()}catch(l){await mI(l)}}function mr(e){var t;let r=null;jE(e)&&(r=Object.assign({},e),e.expires_at||(r.expires_at=nI(e.expires_in)));let a=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:r,user:a},error:null}}function ty(e){let t=mr(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((r,a)=>r&&typeof a=="string",!0)&&(t.data.weak_password=e.weak_password),t}function Kr(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function gI(e){return{data:e,error:null}}function yI(e){let{action_link:t,email_otp:r,hashed_token:a,redirect_to:o,verification_type:n}=e,s=sn(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),i={action_link:t,email_otp:r,hashed_token:a,redirect_to:o,verification_type:n},l=Object.assign({},s);return{data:{properties:i,user:l},error:null}}function ry(e){return e}function jE(e){return e.access_token&&e.refresh_token&&e.expires_in}var jf=["global","local","others"];var xn=class{constructor({url:t="",headers:r={},fetch:a}){this.url=t,this.headers=r,this.fetch=Ff(a),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)}}async signOut(t,r=jf[0]){if(jf.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${jf.join(", ")}`);try{return await K(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(a){if(j(a))return{data:null,error:a};throw a}}async inviteUserByEmail(t,r={}){try{return await K(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:Kr})}catch(a){if(j(a))return{data:{user:null},error:a};throw a}}async generateLink(t){try{let{options:r}=t,a=sn(t,["options"]),o=Object.assign(Object.assign({},a),r);return"newEmail"in a&&(o.new_email=a?.newEmail,delete o.newEmail),await K(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:o,headers:this.headers,xform:yI,redirectTo:r?.redirectTo})}catch(r){if(j(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(t){try{return await K(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:Kr})}catch(r){if(j(r))return{data:{user:null},error:r};throw r}}async listUsers(t){var r,a,o,n,s,i,l;try{let u={nextPage:null,lastPage:0,total:0},c=await K(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(a=(r=t?.page)===null||r===void 0?void 0:r.toString())!==null&&a!==void 0?a:"",per_page:(n=(o=t?.perPage)===null||o===void 0?void 0:o.toString())!==null&&n!==void 0?n:""},xform:ry});if(c.error)throw c.error;let d=await c.json(),f=(s=c.headers.get("x-total-count"))!==null&&s!==void 0?s:0,p=(l=(i=c.headers.get("link"))===null||i===void 0?void 0:i.split(","))!==null&&l!==void 0?l:[];return p.length>0&&(p.forEach(v=>{let x=parseInt(v.split(";")[0].split("=")[1].substring(0,1)),C=JSON.parse(v.split(";")[1].split("=")[1]);u[`${C}Page`]=x}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},d),u),error:null}}catch(u){if(j(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){yn(t);try{return await K(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:Kr})}catch(r){if(j(r))return{data:{user:null},error:r};throw r}}async updateUserById(t,r){yn(t);try{return await K(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:r,headers:this.headers,xform:Kr})}catch(a){if(j(a))return{data:{user:null},error:a};throw a}}async deleteUser(t,r=!1){yn(t);try{return await K(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:r},xform:Kr})}catch(a){if(j(a))return{data:{user:null},error:a};throw a}}async _listFactors(t){yn(t.userId);try{let{data:r,error:a}=await K(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:o=>({data:{factors:o},error:null})});return{data:r,error:a}}catch(r){if(j(r))return{data:null,error:r};throw r}}async _deleteFactor(t){yn(t.userId),yn(t.id);try{return{data:await K(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(r){if(j(r))return{data:null,error:r};throw r}}async _listOAuthClients(t){var r,a,o,n,s,i,l;try{let u={nextPage:null,lastPage:0,total:0},c=await K(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(a=(r=t?.page)===null||r===void 0?void 0:r.toString())!==null&&a!==void 0?a:"",per_page:(n=(o=t?.perPage)===null||o===void 0?void 0:o.toString())!==null&&n!==void 0?n:""},xform:ry});if(c.error)throw c.error;let d=await c.json(),f=(s=c.headers.get("x-total-count"))!==null&&s!==void 0?s:0,p=(l=(i=c.headers.get("link"))===null||i===void 0?void 0:i.split(","))!==null&&l!==void 0?l:[];return p.length>0&&(p.forEach(v=>{let x=parseInt(v.split(";")[0].split("=")[1].substring(0,1)),C=JSON.parse(v.split(";")[1].split("=")[1]);u[`${C}Page`]=x}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},d),u),error:null}}catch(u){if(j(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(t){try{return await K(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(j(r))return{data:null,error:r};throw r}}async _getOAuthClient(t){try{return await K(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(j(r))return{data:null,error:r};throw r}}async _updateOAuthClient(t,r){try{return await K(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:r,headers:this.headers,xform:a=>({data:a,error:null})})}catch(a){if(j(a))return{data:null,error:a};throw a}}async _deleteOAuthClient(t){try{return await K(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(j(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(t){try{return await K(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(j(r))return{data:null,error:r};throw r}}};function ay(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}var wn={debug:!!(globalThis&&Bf()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")},iu=class extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}},qf=class extends iu{};async function oy(e,t,r){wn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);let a=new globalThis.AbortController;return t>0&&setTimeout(()=>{a.abort(),wn.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:a.signal},async o=>{if(o){wn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,o.name);try{return await r()}finally{wn.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,o.name)}}else{if(t===0)throw wn.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new qf(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(wn.debug)try{let n=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(n,null," "))}catch(n){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",n)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await r()}}))}function vI(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function ny(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function xI(e){return parseInt(e,16)}function wI(e){let t=new TextEncoder().encode(e);return"0x"+Array.from(t,a=>a.toString(16).padStart(2,"0")).join("")}function SI(e){var t;let{chainId:r,domain:a,expirationTime:o,issuedAt:n=new Date,nonce:s,notBefore:i,requestId:l,resources:u,scheme:c,uri:d,version:f}=e;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!a)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(s&&s.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${s}`);if(!d)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(f!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${f}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(`
|
|
43
|
-
`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}let p=ny(e.address),v=c?`${c}://${a}`:a,x=e.statement?`${e.statement}
|
|
44
|
-
`:"",C=`${v} wants you to sign in with your Ethereum account:
|
|
45
|
-
${p}
|
|
46
|
-
|
|
47
|
-
${x}`,g=`URI: ${d}
|
|
48
|
-
Version: ${f}
|
|
49
|
-
Chain ID: ${r}${s?`
|
|
50
|
-
Nonce: ${s}`:""}
|
|
51
|
-
Issued At: ${n.toISOString()}`;if(o&&(g+=`
|
|
52
|
-
Expiration Time: ${o.toISOString()}`),i&&(g+=`
|
|
53
|
-
Not Before: ${i.toISOString()}`),l&&(g+=`
|
|
54
|
-
Request ID: ${l}`),u){let m=`
|
|
55
|
-
Resources:`;for(let y of u){if(!y||typeof y!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${y}`);m+=`
|
|
56
|
-
- ${y}`}g+=m}return`${C}
|
|
57
|
-
${g}`}var Me=class extends Error{constructor({message:t,code:r,cause:a,name:o}){var n;super(t,{cause:a}),this.__isWebAuthnError=!0,this.name=(n=o??(a instanceof Error?a.name:void 0))!==null&&n!==void 0?n:"Unknown Error",this.code=r}},Sn=class extends Me{constructor(t,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:t}),this.name="WebAuthnUnknownError",this.originalError=r}};function CI({error:e,options:t}){var r,a,o;let{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Me({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((r=n.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new Me({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((a=n.authenticatorSelection)===null||a===void 0?void 0:a.userVerification)==="required")return new Me({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((o=n.authenticatorSelection)===null||o===void 0?void 0:o.userVerification)==="required")return new Me({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new Me({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new Me({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return n.pubKeyCredParams.filter(i=>i.type==="public-key").length===0?new Me({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new Me({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){let s=window.location.hostname;if(sy(s)){if(n.rp.id!==s)return new Me({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Me({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new Me({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new Me({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Me({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function bI({error:e,options:t}){let{publicKey:r}=t;if(!r)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Me({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new Me({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){let a=window.location.hostname;if(sy(a)){if(r.rpId!==a)return new Me({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Me({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new Me({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Me({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}var iy=class{createNewAbortSignal(){if(this.controller){let r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}let t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){let t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}},qE=new iy;function II(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);let{challenge:t,user:r,excludeCredentials:a}=e,o=sn(e,["challenge","user","excludeCredentials"]),n=Co(t).buffer,s=Object.assign(Object.assign({},r),{id:Co(r.id).buffer}),i=Object.assign(Object.assign({},o),{challenge:n,user:s});if(a&&a.length>0){i.excludeCredentials=new Array(a.length);for(let l=0;l<a.length;l++){let u=a[l];i.excludeCredentials[l]=Object.assign(Object.assign({},u),{id:Co(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return i}function kI(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);let{challenge:t,allowCredentials:r}=e,a=sn(e,["challenge","allowCredentials"]),o=Co(t).buffer,n=Object.assign(Object.assign({},a),{challenge:o});if(r&&r.length>0){n.allowCredentials=new Array(r.length);for(let s=0;s<r.length;s++){let i=r[s];n.allowCredentials[s]=Object.assign(Object.assign({},i),{id:Co(i.id).buffer,type:i.type||"public-key",transports:i.transports})}}return n}function PI(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();let r=e;return{id:e.id,rawId:e.id,response:{attestationObject:Pa(new Uint8Array(e.response.attestationObject)),clientDataJSON:Pa(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function TI(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();let r=e,a=e.getClientExtensionResults(),o=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:Pa(new Uint8Array(o.authenticatorData)),clientDataJSON:Pa(new Uint8Array(o.clientDataJSON)),signature:Pa(new Uint8Array(o.signature)),userHandle:o.userHandle?Pa(new Uint8Array(o.userHandle)):void 0},type:"public-key",clientExtensionResults:a,authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function sy(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function LI(){var e,t;return!!(Je()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator?.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator?.credentials)===null||t===void 0?void 0:t.get)=="function")}async function HE(e){try{let t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Sn("Browser returned unexpected credential type",t)}:{data:null,error:new Sn("Empty credential response",t)}}catch(t){return{data:null,error:CI({error:t,options:e})}}}async function zE(e){try{let t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Sn("Browser returned unexpected credential type",t)}:{data:null,error:new Sn("Empty credential response",t)}}catch(t){return{data:null,error:bI({error:t,options:e})}}}var $E={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},WE={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Hf(...e){let t=o=>o!==null&&typeof o=="object"&&!Array.isArray(o),r=o=>o instanceof ArrayBuffer||ArrayBuffer.isView(o),a={};for(let o of e)if(o)for(let n in o){let s=o[n];if(s!==void 0)if(Array.isArray(s))a[n]=s;else if(r(s))a[n]=s;else if(t(s)){let i=a[n];t(i)?a[n]=Hf(i,s):a[n]=Hf(s)}else a[n]=s}return a}function GE(e,t){return Hf($E,e,t||{})}function KE(e,t){return Hf(WE,e,t||{})}var zf=class{constructor(t){this.client=t,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:r,friendlyName:a,signal:o},n){try{let{data:s,error:i}=await this.client.mfa.challenge({factorId:t,webauthn:r});if(!s)return{data:null,error:i};let l=o??qE.createNewAbortSignal();if(s.webauthn.type==="create"){let{user:u}=s.webauthn.credential_options.publicKey;u.name||(u.name=`${u.id}:${a}`),u.displayName||(u.displayName=u.name)}switch(s.webauthn.type){case"create":{let u=GE(s.webauthn.credential_options.publicKey,n?.create),{data:c,error:d}=await HE({publicKey:u,signal:l});return c?{data:{factorId:t,challengeId:s.id,webauthn:{type:s.webauthn.type,credential_response:c}},error:null}:{data:null,error:d}}case"request":{let u=KE(s.webauthn.credential_options.publicKey,n?.request),{data:c,error:d}=await zE(Object.assign(Object.assign({},s.webauthn.credential_options),{publicKey:u,signal:l}));return c?{data:{factorId:t,challengeId:s.id,webauthn:{type:s.webauthn.type,credential_response:c}},error:null}:{data:null,error:d}}}}catch(s){return j(s)?{data:null,error:s}:{data:null,error:new hr("Unexpected error in challenge",s)}}}async _verify({challengeId:t,factorId:r,webauthn:a}){return this.client.mfa.verify({factorId:r,challengeId:t,webauthn:a})}async _authenticate({factorId:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:a=typeof window<"u"?[window.location.origin]:void 0,signal:o}={}},n){if(!r)return{data:null,error:new So("rpId is required for WebAuthn authentication")};try{if(!LI())return{data:null,error:new hr("Browser does not support WebAuthn",null)};let{data:s,error:i}=await this.challenge({factorId:t,webauthn:{rpId:r,rpOrigins:a},signal:o},{request:n});if(!s)return{data:null,error:i};let{webauthn:l}=s;return this._verify({factorId:t,challengeId:s.challengeId,webauthn:{type:l.type,rpId:r,rpOrigins:a,credential_response:l.credential_response}})}catch(s){return j(s)?{data:null,error:s}:{data:null,error:new hr("Unexpected error in authenticate",s)}}}async _register({friendlyName:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:a=typeof window<"u"?[window.location.origin]:void 0,signal:o}={}},n){if(!r)return{data:null,error:new So("rpId is required for WebAuthn registration")};try{if(!LI())return{data:null,error:new hr("Browser does not support WebAuthn",null)};let{data:s,error:i}=await this._enroll({friendlyName:t});if(!s)return await this.client.mfa.listFactors().then(c=>{var d;return(d=c.data)===null||d===void 0?void 0:d.all.find(f=>f.factor_type==="webauthn"&&f.friendly_name===t&&f.status!=="unverified")}).then(c=>c?this.client.mfa.unenroll({factorId:c?.id}):void 0),{data:null,error:i};let{data:l,error:u}=await this._challenge({factorId:s.id,friendlyName:s.friendly_name,webauthn:{rpId:r,rpOrigins:a},signal:o},{create:n});return l?this._verify({factorId:s.id,challengeId:l.challengeId,webauthn:{rpId:r,rpOrigins:a,type:l.webauthn.type,credential_response:l.webauthn.credential_response}}):{data:null,error:u}}catch(s){return j(s)?{data:null,error:s}:{data:null,error:new hr("Unexpected error in register",s)}}}};vI();var XE={url:GL,storageKey:KL,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:XL,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:1e4};async function _I(e,t,r){return await r()}var pi={},$f=class e{get jwks(){var t,r;return(r=(t=pi[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(t){pi[this.storageKey]=Object.assign(Object.assign({},pi[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,r;return(r=(t=pi[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){pi[this.storageKey]=Object.assign(Object.assign({},pi[this.storageKey]),{cachedAt:t})}constructor(t){var r,a,o;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;let n=Object.assign(Object.assign({},XE),t);if(this.storageKey=n.storageKey,this.instanceID=(r=e.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,e.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!n.debug,typeof n.debug=="function"&&(this.logger=n.debug),this.instanceID>0&&Je()){let s=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(s),this.logDebugMessages&&console.trace(s)}if(this.persistSession=n.persistSession,this.autoRefreshToken=n.autoRefreshToken,this.admin=new xn({url:n.url,headers:n.headers,fetch:n.fetch}),this.url=n.url,this.headers=n.headers,this.fetch=Ff(n.fetch),this.lock=n.lock||_I,this.detectSessionInUrl=n.detectSessionInUrl,this.flowType=n.flowType,this.hasCustomAuthorizationHeader=n.hasCustomAuthorizationHeader,this.throwOnError=n.throwOnError,this.lockAcquireTimeout=n.lockAcquireTimeout,n.lock?this.lock=n.lock:this.persistSession&&Je()&&(!((a=globalThis?.navigator)===null||a===void 0)&&a.locks)?this.lock=oy:this.lock=_I,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new zf(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(n.storage?this.storage=n.storage:Bf()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=ay(this.memoryStorage)),n.userStorage&&(this.userStorage=n.userStorage)):(this.memoryStorage={},this.storage=ay(this.memoryStorage)),Je()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(s){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",s)}(o=this.broadcastChannel)===null||o===void 0||o.addEventListener("message",async s=>{this._debug("received broadcast notification from other tab or client",s),await this._notifyAllSubscribers(s.data.event,s.data.session,!1)})}this.initialize()}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${Af}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let r={},a="none";if(Je()&&(r=iI(window.location.href),this._isImplicitGrantCallback(r)?a="implicit":await this._isPKCECallback(r)&&(a="pkce")),Je()&&this.detectSessionInUrl&&a!=="none"){let{data:o,error:n}=await this._getSessionFromURL(r,a);if(n){if(this._debug("#_initialize()","error detecting session from URL",n),eI(n)){let l=(t=n.details)===null||t===void 0?void 0:t.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{error:n}}return{error:n}}let{session:s,redirectType:i}=o;return this._debug("#_initialize()","detected session in URL",s,"redirect type",i),await this._saveSession(s),setTimeout(async()=>{i==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",s):await this._notifyAllSubscribers("SIGNED_IN",s)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return j(r)?this._returnResult({error:r}):this._returnResult({error:new hr("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var r,a,o;try{let n=await K(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(a=(r=t?.options)===null||r===void 0?void 0:r.data)!==null&&a!==void 0?a:{},gotrue_meta_security:{captcha_token:(o=t?.options)===null||o===void 0?void 0:o.captchaToken}},xform:mr}),{data:s,error:i}=n;if(i||!s)return this._returnResult({data:{user:null,session:null},error:i});let l=s.session,u=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(n){if(j(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signUp(t){var r,a,o;try{let n;if("email"in t){let{email:c,password:d,options:f}=t,p=null,v=null;this.flowType==="pkce"&&([p,v]=await gn(this.storage,this.storageKey)),n=await K(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:f?.emailRedirectTo,body:{email:c,password:d,data:(r=f?.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:f?.captchaToken},code_challenge:p,code_challenge_method:v},xform:mr})}else if("phone"in t){let{phone:c,password:d,options:f}=t;n=await K(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:c,password:d,data:(a=f?.data)!==null&&a!==void 0?a:{},channel:(o=f?.channel)!==null&&o!==void 0?o:"sms",gotrue_meta_security:{captcha_token:f?.captchaToken}},xform:mr})}else throw new dn("You must provide either an email or phone number and a password");let{data:s,error:i}=n;if(i||!s)return await at(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:i});let l=s.session,u=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(n){if(await at(this.storage,`${this.storageKey}-code-verifier`),j(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithPassword(t){try{let r;if("email"in t){let{email:n,password:s,options:i}=t;r=await K(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:n,password:s,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:ty})}else if("phone"in t){let{phone:n,password:s,options:i}=t;r=await K(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:n,password:s,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:ty})}else throw new dn("You must provide either an email or phone number and a password");let{data:a,error:o}=r;if(o)return this._returnResult({data:{user:null,session:null},error:o});if(!a||!a.session||!a.user){let n=new ka;return this._returnResult({data:{user:null,session:null},error:n})}return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),this._returnResult({data:Object.assign({user:a.user,session:a.session},a.weak_password?{weakPassword:a.weak_password}:null),error:o})}catch(r){if(j(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(t){var r,a,o,n;return await this._handleProviderSignIn(t.provider,{redirectTo:(r=t.options)===null||r===void 0?void 0:r.redirectTo,scopes:(a=t.options)===null||a===void 0?void 0:a.scopes,queryParams:(o=t.options)===null||o===void 0?void 0:o.queryParams,skipBrowserRedirect:(n=t.options)===null||n===void 0?void 0:n.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){let{chain:r}=t;switch(r){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(t){var r,a,o,n,s,i,l,u,c,d,f;let p,v;if("message"in t)p=t.message,v=t.signature;else{let{chain:x,wallet:C,statement:g,options:m}=t,y;if(Je())if(typeof C=="object")y=C;else{let M=window;if("ethereum"in M&&typeof M.ethereum=="object"&&"request"in M.ethereum&&typeof M.ethereum.request=="function")y=M.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof C!="object"||!m?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");y=C}let b=new URL((r=m?.url)!==null&&r!==void 0?r:window.location.href),L=await y.request({method:"eth_requestAccounts"}).then(M=>M).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!L||L.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");let k=ny(L[0]),_=(a=m?.signInWithEthereum)===null||a===void 0?void 0:a.chainId;if(!_){let M=await y.request({method:"eth_chainId"});_=xI(M)}let T={domain:b.host,address:k,statement:g,uri:b.href,version:"1",chainId:_,nonce:(o=m?.signInWithEthereum)===null||o===void 0?void 0:o.nonce,issuedAt:(s=(n=m?.signInWithEthereum)===null||n===void 0?void 0:n.issuedAt)!==null&&s!==void 0?s:new Date,expirationTime:(i=m?.signInWithEthereum)===null||i===void 0?void 0:i.expirationTime,notBefore:(l=m?.signInWithEthereum)===null||l===void 0?void 0:l.notBefore,requestId:(u=m?.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(c=m?.signInWithEthereum)===null||c===void 0?void 0:c.resources};p=SI(T),v=await y.request({method:"personal_sign",params:[wI(p),k]})}try{let{data:x,error:C}=await K(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:p,signature:v},!((d=t.options)===null||d===void 0)&&d.captchaToken?{gotrue_meta_security:{captcha_token:(f=t.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:mr});if(C)throw C;if(!x||!x.session||!x.user){let g=new ka;return this._returnResult({data:{user:null,session:null},error:g})}return x.session&&(await this._saveSession(x.session),await this._notifyAllSubscribers("SIGNED_IN",x.session)),this._returnResult({data:Object.assign({},x),error:C})}catch(x){if(j(x))return this._returnResult({data:{user:null,session:null},error:x});throw x}}async signInWithSolana(t){var r,a,o,n,s,i,l,u,c,d,f,p;let v,x;if("message"in t)v=t.message,x=t.signature;else{let{chain:C,wallet:g,statement:m,options:y}=t,b;if(Je())if(typeof g=="object")b=g;else{let k=window;if("solana"in k&&typeof k.solana=="object"&&("signIn"in k.solana&&typeof k.solana.signIn=="function"||"signMessage"in k.solana&&typeof k.solana.signMessage=="function"))b=k.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof g!="object"||!y?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");b=g}let L=new URL((r=y?.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in b&&b.signIn){let k=await b.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},y?.signInWithSolana),{version:"1",domain:L.host,uri:L.href}),m?{statement:m}:null)),_;if(Array.isArray(k)&&k[0]&&typeof k[0]=="object")_=k[0];else if(k&&typeof k=="object"&&"signedMessage"in k&&"signature"in k)_=k;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in _&&"signature"in _&&(typeof _.signedMessage=="string"||_.signedMessage instanceof Uint8Array)&&_.signature instanceof Uint8Array)v=typeof _.signedMessage=="string"?_.signedMessage:new TextDecoder().decode(_.signedMessage),x=_.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in b)||typeof b.signMessage!="function"||!("publicKey"in b)||typeof b!="object"||!b.publicKey||!("toBase58"in b.publicKey)||typeof b.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");v=[`${L.host} wants you to sign in with your Solana account:`,b.publicKey.toBase58(),...m?["",m,""]:[""],"Version: 1",`URI: ${L.href}`,`Issued At: ${(o=(a=y?.signInWithSolana)===null||a===void 0?void 0:a.issuedAt)!==null&&o!==void 0?o:new Date().toISOString()}`,...!((n=y?.signInWithSolana)===null||n===void 0)&&n.notBefore?[`Not Before: ${y.signInWithSolana.notBefore}`]:[],...!((s=y?.signInWithSolana)===null||s===void 0)&&s.expirationTime?[`Expiration Time: ${y.signInWithSolana.expirationTime}`]:[],...!((i=y?.signInWithSolana)===null||i===void 0)&&i.chainId?[`Chain ID: ${y.signInWithSolana.chainId}`]:[],...!((l=y?.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${y.signInWithSolana.nonce}`]:[],...!((u=y?.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${y.signInWithSolana.requestId}`]:[],...!((d=(c=y?.signInWithSolana)===null||c===void 0?void 0:c.resources)===null||d===void 0)&&d.length?["Resources",...y.signInWithSolana.resources.map(_=>`- ${_}`)]:[]].join(`
|
|
58
|
-
`);let k=await b.signMessage(new TextEncoder().encode(v),"utf8");if(!k||!(k instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");x=k}}try{let{data:C,error:g}=await K(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:v,signature:Pa(x)},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(p=t.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:mr});if(g)throw g;if(!C||!C.session||!C.user){let m=new ka;return this._returnResult({data:{user:null,session:null},error:m})}return C.session&&(await this._saveSession(C.session),await this._notifyAllSubscribers("SIGNED_IN",C.session)),this._returnResult({data:Object.assign({},C),error:g})}catch(C){if(j(C))return this._returnResult({data:{user:null,session:null},error:C});throw C}}async _exchangeCodeForSession(t){let r=await bo(this.storage,`${this.storageKey}-code-verifier`),[a,o]=(r??"").split("/");try{if(!a&&this.flowType==="pkce")throw new Nf;let{data:n,error:s}=await K(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:a},xform:mr});if(await at(this.storage,`${this.storageKey}-code-verifier`),s)throw s;if(!n||!n.session||!n.user){let i=new ka;return this._returnResult({data:{user:null,session:null,redirectType:null},error:i})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign(Object.assign({},n),{redirectType:o??null}),error:s})}catch(n){if(await at(this.storage,`${this.storageKey}-code-verifier`),j(n))return this._returnResult({data:{user:null,session:null,redirectType:null},error:n});throw n}}async signInWithIdToken(t){try{let{options:r,provider:a,token:o,access_token:n,nonce:s}=t,i=await K(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:a,id_token:o,access_token:n,nonce:s,gotrue_meta_security:{captcha_token:r?.captchaToken}},xform:mr}),{data:l,error:u}=i;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!l||!l.session||!l.user){let c=new ka;return this._returnResult({data:{user:null,session:null},error:c})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),this._returnResult({data:l,error:u})}catch(r){if(j(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(t){var r,a,o,n,s;try{if("email"in t){let{email:i,options:l}=t,u=null,c=null;this.flowType==="pkce"&&([u,c]=await gn(this.storage,this.storageKey));let{error:d}=await K(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:i,data:(r=l?.data)!==null&&r!==void 0?r:{},create_user:(a=l?.shouldCreateUser)!==null&&a!==void 0?a:!0,gotrue_meta_security:{captcha_token:l?.captchaToken},code_challenge:u,code_challenge_method:c},redirectTo:l?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:d})}if("phone"in t){let{phone:i,options:l}=t,{data:u,error:c}=await K(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:i,data:(o=l?.data)!==null&&o!==void 0?o:{},create_user:(n=l?.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:l?.captchaToken},channel:(s=l?.channel)!==null&&s!==void 0?s:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u?.message_id},error:c})}throw new dn("You must provide either an email or phone number.")}catch(i){if(await at(this.storage,`${this.storageKey}-code-verifier`),j(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async verifyOtp(t){var r,a;try{let o,n;"options"in t&&(o=(r=t.options)===null||r===void 0?void 0:r.redirectTo,n=(a=t.options)===null||a===void 0?void 0:a.captchaToken);let{data:s,error:i}=await K(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:n}}),redirectTo:o,xform:mr});if(i)throw i;if(!s)throw new Error("An error occurred on token verification.");let l=s.session,u=s.user;return l?.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(o){if(j(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signInWithSSO(t){var r,a,o,n,s;try{let i=null,l=null;this.flowType==="pkce"&&([i,l]=await gn(this.storage,this.storageKey));let u=await K(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(a=(r=t.options)===null||r===void 0?void 0:r.redirectTo)!==null&&a!==void 0?a:void 0}),!((o=t?.options)===null||o===void 0)&&o.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:i,code_challenge_method:l}),headers:this.headers,xform:gI});return!((n=u.data)===null||n===void 0)&&n.url&&Je()&&!(!((s=t.options)===null||s===void 0)&&s.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(i){if(await at(this.storage,`${this.storageKey}-code-verifier`),j(i))return this._returnResult({data:null,error:i});throw i}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{let{data:{session:r},error:a}=t;if(a)throw a;if(!r)throw new dt;let{error:o}=await K(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:o})})}catch(t){if(j(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{let r=`${this.url}/resend`;if("email"in t){let{email:a,type:o,options:n}=t,{error:s}=await K(this.fetch,"POST",r,{headers:this.headers,body:{email:a,type:o,gotrue_meta_security:{captcha_token:n?.captchaToken}},redirectTo:n?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:s})}else if("phone"in t){let{phone:a,type:o,options:n}=t,{data:s,error:i}=await K(this.fetch,"POST",r,{headers:this.headers,body:{phone:a,type:o,gotrue_meta_security:{captcha_token:n?.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:s?.message_id},error:i})}throw new dn("You must provide either an email or phone number and a type")}catch(r){if(j(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async r=>r))}async _acquireLock(t,r){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){let a=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),o=(async()=>(await a,await r()))();return this.pendingInLock.push((async()=>{try{await o}catch{}})()),o}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let a=r();for(this.pendingInLock.push((async()=>{try{await a}catch{}})()),await a;this.pendingInLock.length;){let o=[...this.pendingInLock];await Promise.all(o),this.pendingInLock.splice(0,o.length)}return await a}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{let r=await this.__loadSession();return await t(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null,r=await bo(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?t=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!t)return{data:{session:null},error:null};let a=t.expires_at?t.expires_at*1e3-Date.now()<Ef:!1;if(this._debug("#__loadSession()",`session has${a?"":" not"} expired`,"expires_at",t.expires_at),!a){if(this.userStorage){let s=await bo(this.userStorage,this.storageKey+"-user");s?.user?t.user=s.user:t.user=Vf()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){let s={value:this.suppressGetSessionWarning};t.user=hI(t.user,s),s.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}let{data:o,error:n}=await this._callRefreshToken(t.refresh_token);return n?this._returnResult({data:{session:null},error:n}):this._returnResult({data:{session:o},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;let r=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(t){try{return t?await K(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:Kr}):await this._useSession(async r=>{var a,o,n;let{data:s,error:i}=r;if(i)throw i;return!(!((a=s.session)===null||a===void 0)&&a.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new dt}:await K(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(n=(o=s.session)===null||o===void 0?void 0:o.access_token)!==null&&n!==void 0?n:void 0,xform:Kr})})}catch(r){if(j(r))return ZL(r)&&(await this._removeSession(),await at(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(t,r={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,r))}async _updateUser(t,r={}){try{return await this._useSession(async a=>{let{data:o,error:n}=a;if(n)throw n;if(!o.session)throw new dt;let s=o.session,i=null,l=null;this.flowType==="pkce"&&t.email!=null&&([i,l]=await gn(this.storage,this.storageKey));let{data:u,error:c}=await K(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r?.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:i,code_challenge_method:l}),jwt:s.access_token,xform:Kr});if(c)throw c;return s.user=u.user,await this._saveSession(s),await this._notifyAllSubscribers("USER_UPDATED",s),this._returnResult({data:{user:s.user},error:null})})}catch(a){if(await at(this.storage,`${this.storageKey}-code-verifier`),j(a))return this._returnResult({data:{user:null},error:a});throw a}}async setSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new dt;let r=Date.now()/1e3,a=r,o=!0,n=null,{payload:s}=Uf(t.access_token);if(s.exp&&(a=s.exp,o=a<=r),o){let{data:i,error:l}=await this._callRefreshToken(t.refresh_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});if(!i)return{data:{user:null,session:null},error:null};n=i}else{let{data:i,error:l}=await this._getUser(t.access_token);if(l)throw l;n={access_token:t.access_token,refresh_token:t.refresh_token,user:i.user,token_type:"bearer",expires_in:a-r,expires_at:a},await this._saveSession(n),await this._notifyAllSubscribers("SIGNED_IN",n)}return this._returnResult({data:{user:n.user,session:n},error:null})}catch(r){if(j(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async r=>{var a;if(!t){let{data:s,error:i}=r;if(i)throw i;t=(a=s.session)!==null&&a!==void 0?a:void 0}if(!t?.refresh_token)throw new dt;let{data:o,error:n}=await this._callRefreshToken(t.refresh_token);return n?this._returnResult({data:{user:null,session:null},error:n}):o?this._returnResult({data:{user:o.user,session:o},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(j(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(t,r){try{if(!Je())throw new fn("No browser detected.");if(t.error||t.error_description||t.error_code)throw new fn(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new ou("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new fn("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new ou("No code detected.");let{data:m,error:y}=await this._exchangeCodeForSession(t.code);if(y)throw y;let b=new URL(window.location.href);return b.searchParams.delete("code"),window.history.replaceState(window.history.state,"",b.toString()),{data:{session:m.session,redirectType:null},error:null}}let{provider_token:a,provider_refresh_token:o,access_token:n,refresh_token:s,expires_in:i,expires_at:l,token_type:u}=t;if(!n||!i||!s||!u)throw new fn("No session defined in URL");let c=Math.round(Date.now()/1e3),d=parseInt(i),f=c+d;l&&(f=parseInt(l));let p=f-c;p*1e3<=cn&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${p}s, should have been closer to ${d}s`);let v=f-d;c-v>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",v,f,c):c-v<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",v,f,c);let{data:x,error:C}=await this._getUser(n);if(C)throw C;let g={provider_token:a,provider_refresh_token:o,access_token:n,expires_in:d,expires_at:f,refresh_token:s,token_type:u,user:x.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:g,redirectType:t.type},error:null})}catch(a){if(j(a))return this._returnResult({data:{session:null,redirectType:null},error:a});throw a}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error_description)}async _isPKCECallback(t){let r=await bo(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&r)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async r=>{var a;let{data:o,error:n}=r;if(n)return this._returnResult({error:n});let s=(a=o.session)===null||a===void 0?void 0:a.access_token;if(s){let{error:i}=await this.admin.signOut(s,t);if(i&&!(YL(i)&&(i.status===404||i.status===401||i.status===403)))return this._returnResult({error:i})}return t!=="others"&&(await this._removeSession(),await at(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){let r=sI(),a={id:r,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,a),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:a}}}async _emitInitialSession(t){return await this._useSession(async r=>{var a,o;try{let{data:{session:n},error:s}=r;if(s)throw s;await((a=this.stateChangeEmitters.get(t))===null||a===void 0?void 0:a.callback("INITIAL_SESSION",n)),this._debug("INITIAL_SESSION","callback id",t,"session",n)}catch(n){await((o=this.stateChangeEmitters.get(t))===null||o===void 0?void 0:o.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",n),console.error(n)}})}async resetPasswordForEmail(t,r={}){let a=null,o=null;this.flowType==="pkce"&&([a,o]=await gn(this.storage,this.storageKey,!0));try{return await K(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:a,code_challenge_method:o,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(n){if(await at(this.storage,`${this.storageKey}-code-verifier`),j(n))return this._returnResult({data:null,error:n});throw n}}async getUserIdentities(){var t;try{let{data:r,error:a}=await this.getUser();if(a)throw a;return this._returnResult({data:{identities:(t=r.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(r){if(j(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var r;try{let{data:a,error:o}=await this._useSession(async n=>{var s,i,l,u,c;let{data:d,error:f}=n;if(f)throw f;let p=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(s=t.options)===null||s===void 0?void 0:s.redirectTo,scopes:(i=t.options)===null||i===void 0?void 0:i.scopes,queryParams:(l=t.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await K(this.fetch,"GET",p,{headers:this.headers,jwt:(c=(u=d.session)===null||u===void 0?void 0:u.access_token)!==null&&c!==void 0?c:void 0})});if(o)throw o;return Je()&&!(!((r=t.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(a?.url),this._returnResult({data:{provider:t.provider,url:a?.url},error:null})}catch(a){if(j(a))return this._returnResult({data:{provider:t.provider,url:null},error:a});throw a}}async linkIdentityIdToken(t){return await this._useSession(async r=>{var a;try{let{error:o,data:{session:n}}=r;if(o)throw o;let{options:s,provider:i,token:l,access_token:u,nonce:c}=t,d=await K(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(a=n?.access_token)!==null&&a!==void 0?a:void 0,body:{provider:i,id_token:l,access_token:u,nonce:c,link_identity:!0,gotrue_meta_security:{captcha_token:s?.captchaToken}},xform:mr}),{data:f,error:p}=d;return p?this._returnResult({data:{user:null,session:null},error:p}):!f||!f.session||!f.user?this._returnResult({data:{user:null,session:null},error:new ka}):(f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("USER_UPDATED",f.session)),this._returnResult({data:f,error:p}))}catch(o){if(await at(this.storage,`${this.storageKey}-code-verifier`),j(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}})}async unlinkIdentity(t){try{return await this._useSession(async r=>{var a,o;let{data:n,error:s}=r;if(s)throw s;return await K(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(o=(a=n.session)===null||a===void 0?void 0:a.access_token)!==null&&o!==void 0?o:void 0})})}catch(r){if(j(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(t){let r=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(r,"begin");try{let a=Date.now();return await cI(async o=>(o>0&&await uI(200*Math.pow(2,o-1)),this._debug(r,"refreshing attempt",o),await K(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:mr})),(o,n)=>{let s=200*Math.pow(2,o);return n&&Mf(n)&&Date.now()+s-a<cn})}catch(a){if(this._debug(r,"error",a),j(a))return this._returnResult({data:{session:null,user:null},error:a});throw a}finally{this._debug(r,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,r){let a=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",r,"url",a),Je()&&!r.skipBrowserRedirect&&window.location.assign(a),{data:{provider:t,url:a},error:null}}async _recoverAndRefresh(){var t,r;let a="#_recoverAndRefresh()";this._debug(a,"begin");try{let o=await bo(this.storage,this.storageKey);if(o&&this.userStorage){let s=await bo(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!s&&(s={user:o.user},await mn(this.userStorage,this.storageKey+"-user",s)),o.user=(t=s?.user)!==null&&t!==void 0?t:Vf()}else if(o&&!o.user&&!o.user){let s=await bo(this.storage,this.storageKey+"-user");s&&s?.user?(o.user=s.user,await at(this.storage,this.storageKey+"-user"),await mn(this.storage,this.storageKey,o)):o.user=Vf()}if(this._debug(a,"session from storage",o),!this._isValidSession(o)){this._debug(a,"session is not valid"),o!==null&&await this._removeSession();return}let n=((r=o.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<Ef;if(this._debug(a,`session has${n?"":" not"} expired with margin of ${Ef}s`),n){if(this.autoRefreshToken&&o.refresh_token){let{error:s}=await this._callRefreshToken(o.refresh_token);s&&(console.error(s),Mf(s)||(this._debug(a,"refresh failed with a non-retryable error, removing the session",s),await this._removeSession()))}}else if(o.user&&o.user.__isUserNotAvailableProxy===!0)try{let{data:s,error:i}=await this._getUser(o.access_token);!i&&s?.user?(o.user=s.user,await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)):this._debug(a,"could not get user data, skipping SIGNED_IN notification")}catch(s){console.error("Error getting user data:",s),this._debug(a,"error getting user data, skipping SIGNED_IN notification",s)}else await this._notifyAllSubscribers("SIGNED_IN",o)}catch(o){this._debug(a,"error",o),console.error(o);return}finally{this._debug(a,"end")}}async _callRefreshToken(t){var r,a;if(!t)throw new dt;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let o=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(o,"begin");try{this.refreshingDeferred=new su;let{data:n,error:s}=await this._refreshAccessToken(t);if(s)throw s;if(!n.session)throw new dt;await this._saveSession(n.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",n.session);let i={data:n.session,error:null};return this.refreshingDeferred.resolve(i),i}catch(n){if(this._debug(o,"error",n),j(n)){let s={data:null,error:n};return Mf(n)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(s),s}throw(a=this.refreshingDeferred)===null||a===void 0||a.reject(n),n}finally{this.refreshingDeferred=null,this._debug(o,"end")}}async _notifyAllSubscribers(t,r,a=!0){let o=`#_notifyAllSubscribers(${t})`;this._debug(o,"begin",r,`broadcast = ${a}`);try{this.broadcastChannel&&a&&this.broadcastChannel.postMessage({event:t,session:r});let n=[],s=Array.from(this.stateChangeEmitters.values()).map(async i=>{try{await i.callback(t,r)}catch(l){n.push(l)}});if(await Promise.all(s),n.length>0){for(let i=0;i<n.length;i+=1)console.error(n[i]);throw n[0]}}finally{this._debug(o,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await at(this.storage,`${this.storageKey}-code-verifier`);let r=Object.assign({},t),a=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!a&&r.user&&await mn(this.userStorage,this.storageKey+"-user",{user:r.user});let o=Object.assign({},r);delete o.user;let n=ey(o);await mn(this.storage,this.storageKey,n)}else{let o=ey(r);await mn(this.storage,this.storageKey,o)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await at(this.storage,this.storageKey),await at(this.storage,this.storageKey+"-code-verifier"),await at(this.storage,this.storageKey+"-user"),this.userStorage&&await at(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&Je()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",t)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let t=setInterval(()=>this._autoRefreshTokenTick(),cn);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);let r=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");let t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);let r=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,r&&clearTimeout(r)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{let t=Date.now();try{return await this._useSession(async r=>{let{data:{session:a}}=r;if(!a||!a.refresh_token||!a.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}let o=Math.floor((a.expires_at*1e3-t)/cn);this._debug("#_autoRefreshTokenTick()",`access token expires in ${o} ticks, a tick lasts ${cn}ms, refresh threshold is ${Rf} ticks`),o<=Rf&&await this._callRefreshToken(a.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof iu)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Je()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){let r=`#_onVisibilityChanged(${t})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,r,a){let o=[`provider=${encodeURIComponent(r)}`];if(a?.redirectTo&&o.push(`redirect_to=${encodeURIComponent(a.redirectTo)}`),a?.scopes&&o.push(`scopes=${encodeURIComponent(a.scopes)}`),this.flowType==="pkce"){let[n,s]=await gn(this.storage,this.storageKey),i=new URLSearchParams({code_challenge:`${encodeURIComponent(n)}`,code_challenge_method:`${encodeURIComponent(s)}`});o.push(i.toString())}if(a?.queryParams){let n=new URLSearchParams(a.queryParams);o.push(n.toString())}return a?.skipBrowserRedirect&&o.push(`skip_http_redirect=${a.skipBrowserRedirect}`),`${t}?${o.join("&")}`}async _unenroll(t){try{return await this._useSession(async r=>{var a;let{data:o,error:n}=r;return n?this._returnResult({data:null,error:n}):await K(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(a=o?.session)===null||a===void 0?void 0:a.access_token})})}catch(r){if(j(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(t){try{return await this._useSession(async r=>{var a,o;let{data:n,error:s}=r;if(s)return this._returnResult({data:null,error:s});let i=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:l,error:u}=await K(this.fetch,"POST",`${this.url}/factors`,{body:i,headers:this.headers,jwt:(a=n?.session)===null||a===void 0?void 0:a.access_token});return u?this._returnResult({data:null,error:u}):(t.factorType==="totp"&&l.type==="totp"&&(!((o=l?.totp)===null||o===void 0)&&o.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),this._returnResult({data:l,error:null}))})}catch(r){if(j(r))return this._returnResult({data:null,error:r});throw r}}async _verify(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var a;let{data:o,error:n}=r;if(n)return this._returnResult({data:null,error:n});let s=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?PI(t.webauthn.credential_response):TI(t.webauthn.credential_response)})}:{code:t.code}),{data:i,error:l}=await K(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:s,headers:this.headers,jwt:(a=o?.session)===null||a===void 0?void 0:a.access_token});return l?this._returnResult({data:null,error:l}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+i.expires_in},i)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",i),this._returnResult({data:i,error:l}))})}catch(r){if(j(r))return this._returnResult({data:null,error:r});throw r}})}async _challenge(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var a;let{data:o,error:n}=r;if(n)return this._returnResult({data:null,error:n});let s=await K(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(a=o?.session)===null||a===void 0?void 0:a.access_token});if(s.error)return s;let{data:i}=s;if(i.type!=="webauthn")return{data:i,error:null};switch(i.webauthn.type){case"create":return{data:Object.assign(Object.assign({},i),{webauthn:Object.assign(Object.assign({},i.webauthn),{credential_options:Object.assign(Object.assign({},i.webauthn.credential_options),{publicKey:II(i.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},i),{webauthn:Object.assign(Object.assign({},i.webauthn),{credential_options:Object.assign(Object.assign({},i.webauthn.credential_options),{publicKey:kI(i.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(j(r))return this._returnResult({data:null,error:r});throw r}})}async _challengeAndVerify(t){let{data:r,error:a}=await this._challenge({factorId:t.factorId});return a?this._returnResult({data:null,error:a}):await this._verify({factorId:t.factorId,challengeId:r.id,code:t.code})}async _listFactors(){var t;let{data:{user:r},error:a}=await this.getUser();if(a)return{data:null,error:a};let o={all:[],phone:[],totp:[],webauthn:[]};for(let n of(t=r?.factors)!==null&&t!==void 0?t:[])o.all.push(n),n.status==="verified"&&o[n.factor_type].push(n);return{data:o,error:null}}async _getAuthenticatorAssuranceLevel(){var t,r;let{data:{session:a},error:o}=await this.getSession();if(o)return this._returnResult({data:null,error:o});if(!a)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let{payload:n}=Uf(a.access_token),s=null;n.aal&&(s=n.aal);let i=s;((r=(t=a.user.factors)===null||t===void 0?void 0:t.filter(c=>c.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(i="aal2");let u=n.amr||[];return{data:{currentLevel:s,nextLevel:i,currentAuthenticationMethods:u},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async r=>{let{data:{session:a},error:o}=r;return o?this._returnResult({data:null,error:o}):a?await K(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:a.access_token,xform:n=>({data:n,error:null})}):this._returnResult({data:null,error:new dt})})}catch(r){if(j(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(t,r){try{return await this._useSession(async a=>{let{data:{session:o},error:n}=a;if(n)return this._returnResult({data:null,error:n});if(!o)return this._returnResult({data:null,error:new dt});let s=await K(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:o.access_token,body:{action:"approve"},xform:i=>({data:i,error:null})});return s.data&&s.data.redirect_url&&Je()&&!r?.skipBrowserRedirect&&window.location.assign(s.data.redirect_url),s})}catch(a){if(j(a))return this._returnResult({data:null,error:a});throw a}}async _denyAuthorization(t,r){try{return await this._useSession(async a=>{let{data:{session:o},error:n}=a;if(n)return this._returnResult({data:null,error:n});if(!o)return this._returnResult({data:null,error:new dt});let s=await K(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:o.access_token,body:{action:"deny"},xform:i=>({data:i,error:null})});return s.data&&s.data.redirect_url&&Je()&&!r?.skipBrowserRedirect&&window.location.assign(s.data.redirect_url),s})}catch(a){if(j(a))return this._returnResult({data:null,error:a});throw a}}async _listOAuthGrants(){try{return await this._useSession(async t=>{let{data:{session:r},error:a}=t;return a?this._returnResult({data:null,error:a}):r?await K(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:o=>({data:o,error:null})}):this._returnResult({data:null,error:new dt})})}catch(t){if(j(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async r=>{let{data:{session:a},error:o}=r;return o?this._returnResult({data:null,error:o}):a?(await K(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:a.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new dt})})}catch(r){if(j(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(t,r={keys:[]}){let a=r.keys.find(i=>i.kid===t);if(a)return a;let o=Date.now();if(a=this.jwks.keys.find(i=>i.kid===t),a&&this.jwks_cached_at+QL>o)return a;let{data:n,error:s}=await K(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(s)throw s;return!n.keys||n.keys.length===0||(this.jwks=n,this.jwks_cached_at=o,a=n.keys.find(i=>i.kid===t),!a)?null:a}async getClaims(t,r={}){try{let a=t;if(!a){let{data:p,error:v}=await this.getSession();if(v||!p.session)return this._returnResult({data:null,error:v});a=p.session.access_token}let{header:o,payload:n,signature:s,raw:{header:i,payload:l}}=Uf(a);r?.allowExpired||fI(n.exp);let u=!o.alg||o.alg.startsWith("HS")||!o.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(o.kid,r?.keys?{keys:r.keys}:r?.jwks);if(!u){let{error:p}=await this.getUser(a);if(p)throw p;return{data:{claims:n,header:o,signature:s},error:null}}let c=pI(o.alg),d=await crypto.subtle.importKey("jwk",u,c,!0,["verify"]);if(!await crypto.subtle.verify(c,d,s,oI(`${i}.${l}`)))throw new pn("Invalid JWT signature");return{data:{claims:n,header:o,signature:s},error:null}}catch(a){if(j(a))return this._returnResult({data:null,error:a});throw a}}};$f.nextInstanceID={};var ly=$f;var JE=ly,uy=JE;var QE="2.90.1",lu="";typeof Deno<"u"?lu="deno":typeof document<"u"?lu="web":typeof navigator<"u"&&navigator.product==="ReactNative"?lu="react-native":lu="node";var YE={"X-Client-Info":`supabase-js-${lu}/${QE}`},ZE={headers:YE},eD={schema:"public"},tD={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},rD={};function uu(e){"@babel/helpers - typeof";return uu=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},uu(e)}function aD(e,t){if(uu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t||"default");if(uu(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function oD(e){var t=aD(e,"string");return uu(t)=="symbol"?t:t+""}function nD(e,t,r){return(t=oD(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function AI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,a)}return r}function Fe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?AI(Object(r),!0).forEach(function(a){nD(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):AI(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}var sD=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),iD=()=>Headers,lD=(e,t,r)=>{let a=sD(r),o=iD();return async(n,s)=>{var i;let l=(i=await t())!==null&&i!==void 0?i:e,u=new o(s?.headers);return u.has("apikey")||u.set("apikey",e),u.has("Authorization")||u.set("Authorization",`Bearer ${l}`),a(n,Fe(Fe({},s),{},{headers:u}))}};function uD(e){return e.endsWith("/")?e:e+"/"}function cD(e,t){var r,a;let{db:o,auth:n,realtime:s,global:i}=e,{db:l,auth:u,realtime:c,global:d}=t,f={db:Fe(Fe({},l),o),auth:Fe(Fe({},u),n),realtime:Fe(Fe({},c),s),storage:{},global:Fe(Fe(Fe({},d),i),{},{headers:Fe(Fe({},(r=d?.headers)!==null&&r!==void 0?r:{}),(a=i?.headers)!==null&&a!==void 0?a:{})}),accessToken:async()=>""};return e.accessToken?f.accessToken=e.accessToken:delete f.accessToken,f}function dD(e){let t=e?.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(uD(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var fD=class extends uy{constructor(e){super(e)}},pD=class{constructor(e,t,r){var a,o;this.supabaseUrl=e,this.supabaseKey=t;let n=dD(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",n),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",n),this.storageUrl=new URL("storage/v1",n),this.functionsUrl=new URL("functions/v1",n);let s=`sb-${n.hostname.split(".")[0]}-auth-token`,i={db:eD,realtime:rD,auth:Fe(Fe({},tD),{},{storageKey:s}),global:ZE},l=cD(r??{},i);if(this.storageKey=(a=l.auth.storageKey)!==null&&a!==void 0?a:"",this.headers=(o=l.global.headers)!==null&&o!==void 0?o:{},l.accessToken)this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(c,d)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(d)} is not possible`)}});else{var u;this.auth=this._initSupabaseAuthClient((u=l.auth)!==null&&u!==void 0?u:{},this.headers,l.global.fetch)}this.fetch=lD(t,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(Fe({headers:this.headers,accessToken:this._getAccessToken.bind(this)},l.realtime)),this.accessToken&&this.accessToken().then(c=>this.realtime.setAuth(c)).catch(c=>console.warn("Failed to set initial Realtime auth token:",c)),this.rest=new AL(new URL("rest/v1",n).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch}),this.storage=new WL(this.storageUrl.href,this.headers,this.fetch,r?.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new Jl(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,r)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this,t,r;if(e.accessToken)return await e.accessToken();let{data:a}=await e.auth.getSession();return(t=(r=a.session)===null||r===void 0?void 0:r.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:a,userStorage:o,storageKey:n,flowType:s,lock:i,debug:l,throwOnError:u},c,d){let f={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new fD({url:this.authUrl.href,headers:Fe(Fe({},f),c),storageKey:n,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:a,userStorage:o,flowType:s,lock:i,debug:l,throwOnError:u,fetch:d,hasCustomAuthorizationHeader:Object.keys(this.headers).some(p=>p.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new ci(this.realtimeUrl.href,Fe(Fe({},e),{},{params:Fe(Fe({},{apikey:this.supabaseKey}),e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t?.access_token)})}_handleTokenChanged(e,t,r){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}},RI=(e,t,r)=>new pD(e,t,r);function hD(){if(typeof window<"u")return!1;let e=globalThis.process;if(!e)return!1;let t=e.version;if(t==null)return!1;let r=t.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=18:!1}hD()&&console.warn("\u26A0\uFE0F Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");var h=D(de(),1),mD="http://localhost:5002",NI=340;function gD(e){return e.replace(/\\\\n/g,`
|
|
16
|
+
`),()=>{document.head.removeChild(d)}},[t]),(0,Wv.jsx)(Gp,{isPresent:t,childRef:r,sizeRef:o,children:Fu.cloneElement(e,{ref:r})})}var Kv=({children:e,initial:t,isPresent:a,onExitComplete:r,custom:o,presenceAffectsLayout:n,mode:s})=>{let i=Pn(jb),l=(0,vo.useId)(),u=(0,vo.useCallback)(c=>{i.set(c,!0);for(let p of i.values())if(!p)return;r&&r()},[i,r]),d=(0,vo.useMemo)(()=>({id:l,initial:t,isPresent:a,custom:o,onExitComplete:u,register:c=>(i.set(c,!1),()=>i.delete(c))}),n?[Math.random(),u]:[a,u]);return(0,vo.useMemo)(()=>{i.forEach((c,p)=>i.set(p,!1))},[a]),jv.useEffect(()=>{!a&&!i.size&&r&&r()},[a]),s==="popLayout"&&(e=(0,jp.jsx)(Gv,{isPresent:a,children:e})),(0,jp.jsx)(Nr.Provider,{value:d,children:e})};function jb(){return new Map}var Er=E($(),1);function Bu(e=!0){let t=(0,Er.useContext)(Nr);if(t===null)return[!0,null];let{isPresent:a,onExitComplete:r,register:o}=t,n=(0,Er.useId)();(0,Er.useEffect)(()=>{e&&o(n)},[e]);let s=(0,Er.useCallback)(()=>e&&r&&r(n),[n,r,e]);return!a&&r?[!1,s]:[!0]}var Ou=E($(),1),wi=e=>e.key||"";function Kp(e){let t=[];return Ou.Children.forEach(e,a=>{(0,Ou.isValidElement)(a)&&t.push(a)}),t}var Vu=E($(),1);var An=typeof window<"u";var Uu=An?Vu.useLayoutEffect:Vu.useEffect;var $p=({children:e,custom:t,initial:a=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:n="sync",propagate:s=!1})=>{let[i,l]=Bu(s),u=(0,Sa.useMemo)(()=>Kp(e),[e]),d=s&&!i?[]:u.map(wi),c=(0,Sa.useRef)(!0),p=(0,Sa.useRef)(u),g=Pn(()=>new Map),[L,C]=(0,Sa.useState)(u),[w,h]=(0,Sa.useState)(u);Uu(()=>{c.current=!1,p.current=u;for(let S=0;S<w.length;S++){let k=wi(w[S]);d.includes(k)?g.delete(k):g.get(k)!==!0&&g.set(k,!1)}},[w,d.length,d.join("-")]);let m=[];if(u!==L){let S=[...u];for(let k=0;k<w.length;k++){let A=w[k],P=wi(A);d.includes(P)||(S.splice(k,0,A),m.push(A))}n==="wait"&&m.length&&(S=m),h(Kp(S)),C(u);return}let{forceRender:x}=(0,Sa.useContext)(bn);return(0,ki.jsx)(ki.Fragment,{children:w.map(S=>{let k=wi(S),A=s&&!i?!1:u===w||d.includes(k),P=()=>{if(g.has(k))g.set(k,!0);else return;let R=!0;g.forEach(M=>{M||(R=!1)}),R&&(x?.(),h(p.current),s&&l?.(),r&&r())};return(0,ki.jsx)(Kv,{isPresent:A,initial:!c.current||a?void 0:!1,custom:A?void 0:t,presenceAffectsLayout:o,mode:n,onExitComplete:A?void 0:P,children:S},k)})})};var me=e=>e;var Qa=me,ca=me;function Lo(e){let t;return()=>(t===void 0&&(t=e()),t)}var Vt=(e,t,a)=>{let r=t-e;return r===0?1:(a-e)/r};var Ne=e=>e*1e3,Ze=e=>e/1e3;var Rn={skipAnimations:!1,useManualTiming:!1};function $v(e){let t=new Set,a=new Set,r=!1,o=!1,n=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1};function i(u){n.has(u)&&(l.schedule(u),e()),u(s)}let l={schedule:(u,d=!1,c=!1)=>{let g=c&&r?t:a;return d&&n.add(u),g.has(u)||g.add(u),u},cancel:u=>{a.delete(u),n.delete(u)},process:u=>{if(s=u,r){o=!0;return}r=!0,[t,a]=[a,t],t.forEach(i),t.clear(),r=!1,o&&(o=!1,l.process(u))}};return l}var _u=["read","resolveKeyframes","update","preRender","render","postRender"],Kb=40;function zu(e,t){let a=!1,r=!0,o={delta:0,timestamp:0,isProcessing:!1},n=()=>a=!0,s=_u.reduce((h,m)=>(h[m]=$v(n),h),{}),{read:i,resolveKeyframes:l,update:u,preRender:d,render:c,postRender:p}=s,g=()=>{let h=Rn.useManualTiming?o.timestamp:performance.now();a=!1,o.delta=r?1e3/60:Math.max(Math.min(h-o.timestamp,Kb),1),o.timestamp=h,o.isProcessing=!0,i.process(o),l.process(o),u.process(o),d.process(o),c.process(o),p.process(o),o.isProcessing=!1,a&&t&&(r=!1,e(g))},L=()=>{a=!0,r=!0,o.isProcessing||e(g)};return{schedule:_u.reduce((h,m)=>{let x=s[m];return h[m]=(S,k=!1,A=!1)=>(a||L(),x.schedule(S,k,A)),h},{}),cancel:h=>{for(let m=0;m<_u.length;m++)s[_u[m]].cancel(h)},state:o,steps:s}}var{schedule:Z,cancel:Ut,state:Ee,steps:Hu}=zu(typeof requestAnimationFrame<"u"?requestAnimationFrame:me,!0);var Xv=E($(),1),qu=(0,Xv.createContext)({strict:!1});var Qv={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"]},Ya={};for(let e in Qv)Ya[e]={isEnabled:t=>Qv[e].some(a=>!!t[a])};function Yv(e){for(let t in e)Ya[t]={...Ya[t],...e[t]}}var $b=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 bi(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||$b.has(e)}var Zv=e=>!bi(e);function Xb(e){e&&(Zv=t=>t.startsWith("on")?!bi(t):e(t))}try{Xb(RS("@emotion/is-prop-valid").default)}catch{}function Jv(e,t,a){let r={};for(let o in e)o==="values"&&typeof e.values=="object"||(Zv(o)||a===!0&&bi(o)||!t&&!bi(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function e0(e){if(typeof Proxy>"u")return e;let t=new Map,a=(...r)=>e(...r);return new Proxy(a,{get:(r,o)=>o==="create"?e:(t.has(o)||t.set(o,e(o)),t.get(o))})}var Xu=E(le(),1);var Nn=E($(),1);var t0=E($(),1),Fr=(0,t0.createContext)({});var ju=E($(),1);function Za(e){return typeof e=="string"||Array.isArray(e)}function Br(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}var Wu=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Pi=["initial",...Wu];function Co(e){return Br(e.animate)||Pi.some(t=>Za(e[t]))}function Gu(e){return!!(Co(e)||e.variants)}function a0(e,t){if(Co(e)){let{initial:a,animate:r}=e;return{initial:a===!1||Za(a)?a:void 0,animate:Za(r)?r:void 0}}return e.inherit!==!1?t:{}}function o0(e){let{initial:t,animate:a}=a0(e,(0,ju.useContext)(Fr));return(0,ju.useMemo)(()=>({initial:t,animate:a}),[r0(t),r0(a)])}function r0(e){return Array.isArray(e)?e.join(" "):e}var n0=Symbol.for("motionComponentSymbol");var s0=E($(),1);function Ja(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function i0(e,t,a){return(0,s0.useCallback)(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),a&&(typeof a=="function"?a(r):Ja(a)&&(a.current=r))},[t])}var bt=E($(),1);var Dn=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase();var Qb="framerAppearId",Ku="data-"+Dn(Qb);var{schedule:Mn,cancel:HM}=zu(queueMicrotask,!1);var l0=E($(),1),$u=(0,l0.createContext)({});function u0(e,t,a,r,o){var n,s;let{visualElement:i}=(0,bt.useContext)(Fr),l=(0,bt.useContext)(qu),u=(0,bt.useContext)(Nr),d=(0,bt.useContext)(Tn).reducedMotion,c=(0,bt.useRef)(null);r=r||l.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:i,props:a,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));let p=c.current,g=(0,bt.useContext)($u);p&&!p.projection&&o&&(p.type==="html"||p.type==="svg")&&Yb(c.current,a,o,g);let L=(0,bt.useRef)(!1);(0,bt.useInsertionEffect)(()=>{p&&L.current&&p.update(a,u)});let C=a[Ku],w=(0,bt.useRef)(!!C&&!(!((n=window.MotionHandoffIsComplete)===null||n===void 0)&&n.call(window,C))&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,C)));return Uu(()=>{p&&(L.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),Mn.render(p.render),w.current&&p.animationState&&p.animationState.animateChanges())}),(0,bt.useEffect)(()=>{p&&(!w.current&&p.animationState&&p.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var h;(h=window.MotionHandoffMarkAsComplete)===null||h===void 0||h.call(window,C)}),w.current=!1))}),p}function Yb(e,t,a,r){let{layoutId:o,layout:n,drag:s,dragConstraints:i,layoutScroll:l,layoutRoot:u}=t;e.projection=new a(e.latestValues,t["data-framer-portal-id"]?void 0:d0(e.parent)),e.projection.setOptions({layoutId:o,layout:n,alwaysMeasureLayout:!!s||i&&Ja(i),visualElement:e,animationType:typeof n=="string"?n:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}function d0(e){if(e)return e.options.allowProjection!==!1?e.projection:d0(e.parent)}function c0({preloadedFeatures:e,createVisualElement:t,useRender:a,useVisualState:r,Component:o}){var n,s;e&&Yv(e);function i(u,d){let c,p={...(0,Nn.useContext)(Tn),...u,layoutId:Zb(u)},{isStatic:g}=p,L=o0(u),C=r(u,g);if(!g&&An){Jb(p,e);let w=eP(p);c=w.MeasureLayout,L.visualElement=u0(o,C,p,t,w.ProjectionNode)}return(0,Xu.jsxs)(Fr.Provider,{value:L,children:[c&&L.visualElement?(0,Xu.jsx)(c,{visualElement:L.visualElement,...p}):null,a(o,u,i0(C,L.visualElement,d),C,g,L.visualElement)]})}i.displayName=`motion.${typeof o=="string"?o:`create(${(s=(n=o.displayName)!==null&&n!==void 0?n:o.name)!==null&&s!==void 0?s:""})`}`;let l=(0,Nn.forwardRef)(i);return l[n0]=o,l}function Zb({layoutId:e}){let t=(0,Nn.useContext)(bn).id;return t&&e!==void 0?t+"-"+e:e}function Jb(e,t){let a=(0,Nn.useContext)(qu).strict}function eP(e){let{drag:t,layout:a}=Ya;if(!t&&!a)return{};let r={...t,...a};return{MeasureLayout:t?.isEnabled(e)||a?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}var f0=["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 En(e){return typeof e!="string"||e.includes("-")?!1:!!(f0.indexOf(e)>-1||/[A-Z]/u.test(e))}var Xp=E($(),1);function p0(e){let t=[{},{}];return e?.values.forEach((a,r)=>{t[0][r]=a.get(),t[1][r]=a.getVelocity()}),t}function Fn(e,t,a,r){if(typeof t=="function"){let[o,n]=p0(r);t=t(a!==void 0?a:e.custom,o,n)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){let[o,n]=p0(r);t=t(a!==void 0?a:e.custom,o,n)}return t}var Ti=e=>Array.isArray(e);var m0=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),h0=e=>Ti(e)?e[e.length-1]||0:e;var xe=e=>!!(e&&e.getVelocity);function Bn(e){let t=xe(e)?e.get():e;return m0(t)?t.toValue():t}function tP({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:a},r,o,n){let s={latestValues:aP(r,o,n,e),renderState:t()};return a&&(s.onMount=i=>a({props:r,current:i,...s}),s.onUpdate=i=>a(i)),s}var Qu=e=>(t,a)=>{let r=(0,Xp.useContext)(Fr),o=(0,Xp.useContext)(Nr),n=()=>tP(e,t,r,o);return a?n():Pn(n)};function aP(e,t,a,r){let o={},n=r(e,{});for(let p in n)o[p]=Bn(n[p]);let{initial:s,animate:i}=e,l=Co(e),u=Gu(e);t&&u&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),i===void 0&&(i=t.animate));let d=a?a.initial===!1:!1;d=d||s===!1;let c=d?i:s;if(c&&typeof c!="boolean"&&!Br(c)){let p=Array.isArray(c)?c:[c];for(let g=0;g<p.length;g++){let L=Fn(e,p[g]);if(L){let{transitionEnd:C,transition:w,...h}=L;for(let m in h){let x=h[m];if(Array.isArray(x)){let S=d?x.length-1:0;x=x[S]}x!==null&&(o[m]=x)}for(let m in C)o[m]=C[m]}}}return o}var Ia=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Pt=new Set(Ia);var g0=e=>t=>typeof t=="string"&&t.startsWith(e),Yu=g0("--"),rP=g0("var(--"),On=e=>rP(e)?oP.test(e.split("/*")[0].trim()):!1,oP=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;var Zu=(e,t)=>t&&typeof e=="number"?t.transform(e):e;var Je=(e,t,a)=>a>t?t:a<e?e:a;var wa={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},er={...wa,transform:e=>Je(0,1,e)},Ai={...wa,default:1};var Ri=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ka=Ri("deg"),ht=Ri("%"),H=Ri("px"),x0=Ri("vh"),y0=Ri("vw"),Qp={...ht,parse:e=>ht.parse(e)/100,transform:e=>ht.transform(e*100)};var v0={borderWidth:H,borderTopWidth:H,borderRightWidth:H,borderBottomWidth:H,borderLeftWidth:H,borderRadius:H,radius:H,borderTopLeftRadius:H,borderTopRightRadius:H,borderBottomRightRadius:H,borderBottomLeftRadius:H,width:H,maxWidth:H,height:H,maxHeight:H,top:H,right:H,bottom:H,left:H,padding:H,paddingTop:H,paddingRight:H,paddingBottom:H,paddingLeft:H,margin:H,marginTop:H,marginRight:H,marginBottom:H,marginLeft:H,backgroundPositionX:H,backgroundPositionY:H};var L0={rotate:ka,rotateX:ka,rotateY:ka,rotateZ:ka,scale:Ai,scaleX:Ai,scaleY:Ai,scaleZ:Ai,skew:ka,skewX:ka,skewY:ka,distance:H,translateX:H,translateY:H,translateZ:H,x:H,y:H,z:H,perspective:H,transformPerspective:H,opacity:er,originX:Qp,originY:Qp,originZ:H};var Yp={...wa,transform:Math.round};var Vn={...v0,...L0,zIndex:Yp,size:H,fillOpacity:er,strokeOpacity:er,numOctaves:Yp};var nP={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},sP=Ia.length;function C0(e,t,a){let r="",o=!0;for(let n=0;n<sP;n++){let s=Ia[n],i=e[s];if(i===void 0)continue;let l=!0;if(typeof i=="number"?l=i===(s.startsWith("scale")?1:0):l=parseFloat(i)===0,!l||a){let u=Zu(i,Vn[s]);if(!l){o=!1;let d=nP[s]||s;r+=`${d}(${u}) `}a&&(t[s]=u)}}return r=r.trim(),a?r=a(t,o?"":r):o&&(r="none"),r}function Un(e,t,a){let{style:r,vars:o,transformOrigin:n}=e,s=!1,i=!1;for(let l in t){let u=t[l];if(Pt.has(l)){s=!0;continue}else if(Yu(l)){o[l]=u;continue}else{let d=Zu(u,Vn[l]);l.startsWith("origin")?(i=!0,n[l]=d):r[l]=d}}if(t.transform||(s||a?r.transform=C0(t,e.transform,a):r.transform&&(r.transform="none")),i){let{originX:l="50%",originY:u="50%",originZ:d=0}=n;r.transformOrigin=`${l} ${u} ${d}`}}var iP={offset:"stroke-dashoffset",array:"stroke-dasharray"},lP={offset:"strokeDashoffset",array:"strokeDasharray"};function S0(e,t,a=1,r=0,o=!0){e.pathLength=1;let n=o?iP:lP;e[n.offset]=H.transform(-r);let s=H.transform(t),i=H.transform(a);e[n.array]=`${s} ${i}`}function I0(e,t,a){return typeof e=="string"?e:H.transform(t+a*e)}function w0(e,t,a){let r=I0(t,e.x,e.width),o=I0(a,e.y,e.height);return`${r} ${o}`}function _n(e,{attrX:t,attrY:a,attrScale:r,originX:o,originY:n,pathLength:s,pathSpacing:i=1,pathOffset:l=0,...u},d,c){if(Un(e,u,c),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:p,style:g,dimensions:L}=e;p.transform&&(L&&(g.transform=p.transform),delete p.transform),L&&(o!==void 0||n!==void 0||g.transform)&&(g.transformOrigin=w0(L,o!==void 0?o:.5,n!==void 0?n:.5)),t!==void 0&&(p.x=t),a!==void 0&&(p.y=a),r!==void 0&&(p.scale=r),s!==void 0&&S0(p,s,i,l,!1)}var zn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});var Ju=()=>({...zn(),attrs:{}});var Hn=e=>typeof e=="string"&&e.toLowerCase()==="svg";function ed(e,{style:t,vars:a},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(let n in a)e.style.setProperty(n,a[n])}var td=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 ad(e,t,a,r){ed(e,t,void 0,r);for(let o in t.attrs)e.setAttribute(td.has(o)?o:Dn(o),t.attrs[o])}var qn={};function k0(e){Object.assign(qn,e)}function rd(e,{layout:t,layoutId:a}){return Pt.has(e)||e.startsWith("origin")||(t||a!==void 0)&&(!!qn[e]||e==="opacity")}function Wn(e,t,a){var r;let{style:o}=e,n={};for(let s in o)(xe(o[s])||t.style&&xe(t.style[s])||rd(s,e)||((r=a?.getValue(s))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(n[s]=o[s]);return n}function od(e,t,a){let r=Wn(e,t,a);for(let o in e)if(xe(e[o])||xe(t[o])){let n=Ia.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[n]=e[o]}return r}function uP(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}var b0=["x","y","width","height","cx","cy","r"],P0={useVisualState:Qu({scrapeMotionValuesFromProps:od,createRenderState:Ju,onUpdate:({props:e,prevProps:t,current:a,renderState:r,latestValues:o})=>{if(!a)return;let n=!!e.drag;if(!n){for(let i in o)if(Pt.has(i)){n=!0;break}}if(!n)return;let s=!t;if(t)for(let i=0;i<b0.length;i++){let l=b0[i];e[l]!==t[l]&&(s=!0)}s&&Z.read(()=>{uP(a,r),Z.render(()=>{_n(r,o,Hn(a.tagName),e.transformTemplate),ad(a,r)})})}})};var T0={useVisualState:Qu({scrapeMotionValuesFromProps:Wn,createRenderState:zn})};var Gn=E($(),1);var A0=E($(),1);function Zp(e,t,a){for(let r in t)!xe(t[r])&&!rd(r,a)&&(e[r]=t[r])}function dP({transformTemplate:e},t){return(0,A0.useMemo)(()=>{let a=zn();return Un(a,t,e),Object.assign({},a.vars,a.style)},[t])}function cP(e,t){let a=e.style||{},r={};return Zp(r,a,e),Object.assign(r,dP(e,t)),r}function R0(e,t){let a={},r=cP(e,t);return e.drag&&e.dragListener!==!1&&(a.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)&&(a.tabIndex=0),a.style=r,a}var D0=E($(),1);function M0(e,t,a,r){let o=(0,D0.useMemo)(()=>{let n=Ju();return _n(n,t,Hn(r),e.transformTemplate),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let n={};Zp(n,e.style,e),o.style={...n,...o.style}}return o}function N0(e=!1){return(a,r,o,{latestValues:n},s)=>{let l=(En(a)?M0:R0)(r,n,s,a),u=Jv(r,typeof a=="string",e),d=a!==Gn.Fragment?{...u,...l,ref:o}:{},{children:c}=r,p=(0,Gn.useMemo)(()=>xe(c)?c.get():c,[c]);return(0,Gn.createElement)(a,{...d,children:p})}}function E0(e,t){return function(r,{forwardMotionProps:o}={forwardMotionProps:!1}){let s={...En(r)?P0:T0,preloadedFeatures:e,useRender:N0(o),createVisualElement:t,Component:r};return c0(s)}}function Jp(e,t){if(!Array.isArray(t))return!1;let a=t.length;if(a!==e.length)return!1;for(let r=0;r<a;r++)if(t[r]!==e[r])return!1;return!0}function Or(e,t,a){let r=e.getProps();return Fn(r,t,a!==void 0?a:r.custom,e)}var em=Lo(()=>window.ScrollTimeline!==void 0);var Di=class{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,a){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=a}attachTimeline(t,a){let r=this.animations.map(o=>{if(em()&&o.attachTimeline)return o.attachTimeline(t);if(typeof a=="function")return a(o)});return()=>{r.forEach((o,n)=>{o&&o(),this.animations[n].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 a=0;a<this.animations.length;a++)t=Math.max(t,this.animations[a].duration);return t}runAll(t){this.animations.forEach(a=>a[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}};var Mi=class extends Di{then(t,a){return Promise.all(this.animations).then(t).catch(a)}};function Vr(e,t){return e?e[t]||e.default||e:void 0}function jn(e){let t=0,a=50,r=e.next(t);for(;!r.done&&t<2e4;)t+=a,r=e.next(t);return t>=2e4?1/0:t}function Ur(e){return typeof e=="function"}function Ni(e,t){e.timeline=t,e.onfinish=null}var Kn=e=>Array.isArray(e)&&typeof e[0]=="number";var am={linearEasing:void 0};function F0(e,t){let a=Lo(e);return()=>{var r;return(r=am[t])!==null&&r!==void 0?r:a()}}var _r=F0(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");var Ei=(e,t,a=10)=>{let r="",o=Math.max(Math.round(t/a),2);for(let n=0;n<o;n++)r+=e(Vt(0,o-1,n))+", ";return`linear(${r.substring(0,r.length-2)})`};function sd(e){return!!(typeof e=="function"&&_r()||!e||typeof e=="string"&&(e in nd||_r())||Kn(e)||Array.isArray(e)&&e.every(sd))}var $n=([e,t,a,r])=>`cubic-bezier(${e}, ${t}, ${a}, ${r})`,nd={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:$n([0,.65,.55,1]),circOut:$n([.55,0,1,.45]),backIn:$n([.31,.01,.66,-.59]),backOut:$n([.33,1.53,.69,.99])};function Xn(e,t){if(e)return typeof e=="function"&&_r()?Ei(e,t):Kn(e)?$n(e):Array.isArray(e)?e.map(a=>Xn(a,t)||nd.easeOut):nd[e]}var _t={x:!1,y:!1};function Qn(){return _t.x||_t.y}function rm(e,t,a){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let o=document;t&&(o=t.current);let n=(r=a?.[e])!==null&&r!==void 0?r:o.querySelectorAll(e);return n?Array.from(n):[]}return Array.from(e)}function id(e,t){let a=rm(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[a,o,()=>r.abort()]}function B0(e){return t=>{t.pointerType==="touch"||Qn()||e(t)}}function om(e,t,a={}){let[r,o,n]=id(e,a),s=B0(i=>{let{target:l}=i,u=t(i);if(typeof u!="function"||!l)return;let d=B0(c=>{u(c),l.removeEventListener("pointerleave",d)});l.addEventListener("pointerleave",d,o)});return r.forEach(i=>{i.addEventListener("pointerenter",s,o)}),n}var ld=(e,t)=>t?e===t?!0:ld(e,t.parentElement):!1;var So=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;var fP=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function O0(e){return fP.has(e.tagName)||e.tabIndex!==-1}var Io=new WeakSet;function V0(e){return t=>{t.key==="Enter"&&e(t)}}function nm(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}var U0=(e,t)=>{let a=e.currentTarget;if(!a)return;let r=V0(()=>{if(Io.has(a))return;nm(a,"down");let o=V0(()=>{nm(a,"up")}),n=()=>nm(a,"cancel");a.addEventListener("keyup",o,t),a.addEventListener("blur",n,t)});a.addEventListener("keydown",r,t),a.addEventListener("blur",()=>a.removeEventListener("keydown",r),t)};function _0(e){return So(e)&&!Qn()}function sm(e,t,a={}){let[r,o,n]=id(e,a),s=i=>{let l=i.currentTarget;if(!_0(i)||Io.has(l))return;Io.add(l);let u=t(i),d=(g,L)=>{window.removeEventListener("pointerup",c),window.removeEventListener("pointercancel",p),!(!_0(g)||!Io.has(l))&&(Io.delete(l),typeof u=="function"&&u(g,{success:L}))},c=g=>{d(g,a.useGlobalTarget||ld(l,g.target))},p=g=>{d(g,!1)};window.addEventListener("pointerup",c,o),window.addEventListener("pointercancel",p,o)};return r.forEach(i=>{!O0(i)&&i.getAttribute("tabindex")===null&&(i.tabIndex=0),(a.useGlobalTarget?window:i).addEventListener("pointerdown",s,o),i.addEventListener("focus",u=>U0(u,o),o)}),n}function im(e){return e==="x"||e==="y"?_t[e]?null:(_t[e]=!0,()=>{_t[e]=!1}):_t.x||_t.y?null:(_t.x=_t.y=!0,()=>{_t.x=_t.y=!1})}var ud=new Set(["width","height","top","left","right","bottom",...Ia]);var dd;function mP(){dd=void 0}var it={now:()=>(dd===void 0&&it.set(Ee.isProcessing||Rn.useManualTiming?Ee.timestamp:performance.now()),dd),set:e=>{dd=e,queueMicrotask(mP)}};function Yn(e,t){e.indexOf(t)===-1&&e.push(t)}function Zn(e,t){let a=e.indexOf(t);a>-1&&e.splice(a,1)}var zr=class{constructor(){this.subscriptions=[]}add(t){return Yn(this.subscriptions,t),()=>Zn(this.subscriptions,t)}notify(t,a,r){let o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,a,r);else for(let n=0;n<o;n++){let s=this.subscriptions[n];s&&s(t,a,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};function cd(e,t){return t?e*(1e3/t):0}var H0=30,hP=e=>!isNaN(parseFloat(e)),q0={current:void 0},lm=class{constructor(t,a={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,o=!0)=>{let n=it.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),o&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=a.owner}setCurrent(t){this.current=t,this.updatedAt=it.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=hP(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,a){this.events[t]||(this.events[t]=new zr);let r=this.events[t].add(a);return t==="change"?()=>{r(),Z.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(let t in this.events)this.events[t].clear()}attach(t,a){this.passiveEffect=t,this.stopPassiveEffect=a}set(t,a=!0){!a||!this.passiveEffect?this.updateAndNotify(t,a):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,a,r){this.set(a),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,a=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,a&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return q0.current&&q0.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let t=it.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>H0)return 0;let a=Math.min(this.updatedAt-this.prevUpdatedAt,H0);return cd(parseFloat(this.current)-parseFloat(this.prevFrameValue),a)}start(t){return this.stop(),new Promise(a=>{this.hasAnimated=!0,this.animation=t(a),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 tr(e,t){return new lm(e,t)}function gP(e,t,a){e.hasValue(t)?e.getValue(t).set(a):e.addValue(t,tr(a))}function W0(e,t){let a=Or(e,t),{transitionEnd:r={},transition:o={},...n}=a||{};n={...n,...r};for(let s in n){let i=h0(n[s]);gP(e,s,i)}}function G0(e){return!!(xe(e)&&e.add)}function Fi(e,t){let a=e.getValue("willChange");if(G0(a))return a.add(t)}function fd(e){return e.props[Ku]}var pd={current:!1};var j0=(e,t,a)=>(((1-3*a+3*t)*e+(3*a-6*t))*e+3*t)*e,xP=1e-7,yP=12;function vP(e,t,a,r,o){let n,s,i=0;do s=t+(a-t)/2,n=j0(s,r,o)-e,n>0?a=s:t=s;while(Math.abs(n)>xP&&++i<yP);return s}function Hr(e,t,a,r){if(e===t&&a===r)return me;let o=n=>vP(n,0,1,e,a);return n=>n===0||n===1?n:j0(o(n),t,r)}var md=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2;var hd=e=>t=>1-e(1-t);var um=Hr(.33,1.53,.69,.99),Bi=hd(um),gd=md(Bi);var xd=e=>(e*=2)<1?.5*Bi(e):.5*(2-Math.pow(2,-10*(e-1)));var yd=e=>1-Math.sin(Math.acos(e)),vd=hd(yd),Ld=md(yd);var Cd=e=>/^0[^.\s]+$/u.test(e);function K0(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Cd(e):!0}var qr=e=>Math.round(e*1e5)/1e5;var Jn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function $0(e){return e==null}var X0=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var es=(e,t)=>a=>!!(typeof a=="string"&&X0.test(a)&&a.startsWith(e)||t&&!$0(a)&&Object.prototype.hasOwnProperty.call(a,t)),Sd=(e,t,a)=>r=>{if(typeof r!="string")return r;let[o,n,s,i]=r.match(Jn);return{[e]:parseFloat(o),[t]:parseFloat(n),[a]:parseFloat(s),alpha:i!==void 0?parseFloat(i):1}};var LP=e=>Je(0,255,e),dm={...wa,transform:e=>Math.round(LP(e))},ba={test:es("rgb","red"),parse:Sd("red","green","blue"),transform:({red:e,green:t,blue:a,alpha:r=1})=>"rgba("+dm.transform(e)+", "+dm.transform(t)+", "+dm.transform(a)+", "+qr(er.transform(r))+")"};function CP(e){let t="",a="",r="",o="";return e.length>5?(t=e.substring(1,3),a=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),a=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,a+=a,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(a,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}var Oi={test:es("#"),parse:CP,transform:ba.transform};var Wr={test:es("hsl","hue"),parse:Sd("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:a,alpha:r=1})=>"hsla("+Math.round(e)+", "+ht.transform(qr(t))+", "+ht.transform(qr(a))+", "+qr(er.transform(r))+")"};var Oe={test:e=>ba.test(e)||Oi.test(e)||Wr.test(e),parse:e=>ba.test(e)?ba.parse(e):Wr.test(e)?Wr.parse(e):Oi.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ba.transform(e):Wr.transform(e)};var Q0=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function SP(e){var t,a;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Jn))===null||t===void 0?void 0:t.length)||0)+(((a=e.match(Q0))===null||a===void 0?void 0:a.length)||0)>0}var Z0="number",J0="color",IP="var",wP="var(",Y0="${}",kP=/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 wo(e){let t=e.toString(),a=[],r={color:[],number:[],var:[]},o=[],n=0,i=t.replace(kP,l=>(Oe.test(l)?(r.color.push(n),o.push(J0),a.push(Oe.parse(l))):l.startsWith(wP)?(r.var.push(n),o.push(IP),a.push(l)):(r.number.push(n),o.push(Z0),a.push(parseFloat(l))),++n,Y0)).split(Y0);return{values:a,split:i,indexes:r,types:o}}function eL(e){return wo(e).values}function tL(e){let{split:t,types:a}=wo(e),r=t.length;return o=>{let n="";for(let s=0;s<r;s++)if(n+=t[s],o[s]!==void 0){let i=a[s];i===Z0?n+=qr(o[s]):i===J0?n+=Oe.transform(o[s]):n+=o[s]}return n}}var bP=e=>typeof e=="number"?0:e;function PP(e){let t=eL(e);return tL(e)(t.map(bP))}var gt={test:SP,parse:eL,createTransformer:tL,getAnimatableNone:PP};var TP=new Set(["brightness","contrast","saturate","opacity"]);function AP(e){let[t,a]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;let[r]=a.match(Jn)||[];if(!r)return e;let o=a.replace(r,""),n=TP.has(t)?1:0;return r!==a&&(n*=100),t+"("+n+o+")"}var RP=/\b([a-z-]*)\(.*?\)/gu,Vi={...gt,getAnimatableNone:e=>{let t=e.match(RP);return t?t.map(AP).join(" "):e}};var DP={...Vn,color:Oe,backgroundColor:Oe,outlineColor:Oe,fill:Oe,stroke:Oe,borderColor:Oe,borderTopColor:Oe,borderRightColor:Oe,borderBottomColor:Oe,borderLeftColor:Oe,filter:Vi,WebkitFilter:Vi},ts=e=>DP[e];function Id(e,t){let a=ts(e);return a!==Vi&&(a=gt),a.getAnimatableNone?a.getAnimatableNone(t):void 0}var MP=new Set(["auto","none","0"]);function aL(e,t,a){let r=0,o;for(;r<e.length&&!o;){let n=e[r];typeof n=="string"&&!MP.has(n)&&wo(n).values.length&&(o=e[r]),r++}if(o&&a)for(let n of t)e[n]=Id(a,o)}var cm=e=>e===wa||e===H,rL=(e,t)=>parseFloat(e.split(", ")[t]),oL=(e,t)=>(a,{transform:r})=>{if(r==="none"||!r)return 0;let o=r.match(/^matrix3d\((.+)\)$/u);if(o)return rL(o[1],t);{let n=r.match(/^matrix\((.+)\)$/u);return n?rL(n[1],e):0}},NP=new Set(["x","y","z"]),EP=Ia.filter(e=>!NP.has(e));function nL(e){let t=[];return EP.forEach(a=>{let r=e.getValue(a);r!==void 0&&(t.push([a,r.get()]),r.set(a.startsWith("scale")?1:0))}),t}var ko={width:({x:e},{paddingLeft:t="0",paddingRight:a="0"})=>e.max-e.min-parseFloat(t)-parseFloat(a),height:({y:e},{paddingTop:t="0",paddingBottom:a="0"})=>e.max-e.min-parseFloat(t)-parseFloat(a),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:oL(4,13),y:oL(5,14)};ko.translateX=ko.x;ko.translateY=ko.y;var bo=new Set,fm=!1,pm=!1;function sL(){if(pm){let e=Array.from(bo).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),a=new Map;t.forEach(r=>{let o=nL(r);o.length&&(a.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();let o=a.get(r);o&&o.forEach(([n,s])=>{var i;(i=r.getValue(n))===null||i===void 0||i.set(s)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}pm=!1,fm=!1,bo.forEach(e=>e.complete()),bo.clear()}function iL(){bo.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(pm=!0)})}function lL(){iL(),sL()}var Gr=class{constructor(t,a,r,o,n,s=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=a,this.name=r,this.motionValue=o,this.element=n,this.isAsync=s}scheduleResolve(){this.isScheduled=!0,this.isAsync?(bo.add(this),fm||(fm=!0,Z.read(iL),Z.resolveKeyframes(sL))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:t,name:a,element:r,motionValue:o}=this;for(let n=0;n<t.length;n++)if(t[n]===null)if(n===0){let s=o?.get(),i=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&a){let l=r.readValue(a,i);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=i),o&&s===void 0&&o.set(t[0])}else t[n]=t[n-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),bo.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,bo.delete(this))}resume(){this.isComplete||this.scheduleResolve()}};var wd=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);var FP=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function BP(e){let t=FP.exec(e);if(!t)return[,];let[,a,r,o]=t;return[`--${a??r}`,o]}var OP=4;function mm(e,t,a=1){ca(a<=OP,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);let[r,o]=BP(e);if(!r)return;let n=window.getComputedStyle(t).getPropertyValue(r);if(n){let s=n.trim();return wd(s)?parseFloat(s):s}return On(o)?mm(o,t,a+1):o}var kd=e=>t=>t.test(e);var uL={test:e=>e==="auto",parse:e=>e};var hm=[wa,H,ht,ka,y0,x0,uL],gm=e=>hm.find(kd(e));var as=class extends Gr{constructor(t,a,r,o,n){super(t,a,r,o,n,!0)}readKeyframes(){let{unresolvedKeyframes:t,element:a,name:r}=this;if(!a||!a.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let u=t[l];if(typeof u=="string"&&(u=u.trim(),On(u))){let d=mm(u,a.current);d!==void 0&&(t[l]=d),l===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!ud.has(r)||t.length!==2)return;let[o,n]=t,s=gm(o),i=gm(n);if(s!==i)if(cm(s)&&cm(i))for(let l=0;l<t.length;l++){let u=t[l];typeof u=="string"&&(t[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){let{unresolvedKeyframes:t,name:a}=this,r=[];for(let o=0;o<t.length;o++)K0(t[o])&&r.push(o);r.length&&aL(t,r,a)}measureInitialState(){let{element:t,unresolvedKeyframes:a,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ko[r](t.measureViewportBox(),window.getComputedStyle(t.current)),a[0]=this.measuredOrigin;let o=a[a.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){var t;let{element:a,name:r,unresolvedKeyframes:o}=this;if(!a||!a.current)return;let n=a.getValue(r);n&&n.jump(this.measuredOrigin,!1);let s=o.length-1,i=o[s];o[s]=ko[r](a.measureViewportBox(),window.getComputedStyle(a.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,u])=>{a.getValue(l).set(u)}),this.resolveNoneKeyframes()}};var xm=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(gt.test(e)||e==="0")&&!e.startsWith("url("));function VP(e){let t=e[0];if(e.length===1)return!0;for(let a=0;a<e.length;a++)if(e[a]!==t)return!0}function dL(e,t,a,r){let o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;let n=e[e.length-1],s=xm(o,t),i=xm(n,t);return Qa(s===i,`You are trying to animate ${t} from "${o}" to "${n}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${n} via the \`style\` property.`),!s||!i?!1:VP(e)||(a==="spring"||Ur(a))&&r}var UP=e=>e!==null;function jr(e,{repeat:t,repeatType:a="loop"},r){let o=e.filter(UP),n=t&&a!=="loop"&&t%2===1?0:o.length-1;return!n||r===void 0?o[n]:r}var _P=40,rs=class{constructor({autoplay:t=!0,delay:a=0,type:r="keyframes",repeat:o=0,repeatDelay:n=0,repeatType:s="loop",...i}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=it.now(),this.options={autoplay:t,delay:a,type:r,repeat:o,repeatDelay:n,repeatType:s,...i},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>_P?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&lL(),this._resolved}onKeyframesResolved(t,a){this.resolvedAt=it.now(),this.hasAttemptedResolve=!0;let{name:r,type:o,velocity:n,delay:s,onComplete:i,onUpdate:l,isGenerator:u}=this.options;if(!u&&!dL(t,r,o,n))if(pd.current||!s){l&&l(jr(t,this.options,a)),i&&i(),this.resolveFinishedPromise();return}else this.options.duration=0;let d=this.initPlayback(t,a);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:a,...d},this.onPostResolved())}onPostResolved(){}then(t,a){return this.currentFinishedPromise.then(t,a)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}};var ne=(e,t,a)=>e+(t-e)*a;function ym(e,t,a){return a<0&&(a+=1),a>1&&(a-=1),a<1/6?e+(t-e)*6*a:a<1/2?t:a<2/3?e+(t-e)*(2/3-a)*6:e}function cL({hue:e,saturation:t,lightness:a,alpha:r}){e/=360,t/=100,a/=100;let o=0,n=0,s=0;if(!t)o=n=s=a;else{let i=a<.5?a*(1+t):a+t-a*t,l=2*a-i;o=ym(l,i,e+1/3),n=ym(l,i,e),s=ym(l,i,e-1/3)}return{red:Math.round(o*255),green:Math.round(n*255),blue:Math.round(s*255),alpha:r}}function os(e,t){return a=>a>0?t:e}var vm=(e,t,a)=>{let r=e*e,o=a*(t*t-r)+r;return o<0?0:Math.sqrt(o)},zP=[Oi,ba,Wr],HP=e=>zP.find(t=>t.test(e));function fL(e){let t=HP(e);if(Qa(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let a=t.parse(e);return t===Wr&&(a=cL(a)),a}var Lm=(e,t)=>{let a=fL(e),r=fL(t);if(!a||!r)return os(e,t);let o={...a};return n=>(o.red=vm(a.red,r.red,n),o.green=vm(a.green,r.green,n),o.blue=vm(a.blue,r.blue,n),o.alpha=ne(a.alpha,r.alpha,n),ba.transform(o))};var qP=(e,t)=>a=>t(e(a)),Pa=(...e)=>e.reduce(qP);var bd=new Set(["none","hidden"]);function pL(e,t){return bd.has(e)?a=>a<=0?e:t:a=>a>=1?t:e}function WP(e,t){return a=>ne(e,t,a)}function Pd(e){return typeof e=="number"?WP:typeof e=="string"?On(e)?os:Oe.test(e)?Lm:KP:Array.isArray(e)?mL:typeof e=="object"?Oe.test(e)?Lm:GP:os}function mL(e,t){let a=[...e],r=a.length,o=e.map((n,s)=>Pd(n)(n,t[s]));return n=>{for(let s=0;s<r;s++)a[s]=o[s](n);return a}}function GP(e,t){let a={...e,...t},r={};for(let o in a)e[o]!==void 0&&t[o]!==void 0&&(r[o]=Pd(e[o])(e[o],t[o]));return o=>{for(let n in r)a[n]=r[n](o);return a}}function jP(e,t){var a;let r=[],o={color:0,var:0,number:0};for(let n=0;n<t.values.length;n++){let s=t.types[n],i=e.indexes[s][o[s]],l=(a=e.values[i])!==null&&a!==void 0?a:0;r[n]=l,o[s]++}return r}var KP=(e,t)=>{let a=gt.createTransformer(t),r=wo(e),o=wo(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?bd.has(e)&&!o.values.length||bd.has(t)&&!r.values.length?pL(e,t):Pa(mL(jP(r,o),o.values),a):(Qa(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),os(e,t))};function Td(e,t,a){return typeof e=="number"&&typeof t=="number"&&typeof a=="number"?ne(e,t,a):Pd(e)(e,t)}var $P=5;function Ad(e,t,a){let r=Math.max(t-$P,0);return cd(a-e(r),t-r)}var Ce={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};var Cm=.001;function hL({duration:e=Ce.duration,bounce:t=Ce.bounce,velocity:a=Ce.velocity,mass:r=Ce.mass}){let o,n;Qa(e<=Ne(Ce.maxDuration),"Spring duration must be 10 seconds or less");let s=1-t;s=Je(Ce.minDamping,Ce.maxDamping,s),e=Je(Ce.minDuration,Ce.maxDuration,Ze(e)),s<1?(o=u=>{let d=u*s,c=d*e,p=d-a,g=Rd(u,s),L=Math.exp(-c);return Cm-p/g*L},n=u=>{let c=u*s*e,p=c*a+a,g=Math.pow(s,2)*Math.pow(u,2)*e,L=Math.exp(-c),C=Rd(Math.pow(u,2),s);return(-o(u)+Cm>0?-1:1)*((p-g)*L)/C}):(o=u=>{let d=Math.exp(-u*e),c=(u-a)*e+1;return-Cm+d*c},n=u=>{let d=Math.exp(-u*e),c=(a-u)*(e*e);return d*c});let i=5/e,l=QP(o,n,i);if(e=Ne(e),isNaN(l))return{stiffness:Ce.stiffness,damping:Ce.damping,duration:e};{let u=Math.pow(l,2)*r;return{stiffness:u,damping:s*2*Math.sqrt(r*u),duration:e}}}var XP=12;function QP(e,t,a){let r=a;for(let o=1;o<XP;o++)r=r-e(r)/t(r);return r}function Rd(e,t){return e*Math.sqrt(1-t*t)}var YP=["duration","bounce"],ZP=["stiffness","damping","mass"];function gL(e,t){return t.some(a=>e[a]!==void 0)}function JP(e){let t={velocity:Ce.velocity,stiffness:Ce.stiffness,damping:Ce.damping,mass:Ce.mass,isResolvedFromDuration:!1,...e};if(!gL(e,ZP)&&gL(e,YP))if(e.visualDuration){let a=e.visualDuration,r=2*Math.PI/(a*1.2),o=r*r,n=2*Je(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Ce.mass,stiffness:o,damping:n}}else{let a=hL(e);t={...t,...a,mass:Ce.mass},t.isResolvedFromDuration=!0}return t}function Dd(e=Ce.visualDuration,t=Ce.bounce){let a=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:r,restDelta:o}=a,n=a.keyframes[0],s=a.keyframes[a.keyframes.length-1],i={done:!1,value:n},{stiffness:l,damping:u,mass:d,duration:c,velocity:p,isResolvedFromDuration:g}=JP({...a,velocity:-Ze(a.velocity||0)}),L=p||0,C=u/(2*Math.sqrt(l*d)),w=s-n,h=Ze(Math.sqrt(l/d)),m=Math.abs(w)<5;r||(r=m?Ce.restSpeed.granular:Ce.restSpeed.default),o||(o=m?Ce.restDelta.granular:Ce.restDelta.default);let x;if(C<1){let k=Rd(h,C);x=A=>{let P=Math.exp(-C*h*A);return s-P*((L+C*h*w)/k*Math.sin(k*A)+w*Math.cos(k*A))}}else if(C===1)x=k=>s-Math.exp(-h*k)*(w+(L+h*w)*k);else{let k=h*Math.sqrt(C*C-1);x=A=>{let P=Math.exp(-C*h*A),R=Math.min(k*A,300);return s-P*((L+C*h*w)*Math.sinh(R)+k*w*Math.cosh(R))/k}}let S={calculatedDuration:g&&c||null,next:k=>{let A=x(k);if(g)i.done=k>=c;else{let P=0;C<1&&(P=k===0?Ne(L):Ad(x,k,A));let R=Math.abs(P)<=r,M=Math.abs(s-A)<=o;i.done=R&&M}return i.value=i.done?s:A,i},toString:()=>{let k=Math.min(jn(S),2e4),A=Ei(P=>S.next(k*P).value,k,30);return k+"ms "+A}};return S}function Sm({keyframes:e,velocity:t=0,power:a=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:n=500,modifyTarget:s,min:i,max:l,restDelta:u=.5,restSpeed:d}){let c=e[0],p={done:!1,value:c},g=R=>i!==void 0&&R<i||l!==void 0&&R>l,L=R=>i===void 0?l:l===void 0||Math.abs(i-R)<Math.abs(l-R)?i:l,C=a*t,w=c+C,h=s===void 0?w:s(w);h!==w&&(C=h-c);let m=R=>-C*Math.exp(-R/r),x=R=>h+m(R),S=R=>{let M=m(R),O=x(R);p.done=Math.abs(M)<=u,p.value=p.done?h:O},k,A,P=R=>{g(p.value)&&(k=R,A=Dd({keyframes:[p.value,L(p.value)],velocity:Ad(x,R,p.value),damping:o,stiffness:n,restDelta:u,restSpeed:d}))};return P(0),{calculatedDuration:null,next:R=>{let M=!1;return!A&&k===void 0&&(M=!0,S(R),P(R)),k!==void 0&&R>=k?A.next(R-k):(!M&&S(R),p)}}}var xL=Hr(.42,0,1,1),yL=Hr(0,0,.58,1),Md=Hr(.42,0,.58,1);var vL=e=>Array.isArray(e)&&typeof e[0]!="number";var LL={linear:me,easeIn:xL,easeInOut:Md,easeOut:yL,circIn:yd,circInOut:Ld,circOut:vd,backIn:Bi,backInOut:gd,backOut:um,anticipate:xd},Im=e=>{if(Kn(e)){ca(e.length===4,"Cubic bezier arrays must contain four numerical values.");let[t,a,r,o]=e;return Hr(t,a,r,o)}else if(typeof e=="string")return ca(LL[e]!==void 0,`Invalid easing type '${e}'`),LL[e];return e};function e1(e,t,a){let r=[],o=a||Td,n=e.length-1;for(let s=0;s<n;s++){let i=o(e[s],e[s+1]);if(t){let l=Array.isArray(t)?t[s]||me:t;i=Pa(l,i)}r.push(i)}return r}function CL(e,t,{clamp:a=!0,ease:r,mixer:o}={}){let n=e.length;if(ca(n===t.length,"Both input and output ranges must be the same length"),n===1)return()=>t[0];if(n===2&&t[0]===t[1])return()=>t[1];let s=e[0]===e[1];e[0]>e[n-1]&&(e=[...e].reverse(),t=[...t].reverse());let i=e1(t,r,o),l=i.length,u=d=>{if(s&&d<e[0])return t[0];let c=0;if(l>1)for(;c<e.length-2&&!(d<e[c+1]);c++);let p=Vt(e[c],e[c+1],d);return i[c](p)};return a?d=>u(Je(e[0],e[n-1],d)):u}function SL(e,t){let a=e[e.length-1];for(let r=1;r<=t;r++){let o=Vt(0,t,r);e.push(ne(a,1,o))}}function IL(e){let t=[0];return SL(t,e.length-1),t}function wL(e,t){return e.map(a=>a*t)}function t1(e,t){return e.map(()=>t||Md).splice(0,e.length-1)}function Ui({duration:e=300,keyframes:t,times:a,ease:r="easeInOut"}){let o=vL(r)?r.map(Im):Im(r),n={done:!1,value:t[0]},s=wL(a&&a.length===t.length?a:IL(t),e),i=CL(s,t,{ease:Array.isArray(o)?o:t1(t,o)});return{calculatedDuration:e,next:l=>(n.value=i(l),n.done=l>=e,n)}}var kL=e=>{let t=({timestamp:a})=>e(a);return{start:()=>Z.update(t,!0),stop:()=>Ut(t),now:()=>Ee.isProcessing?Ee.timestamp:it.now()}};var a1={decay:Sm,inertia:Sm,tween:Ui,keyframes:Ui,spring:Dd},r1=e=>e/100,Po=class extends rs{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();let{onStop:l}=this.options;l&&l()};let{name:a,motionValue:r,element:o,keyframes:n}=this.options,s=o?.KeyframeResolver||Gr,i=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new s(n,i,a,r,o),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){let{type:a="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:n,velocity:s=0}=this.options,i=Ur(a)?a:a1[a]||Ui,l,u;i!==Ui&&typeof t[0]!="number"&&(l=Pa(r1,Td(t[0],t[1])),t=[0,100]);let d=i({...this.options,keyframes:t});n==="mirror"&&(u=i({...this.options,keyframes:[...t].reverse(),velocity:-s})),d.calculatedDuration===null&&(d.calculatedDuration=jn(d));let{calculatedDuration:c}=d,p=c+o,g=p*(r+1)-o;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:c,resolvedDuration:p,totalDuration:g}}onPostResolved(){let{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,a=!1){let{resolved:r}=this;if(!r){let{keyframes:R}=this.options;return{done:!0,value:R[R.length-1]}}let{finalKeyframe:o,generator:n,mirroredGenerator:s,mapPercentToKeyframes:i,keyframes:l,calculatedDuration:u,totalDuration:d,resolvedDuration:c}=r;if(this.startTime===null)return n.next(0);let{delay:p,repeat:g,repeatType:L,repeatDelay:C,onUpdate:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),a?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;let h=this.currentTime-p*(this.speed>=0?1:-1),m=this.speed>=0?h<0:h>d;this.currentTime=Math.max(h,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let x=this.currentTime,S=n;if(g){let R=Math.min(this.currentTime,d)/c,M=Math.floor(R),O=R%1;!O&&R>=1&&(O=1),O===1&&M--,M=Math.min(M,g+1),M%2&&(L==="reverse"?(O=1-O,C&&(O-=C/c)):L==="mirror"&&(S=s)),x=Je(0,1,O)*c}let k=m?{done:!1,value:l[0]}:S.next(x);i&&(k.value=i(k.value));let{done:A}=k;!m&&u!==null&&(A=this.speed>=0?this.currentTime>=d:this.currentTime<=0);let P=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return P&&o!==void 0&&(k.value=jr(l,this.options,o)),w&&w(k.value),P&&this.finish(),k}get duration(){let{resolved:t}=this;return t?Ze(t.calculatedDuration):0}get time(){return Ze(this.currentTime)}set time(t){t=Ne(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){let a=this.playbackSpeed!==t;this.playbackSpeed=t,a&&(this.time=Ze(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;let{driver:t=kL,onPlay:a,startTime:r}=this.options;this.driver||(this.driver=t(n=>this.tick(n))),a&&a();let o=this.driver.now();this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=o):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";let{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)}};var bL=new Set(["opacity","clipPath","filter","transform"]);function PL(e,t,a,{delay:r=0,duration:o=300,repeat:n=0,repeatType:s="loop",ease:i="easeInOut",times:l}={}){let u={[t]:a};l&&(u.offset=l);let d=Xn(i,o);return Array.isArray(d)&&(u.easing=d),e.animate(u,{delay:r,duration:o,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:n+1,direction:s==="reverse"?"alternate":"normal"})}var TL=Lo(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));var Nd=10,o1=2e4;function n1(e){return Ur(e.type)||e.type==="spring"||!sd(e.ease)}function s1(e,t){let a=new Po({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0}),r={done:!1,value:e[0]},o=[],n=0;for(;!r.done&&n<o1;)r=a.sample(n),o.push(r.value),n+=Nd;return{times:void 0,keyframes:o,duration:n-Nd,ease:"linear"}}var AL={anticipate:xd,backInOut:gd,circInOut:Ld};function i1(e){return e in AL}var _i=class extends rs{constructor(t){super(t);let{name:a,motionValue:r,element:o,keyframes:n}=this.options;this.resolver=new as(n,(s,i)=>this.onKeyframesResolved(s,i),a,r,o),this.resolver.scheduleResolve()}initPlayback(t,a){let{duration:r=300,times:o,ease:n,type:s,motionValue:i,name:l,startTime:u}=this.options;if(!i.owner||!i.owner.current)return!1;if(typeof n=="string"&&_r()&&i1(n)&&(n=AL[n]),n1(this.options)){let{onComplete:c,onUpdate:p,motionValue:g,element:L,...C}=this.options,w=s1(t,C);t=w.keyframes,t.length===1&&(t[1]=t[0]),r=w.duration,o=w.times,n=w.ease,s="keyframes"}let d=PL(i.owner.current,l,t,{...this.options,duration:r,times:o,ease:n});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(Ni(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{let{onComplete:c}=this.options;i.set(jr(t,this.options,a)),c&&c(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:o,type:s,ease:n,keyframes:t}}get duration(){let{resolved:t}=this;if(!t)return 0;let{duration:a}=t;return Ze(a)}get time(){let{resolved:t}=this;if(!t)return 0;let{animation:a}=t;return Ze(a.currentTime||0)}set time(t){let{resolved:a}=this;if(!a)return;let{animation:r}=a;r.currentTime=Ne(t)}get speed(){let{resolved:t}=this;if(!t)return 1;let{animation:a}=t;return a.playbackRate}set speed(t){let{resolved:a}=this;if(!a)return;let{animation:r}=a;r.playbackRate=t}get state(){let{resolved:t}=this;if(!t)return"idle";let{animation:a}=t;return a.playState}get startTime(){let{resolved:t}=this;if(!t)return null;let{animation:a}=t;return a.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{let{resolved:a}=this;if(!a)return me;let{animation:r}=a;Ni(r,t)}return me}play(){if(this.isStopped)return;let{resolved:t}=this;if(!t)return;let{animation:a}=t;a.playState==="finished"&&this.updateFinishedPromise(),a.play()}pause(){let{resolved:t}=this;if(!t)return;let{animation:a}=t;a.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();let{resolved:t}=this;if(!t)return;let{animation:a,keyframes:r,duration:o,type:n,ease:s,times:i}=t;if(a.playState==="idle"||a.playState==="finished")return;if(this.time){let{motionValue:u,onUpdate:d,onComplete:c,element:p,...g}=this.options,L=new Po({...g,keyframes:r,duration:o,type:n,ease:s,times:i,isGenerator:!0}),C=Ne(this.time);u.setWithVelocity(L.sample(C-Nd).value,L.sample(C).value,Nd)}let{onStop:l}=this.options;l&&l(),this.cancel()}complete(){let{resolved:t}=this;t&&t.animation.finish()}cancel(){let{resolved:t}=this;t&&t.animation.cancel()}static supports(t){let{motionValue:a,name:r,repeatDelay:o,repeatType:n,damping:s,type:i}=t;if(!a||!a.owner||!(a.owner.current instanceof HTMLElement))return!1;let{onUpdate:l,transformTemplate:u}=a.owner.getProps();return TL()&&r&&bL.has(r)&&!l&&!u&&!o&&n!=="mirror"&&s!==0&&i!=="inertia"}};var l1={type:"spring",stiffness:500,damping:25,restSpeed:10},u1=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),d1={type:"keyframes",duration:.8},c1={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},RL=(e,{keyframes:t})=>t.length>2?d1:Pt.has(e)?e.startsWith("scale")?u1(t[1]):l1:c1;function DL({when:e,delay:t,delayChildren:a,staggerChildren:r,staggerDirection:o,repeat:n,repeatType:s,repeatDelay:i,from:l,elapsed:u,...d}){return!!Object.keys(d).length}var ns=(e,t,a,r={},o,n)=>s=>{let i=Vr(r,e)||{},l=i.delay||r.delay||0,{elapsed:u=0}=r;u=u-Ne(l);let d={keyframes:Array.isArray(a)?a:[null,a],ease:"easeOut",velocity:t.getVelocity(),...i,delay:-u,onUpdate:p=>{t.set(p),i.onUpdate&&i.onUpdate(p)},onComplete:()=>{s(),i.onComplete&&i.onComplete()},name:e,motionValue:t,element:n?void 0:o};DL(i)||(d={...d,...RL(e,d)}),d.duration&&(d.duration=Ne(d.duration)),d.repeatDelay&&(d.repeatDelay=Ne(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let c=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(c=!0)),(pd.current||Rn.skipAnimations)&&(c=!0,d.duration=0,d.delay=0),c&&!n&&t.get()!==void 0){let p=jr(d.keyframes,i);if(p!==void 0)return Z.update(()=>{d.onUpdate(p),d.onComplete()}),new Mi([])}return!n&&_i.supports(d)?new _i(d):new Po(d)};function f1({protectedKeys:e,needsAnimating:t},a){let r=e.hasOwnProperty(a)&&t[a]!==!0;return t[a]=!1,r}function Ed(e,t,{delay:a=0,transitionOverride:r,type:o}={}){var n;let{transition:s=e.getDefaultTransition(),transitionEnd:i,...l}=t;r&&(s=r);let u=[],d=o&&e.animationState&&e.animationState.getState()[o];for(let c in l){let p=e.getValue(c,(n=e.latestValues[c])!==null&&n!==void 0?n:null),g=l[c];if(g===void 0||d&&f1(d,c))continue;let L={delay:a,...Vr(s||{},c)},C=!1;if(window.MotionHandoffAnimation){let h=fd(e);if(h){let m=window.MotionHandoffAnimation(h,c,Z);m!==null&&(L.startTime=m,C=!0)}}Fi(e,c),p.start(ns(c,p,g,e.shouldReduceMotion&&ud.has(c)?{type:!1}:L,e,C));let w=p.animation;w&&u.push(w)}return i&&Promise.all(u).then(()=>{Z.update(()=>{i&&W0(e,i)})}),u}function Fd(e,t,a={}){var r;let o=Or(e,t,a.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0),{transition:n=e.getDefaultTransition()||{}}=o||{};a.transitionOverride&&(n=a.transitionOverride);let s=o?()=>Promise.all(Ed(e,o,a)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(u=0)=>{let{delayChildren:d=0,staggerChildren:c,staggerDirection:p}=n;return p1(e,t,d+u,c,p,a)}:()=>Promise.resolve(),{when:l}=n;if(l){let[u,d]=l==="beforeChildren"?[s,i]:[i,s];return u().then(()=>d())}else return Promise.all([s(),i(a.delay)])}function p1(e,t,a=0,r=0,o=1,n){let s=[],i=(e.variantChildren.size-1)*r,l=o===1?(u=0)=>u*r:(u=0)=>i-u*r;return Array.from(e.variantChildren).sort(m1).forEach((u,d)=>{u.notify("AnimationStart",t),s.push(Fd(u,t,{...n,delay:a+l(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(s)}function m1(e,t){return e.sortNodePosition(t)}function ML(e,t,a={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){let o=t.map(n=>Fd(e,n,a));r=Promise.all(o)}else if(typeof t=="string")r=Fd(e,t,a);else{let o=typeof t=="function"?Or(e,t,a.custom):t;r=Promise.all(Ed(e,o,a))}return r.then(()=>{e.notify("AnimationComplete",t)})}var h1=Pi.length;function wm(e){if(!e)return;if(!e.isControllingVariants){let a=e.parent?wm(e.parent)||{}:{};return e.props.initial!==void 0&&(a.initial=e.props.initial),a}let t={};for(let a=0;a<h1;a++){let r=Pi[a],o=e.props[r];(Za(o)||o===!1)&&(t[r]=o)}return t}var g1=[...Wu].reverse(),x1=Wu.length;function y1(e){return t=>Promise.all(t.map(({animation:a,options:r})=>ML(e,a,r)))}function EL(e){let t=y1(e),a=NL(),r=!0,o=l=>(u,d)=>{var c;let p=Or(e,d,l==="exit"?(c=e.presenceContext)===null||c===void 0?void 0:c.custom:void 0);if(p){let{transition:g,transitionEnd:L,...C}=p;u={...u,...C,...L}}return u};function n(l){t=l(e)}function s(l){let{props:u}=e,d=wm(e.parent)||{},c=[],p=new Set,g={},L=1/0;for(let w=0;w<x1;w++){let h=g1[w],m=a[h],x=u[h]!==void 0?u[h]:d[h],S=Za(x),k=h===l?m.isActive:null;k===!1&&(L=w);let A=x===d[h]&&x!==u[h]&&S;if(A&&r&&e.manuallyAnimateOnMount&&(A=!1),m.protectedKeys={...g},!m.isActive&&k===null||!x&&!m.prevProp||Br(x)||typeof x=="boolean")continue;let P=v1(m.prevProp,x),R=P||h===l&&m.isActive&&!A&&S||w>L&&S,M=!1,O=Array.isArray(x)?x:[x],pe=O.reduce(o(h),{});k===!1&&(pe={});let{prevResolvedValues:se={}}=m,Zt={...se,...pe},fa=Re=>{R=!0,p.has(Re)&&(M=!0,p.delete(Re)),m.needsAnimating[Re]=!0;let dt=e.getValue(Re);dt&&(dt.liveStyle=!1)};for(let Re in Zt){let dt=pe[Re],qt=se[Re];if(g.hasOwnProperty(Re))continue;let oe=!1;Ti(dt)&&Ti(qt)?oe=!Jp(dt,qt):oe=dt!==qt,oe?dt!=null?fa(Re):p.add(Re):dt!==void 0&&p.has(Re)?fa(Re):m.protectedKeys[Re]=!0}m.prevProp=x,m.prevResolvedValues=pe,m.isActive&&(g={...g,...pe}),r&&e.blockInitialAnimation&&(R=!1),R&&(!(A&&P)||M)&&c.push(...O.map(Re=>({animation:Re,options:{type:h}})))}if(p.size){let w={};p.forEach(h=>{let m=e.getBaseTarget(h),x=e.getValue(h);x&&(x.liveStyle=!0),w[h]=m??null}),c.push({animation:w})}let C=!!c.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(C=!1),r=!1,C?t(c):Promise.resolve()}function i(l,u){var d;if(a[l].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(p=>{var g;return(g=p.animationState)===null||g===void 0?void 0:g.setActive(l,u)}),a[l].isActive=u;let c=s(l);for(let p in a)a[p].protectedKeys={};return c}return{animateChanges:s,setActive:i,setAnimateFunction:n,getState:()=>a,reset:()=>{a=NL(),r=!0}}}function v1(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Jp(t,e):!1}function To(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function NL(){return{animate:To(!0),whileInView:To(),whileHover:To(),whileTap:To(),whileDrag:To(),whileFocus:To(),exit:To()}}var Ke=class{constructor(t){this.isMounted=!1,this.node=t}update(){}};var Bd=class extends Ke{constructor(t){super(t),t.animationState||(t.animationState=EL(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();Br(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:t}=this.node.getProps(),{animate:a}=this.node.prevProps||{};t!==a&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}};var L1=0,Od=class extends Ke{constructor(){super(...arguments),this.id=L1++}update(){if(!this.node.presenceContext)return;let{isPresent:t,onExitComplete:a}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;let o=this.node.animationState.setActive("exit",!t);a&&!t&&o.then(()=>a(this.id))}mount(){let{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}};var FL={animation:{Feature:Bd},exit:{Feature:Od}};function ar(e,t,a,r={passive:!0}){return e.addEventListener(t,a,r),()=>e.removeEventListener(t,a)}function rr(e){return{point:{x:e.pageX,y:e.pageY}}}var BL=e=>t=>So(t)&&e(t,rr(t));function Kr(e,t,a,r){return ar(e,t,BL(a),r)}var OL=(e,t)=>Math.abs(e-t);function VL(e,t){let a=OL(e.x,t.x),r=OL(e.y,t.y);return Math.sqrt(a**2+r**2)}var ss=class{constructor(t,a,{transformPagePoint:r,contextWindow:o,dragSnapToOrigin:n=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let c=bm(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,g=VL(c.offset,{x:0,y:0})>=3;if(!p&&!g)return;let{point:L}=c,{timestamp:C}=Ee;this.history.push({...L,timestamp:C});let{onStart:w,onMove:h}=this.handlers;p||(w&&w(this.lastMoveEvent,c),this.startEvent=this.lastMoveEvent),h&&h(this.lastMoveEvent,c)},this.handlePointerMove=(c,p)=>{this.lastMoveEvent=c,this.lastMoveEventInfo=km(p,this.transformPagePoint),Z.update(this.updatePoint,!0)},this.handlePointerUp=(c,p)=>{this.end();let{onEnd:g,onSessionEnd:L,resumeAnimation:C}=this.handlers;if(this.dragSnapToOrigin&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let w=bm(c.type==="pointercancel"?this.lastMoveEventInfo:km(p,this.transformPagePoint),this.history);this.startEvent&&g&&g(c,w),L&&L(c,w)},!So(t))return;this.dragSnapToOrigin=n,this.handlers=a,this.transformPagePoint=r,this.contextWindow=o||window;let s=rr(t),i=km(s,this.transformPagePoint),{point:l}=i,{timestamp:u}=Ee;this.history=[{...l,timestamp:u}];let{onSessionStart:d}=a;d&&d(t,bm(i,this.history)),this.removeListeners=Pa(Kr(this.contextWindow,"pointermove",this.handlePointerMove),Kr(this.contextWindow,"pointerup",this.handlePointerUp),Kr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Ut(this.updatePoint)}};function km(e,t){return t?{point:t(e.point)}:e}function UL(e,t){return{x:e.x-t.x,y:e.y-t.y}}function bm({point:e},t){return{point:e,delta:UL(e,_L(t)),offset:UL(e,C1(t)),velocity:S1(t,.1)}}function C1(e){return e[0]}function _L(e){return e[e.length-1]}function S1(e,t){if(e.length<2)return{x:0,y:0};let a=e.length-1,r=null,o=_L(e);for(;a>=0&&(r=e[a],!(o.timestamp-r.timestamp>Ne(t)));)a--;if(!r)return{x:0,y:0};let n=Ze(o.timestamp-r.timestamp);if(n===0)return{x:0,y:0};let s={x:(o.x-r.x)/n,y:(o.y-r.y)/n};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}var WL=1e-4,I1=1-WL,w1=1+WL,GL=.01,k1=0-GL,b1=0+GL;function et(e){return e.max-e.min}function jL(e,t,a){return Math.abs(e-t)<=a}function zL(e,t,a,r=.5){e.origin=r,e.originPoint=ne(t.min,t.max,e.origin),e.scale=et(a)/et(t),e.translate=ne(a.min,a.max,e.origin)-e.originPoint,(e.scale>=I1&&e.scale<=w1||isNaN(e.scale))&&(e.scale=1),(e.translate>=k1&&e.translate<=b1||isNaN(e.translate))&&(e.translate=0)}function is(e,t,a,r){zL(e.x,t.x,a.x,r?r.originX:void 0),zL(e.y,t.y,a.y,r?r.originY:void 0)}function HL(e,t,a){e.min=a.min+t.min,e.max=e.min+et(t)}function KL(e,t,a){HL(e.x,t.x,a.x),HL(e.y,t.y,a.y)}function qL(e,t,a){e.min=t.min-a.min,e.max=e.min+et(t)}function ls(e,t,a){qL(e.x,t.x,a.x),qL(e.y,t.y,a.y)}function ZL(e,{min:t,max:a},r){return t!==void 0&&e<t?e=r?ne(t,e,r.min):Math.max(e,t):a!==void 0&&e>a&&(e=r?ne(a,e,r.max):Math.min(e,a)),e}function $L(e,t,a){return{min:t!==void 0?e.min+t:void 0,max:a!==void 0?e.max+a-(e.max-e.min):void 0}}function JL(e,{top:t,left:a,bottom:r,right:o}){return{x:$L(e.x,a,o),y:$L(e.y,t,r)}}function XL(e,t){let a=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([a,r]=[r,a]),{min:a,max:r}}function eC(e,t){return{x:XL(e.x,t.x),y:XL(e.y,t.y)}}function tC(e,t){let a=.5,r=et(e),o=et(t);return o>r?a=Vt(t.min,t.max-r,e.min):r>o&&(a=Vt(e.min,e.max-o,t.min)),Je(0,1,a)}function aC(e,t){let a={};return t.min!==void 0&&(a.min=t.min-e.min),t.max!==void 0&&(a.max=t.max-e.min),a}var Vd=.35;function rC(e=Vd){return e===!1?e=0:e===!0&&(e=Vd),{x:QL(e,"left","right"),y:QL(e,"top","bottom")}}function QL(e,t,a){return{min:YL(e,t),max:YL(e,a)}}function YL(e,t){return typeof e=="number"?e:e[t]||0}var oC=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ao=()=>({x:oC(),y:oC()}),nC=()=>({min:0,max:0}),Se=()=>({x:nC(),y:nC()});function Tt(e){return[e("x"),e("y")]}function Ud({top:e,left:t,right:a,bottom:r}){return{x:{min:t,max:a},y:{min:e,max:r}}}function sC({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function iC(e,t){if(!t)return e;let a=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:a.y,left:a.x,bottom:r.y,right:r.x}}function Pm(e){return e===void 0||e===1}function _d({scale:e,scaleX:t,scaleY:a}){return!Pm(e)||!Pm(t)||!Pm(a)}function or(e){return _d(e)||Tm(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Tm(e){return lC(e.x)||lC(e.y)}function lC(e){return e&&e!=="0%"}function zi(e,t,a){let r=e-a,o=t*r;return a+o}function uC(e,t,a,r,o){return o!==void 0&&(e=zi(e,o,r)),zi(e,a,r)+t}function Am(e,t=0,a=1,r,o){e.min=uC(e.min,t,a,r,o),e.max=uC(e.max,t,a,r,o)}function Rm(e,{x:t,y:a}){Am(e.x,t.translate,t.scale,t.originPoint),Am(e.y,a.translate,a.scale,a.originPoint)}var dC=.999999999999,cC=1.0000000000001;function pC(e,t,a,r=!1){let o=a.length;if(!o)return;t.x=t.y=1;let n,s;for(let i=0;i<o;i++){n=a[i],s=n.projectionDelta;let{visualElement:l}=n.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&n.options.layoutScroll&&n.scroll&&n!==n.root&&Ro(e,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,Rm(e,s)),r&&or(n.latestValues)&&Ro(e,n.latestValues))}t.x<cC&&t.x>dC&&(t.x=1),t.y<cC&&t.y>dC&&(t.y=1)}function $r(e,t){e.min=e.min+t,e.max=e.max+t}function fC(e,t,a,r,o=.5){let n=ne(e.min,e.max,o);Am(e,t,a,n,r)}function Ro(e,t){fC(e.x,t.x,t.scaleX,t.scale,t.originX),fC(e.y,t.y,t.scaleY,t.scale,t.originY)}function Dm(e,t){return Ud(iC(e.getBoundingClientRect(),t))}function mC(e,t,a){let r=Dm(e,a),{scroll:o}=t;return o&&($r(r.x,o.offset.x),$r(r.y,o.offset.y)),r}var zd=({current:e})=>e?e.ownerDocument.defaultView:null;var P1=new WeakMap,qd=class{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Se(),this.visualElement=t}start(t,{snapToCursor:a=!1}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let o=d=>{let{dragSnapToOrigin:c}=this.getProps();c?this.pauseAnimation():this.stopAnimation(),a&&this.snapToCursor(rr(d).point)},n=(d,c)=>{let{drag:p,dragPropagation:g,onDragStart:L}=this.getProps();if(p&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=im(p),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Tt(w=>{let h=this.getAxisMotionValue(w).get()||0;if(ht.test(h)){let{projection:m}=this.visualElement;if(m&&m.layout){let x=m.layout.layoutBox[w];x&&(h=et(x)*(parseFloat(h)/100))}}this.originPoint[w]=h}),L&&Z.postRender(()=>L(d,c)),Fi(this.visualElement,"transform");let{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},s=(d,c)=>{let{dragPropagation:p,dragDirectionLock:g,onDirectionLock:L,onDrag:C}=this.getProps();if(!p&&!this.openDragLock)return;let{offset:w}=c;if(g&&this.currentDirection===null){this.currentDirection=T1(w),this.currentDirection!==null&&L&&L(this.currentDirection);return}this.updateAxis("x",c.point,w),this.updateAxis("y",c.point,w),this.visualElement.render(),C&&C(d,c)},i=(d,c)=>this.stop(d,c),l=()=>Tt(d=>{var c;return this.getAnimationState(d)==="paused"&&((c=this.getAxisMotionValue(d).animation)===null||c===void 0?void 0:c.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new ss(t,{onSessionStart:o,onStart:n,onMove:s,onSessionEnd:i,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:zd(this.visualElement)})}stop(t,a){let r=this.isDragging;if(this.cancel(),!r)return;let{velocity:o}=a;this.startAnimation(o);let{onDragEnd:n}=this.getProps();n&&Z.postRender(()=>n(t,a))}cancel(){this.isDragging=!1;let{projection:t,animationState:a}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),a&&a.setActive("whileDrag",!1)}updateAxis(t,a,r){let{drag:o}=this.getProps();if(!r||!Hd(t,o,this.currentDirection))return;let n=this.getAxisMotionValue(t),s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=ZL(s,this.constraints[t],this.elastic[t])),n.set(s)}resolveConstraints(){var t;let{dragConstraints:a,dragElastic:r}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,n=this.constraints;a&&Ja(a)?this.constraints||(this.constraints=this.resolveRefConstraints()):a&&o?this.constraints=JL(o.layoutBox,a):this.constraints=!1,this.elastic=rC(r),n!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&Tt(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=aC(o.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){let{dragConstraints:t,onMeasureDragConstraints:a}=this.getProps();if(!t||!Ja(t))return!1;let r=t.current;ca(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");let{projection:o}=this.visualElement;if(!o||!o.layout)return!1;let n=mC(r,o.root,this.visualElement.getTransformPagePoint()),s=eC(o.layout.layoutBox,n);if(a){let i=a(sC(s));this.hasMutatedConstraints=!!i,i&&(s=Ud(i))}return s}startAnimation(t){let{drag:a,dragMomentum:r,dragElastic:o,dragTransition:n,dragSnapToOrigin:s,onDragTransitionEnd:i}=this.getProps(),l=this.constraints||{},u=Tt(d=>{if(!Hd(d,a,this.currentDirection))return;let c=l&&l[d]||{};s&&(c={min:0,max:0});let p=o?200:1e6,g=o?40:1e7,L={type:"inertia",velocity:r?t[d]:0,bounceStiffness:p,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...n,...c};return this.startAxisValueAnimation(d,L)});return Promise.all(u).then(i)}startAxisValueAnimation(t,a){let r=this.getAxisMotionValue(t);return Fi(this.visualElement,t),r.start(ns(t,r,0,a,this.visualElement,!1))}stopAnimation(){Tt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Tt(t=>{var a;return(a=this.getAxisMotionValue(t).animation)===null||a===void 0?void 0:a.pause()})}getAnimationState(t){var a;return(a=this.getAxisMotionValue(t).animation)===null||a===void 0?void 0:a.state}getAxisMotionValue(t){let a=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[a];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Tt(a=>{let{drag:r}=this.getProps();if(!Hd(a,r,this.currentDirection))return;let{projection:o}=this.visualElement,n=this.getAxisMotionValue(a);if(o&&o.layout){let{min:s,max:i}=o.layout.layoutBox[a];n.set(t[a]-ne(s,i,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:t,dragConstraints:a}=this.getProps(),{projection:r}=this.visualElement;if(!Ja(a)||!r||!this.constraints)return;this.stopAnimation();let o={x:0,y:0};Tt(s=>{let i=this.getAxisMotionValue(s);if(i&&this.constraints!==!1){let l=i.get();o[s]=tC({min:l,max:l},this.constraints[s])}});let{transformTemplate:n}=this.visualElement.getProps();this.visualElement.current.style.transform=n?n({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Tt(s=>{if(!Hd(s,t,null))return;let i=this.getAxisMotionValue(s),{min:l,max:u}=this.constraints[s];i.set(ne(l,u,o[s]))})}addListeners(){if(!this.visualElement.current)return;P1.set(this.visualElement,this);let t=this.visualElement.current,a=Kr(t,"pointerdown",l=>{let{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(l)}),r=()=>{let{dragConstraints:l}=this.getProps();Ja(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,n=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),Z.read(r);let s=ar(window,"resize",()=>this.scalePositionWithinConstraints()),i=o.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Tt(d=>{let c=this.getAxisMotionValue(d);c&&(this.originPoint[d]+=l[d].translate,c.set(c.get()+l[d].translate))}),this.visualElement.render())}));return()=>{s(),a(),n(),i&&i()}}getProps(){let t=this.visualElement.getProps(),{drag:a=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:n=!1,dragElastic:s=Vd,dragMomentum:i=!0}=t;return{...t,drag:a,dragDirectionLock:r,dragPropagation:o,dragConstraints:n,dragElastic:s,dragMomentum:i}}};function Hd(e,t,a){return(t===!0||t===e)&&(a===null||a===e)}function T1(e,t=10){let a=null;return Math.abs(e.y)>t?a="y":Math.abs(e.x)>t&&(a="x"),a}var Wd=class extends Ke{constructor(t){super(t),this.removeGroupControls=me,this.removeListeners=me,this.controls=new qd(t)}mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||me}unmount(){this.removeGroupControls(),this.removeListeners()}};var hC=e=>(t,a)=>{e&&Z.postRender(()=>e(t,a))},Gd=class extends Ke{constructor(){super(...arguments),this.removePointerDownListener=me}onPointerDown(t){this.session=new ss(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:zd(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:a,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:hC(t),onStart:hC(a),onMove:r,onEnd:(n,s)=>{delete this.session,o&&Z.postRender(()=>o(n,s))}}}mount(){this.removePointerDownListener=Kr(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};var yC=E(le(),1),Hi=E($(),1);var us={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function gC(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var ds={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(H.test(e))e=parseFloat(e);else return e;let a=gC(e,t.target.x),r=gC(e,t.target.y);return`${a}% ${r}%`}};var xC={correct:(e,{treeScale:t,projectionDelta:a})=>{let r=e,o=gt.parse(e);if(o.length>5)return r;let n=gt.createTransformer(e),s=typeof o[0]!="number"?1:0,i=a.x.scale*t.x,l=a.y.scale*t.y;o[0+s]/=i,o[1+s]/=l;let u=ne(i,l,.5);return typeof o[2+s]=="number"&&(o[2+s]/=u),typeof o[3+s]=="number"&&(o[3+s]/=u),n(o)}};var Mm=class extends Hi.Component{componentDidMount(){let{visualElement:t,layoutGroup:a,switchLayoutGroup:r,layoutId:o}=this.props,{projection:n}=t;k0(A1),n&&(a.group&&a.group.add(n),r&&r.register&&o&&r.register(n),n.root.didUpdate(),n.addEventListener("animationComplete",()=>{this.safeToRemove()}),n.setOptions({...n.options,onExitComplete:()=>this.safeToRemove()})),us.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){let{layoutDependency:a,visualElement:r,drag:o,isPresent:n}=this.props,s=r.projection;return s&&(s.isPresent=n,o||t.layoutDependency!==a||a===void 0?s.willUpdate():this.safeToRemove(),t.isPresent!==n&&(n?s.promote():s.relegate()||Z.postRender(()=>{let i=s.getStack();(!i||!i.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Mn.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:t,layoutGroup:a,switchLayoutGroup:r}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),a&&a.group&&a.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){let{safeToRemove:t}=this.props;t&&t()}render(){return null}};function jd(e){let[t,a]=Bu(),r=(0,Hi.useContext)(bn);return(0,yC.jsx)(Mm,{...e,layoutGroup:r,switchLayoutGroup:(0,Hi.useContext)($u),isPresent:t,safeToRemove:a})}var A1={borderRadius:{...ds,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ds,borderTopRightRadius:ds,borderBottomLeftRadius:ds,borderBottomRightRadius:ds,boxShadow:xC};function vC(e,t,a){let r=xe(e)?e:tr(e);return r.start(ns("",r,t,a)),r.animation}function LC(e){return e instanceof SVGElement&&e.tagName!=="svg"}var CC=(e,t)=>e.depth-t.depth;var Kd=class{constructor(){this.children=[],this.isDirty=!1}add(t){Yn(this.children,t),this.isDirty=!0}remove(t){Zn(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(CC),this.isDirty=!1,this.children.forEach(t)}};function SC(e,t){let a=it.now(),r=({timestamp:o})=>{let n=o-a;n>=t&&(Ut(r),e(n-t))};return Z.read(r,!0),()=>Ut(r)}var bC=["TopLeft","TopRight","BottomLeft","BottomRight"],R1=bC.length,IC=e=>typeof e=="string"?parseFloat(e):e,wC=e=>typeof e=="number"||H.test(e);function PC(e,t,a,r,o,n){o?(e.opacity=ne(0,a.opacity!==void 0?a.opacity:1,D1(r)),e.opacityExit=ne(t.opacity!==void 0?t.opacity:1,0,M1(r))):n&&(e.opacity=ne(t.opacity!==void 0?t.opacity:1,a.opacity!==void 0?a.opacity:1,r));for(let s=0;s<R1;s++){let i=`border${bC[s]}Radius`,l=kC(t,i),u=kC(a,i);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||wC(l)===wC(u)?(e[i]=Math.max(ne(IC(l),IC(u),r),0),(ht.test(u)||ht.test(l))&&(e[i]+="%")):e[i]=u}(t.rotate||a.rotate)&&(e.rotate=ne(t.rotate||0,a.rotate||0,r))}function kC(e,t){return e[t]!==void 0?e[t]:e.borderRadius}var D1=TC(0,.5,vd),M1=TC(.5,.95,me);function TC(e,t,a){return r=>r<e?0:r>t?1:a(Vt(e,t,r))}function AC(e,t){e.min=t.min,e.max=t.max}function zt(e,t){AC(e.x,t.x),AC(e.y,t.y)}function Nm(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function RC(e,t,a,r,o){return e-=t,e=zi(e,1/a,r),o!==void 0&&(e=zi(e,1/o,r)),e}function N1(e,t=0,a=1,r=.5,o,n=e,s=e){if(ht.test(t)&&(t=parseFloat(t),t=ne(s.min,s.max,t/100)-s.min),typeof t!="number")return;let i=ne(n.min,n.max,r);e===n&&(i-=t),e.min=RC(e.min,t,a,i,o),e.max=RC(e.max,t,a,i,o)}function DC(e,t,[a,r,o],n,s){N1(e,t[a],t[r],t[o],t.scale,n,s)}var E1=["x","scaleX","originX"],F1=["y","scaleY","originY"];function Em(e,t,a,r){DC(e.x,t,E1,a?a.x:void 0,r?r.x:void 0),DC(e.y,t,F1,a?a.y:void 0,r?r.y:void 0)}function MC(e){return e.translate===0&&e.scale===1}function Fm(e){return MC(e.x)&&MC(e.y)}function NC(e,t){return e.min===t.min&&e.max===t.max}function FC(e,t){return NC(e.x,t.x)&&NC(e.y,t.y)}function EC(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Bm(e,t){return EC(e.x,t.x)&&EC(e.y,t.y)}function Om(e){return et(e.x)/et(e.y)}function Vm(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var $d=class{constructor(){this.members=[]}add(t){Yn(this.members,t),t.scheduleRender()}remove(t){if(Zn(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){let a=this.members[this.members.length-1];a&&this.promote(a)}}relegate(t){let a=this.members.findIndex(o=>t===o);if(a===0)return!1;let r;for(let o=a;o>=0;o--){let n=this.members[o];if(n.isPresent!==!1){r=n;break}}return r?(this.promote(r),!0):!1}promote(t,a){let r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,a&&(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);let{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{let{options:a,resumingFrom:r}=t;a.onExitComplete&&a.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 BC(e,t,a){let r="",o=e.x.translate/t.x,n=e.y.translate/t.y,s=a?.z||0;if((o||n||s)&&(r=`translate3d(${o}px, ${n}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),a){let{transformPerspective:u,rotate:d,rotateX:c,rotateY:p,skewX:g,skewY:L}=a;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),c&&(r+=`rotateX(${c}deg) `),p&&(r+=`rotateY(${p}deg) `),g&&(r+=`skewX(${g}deg) `),L&&(r+=`skewY(${L}deg) `)}let i=e.x.scale*t.x,l=e.y.scale*t.y;return(i!==1||l!==1)&&(r+=`scale(${i}, ${l})`),r||"none"}var Do={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},qi=typeof window<"u"&&window.MotionDebug!==void 0,Um=["","X","Y","Z"],B1={visibility:"hidden"},OC=1e3,O1=0;function _m(e,t,a,r){let{latestValues:o}=t;o[e]&&(a[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function GC(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let a=fd(t);if(window.MotionHasOptimisedAnimation(a,"transform")){let{layout:o,layoutId:n}=e.options;window.MotionCancelOptimisedAnimation(a,"transform",Z,!(o||n))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&GC(r)}function Xd({attachResizeListener:e,defaultParent:t,measureScroll:a,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(s={},i=t?.()){this.id=O1++,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,qi&&(Do.totalNodes=Do.resolvedTargetDeltas=Do.recalculatedProjection=0),this.nodes.forEach(_1),this.nodes.forEach(G1),this.nodes.forEach(j1),this.nodes.forEach(z1),qi&&window.MotionDebug.record(Do)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Kd)}addEventListener(s,i){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new zr),this.eventHandlers.get(s).add(i)}notifyListeners(s,...i){let l=this.eventHandlers.get(s);l&&l.notify(...i)}hasListeners(s){return this.eventHandlers.has(s)}mount(s,i=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=LC(s),this.instance=s;let{layoutId:l,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),i&&(u||l)&&(this.isLayoutDirty=!0),e){let c,p=()=>this.root.updateBlockedByResize=!1;e(s,()=>{this.root.updateBlockedByResize=!0,c&&c(),c=SC(p,250),us.hasAnimatedSinceResize&&(us.hasAnimatedSinceResize=!1,this.nodes.forEach(UC))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||u)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:p,hasRelativeTargetChanged:g,layout:L})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let C=this.options.transition||d.getDefaultTransition()||Y1,{onLayoutAnimationStart:w,onLayoutAnimationComplete:h}=d.getProps(),m=!this.targetLayout||!Bm(this.targetLayout,L)||g,x=!p&&g;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||p&&(m||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(c,x);let S={...Vr(C,"layout"),onPlay:w,onComplete:h};(d.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S)}else p||UC(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=L})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Ut(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(K1),this.animationId++)}getTransformTemplate(){let{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&GC(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){let c=this.path[d];c.shouldResetTransform=!0,c.updateScroll("snapshot"),c.options.layoutRoot&&c.willUpdate(!1)}let{layoutId:i,layout:l}=this.options;if(i===void 0&&!l)return;let u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(VC);return}this.isUpdating||this.nodes.forEach(q1),this.isUpdating=!1,this.nodes.forEach(W1),this.nodes.forEach(V1),this.nodes.forEach(U1),this.clearAllSnapshots();let i=it.now();Ee.delta=Je(0,1e3/60,i-Ee.timestamp),Ee.timestamp=i,Ee.isProcessing=!0,Hu.update.process(Ee),Hu.preRender.process(Ee),Hu.render.process(Ee),Ee.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Mn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(H1),this.sharedNodes.forEach($1)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Z.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Z.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();let s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Se(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:i}=this.options;i&&i.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let i=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(i=!1),i){let l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:a(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!o)return;let s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,i=this.projectionDelta&&!Fm(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;s&&(i||or(this.latestValues)||d)&&(o(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){let i=this.measurePageBox(),l=this.removeElementScroll(i);return s&&(l=this.removeTransform(l)),Z1(l),{animationId:this.root.animationId,measuredBox:i,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var s;let{visualElement:i}=this.options;if(!i)return Se();let l=i.measureViewportBox();if(!(((s=this.scroll)===null||s===void 0?void 0:s.wasRoot)||this.path.some(J1))){let{scroll:d}=this.root;d&&($r(l.x,d.offset.x),$r(l.y,d.offset.y))}return l}removeElementScroll(s){var i;let l=Se();if(zt(l,s),!((i=this.scroll)===null||i===void 0)&&i.wasRoot)return l;for(let u=0;u<this.path.length;u++){let d=this.path[u],{scroll:c,options:p}=d;d!==this.root&&c&&p.layoutScroll&&(c.wasRoot&&zt(l,s),$r(l.x,c.offset.x),$r(l.y,c.offset.y))}return l}applyTransform(s,i=!1){let l=Se();zt(l,s);for(let u=0;u<this.path.length;u++){let d=this.path[u];!i&&d.options.layoutScroll&&d.scroll&&d!==d.root&&Ro(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),or(d.latestValues)&&Ro(l,d.latestValues)}return or(this.latestValues)&&Ro(l,this.latestValues),l}removeTransform(s){let i=Se();zt(i,s);for(let l=0;l<this.path.length;l++){let u=this.path[l];if(!u.instance||!or(u.latestValues))continue;_d(u.latestValues)&&u.updateSnapshot();let d=Se(),c=u.measurePageBox();zt(d,c),Em(i,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return or(this.latestValues)&&Em(i,this.latestValues),i}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.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!==Ee.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var i;let l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);let u=!!this.resumingFrom||this!==l;if(!(s||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((i=this.parent)===null||i===void 0)&&i.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:c,layoutId:p}=this.options;if(!(!this.layout||!(c||p))){if(this.resolvedRelativeTargetAt=Ee.timestamp,!this.targetDelta&&!this.relativeTarget){let g=this.getClosestProjectingParent();g&&g.layout&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Se(),this.relativeTargetOrigin=Se(),ls(this.relativeTargetOrigin,this.layout.layoutBox,g.layout.layoutBox),zt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Se(),this.targetWithTransforms=Se()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),KL(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):zt(this.target,this.layout.layoutBox),Rm(this.target,this.targetDelta)):zt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;let g=this.getClosestProjectingParent();g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Se(),this.relativeTargetOrigin=Se(),ls(this.relativeTargetOrigin,this.target,g.target),zt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}qi&&Do.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||_d(this.parent.latestValues)||Tm(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 s;let i=this.getLead(),l=!!this.resumingFrom||this!==i,u=!0;if((this.isProjectionDirty||!((s=this.parent)===null||s===void 0)&&s.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===Ee.timestamp&&(u=!1),u)return;let{layout:d,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||c))return;zt(this.layoutCorrected,this.layout.layoutBox);let p=this.treeScale.x,g=this.treeScale.y;pC(this.layoutCorrected,this.treeScale,this.path,l),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=Se());let{target:L}=i;if(!L){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Nm(this.prevProjectionDelta.x,this.projectionDelta.x),Nm(this.prevProjectionDelta.y,this.projectionDelta.y)),is(this.projectionDelta,this.layoutCorrected,L,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==g||!Vm(this.projectionDelta.x,this.prevProjectionDelta.x)||!Vm(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",L)),qi&&Do.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){var i;if((i=this.options.visualElement)===null||i===void 0||i.scheduleRender(),s){let l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ao(),this.projectionDelta=Ao(),this.projectionDeltaWithTransform=Ao()}setAnimationOrigin(s,i=!1){let l=this.snapshot,u=l?l.latestValues:{},d={...this.latestValues},c=Ao();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!i;let p=Se(),g=l?l.source:void 0,L=this.layout?this.layout.source:void 0,C=g!==L,w=this.getStack(),h=!w||w.members.length<=1,m=!!(C&&!h&&this.options.crossfade===!0&&!this.path.some(Q1));this.animationProgress=0;let x;this.mixTargetDelta=S=>{let k=S/1e3;_C(c.x,s.x,k),_C(c.y,s.y,k),this.setTargetDelta(c),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ls(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),X1(this.relativeTarget,this.relativeTargetOrigin,p,k),x&&FC(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=Se()),zt(x,this.relativeTarget)),C&&(this.animationValues=d,PC(d,u,this.latestValues,k,m,h)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=k},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Ut(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Z.update(()=>{us.hasAnimatedSinceResize=!0,this.currentAnimation=vC(0,OC,{...s,onUpdate:i=>{this.mixTargetDelta(i),s.onUpdate&&s.onUpdate(i)},onComplete:()=>{s.onComplete&&s.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);let s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(OC),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let s=this.getLead(),{targetWithTransforms:i,target:l,layout:u,latestValues:d}=s;if(!(!i||!l||!u)){if(this!==s&&this.layout&&u&&jC(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Se();let c=et(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+c;let p=et(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+p}zt(i,l),Ro(i,d),is(this.projectionDeltaWithTransform,this.layoutCorrected,i,d)}}registerSharedNode(s,i){this.sharedNodes.has(s)||this.sharedNodes.set(s,new $d),this.sharedNodes.get(s).add(i);let u=i.options.initialPromotionConfig;i.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(i):void 0})}isLead(){let s=this.getStack();return s?s.lead===this:!0}getLead(){var s;let{layoutId:i}=this.options;return i?((s=this.getStack())===null||s===void 0?void 0:s.lead)||this:this}getPrevLead(){var s;let{layoutId:i}=this.options;return i?(s=this.getStack())===null||s===void 0?void 0:s.prevLead:void 0}getStack(){let{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:i,preserveFollowOpacity:l}={}){let u=this.getStack();u&&u.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),i&&this.setOptions({transition:i})}relegate(){let s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){let{visualElement:s}=this.options;if(!s)return;let i=!1,{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(i=!0),!i)return;let u={};l.z&&_m("z",s,u,this.animationValues);for(let d=0;d<Um.length;d++)_m(`rotate${Um[d]}`,s,u,this.animationValues),_m(`skew${Um[d]}`,s,u,this.animationValues);s.render();for(let d in u)s.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);s.scheduleRender()}getProjectionStyles(s){var i,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return B1;let u={visibility:""},d=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=Bn(s?.pointerEvents)||"",u.transform=d?d(this.latestValues,""):"none",u;let c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){let C={};return this.options.layoutId&&(C.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,C.pointerEvents=Bn(s?.pointerEvents)||""),this.hasProjected&&!or(this.latestValues)&&(C.transform=d?d({},""):"none",this.hasProjected=!1),C}let p=c.animationValues||c.latestValues;this.applyTransformsToTarget(),u.transform=BC(this.projectionDeltaWithTransform,this.treeScale,p),d&&(u.transform=d(p,u.transform));let{x:g,y:L}=this.projectionDelta;u.transformOrigin=`${g.origin*100}% ${L.origin*100}% 0`,c.animationValues?u.opacity=c===this?(l=(i=p.opacity)!==null&&i!==void 0?i:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:p.opacityExit:u.opacity=c===this?p.opacity!==void 0?p.opacity:"":p.opacityExit!==void 0?p.opacityExit:0;for(let C in qn){if(p[C]===void 0)continue;let{correct:w,applyTo:h}=qn[C],m=u.transform==="none"?p[C]:w(p[C],c);if(h){let x=h.length;for(let S=0;S<x;S++)u[h[S]]=m}else u[C]=m}return this.options.layoutId&&(u.pointerEvents=c===this?Bn(s?.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var i;return(i=s.currentAnimation)===null||i===void 0?void 0:i.stop()}),this.root.nodes.forEach(VC),this.root.sharedNodes.clear()}}}function V1(e){e.updateLayout()}function U1(e){var t;let a=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&a&&e.hasListeners("didUpdate")){let{layoutBox:r,measuredBox:o}=e.layout,{animationType:n}=e.options,s=a.source!==e.layout.source;n==="size"?Tt(c=>{let p=s?a.measuredBox[c]:a.layoutBox[c],g=et(p);p.min=r[c].min,p.max=p.min+g}):jC(n,a.layoutBox,r)&&Tt(c=>{let p=s?a.measuredBox[c]:a.layoutBox[c],g=et(r[c]);p.max=p.min+g,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[c].max=e.relativeTarget[c].min+g)});let i=Ao();is(i,r,a.layoutBox);let l=Ao();s?is(l,e.applyTransform(o,!0),a.measuredBox):is(l,r,a.layoutBox);let u=!Fm(i),d=!1;if(!e.resumeFrom){let c=e.getClosestProjectingParent();if(c&&!c.resumeFrom){let{snapshot:p,layout:g}=c;if(p&&g){let L=Se();ls(L,a.layoutBox,p.layoutBox);let C=Se();ls(C,r,g.layoutBox),Bm(L,C)||(d=!0),c.options.layoutRoot&&(e.relativeTarget=C,e.relativeTargetOrigin=L,e.relativeParent=c)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:a,delta:l,layoutDelta:i,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){let{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function _1(e){qi&&Do.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 z1(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function H1(e){e.clearSnapshot()}function VC(e){e.clearMeasurements()}function q1(e){e.isLayoutDirty=!1}function W1(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function UC(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function G1(e){e.resolveTargetDelta()}function j1(e){e.calcProjection()}function K1(e){e.resetSkewAndRotation()}function $1(e){e.removeLeadSnapshot()}function _C(e,t,a){e.translate=ne(t.translate,0,a),e.scale=ne(t.scale,1,a),e.origin=t.origin,e.originPoint=t.originPoint}function zC(e,t,a,r){e.min=ne(t.min,a.min,r),e.max=ne(t.max,a.max,r)}function X1(e,t,a,r){zC(e.x,t.x,a.x,r),zC(e.y,t.y,a.y,r)}function Q1(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Y1={duration:.45,ease:[.4,0,.1,1]},HC=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),qC=HC("applewebkit/")&&!HC("chrome/")?Math.round:me;function WC(e){e.min=qC(e.min),e.max=qC(e.max)}function Z1(e){WC(e.x),WC(e.y)}function jC(e,t,a){return e==="position"||e==="preserve-aspect"&&!jL(Om(t),Om(a),.2)}function J1(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}var KC=Xd({attachResizeListener:(e,t)=>ar(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0});var zm={current:void 0},Qd=Xd({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!zm.current){let e=new KC({});e.mount(window),e.setOptions({layoutScroll:!0}),zm.current=e}return zm.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"});var $C={pan:{Feature:Gd},drag:{Feature:Wd,ProjectionNode:Qd,MeasureLayout:jd}};function XC(e,t,a){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",a==="Start");let o="onHover"+a,n=r[o];n&&Z.postRender(()=>n(t,rr(t)))}var Yd=class extends Ke{mount(){let{current:t}=this.node;t&&(this.unmount=om(t,a=>(XC(this.node,a,"Start"),r=>XC(this.node,r,"End"))))}unmount(){}};var Zd=class extends Ke{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=Pa(ar(this.node.current,"focus",()=>this.onFocus()),ar(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function QC(e,t,a){let{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",a==="Start");let o="onTap"+(a==="End"?"":a),n=r[o];n&&Z.postRender(()=>n(t,rr(t)))}var Jd=class extends Ke{mount(){let{current:t}=this.node;t&&(this.unmount=sm(t,a=>(QC(this.node,a,"Start"),(r,{success:o})=>QC(this.node,r,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}};var qm=new WeakMap,Hm=new WeakMap,eT=e=>{let t=qm.get(e.target);t&&t(e)},tT=e=>{e.forEach(eT)};function aT({root:e,...t}){let a=e||document;Hm.has(a)||Hm.set(a,{});let r=Hm.get(a),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(tT,{root:e,...t})),r[o]}function YC(e,t,a){let r=aT(t);return qm.set(e,a),r.observe(e),()=>{qm.delete(e),r.unobserve(e)}}var rT={some:0,all:1},ec=class extends Ke{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:t={}}=this.node.getProps(),{root:a,margin:r,amount:o="some",once:n}=t,s={root:a?a.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:rT[o]},i=l=>{let{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,n&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);let{onViewportEnter:d,onViewportLeave:c}=this.node.getProps(),p=u?d:c;p&&p(l)};return YC(this.node.current,s,i)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;let{props:t,prevProps:a}=this.node;["amount","margin","root"].some(oT(t,a))&&this.startObserver()}unmount(){}};function oT({viewport:e={}},{viewport:t={}}={}){return a=>e[a]!==t[a]}var ZC={inView:{Feature:ec},tap:{Feature:Jd},focus:{Feature:Zd},hover:{Feature:Yd}};var JC={layout:{ProjectionNode:Qd,MeasureLayout:jd}};var oS=E($(),1);var Wi={current:null},tc={current:!1};function eS(){if(tc.current=!0,!!An)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Wi.current=e.matches;e.addListener(t),t()}else Wi.current=!1}var nT=[...hm,Oe,gt],tS=e=>nT.find(kd(e));var Wm=new WeakMap;function aS(e,t,a){for(let r in t){let o=t[r],n=a[r];if(xe(o))e.addValue(r,o);else if(xe(n))e.addValue(r,tr(o,{owner:e}));else if(n!==o)if(e.hasValue(r)){let s=e.getValue(r);s.liveStyle===!0?s.jump(o):s.hasAnimated||s.set(o)}else{let s=e.getStaticValue(r);e.addValue(r,tr(s!==void 0?s:o,{owner:e}))}}for(let r in a)t[r]===void 0&&e.removeValue(r);return t}var rS=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],ac=class{scrapeMotionValuesFromProps(t,a,r){return{}}constructor({parent:t,props:a,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:n,visualState:s},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Gr,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=()=>{let g=it.now();this.renderScheduledAt<g&&(this.renderScheduledAt=g,Z.render(this.render,!1,!0))};let{latestValues:l,renderState:u,onUpdate:d}=s;this.onUpdate=d,this.latestValues=l,this.baseTarget={...l},this.initialValues=a.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=a,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=i,this.blockInitialAnimation=!!n,this.isControllingVariants=Co(a),this.isVariantNode=Gu(a),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);let{willChange:c,...p}=this.scrapeMotionValuesFromProps(a,{},this);for(let g in p){let L=p[g];l[g]!==void 0&&xe(L)&&L.set(l[g],!1)}}mount(t){this.current=t,Wm.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((a,r)=>this.bindToMotionValue(r,a)),tc.current||eS(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Wi.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Wm.delete(this.current),this.projection&&this.projection.unmount(),Ut(this.notifyUpdate),Ut(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(let t in this.events)this.events[t].clear();for(let t in this.features){let a=this.features[t];a&&(a.unmount(),a.isMounted=!1)}this.current=null}bindToMotionValue(t,a){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();let r=Pt.has(t),o=a.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&Z.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),n=a.on("renderRequest",this.scheduleRender),s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,a)),this.valueSubscriptions.set(t,()=>{o(),n(),s&&s(),a.owner&&a.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 Ya){let a=Ya[t];if(!a)continue;let{isEnabled:r,Feature:o}=a;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){let n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Se()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,a){this.latestValues[t]=a}update(t,a){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=a;for(let r=0;r<rS.length;r++){let o=rS[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);let n="on"+o,s=t[n];s&&(this.propEventSubscriptions[o]=this.on(o,s))}this.prevMotionValues=aS(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){let a=this.getClosestVariantNode();if(a)return a.variantChildren&&a.variantChildren.add(t),()=>a.variantChildren.delete(t)}addValue(t,a){let r=this.values.get(t);a!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,a),this.values.set(t,a),this.latestValues[t]=a.get())}removeValue(t){this.values.delete(t);let a=this.valueSubscriptions.get(t);a&&(a(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,a){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&a!==void 0&&(r=tr(a===null?void 0:a,{owner:this}),this.addValue(t,r)),r}readValue(t,a){var r;let o=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 o!=null&&(typeof o=="string"&&(wd(o)||Cd(o))?o=parseFloat(o):!tS(o)&>.test(a)&&(o=Id(t,a)),this.setBaseTarget(t,xe(o)?o.get():o)),xe(o)?o.get():o}setBaseTarget(t,a){this.baseTarget[t]=a}getBaseTarget(t){var a;let{initial:r}=this.props,o;if(typeof r=="string"||typeof r=="object"){let s=Fn(this.props,r,(a=this.presenceContext)===null||a===void 0?void 0:a.custom);s&&(o=s[t])}if(r&&o!==void 0)return o;let n=this.getBaseTargetFromProps(this.props,t);return n!==void 0&&!xe(n)?n:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,a){return this.events[t]||(this.events[t]=new zr),this.events[t].add(a)}notify(t,...a){this.events[t]&&this.events[t].notify(...a)}};var cs=class extends ac{constructor(){super(...arguments),this.KeyframeResolver=as}sortInstanceNodePosition(t,a){return t.compareDocumentPosition(a)&2?1:-1}getBaseTargetFromProps(t,a){return t.style?t.style[a]:void 0}removeValueFromRenderState(t,{vars:a,style:r}){delete a[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:t}=this.props;xe(t)&&(this.childSubscription=t.on("change",a=>{this.current&&(this.current.textContent=`${a}`)}))}};function sT(e){return window.getComputedStyle(e)}var rc=class extends cs{constructor(){super(...arguments),this.type="html",this.renderInstance=ed}readValueFromInstance(t,a){if(Pt.has(a)){let r=ts(a);return r&&r.default||0}else{let r=sT(t),o=(Yu(a)?r.getPropertyValue(a):r[a])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:a}){return Dm(t,a)}build(t,a,r){Un(t,a,r.transformTemplate)}scrapeMotionValuesFromProps(t,a,r){return Wn(t,a,r)}};var oc=class extends cs{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Se}getBaseTargetFromProps(t,a){return t[a]}readValueFromInstance(t,a){if(Pt.has(a)){let r=ts(a);return r&&r.default||0}return a=td.has(a)?a:Dn(a),t.getAttribute(a)}scrapeMotionValuesFromProps(t,a,r){return od(t,a,r)}build(t,a,r){_n(t,a,this.isSVGTag,r.transformTemplate)}renderInstance(t,a,r,o){ad(t,a,r,o)}mount(t){this.isSVGTag=Hn(t.tagName),super.mount(t)}};var nS=(e,t)=>En(e)?new oc(t):new rc(t,{allowProjection:e!==oS.Fragment});var sS=E0({...FL,...ZC,...$C,...JC},nS);var Gm=e0(sS);var Gi=E(le(),1);function iS({x:e,y:t,visible:a,onClick:r=!1}){return(0,Gi.jsx)($p,{children:a&&(0,Gi.jsx)(Gm.div,{className:"fixed pointer-events-none z-[9999]",initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1,x:e,y:t},exit:{opacity:0,scale:.5},transition:{type:"spring",stiffness:200,damping:20},style:{left:0,top:0},children:(0,Gi.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Gi.jsx)("path",{d:"M3 3L10.07 19.97L12.58 12.58L19.97 10.07L3 3Z",fill:"#C4B5FD"})})})})}var fs=E($(),1);function lS(){let[e,t]=fs.useState({x:0,y:0,visible:!1,onClick:!1}),a=fs.useCallback(n=>{let s=document.querySelector(n.selector);if(s){let i=s.getBoundingClientRect(),l=n.offset?.x||0,u=n.offset?.y||0;t({x:i.left+i.width/2+l,y:i.top+i.height/2+u,visible:!0,onClick:n.onClick||!1})}},[]),r=fs.useCallback(()=>{t(n=>({...n,visible:!1}))},[]),o=fs.useCallback(()=>{t(n=>({...n,visible:!0}))},[]);return{cursorState:e,moveTo:a,hide:r,show:o}}var ps=E(le(),1);function lt({className:e,...t}){return(0,ps.jsx)("div",{"data-slot":"card",className:Bt("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Ta({className:e,...t}){return(0,ps.jsx)("div",{"data-slot":"card-header",className:Bt("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function Aa({className:e,...t}){return(0,ps.jsx)("div",{"data-slot":"card-title",className:Bt("leading-none font-semibold",e),...t})}function jm({className:e,...t}){return(0,ps.jsx)("div",{"data-slot":"card-description",className:Bt("text-muted-foreground text-sm",e),...t})}function ut({className:e,...t}){return(0,ps.jsx)("div",{"data-slot":"card-content",className:Bt("px-6",e),...t})}var y=E(le(),1),Km=e=>new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),nc=(e,t="USD")=>new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e),$m=e=>{switch(e){case"Enterprise":return go;case"Professional":return Ii;default:return hi}},sc=e=>{switch(e){case"Enterprise":return"bg-purple-50 text-purple-700 border-purple-200";case"Professional":return"bg-blue-50 text-blue-700 border-blue-200";default:return"bg-gray-50 text-gray-700 border-gray-200"}};function ji({status:e,type:t="default"}){let r=(()=>{let n=e.toLowerCase();if(t==="transaction")switch(n){case"paid":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:je};case"failed":return{color:"bg-red-50 text-red-700 border-red-200",icon:ua};case"pending":return{color:"bg-amber-50 text-amber-700 border-amber-200",icon:mo};case"refunded":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:In};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:la}}if(t==="subscription")switch(n){case"active":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:je};case"cancelled":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:ua};case"past_due":return{color:"bg-red-50 text-red-700 border-red-200",icon:la};case"trialing":return{color:"bg-blue-50 text-blue-700 border-blue-200",icon:mo};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:la}}switch(n){case"active":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:je};case"inactive":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:ua};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:la}}})(),o=r.icon;return(0,y.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium border ${r.color}`,children:[(0,y.jsx)(o,{className:"h-3 w-3"}),e]})}function iT({subscription:e}){let t=$m(e.plan);return(0,y.jsxs)(lt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,y.jsx)("div",{className:`h-1 ${e.status==="active"?"bg-emerald-500":e.status==="past_due"?"bg-red-500":"bg-slate-300"}`}),(0,y.jsx)(Ta,{className:"pb-3",children:(0,y.jsxs)("div",{className:"flex items-start justify-between",children:[(0,y.jsxs)("div",{className:"space-y-1",children:[(0,y.jsxs)(Aa,{className:"text-base font-semibold text-gray-900 flex items-center gap-2",children:[(0,y.jsx)(ho,{className:"h-4 w-4 text-gray-500"}),e.id]}),e.customer_email&&(0,y.jsxs)(jm,{className:"text-sm text-gray-500 flex items-center gap-1.5",children:[(0,y.jsx)(Cn,{className:"h-3 w-3"}),e.customer_email]})]}),(0,y.jsx)(ji,{status:e.status,type:"subscription"})]})}),(0,y.jsx)(ut,{className:"pt-0",children:(0,y.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,y.jsxs)("div",{className:"space-y-3",children:[(0,y.jsxs)("div",{children:[(0,y.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Plan"}),(0,y.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium border ${sc(e.plan)}`,children:[(0,y.jsx)(t,{className:"h-3 w-3"}),e.plan]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Billing"}),(0,y.jsxs)("div",{className:"text-sm font-medium text-gray-900",children:[nc(e.amount,e.currency)," / ",e.billing_cycle]})]})]}),(0,y.jsxs)("div",{className:"space-y-3",children:[(0,y.jsxs)("div",{children:[(0,y.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Current Period"}),(0,y.jsxs)("div",{className:"text-sm text-gray-700",children:[Km(e.current_period_start)," - ",Km(e.current_period_end)]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Created"}),(0,y.jsx)("div",{className:"text-sm text-gray-700",children:Km(e.created_at)})]})]})]})})]})}function lT({subscriptions:e,maxItems:t=5}){let a=e.slice(0,t),r=e.length>t;return e.length===0?(0,y.jsx)(lt,{className:"border-gray-200 shadow-sm bg-white",children:(0,y.jsxs)(ut,{className:"py-8 text-center",children:[(0,y.jsx)(ho,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,y.jsx)("p",{className:"text-sm text-gray-500",children:"No subscriptions found"})]})}):(0,y.jsxs)(lt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,y.jsx)(Ta,{className:"pb-2 border-b border-gray-100",children:(0,y.jsxs)(Aa,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,y.jsx)(ho,{className:"h-4 w-4"}),e.length," Subscription",e.length!==1?"s":""]})}),(0,y.jsxs)(ut,{className:"p-0",children:[(0,y.jsx)("div",{className:"divide-y divide-gray-100",children:a.map(o=>{let n=$m(o.plan);return(0,y.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,y.jsxs)("div",{className:"flex items-center justify-between",children:[(0,y.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,y.jsx)("div",{className:`p-2 rounded-lg ${sc(o.plan).replace("text-","text-").replace("border-","bg-").split(" ")[0]}`,children:(0,y.jsx)(n,{className:"h-4 w-4"})}),(0,y.jsxs)("div",{className:"min-w-0",children:[(0,y.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:o.customer_email||o.customer_id}),(0,y.jsxs)("div",{className:"text-xs text-gray-500",children:[o.plan," \xB7 ",nc(o.amount,o.currency),"/",o.billing_cycle]})]})]}),(0,y.jsx)(ji,{status:o.status,type:"subscription"})]})},o.id)})}),r&&(0,y.jsx)("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-100 text-center",children:(0,y.jsxs)("span",{className:"text-xs text-gray-500",children:["+",e.length-t," more subscription",e.length-t!==1?"s":""]})})]})]})}function uT({customer:e}){let t=$m(e.subscription);return(0,y.jsxs)(lt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,y.jsx)("div",{className:`h-1 ${e.status==="active"?"bg-emerald-500":"bg-slate-300"}`}),(0,y.jsx)(Ta,{className:"pb-3",children:(0,y.jsxs)("div",{className:"flex items-start justify-between",children:[(0,y.jsx)("div",{className:"flex items-center gap-3",children:(0,y.jsxs)("div",{children:[(0,y.jsx)(Aa,{className:"text-base font-semibold text-gray-900",children:e.name}),(0,y.jsxs)(jm,{className:"text-sm text-gray-500 flex items-center gap-1",children:[(0,y.jsx)(Cn,{className:"h-3 w-3"}),e.email]})]})}),(0,y.jsx)(ji,{status:e.status,type:"customer"})]})}),(0,y.jsx)(ut,{className:"pt-0",children:(0,y.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,y.jsxs)("div",{className:"space-y-3",children:[(0,y.jsxs)("div",{children:[(0,y.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Plan"}),(0,y.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium border ${sc(e.subscription)}`,children:[(0,y.jsx)(t,{className:"h-3 w-3"}),e.subscription]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Revenue"}),(0,y.jsxs)("div",{className:"text-sm font-medium text-gray-900 flex items-center gap-1",children:[(0,y.jsx)(xo,{className:"h-3 w-3 text-emerald-500"}),e.revenue]})]})]}),(0,y.jsxs)("div",{className:"space-y-3",children:[(0,y.jsxs)("div",{children:[(0,y.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Location"}),(0,y.jsxs)("div",{className:"text-sm text-gray-700 flex items-center gap-1",children:[(0,y.jsx)(Sn,{className:"h-3 w-3 text-gray-400"}),e.location||"Not specified"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Customer Since"}),(0,y.jsxs)("div",{className:"text-sm text-gray-700 flex items-center gap-1",children:[(0,y.jsx)(xi,{className:"h-3 w-3 text-gray-400"}),e.joinDate]})]})]})]})})]})}function dT({customers:e,maxItems:t=5}){let a=e.slice(0,t),r=e.length>t;return e.length===0?(0,y.jsx)(lt,{className:"border-gray-200 shadow-sm bg-white",children:(0,y.jsxs)(ut,{className:"py-8 text-center",children:[(0,y.jsx)(kn,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,y.jsx)("p",{className:"text-sm text-gray-500",children:"No customers found"})]})}):(0,y.jsxs)(lt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,y.jsx)(Ta,{className:"pb-2 border-b border-gray-100",children:(0,y.jsxs)(Aa,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,y.jsx)(kn,{className:"h-4 w-4"}),e.length," Customer",e.length!==1?"s":""]})}),(0,y.jsxs)(ut,{className:"p-0",children:[(0,y.jsx)("div",{className:"divide-y divide-gray-100",children:a.map(o=>(0,y.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,y.jsxs)("div",{className:"flex items-center justify-between",children:[(0,y.jsx)("div",{className:"flex items-center gap-3 min-w-0",children:(0,y.jsxs)("div",{className:"min-w-0",children:[(0,y.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:o.name}),(0,y.jsx)("div",{className:"text-xs text-gray-500 truncate",children:o.email})]})}),(0,y.jsxs)("div",{className:"flex items-center gap-2",children:[(0,y.jsx)("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${sc(o.subscription)}`,children:o.subscription}),(0,y.jsx)(ji,{status:o.status,type:"customer"})]})]})},o.id))}),r&&(0,y.jsx)("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-100 text-center",children:(0,y.jsxs)("span",{className:"text-xs text-gray-500",children:["+",e.length-t," more customer",e.length-t!==1?"s":""]})})]})]})}function uS({transactions:e,maxItems:t=5}){let a=e.slice(0,t),r=e.length>t;return e.length===0?(0,y.jsx)(lt,{className:"border-gray-200 shadow-sm bg-white",children:(0,y.jsxs)(ut,{className:"py-8 text-center",children:[(0,y.jsx)(xo,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,y.jsx)("p",{className:"text-sm text-gray-500",children:"No transactions found"})]})}):(0,y.jsxs)(lt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,y.jsx)(Ta,{className:"pb-2 border-b border-gray-100",children:(0,y.jsxs)(Aa,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,y.jsx)(xo,{className:"h-4 w-4"}),e.length," Transaction",e.length!==1?"s":""]})}),(0,y.jsxs)(ut,{className:"p-0",children:[(0,y.jsx)("div",{className:"divide-y divide-gray-100",children:a.map(o=>(0,y.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,y.jsxs)("div",{className:"flex items-center justify-between",children:[(0,y.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,y.jsx)("div",{className:`p-2 rounded-lg ${o.status==="paid"?"bg-emerald-50":o.status==="failed"?"bg-red-50":o.status==="refunded"?"bg-slate-50":"bg-amber-50"}`,children:o.status==="paid"?(0,y.jsx)(je,{className:"h-4 w-4 text-emerald-600"}):o.status==="failed"?(0,y.jsx)(ua,{className:"h-4 w-4 text-red-600"}):o.status==="refunded"?(0,y.jsx)(In,{className:"h-4 w-4 text-slate-600"}):(0,y.jsx)(mo,{className:"h-4 w-4 text-amber-600"})}),(0,y.jsxs)("div",{className:"min-w-0",children:[(0,y.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:o.customer}),(0,y.jsxs)("div",{className:"text-xs text-gray-500",children:[o.date,o.decline_reason&&(0,y.jsxs)("span",{className:"text-red-500 ml-2",children:["\xB7 ",o.decline_reason]})]})]})]}),(0,y.jsxs)("div",{className:"flex items-center gap-3",children:[(0,y.jsxs)("span",{className:`text-sm font-semibold ${o.status==="paid"?"text-emerald-600":o.status==="failed"?"text-red-600":o.status==="refunded"?"text-slate-600":"text-amber-600"}`,children:[o.status==="refunded"?"-":"",o.amount]}),(0,y.jsx)(ji,{status:o.status,type:"transaction"})]})]})},o.id))}),r&&(0,y.jsx)("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-100 text-center",children:(0,y.jsxs)("span",{className:"text-xs text-gray-500",children:["+",e.length-t," more transaction",e.length-t!==1?"s":""]})})]})]})}function cT({apiKeys:e}){return e.length===0?(0,y.jsx)(lt,{className:"border-gray-200 shadow-sm bg-white",children:(0,y.jsxs)(ut,{className:"py-8 text-center",children:[(0,y.jsx)(Ln,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,y.jsx)("p",{className:"text-sm text-gray-500",children:"No API keys found"})]})}):(0,y.jsxs)(lt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,y.jsx)(Ta,{className:"pb-2 border-b border-gray-100",children:(0,y.jsxs)(Aa,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,y.jsx)(Ln,{className:"h-4 w-4"}),e.length," API Key",e.length!==1?"s":""]})}),(0,y.jsx)(ut,{className:"p-0",children:(0,y.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((t,a)=>(0,y.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,y.jsxs)("div",{className:"flex items-center justify-between",children:[(0,y.jsxs)("div",{className:"min-w-0",children:[(0,y.jsx)("div",{className:"text-sm font-medium text-gray-900",children:t.name}),(0,y.jsxs)("div",{className:"text-xs text-gray-500 font-mono",children:[t.key.slice(0,12),"...",t.key.slice(-4)]})]}),(0,y.jsxs)("div",{className:"text-xs text-gray-500",children:["Last used: ",t.lastUsed]})]})},a))})})]})}function fT({sessions:e}){let t=a=>{let r=a.toLowerCase();return r.includes("mobile")||r.includes("iphone")||r.includes("android")?Ci:vi};return e.length===0?(0,y.jsx)(lt,{className:"border-gray-200 shadow-sm bg-white",children:(0,y.jsxs)(ut,{className:"py-8 text-center",children:[(0,y.jsx)(wn,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,y.jsx)("p",{className:"text-sm text-gray-500",children:"No active sessions"})]})}):(0,y.jsxs)(lt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,y.jsx)(Ta,{className:"pb-2 border-b border-gray-100",children:(0,y.jsxs)(Aa,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,y.jsx)(wn,{className:"h-4 w-4"}),e.length," Active Session",e.length!==1?"s":""]})}),(0,y.jsx)(ut,{className:"p-0",children:(0,y.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((a,r)=>{let o=t(a.device);return(0,y.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,y.jsxs)("div",{className:"flex items-center justify-between",children:[(0,y.jsxs)("div",{className:"flex items-center gap-3",children:[(0,y.jsx)("div",{className:"p-2 rounded-lg bg-gray-100",children:(0,y.jsx)(o,{className:"h-4 w-4 text-gray-600"})}),(0,y.jsxs)("div",{children:[(0,y.jsx)("div",{className:"text-sm font-medium text-gray-900",children:a.device}),(0,y.jsxs)("div",{className:"text-xs text-gray-500 flex items-center gap-1",children:[(0,y.jsx)(Sn,{className:"h-3 w-3"}),a.location]})]})]}),(0,y.jsx)("div",{className:"text-xs text-gray-500",children:a.time})]})},r)})})})]})}function pT({stats:e}){return(0,y.jsxs)(lt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,y.jsx)(Ta,{className:"pb-2 border-b border-gray-100",children:(0,y.jsxs)(Aa,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,y.jsx)(Si,{className:"h-4 w-4"}),"Dashboard Overview"]})}),(0,y.jsx)(ut,{className:"p-4",children:(0,y.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[e.revenue&&(0,y.jsxs)("div",{className:"p-3 rounded-lg bg-emerald-50 border border-emerald-100",children:[(0,y.jsx)("div",{className:"text-xs text-emerald-600 font-medium mb-1",children:"Revenue"}),(0,y.jsx)("div",{className:"text-lg font-bold text-emerald-700",children:nc(e.revenue.total)}),e.revenue.change!==0&&(0,y.jsxs)("div",{className:`text-xs ${e.revenue.change>0?"text-emerald-600":"text-red-600"}`,children:[e.revenue.change>0?"+":"",e.revenue.change,"% from last period"]})]}),e.subscriptions&&(0,y.jsxs)("div",{className:"p-3 rounded-lg bg-blue-50 border border-blue-100",children:[(0,y.jsx)("div",{className:"text-xs text-blue-600 font-medium mb-1",children:"Subscriptions"}),(0,y.jsxs)("div",{className:"text-lg font-bold text-blue-700",children:[e.subscriptions.active," active"]}),(0,y.jsxs)("div",{className:"text-xs text-blue-600",children:[e.subscriptions.total," total"]})]}),e.customers&&(0,y.jsxs)("div",{className:"p-3 rounded-lg bg-purple-50 border border-purple-100",children:[(0,y.jsx)("div",{className:"text-xs text-purple-600 font-medium mb-1",children:"Customers"}),(0,y.jsx)("div",{className:"text-lg font-bold text-purple-700",children:e.customers.total}),e.customers.new>0&&(0,y.jsxs)("div",{className:"text-xs text-purple-600",children:["+",e.customers.new," new this period"]})]}),e.transactions&&(0,y.jsxs)("div",{className:"p-3 rounded-lg bg-amber-50 border border-amber-100",children:[(0,y.jsx)("div",{className:"text-xs text-amber-600 font-medium mb-1",children:"Transactions"}),(0,y.jsxs)("div",{className:"text-lg font-bold text-amber-700",children:[e.transactions.successful," successful"]}),e.transactions.failed>0&&(0,y.jsxs)("div",{className:"text-xs text-red-600",children:[e.transactions.failed," failed"]})]})]})})]})}function mT({customers:e}){return e.length===0?(0,y.jsx)(lt,{className:"border-gray-200 shadow-sm bg-white",children:(0,y.jsxs)(ut,{className:"py-8 text-center",children:[(0,y.jsx)(go,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,y.jsx)("p",{className:"text-sm text-gray-500",children:"No top customers data"})]})}):(0,y.jsxs)(lt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,y.jsx)(Ta,{className:"pb-2 border-b border-gray-100",children:(0,y.jsxs)(Aa,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,y.jsx)(go,{className:"h-4 w-4 text-amber-500"}),"Top Customers"]})}),(0,y.jsx)(ut,{className:"p-0",children:(0,y.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((t,a)=>(0,y.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,y.jsxs)("div",{className:"flex items-center justify-between",children:[(0,y.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,y.jsx)("div",{className:`h-6 w-6 rounded-full flex items-center justify-center text-xs font-bold ${a===0?"bg-amber-100 text-amber-700":a===1?"bg-slate-100 text-slate-700":a===2?"bg-orange-100 text-orange-700":"bg-gray-100 text-gray-700"}`,children:a+1}),(0,y.jsxs)("div",{className:"min-w-0",children:[(0,y.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:t.name}),(0,y.jsx)("div",{className:"text-xs text-gray-500 truncate",children:t.email})]})]}),(0,y.jsx)("div",{className:"text-sm font-semibold text-emerald-600",children:typeof t.revenue=="number"?nc(t.revenue):t.revenue})]})},a))})})]})}function dS({type:e,data:t}){if(!t)return null;switch(e){case"subscription":return(0,y.jsx)(iT,{subscription:t});case"subscriptions":let a=t.subscriptions||t||[];return(0,y.jsx)(lT,{subscriptions:Array.isArray(a)?a:[a]});case"customer":return(0,y.jsx)(uT,{customer:t.customer||t});case"customers":let r=t.customers||t||[];return(0,y.jsx)(dT,{customers:Array.isArray(r)?r:[r]});case"transactions":let o=t.transactions||t||[];return(0,y.jsx)(uS,{transactions:Array.isArray(o)?o:[o]});case"transaction":return(0,y.jsx)(uS,{transactions:[t],maxItems:1});case"dashboard_stats":return(0,y.jsx)(pT,{stats:t});case"top_customers":let n=t.customers||t||[];return(0,y.jsx)(mT,{customers:Array.isArray(n)?n:[n]});case"api_keys":let s=t.api_keys||t||[];return(0,y.jsx)(cT,{apiKeys:Array.isArray(s)?s:[s]});case"sessions":let i=t.sessions||t||[];return(0,y.jsx)(fT,{sessions:Array.isArray(i)?i:[i]});default:return null}}var f=E(le(),1),hT="http://localhost:5002",pS=340;function gT(e){return e.replace(/\\\\n/g,`
|
|
59
17
|
`).replace(/\\\\t/g," ").replace(/\\\\"/g,'"').replace(/\\\\\\\\/g,"\\").replace(/\\n/g,`
|
|
60
|
-
`).replace(/\\t/g," ").replace(/\\"/g,'"').replace(/\\\\/g,"\\")}function
|
|
61
|
-
`),
|
|
62
|
-
`)})},r.length)),o=!1,n=[],s=""):(l(),o=!0,s=c.slice(3).trim());continue}if(o){n.push(c);continue}let d=c.match(/^(#{1,6})\s+(.+)/);if(d){l();let v=d[1].length,x=i(d[2]),C=v===1?"text-lg font-bold my-1":v===2?"text-base font-bold my-1":"text-sm font-semibold my-1";r.push((0,h.jsx)("div",{className:C,children:x},r.length));continue}let f=c.match(/^[-*]\s+(.+)/);if(f){(!a||a.type!=="ul")&&(l(),a={type:"ul",items:[]}),a.items.push(i(f[1]));continue}let p=c.match(/^\d+[.)]\s+(.+)/);if(p){(!a||a.type!=="ol")&&(l(),a={type:"ol",items:[]}),a.items.push(i(p[1]));continue}if(c.trim()===""){l(),r.push((0,h.jsx)("div",{className:"h-2"},r.length));continue}if(c.match(/^[-*_]{3,}$/)){l(),r.push((0,h.jsx)("hr",{className:"my-2 border-gray-200"},r.length));continue}l(),r.push((0,h.jsx)("div",{children:i(c)},r.length))}return l(),(0,h.jsx)(h.Fragment,{children:r})}var yD=[{id:"changing-layouts",label:"Changing layouts",prompt:"How do I change the layout of my profiles or folders?",icon:"layout"},{id:"bulk-uploads",label:"Bulk uploads",prompt:"How do I bulk upload profiles using a CSV file?",icon:"upload"},{id:"example-setups",label:"Example setups",prompt:"Can you show me some example folder setups?",icon:"setup"}],DI=[{id:"customers",title:"Customer Management",topics:[{id:"add-customer",label:"Add a new customer",prompt:"How do I add a new customer to the system and what information is required?"},{id:"customer-details",label:"View customer details",prompt:"Show me how to view and edit customer information and their payment history."}]},{id:"payments",title:"Payment Processing",topics:[{id:"process-payment",label:"Process a payment",prompt:"How do I process a one-time payment for a customer?"},{id:"refund-payment",label:"Issue a refund",prompt:"Walk me through issuing a refund for a customer payment."}]},{id:"subscriptions",title:"Subscription Management",topics:[{id:"create-subscription",label:"Create a subscription",prompt:"How do I set up a new subscription plan for a customer?"},{id:"update-subscription",label:"Update subscription tier",prompt:"How can I change a customer's subscription plan or upgrade them?"}]},{id:"billing",title:"Billing",topics:[{id:"payment-methods",label:"Manage payment methods",prompt:"How do customers add or update their payment methods?"}]}],cy={"getting-started":{id:"getting-started",title:"Getting started",steps:[{text:"Step 1: Let's open the Customers page. This is where you'll manage all your customers - you can view, add, and edit customer information here.",navigation:{page:"customers"},cursorTarget:{selector:'[data-page="customers"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 2: Now let's open the Add customer dialog. This is where you'll enter information for your first customer, including their name, email, and other details.",navigation:{page:"customers"},cursorTarget:{selector:'[data-testid="add-customer-button"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 3: Let's open the Settings page. This is where you manage your account settings, company information, and preferences. We're going to verify your company address is correct.",navigation:{page:"settings",subtab:"general"},cursorTarget:{selector:'[data-page="settings"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 4: Here's the address field in the Company Information section. It's important to verify this address is accurate since it's used for billing and shipping purposes. Make sure it's up to date.",navigation:{page:"settings",subtab:"general"},cursorTarget:{selector:'[data-testid="company-address-input"]',offset:{x:0,y:0},onClick:!1}},{text:"Step 5: Let's open the API Keys tab. This section shows all your API keys - you'll need these to connect your application to our services. We're going to create a production API key.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-settings-tab="api"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 6: Let's open the Create API Key dialog. Here you can create a new API key for your application. You'll want to give it a descriptive name like 'Production Key' so you can easily identify it later.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-testid="create-api-key-button"]',offset:{x:0,y:0},onClick:!0}}]},"add-api-key":{id:"add-api-key",title:"How to add an API key",steps:[{text:"Step 1: Let's open the Settings page. This is where you manage your account settings and preferences. We need to go here to access the API Keys section.",navigation:{page:"settings",subtab:"general"},cursorTarget:{selector:'[data-page="settings"]',offset:{x:0,y:0},onClick:!1}},{text:"Step 2: Let's open the API Keys tab. This section shows all your API keys and allows you to create new ones. You'll need API keys to connect your application to our services.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-settings-tab="api"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 3: Let's open the Create API Key dialog. This is where you'll create your new API key - you can give it a name to help you identify it later, then click Create to generate it.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-testid="create-api-key-button"]',offset:{x:0,y:0},onClick:!0}}]},"refund-payment":{id:"refund-payment",title:"How to refund a payment",steps:[{text:"Step 1: Let's open the Home page. This is your dashboard where you can view today's activity, your payment overview, and recent transactions. We need to go here to find the payment you want to refund.",navigation:{page:"dashboard"},cursorTarget:{selector:'[data-page="dashboard"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 2: Scroll down to see the Recent transactions section at the bottom. This shows your latest payment transactions with their status. We're looking for a transaction with 'paid' status - only paid transactions can be refunded.",navigation:{page:"dashboard"},cursorTarget:{selector:'[data-testid="recent-activity-card"]',offset:{x:0,y:0},onClick:!1}},{text:"Step 3: Let's open the dropdown menu for this paid transaction. Each transaction has a menu button (three dots) that gives you options like refunding. Click it to see the available actions, including the 'Refund payment' option.",navigation:{page:"dashboard"},cursorTarget:{selector:'[data-testid="transaction-menu-button"]',offset:{x:0,y:0},onClick:!0}}]}},vD=[];function xD({isOpen:e=!0,onClose:t,onOpen:r,onBack:a,onNavigate:o,onActionComplete:n,currentPage:s,agentUrl:i=mD,startingQuestions:l,startingQuestionsEndpoint:u,supabaseUrl:c,supabaseAnonKey:d}={}){let[f,p]=z.useState(vD),[v,x]=z.useState(""),[C,g]=z.useState(()=>crypto.randomUUID()),[m,y]=z.useState(!1),[b,L]=z.useState(null),k=z.useRef(null),_=z.useCallback(()=>{g(crypto.randomUUID())},[]),T=z.useRef({}),M=f.length===0,[B,W]=z.useState("idle"),[ce,ge]=z.useState([]),ft=z.useRef([]),mi=f.length?f[f.length-1].role:void 0,[Jr,be]=z.useState("landing"),[pt,ht]=z.useState(void 0),[Ta,nr]=z.useState(l||yD),[BI,py]=z.useState(!1);z.useEffect(()=>{u&&!l&&(py(!0),fetch(u).then(S=>S.json()).then(S=>{Array.isArray(S)&&S.length>0&&nr(S)}).catch(S=>{console.warn("[KiteChat] Failed to fetch starting questions:",S)}).finally(()=>py(!1)))},[u,l]),z.useEffect(()=>{l&&nr(l)},[l]);let[ye,Lo]=z.useState(void 0),Ue=z.useRef(void 0),hy=z.useRef(null),[gi,cu]=z.useState(!1);z.useEffect(()=>{window.resetIntegrationNotification=()=>{localStorage.removeItem("gmailNotificationSeen"),console.log("Integration notification reset! Click the Integrations tab to see it again.")};let S=()=>{if(!localStorage.getItem("gmailNotificationSeen")){be("landing"),ht(void 0);let U=Date.now(),N="I see you're exploring integrations. Let me know if there are any other connections we should add.",O={id:U,role:"assistant",kind:"text",content:"",isNotificationMessage:!0};p(re=>[...re,O]),Qr(U,N),localStorage.setItem("gmailNotificationSeen","true")}};return window.addEventListener("integrationTabClicked",S),()=>{window.removeEventListener("integrationTabClicked",S)}},[]),z.useEffect(()=>{ye?(!Ue.current||Ue.current.id!==ye.id||Ue.current.stepIndex!==ye.stepIndex)&&(Ue.current=ye):Ue.current=void 0},[ye]);let[yi,du]=z.useState(null),[Qe,Wf]=z.useState(null),[se,ie]=z.useState({}),my=z.useRef(null),Gf=z.useRef(null),fu=z.useRef(null),{cursorState:pu,moveTo:Io,hide:Cn}=bL(),[ko,Kf]=z.useState(null),[gy,_a]=z.useState(null),Xf=z.useRef(null),bn=z.useRef(null),[yy,vi]=z.useState(!1),[Ln,hu]=z.useState(""),vy=z.useRef(null);z.useEffect(()=>{if(!ye||ye.id!=="add-api-key"||ye.stepIndex!==2)return;let P=setInterval(()=>{let U=document.querySelector('[role="dialog"]'),N=Ue.current;if(U&&N&&N.id==="add-api-key"&&N.stepIndex===2){Cn();let O=Date.now()+1;p(re=>[...re,{id:O,role:"assistant",kind:"guideComplete",content:"Perfect! The dialog is now open. You can enter a name and create your API key."}]),Lo(void 0),cu(!0)}},300);return()=>clearInterval(P)},[ye,Cn]),z.useEffect(()=>()=>{Object.values(T.current).forEach(S=>window.clearInterval(S)),T.current={},ft.current.forEach(S=>window.clearTimeout(S)),ft.current=[]},[]),z.useEffect(()=>{if(ye&&f.length>0){let S=f[f.length-1];if((S.kind==="guideStep"||S.kind==="guideComplete")&&fu.current&&Gf.current){let P=Gf.current,U=fu.current,N=P.getBoundingClientRect(),re=U.getBoundingClientRect().top-N.top+P.scrollTop;P.scrollTop=re}}else!ye&&f.length>0&&my.current?.scrollIntoView({behavior:"smooth"})},[f,B,ye]);let xy=z.useMemo(()=>{for(let S=f.length-1;S>=0;S--){let P=f[S];if(P.kind==="bulkSummary"&&P.bulkSummary?.navigationPage&&P.bulkSummary.successes>0)return P.bulkSummary.navigationPage}return null},[f]);z.useEffect(()=>{hy.current=xy},[xy]),z.useEffect(()=>{Xf.current=gy},[gy]),z.useEffect(()=>{let S=P=>{if((P.metaKey||P.ctrlKey)&&P.key==="Enter"){let U=Xf.current;if(U){P.preventDefault(),P.stopPropagation(),Zf(U);return}if(Qe){P.preventDefault(),P.stopPropagation(),Yf();return}if(yi){P.preventDefault(),P.stopPropagation(),Qf(yi);return}let N=hy.current;if(console.log("[DEBUG] Keyboard handler - latestBulkSummaryNavigation:",N,"onNavigate:",!!o),N&&o){console.log("[DEBUG] Navigating via keyboard to:",N.page),P.preventDefault(),P.stopPropagation(),o(N.page,N.subtab);return}if(gi){P.preventDefault(),P.stopPropagation(),wy();return}if(Ue.current){P.preventDefault(),P.stopPropagation(),ep();return}}};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[Qe,yi,ye,gi,o]),z.useEffect(()=>{if(c&&d&&!b){let S=RI(c,d);L(S)}},[c,d,b]);let Jf=z.useCallback(S=>{if(!b)return;k.current&&b.removeChannel(k.current);let P=b.channel(`user-chat-${S}`).on("postgres_changes",{event:"INSERT",schema:"public",table:"chat_history",filter:`session_id=eq.${S}`},U=>{let N=U.new;N.role==="agent"&&p(O=>[...O,{id:Date.now(),role:"agent",kind:"text",content:N.content}])}).subscribe();k.current=P},[b]);z.useEffect(()=>()=>{k.current&&b&&b.removeChannel(k.current)},[b]),z.useEffect(()=>{m&&b&&C&&Jf(C)},[m,b,C,Jf]);let FI=z.useCallback(async S=>{if(!b||!m)return!1;try{return await b.from("chat_history").insert({session_id:C,role:"user",content:S}),!0}catch(P){return console.error("[KiteChat] Failed to send escalated message:",P),!1}},[b,m,C]);function Qr(S,P,U){let N=P,O=U;if(P&&P.startsWith("{")&&P.includes('"response"'))try{let E=0,I=0;for(let J=0;J<P.length;J++)if(P[J]==="{")E++;else if(P[J]==="}"&&(E--,E===0)){I=J+1;break}let Q=I>0?P.slice(0,I):P,ae=JSON.parse(Q);ae.response&&typeof ae.response=="string"&&(N=ae.response,!O&&ae.followups&&(O=ae.followups))}catch{}N=gD(N);let re=N.split(" "),Z=0,A=window.setInterval(()=>{Z+=1,p(E=>E.map(I=>I.id===S?{...I,content:re.slice(0,Z).join(" ")}:I)),Z>=re.length&&(window.clearInterval(A),delete T.current[S],O&&O.length>0&&p(E=>E.map(I=>I.id===S?{...I,followups:O}:I)),W("idle"))},25);T.current[S]=A}function UI(S,P){p(U=>U.map(N=>N.id===S?{...N,followupSelected:!0}:N)),mu(P.label)}function wy(){Object.values(T.current).forEach(S=>window.clearInterval(S)),T.current={},ft.current.forEach(S=>window.clearTimeout(S)),ft.current=[],Cn(),_(),p([]),x(""),W("idle"),be("landing"),ht(void 0),Lo(void 0),cu(!1),du(null),Wf(null),ie({}),a&&a()}function LD(S){be("folder"),ht(S)}function VI(){be("landing"),ht(void 0)}function jI(S){S.preventDefault();let P=v.trim();if(ko){if(!P){let U={id:Date.now(),role:"assistant",kind:"text",content:"Please describe what you'd like to do with this CSV file. For example: 'Create customers from this file' or 'Add these subscriptions'."};p(N=>[...N,U]);return}HI(P,ko),x(""),Kf(null),bn.current&&(bn.current.value="");return}if(P){if(m&&b){let U={id:Date.now(),role:"user",content:P};p(N=>[...N,U]),FI(P),x("");return}mu(P),x("")}}function qI(S){let P={dashboard:"dashboard",customers:"customers page",payments:"payments page",settings:"settings page",support:"support page",disputes:"disputes page",radar:"radar page"};if(S.page==="settings"&&S.subtab){let U={general:"General",billing:"Billing",security:"Security",api:"API Keys",notifications:"Notifications",integrations:"Integrations"};return`${P.settings} (${U[S.subtab]} tab)`}return P[S.page]}function Qf(S){o&&o(S.page,S.subtab),du(null),p(P=>P.map(U=>U.kind==="navigationAction"&&U.navigationTarget?.page===S.page&&U.navigationTarget?.subtab===S.subtab?{...U,navigationTarget:void 0}:U))}function Yf(){if(!Qe)return;let S=se;if(Qe.type!=="updateCompanyInfo"){if(Qe.type==="addApiKey"){let P=S;if(!P.name||!P.name.trim())return}else if(Qe.type==="addCustomer"){let P=S;if(!P.name||!P.name.trim()||!P.email||!P.email.trim())return}else if(Qe.type==="changePassword"){let P=S;if(!P.currentPassword||!P.newPassword||!P.confirmPassword||P.newPassword!==P.confirmPassword)return}else if(Qe.type==="addWebhook"){let P=S;if(!P.url||!P.url.trim())return}else if(Qe.type==="addPaymentMethod"){let P=S;if(!P.cardNumber||!P.expiryDate)return}else if(Qe.type==="deleteApiKey"){let P=S;if(!P.keyId&&!P.name)return}else if(Qe.type==="refundPayment"){let P=S;if(!P.transactionId&&!P.customer)return}else if(Qe.type==="createSubscription"){let P=S;if(!P.customerEmail&&!P.customerId)return}else if((Qe.type==="toggleBlockRule"||Qe.type==="enableBlockRule"||Qe.type==="disableBlockRule")&&!S.ruleId)return}n&&n(Qe.type,S),p(P=>P.map(U=>U.kind==="actionForm"&&U.actionType===Qe.type?{...U,isSubmitted:!0}:U)),Wf(null),ie({})}async function mu(S){ft.current.forEach(Z=>window.clearTimeout(Z)),ft.current=[];let U=[...f].reverse().find(Z=>Z.role==="assistant")?.isNotificationMessage===!0,N=Date.now(),O={id:N,role:"user",content:S};if(p(Z=>Z.map(A=>A.followups&&A.followups.length>0?{...A,followupSelected:!0}:A).concat(O)),U){let Z=Date.now()+1,A={id:Z,role:"assistant",kind:"text",content:""};p(E=>[...E,A]),Qr(Z,"Thank you, your feedback is saved.");return}du(null),W("thinking"),ge([]);let re=!1;try{let Z=new AbortController,A=setTimeout(()=>Z.abort(),6e4),E=await fetch(`${i}/chat/stream`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:C,message:S,current_page:s||"dashboard"}),signal:Z.signal});if(clearTimeout(A),!E.ok)throw new Error(`Agent request failed: ${E.status}`);let I=E.body?.getReader();if(!I)throw new Error("No response body");let Q=new TextDecoder,ae="";for(;;){let{done:J,value:he}=await I.read();if(J)break;ae+=Q.decode(he,{stream:!0});let Ye=ae.split(`
|
|
18
|
+
`).replace(/\\t/g," ").replace(/\\"/g,'"').replace(/\\\\/g,"\\")}function cS(e){if(!e)return null;let t=e.split(`
|
|
19
|
+
`),a=[],r=null,o=!1,n=[],s="",i=u=>{let d=[],c=u,p=0;for(;c.length>0;){let g=c.match(/^`([^`]+)`/);if(g){d.push((0,f.jsx)("code",{className:"bg-gray-100 px-1 py-0.5 rounded text-xs font-mono",children:g[1]},p++)),c=c.slice(g[0].length);continue}let L=c.match(/^\*\*([^*]+)\*\*/);if(L){d.push((0,f.jsx)("strong",{children:L[1]},p++)),c=c.slice(L[0].length);continue}let C=c.match(/^\*([^*]+)\*/);if(C){d.push((0,f.jsx)("em",{children:C[1]},p++)),c=c.slice(C[0].length);continue}let w=c.match(/^\[([^\]]+)\]\(([^)]+)\)/);if(w){d.push((0,f.jsx)("a",{href:w[2],className:"kite-link",target:"_blank",rel:"noopener noreferrer",children:w[1]},p++)),c=c.slice(w[0].length);continue}let h=c.match(/^(https?:\/\/[^\s<>]+|www\.[^\s<>]+)/);if(h){let S=h[1],k=S.startsWith("www.")?`https://${S}`:S;d.push((0,f.jsx)("a",{href:k,className:"kite-link",target:"_blank",rel:"noopener noreferrer",children:S},p++)),c=c.slice(S.length);continue}let m=c.match(/^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})/);if(m){let S=m[1];d.push((0,f.jsx)("a",{href:`mailto:${S}`,className:"kite-link",children:S},p++)),c=c.slice(S.length);continue}let x=c.search(/[`*\[@h]/);if(x===-1){d.push(c);break}else x===0?(d.push(c[0]),c=c.slice(1)):(d.push(c.slice(0,x)),c=c.slice(x))}return d.length===1?d[0]:(0,f.jsx)(f.Fragment,{children:d})},l=()=>{if(r){let u=r.type==="ul"?"ul":"ol";a.push((0,f.jsx)(u,{className:`${r.type==="ul"?"list-disc":"list-decimal"} ml-4 my-1`,children:r.items.map((d,c)=>(0,f.jsx)("li",{className:"ml-2",children:d},c))},a.length)),r=null}};for(let u=0;u<t.length;u++){let d=t[u];if(d.startsWith("```")){o?(a.push((0,f.jsx)("pre",{className:"bg-gray-100 rounded p-2 my-1 overflow-x-auto",children:(0,f.jsx)("code",{className:"text-xs font-mono",children:n.join(`
|
|
20
|
+
`)})},a.length)),o=!1,n=[],s=""):(l(),o=!0,s=d.slice(3).trim());continue}if(o){n.push(d);continue}let c=d.match(/^(#{1,6})\s+(.+)/);if(c){l();let L=c[1].length,C=i(c[2]),w=L===1?"text-lg font-bold my-1":L===2?"text-base font-bold my-1":"text-sm font-semibold my-1";a.push((0,f.jsx)("div",{className:w,children:C},a.length));continue}let p=d.match(/^[-*]\s+(.+)/);if(p){(!r||r.type!=="ul")&&(l(),r={type:"ul",items:[]}),r.items.push(i(p[1]));continue}let g=d.match(/^\d+[.)]\s+(.+)/);if(g){(!r||r.type!=="ol")&&(l(),r={type:"ol",items:[]}),r.items.push(i(g[1]));continue}if(d.trim()===""){l(),a.push((0,f.jsx)("div",{className:"h-2"},a.length));continue}if(d.match(/^[-*_]{3,}$/)){l(),a.push((0,f.jsx)("hr",{className:"my-2 border-gray-200"},a.length));continue}l(),a.push((0,f.jsx)("div",{children:i(d)},a.length))}return l(),(0,f.jsx)(f.Fragment,{children:a})}var xT=[{id:"changing-layouts",label:"Changing layouts",prompt:"How do I change the layout of my profiles or folders?",icon:"layout"},{id:"bulk-uploads",label:"Bulk uploads",prompt:"How do I bulk upload profiles using a CSV file?",icon:"upload"},{id:"example-setups",label:"Example setups",prompt:"Can you show me some example folder setups?",icon:"setup"}],fS=[{id:"customers",title:"Customer Management",topics:[{id:"add-customer",label:"Add a new customer",prompt:"How do I add a new customer to the system and what information is required?"},{id:"customer-details",label:"View customer details",prompt:"Show me how to view and edit customer information and their payment history."}]},{id:"payments",title:"Payment Processing",topics:[{id:"process-payment",label:"Process a payment",prompt:"How do I process a one-time payment for a customer?"},{id:"refund-payment",label:"Issue a refund",prompt:"Walk me through issuing a refund for a customer payment."}]},{id:"subscriptions",title:"Subscription Management",topics:[{id:"create-subscription",label:"Create a subscription",prompt:"How do I set up a new subscription plan for a customer?"},{id:"update-subscription",label:"Update subscription tier",prompt:"How can I change a customer's subscription plan or upgrade them?"}]},{id:"billing",title:"Billing",topics:[{id:"payment-methods",label:"Manage payment methods",prompt:"How do customers add or update their payment methods?"}]}],Xm={"getting-started":{id:"getting-started",title:"Getting started",steps:[{text:"Step 1: Let's open the Customers page. This is where you'll manage all your customers - you can view, add, and edit customer information here.",navigation:{page:"customers"},cursorTarget:{selector:'[data-page="customers"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 2: Now let's open the Add customer dialog. This is where you'll enter information for your first customer, including their name, email, and other details.",navigation:{page:"customers"},cursorTarget:{selector:'[data-testid="add-customer-button"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 3: Let's open the Settings page. This is where you manage your account settings, company information, and preferences. We're going to verify your company address is correct.",navigation:{page:"settings",subtab:"general"},cursorTarget:{selector:'[data-page="settings"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 4: Here's the address field in the Company Information section. It's important to verify this address is accurate since it's used for billing and shipping purposes. Make sure it's up to date.",navigation:{page:"settings",subtab:"general"},cursorTarget:{selector:'[data-testid="company-address-input"]',offset:{x:0,y:0},onClick:!1}},{text:"Step 5: Let's open the API Keys tab. This section shows all your API keys - you'll need these to connect your application to our services. We're going to create a production API key.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-settings-tab="api"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 6: Let's open the Create API Key dialog. Here you can create a new API key for your application. You'll want to give it a descriptive name like 'Production Key' so you can easily identify it later.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-testid="create-api-key-button"]',offset:{x:0,y:0},onClick:!0}}]},"add-api-key":{id:"add-api-key",title:"How to add an API key",steps:[{text:"Step 1: Let's open the Settings page. This is where you manage your account settings and preferences. We need to go here to access the API Keys section.",navigation:{page:"settings",subtab:"general"},cursorTarget:{selector:'[data-page="settings"]',offset:{x:0,y:0},onClick:!1}},{text:"Step 2: Let's open the API Keys tab. This section shows all your API keys and allows you to create new ones. You'll need API keys to connect your application to our services.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-settings-tab="api"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 3: Let's open the Create API Key dialog. This is where you'll create your new API key - you can give it a name to help you identify it later, then click Create to generate it.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-testid="create-api-key-button"]',offset:{x:0,y:0},onClick:!0}}]},"refund-payment":{id:"refund-payment",title:"How to refund a payment",steps:[{text:"Step 1: Let's open the Home page. This is your dashboard where you can view today's activity, your payment overview, and recent transactions. We need to go here to find the payment you want to refund.",navigation:{page:"dashboard"},cursorTarget:{selector:'[data-page="dashboard"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 2: Scroll down to see the Recent transactions section at the bottom. This shows your latest payment transactions with their status. We're looking for a transaction with 'paid' status - only paid transactions can be refunded.",navigation:{page:"dashboard"},cursorTarget:{selector:'[data-testid="recent-activity-card"]',offset:{x:0,y:0},onClick:!1}},{text:"Step 3: Let's open the dropdown menu for this paid transaction. Each transaction has a menu button (three dots) that gives you options like refunding. Click it to see the available actions, including the 'Refund payment' option.",navigation:{page:"dashboard"},cursorTarget:{selector:'[data-testid="transaction-menu-button"]',offset:{x:0,y:0},onClick:!0}}]}},yT=[];function vT({isOpen:e=!0,onClose:t,onOpen:a,onBack:r,onNavigate:o,onActionComplete:n,currentPage:s,agentUrl:i=hT,startingQuestions:l,startingQuestionsEndpoint:u}={}){let[d,c]=G.useState(yT),[p,g]=G.useState(""),[L,C]=G.useState(()=>crypto.randomUUID()),[w,h]=G.useState(!1),m=G.useRef(null),x=G.useCallback(()=>{C(crypto.randomUUID()),h(!1),m.current&&(m.current.close(),m.current=null)},[]),S=G.useRef({}),k=d.length===0,[A,P]=G.useState("idle"),[R,M]=G.useState([]),O=G.useRef([]),pe=d.length?d[d.length-1].role:void 0,[se,Zt]=G.useState("landing"),[fa,pa]=G.useState(void 0),[Xr,Re]=G.useState(l||xT),[dt,qt]=G.useState(!1);G.useEffect(()=>{u&&!l&&(qt(!0),fetch(u).then(v=>v.json()).then(v=>{Array.isArray(v)&&v.length>0&&Re(v)}).catch(v=>{console.warn("[KiteChat] Failed to fetch starting questions:",v)}).finally(()=>qt(!1)))},[u,l]),G.useEffect(()=>{l&&Re(l)},[l]);let[oe,$e]=G.useState(void 0),De=G.useRef(void 0),Zm=G.useRef(null),[hs,Ki]=G.useState(!1);G.useEffect(()=>{window.resetIntegrationNotification=()=>{localStorage.removeItem("gmailNotificationSeen"),console.log("Integration notification reset! Click the Integrations tab to see it again.")};let v=()=>{if(!localStorage.getItem("gmailNotificationSeen")){Zt("landing"),pa(void 0);let V=Date.now(),F="I see you're exploring integrations. Let me know if there are any other connections we should add.",B={id:V,role:"assistant",kind:"text",content:"",isNotificationMessage:!0};c(Q=>[...Q,B]),Da(V,F),localStorage.setItem("gmailNotificationSeen","true")}};return window.addEventListener("integrationTabClicked",v),()=>{window.removeEventListener("integrationTabClicked",v)}},[]),G.useEffect(()=>{oe?(!De.current||De.current.id!==oe.id||De.current.stepIndex!==oe.stepIndex)&&(De.current=oe):De.current=void 0},[oe]);let[gs,$i]=G.useState(null),[ze,ic]=G.useState(null),[ae,re]=G.useState({}),Jm=G.useRef(null),lc=G.useRef(null),Xi=G.useRef(null),{cursorState:Qi,moveTo:Qr,hide:Mo}=lS(),[Yr,uc]=G.useState(null),[eh,nr]=G.useState(null),dc=G.useRef(null),No=G.useRef(null),[th,xs]=G.useState(!1),[Eo,Yi]=G.useState(""),ah=G.useRef(null);G.useEffect(()=>{if(!oe||oe.id!=="add-api-key"||oe.stepIndex!==2)return;let b=setInterval(()=>{let V=document.querySelector('[role="dialog"]'),F=De.current;if(V&&F&&F.id==="add-api-key"&&F.stepIndex===2){Mo();let B=Date.now()+1;c(Q=>[...Q,{id:B,role:"assistant",kind:"guideComplete",content:"Perfect! The dialog is now open. You can enter a name and create your API key."}]),$e(void 0),Ki(!0)}},300);return()=>clearInterval(b)},[oe,Mo]),G.useEffect(()=>()=>{Object.values(S.current).forEach(v=>window.clearInterval(v)),S.current={},O.current.forEach(v=>window.clearTimeout(v)),O.current=[]},[]),G.useEffect(()=>{if(oe&&d.length>0){let v=d[d.length-1];if((v.kind==="guideStep"||v.kind==="guideComplete")&&Xi.current&&lc.current){let b=lc.current,V=Xi.current,F=b.getBoundingClientRect(),Q=V.getBoundingClientRect().top-F.top+b.scrollTop;b.scrollTop=Q}}else!oe&&d.length>0&&Jm.current?.scrollIntoView({behavior:"smooth"})},[d,A,oe]);let rh=G.useMemo(()=>{for(let v=d.length-1;v>=0;v--){let b=d[v];if(b.kind==="bulkSummary"&&b.bulkSummary?.navigationPage&&b.bulkSummary.successes>0)return b.bulkSummary.navigationPage}return null},[d]);G.useEffect(()=>{Zm.current=rh},[rh]),G.useEffect(()=>{dc.current=eh},[eh]),G.useEffect(()=>{let v=b=>{if((b.metaKey||b.ctrlKey)&&b.key==="Enter"){let V=dc.current;if(V){b.preventDefault(),b.stopPropagation(),pc(V);return}if(ze){b.preventDefault(),b.stopPropagation(),fc();return}if(gs){b.preventDefault(),b.stopPropagation(),cc(gs);return}let F=Zm.current;if(console.log("[DEBUG] Keyboard handler - latestBulkSummaryNavigation:",F,"onNavigate:",!!o),F&&o){console.log("[DEBUG] Navigating via keyboard to:",F.page),b.preventDefault(),b.stopPropagation(),o(F.page,F.subtab);return}if(hs){b.preventDefault(),b.stopPropagation(),nh();return}if(De.current){b.preventDefault(),b.stopPropagation(),mc();return}}};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[ze,gs,oe,hs,o]);let oh=G.useCallback(v=>{if(!i)return;m.current&&m.current.close();let b=i.replace(/^http/,"ws")+`/ws/escalation/${v}`,V=new WebSocket(b);V.onmessage=F=>{try{let B=JSON.parse(F.data);B.type==="agent_message"?c(Q=>{let X=B.content;return Q.slice(-5).some(I=>I.content===X)?(console.debug("[KiteChat] Skipping duplicate agent message"),Q):[...Q,{id:Date.now(),role:"agent",kind:"text",content:X}]}):B.type==="error"&&console.error("[KiteChat] Escalation error:",B.message)}catch(B){console.error("[KiteChat] Failed to parse escalation message:",B)}},V.onerror=F=>{console.error("[KiteChat] Escalation WebSocket error:",F)},V.onclose=()=>{console.log("[KiteChat] Escalation WebSocket closed")},m.current=V},[i]),gS=G.useCallback(async v=>{if(!m.current||m.current.readyState!==WebSocket.OPEN)return console.error("[KiteChat] Escalation WebSocket not connected"),!1;try{return m.current.send(JSON.stringify({type:"user_message",content:v})),!0}catch(b){return console.error("[KiteChat] Failed to send escalated message:",b),!1}},[]);G.useEffect(()=>()=>{m.current&&m.current.close()},[]),G.useEffect(()=>{w&&L&&oh(L)},[w,L,oh]);function Da(v,b,V){let F=b||"",B=V;if(b&&b.startsWith("{")&&b.includes('"response"'))try{let N=0,I=0;for(let j=0;j<b.length;j++)if(b[j]==="{")N++;else if(b[j]==="}"&&(N--,N===0)){I=j+1;break}let K=I>0?b.slice(0,I):b,J=JSON.parse(K);J.response&&typeof J.response=="string"&&(F=J.response,!B&&J.followups&&(B=J.followups))}catch{}F=gT(F);let Q=F.split(" "),X=0,T=window.setInterval(()=>{X+=1,c(N=>N.map(I=>I.id===v?{...I,content:Q.slice(0,X).join(" ")}:I)),X>=Q.length&&(window.clearInterval(T),delete S.current[v],B&&B.length>0&&c(N=>N.map(I=>I.id===v?{...I,followups:B}:I)),P("idle"))},25);S.current[v]=T}function xS(v,b){c(V=>V.map(F=>F.id===v?{...F,followupSelected:!0}:F)),Zi(b.label)}function nh(){Object.values(S.current).forEach(v=>window.clearInterval(v)),S.current={},O.current.forEach(v=>window.clearTimeout(v)),O.current=[],Mo(),x(),c([]),g(""),P("idle"),Zt("landing"),pa(void 0),$e(void 0),Ki(!1),$i(null),ic(null),re({}),r&&r()}function wT(v){Zt("folder"),pa(v)}function yS(){Zt("landing"),pa(void 0)}function vS(v){v.preventDefault();let b=p.trim();if(Yr){if(!b){let V={id:Date.now(),role:"assistant",kind:"text",content:"Please describe what you'd like to do with this CSV file. For example: 'Create customers from this file' or 'Add these subscriptions'."};c(F=>[...F,V]);return}CS(b,Yr),g(""),uc(null),No.current&&(No.current.value="");return}if(b){if(w){let V={id:Date.now(),role:"user",content:b};c(F=>[...F,V]),gS(b),g("");return}Zi(b),g("")}}function LS(v){let b={dashboard:"dashboard",customers:"customers page",payments:"payments page",settings:"settings page",support:"support page",disputes:"disputes page",radar:"radar page"};if(v.page==="settings"&&v.subtab){let V={general:"General",billing:"Billing",security:"Security",api:"API Keys",notifications:"Notifications",integrations:"Integrations"};return`${b.settings} (${V[v.subtab]} tab)`}return b[v.page]}function cc(v){o&&o(v.page,v.subtab),$i(null),c(b=>b.map(V=>V.kind==="navigationAction"&&V.navigationTarget?.page===v.page&&V.navigationTarget?.subtab===v.subtab?{...V,navigationTarget:void 0}:V))}function fc(){if(!ze)return;let v=ae;if(ze.type!=="updateCompanyInfo"){if(ze.type==="addApiKey"){let b=v;if(!b.name||!b.name.trim())return}else if(ze.type==="addCustomer"){let b=v;if(!b.name||!b.name.trim()||!b.email||!b.email.trim())return}else if(ze.type==="changePassword"){let b=v;if(!b.currentPassword||!b.newPassword||!b.confirmPassword||b.newPassword!==b.confirmPassword)return}else if(ze.type==="addWebhook"){let b=v;if(!b.url||!b.url.trim())return}else if(ze.type==="addPaymentMethod"){let b=v;if(!b.cardNumber||!b.expiryDate)return}else if(ze.type==="deleteApiKey"){let b=v;if(!b.keyId&&!b.name)return}else if(ze.type==="refundPayment"){let b=v;if(!b.transactionId&&!b.customer)return}else if(ze.type==="createSubscription"){let b=v;if(!b.customerEmail&&!b.customerId)return}else if((ze.type==="toggleBlockRule"||ze.type==="enableBlockRule"||ze.type==="disableBlockRule")&&!v.ruleId)return}n&&n(ze.type,v),c(b=>b.map(V=>V.kind==="actionForm"&&V.actionType===ze.type?{...V,isSubmitted:!0}:V)),ic(null),re({})}async function Zi(v){O.current.forEach(X=>window.clearTimeout(X)),O.current=[];let V=[...d].reverse().find(X=>X.role==="assistant")?.isNotificationMessage===!0,F=Date.now(),B={id:F,role:"user",content:v};if(c(X=>X.map(T=>T.followups&&T.followups.length>0?{...T,followupSelected:!0}:T).concat(B)),V){let X=Date.now()+1,T={id:X,role:"assistant",kind:"text",content:""};c(N=>[...N,T]),Da(X,"Thank you, your feedback is saved.");return}$i(null),P("thinking"),M([]);let Q=!1;try{let X=new AbortController,T=setTimeout(()=>X.abort(),6e4),N=await fetch(`${i}/chat/stream`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:L,message:v,current_page:s||"dashboard"}),signal:X.signal});if(clearTimeout(T),!N.ok)throw new Error(`Agent request failed: ${N.status}`);let I=N.body?.getReader();if(!I)throw new Error("No response body");let K=new TextDecoder,J="";for(;;){let{done:j,value:ce}=await I.read();if(j)break;J+=K.decode(ce,{stream:!0});let He=J.split(`
|
|
63
21
|
|
|
64
|
-
`);
|
|
65
|
-
`),
|
|
22
|
+
`);J=He.pop()||"";for(let tt of He){if(!tt.trim())continue;let Ma=tt.split(`
|
|
23
|
+
`),qe="",Jt="";for(let q of Ma)q.startsWith("event: ")?qe=q.slice(7):q.startsWith("data: ")&&(Jt=q.slice(6));if(!(!qe||!Jt))try{let q=JSON.parse(Jt);if(qe==="progress")q.status==="thinking"?(P("thinking"),M([{message:q.message,completed:!1}])):q.status==="searching"?(P("thinking"),M([{message:q.message||"Searching knowledge base...",completed:!1}])):q.status==="evaluating"?(P("thinking"),M([{message:q.message||"Evaluating sources...",completed:!1}])):q.status==="executing"?(P("executing"),M(z=>{let ee=z.map(xt=>({...xt,completed:!0})),ue=ee[ee.length-1];return(!ue||ue.message!==q.message)&&ee.push({message:q.message,completed:!1}),ee})):q.status==="responding"&&(P("responding"),M(z=>z.map(ee=>({...ee,completed:!0}))));else if(qe==="response"){M([]),Q=!0;let z=q;if(z.action==="navigate"&&z.navigation){let ee={page:z.navigation.page,subtab:z.navigation.subtab};$i(ee);let ue={id:F+1,role:"assistant",kind:"navigationAction",content:z.response||`I can take you to the ${LS(ee)}.`,navigationTarget:ee};c(xt=>[...xt,ue]),P("idle")}else if(z.action==="show_form"&&z.actionType){ic({type:z.actionType,data:z.actionData||{}}),re(z.actionData||{});let ee={id:F+1,role:"assistant",kind:"actionForm",content:z.response||z.message||"Please fill in the details below:",actionType:z.actionType,actionData:z.actionData||{}};c(ue=>[...ue,ee]),P("idle")}else if(z.action==="suggest_bulk"){let ee=F+1,ue={id:ee,role:"assistant",kind:"text",content:""};c(xt=>[...xt,ue]),Da(ee,z.response||z.message||"For bulk operations, you can upload a CSV file - just click the \u{1F4CE} button!",z.followups),Q=!0}else if(z.action==="bulk_preview"){nr(z.bulk_session_id);let ee={id:F+1,role:"assistant",kind:"bulkPreview",content:z.message||`I found ${z.csv_data?.rowCount||0} items. Here's a preview:`,csvData:z.csv_data?{rowCount:z.csv_data.rowCount,columns:z.csv_data.columns,sampleRows:z.csv_data.sampleRows,fileName:"From context"}:void 0,suggestedAction:z.suggested_action,bulkSessionId:z.bulk_session_id};c(ue=>[...ue,ee]),P("idle"),Q=!0}else if(z.action==="execute"&&z.executionResult){let ee=F+1,ue={id:ee,role:"assistant",kind:"text",content:"",structuredData:z.structuredData||void 0};c(xt=>[...xt,ue]),Da(ee,z.response||"Action completed successfully.",z.followups),Q=!0,setTimeout(()=>{window.dispatchEvent(new CustomEvent("agentActionComplete",{detail:{result:z.executionResult}}))},100)}else{let ee=F+1,ue={id:ee,role:"assistant",kind:"text",content:""};c(xt=>[...xt,ue]),Da(ee,z.response||z.message||"",z.followups),Q=!0}}else if(qe==="error"){P("idle"),M([]),Q=!0;let z=F+1,ee={id:z,role:"assistant",kind:"text",content:""};c(ue=>[...ue,ee]),Da(z,q.message||"An error occurred processing your request.")}else if(qe==="done")M([]),P("idle"),Q=!0;else if(qe==="escalation"){h(!0),P("idle");let ee={id:Date.now()+2,role:"assistant",kind:"text",content:q.message||"You've been connected to our support queue. An agent will be with you shortly."};c(ue=>[...ue,ee])}}catch(q){console.error("Failed to parse SSE event:",q)}}}M([]),Q||P("idle")}catch(X){console.error("Agent request failed:",X),M([]);let T=F+1,N={id:T,role:"assistant",kind:"text",content:""};c(K=>[...K,N]);let I="I'm having trouble connecting to my backend.";X instanceof Error&&(X.name==="AbortError"?I="The request timed out. The server might be busy - please try again.":X.message.includes("Failed to fetch")||X.message.includes("NetworkError")?I="I'm having trouble connecting to my backend. Please make sure the agent server is running on port 5002.":X.message.includes("Agent request failed:")&&(I="The server encountered an error. Please try again.")),I+=" For simple navigation requests, I can still help you locally.",Da(T,I)}finally{M([])}}async function CS(v,b){O.current.forEach(B=>window.clearTimeout(B)),O.current=[];let V=Date.now(),F={id:V,role:"user",content:`\u{1F4CE} ${b.name}
|
|
66
24
|
|
|
67
|
-
${
|
|
25
|
+
${v}`};c(B=>[...B,F]),P("thinking"),M([{message:"Analyzing CSV file...",completed:!1}]);try{let B=new FormData;B.append("file",b),B.append("message",v),B.append("session_id",L),B.append("current_page",s||"dashboard");let Q=new AbortController,X=setTimeout(()=>Q.abort(),12e4),T=await fetch(`${i}/chat/bulk/stream`,{method:"POST",body:B,signal:Q.signal});if(clearTimeout(X),!T.ok)throw new Error(`Bulk upload failed: ${T.status}`);let N=T.body?.getReader();if(!N)throw new Error("No response body");let I=new TextDecoder,K="",J=null;for(;;){let{done:j,value:ce}=await N.read();if(j)break;K+=I.decode(ce,{stream:!0});let He=K.split(`
|
|
68
26
|
|
|
69
|
-
`);
|
|
70
|
-
`),
|
|
27
|
+
`);K=He.pop()||"";for(let tt of He){if(!tt.trim())continue;let Ma=tt.split(`
|
|
28
|
+
`),qe="",Jt="";for(let q of Ma)q.startsWith("event: ")?qe=q.slice(7):q.startsWith("data: ")&&(Jt=q.slice(6));if(!(!qe||!Jt))try{let q=JSON.parse(Jt);if(qe==="preview"){P("idle"),M([]),J=q.bulk_session_id,nr(J);let z={id:V+1,role:"assistant",kind:"bulkPreview",content:q.message||`I found ${q.csv_data.rowCount} rows in your CSV. Here's a preview:`,csvData:{rowCount:q.csv_data.rowCount,columns:q.csv_data.columns,sampleRows:q.csv_data.sampleRows,fileName:b.name},suggestedAction:q.suggested_action,bulkSessionId:J||void 0};c(ee=>[...ee,z])}else if(qe==="progress")P("executing"),M([{message:`Processing row ${q.row} of ${q.total}...`,completed:!1}]),c(z=>z[z.length-1]?.kind==="bulkProgress"?z.map((ue,xt)=>xt===z.length-1?{...ue,bulkProgress:{processed:q.row,total:q.total,successes:q.successes||0,failures:q.failures||0}}:ue):[...z,{id:Date.now(),role:"assistant",kind:"bulkProgress",bulkProgress:{processed:q.row,total:q.total,successes:q.successes||0,failures:q.failures||0}}]);else if(qe==="summary")P("idle"),M([]),nr(null),c(z=>[...z.filter(ue=>ue.kind!=="bulkProgress"),{id:Date.now(),role:"assistant",kind:"bulkSummary",content:q.message,bulkSummary:{total:q.total,successes:q.successes,failures:q.failures||[],navigationPage:q.navigationPage}}]),setTimeout(()=>{window.dispatchEvent(new CustomEvent("agentActionComplete",{detail:{result:{bulk:!0,total:q.total,successes:q.successes}}}))},100);else if(qe==="error"){P("idle"),M([]),nr(null);let z={id:V+1,role:"assistant",kind:"text",content:q.message||"An error occurred processing your CSV file."};c(ee=>[...ee,z])}else qe==="done"&&(P("idle"),M([]))}catch(q){console.error("Failed to parse bulk SSE event:",q)}}}M([]),P("idle")}catch(B){console.error("Bulk upload failed:",B),M([]),P("idle");let Q="I'm having trouble processing your CSV file.";B instanceof Error&&(B.name==="AbortError"?Q="The bulk upload request timed out. The file might be too large or the server is busy - please try again.":B.message.includes("Failed to fetch")||B.message.includes("NetworkError")?Q="I'm having trouble connecting to my backend. Please make sure the agent server is running on port 5002.":B.message.includes("Bulk upload failed:")&&(Q="The server encountered an error processing your CSV file. Please try again.")),Q+=" Please try again.";let X={id:V+1,role:"assistant",kind:"text",content:Q};c(T=>[...T,X])}}async function pc(v){P("executing"),M([{message:"Starting bulk operation...",completed:!1}]);try{let b=await fetch(`${i}/chat/bulk/confirm`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({bulk_session_id:v})});if(!b.ok)throw new Error(`Confirm failed: ${b.status}`);let V=b.body?.getReader();if(!V)throw new Error("No response body");let F=new TextDecoder,B="";for(;;){let{done:Q,value:X}=await V.read();if(Q)break;B+=F.decode(X,{stream:!0});let T=B.split(`
|
|
71
29
|
|
|
72
|
-
`);
|
|
73
|
-
`),Q="",ae="";for(let J of I)J.startsWith("event: ")?Q=J.slice(7):J.startsWith("data: ")&&(ae=J.slice(6));if(!(!Q||!ae))try{let J=JSON.parse(ae);if(Q==="progress")ge([{message:`Processing row ${J.row} of ${J.total}...`,completed:!1}]),p(he=>he[he.length-1]?.kind==="bulkProgress"?he.map((mt,Yr)=>Yr===he.length-1?{...mt,bulkProgress:{processed:J.row,total:J.total,successes:J.successes||0,failures:J.failures||0}}:mt):[...he,{id:Date.now(),role:"assistant",kind:"bulkProgress",bulkProgress:{processed:J.row,total:J.total,successes:J.successes||0,failures:J.failures||0}}]);else if(Q==="summary")console.log("[DEBUG] Received summary event - data:",J),console.log("[DEBUG] navigationPage from backend:",J.navigationPage),W("idle"),ge([]),_a(null),p(he=>{let Ye=he.filter(Yr=>Yr.kind!=="bulkProgress"&&Yr.kind!=="bulkPreview"),mt={id:Date.now(),role:"assistant",kind:"bulkSummary",content:J.message,bulkSummary:{total:J.total,successes:J.successes,failures:J.failures||[],navigationPage:J.navigationPage}};return console.log("[DEBUG] Creating bulkSummary message:",mt),[...Ye,mt]}),setTimeout(()=>{window.dispatchEvent(new CustomEvent("agentActionComplete",{detail:{result:{bulk:!0,total:J.total,successes:J.successes}}}))},100);else if(Q==="error"){W("idle"),ge([]),_a(null);let he={id:Date.now(),role:"assistant",kind:"text",content:J.message||"An error occurred during bulk processing."};p(Ye=>[...Ye,he])}}catch(J){console.error("Failed to parse confirm SSE event:",J)}}}}catch(P){console.error("Bulk confirm failed:",P),W("idle"),ge([]),_a(null);let U={id:Date.now(),role:"assistant",kind:"text",content:"Failed to start bulk operation. Please try again."};p(N=>[...N,U])}}function zI(){_a(null),p(S=>S.filter(P=>P.kind!=="bulkPreview"))}function Sy(S){mu(S)}function $I(S){let P=Date.now()+Math.floor(Math.random()*1e3);p(U=>[...U,{id:P,role:"assistant",kind:"text",content:S}])}function ID(S){let P=cy[S];if(!P)return;be("landing"),ht(void 0);let U={id:S,stepIndex:0};Lo(U),Ue.current=U,$I(`I'll help you with ${P.title}.`);let N=P.steps[0],O=N.cursorTarget?.selector.includes("[data-page="),re=N.cursorTarget?.selector.includes("[data-settings-tab=");if(N.cursorTarget&&(O||re)){let A=N.cursorTarget;re&&N.navigation&&o&&o(N.navigation.page,void 0),setTimeout(()=>{let I=()=>{let Q=document.querySelector(A.selector);Q&&Q.offsetParent!==null?(Io(A),A.onClick&&setTimeout(()=>{Q.click()},1200)):setTimeout(I,200)};I()},re?800:400)}else if(N.navigation&&o&&o(N.navigation.page,N.navigation.subtab),N.cursorTarget){let A=N.cursorTarget,E=A.selector.includes("data-settings-tab"),I=A.selector.includes("dialog")||A.selector.includes("api-key-name-input");setTimeout(()=>{let ae=()=>{let J=document.querySelector(A.selector);J&&J.offsetParent!==null?(Io(A),A.onClick&&setTimeout(()=>{J.click()},1e3)):E||I?setTimeout(ae,200):(Io(A),A.onClick&&setTimeout(()=>{let he=document.querySelector(A.selector);he&&he.click()},1e3))};ae()},I?700:E?600:400)}let Z={id:Date.now()+1,role:"assistant",kind:"guideStep",content:"",guideStepIndex:0};p(A=>[...A,Z]),Qr(Z.id,N.text)}function ep(){if(!ye)return;let S=cy[ye.id];if(!S)return;let P=Ue.current;(!P||P.id!==ye.id)&&(P=ye,Ue.current=ye);let N=P.stepIndex+1;if(N>=S.steps.length){Cn();let I=Date.now()+1;p(Q=>[...Q,{id:I,role:"assistant",kind:"guideComplete",content:"Guide Complete"}]),Lo(void 0),cu(!0);return}let O=S.steps[N],re={id:ye.id,stepIndex:N};Lo(re),Ue.current=re;let Z={id:Date.now()+1,role:"assistant",kind:"guideStep",content:"",guideStepIndex:N};p(I=>[...I,Z]);let A=O.cursorTarget?.selector.includes("[data-page="),E=O.cursorTarget?.selector.includes("[data-settings-tab=");if(O.cursorTarget&&(A||E)){let I=O.cursorTarget;E&&O.navigation&&o&&o(O.navigation.page,void 0),setTimeout(()=>{let ae=Ue.current;if(!ae||ae.id!==S.id||ae.stepIndex!==N)return;let J=()=>{let he=Ue.current;if(!he||he.id!==S.id||he.stepIndex!==N)return;let Ye=document.querySelector(I.selector);Ye&&Ye.offsetParent!==null?(Io(I),I.onClick&&setTimeout(()=>{let mt=Ue.current;!mt||mt.id!==S.id||mt.stepIndex!==N||Ye.click()},1200)):setTimeout(J,200)};J()},E?800:400)}else if(O.navigation&&o&&o(O.navigation.page,O.navigation.subtab),O.cursorTarget){let I=O.cursorTarget,Q=I.selector.includes("dialog")||I.selector.includes("api-key-name-input"),ae=I.selector.includes("data-settings-tab"),J=O.navigation?.subtab&&ae&&I.selector.includes(`data-settings-tab="${O.navigation.subtab}"`),he=I.onClick&&!J,Ye=!!O.navigation,ot=(!!O.navigation?.subtab?700:Ye?400:0)+(Q?700:ae?600:400);setTimeout(()=>{let gr=Ue.current;if(!gr||gr.id!==S.id||gr.stepIndex!==N)return;let G=()=>{let q=Ue.current;if(!q||q.id!==S.id||q.stepIndex!==N)return;let oe=document.querySelector(I.selector);oe&&oe.offsetParent!==null?(Io(I),he&&setTimeout(()=>{let fe=Ue.current;!fe||fe.id!==S.id||fe.stepIndex!==N||oe.click()},1e3)):Q||ae||I.selector.includes("data-testid")?setTimeout(G,200):(Io(I),he&&setTimeout(()=>{let fe=Ue.current;if(!fe||fe.id!==S.id||fe.stepIndex!==N)return;let At=document.querySelector(I.selector);At&&At.click()},1e3))};G()},ot)}else Cn();Qr(Z.id,O.text)}function WI(){if(!ye)return;let S=cy[ye.id];if(!S)return;let P=ye.stepIndex-1;if(P>=0){Lo({id:ye.id,stepIndex:P});let U=S.steps[P];U.navigation&&o&&o(U.navigation.page,U.navigation.subtab),U.cursorTarget?setTimeout(()=>{Io(U.cursorTarget)},500):Cn();let N=f.filter(O=>O.kind!=="guideStep"&&O.kind!=="guideComplete");p([...N,{id:Date.now(),role:"assistant",kind:"guideStep",content:U.text}])}}return e?(0,h.jsxs)("section",{className:`fixed top-0 right-0 z-40 flex flex-col bg-white border-l border-gray-200 h-full overflow-hidden transition-transform duration-300 ${e?"translate-x-0":"translate-x-full"}`,style:{width:`${NI}px`},children:[(0,h.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 bg-gradient-to-r from-gray-50 to-white shrink-0",children:[(0,h.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,h.jsx)(Fr,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"}),(0,h.jsx)("h3",{className:"text-sm font-semibold text-gray-800",children:"Copilot"})]}),(0,h.jsxs)("div",{className:"flex items-center gap-1",children:[(0,h.jsx)(Ot,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",onClick:()=>{_(),p([]),be("landing"),ht(void 0),Lo(void 0),Ue.current=void 0,cu(!1)},children:(0,h.jsx)(Ft,{className:"h-3 w-3"})}),(0,h.jsx)(Ot,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",onClick:()=>t?.(),children:(0,h.jsx)(ro,{className:"h-3.5 w-3.5"})})]})]}),(0,h.jsx)("div",{className:M?"grid flex-1 place-items-center transition-all duration-300":"flex flex-1 flex-col transition-all duration-300 min-h-0 overflow-hidden",children:M?(0,h.jsxs)("div",{className:"w-full overflow-y-auto px-4",children:[(0,h.jsx)("div",{className:"py-3 transition-all duration-300",children:(0,h.jsx)("h2",{className:"text-center text-2xl font-semibold text-gray-900",children:Jr==="folder"?DI.find(S=>S.id===pt)?.title||"":"How can I help?"})}),(0,h.jsxs)("div",{className:"pb-4 px-4",children:[Jr==="landing"&&(0,h.jsx)(h.Fragment,{children:(0,h.jsx)("div",{className:"flex flex-col gap-1",children:BI?(0,h.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,h.jsx)(Jt,{className:"h-4 w-4 animate-spin text-gray-400"})}):Ta.map((S,P)=>{let U=["bg-blue-400","bg-green-400","bg-purple-400","bg-orange-400","bg-pink-400"];return(0,h.jsxs)(Ot,{type:"button",size:"sm",variant:"ghost",className:"w-full justify-start rounded-lg px-3 py-1.5 text-xs text-gray-700 hover:bg-gray-100 h-auto",onClick:()=>Sy(S.prompt),children:[(0,h.jsx)("span",{className:`mr-2 inline-block h-1.5 w-1.5 rounded-full ${U[P%U.length]}`}),S.label]},S.id)})})}),Jr==="folder"&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,h.jsx)(Ot,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 rounded-full hover:bg-gray-100",onClick:VI,"aria-label":"Back to suggestions",children:(0,h.jsx)(is,{className:"h-4 w-4 text-gray-500"})}),(0,h.jsx)("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-400",children:"Topics"})]}),(0,h.jsx)("div",{className:"flex flex-col gap-1.5",children:DI.find(S=>S.id===pt)?.topics.map(S=>(0,h.jsx)(Ot,{type:"button",size:"sm",variant:"secondary",className:"justify-start rounded-xl border border-gray-200 bg-gray-50 px-3 py-2.5 text-xs text-gray-700 shadow-none transition-all hover:bg-gray-100 hover:border-gray-300 h-auto",onClick:()=>Sy(S.prompt),children:S.label},S.id))})]})]})]}):(0,h.jsx)(h.Fragment,{children:(0,h.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:(0,h.jsx)(Tm,{ref:Gf,className:"h-full",children:(0,h.jsxs)("div",{className:"flex flex-col gap-2 px-4 py-3",children:[f.map((S,P)=>{let U=S.role==="user",N=P>0?f[P-1].role:void 0,O=N!==void 0&&N!==S.role,re=Ue.current||ye,Z=!1;if(re&&S.kind==="guideStep"?S.guideStepIndex!==void 0?Z=S.guideStepIndex===re.stepIndex:Z=P===f.length-1:S.kind==="guideComplete"&&(Z=P===f.length-1),S.kind==="guideStep"&&!Z)return null;if(U)return(0,h.jsx)("div",{className:`flex justify-end ${O?"mt-3":""}`,children:(0,h.jsx)("div",{className:"max-w-[260px] rounded-2xl rounded-br-md bg-gray-900 px-3.5 py-2.5 text-sm text-white shadow-sm",children:S.content})},S.id);if(S.role==="agent")return(0,h.jsx)("div",{className:`flex justify-start ${O?"mt-3":""}`,children:(0,h.jsxs)("div",{className:"max-w-[260px] rounded-2xl rounded-bl-md bg-blue-50 border border-blue-200 px-3.5 py-2.5 text-sm text-gray-900 shadow-sm",children:[(0,h.jsx)("div",{className:"text-xs text-blue-600 font-medium mb-1",children:"Support Agent"}),(0,h.jsx)("div",{className:"whitespace-pre-wrap leading-relaxed",children:EI(S.content||"")})]})},S.id);if(S.kind==="searchSummary")return(0,h.jsx)("div",{className:`${O?"mt-3":""}`,children:(0,h.jsx)(eS,{title:S.title??"Search results",links:S.links??[]})},S.id);if(S.kind==="guideComplete")return(0,h.jsx)("div",{ref:Z?fu:null,className:`${O?"mt-3":""}`,children:(0,h.jsxs)("div",{className:"flex items-center gap-2 rounded-xl bg-green-50 border border-green-200 px-3 py-2.5 text-sm leading-6",children:[(0,h.jsx)(tt,{className:"h-5 w-5 text-green-600 flex-shrink-0"}),(0,h.jsx)("span",{className:"font-medium text-green-800",children:S.content})]})},S.id);if(S.kind==="navigationAction")return(0,h.jsxs)("div",{className:`${O?"mt-3":""}`,children:[(0,h.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 mb-2 text-gray-700",children:S.content||""}),S.navigationTarget&&(0,h.jsx)("div",{className:"mt-2",children:(0,h.jsxs)(Ot,{type:"button",size:"sm",variant:"secondary",className:"h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",onClick:()=>S.navigationTarget&&Qf(S.navigationTarget),children:[(0,h.jsx)("span",{children:"Confirm"}),(0,h.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,h.jsx)(pa,{className:"h-3 w-3"}),(0,h.jsx)(ha,{className:"h-3 w-3"})]})]})})]},S.id);if(S.kind==="actionForm"){let A=S.actionType,E=Object.keys(se).length>0?se:S.actionData||{};if(S.isSubmitted){let I="";return A==="updateCompanyInfo"?I="Company information has been updated successfully.":A==="addApiKey"?I="API key has been added successfully.":A==="addCustomer"?I="Customer has been added successfully.":A==="enable2FA"?I="Two-factor authentication has been enabled successfully.":A==="disable2FA"?I="Two-factor authentication has been disabled successfully.":A==="changePassword"?I="Your password has been changed successfully.":A==="revokeSession"?I="Session has been revoked successfully.":A==="toggleNotification"?I="Notification preferences have been updated successfully.":A==="connectIntegration"?I="Integration has been connected successfully.":A==="disconnectIntegration"?I="Integration has been disconnected successfully.":A==="addPaymentMethod"?I="Payment method has been added successfully.":A==="removePaymentMethod"?I="Payment method has been removed successfully.":A==="deleteApiKey"?I="API key has been deleted successfully.":A==="addWebhook"?I="Webhook endpoint has been added successfully.":A==="updateCurrency"?I="Currency preference has been updated successfully.":A==="updateTimezone"?I="Timezone has been updated successfully.":A==="refundPayment"?I="Refund has been processed successfully.":A==="exportCertificate"?I="Certificate of Incorporation has been downloaded successfully.":A==="createSubscription"?I="Subscription has been created successfully.":A==="toggleBlockRule"||A==="enableBlockRule"||A==="disableBlockRule"?I="Block rule has been updated successfully.":I="Action completed successfully.",(0,h.jsx)("div",{className:`${O?"mt-3":""}`,children:(0,h.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 text-gray-700",children:I})},S.id)}return(0,h.jsxs)("div",{className:`min-w-0 ${O?"mt-3":""}`,children:[(0,h.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 mb-3 text-gray-700",children:S.content||""}),A==="updateCompanyInfo"&&(0,h.jsxs)("div",{className:"space-y-2 bg-gray-50 rounded-lg p-2 border border-gray-200 overflow-hidden",children:[(0,h.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Company Name"}),(0,h.jsx)(De,{placeholder:"Acme Corporation",value:E.companyName||"",onChange:I=>ie({...se,companyName:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Email"}),(0,h.jsx)(De,{type:"email",placeholder:"contact@acme.com",value:E.email||"",onChange:I=>ie({...se,email:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Address"}),(0,h.jsx)(De,{placeholder:"123 Main St, San Francisco, CA",value:E.address||"",onChange:I=>ie({...se,address:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,h.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Phone"}),(0,h.jsx)(De,{type:"tel",placeholder:"+1 (555) 123-4567",value:E.phone||"",onChange:I=>ie({...se,phone:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Website"}),(0,h.jsx)(De,{type:"url",placeholder:"https://acme.com",value:E.website||"",onChange:I=>ie({...se,website:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]})]}),A==="addApiKey"&&(0,h.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"API Key Name"}),(0,h.jsx)(De,{placeholder:"Production Key",value:E.name||"",onChange:I=>ie({...se,name:I.target.value}),className:"h-8 text-xs border-gray-200"})]})}),A==="addCustomer"&&(0,h.jsxs)("div",{className:"space-y-2 bg-gray-50 rounded-lg p-2 border border-gray-200 overflow-hidden",children:[(0,h.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Company Name"}),(0,h.jsx)(De,{placeholder:"Acme Corporation",value:E.name||"",onChange:I=>ie({...se,name:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Email"}),(0,h.jsx)(De,{type:"email",placeholder:"contact@acme.com",value:E.email||"",onChange:I=>ie({...se,email:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Location"}),(0,h.jsx)(De,{placeholder:"San Francisco, CA",value:E.location||"",onChange:I=>ie({...se,location:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Subscription Tier"}),(0,h.jsxs)("select",{value:E.subscription||"Starter",onChange:I=>ie({...se,subscription:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,h.jsx)("option",{value:"Starter",children:"Starter"}),(0,h.jsx)("option",{value:"Professional",children:"Professional"}),(0,h.jsx)("option",{value:"Enterprise",children:"Enterprise"})]})]})]}),(A==="enable2FA"||A==="disable2FA")&&(0,h.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,h.jsx)("p",{className:"text-xs text-black",children:A==="enable2FA"?"This will enable two-factor authentication for your account. You'll need to set up an authenticator app.":"This will disable two-factor authentication for your account. Your account will be less secure."})}),A==="changePassword"&&(0,h.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Current Password"}),(0,h.jsx)(De,{type:"password",value:E.currentPassword||"",onChange:I=>ie({...se,currentPassword:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"New Password"}),(0,h.jsx)(De,{type:"password",value:E.newPassword||"",onChange:I=>ie({...se,newPassword:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Confirm New Password"}),(0,h.jsx)(De,{type:"password",value:E.confirmPassword||"",onChange:I=>ie({...se,confirmPassword:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),A==="toggleNotification"&&(0,h.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Notification Type"}),(0,h.jsxs)("select",{value:E.notificationType||"paymentReceived",onChange:I=>ie({...se,notificationType:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,h.jsx)("option",{value:"paymentReceived",children:"Payment Received"}),(0,h.jsx)("option",{value:"paymentFailed",children:"Payment Failed"}),(0,h.jsx)("option",{value:"invoicePaid",children:"Invoice Paid"}),(0,h.jsx)("option",{value:"monthlySummary",children:"Monthly Summary"}),(0,h.jsx)("option",{value:"productUpdates",children:"Product Updates"})]})]}),(0,h.jsxs)("div",{className:"flex items-center gap-2",children:[(0,h.jsx)("input",{type:"checkbox",checked:E.enabled!==!1,onChange:I=>ie({...se,enabled:I.target.checked}),className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"}),(0,h.jsx)("label",{className:"text-xs text-black",children:"Enable this notification"})]})]}),(A==="connectIntegration"||A==="disconnectIntegration")&&(0,h.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Integration"}),(0,h.jsxs)("select",{value:E.integrationName||"Slack",onChange:I=>ie({...se,integrationName:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,h.jsx)("option",{value:"Slack",children:"Slack"}),(0,h.jsx)("option",{value:"Zapier",children:"Zapier"}),(0,h.jsx)("option",{value:"Webhook",children:"Webhook"})]})]})}),A==="addPaymentMethod"&&(0,h.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Card Number"}),(0,h.jsx)(De,{placeholder:"1234 5678 9012 3456",value:E.cardNumber||"",onChange:I=>ie({...se,cardNumber:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Expiry Date"}),(0,h.jsx)(De,{placeholder:"MM/YY",value:E.expiryDate||"",onChange:I=>ie({...se,expiryDate:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),A==="removePaymentMethod"&&(0,h.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,h.jsx)("p",{className:"text-xs text-black",children:"This will remove the default payment method from your account."})}),A==="refundPayment"&&(0,h.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Transaction ID or Customer Name"}),(0,h.jsx)(De,{placeholder:"e.g., txn_1234 or Acme Corp",value:E.transactionId||E.customer||"",onChange:I=>{let Q=I.target.value;Q.startsWith("txn_")||/^\d+$/.test(Q)?ie({...se,transactionId:Q,customer:void 0}):ie({...se,customer:Q,transactionId:void 0})},className:"h-8 text-xs border-gray-200"})]}),(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Amount (optional)"}),(0,h.jsx)(De,{placeholder:"$0.00",value:E.amount||"",onChange:I=>ie({...se,amount:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Reason (optional)"}),(0,h.jsx)(De,{placeholder:"e.g., Customer request",value:E.reason||"",onChange:I=>ie({...se,reason:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),A==="deleteApiKey"&&(0,h.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"API Key Name or ID"}),(0,h.jsx)(De,{placeholder:"Production Key",value:E.keyId||E.name||"",onChange:I=>ie({...se,keyId:I.target.value,name:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,h.jsx)("p",{className:"text-xs text-red-600",children:"Warning: This action cannot be undone. The API key will be permanently deleted."})]}),A==="addWebhook"&&(0,h.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Webhook URL"}),(0,h.jsx)(De,{type:"url",placeholder:"https://example.com/webhook",value:E.url||"",onChange:I=>ie({...se,url:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Name (optional)"}),(0,h.jsx)(De,{placeholder:"Production Webhook",value:E.name||"",onChange:I=>ie({...se,name:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),A==="updateCurrency"&&(0,h.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Currency"}),(0,h.jsxs)("select",{value:E.currency||"USD",onChange:I=>ie({...se,currency:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,h.jsx)("option",{value:"USD",children:"USD ($)"}),(0,h.jsx)("option",{value:"EUR",children:"EUR (\u20AC)"}),(0,h.jsx)("option",{value:"GBP",children:"GBP (\xA3)"}),(0,h.jsx)("option",{value:"JPY",children:"JPY (\xA5)"})]})]})}),A==="updateTimezone"&&(0,h.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Timezone"}),(0,h.jsxs)("select",{value:E.timezone||"America/Los_Angeles",onChange:I=>ie({...se,timezone:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,h.jsx)("option",{value:"America/Los_Angeles",children:"Pacific Time (PT)"}),(0,h.jsx)("option",{value:"America/New_York",children:"Eastern Time (ET)"}),(0,h.jsx)("option",{value:"Europe/London",children:"GMT"}),(0,h.jsx)("option",{value:"Asia/Tokyo",children:"JST"})]})]})}),A==="revokeSession"&&(0,h.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Device/Session"}),(0,h.jsx)(De,{placeholder:"MacBook Pro",value:E.device||"",onChange:I=>ie({...se,device:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,h.jsx)("p",{className:"text-xs text-black",children:"This will sign out the device and invalidate its session."})]}),A==="createSubscription"&&(0,h.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Customer Email"}),(0,h.jsx)(De,{type:"email",placeholder:"customer@example.com",value:E.customerEmail||"",onChange:I=>ie({...se,customerEmail:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Plan"}),(0,h.jsxs)("select",{value:E.plan||"Starter",onChange:I=>ie({...se,plan:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,h.jsx)("option",{value:"Starter",children:"Starter ($29/mo)"}),(0,h.jsx)("option",{value:"Professional",children:"Professional ($99/mo)"}),(0,h.jsx)("option",{value:"Enterprise",children:"Enterprise ($299/mo)"})]})]}),(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Billing Cycle"}),(0,h.jsxs)("select",{value:E.billingCycle||"monthly",onChange:I=>ie({...se,billingCycle:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,h.jsx)("option",{value:"monthly",children:"Monthly"}),(0,h.jsx)("option",{value:"yearly",children:"Yearly (Save 15%)"})]})]})]}),A==="exportCertificate"&&(0,h.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,h.jsx)("p",{className:"text-xs text-black",children:"This will export your certificate of incorporation document."}),(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Format"}),(0,h.jsxs)("select",{value:E.format||"pdf",onChange:I=>ie({...se,format:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,h.jsx)("option",{value:"pdf",children:"PDF"}),(0,h.jsx)("option",{value:"json",children:"JSON"})]})]})]}),(A==="toggleBlockRule"||A==="enableBlockRule"||A==="disableBlockRule")&&(0,h.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Block Rule"}),(0,h.jsxs)("select",{value:E.ruleId||"rule_1",onChange:I=>ie({...se,ruleId:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,h.jsx)("option",{value:"rule_1",children:"Block if risk level = 'highest'"}),(0,h.jsx)("option",{value:"rule_2",children:"Block if matches Stripe block lists"}),(0,h.jsx)("option",{value:"rule_3",children:"Block if CVC verification fails"}),(0,h.jsx)("option",{value:"rule_4",children:"Block if Postal code verification fails"})]})]}),(0,h.jsx)("p",{className:"text-xs text-black",children:A==="enableBlockRule"?"This will enable the selected block rule to actively block matching payments.":A==="disableBlockRule"?"This will disable the selected block rule. Matching payments will no longer be blocked.":"This will toggle the selected block rule's state."})]}),(0,h.jsx)("div",{className:"mt-3",children:(0,h.jsxs)(Ot,{type:"button",size:"sm",variant:"secondary",className:"h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",onClick:Yf,children:[(0,h.jsx)("span",{children:"Confirm"}),(0,h.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,h.jsx)(pa,{className:"h-3 w-3"}),(0,h.jsx)(ha,{className:"h-3 w-3"})]})]})})]},S.id)}if(S.kind==="bulkPreview"&&S.csvData)return(0,h.jsxs)("div",{className:`${O?"mt-3":""}`,children:[(0,h.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 mb-3 text-gray-700",children:S.content||""}),(0,h.jsxs)("div",{className:"bg-gray-50 rounded-lg border border-gray-200 overflow-hidden",children:[(0,h.jsxs)("div",{className:"bg-gray-100 px-3 py-2 border-b border-gray-200 flex items-center gap-2",children:[(0,h.jsx)(ls,{className:"h-4 w-4 text-gray-600"}),(0,h.jsx)("span",{className:"text-xs font-medium text-gray-700",children:S.csvData.fileName}),(0,h.jsxs)("span",{className:"text-xs text-gray-500",children:["\u2022 ",S.csvData.rowCount," rows"]})]}),(0,h.jsxs)("div",{className:"px-3 py-2 border-b border-gray-100",children:[(0,h.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-gray-500 mb-1",children:"Columns"}),(0,h.jsx)("div",{className:"flex flex-wrap gap-1",children:S.csvData.columns.map((A,E)=>(0,h.jsx)("span",{className:"text-xs bg-blue-100 text-blue-700 px-1.5 py-0.5 rounded",children:A},E))})]}),S.csvData.sampleRows.length>0&&(0,h.jsxs)("div",{className:"px-3 py-2",children:[(0,h.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-gray-500 mb-1",children:"Sample Data"}),(0,h.jsx)("div",{className:"space-y-1",children:S.csvData.sampleRows.slice(0,3).map((A,E)=>(0,h.jsxs)("div",{className:"text-xs text-gray-600 bg-white rounded px-2 py-1 border border-gray-100",children:[Object.entries(A).slice(0,3).map(([I,Q],ae)=>(0,h.jsxs)("span",{children:[ae>0&&" \u2022 ",(0,h.jsxs)("span",{className:"text-gray-400",children:[I,":"]})," ",Q]},I)),Object.keys(A).length>3&&(0,h.jsxs)("span",{className:"text-gray-400",children:[" ","..."]})]},E))})]}),S.suggestedAction&&(0,h.jsx)("div",{className:"px-3 py-2 bg-blue-50 border-t border-blue-100",children:(0,h.jsxs)("span",{className:"text-xs text-blue-700",children:["Suggested action:"," ",(0,h.jsx)("strong",{children:S.suggestedAction.replace(/_/g," ")})]})})]}),S.bulkSessionId&&(0,h.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[(0,h.jsxs)(Ot,{type:"button",size:"sm",variant:"secondary",className:"h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",onClick:()=>S.bulkSessionId&&Zf(S.bulkSessionId),children:[(0,h.jsxs)("span",{children:["Process ",S.csvData.rowCount," rows"]}),(0,h.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,h.jsx)(pa,{className:"h-3 w-3"}),(0,h.jsx)(ha,{className:"h-3 w-3"})]})]}),(0,h.jsx)(Ot,{type:"button",size:"sm",variant:"ghost",className:"h-8 rounded-xl px-3 text-xs text-gray-500 hover:text-gray-700 hover:bg-gray-100",onClick:zI,children:"Cancel"})]})]},S.id);if(S.kind==="bulkProgress"&&S.bulkProgress){let{processed:A,total:E,successes:I,failures:Q}=S.bulkProgress,ae=Math.round(A/E*100);return(0,h.jsx)("div",{className:`${O?"mt-3":""}`,children:(0,h.jsxs)("div",{className:"bg-gray-50 rounded-lg border border-gray-200 p-3",children:[(0,h.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,h.jsx)(Jt,{className:"h-4 w-4 animate-spin text-blue-600"}),(0,h.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Processing... ",A," of ",E]})]}),(0,h.jsx)("div",{className:"h-2 bg-gray-200 rounded-full overflow-hidden mb-2",children:(0,h.jsx)("div",{className:"h-full bg-blue-600 transition-all duration-300",style:{width:`${ae}%`}})}),(0,h.jsxs)("div",{className:"flex items-center gap-3 text-xs text-gray-600",children:[(0,h.jsxs)("span",{className:"flex items-center gap-1",children:[(0,h.jsx)(tt,{className:"h-3 w-3 text-green-600"}),I," successful"]}),Q>0&&(0,h.jsxs)("span",{className:"flex items-center gap-1 text-red-600",children:[(0,h.jsx)(ro,{className:"h-3 w-3"}),Q," failed"]})]})]})},S.id)}if(S.kind==="bulkSummary"&&S.bulkSummary){let{total:A,successes:E,failures:I,navigationPage:Q}=S.bulkSummary,ae=I.length>0,J=Q?.page==="customers"?"Customers":Q?.page==="dashboard"?"Dashboard":Q?.page==="settings"?"Settings":"Results";return(0,h.jsx)("div",{className:`${O?"mt-3":""}`,children:(0,h.jsxs)("div",{className:`rounded-lg border p-3 ${ae?"bg-amber-50 border-amber-200":"bg-green-50 border-green-200"}`,children:[(0,h.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,h.jsx)(tt,{className:`h-5 w-5 ${ae?"text-amber-600":"text-green-600"}`}),(0,h.jsx)("span",{className:"text-sm font-medium text-gray-800",children:"Bulk operation complete"})]}),(0,h.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:S.content||`Processed ${A} rows: ${E} successful${ae?`, ${I.length} failed`:""}.`}),(0,h.jsxs)("div",{className:"flex items-center gap-4 text-xs",children:[(0,h.jsxs)("span",{className:"flex items-center gap-1 text-green-700",children:[(0,h.jsx)(tt,{className:"h-3 w-3"}),E," successful"]}),ae&&(0,h.jsxs)("span",{className:"flex items-center gap-1 text-red-600",children:[(0,h.jsx)(ro,{className:"h-3 w-3"}),I.length," failed"]})]}),ae&&(0,h.jsxs)("div",{className:"mt-3 pt-2 border-t border-amber-200",children:[(0,h.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-amber-700 mb-1",children:"Failed Rows"}),(0,h.jsxs)("div",{className:"space-y-1 max-h-32 overflow-y-auto",children:[I.slice(0,5).map((he,Ye)=>(0,h.jsxs)("div",{className:"text-xs text-red-700 bg-red-50 rounded px-2 py-1",children:["Row ",he.row,":"," ",he.error||"Unknown error"]},Ye)),I.length>5&&(0,h.jsxs)("div",{className:"text-xs text-amber-600",children:["...and ",I.length-5," more"]})]})]}),Q&&E>0&&(0,h.jsx)("div",{className:"mt-3 pt-2 border-t border-gray-200",children:(0,h.jsxs)("button",{type:"button",onClick:he=>{he.preventDefault(),he.stopPropagation(),console.log("[DEBUG] Button clicked - navigationPage:",Q,"onNavigate:",!!o),o&&Q.page?(console.log("[DEBUG] Calling onNavigate with page:",Q.page),o(Q.page,Q.subtab)):console.log("[DEBUG] Condition failed - onNavigate:",!!o,"navigationPage.page:",Q.page)},className:"flex items-center gap-2 text-xs text-gray-500 hover:text-gray-700 transition-colors group cursor-pointer",children:[(0,h.jsxs)("span",{className:"flex items-center gap-1 px-1.5 py-0.5 bg-gray-100 rounded text-[10px] font-medium text-gray-600 group-hover:bg-gray-200",children:[(0,h.jsx)(pa,{className:"h-2.5 w-2.5"}),(0,h.jsx)("span",{children:"+"}),(0,h.jsx)(ha,{className:"h-2.5 w-2.5"})]}),(0,h.jsxs)("span",{children:["View ",J]})]})})]})},S.id)}return(0,h.jsx)(z.Fragment,{children:(0,h.jsxs)("div",{ref:Z?fu:null,className:`${O?"mt-3":""}`,children:[(0,h.jsx)("div",{className:"text-sm leading-6 text-gray-700",children:(()=>{let A=S.content||"";if(S.kind==="guideStep"){let E=A.match(/^(Step\s+\d+:)([\s\S]*)/);if(E)return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("strong",{children:E[1]}),E[2]]})}return S.role==="assistant"&&A?EI(A):A||(0,h.jsx)("span",{className:"opacity-70",children:"Thinking\u2026"})})()}),S.role==="assistant"&&S.structuredData&&(0,h.jsx)("div",{className:"mt-3",children:(0,h.jsx)(IL,{type:S.structuredData.type,data:S.structuredData.data})}),S.role==="assistant"&&S.followups&&S.followups.length>0&&!S.followupSelected&&(0,h.jsx)("div",{className:"mt-3 flex flex-wrap gap-1.5",children:S.followups.map(A=>(0,h.jsx)("button",{type:"button",onClick:()=>UI(S.id,A),className:`inline-flex items-center px-3 py-1.5 text-xs font-medium rounded-xl
|
|
30
|
+
`);B=T.pop()||"";for(let N of T){if(!N.trim())continue;let I=N.split(`
|
|
31
|
+
`),K="",J="";for(let j of I)j.startsWith("event: ")?K=j.slice(7):j.startsWith("data: ")&&(J=j.slice(6));if(!(!K||!J))try{let j=JSON.parse(J);if(K==="progress")M([{message:`Processing row ${j.row} of ${j.total}...`,completed:!1}]),c(ce=>ce[ce.length-1]?.kind==="bulkProgress"?ce.map((tt,Ma)=>Ma===ce.length-1?{...tt,bulkProgress:{processed:j.row,total:j.total,successes:j.successes||0,failures:j.failures||0}}:tt):[...ce,{id:Date.now(),role:"assistant",kind:"bulkProgress",bulkProgress:{processed:j.row,total:j.total,successes:j.successes||0,failures:j.failures||0}}]);else if(K==="summary")console.log("[DEBUG] Received summary event - data:",j),console.log("[DEBUG] navigationPage from backend:",j.navigationPage),P("idle"),M([]),nr(null),c(ce=>{let He=ce.filter(Ma=>Ma.kind!=="bulkProgress"&&Ma.kind!=="bulkPreview"),tt={id:Date.now(),role:"assistant",kind:"bulkSummary",content:j.message,bulkSummary:{total:j.total,successes:j.successes,failures:j.failures||[],navigationPage:j.navigationPage}};return console.log("[DEBUG] Creating bulkSummary message:",tt),[...He,tt]}),setTimeout(()=>{window.dispatchEvent(new CustomEvent("agentActionComplete",{detail:{result:{bulk:!0,total:j.total,successes:j.successes}}}))},100);else if(K==="error"){P("idle"),M([]),nr(null);let ce={id:Date.now(),role:"assistant",kind:"text",content:j.message||"An error occurred during bulk processing."};c(He=>[...He,ce])}}catch(j){console.error("Failed to parse confirm SSE event:",j)}}}}catch(b){console.error("Bulk confirm failed:",b),P("idle"),M([]),nr(null);let V={id:Date.now(),role:"assistant",kind:"text",content:"Failed to start bulk operation. Please try again."};c(F=>[...F,V])}}function SS(){nr(null),c(v=>v.filter(b=>b.kind!=="bulkPreview"))}function sh(v){Zi(v)}function IS(v){let b=Date.now()+Math.floor(Math.random()*1e3);c(V=>[...V,{id:b,role:"assistant",kind:"text",content:v}])}function kT(v){let b=Xm[v];if(!b)return;Zt("landing"),pa(void 0);let V={id:v,stepIndex:0};$e(V),De.current=V,IS(`I'll help you with ${b.title}.`);let F=b.steps[0],B=F.cursorTarget?.selector.includes("[data-page="),Q=F.cursorTarget?.selector.includes("[data-settings-tab=");if(F.cursorTarget&&(B||Q)){let T=F.cursorTarget;Q&&F.navigation&&o&&o(F.navigation.page,void 0),setTimeout(()=>{let I=()=>{let K=document.querySelector(T.selector);K&&K.offsetParent!==null?(Qr(T),T.onClick&&setTimeout(()=>{K.click()},1200)):setTimeout(I,200)};I()},Q?800:400)}else if(F.navigation&&o&&o(F.navigation.page,F.navigation.subtab),F.cursorTarget){let T=F.cursorTarget,N=T.selector.includes("data-settings-tab"),I=T.selector.includes("dialog")||T.selector.includes("api-key-name-input");setTimeout(()=>{let J=()=>{let j=document.querySelector(T.selector);j&&j.offsetParent!==null?(Qr(T),T.onClick&&setTimeout(()=>{j.click()},1e3)):N||I?setTimeout(J,200):(Qr(T),T.onClick&&setTimeout(()=>{let ce=document.querySelector(T.selector);ce&&ce.click()},1e3))};J()},I?700:N?600:400)}let X={id:Date.now()+1,role:"assistant",kind:"guideStep",content:"",guideStepIndex:0};c(T=>[...T,X]),Da(X.id,F.text)}function mc(){if(!oe)return;let v=Xm[oe.id];if(!v)return;let b=De.current;(!b||b.id!==oe.id)&&(b=oe,De.current=oe);let F=b.stepIndex+1;if(F>=v.steps.length){Mo();let I=Date.now()+1;c(K=>[...K,{id:I,role:"assistant",kind:"guideComplete",content:"Guide Complete"}]),$e(void 0),Ki(!0);return}let B=v.steps[F],Q={id:oe.id,stepIndex:F};$e(Q),De.current=Q;let X={id:Date.now()+1,role:"assistant",kind:"guideStep",content:"",guideStepIndex:F};c(I=>[...I,X]);let T=B.cursorTarget?.selector.includes("[data-page="),N=B.cursorTarget?.selector.includes("[data-settings-tab=");if(B.cursorTarget&&(T||N)){let I=B.cursorTarget;N&&B.navigation&&o&&o(B.navigation.page,void 0),setTimeout(()=>{let J=De.current;if(!J||J.id!==v.id||J.stepIndex!==F)return;let j=()=>{let ce=De.current;if(!ce||ce.id!==v.id||ce.stepIndex!==F)return;let He=document.querySelector(I.selector);He&&He.offsetParent!==null?(Qr(I),I.onClick&&setTimeout(()=>{let tt=De.current;!tt||tt.id!==v.id||tt.stepIndex!==F||He.click()},1200)):setTimeout(j,200)};j()},N?800:400)}else if(B.navigation&&o&&o(B.navigation.page,B.navigation.subtab),B.cursorTarget){let I=B.cursorTarget,K=I.selector.includes("dialog")||I.selector.includes("api-key-name-input"),J=I.selector.includes("data-settings-tab"),j=B.navigation?.subtab&&J&&I.selector.includes(`data-settings-tab="${B.navigation.subtab}"`),ce=I.onClick&&!j,He=!!B.navigation,qe=(!!B.navigation?.subtab?700:He?400:0)+(K?700:J?600:400);setTimeout(()=>{let Jt=De.current;if(!Jt||Jt.id!==v.id||Jt.stepIndex!==F)return;let q=()=>{let z=De.current;if(!z||z.id!==v.id||z.stepIndex!==F)return;let ee=document.querySelector(I.selector);ee&&ee.offsetParent!==null?(Qr(I),ce&&setTimeout(()=>{let ue=De.current;!ue||ue.id!==v.id||ue.stepIndex!==F||ee.click()},1e3)):K||J||I.selector.includes("data-testid")?setTimeout(q,200):(Qr(I),ce&&setTimeout(()=>{let ue=De.current;if(!ue||ue.id!==v.id||ue.stepIndex!==F)return;let xt=document.querySelector(I.selector);xt&&xt.click()},1e3))};q()},qe)}else Mo();Da(X.id,B.text)}function wS(){if(!oe)return;let v=Xm[oe.id];if(!v)return;let b=oe.stepIndex-1;if(b>=0){$e({id:oe.id,stepIndex:b});let V=v.steps[b];V.navigation&&o&&o(V.navigation.page,V.navigation.subtab),V.cursorTarget?setTimeout(()=>{Qr(V.cursorTarget)},500):Mo();let F=d.filter(B=>B.kind!=="guideStep"&&B.kind!=="guideComplete");c([...F,{id:Date.now(),role:"assistant",kind:"guideStep",content:V.text}])}}return e?(0,f.jsxs)("section",{className:`fixed top-0 right-0 z-40 flex flex-col bg-white border-l border-gray-200 h-full overflow-hidden transition-transform duration-300 ${e?"translate-x-0":"translate-x-full"}`,style:{width:`${pS}px`},children:[(0,f.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 bg-gradient-to-r from-gray-50 to-white shrink-0",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,f.jsx)(Ca,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"}),(0,f.jsx)("h3",{className:"text-sm font-semibold text-gray-800",children:"Copilot"})]}),(0,f.jsxs)("div",{className:"flex items-center gap-1",children:[(0,f.jsx)(It,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",onClick:()=>{x(),c([]),Zt("landing"),pa(void 0),$e(void 0),De.current=void 0,Ki(!1)},children:(0,f.jsx)(kt,{className:"h-3 w-3"})}),(0,f.jsx)(It,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",onClick:()=>t?.(),children:(0,f.jsx)(Mr,{className:"h-3.5 w-3.5"})})]})]}),(0,f.jsx)("div",{className:k?"grid flex-1 place-items-center transition-all duration-300":"flex flex-1 flex-col transition-all duration-300 min-h-0 overflow-hidden",children:k?(0,f.jsxs)("div",{className:"w-full overflow-y-auto px-4",children:[(0,f.jsx)("div",{className:"py-3 transition-all duration-300",children:(0,f.jsx)("h2",{className:"text-center text-2xl font-semibold text-gray-900",children:se==="folder"?fS.find(v=>v.id===fa)?.title||"":"How can I help?"})}),(0,f.jsxs)("div",{className:"pb-4 px-4",children:[se==="landing"&&(0,f.jsx)(f.Fragment,{children:(0,f.jsx)("div",{className:"flex flex-col gap-1",children:dt?(0,f.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,f.jsx)(Ot,{className:"h-4 w-4 animate-spin text-gray-400"})}):Xr.map((v,b)=>{let V=["bg-blue-400","bg-green-400","bg-purple-400","bg-orange-400","bg-pink-400"];return(0,f.jsxs)(It,{type:"button",size:"sm",variant:"ghost",className:"w-full justify-start rounded-lg px-3 py-1.5 text-xs text-gray-700 hover:bg-gray-100 h-auto",onClick:()=>sh(v.prompt),children:[(0,f.jsx)("span",{className:`mr-2 inline-block h-1.5 w-1.5 rounded-full ${V[b%V.length]}`}),v.label]},v.id)})})}),se==="folder"&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,f.jsx)(It,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 rounded-full hover:bg-gray-100",onClick:yS,"aria-label":"Back to suggestions",children:(0,f.jsx)(yn,{className:"h-4 w-4 text-gray-500"})}),(0,f.jsx)("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-400",children:"Topics"})]}),(0,f.jsx)("div",{className:"flex flex-col gap-1.5",children:fS.find(v=>v.id===fa)?.topics.map(v=>(0,f.jsx)(It,{type:"button",size:"sm",variant:"secondary",className:"justify-start rounded-xl border border-gray-200 bg-gray-50 px-3 py-2.5 text-xs text-gray-700 shadow-none transition-all hover:bg-gray-100 hover:border-gray-300 h-auto",onClick:()=>sh(v.prompt),children:v.label},v.id))})]})]})]}):(0,f.jsx)(f.Fragment,{children:(0,f.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:(0,f.jsx)(qp,{ref:lc,className:"h-full",children:(0,f.jsxs)("div",{className:"flex flex-col gap-2 px-4 py-3",children:[d.map((v,b)=>{let V=v.role==="user",F=b>0?d[b-1].role:void 0,B=F!==void 0&&F!==v.role,Q=De.current||oe,X=!1;if(Q&&v.kind==="guideStep"?v.guideStepIndex!==void 0?X=v.guideStepIndex===Q.stepIndex:X=b===d.length-1:v.kind==="guideComplete"&&(X=b===d.length-1),v.kind==="guideStep"&&!X)return null;if(V)return(0,f.jsx)("div",{className:`flex justify-end ${B?"mt-3":""}`,children:(0,f.jsx)("div",{className:"max-w-[260px] rounded-2xl rounded-br-md bg-gray-900 px-3.5 py-2.5 text-sm text-white shadow-sm",children:v.content})},v.id);if(v.role==="agent")return(0,f.jsx)("div",{className:`flex justify-start ${B?"mt-3":""}`,children:(0,f.jsxs)("div",{className:"max-w-[260px] rounded-2xl rounded-bl-md bg-blue-50 border border-blue-200 px-3.5 py-2.5 text-sm text-gray-900 shadow-sm",children:[(0,f.jsx)("div",{className:"text-xs text-blue-600 font-medium mb-1",children:"Support Agent"}),(0,f.jsx)("div",{className:"whitespace-pre-wrap leading-relaxed",children:cS(v.content||"")})]})},v.id);if(v.kind==="searchSummary")return(0,f.jsx)("div",{className:`${B?"mt-3":""}`,children:(0,f.jsx)(Uv,{title:v.title??"Search results",links:v.links??[]})},v.id);if(v.kind==="guideComplete")return(0,f.jsx)("div",{ref:X?Xi:null,className:`${B?"mt-3":""}`,children:(0,f.jsxs)("div",{className:"flex items-center gap-2 rounded-xl bg-green-50 border border-green-200 px-3 py-2.5 text-sm leading-6",children:[(0,f.jsx)(je,{className:"h-5 w-5 text-green-600 flex-shrink-0"}),(0,f.jsx)("span",{className:"font-medium text-green-800",children:v.content})]})},v.id);if(v.kind==="navigationAction")return(0,f.jsxs)("div",{className:`${B?"mt-3":""}`,children:[(0,f.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 mb-2 text-gray-700",children:v.content||""}),v.navigationTarget&&(0,f.jsx)("div",{className:"mt-2",children:(0,f.jsxs)(It,{type:"button",size:"sm",variant:"secondary",className:"h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",onClick:()=>v.navigationTarget&&cc(v.navigationTarget),children:[(0,f.jsx)("span",{children:"Confirm"}),(0,f.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,f.jsx)(Ka,{className:"h-3 w-3"}),(0,f.jsx)($a,{className:"h-3 w-3"})]})]})})]},v.id);if(v.kind==="actionForm"){let T=v.actionType,N=Object.keys(ae).length>0?ae:v.actionData||{};if(v.isSubmitted){let I="";return T==="updateCompanyInfo"?I="Company information has been updated successfully.":T==="addApiKey"?I="API key has been added successfully.":T==="addCustomer"?I="Customer has been added successfully.":T==="enable2FA"?I="Two-factor authentication has been enabled successfully.":T==="disable2FA"?I="Two-factor authentication has been disabled successfully.":T==="changePassword"?I="Your password has been changed successfully.":T==="revokeSession"?I="Session has been revoked successfully.":T==="toggleNotification"?I="Notification preferences have been updated successfully.":T==="connectIntegration"?I="Integration has been connected successfully.":T==="disconnectIntegration"?I="Integration has been disconnected successfully.":T==="addPaymentMethod"?I="Payment method has been added successfully.":T==="removePaymentMethod"?I="Payment method has been removed successfully.":T==="deleteApiKey"?I="API key has been deleted successfully.":T==="addWebhook"?I="Webhook endpoint has been added successfully.":T==="updateCurrency"?I="Currency preference has been updated successfully.":T==="updateTimezone"?I="Timezone has been updated successfully.":T==="refundPayment"?I="Refund has been processed successfully.":T==="exportCertificate"?I="Certificate of Incorporation has been downloaded successfully.":T==="createSubscription"?I="Subscription has been created successfully.":T==="toggleBlockRule"||T==="enableBlockRule"||T==="disableBlockRule"?I="Block rule has been updated successfully.":I="Action completed successfully.",(0,f.jsx)("div",{className:`${B?"mt-3":""}`,children:(0,f.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 text-gray-700",children:I})},v.id)}return(0,f.jsxs)("div",{className:`min-w-0 ${B?"mt-3":""}`,children:[(0,f.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 mb-3 text-gray-700",children:v.content||""}),T==="updateCompanyInfo"&&(0,f.jsxs)("div",{className:"space-y-2 bg-gray-50 rounded-lg p-2 border border-gray-200 overflow-hidden",children:[(0,f.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Company Name"}),(0,f.jsx)(Pe,{placeholder:"Acme Corporation",value:N.companyName||"",onChange:I=>re({...ae,companyName:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Email"}),(0,f.jsx)(Pe,{type:"email",placeholder:"contact@acme.com",value:N.email||"",onChange:I=>re({...ae,email:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Address"}),(0,f.jsx)(Pe,{placeholder:"123 Main St, San Francisco, CA",value:N.address||"",onChange:I=>re({...ae,address:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,f.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Phone"}),(0,f.jsx)(Pe,{type:"tel",placeholder:"+1 (555) 123-4567",value:N.phone||"",onChange:I=>re({...ae,phone:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Website"}),(0,f.jsx)(Pe,{type:"url",placeholder:"https://acme.com",value:N.website||"",onChange:I=>re({...ae,website:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]})]}),T==="addApiKey"&&(0,f.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"API Key Name"}),(0,f.jsx)(Pe,{placeholder:"Production Key",value:N.name||"",onChange:I=>re({...ae,name:I.target.value}),className:"h-8 text-xs border-gray-200"})]})}),T==="addCustomer"&&(0,f.jsxs)("div",{className:"space-y-2 bg-gray-50 rounded-lg p-2 border border-gray-200 overflow-hidden",children:[(0,f.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Company Name"}),(0,f.jsx)(Pe,{placeholder:"Acme Corporation",value:N.name||"",onChange:I=>re({...ae,name:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Email"}),(0,f.jsx)(Pe,{type:"email",placeholder:"contact@acme.com",value:N.email||"",onChange:I=>re({...ae,email:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Location"}),(0,f.jsx)(Pe,{placeholder:"San Francisco, CA",value:N.location||"",onChange:I=>re({...ae,location:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Subscription Tier"}),(0,f.jsxs)("select",{value:N.subscription||"Starter",onChange:I=>re({...ae,subscription:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,f.jsx)("option",{value:"Starter",children:"Starter"}),(0,f.jsx)("option",{value:"Professional",children:"Professional"}),(0,f.jsx)("option",{value:"Enterprise",children:"Enterprise"})]})]})]}),(T==="enable2FA"||T==="disable2FA")&&(0,f.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,f.jsx)("p",{className:"text-xs text-black",children:T==="enable2FA"?"This will enable two-factor authentication for your account. You'll need to set up an authenticator app.":"This will disable two-factor authentication for your account. Your account will be less secure."})}),T==="changePassword"&&(0,f.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Current Password"}),(0,f.jsx)(Pe,{type:"password",value:N.currentPassword||"",onChange:I=>re({...ae,currentPassword:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"New Password"}),(0,f.jsx)(Pe,{type:"password",value:N.newPassword||"",onChange:I=>re({...ae,newPassword:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Confirm New Password"}),(0,f.jsx)(Pe,{type:"password",value:N.confirmPassword||"",onChange:I=>re({...ae,confirmPassword:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),T==="toggleNotification"&&(0,f.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Notification Type"}),(0,f.jsxs)("select",{value:N.notificationType||"paymentReceived",onChange:I=>re({...ae,notificationType:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,f.jsx)("option",{value:"paymentReceived",children:"Payment Received"}),(0,f.jsx)("option",{value:"paymentFailed",children:"Payment Failed"}),(0,f.jsx)("option",{value:"invoicePaid",children:"Invoice Paid"}),(0,f.jsx)("option",{value:"monthlySummary",children:"Monthly Summary"}),(0,f.jsx)("option",{value:"productUpdates",children:"Product Updates"})]})]}),(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)("input",{type:"checkbox",checked:N.enabled!==!1,onChange:I=>re({...ae,enabled:I.target.checked}),className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"}),(0,f.jsx)("label",{className:"text-xs text-black",children:"Enable this notification"})]})]}),(T==="connectIntegration"||T==="disconnectIntegration")&&(0,f.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Integration"}),(0,f.jsxs)("select",{value:N.integrationName||"Slack",onChange:I=>re({...ae,integrationName:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,f.jsx)("option",{value:"Slack",children:"Slack"}),(0,f.jsx)("option",{value:"Zapier",children:"Zapier"}),(0,f.jsx)("option",{value:"Webhook",children:"Webhook"})]})]})}),T==="addPaymentMethod"&&(0,f.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Card Number"}),(0,f.jsx)(Pe,{placeholder:"1234 5678 9012 3456",value:N.cardNumber||"",onChange:I=>re({...ae,cardNumber:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Expiry Date"}),(0,f.jsx)(Pe,{placeholder:"MM/YY",value:N.expiryDate||"",onChange:I=>re({...ae,expiryDate:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),T==="removePaymentMethod"&&(0,f.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,f.jsx)("p",{className:"text-xs text-black",children:"This will remove the default payment method from your account."})}),T==="refundPayment"&&(0,f.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Transaction ID or Customer Name"}),(0,f.jsx)(Pe,{placeholder:"e.g., txn_1234 or Acme Corp",value:N.transactionId||N.customer||"",onChange:I=>{let K=I.target.value;K.startsWith("txn_")||/^\d+$/.test(K)?re({...ae,transactionId:K,customer:void 0}):re({...ae,customer:K,transactionId:void 0})},className:"h-8 text-xs border-gray-200"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Amount (optional)"}),(0,f.jsx)(Pe,{placeholder:"$0.00",value:N.amount||"",onChange:I=>re({...ae,amount:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Reason (optional)"}),(0,f.jsx)(Pe,{placeholder:"e.g., Customer request",value:N.reason||"",onChange:I=>re({...ae,reason:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),T==="deleteApiKey"&&(0,f.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"API Key Name or ID"}),(0,f.jsx)(Pe,{placeholder:"Production Key",value:N.keyId||N.name||"",onChange:I=>re({...ae,keyId:I.target.value,name:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,f.jsx)("p",{className:"text-xs text-red-600",children:"Warning: This action cannot be undone. The API key will be permanently deleted."})]}),T==="addWebhook"&&(0,f.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Webhook URL"}),(0,f.jsx)(Pe,{type:"url",placeholder:"https://example.com/webhook",value:N.url||"",onChange:I=>re({...ae,url:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Name (optional)"}),(0,f.jsx)(Pe,{placeholder:"Production Webhook",value:N.name||"",onChange:I=>re({...ae,name:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),T==="updateCurrency"&&(0,f.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Currency"}),(0,f.jsxs)("select",{value:N.currency||"USD",onChange:I=>re({...ae,currency:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,f.jsx)("option",{value:"USD",children:"USD ($)"}),(0,f.jsx)("option",{value:"EUR",children:"EUR (\u20AC)"}),(0,f.jsx)("option",{value:"GBP",children:"GBP (\xA3)"}),(0,f.jsx)("option",{value:"JPY",children:"JPY (\xA5)"})]})]})}),T==="updateTimezone"&&(0,f.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Timezone"}),(0,f.jsxs)("select",{value:N.timezone||"America/Los_Angeles",onChange:I=>re({...ae,timezone:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,f.jsx)("option",{value:"America/Los_Angeles",children:"Pacific Time (PT)"}),(0,f.jsx)("option",{value:"America/New_York",children:"Eastern Time (ET)"}),(0,f.jsx)("option",{value:"Europe/London",children:"GMT"}),(0,f.jsx)("option",{value:"Asia/Tokyo",children:"JST"})]})]})}),T==="revokeSession"&&(0,f.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Device/Session"}),(0,f.jsx)(Pe,{placeholder:"MacBook Pro",value:N.device||"",onChange:I=>re({...ae,device:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,f.jsx)("p",{className:"text-xs text-black",children:"This will sign out the device and invalidate its session."})]}),T==="createSubscription"&&(0,f.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Customer Email"}),(0,f.jsx)(Pe,{type:"email",placeholder:"customer@example.com",value:N.customerEmail||"",onChange:I=>re({...ae,customerEmail:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Plan"}),(0,f.jsxs)("select",{value:N.plan||"Starter",onChange:I=>re({...ae,plan:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,f.jsx)("option",{value:"Starter",children:"Starter ($29/mo)"}),(0,f.jsx)("option",{value:"Professional",children:"Professional ($99/mo)"}),(0,f.jsx)("option",{value:"Enterprise",children:"Enterprise ($299/mo)"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Billing Cycle"}),(0,f.jsxs)("select",{value:N.billingCycle||"monthly",onChange:I=>re({...ae,billingCycle:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,f.jsx)("option",{value:"monthly",children:"Monthly"}),(0,f.jsx)("option",{value:"yearly",children:"Yearly (Save 15%)"})]})]})]}),T==="exportCertificate"&&(0,f.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,f.jsx)("p",{className:"text-xs text-black",children:"This will export your certificate of incorporation document."}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Format"}),(0,f.jsxs)("select",{value:N.format||"pdf",onChange:I=>re({...ae,format:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,f.jsx)("option",{value:"pdf",children:"PDF"}),(0,f.jsx)("option",{value:"json",children:"JSON"})]})]})]}),(T==="toggleBlockRule"||T==="enableBlockRule"||T==="disableBlockRule")&&(0,f.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Block Rule"}),(0,f.jsxs)("select",{value:N.ruleId||"rule_1",onChange:I=>re({...ae,ruleId:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,f.jsx)("option",{value:"rule_1",children:"Block if risk level = 'highest'"}),(0,f.jsx)("option",{value:"rule_2",children:"Block if matches Stripe block lists"}),(0,f.jsx)("option",{value:"rule_3",children:"Block if CVC verification fails"}),(0,f.jsx)("option",{value:"rule_4",children:"Block if Postal code verification fails"})]})]}),(0,f.jsx)("p",{className:"text-xs text-black",children:T==="enableBlockRule"?"This will enable the selected block rule to actively block matching payments.":T==="disableBlockRule"?"This will disable the selected block rule. Matching payments will no longer be blocked.":"This will toggle the selected block rule's state."})]}),(0,f.jsx)("div",{className:"mt-3",children:(0,f.jsxs)(It,{type:"button",size:"sm",variant:"secondary",className:"h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",onClick:fc,children:[(0,f.jsx)("span",{children:"Confirm"}),(0,f.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,f.jsx)(Ka,{className:"h-3 w-3"}),(0,f.jsx)($a,{className:"h-3 w-3"})]})]})})]},v.id)}if(v.kind==="bulkPreview"&&v.csvData)return(0,f.jsxs)("div",{className:`${B?"mt-3":""}`,children:[(0,f.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 mb-3 text-gray-700",children:v.content||""}),(0,f.jsxs)("div",{className:"bg-gray-50 rounded-lg border border-gray-200 overflow-hidden",children:[(0,f.jsxs)("div",{className:"bg-gray-100 px-3 py-2 border-b border-gray-200 flex items-center gap-2",children:[(0,f.jsx)(vn,{className:"h-4 w-4 text-gray-600"}),(0,f.jsx)("span",{className:"text-xs font-medium text-gray-700",children:v.csvData.fileName}),(0,f.jsxs)("span",{className:"text-xs text-gray-500",children:["\u2022 ",v.csvData.rowCount," rows"]})]}),(0,f.jsxs)("div",{className:"px-3 py-2 border-b border-gray-100",children:[(0,f.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-gray-500 mb-1",children:"Columns"}),(0,f.jsx)("div",{className:"flex flex-wrap gap-1",children:v.csvData.columns.map((T,N)=>(0,f.jsx)("span",{className:"text-xs bg-blue-100 text-blue-700 px-1.5 py-0.5 rounded",children:T},N))})]}),v.csvData.sampleRows.length>0&&(0,f.jsxs)("div",{className:"px-3 py-2",children:[(0,f.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-gray-500 mb-1",children:"Sample Data"}),(0,f.jsx)("div",{className:"space-y-1",children:v.csvData.sampleRows.slice(0,3).map((T,N)=>(0,f.jsxs)("div",{className:"text-xs text-gray-600 bg-white rounded px-2 py-1 border border-gray-100",children:[Object.entries(T).slice(0,3).map(([I,K],J)=>(0,f.jsxs)("span",{children:[J>0&&" \u2022 ",(0,f.jsxs)("span",{className:"text-gray-400",children:[I,":"]})," ",K]},I)),Object.keys(T).length>3&&(0,f.jsxs)("span",{className:"text-gray-400",children:[" ","..."]})]},N))})]}),v.suggestedAction&&(0,f.jsx)("div",{className:"px-3 py-2 bg-blue-50 border-t border-blue-100",children:(0,f.jsxs)("span",{className:"text-xs text-blue-700",children:["Suggested action:"," ",(0,f.jsx)("strong",{children:v.suggestedAction.replace(/_/g," ")})]})})]}),v.bulkSessionId&&(0,f.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[(0,f.jsxs)(It,{type:"button",size:"sm",variant:"secondary",className:"h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",onClick:()=>v.bulkSessionId&&pc(v.bulkSessionId),children:[(0,f.jsxs)("span",{children:["Process ",v.csvData.rowCount," rows"]}),(0,f.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,f.jsx)(Ka,{className:"h-3 w-3"}),(0,f.jsx)($a,{className:"h-3 w-3"})]})]}),(0,f.jsx)(It,{type:"button",size:"sm",variant:"ghost",className:"h-8 rounded-xl px-3 text-xs text-gray-500 hover:text-gray-700 hover:bg-gray-100",onClick:SS,children:"Cancel"})]})]},v.id);if(v.kind==="bulkProgress"&&v.bulkProgress){let{processed:T,total:N,successes:I,failures:K}=v.bulkProgress,J=Math.round(T/N*100);return(0,f.jsx)("div",{className:`${B?"mt-3":""}`,children:(0,f.jsxs)("div",{className:"bg-gray-50 rounded-lg border border-gray-200 p-3",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,f.jsx)(Ot,{className:"h-4 w-4 animate-spin text-blue-600"}),(0,f.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Processing... ",T," of ",N]})]}),(0,f.jsx)("div",{className:"h-2 bg-gray-200 rounded-full overflow-hidden mb-2",children:(0,f.jsx)("div",{className:"h-full bg-blue-600 transition-all duration-300",style:{width:`${J}%`}})}),(0,f.jsxs)("div",{className:"flex items-center gap-3 text-xs text-gray-600",children:[(0,f.jsxs)("span",{className:"flex items-center gap-1",children:[(0,f.jsx)(je,{className:"h-3 w-3 text-green-600"}),I," successful"]}),K>0&&(0,f.jsxs)("span",{className:"flex items-center gap-1 text-red-600",children:[(0,f.jsx)(Mr,{className:"h-3 w-3"}),K," failed"]})]})]})},v.id)}if(v.kind==="bulkSummary"&&v.bulkSummary){let{total:T,successes:N,failures:I,navigationPage:K}=v.bulkSummary,J=I.length>0,j=K?.page==="customers"?"Customers":K?.page==="dashboard"?"Dashboard":K?.page==="settings"?"Settings":"Results";return(0,f.jsx)("div",{className:`${B?"mt-3":""}`,children:(0,f.jsxs)("div",{className:`rounded-lg border p-3 ${J?"bg-amber-50 border-amber-200":"bg-green-50 border-green-200"}`,children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,f.jsx)(je,{className:`h-5 w-5 ${J?"text-amber-600":"text-green-600"}`}),(0,f.jsx)("span",{className:"text-sm font-medium text-gray-800",children:"Bulk operation complete"})]}),(0,f.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:v.content||`Processed ${T} rows: ${N} successful${J?`, ${I.length} failed`:""}.`}),(0,f.jsxs)("div",{className:"flex items-center gap-4 text-xs",children:[(0,f.jsxs)("span",{className:"flex items-center gap-1 text-green-700",children:[(0,f.jsx)(je,{className:"h-3 w-3"}),N," successful"]}),J&&(0,f.jsxs)("span",{className:"flex items-center gap-1 text-red-600",children:[(0,f.jsx)(Mr,{className:"h-3 w-3"}),I.length," failed"]})]}),J&&(0,f.jsxs)("div",{className:"mt-3 pt-2 border-t border-amber-200",children:[(0,f.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-amber-700 mb-1",children:"Failed Rows"}),(0,f.jsxs)("div",{className:"space-y-1 max-h-32 overflow-y-auto",children:[I.slice(0,5).map((ce,He)=>(0,f.jsxs)("div",{className:"text-xs text-red-700 bg-red-50 rounded px-2 py-1",children:["Row ",ce.row,":"," ",ce.error||"Unknown error"]},He)),I.length>5&&(0,f.jsxs)("div",{className:"text-xs text-amber-600",children:["...and ",I.length-5," more"]})]})]}),K&&N>0&&(0,f.jsx)("div",{className:"mt-3 pt-2 border-t border-gray-200",children:(0,f.jsxs)("button",{type:"button",onClick:ce=>{ce.preventDefault(),ce.stopPropagation(),console.log("[DEBUG] Button clicked - navigationPage:",K,"onNavigate:",!!o),o&&K.page?(console.log("[DEBUG] Calling onNavigate with page:",K.page),o(K.page,K.subtab)):console.log("[DEBUG] Condition failed - onNavigate:",!!o,"navigationPage.page:",K.page)},className:"flex items-center gap-2 text-xs text-gray-500 hover:text-gray-700 transition-colors group cursor-pointer",children:[(0,f.jsxs)("span",{className:"flex items-center gap-1 px-1.5 py-0.5 bg-gray-100 rounded text-[10px] font-medium text-gray-600 group-hover:bg-gray-200",children:[(0,f.jsx)(Ka,{className:"h-2.5 w-2.5"}),(0,f.jsx)("span",{children:"+"}),(0,f.jsx)($a,{className:"h-2.5 w-2.5"})]}),(0,f.jsxs)("span",{children:["View ",j]})]})})]})},v.id)}return(0,f.jsx)(G.Fragment,{children:(0,f.jsxs)("div",{ref:X?Xi:null,className:`${B?"mt-3":""}`,children:[(0,f.jsx)("div",{className:"text-sm leading-6 text-gray-700",children:(()=>{let T=v.content||"";if(v.kind==="guideStep"){let N=T.match(/^(Step\s+\d+:)([\s\S]*)/);if(N)return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("strong",{children:N[1]}),N[2]]})}return v.role==="assistant"&&T?cS(T):T||(0,f.jsx)("span",{className:"opacity-70",children:"Thinking\u2026"})})()}),v.role==="assistant"&&v.structuredData&&(0,f.jsx)("div",{className:"mt-3",children:(0,f.jsx)(dS,{type:v.structuredData.type,data:v.structuredData.data})}),v.role==="assistant"&&v.followups&&v.followups.length>0&&!v.followupSelected&&(0,f.jsx)("div",{className:"mt-3 flex flex-wrap gap-1.5",children:v.followups.map(T=>(0,f.jsx)("button",{type:"button",onClick:()=>xS(v.id,T),className:`inline-flex items-center px-3 py-1.5 text-xs font-medium rounded-xl
|
|
74
32
|
bg-white hover:bg-gray-50 text-gray-600 hover:text-gray-800
|
|
75
33
|
border border-gray-200 hover:border-gray-300 shadow-sm
|
|
76
|
-
transition-all duration-150 ease-in-out`,children:
|
|
77
|
-
@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){#kite-chat-root *,#kite-chat-root :before,#kite-chat-root :after,#kite-chat-root ::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial}}:root,#kite-chat-root{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-200:oklch(88.5% .062 18.334);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-orange-100:oklch(95.4% .038 75.164);--color-orange-400:oklch(75% .183 55.934);--color-orange-700:oklch(55.3% .195 38.402);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-green-50:oklch(98.2% .018 155.826);--color-green-200:oklch(92.5% .084 155.995);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-green-800:oklch(44.8% .119 151.328);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-600:oklch(59.6% .145 163.225);--color-emerald-700:oklch(50.8% .118 165.612);--color-blue-50:oklch(97% .014 254.604);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-purple-50:oklch(97.7% .014 308.299);--color-purple-100:oklch(94.6% .033 307.174);--color-purple-200:oklch(90.2% .063 306.703);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-600:oklch(55.8% .288 302.321);--color-purple-700:oklch(49.6% .265 301.924);--color-pink-400:oklch(71.8% .202 349.761);--color-slate-50:oklch(98.4% .003 247.858);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-700:oklch(37.2% .044 257.287);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height:calc(1.5/1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--tracking-wider:.05em;--leading-relaxed:1.625;--radius-2xl:1rem;--ease-out:cubic-bezier(0,0,.2,1);--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}#kite-chat-root *,#kite-chat-root :after,#kite-chat-root :before,#kite-chat-root ::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}#kite-chat-root ::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}#kite-chat-root,#kite-chat-root{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}#kite-chat-root hr{height:0;color:inherit;border-top-width:1px}#kite-chat-root abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}#kite-chat-root h1,#kite-chat-root h2,#kite-chat-root h3,#kite-chat-root h4,#kite-chat-root h5,#kite-chat-root h6{font-size:inherit;font-weight:inherit}#kite-chat-root a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}#kite-chat-root b,#kite-chat-root strong{font-weight:bolder}#kite-chat-root code,#kite-chat-root kbd,#kite-chat-root samp,#kite-chat-root pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}#kite-chat-root small{font-size:80%}#kite-chat-root sub,#kite-chat-root sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}#kite-chat-root sub{bottom:-.25em}#kite-chat-root sup{top:-.5em}#kite-chat-root table{text-indent:0;border-color:inherit;border-collapse:collapse}#kite-chat-root :-moz-focusring{outline:auto}#kite-chat-root progress{vertical-align:baseline}#kite-chat-root summary{display:list-item}#kite-chat-root ol,#kite-chat-root ul,#kite-chat-root menu{list-style:none}#kite-chat-root img,#kite-chat-root svg,#kite-chat-root video,#kite-chat-root canvas,#kite-chat-root audio,#kite-chat-root iframe,#kite-chat-root embed,#kite-chat-root object{vertical-align:middle;display:block}#kite-chat-root img,#kite-chat-root video{max-width:100%;height:auto}#kite-chat-root button,#kite-chat-root input,#kite-chat-root select,#kite-chat-root optgroup,#kite-chat-root textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}#kite-chat-root ::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}#kite-chat-root :where(select:is([multiple],[size])) optgroup{font-weight:bolder}#kite-chat-root :where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}#kite-chat-root ::file-selector-button{margin-inline-end:4px}#kite-chat-root ::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){#kite-chat-root ::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){#kite-chat-root ::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}#kite-chat-root textarea{resize:vertical}#kite-chat-root ::-webkit-search-decoration{-webkit-appearance:none}#kite-chat-root ::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}#kite-chat-root ::-webkit-datetime-edit{display:inline-flex}#kite-chat-root ::-webkit-datetime-edit-fields-wrapper{padding:0}#kite-chat-root ::-webkit-datetime-edit{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-year-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-month-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-day-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-hour-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-minute-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-second-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-millisecond-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-meridiem-field{padding-block:0}#kite-chat-root ::-webkit-calendar-picker-indicator{line-height:1}#kite-chat-root :-moz-ui-invalid{box-shadow:none}#kite-chat-root button,#kite-chat-root input:where([type=button],[type=reset],[type=submit]){appearance:button}#kite-chat-root ::file-selector-button{appearance:button}#kite-chat-root ::-webkit-inner-spin-button{height:auto}#kite-chat-root ::-webkit-outer-spin-button{height:auto}#kite-chat-root [hidden]:where(:not([hidden=until-found])){display:none!important}#kite-chat-root .\\@container\\/card-header{container:card-header/inline-size}#kite-chat-root .pointer-events-none{pointer-events:none}#kite-chat-root .collapse{visibility:collapse}#kite-chat-root .visible{visibility:visible}#kite-chat-root .fixed{position:fixed}#kite-chat-root .relative{position:relative}#kite-chat-root .top-0{top:calc(var(--spacing)*0)}#kite-chat-root .top-1\\/2{top:50%}#kite-chat-root .right-0{right:calc(var(--spacing)*0)}#kite-chat-root .bottom-6{bottom:calc(var(--spacing)*6)}#kite-chat-root .left-1\\/2{left:50%}#kite-chat-root .z-40{z-index:40}#kite-chat-root .z-50{z-index:50}#kite-chat-root .z-\\[9999\\]{z-index:9999}#kite-chat-root .col-start-2{grid-column-start:2}#kite-chat-root .row-span-2{grid-row:span 2/span 2}#kite-chat-root .row-start-1{grid-row-start:1}#kite-chat-root .container{width:100%}@media (min-width:40rem){#kite-chat-root .container{max-width:40rem}}@media (min-width:48rem){#kite-chat-root .container{max-width:48rem}}@media (min-width:64rem){#kite-chat-root .container{max-width:64rem}}@media (min-width:80rem){#kite-chat-root .container{max-width:80rem}}@media (min-width:96rem){#kite-chat-root .container{max-width:96rem}}#kite-chat-root .mx-auto{margin-inline:auto}#kite-chat-root .my-1{margin-block:calc(var(--spacing)*1)}#kite-chat-root .my-2{margin-block:calc(var(--spacing)*2)}#kite-chat-root .mt-1{margin-top:calc(var(--spacing)*1)}#kite-chat-root .mt-2{margin-top:calc(var(--spacing)*2)}#kite-chat-root .mt-3{margin-top:calc(var(--spacing)*3)}#kite-chat-root .mr-2{margin-right:calc(var(--spacing)*2)}#kite-chat-root .mb-1{margin-bottom:calc(var(--spacing)*1)}#kite-chat-root .mb-1\\.5{margin-bottom:calc(var(--spacing)*1.5)}#kite-chat-root .mb-2{margin-bottom:calc(var(--spacing)*2)}#kite-chat-root .mb-3{margin-bottom:calc(var(--spacing)*3)}#kite-chat-root .mb-4{margin-bottom:calc(var(--spacing)*4)}#kite-chat-root .ml-2{margin-left:calc(var(--spacing)*2)}#kite-chat-root .ml-4{margin-left:calc(var(--spacing)*4)}#kite-chat-root .ml-5{margin-left:calc(var(--spacing)*5)}#kite-chat-root .ml-6{margin-left:calc(var(--spacing)*6)}#kite-chat-root .block{display:block}#kite-chat-root .contents{display:contents}#kite-chat-root .flex{display:flex}#kite-chat-root .grid{display:grid}#kite-chat-root .hidden{display:none}#kite-chat-root .inline{display:inline}#kite-chat-root .inline-block{display:inline-block}#kite-chat-root .inline-flex{display:inline-flex}#kite-chat-root .table{display:table}#kite-chat-root .size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}#kite-chat-root .size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}#kite-chat-root .size-10{width:calc(var(--spacing)*10);height:calc(var(--spacing)*10)}#kite-chat-root .size-full{width:100%;height:100%}#kite-chat-root .h-1{height:calc(var(--spacing)*1)}#kite-chat-root .h-1\\.5{height:calc(var(--spacing)*1.5)}#kite-chat-root .h-2{height:calc(var(--spacing)*2)}#kite-chat-root .h-2\\.5{height:calc(var(--spacing)*2.5)}#kite-chat-root .h-3{height:calc(var(--spacing)*3)}#kite-chat-root .h-3\\.5{height:calc(var(--spacing)*3.5)}#kite-chat-root .h-4{height:calc(var(--spacing)*4)}#kite-chat-root .h-5{height:calc(var(--spacing)*5)}#kite-chat-root .h-6{height:calc(var(--spacing)*6)}#kite-chat-root .h-7{height:calc(var(--spacing)*7)}#kite-chat-root .h-8{height:calc(var(--spacing)*8)}#kite-chat-root .h-9{height:calc(var(--spacing)*9)}#kite-chat-root .h-10{height:calc(var(--spacing)*10)}#kite-chat-root .h-16{height:calc(var(--spacing)*16)}#kite-chat-root .h-auto{height:auto}#kite-chat-root .h-full{height:100%}#kite-chat-root .max-h-32{max-height:calc(var(--spacing)*32)}#kite-chat-root .min-h-0{min-height:calc(var(--spacing)*0)}#kite-chat-root .w-1\\.5{width:calc(var(--spacing)*1.5)}#kite-chat-root .w-2\\.5{width:calc(var(--spacing)*2.5)}#kite-chat-root .w-3{width:calc(var(--spacing)*3)}#kite-chat-root .w-3\\.5{width:calc(var(--spacing)*3.5)}#kite-chat-root .w-4{width:calc(var(--spacing)*4)}#kite-chat-root .w-5{width:calc(var(--spacing)*5)}#kite-chat-root .w-6{width:calc(var(--spacing)*6)}#kite-chat-root .w-7{width:calc(var(--spacing)*7)}#kite-chat-root .w-10{width:calc(var(--spacing)*10)}#kite-chat-root .w-\\[320px\\]{width:320px}#kite-chat-root .w-\\[480px\\]{width:480px}#kite-chat-root .w-full{width:100%}#kite-chat-root .max-w-\\[260px\\]{max-width:260px}#kite-chat-root .min-w-0{min-width:calc(var(--spacing)*0)}#kite-chat-root .flex-1{flex:1}#kite-chat-root .flex-shrink-0,#kite-chat-root .shrink-0{flex-shrink:0}#kite-chat-root .-translate-x-1\\/2{--tw-translate-x:calc(calc(1/2*100%)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}#kite-chat-root .translate-x-0{--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}#kite-chat-root .translate-x-full{--tw-translate-x:100%;translate:var(--tw-translate-x)var(--tw-translate-y)}#kite-chat-root .transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}#kite-chat-root .animate-spin{animation:var(--animate-spin)}#kite-chat-root .cursor-pointer{cursor:pointer}#kite-chat-root .touch-none{touch-action:none}#kite-chat-root .resize-none{resize:none}#kite-chat-root .list-decimal{list-style-type:decimal}#kite-chat-root .list-disc{list-style-type:disc}#kite-chat-root .auto-rows-min{grid-auto-rows:min-content}#kite-chat-root .grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}#kite-chat-root .grid-rows-\\[auto_auto\\]{grid-template-rows:auto auto}#kite-chat-root .flex-col{flex-direction:column}#kite-chat-root .flex-wrap{flex-wrap:wrap}#kite-chat-root .place-items-center{place-items:center}#kite-chat-root .items-center{align-items:center}#kite-chat-root .items-start{align-items:flex-start}#kite-chat-root .justify-between{justify-content:space-between}#kite-chat-root .justify-center{justify-content:center}#kite-chat-root .justify-end{justify-content:flex-end}#kite-chat-root .justify-start{justify-content:flex-start}#kite-chat-root .gap-0\\.5{gap:calc(var(--spacing)*.5)}#kite-chat-root .gap-1{gap:calc(var(--spacing)*1)}#kite-chat-root .gap-1\\.5{gap:calc(var(--spacing)*1.5)}#kite-chat-root .gap-2{gap:calc(var(--spacing)*2)}#kite-chat-root .gap-2\\.5{gap:calc(var(--spacing)*2.5)}#kite-chat-root .gap-3{gap:calc(var(--spacing)*3)}#kite-chat-root .gap-4{gap:calc(var(--spacing)*4)}#kite-chat-root .gap-6{gap:calc(var(--spacing)*6)}#kite-chat-root :where(.space-y-0\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*.5)*calc(1 - var(--tw-space-y-reverse)))}#kite-chat-root :where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}#kite-chat-root :where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}#kite-chat-root :where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}#kite-chat-root :where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}#kite-chat-root :where(.divide-gray-100>:not(:last-child)){border-color:var(--color-gray-100)}#kite-chat-root .self-start{align-self:flex-start}#kite-chat-root .justify-self-end{justify-self:flex-end}#kite-chat-root .truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}#kite-chat-root .overflow-hidden{overflow:hidden}#kite-chat-root .overflow-x-auto{overflow-x:auto}#kite-chat-root .overflow-y-auto{overflow-y:auto}#kite-chat-root .rounded{border-radius:.25rem}#kite-chat-root .rounded-2xl{border-radius:var(--radius-2xl)}#kite-chat-root .rounded-\\[inherit\\]{border-radius:inherit}#kite-chat-root .rounded-full{border-radius:3.40282e38px}#kite-chat-root .rounded-lg{border-radius:var(--kite-radius)}#kite-chat-root .rounded-md{border-radius:calc(var(--kite-radius) - 2px)}#kite-chat-root .rounded-xl{border-radius:calc(var(--kite-radius) + 4px)}#kite-chat-root .rounded-l-lg{border-top-left-radius:var(--kite-radius);border-bottom-left-radius:var(--kite-radius)}#kite-chat-root .rounded-br-md{border-bottom-right-radius:calc(var(--kite-radius) - 2px)}#kite-chat-root .rounded-bl-md{border-bottom-left-radius:calc(var(--kite-radius) - 2px)}#kite-chat-root .border{border-style:var(--tw-border-style);border-width:1px}#kite-chat-root .border-0{border-style:var(--tw-border-style);border-width:0}#kite-chat-root .border-t{border-top-style:var(--tw-border-style);border-top-width:1px}#kite-chat-root .border-r-0{border-right-style:var(--tw-border-style);border-right-width:0}#kite-chat-root .border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}#kite-chat-root .border-l{border-left-style:var(--tw-border-style);border-left-width:1px}#kite-chat-root .border-amber-100{border-color:var(--color-amber-100)}#kite-chat-root .border-amber-200{border-color:var(--color-amber-200)}#kite-chat-root .border-blue-100{border-color:var(--color-blue-100)}#kite-chat-root .border-blue-200{border-color:var(--color-blue-200)}#kite-chat-root .border-emerald-100{border-color:var(--color-emerald-100)}#kite-chat-root .border-emerald-200{border-color:var(--color-emerald-200)}#kite-chat-root .border-gray-100{border-color:var(--color-gray-100)}#kite-chat-root .border-gray-200{border-color:var(--color-gray-200)}#kite-chat-root .border-gray-300{border-color:var(--color-gray-300)}#kite-chat-root .border-green-200{border-color:var(--color-green-200)}#kite-chat-root .border-input{border-color:var(--kite-input)}#kite-chat-root .border-primary\\/20{border-color:var(--kite-primary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .border-primary\\/20{border-color:color-mix(in oklab,var(--kite-primary)20%,transparent)}}#kite-chat-root .border-purple-100{border-color:var(--color-purple-100)}#kite-chat-root .border-purple-200{border-color:var(--color-purple-200)}#kite-chat-root .border-red-200{border-color:var(--color-red-200)}#kite-chat-root .border-slate-200{border-color:var(--color-slate-200)}#kite-chat-root .border-t-transparent{border-top-color:#0000}#kite-chat-root .border-l-transparent{border-left-color:#0000}#kite-chat-root .bg-amber-50{background-color:var(--color-amber-50)}#kite-chat-root .bg-amber-100{background-color:var(--color-amber-100)}#kite-chat-root .bg-background{background-color:var(--kite-background)}#kite-chat-root .bg-blue-50{background-color:var(--color-blue-50)}#kite-chat-root .bg-blue-100{background-color:var(--color-blue-100)}#kite-chat-root .bg-blue-400{background-color:var(--color-blue-400)}#kite-chat-root .bg-blue-600{background-color:var(--color-blue-600)}#kite-chat-root .bg-border{background-color:var(--kite-border)}#kite-chat-root .bg-card{background-color:var(--kite-card)}#kite-chat-root .bg-destructive{background-color:var(--kite-destructive)}#kite-chat-root .bg-emerald-50{background-color:var(--color-emerald-50)}#kite-chat-root .bg-emerald-500{background-color:var(--color-emerald-500)}#kite-chat-root .bg-gray-50{background-color:var(--color-gray-50)}#kite-chat-root .bg-gray-50\\/50{background-color:#f9fafb80}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .bg-gray-50\\/50{background-color:color-mix(in oklab,var(--color-gray-50)50%,transparent)}}#kite-chat-root .bg-gray-100{background-color:var(--color-gray-100)}#kite-chat-root .bg-gray-200{background-color:var(--color-gray-200)}#kite-chat-root .bg-gray-900{background-color:var(--color-gray-900)}#kite-chat-root .bg-green-50{background-color:var(--color-green-50)}#kite-chat-root .bg-green-400{background-color:var(--color-green-400)}#kite-chat-root .bg-muted\\/40{background-color:var(--kite-muted)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .bg-muted\\/40{background-color:color-mix(in oklab,var(--kite-muted)40%,transparent)}}#kite-chat-root .bg-orange-100{background-color:var(--color-orange-100)}#kite-chat-root .bg-orange-400{background-color:var(--color-orange-400)}#kite-chat-root .bg-pink-400{background-color:var(--color-pink-400)}#kite-chat-root .bg-primary,#kite-chat-root .bg-primary\\/5{background-color:var(--kite-primary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .bg-primary\\/5{background-color:color-mix(in oklab,var(--kite-primary)5%,transparent)}}#kite-chat-root .bg-purple-50{background-color:var(--color-purple-50)}#kite-chat-root .bg-purple-400{background-color:var(--color-purple-400)}#kite-chat-root .bg-red-50{background-color:var(--color-red-50)}#kite-chat-root .bg-red-500{background-color:var(--color-red-500)}#kite-chat-root .bg-secondary{background-color:var(--kite-secondary)}#kite-chat-root .bg-slate-50{background-color:var(--color-slate-50)}#kite-chat-root .bg-slate-100{background-color:var(--color-slate-100)}#kite-chat-root .bg-slate-300{background-color:var(--color-slate-300)}#kite-chat-root .bg-transparent{background-color:#0000}#kite-chat-root .bg-white{background-color:var(--color-white)}#kite-chat-root .bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}#kite-chat-root .from-gray-50{--tw-gradient-from:var(--color-gray-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}#kite-chat-root .to-white{--tw-gradient-to:var(--color-white);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}#kite-chat-root .p-0{padding:calc(var(--spacing)*0)}#kite-chat-root .p-2{padding:calc(var(--spacing)*2)}#kite-chat-root .p-3{padding:calc(var(--spacing)*3)}#kite-chat-root .p-4{padding:calc(var(--spacing)*4)}#kite-chat-root .p-px{padding:1px}#kite-chat-root .px-0{padding-inline:calc(var(--spacing)*0)}#kite-chat-root .px-1{padding-inline:calc(var(--spacing)*1)}#kite-chat-root .px-1\\.5{padding-inline:calc(var(--spacing)*1.5)}#kite-chat-root .px-2{padding-inline:calc(var(--spacing)*2)}#kite-chat-root .px-2\\.5{padding-inline:calc(var(--spacing)*2.5)}#kite-chat-root .px-3{padding-inline:calc(var(--spacing)*3)}#kite-chat-root .px-3\\.5{padding-inline:calc(var(--spacing)*3.5)}#kite-chat-root .px-4{padding-inline:calc(var(--spacing)*4)}#kite-chat-root .px-6{padding-inline:calc(var(--spacing)*6)}#kite-chat-root .py-0{padding-block:calc(var(--spacing)*0)}#kite-chat-root .py-0\\.5{padding-block:calc(var(--spacing)*.5)}#kite-chat-root .py-1{padding-block:calc(var(--spacing)*1)}#kite-chat-root .py-1\\.5{padding-block:calc(var(--spacing)*1.5)}#kite-chat-root .py-2{padding-block:calc(var(--spacing)*2)}#kite-chat-root .py-2\\.5{padding-block:calc(var(--spacing)*2.5)}#kite-chat-root .py-3{padding-block:calc(var(--spacing)*3)}#kite-chat-root .py-4{padding-block:calc(var(--spacing)*4)}#kite-chat-root .py-6{padding-block:calc(var(--spacing)*6)}#kite-chat-root .py-8{padding-block:calc(var(--spacing)*8)}#kite-chat-root .pt-0{padding-top:calc(var(--spacing)*0)}#kite-chat-root .pt-2{padding-top:calc(var(--spacing)*2)}#kite-chat-root .pb-2{padding-bottom:calc(var(--spacing)*2)}#kite-chat-root .pb-3{padding-bottom:calc(var(--spacing)*3)}#kite-chat-root .pb-4{padding-bottom:calc(var(--spacing)*4)}#kite-chat-root .text-center{text-align:center}#kite-chat-root .text-left{text-align:left}#kite-chat-root .font-mono{font-family:var(--font-mono)}#kite-chat-root .text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}#kite-chat-root .text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}#kite-chat-root .text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}#kite-chat-root .text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}#kite-chat-root .text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}#kite-chat-root .text-\\[10px\\]{font-size:10px}#kite-chat-root .leading-6{--tw-leading:calc(var(--spacing)*6);line-height:calc(var(--spacing)*6)}#kite-chat-root .leading-none{--tw-leading:1;line-height:1}#kite-chat-root .leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}#kite-chat-root .font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}#kite-chat-root .font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}#kite-chat-root .font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}#kite-chat-root .tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}#kite-chat-root .tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}#kite-chat-root .whitespace-nowrap{white-space:nowrap}#kite-chat-root .whitespace-pre-wrap{white-space:pre-wrap}#kite-chat-root .text-amber-500{color:var(--color-amber-500)}#kite-chat-root .text-amber-600{color:var(--color-amber-600)}#kite-chat-root .text-amber-700{color:var(--color-amber-700)}#kite-chat-root .text-black{color:var(--color-black)}#kite-chat-root .text-blue-600{color:var(--color-blue-600)}#kite-chat-root .text-blue-700{color:var(--color-blue-700)}#kite-chat-root .text-card-foreground{color:var(--kite-card-foreground)}#kite-chat-root .text-emerald-500{color:var(--color-emerald-500)}#kite-chat-root .text-emerald-600{color:var(--color-emerald-600)}#kite-chat-root .text-emerald-700{color:var(--color-emerald-700)}#kite-chat-root .text-gray-300{color:var(--color-gray-300)}#kite-chat-root .text-gray-400{color:var(--color-gray-400)}#kite-chat-root .text-gray-500{color:var(--color-gray-500)}#kite-chat-root .text-gray-600{color:var(--color-gray-600)}#kite-chat-root .text-gray-700{color:var(--color-gray-700)}#kite-chat-root .text-gray-800{color:var(--color-gray-800)}#kite-chat-root .text-gray-900{color:var(--color-gray-900)}#kite-chat-root .text-green-500{color:var(--color-green-500)}#kite-chat-root .text-green-600{color:var(--color-green-600)}#kite-chat-root .text-green-700{color:var(--color-green-700)}#kite-chat-root .text-green-800{color:var(--color-green-800)}#kite-chat-root .text-muted-foreground{color:var(--kite-muted-foreground)}#kite-chat-root .text-orange-700{color:var(--color-orange-700)}#kite-chat-root .text-primary{color:var(--kite-primary)}#kite-chat-root .text-primary-foreground{color:var(--kite-primary-foreground)}#kite-chat-root .text-purple-600{color:var(--color-purple-600)}#kite-chat-root .text-purple-700{color:var(--color-purple-700)}#kite-chat-root .text-red-500{color:var(--color-red-500)}#kite-chat-root .text-red-600{color:var(--color-red-600)}#kite-chat-root .text-red-700{color:var(--color-red-700)}#kite-chat-root .text-secondary-foreground{color:var(--kite-secondary-foreground)}#kite-chat-root .text-slate-600{color:var(--color-slate-600)}#kite-chat-root .text-slate-700{color:var(--color-slate-700)}#kite-chat-root .text-white{color:var(--color-white)}#kite-chat-root .uppercase{text-transform:uppercase}#kite-chat-root .italic{font-style:italic}#kite-chat-root .line-through{text-decoration-line:line-through}#kite-chat-root .underline-offset-4{text-underline-offset:4px}#kite-chat-root .opacity-60{opacity:.6}#kite-chat-root .opacity-70{opacity:.7}#kite-chat-root .opacity-90{opacity:.9}#kite-chat-root .opacity-100{opacity:1}#kite-chat-root .shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .outline{outline-style:var(--tw-outline-style);outline-width:1px}#kite-chat-root .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,)}#kite-chat-root .transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .transition-\\[color\\,box-shadow\\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .duration-150{--tw-duration:.15s;transition-duration:.15s}#kite-chat-root .duration-200{--tw-duration:.2s;transition-duration:.2s}#kite-chat-root .duration-300{--tw-duration:.3s;transition-duration:.3s}#kite-chat-root .ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}#kite-chat-root .ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}#kite-chat-root .outline-none{--tw-outline-style:none;outline-style:none}#kite-chat-root .select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){#kite-chat-root .group-hover\\:bg-gray-200:is(:where(.group):hover *){background-color:var(--color-gray-200)}}#kite-chat-root .selection\\:bg-primary ::selection{background-color:var(--kite-primary)}#kite-chat-root .selection\\:bg-primary::selection{background-color:var(--kite-primary)}#kite-chat-root .selection\\:text-primary-foreground ::selection{color:var(--kite-primary-foreground)}#kite-chat-root .selection\\:text-primary-foreground::selection{color:var(--kite-primary-foreground)}#kite-chat-root .file\\:inline-flex::file-selector-button{display:inline-flex}#kite-chat-root .file\\:h-7::file-selector-button{height:calc(var(--spacing)*7)}#kite-chat-root .file\\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}#kite-chat-root .file\\:bg-transparent::file-selector-button{background-color:#0000}#kite-chat-root .file\\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}#kite-chat-root .file\\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}#kite-chat-root .file\\:text-foreground::file-selector-button{color:var(--kite-foreground)}#kite-chat-root .placeholder\\:text-gray-400::placeholder{color:var(--color-gray-400)}#kite-chat-root .placeholder\\:text-muted-foreground::placeholder{color:var(--kite-muted-foreground)}#kite-chat-root .focus-within\\:border-gray-700:focus-within{border-color:var(--color-gray-700)}@media (hover:hover){#kite-chat-root .hover\\:border-gray-300:hover{border-color:var(--color-gray-300)}#kite-chat-root .hover\\:border-primary\\/30:hover{border-color:var(--kite-primary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .hover\\:border-primary\\/30:hover{border-color:color-mix(in oklab,var(--kite-primary)30%,transparent)}}#kite-chat-root .hover\\:bg-accent:hover{background-color:var(--kite-accent)}#kite-chat-root .hover\\:bg-destructive\\/90:hover{background-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .hover\\:bg-destructive\\/90:hover{background-color:color-mix(in oklab,var(--kite-destructive)90%,transparent)}}#kite-chat-root .hover\\:bg-gray-50:hover{background-color:var(--color-gray-50)}#kite-chat-root .hover\\:bg-gray-100:hover{background-color:var(--color-gray-100)}#kite-chat-root .hover\\:bg-gray-200:hover{background-color:var(--color-gray-200)}#kite-chat-root .hover\\:bg-gray-800:hover{background-color:var(--color-gray-800)}#kite-chat-root .hover\\:bg-primary\\/10:hover{background-color:var(--kite-primary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .hover\\:bg-primary\\/10:hover{background-color:color-mix(in oklab,var(--kite-primary)10%,transparent)}}#kite-chat-root .hover\\:bg-primary\\/90:hover{background-color:var(--kite-primary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab,var(--kite-primary)90%,transparent)}}#kite-chat-root .hover\\:bg-secondary\\/80:hover{background-color:var(--kite-secondary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .hover\\:bg-secondary\\/80:hover{background-color:color-mix(in oklab,var(--kite-secondary)80%,transparent)}}#kite-chat-root .hover\\:text-accent-foreground:hover{color:var(--kite-accent-foreground)}#kite-chat-root .hover\\:text-blue-800:hover{color:var(--color-blue-800)}#kite-chat-root .hover\\:text-gray-600:hover{color:var(--color-gray-600)}#kite-chat-root .hover\\:text-gray-700:hover{color:var(--color-gray-700)}#kite-chat-root .hover\\:text-gray-800:hover{color:var(--color-gray-800)}#kite-chat-root .hover\\:underline:hover{text-decoration-line:underline}#kite-chat-root .hover\\:shadow-xl:hover{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}#kite-chat-root .focus\\:ring-primary:focus{--tw-ring-color:var(--kite-primary)}#kite-chat-root .focus-visible\\:border-ring:focus-visible{border-color:var(--kite-ring)}#kite-chat-root .focus-visible\\:ring-0:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .focus-visible\\:ring-\\[3px\\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:color-mix(in oklab,var(--kite-destructive)20%,transparent)}}#kite-chat-root .focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:var(--kite-ring)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:color-mix(in oklab,var(--kite-ring)50%,transparent)}}#kite-chat-root .focus-visible\\:ring-offset-0:focus-visible{--tw-ring-offset-width:0px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}#kite-chat-root .focus-visible\\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}#kite-chat-root .disabled\\:pointer-events-none:disabled{pointer-events:none}#kite-chat-root .disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}#kite-chat-root .disabled\\:bg-gray-300:disabled{background-color:var(--color-gray-300)}#kite-chat-root .disabled\\:opacity-50:disabled{opacity:.5}#kite-chat-root .has-data-\\[slot\\=card-action\\]\\:grid-cols-\\[1fr_auto\\]:has([data-slot=card-action]){grid-template-columns:1fr auto}#kite-chat-root .has-\\[\\>svg\\]\\:px-2\\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}#kite-chat-root .has-\\[\\>svg\\]\\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}#kite-chat-root .has-\\[\\>svg\\]\\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}#kite-chat-root .aria-invalid\\:border-destructive[aria-invalid=true]{border-color:var(--kite-destructive)}#kite-chat-root .aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--kite-destructive)20%,transparent)}}@media (min-width:48rem){#kite-chat-root .md\\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}#kite-chat-root .dark\\:border-input:is(.dark *){border-color:var(--kite-input)}#kite-chat-root .dark\\:bg-destructive\\/60:is(.dark *){background-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:bg-destructive\\/60:is(.dark *){background-color:color-mix(in oklab,var(--kite-destructive)60%,transparent)}}#kite-chat-root .dark\\:bg-input\\/30:is(.dark *){background-color:var(--kite-input)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:bg-input\\/30:is(.dark *){background-color:color-mix(in oklab,var(--kite-input)30%,transparent)}}@media (hover:hover){#kite-chat-root .dark\\:hover\\:bg-accent\\/50:is(.dark *):hover{background-color:var(--kite-accent)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:hover\\:bg-accent\\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--kite-accent)50%,transparent)}}#kite-chat-root .dark\\:hover\\:bg-input\\/50:is(.dark *):hover{background-color:var(--kite-input)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:hover\\:bg-input\\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--kite-input)50%,transparent)}}}#kite-chat-root .dark\\:focus-visible\\:ring-destructive\\/40:is(.dark *):focus-visible{--tw-ring-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:focus-visible\\:ring-destructive\\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab,var(--kite-destructive)40%,transparent)}}#kite-chat-root .dark\\:aria-invalid\\:ring-destructive\\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:aria-invalid\\:ring-destructive\\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--kite-destructive)40%,transparent)}}#kite-chat-root .\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}#kite-chat-root .\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}#kite-chat-root .\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-4 svg:not([class*=size-]){width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}#kite-chat-root .\\[\\.border-b\\]\\:pb-6.border-b{padding-bottom:calc(var(--spacing)*6)}#kite-chat-root .\\[\\.border-t\\]\\:pt-6.border-t{padding-top:calc(var(--spacing)*6)}:root{--kite-radius:.625rem;--kite-background:oklch(100% 0 0);--kite-foreground:oklch(14.5% 0 0);--kite-card:oklch(100% 0 0);--kite-card-foreground:oklch(14.5% 0 0);--kite-popover:oklch(100% 0 0);--kite-popover-foreground:oklch(14.5% 0 0);--kite-primary:oklch(20.5% 0 0);--kite-primary-foreground:oklch(98.5% 0 0);--kite-secondary:oklch(97% 0 0);--kite-secondary-foreground:oklch(20.5% 0 0);--kite-muted:oklch(97% 0 0);--kite-muted-foreground:oklch(55.6% 0 0);--kite-accent:oklch(97% 0 0);--kite-accent-foreground:oklch(20.5% 0 0);--kite-destructive:oklch(57.7% .245 27.325);--kite-destructive-foreground:oklch(98.5% 0 0);--kite-border:oklch(92.2% 0 0);--kite-input:oklch(92.2% 0 0);--kite-ring:oklch(70.8% 0 0)}.dark{--kite-background:oklch(14.5% 0 0);--kite-foreground:oklch(98.5% 0 0);--kite-card:oklch(20.5% 0 0);--kite-card-foreground:oklch(98.5% 0 0);--kite-popover:oklch(20.5% 0 0);--kite-popover-foreground:oklch(98.5% 0 0);--kite-primary:oklch(92.2% 0 0);--kite-primary-foreground:oklch(20.5% 0 0);--kite-secondary:oklch(26.9% 0 0);--kite-secondary-foreground:oklch(98.5% 0 0);--kite-muted:oklch(26.9% 0 0);--kite-muted-foreground:oklch(70.8% 0 0);--kite-accent:oklch(26.9% 0 0);--kite-accent-foreground:oklch(98.5% 0 0);--kite-destructive:oklch(70.4% .191 22.216);--kite-destructive-foreground:oklch(98.5% 0 0);--kite-border:oklch(100% 0 0/.1);--kite-input:oklch(100% 0 0/.15);--kite-ring:oklch(55.6% 0 0);--kite-link:oklch(65% .15 250)}#kite-chat-root *{border-color:var(--kite-border)}#kite-chat-root section form input{color:var(--kite-foreground,#1a1a1a)!important}#kite-chat-root section form input::placeholder{color:var(--kite-muted-foreground,#9ca3af)!important}#kite-chat-root section .space-y-1>div+div{margin-top:.625rem}#kite-chat-root section>div.flex-1>div.overflow-y-auto{padding:1rem 1.25rem!important}#kite-chat-root section .mt-6.pt-4.border-t{margin-top:1.25rem;padding-top:1rem}#kite-chat-root section button.w-full.text-left.px-3{padding:.75rem 1rem}#kite-chat-root section .text-sm.leading-6{line-height:1.625rem}@keyframes spin{to{transform:rotate(360deg)}}#kite-chat-root .animate-spin{animation:1s linear infinite spin}#kite-chat-root [data-motion]{will-change:transform,opacity}#kite-chat-root a,#kite-chat-root .kite-link{word-break:break-word;overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;text-decoration:none;color:var(--kite-link)!important}#kite-chat-root a:hover,#kite-chat-root .kite-link:hover{text-decoration:underline}#kite-chat-root .text-sm.leading-6{overflow-wrap:break-word;word-break:break-word;max-width:100%}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}#kite-chat-root{--kite-link:oklch(55% .15 250)}`,document.head.appendChild(e),console.log("[KiteChat-Debug] Style injected",{styleInHead:!!document.getElementById("kite-chat-styles"),cssLength:e.textContent?.length||0});let t=document.createElement("style");t.id="kite-chat-position",t.textContent=`
|
|
34
|
+
transition-all duration-150 ease-in-out`,children:T.label},T.id))})]})},v.id)}),(oe||hs)&&(0,f.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[oe&&oe.stepIndex>0&&(0,f.jsx)(It,{type:"button",size:"sm",variant:"secondary",className:"h-7 w-7 rounded-full p-0 bg-gray-100 hover:bg-gray-200 border border-gray-200",onClick:wS,children:(0,f.jsx)(yn,{className:"h-3.5 w-3.5 text-gray-600"})}),(0,f.jsxs)(It,{type:"button",size:"sm",variant:"secondary",className:"h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",onClick:hs?nh:mc,children:[(0,f.jsx)("span",{children:hs?"Done":"Next"}),(0,f.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,f.jsx)(Ka,{className:"h-3 w-3"}),(0,f.jsx)($a,{className:"h-3 w-3"})]})]})]}),(A==="thinking"||A==="searching"||A==="executing"||A==="responding")&&(0,f.jsx)("div",{className:`${pe==="user"?"mt-3":""}`,children:(0,f.jsx)(Ov,{phase:A,progressSteps:R})}),!oe&&(0,f.jsx)("div",{ref:Jm})]})})})})}),(0,f.jsxs)("div",{className:"px-4 py-3 border-t border-gray-100 bg-gray-50/50 shrink-0",children:[Yr&&(0,f.jsxs)("div",{className:"mb-2 flex items-center gap-2 rounded-xl bg-blue-50 border border-blue-200 px-3 py-2",children:[(0,f.jsx)(vn,{className:"h-4 w-4 text-blue-600"}),(0,f.jsx)("span",{className:"text-xs text-blue-700 flex-1 truncate",children:Yr.name}),(0,f.jsx)("button",{type:"button",onClick:()=>{uc(null),No.current&&(No.current.value="")},className:"text-blue-600 hover:text-blue-800",children:(0,f.jsx)(Mr,{className:"h-4 w-4"})})]}),(0,f.jsxs)("form",{onSubmit:vS,className:"w-full",children:[(0,f.jsx)("input",{ref:No,type:"file",accept:".csv",className:"hidden",onChange:v=>{let b=v.target.files?.[0];b&&uc(b)}}),(0,f.jsxs)("div",{className:"flex w-full items-start gap-2 rounded-xl border border-gray-200 bg-white px-3 py-2 shadow-sm",children:[(0,f.jsx)(It,{type:"button",size:"icon",variant:"ghost",onClick:()=>No.current?.click(),className:"h-5 w-5 rounded-full text-gray-400 hover:text-gray-600 hover:bg-gray-100",title:"Upload CSV for bulk operations",children:(0,f.jsx)(Li,{className:"h-2.5 w-2.5"})}),(0,f.jsx)("textarea",{placeholder:Yr?"Describe what to do with this CSV...":"Ask anything...",value:p,onChange:v=>g(v.target.value),rows:1,className:"flex-1 border-0 bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 text-sm placeholder:text-gray-400 resize-none overflow-hidden outline-none",style:{minHeight:"20px",maxHeight:"120px"},onInput:v=>{let b=v.target;b.style.height="auto",b.style.height=Math.min(b.scrollHeight,120)+"px"},onKeyDown:v=>{if(v.key==="Enter"&&!v.shiftKey&&!v.metaKey&&!v.ctrlKey){if(v.preventDefault(),p.trim()||Yr){let b=v.currentTarget.closest("form");b&&b.requestSubmit()}return}if((v.metaKey||v.ctrlKey)&&v.key==="Enter"){let b=dc.current;if(b){v.preventDefault(),v.stopPropagation(),pc(b);return}if(ze){v.preventDefault(),v.stopPropagation(),fc();return}if(gs){v.preventDefault(),v.stopPropagation(),cc(gs);return}if(De.current){v.preventDefault(),v.stopPropagation(),mc();return}}}}),(0,f.jsx)(It,{type:"submit",size:"icon",disabled:!p.trim()&&!Yr,className:"h-6 w-6 rounded-full bg-gray-900 hover:bg-gray-800 disabled:bg-gray-300",children:(0,f.jsx)(gi,{className:"h-2.5 w-2.5"})})]})]})]}),(0,f.jsx)(iS,{x:Qi.x,y:Qi.y,visible:Qi.visible,onClick:Qi.onClick})]}):(0,f.jsx)("div",{className:"fixed bottom-6 left-1/2 -translate-x-1/2 z-50",children:(0,f.jsx)("div",{className:`flex items-center gap-3 rounded-2xl bg-white border border-gray-200 shadow-lg px-4 py-2 hover:shadow-xl transition-all duration-300 ease-out focus-within:border-gray-700 ${th?"w-[480px]":"w-[320px]"}`,children:th?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("input",{ref:ah,type:"text",value:Eo,onChange:v=>Yi(v.target.value),onKeyDown:v=>{v.key==="Enter"&&Eo.trim()?(v.preventDefault(),a?.(),Zi(Eo.trim()),Yi(""),xs(!1)):v.key==="Escape"&&(xs(!1),Yi(""))},onBlur:()=>{Eo.trim()||setTimeout(()=>xs(!1),200)},placeholder:"Ask a question...",className:"flex-1 text-sm text-gray-700 outline-none bg-transparent"}),(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)("span",{className:"text-xs text-gray-400 font-medium",children:"\u21B5 Enter"}),(0,f.jsx)("button",{onClick:()=>{a?.(),Eo.trim()&&g(Eo),Yi(""),xs(!1)},className:"h-7 w-7 rounded-lg bg-gray-100 hover:bg-gray-200 flex items-center justify-center transition-colors cursor-pointer",children:(0,f.jsx)(Ca,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"})})]})]}):(0,f.jsxs)("div",{className:"flex items-center gap-3 w-full",children:[(0,f.jsxs)("button",{onClick:()=>{xs(!0),setTimeout(()=>ah.current?.focus(),100)},className:"flex items-center gap-3 flex-1 group",children:[(0,f.jsx)("span",{className:"text-sm text-gray-500 flex-1 text-left",children:"Ask a question..."}),(0,f.jsx)("span",{className:"text-xs text-gray-400 font-medium",children:"\u2318I"})]}),(0,f.jsx)("button",{onClick:()=>{a?.()},className:"h-7 w-7 rounded-lg bg-gray-100 hover:bg-gray-200 flex items-center justify-center transition-colors",children:(0,f.jsx)(Ca,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"})})]})})})}function mS({onNavigate:e,onActionComplete:t,currentPage:a,agentUrl:r,startingQuestions:o,startingQuestionsEndpoint:n,defaultOpen:s=!1,isOpen:i,onOpenChange:l}){let[u,d]=G.useState(s),c=i!==void 0?i:u,p=g=>{i===void 0&&d(g),l?.(g)};return G.useEffect(()=>{let g=document.body.style.paddingRight,L=document.body.style.transition;return document.body.style.transition="padding-right 0.3s ease",document.body.style.paddingRight=c?`${pS}px`:"0px",()=>{document.body.style.paddingRight=g,document.body.style.transition=L}},[c]),(0,f.jsx)(vT,{isOpen:c,onClose:()=>p(!1),onOpen:()=>p(!0),onNavigate:e,onActionComplete:t,currentPage:a,agentUrl:r,startingQuestions:o,startingQuestionsEndpoint:n})}var Ym=E(le(),1),ms=null,At=null,Ht={};function LT({initialConfig:e}){let[t,a]=(0,Ra.useState)(e),[r,o]=(0,Ra.useState)(e.currentPage||"dashboard"),[n,s]=(0,Ra.useState)(!1),i=(0,Ra.useRef)(!1);return(0,Ra.useEffect)(()=>{i.current=n},[n]),(0,Ra.useEffect)(()=>(Ht.setCurrentPage=o,Ht.setConfig=l=>a(u=>({...u,...l})),Ht.setIsOpen=s,Ht.getIsOpen=()=>i.current,()=>{Ht={}}),[]),(0,Ra.useEffect)(()=>{t.theme==="dark"?At?.classList.add("dark"):At?.classList.remove("dark")},[t.theme]),(0,Ym.jsx)(mS,{isOpen:n,onOpenChange:s,currentPage:r,agentUrl:t.agentUrl,onNavigate:(l,u)=>t.onNavigate?.(l,u),onActionComplete:t.onActionComplete,startingQuestions:t.startingQuestions,startingQuestionsEndpoint:t.startingQuestionsEndpoint})}function CT(){if(console.log("[KiteChat-Debug] injectStyles called",{existingStyle:!!document.getElementById("kite-chat-styles"),cssContentLength:47507}),document.getElementById("kite-chat-styles"))return;let e=document.createElement("style");e.id="kite-chat-styles",e.textContent=`/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */
|
|
35
|
+
@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){#kite-chat-root *,#kite-chat-root :before,#kite-chat-root :after,#kite-chat-root ::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-duration:initial;--tw-ease:initial}}:root,#kite-chat-root{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-200:oklch(88.5% .062 18.334);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-orange-100:oklch(95.4% .038 75.164);--color-orange-400:oklch(75% .183 55.934);--color-orange-700:oklch(55.3% .195 38.402);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-green-50:oklch(98.2% .018 155.826);--color-green-200:oklch(92.5% .084 155.995);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-green-800:oklch(44.8% .119 151.328);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-600:oklch(59.6% .145 163.225);--color-emerald-700:oklch(50.8% .118 165.612);--color-blue-50:oklch(97% .014 254.604);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-purple-50:oklch(97.7% .014 308.299);--color-purple-100:oklch(94.6% .033 307.174);--color-purple-200:oklch(90.2% .063 306.703);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-600:oklch(55.8% .288 302.321);--color-purple-700:oklch(49.6% .265 301.924);--color-pink-400:oklch(71.8% .202 349.761);--color-slate-50:oklch(98.4% .003 247.858);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-700:oklch(37.2% .044 257.287);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height:calc(1.5/1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--tracking-wider:.05em;--leading-relaxed:1.625;--radius-2xl:1rem;--ease-out:cubic-bezier(0,0,.2,1);--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}#kite-chat-root *,#kite-chat-root :after,#kite-chat-root :before,#kite-chat-root ::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}#kite-chat-root ::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}#kite-chat-root,#kite-chat-root{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}#kite-chat-root hr{height:0;color:inherit;border-top-width:1px}#kite-chat-root abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}#kite-chat-root h1,#kite-chat-root h2,#kite-chat-root h3,#kite-chat-root h4,#kite-chat-root h5,#kite-chat-root h6{font-size:inherit;font-weight:inherit}#kite-chat-root a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}#kite-chat-root b,#kite-chat-root strong{font-weight:bolder}#kite-chat-root code,#kite-chat-root kbd,#kite-chat-root samp,#kite-chat-root pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}#kite-chat-root small{font-size:80%}#kite-chat-root sub,#kite-chat-root sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}#kite-chat-root sub{bottom:-.25em}#kite-chat-root sup{top:-.5em}#kite-chat-root table{text-indent:0;border-color:inherit;border-collapse:collapse}#kite-chat-root :-moz-focusring{outline:auto}#kite-chat-root progress{vertical-align:baseline}#kite-chat-root summary{display:list-item}#kite-chat-root ol,#kite-chat-root ul,#kite-chat-root menu{list-style:none}#kite-chat-root img,#kite-chat-root svg,#kite-chat-root video,#kite-chat-root canvas,#kite-chat-root audio,#kite-chat-root iframe,#kite-chat-root embed,#kite-chat-root object{vertical-align:middle;display:block}#kite-chat-root img,#kite-chat-root video{max-width:100%;height:auto}#kite-chat-root button,#kite-chat-root input,#kite-chat-root select,#kite-chat-root optgroup,#kite-chat-root textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}#kite-chat-root ::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}#kite-chat-root :where(select:is([multiple],[size])) optgroup{font-weight:bolder}#kite-chat-root :where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}#kite-chat-root ::file-selector-button{margin-inline-end:4px}#kite-chat-root ::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){#kite-chat-root ::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){#kite-chat-root ::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}#kite-chat-root textarea{resize:vertical}#kite-chat-root ::-webkit-search-decoration{-webkit-appearance:none}#kite-chat-root ::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}#kite-chat-root ::-webkit-datetime-edit{display:inline-flex}#kite-chat-root ::-webkit-datetime-edit-fields-wrapper{padding:0}#kite-chat-root ::-webkit-datetime-edit{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-year-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-month-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-day-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-hour-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-minute-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-second-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-millisecond-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-meridiem-field{padding-block:0}#kite-chat-root ::-webkit-calendar-picker-indicator{line-height:1}#kite-chat-root :-moz-ui-invalid{box-shadow:none}#kite-chat-root button,#kite-chat-root input:where([type=button],[type=reset],[type=submit]){appearance:button}#kite-chat-root ::file-selector-button{appearance:button}#kite-chat-root ::-webkit-inner-spin-button{height:auto}#kite-chat-root ::-webkit-outer-spin-button{height:auto}#kite-chat-root [hidden]:where(:not([hidden=until-found])){display:none!important}#kite-chat-root .\\@container\\/card-header{container:card-header/inline-size}#kite-chat-root .pointer-events-none{pointer-events:none}#kite-chat-root .collapse{visibility:collapse}#kite-chat-root .visible{visibility:visible}#kite-chat-root .fixed{position:fixed}#kite-chat-root .relative{position:relative}#kite-chat-root .top-0{top:calc(var(--spacing)*0)}#kite-chat-root .top-1\\/2{top:50%}#kite-chat-root .right-0{right:calc(var(--spacing)*0)}#kite-chat-root .bottom-6{bottom:calc(var(--spacing)*6)}#kite-chat-root .left-1\\/2{left:50%}#kite-chat-root .z-40{z-index:40}#kite-chat-root .z-50{z-index:50}#kite-chat-root .z-\\[9999\\]{z-index:9999}#kite-chat-root .col-start-2{grid-column-start:2}#kite-chat-root .row-span-2{grid-row:span 2/span 2}#kite-chat-root .row-start-1{grid-row-start:1}#kite-chat-root .container{width:100%}@media (min-width:40rem){#kite-chat-root .container{max-width:40rem}}@media (min-width:48rem){#kite-chat-root .container{max-width:48rem}}@media (min-width:64rem){#kite-chat-root .container{max-width:64rem}}@media (min-width:80rem){#kite-chat-root .container{max-width:80rem}}@media (min-width:96rem){#kite-chat-root .container{max-width:96rem}}#kite-chat-root .mx-auto{margin-inline:auto}#kite-chat-root .my-1{margin-block:calc(var(--spacing)*1)}#kite-chat-root .my-2{margin-block:calc(var(--spacing)*2)}#kite-chat-root .mt-1{margin-top:calc(var(--spacing)*1)}#kite-chat-root .mt-2{margin-top:calc(var(--spacing)*2)}#kite-chat-root .mt-3{margin-top:calc(var(--spacing)*3)}#kite-chat-root .mr-2{margin-right:calc(var(--spacing)*2)}#kite-chat-root .mb-1{margin-bottom:calc(var(--spacing)*1)}#kite-chat-root .mb-1\\.5{margin-bottom:calc(var(--spacing)*1.5)}#kite-chat-root .mb-2{margin-bottom:calc(var(--spacing)*2)}#kite-chat-root .mb-3{margin-bottom:calc(var(--spacing)*3)}#kite-chat-root .mb-4{margin-bottom:calc(var(--spacing)*4)}#kite-chat-root .ml-2{margin-left:calc(var(--spacing)*2)}#kite-chat-root .ml-4{margin-left:calc(var(--spacing)*4)}#kite-chat-root .ml-5{margin-left:calc(var(--spacing)*5)}#kite-chat-root .ml-6{margin-left:calc(var(--spacing)*6)}#kite-chat-root .block{display:block}#kite-chat-root .contents{display:contents}#kite-chat-root .flex{display:flex}#kite-chat-root .grid{display:grid}#kite-chat-root .hidden{display:none}#kite-chat-root .inline{display:inline}#kite-chat-root .inline-block{display:inline-block}#kite-chat-root .inline-flex{display:inline-flex}#kite-chat-root .table{display:table}#kite-chat-root .size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}#kite-chat-root .size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}#kite-chat-root .size-10{width:calc(var(--spacing)*10);height:calc(var(--spacing)*10)}#kite-chat-root .size-full{width:100%;height:100%}#kite-chat-root .h-1{height:calc(var(--spacing)*1)}#kite-chat-root .h-1\\.5{height:calc(var(--spacing)*1.5)}#kite-chat-root .h-2{height:calc(var(--spacing)*2)}#kite-chat-root .h-2\\.5{height:calc(var(--spacing)*2.5)}#kite-chat-root .h-3{height:calc(var(--spacing)*3)}#kite-chat-root .h-3\\.5{height:calc(var(--spacing)*3.5)}#kite-chat-root .h-4{height:calc(var(--spacing)*4)}#kite-chat-root .h-5{height:calc(var(--spacing)*5)}#kite-chat-root .h-6{height:calc(var(--spacing)*6)}#kite-chat-root .h-7{height:calc(var(--spacing)*7)}#kite-chat-root .h-8{height:calc(var(--spacing)*8)}#kite-chat-root .h-9{height:calc(var(--spacing)*9)}#kite-chat-root .h-10{height:calc(var(--spacing)*10)}#kite-chat-root .h-16{height:calc(var(--spacing)*16)}#kite-chat-root .h-auto{height:auto}#kite-chat-root .h-full{height:100%}#kite-chat-root .max-h-32{max-height:calc(var(--spacing)*32)}#kite-chat-root .min-h-0{min-height:calc(var(--spacing)*0)}#kite-chat-root .w-1\\.5{width:calc(var(--spacing)*1.5)}#kite-chat-root .w-2\\.5{width:calc(var(--spacing)*2.5)}#kite-chat-root .w-3{width:calc(var(--spacing)*3)}#kite-chat-root .w-3\\.5{width:calc(var(--spacing)*3.5)}#kite-chat-root .w-4{width:calc(var(--spacing)*4)}#kite-chat-root .w-5{width:calc(var(--spacing)*5)}#kite-chat-root .w-6{width:calc(var(--spacing)*6)}#kite-chat-root .w-7{width:calc(var(--spacing)*7)}#kite-chat-root .w-10{width:calc(var(--spacing)*10)}#kite-chat-root .w-\\[320px\\]{width:320px}#kite-chat-root .w-\\[480px\\]{width:480px}#kite-chat-root .w-full{width:100%}#kite-chat-root .max-w-\\[260px\\]{max-width:260px}#kite-chat-root .min-w-0{min-width:calc(var(--spacing)*0)}#kite-chat-root .flex-1{flex:1}#kite-chat-root .flex-shrink-0,#kite-chat-root .shrink-0{flex-shrink:0}#kite-chat-root .-translate-x-1\\/2{--tw-translate-x:calc(calc(1/2*100%)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}#kite-chat-root .translate-x-0{--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}#kite-chat-root .translate-x-full{--tw-translate-x:100%;translate:var(--tw-translate-x)var(--tw-translate-y)}#kite-chat-root .transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}#kite-chat-root .animate-spin{animation:var(--animate-spin)}#kite-chat-root .cursor-pointer{cursor:pointer}#kite-chat-root .touch-none{touch-action:none}#kite-chat-root .resize-none{resize:none}#kite-chat-root .list-decimal{list-style-type:decimal}#kite-chat-root .list-disc{list-style-type:disc}#kite-chat-root .auto-rows-min{grid-auto-rows:min-content}#kite-chat-root .grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}#kite-chat-root .grid-rows-\\[auto_auto\\]{grid-template-rows:auto auto}#kite-chat-root .flex-col{flex-direction:column}#kite-chat-root .flex-wrap{flex-wrap:wrap}#kite-chat-root .place-items-center{place-items:center}#kite-chat-root .items-center{align-items:center}#kite-chat-root .items-start{align-items:flex-start}#kite-chat-root .justify-between{justify-content:space-between}#kite-chat-root .justify-center{justify-content:center}#kite-chat-root .justify-end{justify-content:flex-end}#kite-chat-root .justify-start{justify-content:flex-start}#kite-chat-root .gap-0\\.5{gap:calc(var(--spacing)*.5)}#kite-chat-root .gap-1{gap:calc(var(--spacing)*1)}#kite-chat-root .gap-1\\.5{gap:calc(var(--spacing)*1.5)}#kite-chat-root .gap-2{gap:calc(var(--spacing)*2)}#kite-chat-root .gap-2\\.5{gap:calc(var(--spacing)*2.5)}#kite-chat-root .gap-3{gap:calc(var(--spacing)*3)}#kite-chat-root .gap-4{gap:calc(var(--spacing)*4)}#kite-chat-root .gap-6{gap:calc(var(--spacing)*6)}#kite-chat-root :where(.space-y-0\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*.5)*calc(1 - var(--tw-space-y-reverse)))}#kite-chat-root :where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}#kite-chat-root :where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}#kite-chat-root :where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}#kite-chat-root :where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}#kite-chat-root :where(.divide-gray-100>:not(:last-child)){border-color:var(--color-gray-100)}#kite-chat-root .self-start{align-self:flex-start}#kite-chat-root .justify-self-end{justify-self:flex-end}#kite-chat-root .truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}#kite-chat-root .overflow-hidden{overflow:hidden}#kite-chat-root .overflow-x-auto{overflow-x:auto}#kite-chat-root .overflow-y-auto{overflow-y:auto}#kite-chat-root .rounded{border-radius:.25rem}#kite-chat-root .rounded-2xl{border-radius:var(--radius-2xl)}#kite-chat-root .rounded-\\[inherit\\]{border-radius:inherit}#kite-chat-root .rounded-full{border-radius:3.40282e38px}#kite-chat-root .rounded-lg{border-radius:var(--kite-radius)}#kite-chat-root .rounded-md{border-radius:calc(var(--kite-radius) - 2px)}#kite-chat-root .rounded-xl{border-radius:calc(var(--kite-radius) + 4px)}#kite-chat-root .rounded-l-lg{border-top-left-radius:var(--kite-radius);border-bottom-left-radius:var(--kite-radius)}#kite-chat-root .rounded-br-md{border-bottom-right-radius:calc(var(--kite-radius) - 2px)}#kite-chat-root .rounded-bl-md{border-bottom-left-radius:calc(var(--kite-radius) - 2px)}#kite-chat-root .border{border-style:var(--tw-border-style);border-width:1px}#kite-chat-root .border-0{border-style:var(--tw-border-style);border-width:0}#kite-chat-root .border-t{border-top-style:var(--tw-border-style);border-top-width:1px}#kite-chat-root .border-r-0{border-right-style:var(--tw-border-style);border-right-width:0}#kite-chat-root .border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}#kite-chat-root .border-l{border-left-style:var(--tw-border-style);border-left-width:1px}#kite-chat-root .border-amber-100{border-color:var(--color-amber-100)}#kite-chat-root .border-amber-200{border-color:var(--color-amber-200)}#kite-chat-root .border-blue-100{border-color:var(--color-blue-100)}#kite-chat-root .border-blue-200{border-color:var(--color-blue-200)}#kite-chat-root .border-emerald-100{border-color:var(--color-emerald-100)}#kite-chat-root .border-emerald-200{border-color:var(--color-emerald-200)}#kite-chat-root .border-gray-100{border-color:var(--color-gray-100)}#kite-chat-root .border-gray-200{border-color:var(--color-gray-200)}#kite-chat-root .border-gray-300{border-color:var(--color-gray-300)}#kite-chat-root .border-green-200{border-color:var(--color-green-200)}#kite-chat-root .border-input{border-color:var(--kite-input)}#kite-chat-root .border-primary\\/20{border-color:var(--kite-primary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .border-primary\\/20{border-color:color-mix(in oklab,var(--kite-primary)20%,transparent)}}#kite-chat-root .border-purple-100{border-color:var(--color-purple-100)}#kite-chat-root .border-purple-200{border-color:var(--color-purple-200)}#kite-chat-root .border-red-200{border-color:var(--color-red-200)}#kite-chat-root .border-slate-200{border-color:var(--color-slate-200)}#kite-chat-root .border-t-transparent{border-top-color:#0000}#kite-chat-root .border-l-transparent{border-left-color:#0000}#kite-chat-root .bg-amber-50{background-color:var(--color-amber-50)}#kite-chat-root .bg-amber-100{background-color:var(--color-amber-100)}#kite-chat-root .bg-background{background-color:var(--kite-background)}#kite-chat-root .bg-blue-50{background-color:var(--color-blue-50)}#kite-chat-root .bg-blue-100{background-color:var(--color-blue-100)}#kite-chat-root .bg-blue-400{background-color:var(--color-blue-400)}#kite-chat-root .bg-blue-600{background-color:var(--color-blue-600)}#kite-chat-root .bg-border{background-color:var(--kite-border)}#kite-chat-root .bg-card{background-color:var(--kite-card)}#kite-chat-root .bg-destructive{background-color:var(--kite-destructive)}#kite-chat-root .bg-emerald-50{background-color:var(--color-emerald-50)}#kite-chat-root .bg-emerald-500{background-color:var(--color-emerald-500)}#kite-chat-root .bg-gray-50{background-color:var(--color-gray-50)}#kite-chat-root .bg-gray-50\\/50{background-color:#f9fafb80}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .bg-gray-50\\/50{background-color:color-mix(in oklab,var(--color-gray-50)50%,transparent)}}#kite-chat-root .bg-gray-100{background-color:var(--color-gray-100)}#kite-chat-root .bg-gray-200{background-color:var(--color-gray-200)}#kite-chat-root .bg-gray-900{background-color:var(--color-gray-900)}#kite-chat-root .bg-green-50{background-color:var(--color-green-50)}#kite-chat-root .bg-green-400{background-color:var(--color-green-400)}#kite-chat-root .bg-muted\\/40{background-color:var(--kite-muted)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .bg-muted\\/40{background-color:color-mix(in oklab,var(--kite-muted)40%,transparent)}}#kite-chat-root .bg-orange-100{background-color:var(--color-orange-100)}#kite-chat-root .bg-orange-400{background-color:var(--color-orange-400)}#kite-chat-root .bg-pink-400{background-color:var(--color-pink-400)}#kite-chat-root .bg-primary,#kite-chat-root .bg-primary\\/5{background-color:var(--kite-primary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .bg-primary\\/5{background-color:color-mix(in oklab,var(--kite-primary)5%,transparent)}}#kite-chat-root .bg-purple-50{background-color:var(--color-purple-50)}#kite-chat-root .bg-purple-400{background-color:var(--color-purple-400)}#kite-chat-root .bg-red-50{background-color:var(--color-red-50)}#kite-chat-root .bg-red-500{background-color:var(--color-red-500)}#kite-chat-root .bg-secondary{background-color:var(--kite-secondary)}#kite-chat-root .bg-slate-50{background-color:var(--color-slate-50)}#kite-chat-root .bg-slate-100{background-color:var(--color-slate-100)}#kite-chat-root .bg-slate-300{background-color:var(--color-slate-300)}#kite-chat-root .bg-transparent{background-color:#0000}#kite-chat-root .bg-white{background-color:var(--color-white)}#kite-chat-root .bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}#kite-chat-root .from-gray-50{--tw-gradient-from:var(--color-gray-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}#kite-chat-root .to-white{--tw-gradient-to:var(--color-white);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}#kite-chat-root .p-0{padding:calc(var(--spacing)*0)}#kite-chat-root .p-2{padding:calc(var(--spacing)*2)}#kite-chat-root .p-3{padding:calc(var(--spacing)*3)}#kite-chat-root .p-4{padding:calc(var(--spacing)*4)}#kite-chat-root .p-px{padding:1px}#kite-chat-root .px-0{padding-inline:calc(var(--spacing)*0)}#kite-chat-root .px-1{padding-inline:calc(var(--spacing)*1)}#kite-chat-root .px-1\\.5{padding-inline:calc(var(--spacing)*1.5)}#kite-chat-root .px-2{padding-inline:calc(var(--spacing)*2)}#kite-chat-root .px-2\\.5{padding-inline:calc(var(--spacing)*2.5)}#kite-chat-root .px-3{padding-inline:calc(var(--spacing)*3)}#kite-chat-root .px-3\\.5{padding-inline:calc(var(--spacing)*3.5)}#kite-chat-root .px-4{padding-inline:calc(var(--spacing)*4)}#kite-chat-root .px-6{padding-inline:calc(var(--spacing)*6)}#kite-chat-root .py-0{padding-block:calc(var(--spacing)*0)}#kite-chat-root .py-0\\.5{padding-block:calc(var(--spacing)*.5)}#kite-chat-root .py-1{padding-block:calc(var(--spacing)*1)}#kite-chat-root .py-1\\.5{padding-block:calc(var(--spacing)*1.5)}#kite-chat-root .py-2{padding-block:calc(var(--spacing)*2)}#kite-chat-root .py-2\\.5{padding-block:calc(var(--spacing)*2.5)}#kite-chat-root .py-3{padding-block:calc(var(--spacing)*3)}#kite-chat-root .py-4{padding-block:calc(var(--spacing)*4)}#kite-chat-root .py-6{padding-block:calc(var(--spacing)*6)}#kite-chat-root .py-8{padding-block:calc(var(--spacing)*8)}#kite-chat-root .pt-0{padding-top:calc(var(--spacing)*0)}#kite-chat-root .pt-2{padding-top:calc(var(--spacing)*2)}#kite-chat-root .pb-2{padding-bottom:calc(var(--spacing)*2)}#kite-chat-root .pb-3{padding-bottom:calc(var(--spacing)*3)}#kite-chat-root .pb-4{padding-bottom:calc(var(--spacing)*4)}#kite-chat-root .text-center{text-align:center}#kite-chat-root .text-left{text-align:left}#kite-chat-root .font-mono{font-family:var(--font-mono)}#kite-chat-root .text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}#kite-chat-root .text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}#kite-chat-root .text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}#kite-chat-root .text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}#kite-chat-root .text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}#kite-chat-root .text-\\[10px\\]{font-size:10px}#kite-chat-root .leading-6{--tw-leading:calc(var(--spacing)*6);line-height:calc(var(--spacing)*6)}#kite-chat-root .leading-none{--tw-leading:1;line-height:1}#kite-chat-root .leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}#kite-chat-root .font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}#kite-chat-root .font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}#kite-chat-root .font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}#kite-chat-root .tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}#kite-chat-root .tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}#kite-chat-root .whitespace-nowrap{white-space:nowrap}#kite-chat-root .whitespace-pre-wrap{white-space:pre-wrap}#kite-chat-root .text-amber-500{color:var(--color-amber-500)}#kite-chat-root .text-amber-600{color:var(--color-amber-600)}#kite-chat-root .text-amber-700{color:var(--color-amber-700)}#kite-chat-root .text-black{color:var(--color-black)}#kite-chat-root .text-blue-600{color:var(--color-blue-600)}#kite-chat-root .text-blue-700{color:var(--color-blue-700)}#kite-chat-root .text-card-foreground{color:var(--kite-card-foreground)}#kite-chat-root .text-emerald-500{color:var(--color-emerald-500)}#kite-chat-root .text-emerald-600{color:var(--color-emerald-600)}#kite-chat-root .text-emerald-700{color:var(--color-emerald-700)}#kite-chat-root .text-gray-300{color:var(--color-gray-300)}#kite-chat-root .text-gray-400{color:var(--color-gray-400)}#kite-chat-root .text-gray-500{color:var(--color-gray-500)}#kite-chat-root .text-gray-600{color:var(--color-gray-600)}#kite-chat-root .text-gray-700{color:var(--color-gray-700)}#kite-chat-root .text-gray-800{color:var(--color-gray-800)}#kite-chat-root .text-gray-900{color:var(--color-gray-900)}#kite-chat-root .text-green-500{color:var(--color-green-500)}#kite-chat-root .text-green-600{color:var(--color-green-600)}#kite-chat-root .text-green-700{color:var(--color-green-700)}#kite-chat-root .text-green-800{color:var(--color-green-800)}#kite-chat-root .text-muted-foreground{color:var(--kite-muted-foreground)}#kite-chat-root .text-orange-700{color:var(--color-orange-700)}#kite-chat-root .text-primary{color:var(--kite-primary)}#kite-chat-root .text-primary-foreground{color:var(--kite-primary-foreground)}#kite-chat-root .text-purple-600{color:var(--color-purple-600)}#kite-chat-root .text-purple-700{color:var(--color-purple-700)}#kite-chat-root .text-red-500{color:var(--color-red-500)}#kite-chat-root .text-red-600{color:var(--color-red-600)}#kite-chat-root .text-red-700{color:var(--color-red-700)}#kite-chat-root .text-secondary-foreground{color:var(--kite-secondary-foreground)}#kite-chat-root .text-slate-600{color:var(--color-slate-600)}#kite-chat-root .text-slate-700{color:var(--color-slate-700)}#kite-chat-root .text-white{color:var(--color-white)}#kite-chat-root .uppercase{text-transform:uppercase}#kite-chat-root .italic{font-style:italic}#kite-chat-root .line-through{text-decoration-line:line-through}#kite-chat-root .underline-offset-4{text-underline-offset:4px}#kite-chat-root .opacity-60{opacity:.6}#kite-chat-root .opacity-70{opacity:.7}#kite-chat-root .opacity-90{opacity:.9}#kite-chat-root .opacity-100{opacity:1}#kite-chat-root .shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .outline{outline-style:var(--tw-outline-style);outline-width:1px}#kite-chat-root .transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .transition-\\[color\\,box-shadow\\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .duration-150{--tw-duration:.15s;transition-duration:.15s}#kite-chat-root .duration-200{--tw-duration:.2s;transition-duration:.2s}#kite-chat-root .duration-300{--tw-duration:.3s;transition-duration:.3s}#kite-chat-root .ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}#kite-chat-root .ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}#kite-chat-root .outline-none{--tw-outline-style:none;outline-style:none}#kite-chat-root .select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){#kite-chat-root .group-hover\\:bg-gray-200:is(:where(.group):hover *){background-color:var(--color-gray-200)}}#kite-chat-root .selection\\:bg-primary ::selection{background-color:var(--kite-primary)}#kite-chat-root .selection\\:bg-primary::selection{background-color:var(--kite-primary)}#kite-chat-root .selection\\:text-primary-foreground ::selection{color:var(--kite-primary-foreground)}#kite-chat-root .selection\\:text-primary-foreground::selection{color:var(--kite-primary-foreground)}#kite-chat-root .file\\:inline-flex::file-selector-button{display:inline-flex}#kite-chat-root .file\\:h-7::file-selector-button{height:calc(var(--spacing)*7)}#kite-chat-root .file\\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}#kite-chat-root .file\\:bg-transparent::file-selector-button{background-color:#0000}#kite-chat-root .file\\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}#kite-chat-root .file\\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}#kite-chat-root .file\\:text-foreground::file-selector-button{color:var(--kite-foreground)}#kite-chat-root .placeholder\\:text-gray-400::placeholder{color:var(--color-gray-400)}#kite-chat-root .placeholder\\:text-muted-foreground::placeholder{color:var(--kite-muted-foreground)}#kite-chat-root .focus-within\\:border-gray-700:focus-within{border-color:var(--color-gray-700)}@media (hover:hover){#kite-chat-root .hover\\:border-gray-300:hover{border-color:var(--color-gray-300)}#kite-chat-root .hover\\:border-primary\\/30:hover{border-color:var(--kite-primary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .hover\\:border-primary\\/30:hover{border-color:color-mix(in oklab,var(--kite-primary)30%,transparent)}}#kite-chat-root .hover\\:bg-accent:hover{background-color:var(--kite-accent)}#kite-chat-root .hover\\:bg-destructive\\/90:hover{background-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .hover\\:bg-destructive\\/90:hover{background-color:color-mix(in oklab,var(--kite-destructive)90%,transparent)}}#kite-chat-root .hover\\:bg-gray-50:hover{background-color:var(--color-gray-50)}#kite-chat-root .hover\\:bg-gray-100:hover{background-color:var(--color-gray-100)}#kite-chat-root .hover\\:bg-gray-200:hover{background-color:var(--color-gray-200)}#kite-chat-root .hover\\:bg-gray-800:hover{background-color:var(--color-gray-800)}#kite-chat-root .hover\\:bg-primary\\/10:hover{background-color:var(--kite-primary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .hover\\:bg-primary\\/10:hover{background-color:color-mix(in oklab,var(--kite-primary)10%,transparent)}}#kite-chat-root .hover\\:bg-primary\\/90:hover{background-color:var(--kite-primary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab,var(--kite-primary)90%,transparent)}}#kite-chat-root .hover\\:bg-secondary\\/80:hover{background-color:var(--kite-secondary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .hover\\:bg-secondary\\/80:hover{background-color:color-mix(in oklab,var(--kite-secondary)80%,transparent)}}#kite-chat-root .hover\\:text-accent-foreground:hover{color:var(--kite-accent-foreground)}#kite-chat-root .hover\\:text-blue-800:hover{color:var(--color-blue-800)}#kite-chat-root .hover\\:text-gray-600:hover{color:var(--color-gray-600)}#kite-chat-root .hover\\:text-gray-700:hover{color:var(--color-gray-700)}#kite-chat-root .hover\\:text-gray-800:hover{color:var(--color-gray-800)}#kite-chat-root .hover\\:underline:hover{text-decoration-line:underline}#kite-chat-root .hover\\:shadow-xl:hover{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}#kite-chat-root .focus\\:ring-primary:focus{--tw-ring-color:var(--kite-primary)}#kite-chat-root .focus-visible\\:border-ring:focus-visible{border-color:var(--kite-ring)}#kite-chat-root .focus-visible\\:ring-0:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .focus-visible\\:ring-\\[3px\\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:color-mix(in oklab,var(--kite-destructive)20%,transparent)}}#kite-chat-root .focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:var(--kite-ring)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:color-mix(in oklab,var(--kite-ring)50%,transparent)}}#kite-chat-root .focus-visible\\:ring-offset-0:focus-visible{--tw-ring-offset-width:0px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}#kite-chat-root .focus-visible\\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}#kite-chat-root .disabled\\:pointer-events-none:disabled{pointer-events:none}#kite-chat-root .disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}#kite-chat-root .disabled\\:bg-gray-300:disabled{background-color:var(--color-gray-300)}#kite-chat-root .disabled\\:opacity-50:disabled{opacity:.5}#kite-chat-root .has-data-\\[slot\\=card-action\\]\\:grid-cols-\\[1fr_auto\\]:has([data-slot=card-action]){grid-template-columns:1fr auto}#kite-chat-root .has-\\[\\>svg\\]\\:px-2\\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}#kite-chat-root .has-\\[\\>svg\\]\\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}#kite-chat-root .has-\\[\\>svg\\]\\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}#kite-chat-root .aria-invalid\\:border-destructive[aria-invalid=true]{border-color:var(--kite-destructive)}#kite-chat-root .aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--kite-destructive)20%,transparent)}}@media (min-width:48rem){#kite-chat-root .md\\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}#kite-chat-root .dark\\:border-input:is(.dark *){border-color:var(--kite-input)}#kite-chat-root .dark\\:bg-destructive\\/60:is(.dark *){background-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:bg-destructive\\/60:is(.dark *){background-color:color-mix(in oklab,var(--kite-destructive)60%,transparent)}}#kite-chat-root .dark\\:bg-input\\/30:is(.dark *){background-color:var(--kite-input)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:bg-input\\/30:is(.dark *){background-color:color-mix(in oklab,var(--kite-input)30%,transparent)}}@media (hover:hover){#kite-chat-root .dark\\:hover\\:bg-accent\\/50:is(.dark *):hover{background-color:var(--kite-accent)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:hover\\:bg-accent\\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--kite-accent)50%,transparent)}}#kite-chat-root .dark\\:hover\\:bg-input\\/50:is(.dark *):hover{background-color:var(--kite-input)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:hover\\:bg-input\\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--kite-input)50%,transparent)}}}#kite-chat-root .dark\\:focus-visible\\:ring-destructive\\/40:is(.dark *):focus-visible{--tw-ring-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:focus-visible\\:ring-destructive\\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab,var(--kite-destructive)40%,transparent)}}#kite-chat-root .dark\\:aria-invalid\\:ring-destructive\\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:aria-invalid\\:ring-destructive\\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--kite-destructive)40%,transparent)}}#kite-chat-root .\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}#kite-chat-root .\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}#kite-chat-root .\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-4 svg:not([class*=size-]){width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}#kite-chat-root .\\[\\.border-b\\]\\:pb-6.border-b{padding-bottom:calc(var(--spacing)*6)}#kite-chat-root .\\[\\.border-t\\]\\:pt-6.border-t{padding-top:calc(var(--spacing)*6)}:root{--kite-radius:.625rem;--kite-background:oklch(100% 0 0);--kite-foreground:oklch(14.5% 0 0);--kite-card:oklch(100% 0 0);--kite-card-foreground:oklch(14.5% 0 0);--kite-popover:oklch(100% 0 0);--kite-popover-foreground:oklch(14.5% 0 0);--kite-primary:oklch(20.5% 0 0);--kite-primary-foreground:oklch(98.5% 0 0);--kite-secondary:oklch(97% 0 0);--kite-secondary-foreground:oklch(20.5% 0 0);--kite-muted:oklch(97% 0 0);--kite-muted-foreground:oklch(55.6% 0 0);--kite-accent:oklch(97% 0 0);--kite-accent-foreground:oklch(20.5% 0 0);--kite-destructive:oklch(57.7% .245 27.325);--kite-destructive-foreground:oklch(98.5% 0 0);--kite-border:oklch(92.2% 0 0);--kite-input:oklch(92.2% 0 0);--kite-ring:oklch(70.8% 0 0)}.dark{--kite-background:oklch(14.5% 0 0);--kite-foreground:oklch(98.5% 0 0);--kite-card:oklch(20.5% 0 0);--kite-card-foreground:oklch(98.5% 0 0);--kite-popover:oklch(20.5% 0 0);--kite-popover-foreground:oklch(98.5% 0 0);--kite-primary:oklch(92.2% 0 0);--kite-primary-foreground:oklch(20.5% 0 0);--kite-secondary:oklch(26.9% 0 0);--kite-secondary-foreground:oklch(98.5% 0 0);--kite-muted:oklch(26.9% 0 0);--kite-muted-foreground:oklch(70.8% 0 0);--kite-accent:oklch(26.9% 0 0);--kite-accent-foreground:oklch(98.5% 0 0);--kite-destructive:oklch(70.4% .191 22.216);--kite-destructive-foreground:oklch(98.5% 0 0);--kite-border:oklch(100% 0 0/.1);--kite-input:oklch(100% 0 0/.15);--kite-ring:oklch(55.6% 0 0);--kite-link:oklch(65% .15 250)}#kite-chat-root *{border-color:var(--kite-border)}#kite-chat-root section form input{color:var(--kite-foreground,#1a1a1a)!important}#kite-chat-root section form input::placeholder{color:var(--kite-muted-foreground,#9ca3af)!important}#kite-chat-root section .space-y-1>div+div{margin-top:.625rem}#kite-chat-root section>div.flex-1>div.overflow-y-auto{padding:1rem 1.25rem!important}#kite-chat-root section .mt-6.pt-4.border-t{margin-top:1.25rem;padding-top:1rem}#kite-chat-root section button.w-full.text-left.px-3{padding:.75rem 1rem}#kite-chat-root section .text-sm.leading-6{line-height:1.625rem}@keyframes spin{to{transform:rotate(360deg)}}#kite-chat-root .animate-spin{animation:1s linear infinite spin}#kite-chat-root [data-motion]{will-change:transform,opacity}#kite-chat-root a,#kite-chat-root .kite-link{word-break:break-word;overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;text-decoration:none;color:var(--kite-link)!important}#kite-chat-root a:hover,#kite-chat-root .kite-link:hover{text-decoration:underline}#kite-chat-root .text-sm.leading-6{overflow-wrap:break-word;word-break:break-word;max-width:100%}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}#kite-chat-root{--kite-link:oklch(55% .15 250)}`,document.head.appendChild(e),console.log("[KiteChat-Debug] Style injected",{styleInHead:!!document.getElementById("kite-chat-styles"),cssLength:e.textContent?.length||0});let t=document.createElement("style");t.id="kite-chat-position",t.textContent=`
|
|
78
36
|
#kite-chat-root {
|
|
79
37
|
/* Container is just a mount point - ChatPanel handles its own positioning */
|
|
80
38
|
}
|
|
81
|
-
`,document.head.appendChild(t)}function
|
|
39
|
+
`,document.head.appendChild(t)}function Qm(){console.log("[KiteChat-Debug] init() called",{hasConfig:!!window.KiteChatConfig,configKeys:window.KiteChatConfig?Object.keys(window.KiteChatConfig):[]});let e=window.KiteChatConfig;if(!e){console.error("[KiteChat] Missing window.KiteChatConfig"),console.log("[KiteChat-Debug] FAIL: no config");return}if(!e.userId||!e.orgId){console.error("[KiteChat] userId and orgId are required"),console.log("[KiteChat-Debug] FAIL: missing userId/orgId",{hasUserId:!!e.userId,hasOrgId:!!e.orgId});return}if(ms){console.warn("[KiteChat] Already initialized");return}if(CT(),e.container){let t=typeof e.container=="string"?document.querySelector(e.container):e.container;if(console.log("[KiteChat-Debug] Using custom container",{containerSelector:typeof e.container=="string"?e.container:"HTMLElement",foundContainer:!!t,containerId:t?.id||"NO_ID",containerClasses:t?.className||""}),!t){console.error(`[KiteChat] Container not found: ${e.container}`);return}At=document.createElement("div"),At.id="kite-chat-root",t.appendChild(At),console.log("[KiteChat-Debug] Created inner wrapper with kite-chat-root ID inside custom container")}else At=document.createElement("div"),At.id="kite-chat-root",document.body.appendChild(At),console.log("[KiteChat-Debug] Created default container",{containerId:At.id});console.log("[KiteChat-Debug] About to render",{finalContainerId:At?.id||"NO_ID",finalContainerClasses:At?.className||""}),ms=(0,hS.createRoot)(At),ms.render((0,Ym.jsx)(LT,{initialConfig:e})),window.KiteChat=ST(),console.log("[KiteChat] Initialized")}function ST(){return{setCurrentPage:e=>Ht.setCurrentPage?.(e),setUser:(e,t)=>Ht.setConfig?.({userId:e,orgId:t}),setConfig:e=>Ht.setConfig?.(e),open:()=>Ht.setIsOpen?.(!0),close:()=>Ht.setIsOpen?.(!1),toggle:()=>{let e=Ht.getIsOpen?.()??!1;Ht.setIsOpen?.(!e)},isOpen:()=>Ht.getIsOpen?.()??!1,destroy:()=>{ms?.unmount(),ms=null,At?.remove(),At=null,window.KiteChat=void 0},isMounted:()=>ms!==null}}typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Qm):Qm());return MS(IT);})();
|
|
82
40
|
/*! Bundled license information:
|
|
83
41
|
|
|
84
42
|
react/cjs/react.production.min.js:
|