@kite-copilot/chat-panel 0.2.36 → 0.2.37

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.
@@ -1,18 +1,18 @@
1
- "use strict";var KiteChatEmbed=(()=>{var lk=Object.create;var Lu=Object.defineProperty;var uk=Object.getOwnPropertyDescriptor;var ck=Object.getOwnPropertyNames;var dk=Object.getPrototypeOf,fk=Object.prototype.hasOwnProperty;var pk=(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 ta=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),mk=(e,t)=>{for(var r in t)Lu(e,r,{get:t[r],enumerable:!0})},Ny=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ck(t))!fk.call(e,o)&&o!==r&&Lu(e,o,{get:()=>t[o],enumerable:!(a=uk(t,o))||a.enumerable});return e};var O=(e,t,r)=>(r=e!=null?lk(dk(e)):{},Ny(t||!e||!e.__esModule?Lu(r,"default",{value:e,enumerable:!0}):r,e)),hk=e=>Ny(Lu({},"__esModule",{value:!0}),e);var Wy=ta(ne=>{"use strict";var Pi=Symbol.for("react.element"),gk=Symbol.for("react.portal"),yk=Symbol.for("react.fragment"),vk=Symbol.for("react.strict_mode"),xk=Symbol.for("react.profiler"),wk=Symbol.for("react.provider"),Sk=Symbol.for("react.context"),Ck=Symbol.for("react.forward_ref"),bk=Symbol.for("react.suspense"),Lk=Symbol.for("react.memo"),Ik=Symbol.for("react.lazy"),My=Symbol.iterator;function kk(e){return e===null||typeof e!="object"?null:(e=My&&e[My]||e["@@iterator"],typeof e=="function"?e:null)}var Fy={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Uy=Object.assign,Vy={};function Dn(e,t,r){this.props=e,this.context=t,this.refs=Vy,this.updater=r||Fy}Dn.prototype.isReactComponent={};Dn.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")};Dn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function jy(){}jy.prototype=Dn.prototype;function cp(e,t,r){this.props=e,this.context=t,this.refs=Vy,this.updater=r||Fy}var dp=cp.prototype=new jy;dp.constructor=cp;Uy(dp,Dn.prototype);dp.isPureReactComponent=!0;var Oy=Array.isArray,qy=Object.prototype.hasOwnProperty,fp={current:null},Hy={key:!0,ref:!0,__self:!0,__source:!0};function zy(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)qy.call(t,a)&&!Hy.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:Pi,type:e,key:n,ref:s,props:o,_owner:fp.current}}function Pk(e,t){return{$$typeof:Pi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function pp(e){return typeof e=="object"&&e!==null&&e.$$typeof===Pi}function Tk(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var By=/\/+/g;function up(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Tk(""+e.key):t.toString(36)}function ku(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 Pi:case gk:s=!0}}if(s)return s=e,o=o(s),e=a===""?"."+up(s,0):a,Oy(o)?(r="",e!=null&&(r=e.replace(By,"$&/")+"/"),ku(o,t,r,"",function(u){return u})):o!=null&&(pp(o)&&(o=Pk(o,r+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(By,"$&/")+"/")+e)),t.push(o)),1;if(s=0,a=a===""?".":a+":",Oy(e))for(var i=0;i<e.length;i++){n=e[i];var l=a+up(n,i);s+=ku(n,t,r,l,o)}else if(l=kk(e),typeof l=="function")for(e=l.call(e),i=0;!(n=e.next()).done;)n=n.value,l=a+up(n,i++),s+=ku(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 Iu(e,t,r){if(e==null)return e;var a=[],o=0;return ku(e,a,"","",function(n){return t.call(r,n,o++)}),a}function _k(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 It={current:null},Pu={transition:null},Ak={ReactCurrentDispatcher:It,ReactCurrentBatchConfig:Pu,ReactCurrentOwner:fp};function $y(){throw Error("act(...) is not supported in production builds of React.")}ne.Children={map:Iu,forEach:function(e,t,r){Iu(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Iu(e,function(){t++}),t},toArray:function(e){return Iu(e,function(t){return t})||[]},only:function(e){if(!pp(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ne.Component=Dn;ne.Fragment=yk;ne.Profiler=xk;ne.PureComponent=cp;ne.StrictMode=vk;ne.Suspense=bk;ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ak;ne.act=$y;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=Uy({},e.props),o=e.key,n=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(n=t.ref,s=fp.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var i=e.type.defaultProps;for(l in t)qy.call(t,l)&&!Hy.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:Pi,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:wk,_context:e},e.Consumer=e};ne.createElement=zy;ne.createFactory=function(e){var t=zy.bind(null,e);return t.type=e,t};ne.createRef=function(){return{current:null}};ne.forwardRef=function(e){return{$$typeof:Ck,render:e}};ne.isValidElement=pp;ne.lazy=function(e){return{$$typeof:Ik,_payload:{_status:-1,_result:e},_init:_k}};ne.memo=function(e,t){return{$$typeof:Lk,type:e,compare:t===void 0?null:t}};ne.startTransition=function(e){var t=Pu.transition;Pu.transition={};try{e()}finally{Pu.transition=t}};ne.unstable_act=$y;ne.useCallback=function(e,t){return It.current.useCallback(e,t)};ne.useContext=function(e){return It.current.useContext(e)};ne.useDebugValue=function(){};ne.useDeferredValue=function(e){return It.current.useDeferredValue(e)};ne.useEffect=function(e,t){return It.current.useEffect(e,t)};ne.useId=function(){return It.current.useId()};ne.useImperativeHandle=function(e,t,r){return It.current.useImperativeHandle(e,t,r)};ne.useInsertionEffect=function(e,t){return It.current.useInsertionEffect(e,t)};ne.useLayoutEffect=function(e,t){return It.current.useLayoutEffect(e,t)};ne.useMemo=function(e,t){return It.current.useMemo(e,t)};ne.useReducer=function(e,t,r){return It.current.useReducer(e,t,r)};ne.useRef=function(e){return It.current.useRef(e)};ne.useState=function(e){return It.current.useState(e)};ne.useSyncExternalStore=function(e,t,r){return It.current.useSyncExternalStore(e,t,r)};ne.useTransition=function(){return It.current.useTransition()};ne.version="18.3.1"});var Q=ta(($D,Gy)=>{"use strict";Gy.exports=Wy()});var av=ta(we=>{"use strict";function yp(e,t){var r=e.length;e.push(t);e:for(;0<r;){var a=r-1>>>1,o=e[a];if(0<Tu(o,t))e[a]=t,e[r]=o,r=a;else break e}}function xr(e){return e.length===0?null:e[0]}function Au(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>Tu(i,r))l<o&&0>Tu(u,i)?(e[a]=u,e[l]=r,a=l):(e[a]=i,e[s]=r,a=s);else if(l<o&&0>Tu(u,r))e[a]=u,e[l]=r,a=l;else break e}}return t}function Tu(e,t){var r=e.sortIndex-t.sortIndex;return r!==0?r:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(Ky=performance,we.unstable_now=function(){return Ky.now()}):(mp=Date,Xy=mp.now(),we.unstable_now=function(){return mp.now()-Xy});var Ky,mp,Xy,Nr=[],Na=[],Rk=1,lr=null,yt=3,Ru=!1,Do=!1,_i=!1,Yy=typeof setTimeout=="function"?setTimeout:null,Zy=typeof clearTimeout=="function"?clearTimeout:null,Jy=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function vp(e){for(var t=xr(Na);t!==null;){if(t.callback===null)Au(Na);else if(t.startTime<=e)Au(Na),t.sortIndex=t.expirationTime,yp(Nr,t);else break;t=xr(Na)}}function xp(e){if(_i=!1,vp(e),!Do)if(xr(Nr)!==null)Do=!0,Sp(wp);else{var t=xr(Na);t!==null&&Cp(xp,t.startTime-e)}}function wp(e,t){Do=!1,_i&&(_i=!1,Zy(Ai),Ai=-1),Ru=!0;var r=yt;try{for(vp(t),lr=xr(Nr);lr!==null&&(!(lr.expirationTime>t)||e&&!rv());){var a=lr.callback;if(typeof a=="function"){lr.callback=null,yt=lr.priorityLevel;var o=a(lr.expirationTime<=t);t=we.unstable_now(),typeof o=="function"?lr.callback=o:lr===xr(Nr)&&Au(Nr),vp(t)}else Au(Nr);lr=xr(Nr)}if(lr!==null)var n=!0;else{var s=xr(Na);s!==null&&Cp(xp,s.startTime-t),n=!1}return n}finally{lr=null,yt=r,Ru=!1}}var Eu=!1,_u=null,Ai=-1,ev=5,tv=-1;function rv(){return!(we.unstable_now()-tv<ev)}function hp(){if(_u!==null){var e=we.unstable_now();tv=e;var t=!0;try{t=_u(!0,e)}finally{t?Ti():(Eu=!1,_u=null)}}else Eu=!1}var Ti;typeof Jy=="function"?Ti=function(){Jy(hp)}:typeof MessageChannel<"u"?(gp=new MessageChannel,Qy=gp.port2,gp.port1.onmessage=hp,Ti=function(){Qy.postMessage(null)}):Ti=function(){Yy(hp,0)};var gp,Qy;function Sp(e){_u=e,Eu||(Eu=!0,Ti())}function Cp(e,t){Ai=Yy(function(){e(we.unstable_now())},t)}we.unstable_IdlePriority=5;we.unstable_ImmediatePriority=1;we.unstable_LowPriority=4;we.unstable_NormalPriority=3;we.unstable_Profiling=null;we.unstable_UserBlockingPriority=2;we.unstable_cancelCallback=function(e){e.callback=null};we.unstable_continueExecution=function(){Do||Ru||(Do=!0,Sp(wp))};we.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"):ev=0<e?Math.floor(1e3/e):5};we.unstable_getCurrentPriorityLevel=function(){return yt};we.unstable_getFirstCallbackNode=function(){return xr(Nr)};we.unstable_next=function(e){switch(yt){case 1:case 2:case 3:var t=3;break;default:t=yt}var r=yt;yt=t;try{return e()}finally{yt=r}};we.unstable_pauseExecution=function(){};we.unstable_requestPaint=function(){};we.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=yt;yt=e;try{return t()}finally{yt=r}};we.unstable_scheduleCallback=function(e,t,r){var a=we.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:Rk++,callback:t,priorityLevel:e,startTime:r,expirationTime:o,sortIndex:-1},r>a?(e.sortIndex=r,yp(Na,e),xr(Nr)===null&&e===xr(Na)&&(_i?(Zy(Ai),Ai=-1):_i=!0,Cp(xp,r-a))):(e.sortIndex=o,yp(Nr,e),Do||Ru||(Do=!0,Sp(wp))),e};we.unstable_shouldYield=rv;we.unstable_wrapCallback=function(e){var t=yt;return function(){var r=yt;yt=t;try{return e.apply(this,arguments)}finally{yt=r}}}});var nv=ta((GD,ov)=>{"use strict";ov.exports=av()});var uw=ta(Jt=>{"use strict";var Ek=Q(),Kt=nv();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 fx=new Set,Yi={};function Wo(e,t){es(e,t),es(e+"Capture",t)}function es(e,t){for(Yi[e]=t,e=0;e<t.length;e++)fx.add(t[e])}var ia=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$p=Object.prototype.hasOwnProperty,Dk=/^[: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]*$/,sv={},iv={};function Nk(e){return $p.call(iv,e)?!0:$p.call(sv,e)?!1:Dk.test(e)?iv[e]=!0:(sv[e]=!0,!1)}function Mk(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 Ok(e,t,r,a){if(t===null||typeof t>"u"||Mk(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 Tt(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 ut={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ut[e]=new Tt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ut[t]=new Tt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ut[e]=new Tt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ut[e]=new Tt(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){ut[e]=new Tt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ut[e]=new Tt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ut[e]=new Tt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ut[e]=new Tt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ut[e]=new Tt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Bm=/[\-:]([a-z])/g;function Fm(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(Bm,Fm);ut[t]=new Tt(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(Bm,Fm);ut[t]=new Tt(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(Bm,Fm);ut[t]=new Tt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ut[e]=new Tt(e,1,!1,e.toLowerCase(),null,!1,!1)});ut.xlinkHref=new Tt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ut[e]=new Tt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Um(e,t,r,a){var o=ut.hasOwnProperty(t)?ut[t]:null;(o!==null?o.type!==0:a||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Ok(t,r,o,a)&&(r=null),a||o===null?Nk(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 da=Ek.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Du=Symbol.for("react.element"),On=Symbol.for("react.portal"),Bn=Symbol.for("react.fragment"),Vm=Symbol.for("react.strict_mode"),Wp=Symbol.for("react.profiler"),px=Symbol.for("react.provider"),mx=Symbol.for("react.context"),jm=Symbol.for("react.forward_ref"),Gp=Symbol.for("react.suspense"),Kp=Symbol.for("react.suspense_list"),qm=Symbol.for("react.memo"),Oa=Symbol.for("react.lazy"),hx=Symbol.for("react.offscreen"),lv=Symbol.iterator;function Ri(e){return e===null||typeof e!="object"?null:(e=lv&&e[lv]||e["@@iterator"],typeof e=="function"?e:null)}var De=Object.assign,bp;function Ui(e){if(bp===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);bp=t&&t[1]||""}return`
1
+ "use strict";var KiteChatEmbed=(()=>{var lk=Object.create;var Lu=Object.defineProperty;var uk=Object.getOwnPropertyDescriptor;var ck=Object.getOwnPropertyNames;var dk=Object.getPrototypeOf,fk=Object.prototype.hasOwnProperty;var pk=(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 ta=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),mk=(e,t)=>{for(var r in t)Lu(e,r,{get:t[r],enumerable:!0})},Ny=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ck(t))!fk.call(e,o)&&o!==r&&Lu(e,o,{get:()=>t[o],enumerable:!(a=uk(t,o))||a.enumerable});return e};var O=(e,t,r)=>(r=e!=null?lk(dk(e)):{},Ny(t||!e||!e.__esModule?Lu(r,"default",{value:e,enumerable:!0}):r,e)),hk=e=>Ny(Lu({},"__esModule",{value:!0}),e);var Wy=ta(ne=>{"use strict";var Pi=Symbol.for("react.element"),gk=Symbol.for("react.portal"),yk=Symbol.for("react.fragment"),vk=Symbol.for("react.strict_mode"),xk=Symbol.for("react.profiler"),wk=Symbol.for("react.provider"),Sk=Symbol.for("react.context"),Ck=Symbol.for("react.forward_ref"),bk=Symbol.for("react.suspense"),Lk=Symbol.for("react.memo"),Ik=Symbol.for("react.lazy"),My=Symbol.iterator;function kk(e){return e===null||typeof e!="object"?null:(e=My&&e[My]||e["@@iterator"],typeof e=="function"?e:null)}var Fy={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Uy=Object.assign,Vy={};function Dn(e,t,r){this.props=e,this.context=t,this.refs=Vy,this.updater=r||Fy}Dn.prototype.isReactComponent={};Dn.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")};Dn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function jy(){}jy.prototype=Dn.prototype;function cp(e,t,r){this.props=e,this.context=t,this.refs=Vy,this.updater=r||Fy}var dp=cp.prototype=new jy;dp.constructor=cp;Uy(dp,Dn.prototype);dp.isPureReactComponent=!0;var Oy=Array.isArray,qy=Object.prototype.hasOwnProperty,fp={current:null},Hy={key:!0,ref:!0,__self:!0,__source:!0};function zy(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)qy.call(t,a)&&!Hy.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:Pi,type:e,key:n,ref:s,props:o,_owner:fp.current}}function Pk(e,t){return{$$typeof:Pi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function pp(e){return typeof e=="object"&&e!==null&&e.$$typeof===Pi}function Tk(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var By=/\/+/g;function up(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Tk(""+e.key):t.toString(36)}function ku(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 Pi:case gk:s=!0}}if(s)return s=e,o=o(s),e=a===""?"."+up(s,0):a,Oy(o)?(r="",e!=null&&(r=e.replace(By,"$&/")+"/"),ku(o,t,r,"",function(u){return u})):o!=null&&(pp(o)&&(o=Pk(o,r+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(By,"$&/")+"/")+e)),t.push(o)),1;if(s=0,a=a===""?".":a+":",Oy(e))for(var i=0;i<e.length;i++){n=e[i];var l=a+up(n,i);s+=ku(n,t,r,l,o)}else if(l=kk(e),typeof l=="function")for(e=l.call(e),i=0;!(n=e.next()).done;)n=n.value,l=a+up(n,i++),s+=ku(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 Iu(e,t,r){if(e==null)return e;var a=[],o=0;return ku(e,a,"","",function(n){return t.call(r,n,o++)}),a}function _k(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 It={current:null},Pu={transition:null},Ak={ReactCurrentDispatcher:It,ReactCurrentBatchConfig:Pu,ReactCurrentOwner:fp};function $y(){throw Error("act(...) is not supported in production builds of React.")}ne.Children={map:Iu,forEach:function(e,t,r){Iu(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Iu(e,function(){t++}),t},toArray:function(e){return Iu(e,function(t){return t})||[]},only:function(e){if(!pp(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ne.Component=Dn;ne.Fragment=yk;ne.Profiler=xk;ne.PureComponent=cp;ne.StrictMode=vk;ne.Suspense=bk;ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ak;ne.act=$y;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=Uy({},e.props),o=e.key,n=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(n=t.ref,s=fp.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var i=e.type.defaultProps;for(l in t)qy.call(t,l)&&!Hy.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:Pi,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:wk,_context:e},e.Consumer=e};ne.createElement=zy;ne.createFactory=function(e){var t=zy.bind(null,e);return t.type=e,t};ne.createRef=function(){return{current:null}};ne.forwardRef=function(e){return{$$typeof:Ck,render:e}};ne.isValidElement=pp;ne.lazy=function(e){return{$$typeof:Ik,_payload:{_status:-1,_result:e},_init:_k}};ne.memo=function(e,t){return{$$typeof:Lk,type:e,compare:t===void 0?null:t}};ne.startTransition=function(e){var t=Pu.transition;Pu.transition={};try{e()}finally{Pu.transition=t}};ne.unstable_act=$y;ne.useCallback=function(e,t){return It.current.useCallback(e,t)};ne.useContext=function(e){return It.current.useContext(e)};ne.useDebugValue=function(){};ne.useDeferredValue=function(e){return It.current.useDeferredValue(e)};ne.useEffect=function(e,t){return It.current.useEffect(e,t)};ne.useId=function(){return It.current.useId()};ne.useImperativeHandle=function(e,t,r){return It.current.useImperativeHandle(e,t,r)};ne.useInsertionEffect=function(e,t){return It.current.useInsertionEffect(e,t)};ne.useLayoutEffect=function(e,t){return It.current.useLayoutEffect(e,t)};ne.useMemo=function(e,t){return It.current.useMemo(e,t)};ne.useReducer=function(e,t,r){return It.current.useReducer(e,t,r)};ne.useRef=function(e){return It.current.useRef(e)};ne.useState=function(e){return It.current.useState(e)};ne.useSyncExternalStore=function(e,t,r){return It.current.useSyncExternalStore(e,t,r)};ne.useTransition=function(){return It.current.useTransition()};ne.version="18.3.1"});var Q=ta((WD,Gy)=>{"use strict";Gy.exports=Wy()});var av=ta(we=>{"use strict";function yp(e,t){var r=e.length;e.push(t);e:for(;0<r;){var a=r-1>>>1,o=e[a];if(0<Tu(o,t))e[a]=t,e[r]=o,r=a;else break e}}function xr(e){return e.length===0?null:e[0]}function Au(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>Tu(i,r))l<o&&0>Tu(u,i)?(e[a]=u,e[l]=r,a=l):(e[a]=i,e[s]=r,a=s);else if(l<o&&0>Tu(u,r))e[a]=u,e[l]=r,a=l;else break e}}return t}function Tu(e,t){var r=e.sortIndex-t.sortIndex;return r!==0?r:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(Ky=performance,we.unstable_now=function(){return Ky.now()}):(mp=Date,Xy=mp.now(),we.unstable_now=function(){return mp.now()-Xy});var Ky,mp,Xy,Nr=[],Na=[],Rk=1,lr=null,yt=3,Ru=!1,Eo=!1,_i=!1,Yy=typeof setTimeout=="function"?setTimeout:null,Zy=typeof clearTimeout=="function"?clearTimeout:null,Jy=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function vp(e){for(var t=xr(Na);t!==null;){if(t.callback===null)Au(Na);else if(t.startTime<=e)Au(Na),t.sortIndex=t.expirationTime,yp(Nr,t);else break;t=xr(Na)}}function xp(e){if(_i=!1,vp(e),!Eo)if(xr(Nr)!==null)Eo=!0,Sp(wp);else{var t=xr(Na);t!==null&&Cp(xp,t.startTime-e)}}function wp(e,t){Eo=!1,_i&&(_i=!1,Zy(Ai),Ai=-1),Ru=!0;var r=yt;try{for(vp(t),lr=xr(Nr);lr!==null&&(!(lr.expirationTime>t)||e&&!rv());){var a=lr.callback;if(typeof a=="function"){lr.callback=null,yt=lr.priorityLevel;var o=a(lr.expirationTime<=t);t=we.unstable_now(),typeof o=="function"?lr.callback=o:lr===xr(Nr)&&Au(Nr),vp(t)}else Au(Nr);lr=xr(Nr)}if(lr!==null)var n=!0;else{var s=xr(Na);s!==null&&Cp(xp,s.startTime-t),n=!1}return n}finally{lr=null,yt=r,Ru=!1}}var Eu=!1,_u=null,Ai=-1,ev=5,tv=-1;function rv(){return!(we.unstable_now()-tv<ev)}function hp(){if(_u!==null){var e=we.unstable_now();tv=e;var t=!0;try{t=_u(!0,e)}finally{t?Ti():(Eu=!1,_u=null)}}else Eu=!1}var Ti;typeof Jy=="function"?Ti=function(){Jy(hp)}:typeof MessageChannel<"u"?(gp=new MessageChannel,Qy=gp.port2,gp.port1.onmessage=hp,Ti=function(){Qy.postMessage(null)}):Ti=function(){Yy(hp,0)};var gp,Qy;function Sp(e){_u=e,Eu||(Eu=!0,Ti())}function Cp(e,t){Ai=Yy(function(){e(we.unstable_now())},t)}we.unstable_IdlePriority=5;we.unstable_ImmediatePriority=1;we.unstable_LowPriority=4;we.unstable_NormalPriority=3;we.unstable_Profiling=null;we.unstable_UserBlockingPriority=2;we.unstable_cancelCallback=function(e){e.callback=null};we.unstable_continueExecution=function(){Eo||Ru||(Eo=!0,Sp(wp))};we.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"):ev=0<e?Math.floor(1e3/e):5};we.unstable_getCurrentPriorityLevel=function(){return yt};we.unstable_getFirstCallbackNode=function(){return xr(Nr)};we.unstable_next=function(e){switch(yt){case 1:case 2:case 3:var t=3;break;default:t=yt}var r=yt;yt=t;try{return e()}finally{yt=r}};we.unstable_pauseExecution=function(){};we.unstable_requestPaint=function(){};we.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=yt;yt=e;try{return t()}finally{yt=r}};we.unstable_scheduleCallback=function(e,t,r){var a=we.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:Rk++,callback:t,priorityLevel:e,startTime:r,expirationTime:o,sortIndex:-1},r>a?(e.sortIndex=r,yp(Na,e),xr(Nr)===null&&e===xr(Na)&&(_i?(Zy(Ai),Ai=-1):_i=!0,Cp(xp,r-a))):(e.sortIndex=o,yp(Nr,e),Eo||Ru||(Eo=!0,Sp(wp))),e};we.unstable_shouldYield=rv;we.unstable_wrapCallback=function(e){var t=yt;return function(){var r=yt;yt=t;try{return e.apply(this,arguments)}finally{yt=r}}}});var nv=ta((KD,ov)=>{"use strict";ov.exports=av()});var uw=ta(Jt=>{"use strict";var Ek=Q(),Kt=nv();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 fx=new Set,Yi={};function $o(e,t){es(e,t),es(e+"Capture",t)}function es(e,t){for(Yi[e]=t,e=0;e<t.length;e++)fx.add(t[e])}var ia=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$p=Object.prototype.hasOwnProperty,Dk=/^[: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]*$/,sv={},iv={};function Nk(e){return $p.call(iv,e)?!0:$p.call(sv,e)?!1:Dk.test(e)?iv[e]=!0:(sv[e]=!0,!1)}function Mk(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 Ok(e,t,r,a){if(t===null||typeof t>"u"||Mk(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 Tt(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 ut={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ut[e]=new Tt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ut[t]=new Tt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ut[e]=new Tt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ut[e]=new Tt(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){ut[e]=new Tt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ut[e]=new Tt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ut[e]=new Tt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ut[e]=new Tt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ut[e]=new Tt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Bm=/[\-:]([a-z])/g;function Fm(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(Bm,Fm);ut[t]=new Tt(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(Bm,Fm);ut[t]=new Tt(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(Bm,Fm);ut[t]=new Tt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ut[e]=new Tt(e,1,!1,e.toLowerCase(),null,!1,!1)});ut.xlinkHref=new Tt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ut[e]=new Tt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Um(e,t,r,a){var o=ut.hasOwnProperty(t)?ut[t]:null;(o!==null?o.type!==0:a||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Ok(t,r,o,a)&&(r=null),a||o===null?Nk(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 da=Ek.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Du=Symbol.for("react.element"),On=Symbol.for("react.portal"),Bn=Symbol.for("react.fragment"),Vm=Symbol.for("react.strict_mode"),Wp=Symbol.for("react.profiler"),px=Symbol.for("react.provider"),mx=Symbol.for("react.context"),jm=Symbol.for("react.forward_ref"),Gp=Symbol.for("react.suspense"),Kp=Symbol.for("react.suspense_list"),qm=Symbol.for("react.memo"),Oa=Symbol.for("react.lazy"),hx=Symbol.for("react.offscreen"),lv=Symbol.iterator;function Ri(e){return e===null||typeof e!="object"?null:(e=lv&&e[lv]||e["@@iterator"],typeof e=="function"?e:null)}var De=Object.assign,bp;function Ui(e){if(bp===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);bp=t&&t[1]||""}return`
2
2
  `+bp+e}var Lp=!1;function Ip(e,t){if(!e||Lp)return"";Lp=!0;var r=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 a=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){a=u}e.call(t.prototype)}else{try{throw Error()}catch(u){a=u}e()}}catch(u){if(u&&a&&typeof u.stack=="string"){for(var o=u.stack.split(`
3
3
  `),n=a.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{Lp=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Ui(e):""}function Bk(e){switch(e.tag){case 5:return Ui(e.type);case 16:return Ui("Lazy");case 13:return Ui("Suspense");case 19:return Ui("SuspenseList");case 0:case 2:case 15:return e=Ip(e.type,!1),e;case 11:return e=Ip(e.type.render,!1),e;case 1:return e=Ip(e.type,!0),e;default:return""}}function Xp(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 Bn:return"Fragment";case On:return"Portal";case Wp:return"Profiler";case Vm:return"StrictMode";case Gp:return"Suspense";case Kp:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case mx:return(e.displayName||"Context")+".Consumer";case px:return(e._context.displayName||"Context")+".Provider";case jm:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case qm:return t=e.displayName||null,t!==null?t:Xp(e.type)||"Memo";case Oa:t=e._payload,e=e._init;try{return Xp(e(t))}catch{}}return null}function Fk(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 Xp(t);case 8:return t===Vm?"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 Ja(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function gx(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Uk(e){var t=gx(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 Nu(e){e._valueTracker||(e._valueTracker=Uk(e))}function yx(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),a="";return e&&(a=gx(e)?e.checked?"true":"false":e.value),e=a,e!==r?(t.setValue(e),!0):!1}function lc(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 Jp(e,t){var r=t.checked;return De({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function uv(e,t){var r=t.defaultValue==null?"":t.defaultValue,a=t.checked!=null?t.checked:t.defaultChecked;r=Ja(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 vx(e,t){t=t.checked,t!=null&&Um(e,"checked",t,!1)}function Qp(e,t){vx(e,t);var r=Ja(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")?Yp(e,t.type,r):t.hasOwnProperty("defaultValue")&&Yp(e,t.type,Ja(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function cv(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 Yp(e,t,r){(t!=="number"||lc(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Vi=Array.isArray;function Kn(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=""+Ja(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 Zp(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(R(91));return De({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function dv(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(Vi(r)){if(1<r.length)throw Error(R(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Ja(r)}}function xx(e,t){var r=Ja(t.value),a=Ja(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 fv(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function wx(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 em(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?wx(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Mu,Sx=(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(Mu=Mu||document.createElement("div"),Mu.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Mu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Zi(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Hi={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},Vk=["Webkit","ms","Moz","O"];Object.keys(Hi).forEach(function(e){Vk.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Hi[t]=Hi[e]})});function Cx(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Hi.hasOwnProperty(e)&&Hi[e]?(""+t).trim():t+"px"}function bx(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 jk=De({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 tm(e,t){if(t){if(jk[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 rm(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 am=null;function Hm(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var om=null,Xn=null,Jn=null;function pv(e){if(e=yl(e)){if(typeof om!="function")throw Error(R(280));var t=e.stateNode;t&&(t=Oc(t),om(e.stateNode,e.type,t))}}function Lx(e){Xn?Jn?Jn.push(e):Jn=[e]:Xn=e}function Ix(){if(Xn){var e=Xn,t=Jn;if(Jn=Xn=null,pv(e),t)for(e=0;e<t.length;e++)pv(t[e])}}function kx(e,t){return e(t)}function Px(){}var kp=!1;function Tx(e,t,r){if(kp)return e(t,r);kp=!0;try{return kx(e,t,r)}finally{kp=!1,(Xn!==null||Jn!==null)&&(Px(),Ix())}}function el(e,t){var r=e.stateNode;if(r===null)return null;var a=Oc(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 nm=!1;if(ia)try{Nn={},Object.defineProperty(Nn,"passive",{get:function(){nm=!0}}),window.addEventListener("test",Nn,Nn),window.removeEventListener("test",Nn,Nn)}catch{nm=!1}var Nn;function qk(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 zi=!1,uc=null,cc=!1,sm=null,Hk={onError:function(e){zi=!0,uc=e}};function zk(e,t,r,a,o,n,s,i,l){zi=!1,uc=null,qk.apply(Hk,arguments)}function $k(e,t,r,a,o,n,s,i,l){if(zk.apply(this,arguments),zi){if(zi){var u=uc;zi=!1,uc=null}else throw Error(R(198));cc||(cc=!0,sm=u)}}function Go(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 _x(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 mv(e){if(Go(e)!==e)throw Error(R(188))}function Wk(e){var t=e.alternate;if(!t){if(t=Go(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 mv(o),e;if(n===a)return mv(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 Ax(e){return e=Wk(e),e!==null?Rx(e):null}function Rx(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Rx(e);if(t!==null)return t;e=e.sibling}return null}var Ex=Kt.unstable_scheduleCallback,hv=Kt.unstable_cancelCallback,Gk=Kt.unstable_shouldYield,Kk=Kt.unstable_requestPaint,je=Kt.unstable_now,Xk=Kt.unstable_getCurrentPriorityLevel,zm=Kt.unstable_ImmediatePriority,Dx=Kt.unstable_UserBlockingPriority,dc=Kt.unstable_NormalPriority,Jk=Kt.unstable_LowPriority,Nx=Kt.unstable_IdlePriority,Ec=null,Fr=null;function Qk(e){if(Fr&&typeof Fr.onCommitFiberRoot=="function")try{Fr.onCommitFiberRoot(Ec,e,void 0,(e.current.flags&128)===128)}catch{}}var Lr=Math.clz32?Math.clz32:eP,Yk=Math.log,Zk=Math.LN2;function eP(e){return e>>>=0,e===0?32:31-(Yk(e)/Zk|0)|0}var Ou=64,Bu=4194304;function ji(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 fc(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=ji(i):(n&=s,n!==0&&(a=ji(n)))}else s=r&~o,s!==0?a=ji(s):n!==0&&(a=ji(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-Lr(t),o=1<<r,a|=e[r],t&=~o;return a}function tP(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 rP(e,t){for(var r=e.suspendedLanes,a=e.pingedLanes,o=e.expirationTimes,n=e.pendingLanes;0<n;){var s=31-Lr(n),i=1<<s,l=o[s];l===-1?((i&r)===0||(i&a)!==0)&&(o[s]=tP(i,t)):l<=t&&(e.expiredLanes|=i),n&=~i}}function im(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Mx(){var e=Ou;return Ou<<=1,(Ou&4194240)===0&&(Ou=64),e}function Pp(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function hl(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Lr(t),e[t]=r}function aP(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-Lr(r),n=1<<o;t[o]=0,a[o]=-1,e[o]=-1,r&=~n}}function $m(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var a=31-Lr(r),o=1<<a;o&t|e[a]&t&&(e[a]|=t),r&=~o}}var he=0;function Ox(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Bx,Wm,Fx,Ux,Vx,lm=!1,Fu=[],qa=null,Ha=null,za=null,tl=new Map,rl=new Map,Fa=[],oP="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 gv(e,t){switch(e){case"focusin":case"focusout":qa=null;break;case"dragenter":case"dragleave":Ha=null;break;case"mouseover":case"mouseout":za=null;break;case"pointerover":case"pointerout":tl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":rl.delete(t.pointerId)}}function Ei(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=yl(t),t!==null&&Wm(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function nP(e,t,r,a,o){switch(t){case"focusin":return qa=Ei(qa,e,t,r,a,o),!0;case"dragenter":return Ha=Ei(Ha,e,t,r,a,o),!0;case"mouseover":return za=Ei(za,e,t,r,a,o),!0;case"pointerover":var n=o.pointerId;return tl.set(n,Ei(tl.get(n)||null,e,t,r,a,o)),!0;case"gotpointercapture":return n=o.pointerId,rl.set(n,Ei(rl.get(n)||null,e,t,r,a,o)),!0}return!1}function jx(e){var t=Oo(e.target);if(t!==null){var r=Go(t);if(r!==null){if(t=r.tag,t===13){if(t=_x(r),t!==null){e.blockedOn=t,Vx(e.priority,function(){Fx(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 Yu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=um(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var a=new r.constructor(r.type,r);am=a,r.target.dispatchEvent(a),am=null}else return t=yl(r),t!==null&&Wm(t),e.blockedOn=r,!1;t.shift()}return!0}function yv(e,t,r){Yu(e)&&r.delete(t)}function sP(){lm=!1,qa!==null&&Yu(qa)&&(qa=null),Ha!==null&&Yu(Ha)&&(Ha=null),za!==null&&Yu(za)&&(za=null),tl.forEach(yv),rl.forEach(yv)}function Di(e,t){e.blockedOn===t&&(e.blockedOn=null,lm||(lm=!0,Kt.unstable_scheduleCallback(Kt.unstable_NormalPriority,sP)))}function al(e){function t(o){return Di(o,e)}if(0<Fu.length){Di(Fu[0],e);for(var r=1;r<Fu.length;r++){var a=Fu[r];a.blockedOn===e&&(a.blockedOn=null)}}for(qa!==null&&Di(qa,e),Ha!==null&&Di(Ha,e),za!==null&&Di(za,e),tl.forEach(t),rl.forEach(t),r=0;r<Fa.length;r++)a=Fa[r],a.blockedOn===e&&(a.blockedOn=null);for(;0<Fa.length&&(r=Fa[0],r.blockedOn===null);)jx(r),r.blockedOn===null&&Fa.shift()}var Qn=da.ReactCurrentBatchConfig,pc=!0;function iP(e,t,r,a){var o=he,n=Qn.transition;Qn.transition=null;try{he=1,Gm(e,t,r,a)}finally{he=o,Qn.transition=n}}function lP(e,t,r,a){var o=he,n=Qn.transition;Qn.transition=null;try{he=4,Gm(e,t,r,a)}finally{he=o,Qn.transition=n}}function Gm(e,t,r,a){if(pc){var o=um(e,t,r,a);if(o===null)Np(e,t,a,mc,r),gv(e,a);else if(nP(o,e,t,r,a))a.stopPropagation();else if(gv(e,a),t&4&&-1<oP.indexOf(e)){for(;o!==null;){var n=yl(o);if(n!==null&&Bx(n),n=um(e,t,r,a),n===null&&Np(e,t,a,mc,r),n===o)break;o=n}o!==null&&a.stopPropagation()}else Np(e,t,a,null,r)}}var mc=null;function um(e,t,r,a){if(mc=null,e=Hm(a),e=Oo(e),e!==null)if(t=Go(e),t===null)e=null;else if(r=t.tag,r===13){if(e=_x(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 mc=e,null}function qx(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(Xk()){case zm:return 1;case Dx:return 4;case dc:case Jk:return 16;case Nx:return 536870912;default:return 16}default:return 16}}var Va=null,Km=null,Zu=null;function Hx(){if(Zu)return Zu;var e,t=Km,r=t.length,a,o="value"in Va?Va.value:Va.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 Zu=o.slice(e,1<a?1-a:void 0)}function ec(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 Uu(){return!0}function vv(){return!1}function Xt(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)?Uu:vv,this.isPropagationStopped=vv,this}return De(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=Uu)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Uu)},persist:function(){},isPersistent:Uu}),t}var is={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xm=Xt(is),gl=De({},is,{view:0,detail:0}),uP=Xt(gl),Tp,_p,Ni,Dc=De({},gl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Jm,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!==Ni&&(Ni&&e.type==="mousemove"?(Tp=e.screenX-Ni.screenX,_p=e.screenY-Ni.screenY):_p=Tp=0,Ni=e),Tp)},movementY:function(e){return"movementY"in e?e.movementY:_p}}),xv=Xt(Dc),cP=De({},Dc,{dataTransfer:0}),dP=Xt(cP),fP=De({},gl,{relatedTarget:0}),Ap=Xt(fP),pP=De({},is,{animationName:0,elapsedTime:0,pseudoElement:0}),mP=Xt(pP),hP=De({},is,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),gP=Xt(hP),yP=De({},is,{data:0}),wv=Xt(yP),vP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},xP={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"},wP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function SP(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=wP[e])?!!t[e]:!1}function Jm(){return SP}var CP=De({},gl,{key:function(e){if(e.key){var t=vP[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ec(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?xP[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Jm,charCode:function(e){return e.type==="keypress"?ec(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ec(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),bP=Xt(CP),LP=De({},Dc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sv=Xt(LP),IP=De({},gl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Jm}),kP=Xt(IP),PP=De({},is,{propertyName:0,elapsedTime:0,pseudoElement:0}),TP=Xt(PP),_P=De({},Dc,{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}),AP=Xt(_P),RP=[9,13,27,32],Qm=ia&&"CompositionEvent"in window,$i=null;ia&&"documentMode"in document&&($i=document.documentMode);var EP=ia&&"TextEvent"in window&&!$i,zx=ia&&(!Qm||$i&&8<$i&&11>=$i),Cv=" ",bv=!1;function $x(e,t){switch(e){case"keyup":return RP.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wx(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Fn=!1;function DP(e,t){switch(e){case"compositionend":return Wx(t);case"keypress":return t.which!==32?null:(bv=!0,Cv);case"textInput":return e=t.data,e===Cv&&bv?null:e;default:return null}}function NP(e,t){if(Fn)return e==="compositionend"||!Qm&&$x(e,t)?(e=Hx(),Zu=Km=Va=null,Fn=!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 zx&&t.locale!=="ko"?null:t.data;default:return null}}var MP={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 Lv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!MP[e.type]:t==="textarea"}function Gx(e,t,r,a){Lx(a),t=hc(t,"onChange"),0<t.length&&(r=new Xm("onChange","change",null,r,a),e.push({event:r,listeners:t}))}var Wi=null,ol=null;function OP(e){o0(e,0)}function Nc(e){var t=jn(e);if(yx(t))return e}function BP(e,t){if(e==="change")return t}var Kx=!1;ia&&(ia?(ju="oninput"in document,ju||(Rp=document.createElement("div"),Rp.setAttribute("oninput","return;"),ju=typeof Rp.oninput=="function"),Vu=ju):Vu=!1,Kx=Vu&&(!document.documentMode||9<document.documentMode));var Vu,ju,Rp;function Iv(){Wi&&(Wi.detachEvent("onpropertychange",Xx),ol=Wi=null)}function Xx(e){if(e.propertyName==="value"&&Nc(ol)){var t=[];Gx(t,ol,e,Hm(e)),Tx(OP,t)}}function FP(e,t,r){e==="focusin"?(Iv(),Wi=t,ol=r,Wi.attachEvent("onpropertychange",Xx)):e==="focusout"&&Iv()}function UP(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Nc(ol)}function VP(e,t){if(e==="click")return Nc(t)}function jP(e,t){if(e==="input"||e==="change")return Nc(t)}function qP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kr=typeof Object.is=="function"?Object.is:qP;function nl(e,t){if(kr(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(!$p.call(t,o)||!kr(e[o],t[o]))return!1}return!0}function kv(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Pv(e,t){var r=kv(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=kv(r)}}function Jx(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Jx(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Qx(){for(var e=window,t=lc();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=lc(e.document)}return t}function Ym(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 HP(e){var t=Qx(),r=e.focusedElem,a=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Jx(r.ownerDocument.documentElement,r)){if(a!==null&&Ym(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=Pv(r,n);var s=Pv(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 zP=ia&&"documentMode"in document&&11>=document.documentMode,Un=null,cm=null,Gi=null,dm=!1;function Tv(e,t,r){var a=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;dm||Un==null||Un!==lc(a)||(a=Un,"selectionStart"in a&&Ym(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}),Gi&&nl(Gi,a)||(Gi=a,a=hc(cm,"onSelect"),0<a.length&&(t=new Xm("onSelect","select",null,t,r),e.push({event:t,listeners:a}),t.target=Un)))}function qu(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Vn={animationend:qu("Animation","AnimationEnd"),animationiteration:qu("Animation","AnimationIteration"),animationstart:qu("Animation","AnimationStart"),transitionend:qu("Transition","TransitionEnd")},Ep={},Yx={};ia&&(Yx=document.createElement("div").style,"AnimationEvent"in window||(delete Vn.animationend.animation,delete Vn.animationiteration.animation,delete Vn.animationstart.animation),"TransitionEvent"in window||delete Vn.transitionend.transition);function Mc(e){if(Ep[e])return Ep[e];if(!Vn[e])return e;var t=Vn[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Yx)return Ep[e]=t[r];return e}var Zx=Mc("animationend"),e0=Mc("animationiteration"),t0=Mc("animationstart"),r0=Mc("transitionend"),a0=new Map,_v="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 Ya(e,t){a0.set(e,t),Wo(t,[e])}for(Hu=0;Hu<_v.length;Hu++)zu=_v[Hu],Av=zu.toLowerCase(),Rv=zu[0].toUpperCase()+zu.slice(1),Ya(Av,"on"+Rv);var zu,Av,Rv,Hu;Ya(Zx,"onAnimationEnd");Ya(e0,"onAnimationIteration");Ya(t0,"onAnimationStart");Ya("dblclick","onDoubleClick");Ya("focusin","onFocus");Ya("focusout","onBlur");Ya(r0,"onTransitionEnd");es("onMouseEnter",["mouseout","mouseover"]);es("onMouseLeave",["mouseout","mouseover"]);es("onPointerEnter",["pointerout","pointerover"]);es("onPointerLeave",["pointerout","pointerover"]);Wo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Wo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Wo("onBeforeInput",["compositionend","keypress","textInput","paste"]);Wo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Wo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Wo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qi="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(" "),$P=new Set("cancel close invalid load scroll toggle".split(" ").concat(qi));function Ev(e,t,r){var a=e.type||"unknown-event";e.currentTarget=r,$k(a,t,void 0,e),e.currentTarget=null}function o0(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;Ev(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;Ev(o,i,u),n=l}}}if(cc)throw e=sm,cc=!1,sm=null,e}function Ie(e,t){var r=t[gm];r===void 0&&(r=t[gm]=new Set);var a=e+"__bubble";r.has(a)||(n0(t,e,2,!1),r.add(a))}function Dp(e,t,r){var a=0;t&&(a|=4),n0(r,e,a,t)}var $u="_reactListening"+Math.random().toString(36).slice(2);function sl(e){if(!e[$u]){e[$u]=!0,fx.forEach(function(r){r!=="selectionchange"&&($P.has(r)||Dp(r,!1,e),Dp(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[$u]||(t[$u]=!0,Dp("selectionchange",!1,t))}}function n0(e,t,r,a){switch(qx(t)){case 1:var o=iP;break;case 4:o=lP;break;default:o=Gm}r=o.bind(null,t,r,e),o=void 0,!nm||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 Np(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=Oo(i),s===null)return;if(l=s.tag,l===5||l===6){a=n=s;continue e}i=i.parentNode}}a=a.return}Tx(function(){var u=n,c=Hm(r),d=[];e:{var f=a0.get(e);if(f!==void 0){var h=Xm,v=e;switch(e){case"keypress":if(ec(r)===0)break e;case"keydown":case"keyup":h=bP;break;case"focusin":v="focus",h=Ap;break;case"focusout":v="blur",h=Ap;break;case"beforeblur":case"afterblur":h=Ap;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":h=xv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=dP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=kP;break;case Zx:case e0:case t0:h=mP;break;case r0:h=TP;break;case"scroll":h=uP;break;case"wheel":h=AP;break;case"copy":case"cut":case"paste":h=gP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Sv}var x=(t&4)!==0,C=!x&&e==="scroll",g=x?f!==null?f+"Capture":null:f;x=[];for(var p=u,y;p!==null;){y=p;var b=y.stateNode;if(y.tag===5&&b!==null&&(y=b,g!==null&&(b=el(p,g),b!=null&&x.push(il(p,b,y)))),C)break;p=p.return}0<x.length&&(f=new h(f,v,null,r,c),d.push({event:f,listeners:x}))}}if((t&7)===0){e:{if(f=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",f&&r!==am&&(v=r.relatedTarget||r.fromElement)&&(Oo(v)||v[la]))break e;if((h||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,h?(v=r.relatedTarget||r.toElement,h=u,v=v?Oo(v):null,v!==null&&(C=Go(v),v!==C||v.tag!==5&&v.tag!==6)&&(v=null)):(h=null,v=u),h!==v)){if(x=xv,b="onMouseLeave",g="onMouseEnter",p="mouse",(e==="pointerout"||e==="pointerover")&&(x=Sv,b="onPointerLeave",g="onPointerEnter",p="pointer"),C=h==null?f:jn(h),y=v==null?f:jn(v),f=new x(b,p+"leave",h,r,c),f.target=C,f.relatedTarget=y,b=null,Oo(c)===u&&(x=new x(g,p+"enter",v,r,c),x.target=y,x.relatedTarget=C,b=x),C=b,h&&v)t:{for(x=h,g=v,p=0,y=x;y;y=Mn(y))p++;for(y=0,b=g;b;b=Mn(b))y++;for(;0<p-y;)x=Mn(x),p--;for(;0<y-p;)g=Mn(g),y--;for(;p--;){if(x===g||g!==null&&x===g.alternate)break t;x=Mn(x),g=Mn(g)}x=null}else x=null;h!==null&&Dv(d,f,h,x,!1),v!==null&&C!==null&&Dv(d,C,v,x,!0)}}e:{if(f=u?jn(u):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var L=BP;else if(Lv(f))if(Kx)L=jP;else{L=UP;var P=FP}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(L=VP);if(L&&(L=L(e,u))){Gx(d,L,r,c);break e}P&&P(e,f,u),e==="focusout"&&(P=f._wrapperState)&&P.controlled&&f.type==="number"&&Yp(f,"number",f.value)}switch(P=u?jn(u):window,e){case"focusin":(Lv(P)||P.contentEditable==="true")&&(Un=P,cm=u,Gi=null);break;case"focusout":Gi=cm=Un=null;break;case"mousedown":dm=!0;break;case"contextmenu":case"mouseup":case"dragend":dm=!1,Tv(d,r,c);break;case"selectionchange":if(zP)break;case"keydown":case"keyup":Tv(d,r,c)}var T;if(Qm)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else Fn?$x(e,r)&&(A="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(A="onCompositionStart");A&&(zx&&r.locale!=="ko"&&(Fn||A!=="onCompositionStart"?A==="onCompositionEnd"&&Fn&&(T=Hx()):(Va=c,Km="value"in Va?Va.value:Va.textContent,Fn=!0)),P=hc(u,A),0<P.length&&(A=new wv(A,e,null,r,c),d.push({event:A,listeners:P}),T?A.data=T:(T=Wx(r),T!==null&&(A.data=T)))),(T=EP?DP(e,r):NP(e,r))&&(u=hc(u,"onBeforeInput"),0<u.length&&(c=new wv("onBeforeInput","beforeinput",null,r,c),d.push({event:c,listeners:u}),c.data=T))}o0(d,t)})}function il(e,t,r){return{instance:e,listener:t,currentTarget:r}}function hc(e,t){for(var r=t+"Capture",a=[];e!==null;){var o=e,n=o.stateNode;o.tag===5&&n!==null&&(o=n,n=el(e,r),n!=null&&a.unshift(il(e,n,o)),n=el(e,t),n!=null&&a.push(il(e,n,o))),e=e.return}return a}function Mn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Dv(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=el(r,n),l!=null&&s.unshift(il(r,l,i))):o||(l=el(r,n),l!=null&&s.push(il(r,l,i)))),r=r.return}s.length!==0&&e.push({event:t,listeners:s})}var WP=/\r\n?/g,GP=/\u0000|\uFFFD/g;function Nv(e){return(typeof e=="string"?e:""+e).replace(WP,`
6
- `).replace(GP,"")}function Wu(e,t,r){if(t=Nv(t),Nv(e)!==t&&r)throw Error(R(425))}function gc(){}var fm=null,pm=null;function mm(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 hm=typeof setTimeout=="function"?setTimeout:void 0,KP=typeof clearTimeout=="function"?clearTimeout:void 0,Mv=typeof Promise=="function"?Promise:void 0,XP=typeof queueMicrotask=="function"?queueMicrotask:typeof Mv<"u"?function(e){return Mv.resolve(null).then(e).catch(JP)}:hm;function JP(e){setTimeout(function(){throw e})}function Mp(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),al(t);return}a--}else r!=="$"&&r!=="$?"&&r!=="$!"||a++;r=o}while(r);al(t)}function $a(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 Ov(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 ls=Math.random().toString(36).slice(2),Br="__reactFiber$"+ls,ll="__reactProps$"+ls,la="__reactContainer$"+ls,gm="__reactEvents$"+ls,QP="__reactListeners$"+ls,YP="__reactHandles$"+ls;function Oo(e){var t=e[Br];if(t)return t;for(var r=e.parentNode;r;){if(t=r[la]||r[Br]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Ov(e);e!==null;){if(r=e[Br])return r;e=Ov(e)}return t}e=r,r=e.parentNode}return null}function yl(e){return e=e[Br]||e[la],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function jn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(R(33))}function Oc(e){return e[ll]||null}var ym=[],qn=-1;function Za(e){return{current:e}}function ke(e){0>qn||(e.current=ym[qn],ym[qn]=null,qn--)}function Se(e,t){qn++,ym[qn]=e.current,e.current=t}var Qa={},St=Za(Qa),Nt=Za(!1),jo=Qa;function ts(e,t){var r=e.type.contextTypes;if(!r)return Qa;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 Mt(e){return e=e.childContextTypes,e!=null}function yc(){ke(Nt),ke(St)}function Bv(e,t,r){if(St.current!==Qa)throw Error(R(168));Se(St,t),Se(Nt,r)}function s0(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,Fk(e)||"Unknown",o));return De({},r,a)}function vc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Qa,jo=St.current,Se(St,e),Se(Nt,Nt.current),!0}function Fv(e,t,r){var a=e.stateNode;if(!a)throw Error(R(169));r?(e=s0(e,t,jo),a.__reactInternalMemoizedMergedChildContext=e,ke(Nt),ke(St),Se(St,e)):ke(Nt),Se(Nt,r)}var aa=null,Bc=!1,Op=!1;function i0(e){aa===null?aa=[e]:aa.push(e)}function ZP(e){Bc=!0,i0(e)}function eo(){if(!Op&&aa!==null){Op=!0;var e=0,t=he;try{var r=aa;for(he=1;e<r.length;e++){var a=r[e];do a=a(!0);while(a!==null)}aa=null,Bc=!1}catch(o){throw aa!==null&&(aa=aa.slice(e+1)),Ex(zm,eo),o}finally{he=t,Op=!1}}return null}var Hn=[],zn=0,xc=null,wc=0,ur=[],cr=0,qo=null,oa=1,na="";function No(e,t){Hn[zn++]=wc,Hn[zn++]=xc,xc=e,wc=t}function l0(e,t,r){ur[cr++]=oa,ur[cr++]=na,ur[cr++]=qo,qo=e;var a=oa;e=na;var o=32-Lr(a)-1;a&=~(1<<o),r+=1;var n=32-Lr(t)+o;if(30<n){var s=o-o%5;n=(a&(1<<s)-1).toString(32),a>>=s,o-=s,oa=1<<32-Lr(t)+o|r<<o|a,na=n+e}else oa=1<<n|r<<o|a,na=e}function Zm(e){e.return!==null&&(No(e,1),l0(e,1,0))}function eh(e){for(;e===xc;)xc=Hn[--zn],Hn[zn]=null,wc=Hn[--zn],Hn[zn]=null;for(;e===qo;)qo=ur[--cr],ur[cr]=null,na=ur[--cr],ur[cr]=null,oa=ur[--cr],ur[cr]=null}var Gt=null,Wt=null,Ae=!1,br=null;function u0(e,t){var r=dr(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 Uv(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,Gt=e,Wt=$a(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Gt=e,Wt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=qo!==null?{id:oa,overflow:na}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=dr(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Gt=e,Wt=null,!0):!1;default:return!1}}function vm(e){return(e.mode&1)!==0&&(e.flags&128)===0}function xm(e){if(Ae){var t=Wt;if(t){var r=t;if(!Uv(e,t)){if(vm(e))throw Error(R(418));t=$a(r.nextSibling);var a=Gt;t&&Uv(e,t)?u0(a,r):(e.flags=e.flags&-4097|2,Ae=!1,Gt=e)}}else{if(vm(e))throw Error(R(418));e.flags=e.flags&-4097|2,Ae=!1,Gt=e}}}function Vv(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Gt=e}function Gu(e){if(e!==Gt)return!1;if(!Ae)return Vv(e),Ae=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!mm(e.type,e.memoizedProps)),t&&(t=Wt)){if(vm(e))throw c0(),Error(R(418));for(;t;)u0(e,t),t=$a(t.nextSibling)}if(Vv(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){Wt=$a(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Wt=null}}else Wt=Gt?$a(e.stateNode.nextSibling):null;return!0}function c0(){for(var e=Wt;e;)e=$a(e.nextSibling)}function rs(){Wt=Gt=null,Ae=!1}function th(e){br===null?br=[e]:br.push(e)}var eT=da.ReactCurrentBatchConfig;function Mi(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 Ku(e,t){throw e=Object.prototype.toString.call(t),Error(R(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function jv(e){var t=e._init;return t(e._payload)}function d0(e){function t(g,p){if(e){var y=g.deletions;y===null?(g.deletions=[p],g.flags|=16):y.push(p)}}function r(g,p){if(!e)return null;for(;p!==null;)t(g,p),p=p.sibling;return null}function a(g,p){for(g=new Map;p!==null;)p.key!==null?g.set(p.key,p):g.set(p.index,p),p=p.sibling;return g}function o(g,p){return g=Xa(g,p),g.index=0,g.sibling=null,g}function n(g,p,y){return g.index=y,e?(y=g.alternate,y!==null?(y=y.index,y<p?(g.flags|=2,p):y):(g.flags|=2,p)):(g.flags|=1048576,p)}function s(g){return e&&g.alternate===null&&(g.flags|=2),g}function i(g,p,y,b){return p===null||p.tag!==6?(p=Hp(y,g.mode,b),p.return=g,p):(p=o(p,y),p.return=g,p)}function l(g,p,y,b){var L=y.type;return L===Bn?c(g,p,y.props.children,b,y.key):p!==null&&(p.elementType===L||typeof L=="object"&&L!==null&&L.$$typeof===Oa&&jv(L)===p.type)?(b=o(p,y.props),b.ref=Mi(g,p,y),b.return=g,b):(b=ic(y.type,y.key,y.props,null,g.mode,b),b.ref=Mi(g,p,y),b.return=g,b)}function u(g,p,y,b){return p===null||p.tag!==4||p.stateNode.containerInfo!==y.containerInfo||p.stateNode.implementation!==y.implementation?(p=zp(y,g.mode,b),p.return=g,p):(p=o(p,y.children||[]),p.return=g,p)}function c(g,p,y,b,L){return p===null||p.tag!==7?(p=Vo(y,g.mode,b,L),p.return=g,p):(p=o(p,y),p.return=g,p)}function d(g,p,y){if(typeof p=="string"&&p!==""||typeof p=="number")return p=Hp(""+p,g.mode,y),p.return=g,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case Du:return y=ic(p.type,p.key,p.props,null,g.mode,y),y.ref=Mi(g,null,p),y.return=g,y;case On:return p=zp(p,g.mode,y),p.return=g,p;case Oa:var b=p._init;return d(g,b(p._payload),y)}if(Vi(p)||Ri(p))return p=Vo(p,g.mode,y,null),p.return=g,p;Ku(g,p)}return null}function f(g,p,y,b){var L=p!==null?p.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return L!==null?null:i(g,p,""+y,b);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Du:return y.key===L?l(g,p,y,b):null;case On:return y.key===L?u(g,p,y,b):null;case Oa:return L=y._init,f(g,p,L(y._payload),b)}if(Vi(y)||Ri(y))return L!==null?null:c(g,p,y,b,null);Ku(g,y)}return null}function h(g,p,y,b,L){if(typeof b=="string"&&b!==""||typeof b=="number")return g=g.get(y)||null,i(p,g,""+b,L);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Du:return g=g.get(b.key===null?y:b.key)||null,l(p,g,b,L);case On:return g=g.get(b.key===null?y:b.key)||null,u(p,g,b,L);case Oa:var P=b._init;return h(g,p,y,P(b._payload),L)}if(Vi(b)||Ri(b))return g=g.get(y)||null,c(p,g,b,L,null);Ku(p,b)}return null}function v(g,p,y,b){for(var L=null,P=null,T=p,A=p=0,N=null;T!==null&&A<y.length;A++){T.index>A?(N=T,T=null):N=T.sibling;var j=f(g,T,y[A],b);if(j===null){T===null&&(T=N);break}e&&T&&j.alternate===null&&t(g,T),p=n(j,p,A),P===null?L=j:P.sibling=j,P=j,T=N}if(A===y.length)return r(g,T),Ae&&No(g,A),L;if(T===null){for(;A<y.length;A++)T=d(g,y[A],b),T!==null&&(p=n(T,p,A),P===null?L=T:P.sibling=T,P=T);return Ae&&No(g,A),L}for(T=a(g,T);A<y.length;A++)N=h(T,g,A,y[A],b),N!==null&&(e&&N.alternate!==null&&T.delete(N.key===null?A:N.key),p=n(N,p,A),P===null?L=N:P.sibling=N,P=N);return e&&T.forEach(function(pe){return t(g,pe)}),Ae&&No(g,A),L}function x(g,p,y,b){var L=Ri(y);if(typeof L!="function")throw Error(R(150));if(y=L.call(y),y==null)throw Error(R(151));for(var P=L=null,T=p,A=p=0,N=null,j=y.next();T!==null&&!j.done;A++,j=y.next()){T.index>A?(N=T,T=null):N=T.sibling;var pe=f(g,T,j.value,b);if(pe===null){T===null&&(T=N);break}e&&T&&pe.alternate===null&&t(g,T),p=n(pe,p,A),P===null?L=pe:P.sibling=pe,P=pe,T=N}if(j.done)return r(g,T),Ae&&No(g,A),L;if(T===null){for(;!j.done;A++,j=y.next())j=d(g,j.value,b),j!==null&&(p=n(j,p,A),P===null?L=j:P.sibling=j,P=j);return Ae&&No(g,A),L}for(T=a(g,T);!j.done;A++,j=y.next())j=h(T,g,A,j.value,b),j!==null&&(e&&j.alternate!==null&&T.delete(j.key===null?A:j.key),p=n(j,p,A),P===null?L=j:P.sibling=j,P=j);return e&&T.forEach(function(ee){return t(g,ee)}),Ae&&No(g,A),L}function C(g,p,y,b){if(typeof y=="object"&&y!==null&&y.type===Bn&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Du:e:{for(var L=y.key,P=p;P!==null;){if(P.key===L){if(L=y.type,L===Bn){if(P.tag===7){r(g,P.sibling),p=o(P,y.props.children),p.return=g,g=p;break e}}else if(P.elementType===L||typeof L=="object"&&L!==null&&L.$$typeof===Oa&&jv(L)===P.type){r(g,P.sibling),p=o(P,y.props),p.ref=Mi(g,P,y),p.return=g,g=p;break e}r(g,P);break}else t(g,P);P=P.sibling}y.type===Bn?(p=Vo(y.props.children,g.mode,b,y.key),p.return=g,g=p):(b=ic(y.type,y.key,y.props,null,g.mode,b),b.ref=Mi(g,p,y),b.return=g,g=b)}return s(g);case On:e:{for(P=y.key;p!==null;){if(p.key===P)if(p.tag===4&&p.stateNode.containerInfo===y.containerInfo&&p.stateNode.implementation===y.implementation){r(g,p.sibling),p=o(p,y.children||[]),p.return=g,g=p;break e}else{r(g,p);break}else t(g,p);p=p.sibling}p=zp(y,g.mode,b),p.return=g,g=p}return s(g);case Oa:return P=y._init,C(g,p,P(y._payload),b)}if(Vi(y))return v(g,p,y,b);if(Ri(y))return x(g,p,y,b);Ku(g,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,p!==null&&p.tag===6?(r(g,p.sibling),p=o(p,y),p.return=g,g=p):(r(g,p),p=Hp(y,g.mode,b),p.return=g,g=p),s(g)):r(g,p)}return C}var as=d0(!0),f0=d0(!1),Sc=Za(null),Cc=null,$n=null,rh=null;function ah(){rh=$n=Cc=null}function oh(e){var t=Sc.current;ke(Sc),e._currentValue=t}function wm(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 Yn(e,t){Cc=e,rh=$n=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Dt=!0),e.firstContext=null)}function pr(e){var t=e._currentValue;if(rh!==e)if(e={context:e,memoizedValue:t,next:null},$n===null){if(Cc===null)throw Error(R(308));$n=e,Cc.dependencies={lanes:0,firstContext:e}}else $n=$n.next=e;return t}var Bo=null;function nh(e){Bo===null?Bo=[e]:Bo.push(e)}function p0(e,t,r,a){var o=t.interleaved;return o===null?(r.next=r,nh(t)):(r.next=o.next,o.next=r),t.interleaved=r,ua(e,a)}function ua(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 Ba=!1;function sh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function m0(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 sa(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Wa(e,t,r){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(ce&2)!==0){var o=a.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),a.pending=t,ua(e,r)}return o=a.interleaved,o===null?(t.next=t,nh(a)):(t.next=o.next,o.next=t),a.interleaved=t,ua(e,r)}function tc(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,$m(e,r)}}function qv(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 bc(e,t,r,a){var o=e.updateQueue;Ba=!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,h=i.eventTime;if((a&f)===f){c!==null&&(c=c.next={eventTime:h,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var v=e,x=i;switch(f=t,h=r,x.tag){case 1:if(v=x.payload,typeof v=="function"){d=v.call(h,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(h,d,f):v,f==null)break e;d=De({},d,f);break e;case 2:Ba=!0}}i.callback!==null&&i.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[i]:f.push(i))}else h={eventTime:h,lane:f,tag:i.tag,payload:i.payload,callback:i.callback,next:null},c===null?(u=c=h,l=d):c=c.next=h,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);zo|=s,e.lanes=s,e.memoizedState=d}}function Hv(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 vl={},Ur=Za(vl),ul=Za(vl),cl=Za(vl);function Fo(e){if(e===vl)throw Error(R(174));return e}function ih(e,t){switch(Se(cl,t),Se(ul,e),Se(Ur,vl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:em(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=em(t,e)}ke(Ur),Se(Ur,t)}function os(){ke(Ur),ke(ul),ke(cl)}function h0(e){Fo(cl.current);var t=Fo(Ur.current),r=em(t,e.type);t!==r&&(Se(ul,e),Se(Ur,r))}function lh(e){ul.current===e&&(ke(Ur),ke(ul))}var Re=Za(0);function Lc(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 Bp=[];function uh(){for(var e=0;e<Bp.length;e++)Bp[e]._workInProgressVersionPrimary=null;Bp.length=0}var rc=da.ReactCurrentDispatcher,Fp=da.ReactCurrentBatchConfig,Ho=0,Ee=null,Ke=null,rt=null,Ic=!1,Ki=!1,dl=0,tT=0;function vt(){throw Error(R(321))}function ch(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!kr(e[r],t[r]))return!1;return!0}function dh(e,t,r,a,o,n){if(Ho=n,Ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,rc.current=e===null||e.memoizedState===null?nT:sT,e=r(a,o),Ki){n=0;do{if(Ki=!1,dl=0,25<=n)throw Error(R(301));n+=1,rt=Ke=null,t.updateQueue=null,rc.current=iT,e=r(a,o)}while(Ki)}if(rc.current=kc,t=Ke!==null&&Ke.next!==null,Ho=0,rt=Ke=Ee=null,Ic=!1,t)throw Error(R(300));return e}function fh(){var e=dl!==0;return dl=0,e}function Or(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rt===null?Ee.memoizedState=rt=e:rt=rt.next=e,rt}function mr(){if(Ke===null){var e=Ee.alternate;e=e!==null?e.memoizedState:null}else e=Ke.next;var t=rt===null?Ee.memoizedState:rt.next;if(t!==null)rt=t,Ke=e;else{if(e===null)throw Error(R(310));Ke=e,e={memoizedState:Ke.memoizedState,baseState:Ke.baseState,baseQueue:Ke.baseQueue,queue:Ke.queue,next:null},rt===null?Ee.memoizedState=rt=e:rt=rt.next=e}return rt}function fl(e,t){return typeof t=="function"?t(e):t}function Up(e){var t=mr(),r=t.queue;if(r===null)throw Error(R(311));r.lastRenderedReducer=e;var a=Ke,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((Ho&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,Ee.lanes|=c,zo|=c}u=u.next}while(u!==null&&u!==n);l===null?s=a:l.next=i,kr(a,t.memoizedState)||(Dt=!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,Ee.lanes|=n,zo|=n,o=o.next;while(o!==e)}else o===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Vp(e){var t=mr(),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);kr(n,t.memoizedState)||(Dt=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),r.lastRenderedState=n}return[n,a]}function g0(){}function y0(e,t){var r=Ee,a=mr(),o=t(),n=!kr(a.memoizedState,o);if(n&&(a.memoizedState=o,Dt=!0),a=a.queue,ph(w0.bind(null,r,a,e),[e]),a.getSnapshot!==t||n||rt!==null&&rt.memoizedState.tag&1){if(r.flags|=2048,pl(9,x0.bind(null,r,a,o,t),void 0,null),at===null)throw Error(R(349));(Ho&30)!==0||v0(r,t,o)}return o}function v0(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Ee.updateQueue,t===null?(t={lastEffect:null,stores:null},Ee.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function x0(e,t,r,a){t.value=r,t.getSnapshot=a,S0(t)&&C0(e)}function w0(e,t,r){return r(function(){S0(t)&&C0(e)})}function S0(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!kr(e,r)}catch{return!0}}function C0(e){var t=ua(e,1);t!==null&&Ir(t,e,1,-1)}function zv(e){var t=Or();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:fl,lastRenderedState:e},t.queue=e,e=e.dispatch=oT.bind(null,Ee,e),[t.memoizedState,e]}function pl(e,t,r,a){return e={tag:e,create:t,destroy:r,deps:a,next:null},t=Ee.updateQueue,t===null?(t={lastEffect:null,stores:null},Ee.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 b0(){return mr().memoizedState}function ac(e,t,r,a){var o=Or();Ee.flags|=e,o.memoizedState=pl(1|t,r,void 0,a===void 0?null:a)}function Fc(e,t,r,a){var o=mr();a=a===void 0?null:a;var n=void 0;if(Ke!==null){var s=Ke.memoizedState;if(n=s.destroy,a!==null&&ch(a,s.deps)){o.memoizedState=pl(t,r,n,a);return}}Ee.flags|=e,o.memoizedState=pl(1|t,r,n,a)}function $v(e,t){return ac(8390656,8,e,t)}function ph(e,t){return Fc(2048,8,e,t)}function L0(e,t){return Fc(4,2,e,t)}function I0(e,t){return Fc(4,4,e,t)}function k0(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 P0(e,t,r){return r=r!=null?r.concat([e]):null,Fc(4,4,k0.bind(null,t,e),r)}function mh(){}function T0(e,t){var r=mr();t=t===void 0?null:t;var a=r.memoizedState;return a!==null&&t!==null&&ch(t,a[1])?a[0]:(r.memoizedState=[e,t],e)}function _0(e,t){var r=mr();t=t===void 0?null:t;var a=r.memoizedState;return a!==null&&t!==null&&ch(t,a[1])?a[0]:(e=e(),r.memoizedState=[e,t],e)}function A0(e,t,r){return(Ho&21)===0?(e.baseState&&(e.baseState=!1,Dt=!0),e.memoizedState=r):(kr(r,t)||(r=Mx(),Ee.lanes|=r,zo|=r,e.baseState=!0),t)}function rT(e,t){var r=he;he=r!==0&&4>r?r:4,e(!0);var a=Fp.transition;Fp.transition={};try{e(!1),t()}finally{he=r,Fp.transition=a}}function R0(){return mr().memoizedState}function aT(e,t,r){var a=Ka(e);if(r={lane:a,action:r,hasEagerState:!1,eagerState:null,next:null},E0(e))D0(t,r);else if(r=p0(e,t,r,a),r!==null){var o=Pt();Ir(r,e,a,o),N0(r,t,a)}}function oT(e,t,r){var a=Ka(e),o={lane:a,action:r,hasEagerState:!1,eagerState:null,next:null};if(E0(e))D0(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,kr(i,s)){var l=t.interleaved;l===null?(o.next=o,nh(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}r=p0(e,t,o,a),r!==null&&(o=Pt(),Ir(r,e,a,o),N0(r,t,a))}}function E0(e){var t=e.alternate;return e===Ee||t!==null&&t===Ee}function D0(e,t){Ki=Ic=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function N0(e,t,r){if((r&4194240)!==0){var a=t.lanes;a&=e.pendingLanes,r|=a,t.lanes=r,$m(e,r)}}var kc={readContext:pr,useCallback:vt,useContext:vt,useEffect:vt,useImperativeHandle:vt,useInsertionEffect:vt,useLayoutEffect:vt,useMemo:vt,useReducer:vt,useRef:vt,useState:vt,useDebugValue:vt,useDeferredValue:vt,useTransition:vt,useMutableSource:vt,useSyncExternalStore:vt,useId:vt,unstable_isNewReconciler:!1},nT={readContext:pr,useCallback:function(e,t){return Or().memoizedState=[e,t===void 0?null:t],e},useContext:pr,useEffect:$v,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,ac(4194308,4,k0.bind(null,t,e),r)},useLayoutEffect:function(e,t){return ac(4194308,4,e,t)},useInsertionEffect:function(e,t){return ac(4,2,e,t)},useMemo:function(e,t){var r=Or();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var a=Or();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=aT.bind(null,Ee,e),[a.memoizedState,e]},useRef:function(e){var t=Or();return e={current:e},t.memoizedState=e},useState:zv,useDebugValue:mh,useDeferredValue:function(e){return Or().memoizedState=e},useTransition:function(){var e=zv(!1),t=e[0];return e=rT.bind(null,e[1]),Or().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var a=Ee,o=Or();if(Ae){if(r===void 0)throw Error(R(407));r=r()}else{if(r=t(),at===null)throw Error(R(349));(Ho&30)!==0||v0(a,t,r)}o.memoizedState=r;var n={value:r,getSnapshot:t};return o.queue=n,$v(w0.bind(null,a,n,e),[e]),a.flags|=2048,pl(9,x0.bind(null,a,n,r,t),void 0,null),r},useId:function(){var e=Or(),t=at.identifierPrefix;if(Ae){var r=na,a=oa;r=(a&~(1<<32-Lr(a)-1)).toString(32)+r,t=":"+t+"R"+r,r=dl++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=tT++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},sT={readContext:pr,useCallback:T0,useContext:pr,useEffect:ph,useImperativeHandle:P0,useInsertionEffect:L0,useLayoutEffect:I0,useMemo:_0,useReducer:Up,useRef:b0,useState:function(){return Up(fl)},useDebugValue:mh,useDeferredValue:function(e){var t=mr();return A0(t,Ke.memoizedState,e)},useTransition:function(){var e=Up(fl)[0],t=mr().memoizedState;return[e,t]},useMutableSource:g0,useSyncExternalStore:y0,useId:R0,unstable_isNewReconciler:!1},iT={readContext:pr,useCallback:T0,useContext:pr,useEffect:ph,useImperativeHandle:P0,useInsertionEffect:L0,useLayoutEffect:I0,useMemo:_0,useReducer:Vp,useRef:b0,useState:function(){return Vp(fl)},useDebugValue:mh,useDeferredValue:function(e){var t=mr();return Ke===null?t.memoizedState=e:A0(t,Ke.memoizedState,e)},useTransition:function(){var e=Vp(fl)[0],t=mr().memoizedState;return[e,t]},useMutableSource:g0,useSyncExternalStore:y0,useId:R0,unstable_isNewReconciler:!1};function Sr(e,t){if(e&&e.defaultProps){t=De({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Sm(e,t,r,a){t=e.memoizedState,r=r(a,t),r=r==null?t:De({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Uc={isMounted:function(e){return(e=e._reactInternals)?Go(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var a=Pt(),o=Ka(e),n=sa(a,o);n.payload=t,r!=null&&(n.callback=r),t=Wa(e,n,o),t!==null&&(Ir(t,e,o,a),tc(t,e,o))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var a=Pt(),o=Ka(e),n=sa(a,o);n.tag=1,n.payload=t,r!=null&&(n.callback=r),t=Wa(e,n,o),t!==null&&(Ir(t,e,o,a),tc(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Pt(),a=Ka(e),o=sa(r,a);o.tag=2,t!=null&&(o.callback=t),t=Wa(e,o,a),t!==null&&(Ir(t,e,a,r),tc(t,e,a))}};function Wv(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?!nl(r,a)||!nl(o,n):!0}function M0(e,t,r){var a=!1,o=Qa,n=t.contextType;return typeof n=="object"&&n!==null?n=pr(n):(o=Mt(t)?jo:St.current,a=t.contextTypes,n=(a=a!=null)?ts(e,o):Qa),t=new t(r,n),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Uc,e.stateNode=t,t._reactInternals=e,a&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=n),t}function Gv(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&&Uc.enqueueReplaceState(t,t.state,null)}function Cm(e,t,r,a){var o=e.stateNode;o.props=r,o.state=e.memoizedState,o.refs={},sh(e);var n=t.contextType;typeof n=="object"&&n!==null?o.context=pr(n):(n=Mt(t)?jo:St.current,o.context=ts(e,n)),o.state=e.memoizedState,n=t.getDerivedStateFromProps,typeof n=="function"&&(Sm(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&&Uc.enqueueReplaceState(o,o.state,null),bc(e,r,o,a),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function ns(e,t){try{var r="",a=t;do r+=Bk(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{Lp=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Ui(e):""}function Bk(e){switch(e.tag){case 5:return Ui(e.type);case 16:return Ui("Lazy");case 13:return Ui("Suspense");case 19:return Ui("SuspenseList");case 0:case 2:case 15:return e=Ip(e.type,!1),e;case 11:return e=Ip(e.type.render,!1),e;case 1:return e=Ip(e.type,!0),e;default:return""}}function Xp(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 Bn:return"Fragment";case On:return"Portal";case Wp:return"Profiler";case Vm:return"StrictMode";case Gp:return"Suspense";case Kp:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case mx:return(e.displayName||"Context")+".Consumer";case px:return(e._context.displayName||"Context")+".Provider";case jm:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case qm:return t=e.displayName||null,t!==null?t:Xp(e.type)||"Memo";case Oa:t=e._payload,e=e._init;try{return Xp(e(t))}catch{}}return null}function Fk(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 Xp(t);case 8:return t===Vm?"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 Ja(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function gx(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Uk(e){var t=gx(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 Nu(e){e._valueTracker||(e._valueTracker=Uk(e))}function yx(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),a="";return e&&(a=gx(e)?e.checked?"true":"false":e.value),e=a,e!==r?(t.setValue(e),!0):!1}function lc(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 Jp(e,t){var r=t.checked;return De({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function uv(e,t){var r=t.defaultValue==null?"":t.defaultValue,a=t.checked!=null?t.checked:t.defaultChecked;r=Ja(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 vx(e,t){t=t.checked,t!=null&&Um(e,"checked",t,!1)}function Qp(e,t){vx(e,t);var r=Ja(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")?Yp(e,t.type,r):t.hasOwnProperty("defaultValue")&&Yp(e,t.type,Ja(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function cv(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 Yp(e,t,r){(t!=="number"||lc(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Vi=Array.isArray;function Kn(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=""+Ja(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 Zp(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(R(91));return De({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function dv(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(Vi(r)){if(1<r.length)throw Error(R(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Ja(r)}}function xx(e,t){var r=Ja(t.value),a=Ja(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 fv(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function wx(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 em(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?wx(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Mu,Sx=(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(Mu=Mu||document.createElement("div"),Mu.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Mu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Zi(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Hi={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},Vk=["Webkit","ms","Moz","O"];Object.keys(Hi).forEach(function(e){Vk.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Hi[t]=Hi[e]})});function Cx(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Hi.hasOwnProperty(e)&&Hi[e]?(""+t).trim():t+"px"}function bx(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 jk=De({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 tm(e,t){if(t){if(jk[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 rm(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 am=null;function Hm(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var om=null,Xn=null,Jn=null;function pv(e){if(e=yl(e)){if(typeof om!="function")throw Error(R(280));var t=e.stateNode;t&&(t=Oc(t),om(e.stateNode,e.type,t))}}function Lx(e){Xn?Jn?Jn.push(e):Jn=[e]:Xn=e}function Ix(){if(Xn){var e=Xn,t=Jn;if(Jn=Xn=null,pv(e),t)for(e=0;e<t.length;e++)pv(t[e])}}function kx(e,t){return e(t)}function Px(){}var kp=!1;function Tx(e,t,r){if(kp)return e(t,r);kp=!0;try{return kx(e,t,r)}finally{kp=!1,(Xn!==null||Jn!==null)&&(Px(),Ix())}}function el(e,t){var r=e.stateNode;if(r===null)return null;var a=Oc(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 nm=!1;if(ia)try{Nn={},Object.defineProperty(Nn,"passive",{get:function(){nm=!0}}),window.addEventListener("test",Nn,Nn),window.removeEventListener("test",Nn,Nn)}catch{nm=!1}var Nn;function qk(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 zi=!1,uc=null,cc=!1,sm=null,Hk={onError:function(e){zi=!0,uc=e}};function zk(e,t,r,a,o,n,s,i,l){zi=!1,uc=null,qk.apply(Hk,arguments)}function $k(e,t,r,a,o,n,s,i,l){if(zk.apply(this,arguments),zi){if(zi){var u=uc;zi=!1,uc=null}else throw Error(R(198));cc||(cc=!0,sm=u)}}function Wo(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 _x(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 mv(e){if(Wo(e)!==e)throw Error(R(188))}function Wk(e){var t=e.alternate;if(!t){if(t=Wo(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 mv(o),e;if(n===a)return mv(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 Ax(e){return e=Wk(e),e!==null?Rx(e):null}function Rx(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Rx(e);if(t!==null)return t;e=e.sibling}return null}var Ex=Kt.unstable_scheduleCallback,hv=Kt.unstable_cancelCallback,Gk=Kt.unstable_shouldYield,Kk=Kt.unstable_requestPaint,je=Kt.unstable_now,Xk=Kt.unstable_getCurrentPriorityLevel,zm=Kt.unstable_ImmediatePriority,Dx=Kt.unstable_UserBlockingPriority,dc=Kt.unstable_NormalPriority,Jk=Kt.unstable_LowPriority,Nx=Kt.unstable_IdlePriority,Ec=null,Fr=null;function Qk(e){if(Fr&&typeof Fr.onCommitFiberRoot=="function")try{Fr.onCommitFiberRoot(Ec,e,void 0,(e.current.flags&128)===128)}catch{}}var Lr=Math.clz32?Math.clz32:eP,Yk=Math.log,Zk=Math.LN2;function eP(e){return e>>>=0,e===0?32:31-(Yk(e)/Zk|0)|0}var Ou=64,Bu=4194304;function ji(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 fc(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=ji(i):(n&=s,n!==0&&(a=ji(n)))}else s=r&~o,s!==0?a=ji(s):n!==0&&(a=ji(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-Lr(t),o=1<<r,a|=e[r],t&=~o;return a}function tP(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 rP(e,t){for(var r=e.suspendedLanes,a=e.pingedLanes,o=e.expirationTimes,n=e.pendingLanes;0<n;){var s=31-Lr(n),i=1<<s,l=o[s];l===-1?((i&r)===0||(i&a)!==0)&&(o[s]=tP(i,t)):l<=t&&(e.expiredLanes|=i),n&=~i}}function im(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Mx(){var e=Ou;return Ou<<=1,(Ou&4194240)===0&&(Ou=64),e}function Pp(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function hl(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Lr(t),e[t]=r}function aP(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-Lr(r),n=1<<o;t[o]=0,a[o]=-1,e[o]=-1,r&=~n}}function $m(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var a=31-Lr(r),o=1<<a;o&t|e[a]&t&&(e[a]|=t),r&=~o}}var he=0;function Ox(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Bx,Wm,Fx,Ux,Vx,lm=!1,Fu=[],qa=null,Ha=null,za=null,tl=new Map,rl=new Map,Fa=[],oP="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 gv(e,t){switch(e){case"focusin":case"focusout":qa=null;break;case"dragenter":case"dragleave":Ha=null;break;case"mouseover":case"mouseout":za=null;break;case"pointerover":case"pointerout":tl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":rl.delete(t.pointerId)}}function Ei(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=yl(t),t!==null&&Wm(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function nP(e,t,r,a,o){switch(t){case"focusin":return qa=Ei(qa,e,t,r,a,o),!0;case"dragenter":return Ha=Ei(Ha,e,t,r,a,o),!0;case"mouseover":return za=Ei(za,e,t,r,a,o),!0;case"pointerover":var n=o.pointerId;return tl.set(n,Ei(tl.get(n)||null,e,t,r,a,o)),!0;case"gotpointercapture":return n=o.pointerId,rl.set(n,Ei(rl.get(n)||null,e,t,r,a,o)),!0}return!1}function jx(e){var t=Mo(e.target);if(t!==null){var r=Wo(t);if(r!==null){if(t=r.tag,t===13){if(t=_x(r),t!==null){e.blockedOn=t,Vx(e.priority,function(){Fx(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 Yu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=um(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var a=new r.constructor(r.type,r);am=a,r.target.dispatchEvent(a),am=null}else return t=yl(r),t!==null&&Wm(t),e.blockedOn=r,!1;t.shift()}return!0}function yv(e,t,r){Yu(e)&&r.delete(t)}function sP(){lm=!1,qa!==null&&Yu(qa)&&(qa=null),Ha!==null&&Yu(Ha)&&(Ha=null),za!==null&&Yu(za)&&(za=null),tl.forEach(yv),rl.forEach(yv)}function Di(e,t){e.blockedOn===t&&(e.blockedOn=null,lm||(lm=!0,Kt.unstable_scheduleCallback(Kt.unstable_NormalPriority,sP)))}function al(e){function t(o){return Di(o,e)}if(0<Fu.length){Di(Fu[0],e);for(var r=1;r<Fu.length;r++){var a=Fu[r];a.blockedOn===e&&(a.blockedOn=null)}}for(qa!==null&&Di(qa,e),Ha!==null&&Di(Ha,e),za!==null&&Di(za,e),tl.forEach(t),rl.forEach(t),r=0;r<Fa.length;r++)a=Fa[r],a.blockedOn===e&&(a.blockedOn=null);for(;0<Fa.length&&(r=Fa[0],r.blockedOn===null);)jx(r),r.blockedOn===null&&Fa.shift()}var Qn=da.ReactCurrentBatchConfig,pc=!0;function iP(e,t,r,a){var o=he,n=Qn.transition;Qn.transition=null;try{he=1,Gm(e,t,r,a)}finally{he=o,Qn.transition=n}}function lP(e,t,r,a){var o=he,n=Qn.transition;Qn.transition=null;try{he=4,Gm(e,t,r,a)}finally{he=o,Qn.transition=n}}function Gm(e,t,r,a){if(pc){var o=um(e,t,r,a);if(o===null)Np(e,t,a,mc,r),gv(e,a);else if(nP(o,e,t,r,a))a.stopPropagation();else if(gv(e,a),t&4&&-1<oP.indexOf(e)){for(;o!==null;){var n=yl(o);if(n!==null&&Bx(n),n=um(e,t,r,a),n===null&&Np(e,t,a,mc,r),n===o)break;o=n}o!==null&&a.stopPropagation()}else Np(e,t,a,null,r)}}var mc=null;function um(e,t,r,a){if(mc=null,e=Hm(a),e=Mo(e),e!==null)if(t=Wo(e),t===null)e=null;else if(r=t.tag,r===13){if(e=_x(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 mc=e,null}function qx(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(Xk()){case zm:return 1;case Dx:return 4;case dc:case Jk:return 16;case Nx:return 536870912;default:return 16}default:return 16}}var Va=null,Km=null,Zu=null;function Hx(){if(Zu)return Zu;var e,t=Km,r=t.length,a,o="value"in Va?Va.value:Va.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 Zu=o.slice(e,1<a?1-a:void 0)}function ec(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 Uu(){return!0}function vv(){return!1}function Xt(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)?Uu:vv,this.isPropagationStopped=vv,this}return De(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=Uu)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Uu)},persist:function(){},isPersistent:Uu}),t}var is={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xm=Xt(is),gl=De({},is,{view:0,detail:0}),uP=Xt(gl),Tp,_p,Ni,Dc=De({},gl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Jm,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!==Ni&&(Ni&&e.type==="mousemove"?(Tp=e.screenX-Ni.screenX,_p=e.screenY-Ni.screenY):_p=Tp=0,Ni=e),Tp)},movementY:function(e){return"movementY"in e?e.movementY:_p}}),xv=Xt(Dc),cP=De({},Dc,{dataTransfer:0}),dP=Xt(cP),fP=De({},gl,{relatedTarget:0}),Ap=Xt(fP),pP=De({},is,{animationName:0,elapsedTime:0,pseudoElement:0}),mP=Xt(pP),hP=De({},is,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),gP=Xt(hP),yP=De({},is,{data:0}),wv=Xt(yP),vP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},xP={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"},wP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function SP(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=wP[e])?!!t[e]:!1}function Jm(){return SP}var CP=De({},gl,{key:function(e){if(e.key){var t=vP[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ec(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?xP[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Jm,charCode:function(e){return e.type==="keypress"?ec(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ec(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),bP=Xt(CP),LP=De({},Dc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sv=Xt(LP),IP=De({},gl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Jm}),kP=Xt(IP),PP=De({},is,{propertyName:0,elapsedTime:0,pseudoElement:0}),TP=Xt(PP),_P=De({},Dc,{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}),AP=Xt(_P),RP=[9,13,27,32],Qm=ia&&"CompositionEvent"in window,$i=null;ia&&"documentMode"in document&&($i=document.documentMode);var EP=ia&&"TextEvent"in window&&!$i,zx=ia&&(!Qm||$i&&8<$i&&11>=$i),Cv=" ",bv=!1;function $x(e,t){switch(e){case"keyup":return RP.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wx(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Fn=!1;function DP(e,t){switch(e){case"compositionend":return Wx(t);case"keypress":return t.which!==32?null:(bv=!0,Cv);case"textInput":return e=t.data,e===Cv&&bv?null:e;default:return null}}function NP(e,t){if(Fn)return e==="compositionend"||!Qm&&$x(e,t)?(e=Hx(),Zu=Km=Va=null,Fn=!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 zx&&t.locale!=="ko"?null:t.data;default:return null}}var MP={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 Lv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!MP[e.type]:t==="textarea"}function Gx(e,t,r,a){Lx(a),t=hc(t,"onChange"),0<t.length&&(r=new Xm("onChange","change",null,r,a),e.push({event:r,listeners:t}))}var Wi=null,ol=null;function OP(e){o0(e,0)}function Nc(e){var t=jn(e);if(yx(t))return e}function BP(e,t){if(e==="change")return t}var Kx=!1;ia&&(ia?(ju="oninput"in document,ju||(Rp=document.createElement("div"),Rp.setAttribute("oninput","return;"),ju=typeof Rp.oninput=="function"),Vu=ju):Vu=!1,Kx=Vu&&(!document.documentMode||9<document.documentMode));var Vu,ju,Rp;function Iv(){Wi&&(Wi.detachEvent("onpropertychange",Xx),ol=Wi=null)}function Xx(e){if(e.propertyName==="value"&&Nc(ol)){var t=[];Gx(t,ol,e,Hm(e)),Tx(OP,t)}}function FP(e,t,r){e==="focusin"?(Iv(),Wi=t,ol=r,Wi.attachEvent("onpropertychange",Xx)):e==="focusout"&&Iv()}function UP(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Nc(ol)}function VP(e,t){if(e==="click")return Nc(t)}function jP(e,t){if(e==="input"||e==="change")return Nc(t)}function qP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kr=typeof Object.is=="function"?Object.is:qP;function nl(e,t){if(kr(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(!$p.call(t,o)||!kr(e[o],t[o]))return!1}return!0}function kv(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Pv(e,t){var r=kv(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=kv(r)}}function Jx(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Jx(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Qx(){for(var e=window,t=lc();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=lc(e.document)}return t}function Ym(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 HP(e){var t=Qx(),r=e.focusedElem,a=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Jx(r.ownerDocument.documentElement,r)){if(a!==null&&Ym(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=Pv(r,n);var s=Pv(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 zP=ia&&"documentMode"in document&&11>=document.documentMode,Un=null,cm=null,Gi=null,dm=!1;function Tv(e,t,r){var a=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;dm||Un==null||Un!==lc(a)||(a=Un,"selectionStart"in a&&Ym(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}),Gi&&nl(Gi,a)||(Gi=a,a=hc(cm,"onSelect"),0<a.length&&(t=new Xm("onSelect","select",null,t,r),e.push({event:t,listeners:a}),t.target=Un)))}function qu(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Vn={animationend:qu("Animation","AnimationEnd"),animationiteration:qu("Animation","AnimationIteration"),animationstart:qu("Animation","AnimationStart"),transitionend:qu("Transition","TransitionEnd")},Ep={},Yx={};ia&&(Yx=document.createElement("div").style,"AnimationEvent"in window||(delete Vn.animationend.animation,delete Vn.animationiteration.animation,delete Vn.animationstart.animation),"TransitionEvent"in window||delete Vn.transitionend.transition);function Mc(e){if(Ep[e])return Ep[e];if(!Vn[e])return e;var t=Vn[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Yx)return Ep[e]=t[r];return e}var Zx=Mc("animationend"),e0=Mc("animationiteration"),t0=Mc("animationstart"),r0=Mc("transitionend"),a0=new Map,_v="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 Ya(e,t){a0.set(e,t),$o(t,[e])}for(Hu=0;Hu<_v.length;Hu++)zu=_v[Hu],Av=zu.toLowerCase(),Rv=zu[0].toUpperCase()+zu.slice(1),Ya(Av,"on"+Rv);var zu,Av,Rv,Hu;Ya(Zx,"onAnimationEnd");Ya(e0,"onAnimationIteration");Ya(t0,"onAnimationStart");Ya("dblclick","onDoubleClick");Ya("focusin","onFocus");Ya("focusout","onBlur");Ya(r0,"onTransitionEnd");es("onMouseEnter",["mouseout","mouseover"]);es("onMouseLeave",["mouseout","mouseover"]);es("onPointerEnter",["pointerout","pointerover"]);es("onPointerLeave",["pointerout","pointerover"]);$o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));$o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));$o("onBeforeInput",["compositionend","keypress","textInput","paste"]);$o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));$o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));$o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qi="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(" "),$P=new Set("cancel close invalid load scroll toggle".split(" ").concat(qi));function Ev(e,t,r){var a=e.type||"unknown-event";e.currentTarget=r,$k(a,t,void 0,e),e.currentTarget=null}function o0(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;Ev(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;Ev(o,i,u),n=l}}}if(cc)throw e=sm,cc=!1,sm=null,e}function Ie(e,t){var r=t[gm];r===void 0&&(r=t[gm]=new Set);var a=e+"__bubble";r.has(a)||(n0(t,e,2,!1),r.add(a))}function Dp(e,t,r){var a=0;t&&(a|=4),n0(r,e,a,t)}var $u="_reactListening"+Math.random().toString(36).slice(2);function sl(e){if(!e[$u]){e[$u]=!0,fx.forEach(function(r){r!=="selectionchange"&&($P.has(r)||Dp(r,!1,e),Dp(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[$u]||(t[$u]=!0,Dp("selectionchange",!1,t))}}function n0(e,t,r,a){switch(qx(t)){case 1:var o=iP;break;case 4:o=lP;break;default:o=Gm}r=o.bind(null,t,r,e),o=void 0,!nm||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 Np(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=Mo(i),s===null)return;if(l=s.tag,l===5||l===6){a=n=s;continue e}i=i.parentNode}}a=a.return}Tx(function(){var u=n,c=Hm(r),d=[];e:{var f=a0.get(e);if(f!==void 0){var h=Xm,v=e;switch(e){case"keypress":if(ec(r)===0)break e;case"keydown":case"keyup":h=bP;break;case"focusin":v="focus",h=Ap;break;case"focusout":v="blur",h=Ap;break;case"beforeblur":case"afterblur":h=Ap;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":h=xv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=dP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=kP;break;case Zx:case e0:case t0:h=mP;break;case r0:h=TP;break;case"scroll":h=uP;break;case"wheel":h=AP;break;case"copy":case"cut":case"paste":h=gP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Sv}var x=(t&4)!==0,C=!x&&e==="scroll",g=x?f!==null?f+"Capture":null:f;x=[];for(var p=u,y;p!==null;){y=p;var b=y.stateNode;if(y.tag===5&&b!==null&&(y=b,g!==null&&(b=el(p,g),b!=null&&x.push(il(p,b,y)))),C)break;p=p.return}0<x.length&&(f=new h(f,v,null,r,c),d.push({event:f,listeners:x}))}}if((t&7)===0){e:{if(f=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",f&&r!==am&&(v=r.relatedTarget||r.fromElement)&&(Mo(v)||v[la]))break e;if((h||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,h?(v=r.relatedTarget||r.toElement,h=u,v=v?Mo(v):null,v!==null&&(C=Wo(v),v!==C||v.tag!==5&&v.tag!==6)&&(v=null)):(h=null,v=u),h!==v)){if(x=xv,b="onMouseLeave",g="onMouseEnter",p="mouse",(e==="pointerout"||e==="pointerover")&&(x=Sv,b="onPointerLeave",g="onPointerEnter",p="pointer"),C=h==null?f:jn(h),y=v==null?f:jn(v),f=new x(b,p+"leave",h,r,c),f.target=C,f.relatedTarget=y,b=null,Mo(c)===u&&(x=new x(g,p+"enter",v,r,c),x.target=y,x.relatedTarget=C,b=x),C=b,h&&v)t:{for(x=h,g=v,p=0,y=x;y;y=Mn(y))p++;for(y=0,b=g;b;b=Mn(b))y++;for(;0<p-y;)x=Mn(x),p--;for(;0<y-p;)g=Mn(g),y--;for(;p--;){if(x===g||g!==null&&x===g.alternate)break t;x=Mn(x),g=Mn(g)}x=null}else x=null;h!==null&&Dv(d,f,h,x,!1),v!==null&&C!==null&&Dv(d,C,v,x,!0)}}e:{if(f=u?jn(u):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var L=BP;else if(Lv(f))if(Kx)L=jP;else{L=UP;var P=FP}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(L=VP);if(L&&(L=L(e,u))){Gx(d,L,r,c);break e}P&&P(e,f,u),e==="focusout"&&(P=f._wrapperState)&&P.controlled&&f.type==="number"&&Yp(f,"number",f.value)}switch(P=u?jn(u):window,e){case"focusin":(Lv(P)||P.contentEditable==="true")&&(Un=P,cm=u,Gi=null);break;case"focusout":Gi=cm=Un=null;break;case"mousedown":dm=!0;break;case"contextmenu":case"mouseup":case"dragend":dm=!1,Tv(d,r,c);break;case"selectionchange":if(zP)break;case"keydown":case"keyup":Tv(d,r,c)}var T;if(Qm)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else Fn?$x(e,r)&&(A="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(A="onCompositionStart");A&&(zx&&r.locale!=="ko"&&(Fn||A!=="onCompositionStart"?A==="onCompositionEnd"&&Fn&&(T=Hx()):(Va=c,Km="value"in Va?Va.value:Va.textContent,Fn=!0)),P=hc(u,A),0<P.length&&(A=new wv(A,e,null,r,c),d.push({event:A,listeners:P}),T?A.data=T:(T=Wx(r),T!==null&&(A.data=T)))),(T=EP?DP(e,r):NP(e,r))&&(u=hc(u,"onBeforeInput"),0<u.length&&(c=new wv("onBeforeInput","beforeinput",null,r,c),d.push({event:c,listeners:u}),c.data=T))}o0(d,t)})}function il(e,t,r){return{instance:e,listener:t,currentTarget:r}}function hc(e,t){for(var r=t+"Capture",a=[];e!==null;){var o=e,n=o.stateNode;o.tag===5&&n!==null&&(o=n,n=el(e,r),n!=null&&a.unshift(il(e,n,o)),n=el(e,t),n!=null&&a.push(il(e,n,o))),e=e.return}return a}function Mn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Dv(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=el(r,n),l!=null&&s.unshift(il(r,l,i))):o||(l=el(r,n),l!=null&&s.push(il(r,l,i)))),r=r.return}s.length!==0&&e.push({event:t,listeners:s})}var WP=/\r\n?/g,GP=/\u0000|\uFFFD/g;function Nv(e){return(typeof e=="string"?e:""+e).replace(WP,`
6
+ `).replace(GP,"")}function Wu(e,t,r){if(t=Nv(t),Nv(e)!==t&&r)throw Error(R(425))}function gc(){}var fm=null,pm=null;function mm(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 hm=typeof setTimeout=="function"?setTimeout:void 0,KP=typeof clearTimeout=="function"?clearTimeout:void 0,Mv=typeof Promise=="function"?Promise:void 0,XP=typeof queueMicrotask=="function"?queueMicrotask:typeof Mv<"u"?function(e){return Mv.resolve(null).then(e).catch(JP)}:hm;function JP(e){setTimeout(function(){throw e})}function Mp(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),al(t);return}a--}else r!=="$"&&r!=="$?"&&r!=="$!"||a++;r=o}while(r);al(t)}function $a(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 Ov(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 ls=Math.random().toString(36).slice(2),Br="__reactFiber$"+ls,ll="__reactProps$"+ls,la="__reactContainer$"+ls,gm="__reactEvents$"+ls,QP="__reactListeners$"+ls,YP="__reactHandles$"+ls;function Mo(e){var t=e[Br];if(t)return t;for(var r=e.parentNode;r;){if(t=r[la]||r[Br]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Ov(e);e!==null;){if(r=e[Br])return r;e=Ov(e)}return t}e=r,r=e.parentNode}return null}function yl(e){return e=e[Br]||e[la],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function jn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(R(33))}function Oc(e){return e[ll]||null}var ym=[],qn=-1;function Za(e){return{current:e}}function ke(e){0>qn||(e.current=ym[qn],ym[qn]=null,qn--)}function Se(e,t){qn++,ym[qn]=e.current,e.current=t}var Qa={},St=Za(Qa),Nt=Za(!1),Vo=Qa;function ts(e,t){var r=e.type.contextTypes;if(!r)return Qa;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 Mt(e){return e=e.childContextTypes,e!=null}function yc(){ke(Nt),ke(St)}function Bv(e,t,r){if(St.current!==Qa)throw Error(R(168));Se(St,t),Se(Nt,r)}function s0(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,Fk(e)||"Unknown",o));return De({},r,a)}function vc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Qa,Vo=St.current,Se(St,e),Se(Nt,Nt.current),!0}function Fv(e,t,r){var a=e.stateNode;if(!a)throw Error(R(169));r?(e=s0(e,t,Vo),a.__reactInternalMemoizedMergedChildContext=e,ke(Nt),ke(St),Se(St,e)):ke(Nt),Se(Nt,r)}var aa=null,Bc=!1,Op=!1;function i0(e){aa===null?aa=[e]:aa.push(e)}function ZP(e){Bc=!0,i0(e)}function eo(){if(!Op&&aa!==null){Op=!0;var e=0,t=he;try{var r=aa;for(he=1;e<r.length;e++){var a=r[e];do a=a(!0);while(a!==null)}aa=null,Bc=!1}catch(o){throw aa!==null&&(aa=aa.slice(e+1)),Ex(zm,eo),o}finally{he=t,Op=!1}}return null}var Hn=[],zn=0,xc=null,wc=0,ur=[],cr=0,jo=null,oa=1,na="";function Do(e,t){Hn[zn++]=wc,Hn[zn++]=xc,xc=e,wc=t}function l0(e,t,r){ur[cr++]=oa,ur[cr++]=na,ur[cr++]=jo,jo=e;var a=oa;e=na;var o=32-Lr(a)-1;a&=~(1<<o),r+=1;var n=32-Lr(t)+o;if(30<n){var s=o-o%5;n=(a&(1<<s)-1).toString(32),a>>=s,o-=s,oa=1<<32-Lr(t)+o|r<<o|a,na=n+e}else oa=1<<n|r<<o|a,na=e}function Zm(e){e.return!==null&&(Do(e,1),l0(e,1,0))}function eh(e){for(;e===xc;)xc=Hn[--zn],Hn[zn]=null,wc=Hn[--zn],Hn[zn]=null;for(;e===jo;)jo=ur[--cr],ur[cr]=null,na=ur[--cr],ur[cr]=null,oa=ur[--cr],ur[cr]=null}var Gt=null,Wt=null,Ae=!1,br=null;function u0(e,t){var r=dr(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 Uv(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,Gt=e,Wt=$a(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Gt=e,Wt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=jo!==null?{id:oa,overflow:na}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=dr(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Gt=e,Wt=null,!0):!1;default:return!1}}function vm(e){return(e.mode&1)!==0&&(e.flags&128)===0}function xm(e){if(Ae){var t=Wt;if(t){var r=t;if(!Uv(e,t)){if(vm(e))throw Error(R(418));t=$a(r.nextSibling);var a=Gt;t&&Uv(e,t)?u0(a,r):(e.flags=e.flags&-4097|2,Ae=!1,Gt=e)}}else{if(vm(e))throw Error(R(418));e.flags=e.flags&-4097|2,Ae=!1,Gt=e}}}function Vv(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Gt=e}function Gu(e){if(e!==Gt)return!1;if(!Ae)return Vv(e),Ae=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!mm(e.type,e.memoizedProps)),t&&(t=Wt)){if(vm(e))throw c0(),Error(R(418));for(;t;)u0(e,t),t=$a(t.nextSibling)}if(Vv(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){Wt=$a(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Wt=null}}else Wt=Gt?$a(e.stateNode.nextSibling):null;return!0}function c0(){for(var e=Wt;e;)e=$a(e.nextSibling)}function rs(){Wt=Gt=null,Ae=!1}function th(e){br===null?br=[e]:br.push(e)}var eT=da.ReactCurrentBatchConfig;function Mi(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 Ku(e,t){throw e=Object.prototype.toString.call(t),Error(R(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function jv(e){var t=e._init;return t(e._payload)}function d0(e){function t(g,p){if(e){var y=g.deletions;y===null?(g.deletions=[p],g.flags|=16):y.push(p)}}function r(g,p){if(!e)return null;for(;p!==null;)t(g,p),p=p.sibling;return null}function a(g,p){for(g=new Map;p!==null;)p.key!==null?g.set(p.key,p):g.set(p.index,p),p=p.sibling;return g}function o(g,p){return g=Xa(g,p),g.index=0,g.sibling=null,g}function n(g,p,y){return g.index=y,e?(y=g.alternate,y!==null?(y=y.index,y<p?(g.flags|=2,p):y):(g.flags|=2,p)):(g.flags|=1048576,p)}function s(g){return e&&g.alternate===null&&(g.flags|=2),g}function i(g,p,y,b){return p===null||p.tag!==6?(p=Hp(y,g.mode,b),p.return=g,p):(p=o(p,y),p.return=g,p)}function l(g,p,y,b){var L=y.type;return L===Bn?c(g,p,y.props.children,b,y.key):p!==null&&(p.elementType===L||typeof L=="object"&&L!==null&&L.$$typeof===Oa&&jv(L)===p.type)?(b=o(p,y.props),b.ref=Mi(g,p,y),b.return=g,b):(b=ic(y.type,y.key,y.props,null,g.mode,b),b.ref=Mi(g,p,y),b.return=g,b)}function u(g,p,y,b){return p===null||p.tag!==4||p.stateNode.containerInfo!==y.containerInfo||p.stateNode.implementation!==y.implementation?(p=zp(y,g.mode,b),p.return=g,p):(p=o(p,y.children||[]),p.return=g,p)}function c(g,p,y,b,L){return p===null||p.tag!==7?(p=Uo(y,g.mode,b,L),p.return=g,p):(p=o(p,y),p.return=g,p)}function d(g,p,y){if(typeof p=="string"&&p!==""||typeof p=="number")return p=Hp(""+p,g.mode,y),p.return=g,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case Du:return y=ic(p.type,p.key,p.props,null,g.mode,y),y.ref=Mi(g,null,p),y.return=g,y;case On:return p=zp(p,g.mode,y),p.return=g,p;case Oa:var b=p._init;return d(g,b(p._payload),y)}if(Vi(p)||Ri(p))return p=Uo(p,g.mode,y,null),p.return=g,p;Ku(g,p)}return null}function f(g,p,y,b){var L=p!==null?p.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return L!==null?null:i(g,p,""+y,b);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Du:return y.key===L?l(g,p,y,b):null;case On:return y.key===L?u(g,p,y,b):null;case Oa:return L=y._init,f(g,p,L(y._payload),b)}if(Vi(y)||Ri(y))return L!==null?null:c(g,p,y,b,null);Ku(g,y)}return null}function h(g,p,y,b,L){if(typeof b=="string"&&b!==""||typeof b=="number")return g=g.get(y)||null,i(p,g,""+b,L);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Du:return g=g.get(b.key===null?y:b.key)||null,l(p,g,b,L);case On:return g=g.get(b.key===null?y:b.key)||null,u(p,g,b,L);case Oa:var P=b._init;return h(g,p,y,P(b._payload),L)}if(Vi(b)||Ri(b))return g=g.get(y)||null,c(p,g,b,L,null);Ku(p,b)}return null}function v(g,p,y,b){for(var L=null,P=null,T=p,A=p=0,N=null;T!==null&&A<y.length;A++){T.index>A?(N=T,T=null):N=T.sibling;var j=f(g,T,y[A],b);if(j===null){T===null&&(T=N);break}e&&T&&j.alternate===null&&t(g,T),p=n(j,p,A),P===null?L=j:P.sibling=j,P=j,T=N}if(A===y.length)return r(g,T),Ae&&Do(g,A),L;if(T===null){for(;A<y.length;A++)T=d(g,y[A],b),T!==null&&(p=n(T,p,A),P===null?L=T:P.sibling=T,P=T);return Ae&&Do(g,A),L}for(T=a(g,T);A<y.length;A++)N=h(T,g,A,y[A],b),N!==null&&(e&&N.alternate!==null&&T.delete(N.key===null?A:N.key),p=n(N,p,A),P===null?L=N:P.sibling=N,P=N);return e&&T.forEach(function(pe){return t(g,pe)}),Ae&&Do(g,A),L}function x(g,p,y,b){var L=Ri(y);if(typeof L!="function")throw Error(R(150));if(y=L.call(y),y==null)throw Error(R(151));for(var P=L=null,T=p,A=p=0,N=null,j=y.next();T!==null&&!j.done;A++,j=y.next()){T.index>A?(N=T,T=null):N=T.sibling;var pe=f(g,T,j.value,b);if(pe===null){T===null&&(T=N);break}e&&T&&pe.alternate===null&&t(g,T),p=n(pe,p,A),P===null?L=pe:P.sibling=pe,P=pe,T=N}if(j.done)return r(g,T),Ae&&Do(g,A),L;if(T===null){for(;!j.done;A++,j=y.next())j=d(g,j.value,b),j!==null&&(p=n(j,p,A),P===null?L=j:P.sibling=j,P=j);return Ae&&Do(g,A),L}for(T=a(g,T);!j.done;A++,j=y.next())j=h(T,g,A,j.value,b),j!==null&&(e&&j.alternate!==null&&T.delete(j.key===null?A:j.key),p=n(j,p,A),P===null?L=j:P.sibling=j,P=j);return e&&T.forEach(function(ee){return t(g,ee)}),Ae&&Do(g,A),L}function C(g,p,y,b){if(typeof y=="object"&&y!==null&&y.type===Bn&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Du:e:{for(var L=y.key,P=p;P!==null;){if(P.key===L){if(L=y.type,L===Bn){if(P.tag===7){r(g,P.sibling),p=o(P,y.props.children),p.return=g,g=p;break e}}else if(P.elementType===L||typeof L=="object"&&L!==null&&L.$$typeof===Oa&&jv(L)===P.type){r(g,P.sibling),p=o(P,y.props),p.ref=Mi(g,P,y),p.return=g,g=p;break e}r(g,P);break}else t(g,P);P=P.sibling}y.type===Bn?(p=Uo(y.props.children,g.mode,b,y.key),p.return=g,g=p):(b=ic(y.type,y.key,y.props,null,g.mode,b),b.ref=Mi(g,p,y),b.return=g,g=b)}return s(g);case On:e:{for(P=y.key;p!==null;){if(p.key===P)if(p.tag===4&&p.stateNode.containerInfo===y.containerInfo&&p.stateNode.implementation===y.implementation){r(g,p.sibling),p=o(p,y.children||[]),p.return=g,g=p;break e}else{r(g,p);break}else t(g,p);p=p.sibling}p=zp(y,g.mode,b),p.return=g,g=p}return s(g);case Oa:return P=y._init,C(g,p,P(y._payload),b)}if(Vi(y))return v(g,p,y,b);if(Ri(y))return x(g,p,y,b);Ku(g,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,p!==null&&p.tag===6?(r(g,p.sibling),p=o(p,y),p.return=g,g=p):(r(g,p),p=Hp(y,g.mode,b),p.return=g,g=p),s(g)):r(g,p)}return C}var as=d0(!0),f0=d0(!1),Sc=Za(null),Cc=null,$n=null,rh=null;function ah(){rh=$n=Cc=null}function oh(e){var t=Sc.current;ke(Sc),e._currentValue=t}function wm(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 Yn(e,t){Cc=e,rh=$n=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Dt=!0),e.firstContext=null)}function pr(e){var t=e._currentValue;if(rh!==e)if(e={context:e,memoizedValue:t,next:null},$n===null){if(Cc===null)throw Error(R(308));$n=e,Cc.dependencies={lanes:0,firstContext:e}}else $n=$n.next=e;return t}var Oo=null;function nh(e){Oo===null?Oo=[e]:Oo.push(e)}function p0(e,t,r,a){var o=t.interleaved;return o===null?(r.next=r,nh(t)):(r.next=o.next,o.next=r),t.interleaved=r,ua(e,a)}function ua(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 Ba=!1;function sh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function m0(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 sa(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Wa(e,t,r){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(ce&2)!==0){var o=a.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),a.pending=t,ua(e,r)}return o=a.interleaved,o===null?(t.next=t,nh(a)):(t.next=o.next,o.next=t),a.interleaved=t,ua(e,r)}function tc(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,$m(e,r)}}function qv(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 bc(e,t,r,a){var o=e.updateQueue;Ba=!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,h=i.eventTime;if((a&f)===f){c!==null&&(c=c.next={eventTime:h,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var v=e,x=i;switch(f=t,h=r,x.tag){case 1:if(v=x.payload,typeof v=="function"){d=v.call(h,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(h,d,f):v,f==null)break e;d=De({},d,f);break e;case 2:Ba=!0}}i.callback!==null&&i.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[i]:f.push(i))}else h={eventTime:h,lane:f,tag:i.tag,payload:i.payload,callback:i.callback,next:null},c===null?(u=c=h,l=d):c=c.next=h,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);Ho|=s,e.lanes=s,e.memoizedState=d}}function Hv(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 vl={},Ur=Za(vl),ul=Za(vl),cl=Za(vl);function Bo(e){if(e===vl)throw Error(R(174));return e}function ih(e,t){switch(Se(cl,t),Se(ul,e),Se(Ur,vl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:em(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=em(t,e)}ke(Ur),Se(Ur,t)}function os(){ke(Ur),ke(ul),ke(cl)}function h0(e){Bo(cl.current);var t=Bo(Ur.current),r=em(t,e.type);t!==r&&(Se(ul,e),Se(Ur,r))}function lh(e){ul.current===e&&(ke(Ur),ke(ul))}var Re=Za(0);function Lc(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 Bp=[];function uh(){for(var e=0;e<Bp.length;e++)Bp[e]._workInProgressVersionPrimary=null;Bp.length=0}var rc=da.ReactCurrentDispatcher,Fp=da.ReactCurrentBatchConfig,qo=0,Ee=null,Ke=null,rt=null,Ic=!1,Ki=!1,dl=0,tT=0;function vt(){throw Error(R(321))}function ch(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!kr(e[r],t[r]))return!1;return!0}function dh(e,t,r,a,o,n){if(qo=n,Ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,rc.current=e===null||e.memoizedState===null?nT:sT,e=r(a,o),Ki){n=0;do{if(Ki=!1,dl=0,25<=n)throw Error(R(301));n+=1,rt=Ke=null,t.updateQueue=null,rc.current=iT,e=r(a,o)}while(Ki)}if(rc.current=kc,t=Ke!==null&&Ke.next!==null,qo=0,rt=Ke=Ee=null,Ic=!1,t)throw Error(R(300));return e}function fh(){var e=dl!==0;return dl=0,e}function Or(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rt===null?Ee.memoizedState=rt=e:rt=rt.next=e,rt}function mr(){if(Ke===null){var e=Ee.alternate;e=e!==null?e.memoizedState:null}else e=Ke.next;var t=rt===null?Ee.memoizedState:rt.next;if(t!==null)rt=t,Ke=e;else{if(e===null)throw Error(R(310));Ke=e,e={memoizedState:Ke.memoizedState,baseState:Ke.baseState,baseQueue:Ke.baseQueue,queue:Ke.queue,next:null},rt===null?Ee.memoizedState=rt=e:rt=rt.next=e}return rt}function fl(e,t){return typeof t=="function"?t(e):t}function Up(e){var t=mr(),r=t.queue;if(r===null)throw Error(R(311));r.lastRenderedReducer=e;var a=Ke,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((qo&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,Ee.lanes|=c,Ho|=c}u=u.next}while(u!==null&&u!==n);l===null?s=a:l.next=i,kr(a,t.memoizedState)||(Dt=!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,Ee.lanes|=n,Ho|=n,o=o.next;while(o!==e)}else o===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Vp(e){var t=mr(),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);kr(n,t.memoizedState)||(Dt=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),r.lastRenderedState=n}return[n,a]}function g0(){}function y0(e,t){var r=Ee,a=mr(),o=t(),n=!kr(a.memoizedState,o);if(n&&(a.memoizedState=o,Dt=!0),a=a.queue,ph(w0.bind(null,r,a,e),[e]),a.getSnapshot!==t||n||rt!==null&&rt.memoizedState.tag&1){if(r.flags|=2048,pl(9,x0.bind(null,r,a,o,t),void 0,null),at===null)throw Error(R(349));(qo&30)!==0||v0(r,t,o)}return o}function v0(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Ee.updateQueue,t===null?(t={lastEffect:null,stores:null},Ee.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function x0(e,t,r,a){t.value=r,t.getSnapshot=a,S0(t)&&C0(e)}function w0(e,t,r){return r(function(){S0(t)&&C0(e)})}function S0(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!kr(e,r)}catch{return!0}}function C0(e){var t=ua(e,1);t!==null&&Ir(t,e,1,-1)}function zv(e){var t=Or();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:fl,lastRenderedState:e},t.queue=e,e=e.dispatch=oT.bind(null,Ee,e),[t.memoizedState,e]}function pl(e,t,r,a){return e={tag:e,create:t,destroy:r,deps:a,next:null},t=Ee.updateQueue,t===null?(t={lastEffect:null,stores:null},Ee.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 b0(){return mr().memoizedState}function ac(e,t,r,a){var o=Or();Ee.flags|=e,o.memoizedState=pl(1|t,r,void 0,a===void 0?null:a)}function Fc(e,t,r,a){var o=mr();a=a===void 0?null:a;var n=void 0;if(Ke!==null){var s=Ke.memoizedState;if(n=s.destroy,a!==null&&ch(a,s.deps)){o.memoizedState=pl(t,r,n,a);return}}Ee.flags|=e,o.memoizedState=pl(1|t,r,n,a)}function $v(e,t){return ac(8390656,8,e,t)}function ph(e,t){return Fc(2048,8,e,t)}function L0(e,t){return Fc(4,2,e,t)}function I0(e,t){return Fc(4,4,e,t)}function k0(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 P0(e,t,r){return r=r!=null?r.concat([e]):null,Fc(4,4,k0.bind(null,t,e),r)}function mh(){}function T0(e,t){var r=mr();t=t===void 0?null:t;var a=r.memoizedState;return a!==null&&t!==null&&ch(t,a[1])?a[0]:(r.memoizedState=[e,t],e)}function _0(e,t){var r=mr();t=t===void 0?null:t;var a=r.memoizedState;return a!==null&&t!==null&&ch(t,a[1])?a[0]:(e=e(),r.memoizedState=[e,t],e)}function A0(e,t,r){return(qo&21)===0?(e.baseState&&(e.baseState=!1,Dt=!0),e.memoizedState=r):(kr(r,t)||(r=Mx(),Ee.lanes|=r,Ho|=r,e.baseState=!0),t)}function rT(e,t){var r=he;he=r!==0&&4>r?r:4,e(!0);var a=Fp.transition;Fp.transition={};try{e(!1),t()}finally{he=r,Fp.transition=a}}function R0(){return mr().memoizedState}function aT(e,t,r){var a=Ka(e);if(r={lane:a,action:r,hasEagerState:!1,eagerState:null,next:null},E0(e))D0(t,r);else if(r=p0(e,t,r,a),r!==null){var o=Pt();Ir(r,e,a,o),N0(r,t,a)}}function oT(e,t,r){var a=Ka(e),o={lane:a,action:r,hasEagerState:!1,eagerState:null,next:null};if(E0(e))D0(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,kr(i,s)){var l=t.interleaved;l===null?(o.next=o,nh(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}r=p0(e,t,o,a),r!==null&&(o=Pt(),Ir(r,e,a,o),N0(r,t,a))}}function E0(e){var t=e.alternate;return e===Ee||t!==null&&t===Ee}function D0(e,t){Ki=Ic=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function N0(e,t,r){if((r&4194240)!==0){var a=t.lanes;a&=e.pendingLanes,r|=a,t.lanes=r,$m(e,r)}}var kc={readContext:pr,useCallback:vt,useContext:vt,useEffect:vt,useImperativeHandle:vt,useInsertionEffect:vt,useLayoutEffect:vt,useMemo:vt,useReducer:vt,useRef:vt,useState:vt,useDebugValue:vt,useDeferredValue:vt,useTransition:vt,useMutableSource:vt,useSyncExternalStore:vt,useId:vt,unstable_isNewReconciler:!1},nT={readContext:pr,useCallback:function(e,t){return Or().memoizedState=[e,t===void 0?null:t],e},useContext:pr,useEffect:$v,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,ac(4194308,4,k0.bind(null,t,e),r)},useLayoutEffect:function(e,t){return ac(4194308,4,e,t)},useInsertionEffect:function(e,t){return ac(4,2,e,t)},useMemo:function(e,t){var r=Or();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var a=Or();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=aT.bind(null,Ee,e),[a.memoizedState,e]},useRef:function(e){var t=Or();return e={current:e},t.memoizedState=e},useState:zv,useDebugValue:mh,useDeferredValue:function(e){return Or().memoizedState=e},useTransition:function(){var e=zv(!1),t=e[0];return e=rT.bind(null,e[1]),Or().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var a=Ee,o=Or();if(Ae){if(r===void 0)throw Error(R(407));r=r()}else{if(r=t(),at===null)throw Error(R(349));(qo&30)!==0||v0(a,t,r)}o.memoizedState=r;var n={value:r,getSnapshot:t};return o.queue=n,$v(w0.bind(null,a,n,e),[e]),a.flags|=2048,pl(9,x0.bind(null,a,n,r,t),void 0,null),r},useId:function(){var e=Or(),t=at.identifierPrefix;if(Ae){var r=na,a=oa;r=(a&~(1<<32-Lr(a)-1)).toString(32)+r,t=":"+t+"R"+r,r=dl++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=tT++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},sT={readContext:pr,useCallback:T0,useContext:pr,useEffect:ph,useImperativeHandle:P0,useInsertionEffect:L0,useLayoutEffect:I0,useMemo:_0,useReducer:Up,useRef:b0,useState:function(){return Up(fl)},useDebugValue:mh,useDeferredValue:function(e){var t=mr();return A0(t,Ke.memoizedState,e)},useTransition:function(){var e=Up(fl)[0],t=mr().memoizedState;return[e,t]},useMutableSource:g0,useSyncExternalStore:y0,useId:R0,unstable_isNewReconciler:!1},iT={readContext:pr,useCallback:T0,useContext:pr,useEffect:ph,useImperativeHandle:P0,useInsertionEffect:L0,useLayoutEffect:I0,useMemo:_0,useReducer:Vp,useRef:b0,useState:function(){return Vp(fl)},useDebugValue:mh,useDeferredValue:function(e){var t=mr();return Ke===null?t.memoizedState=e:A0(t,Ke.memoizedState,e)},useTransition:function(){var e=Vp(fl)[0],t=mr().memoizedState;return[e,t]},useMutableSource:g0,useSyncExternalStore:y0,useId:R0,unstable_isNewReconciler:!1};function Sr(e,t){if(e&&e.defaultProps){t=De({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Sm(e,t,r,a){t=e.memoizedState,r=r(a,t),r=r==null?t:De({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Uc={isMounted:function(e){return(e=e._reactInternals)?Wo(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var a=Pt(),o=Ka(e),n=sa(a,o);n.payload=t,r!=null&&(n.callback=r),t=Wa(e,n,o),t!==null&&(Ir(t,e,o,a),tc(t,e,o))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var a=Pt(),o=Ka(e),n=sa(a,o);n.tag=1,n.payload=t,r!=null&&(n.callback=r),t=Wa(e,n,o),t!==null&&(Ir(t,e,o,a),tc(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Pt(),a=Ka(e),o=sa(r,a);o.tag=2,t!=null&&(o.callback=t),t=Wa(e,o,a),t!==null&&(Ir(t,e,a,r),tc(t,e,a))}};function Wv(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?!nl(r,a)||!nl(o,n):!0}function M0(e,t,r){var a=!1,o=Qa,n=t.contextType;return typeof n=="object"&&n!==null?n=pr(n):(o=Mt(t)?Vo:St.current,a=t.contextTypes,n=(a=a!=null)?ts(e,o):Qa),t=new t(r,n),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Uc,e.stateNode=t,t._reactInternals=e,a&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=n),t}function Gv(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&&Uc.enqueueReplaceState(t,t.state,null)}function Cm(e,t,r,a){var o=e.stateNode;o.props=r,o.state=e.memoizedState,o.refs={},sh(e);var n=t.contextType;typeof n=="object"&&n!==null?o.context=pr(n):(n=Mt(t)?Vo:St.current,o.context=ts(e,n)),o.state=e.memoizedState,n=t.getDerivedStateFromProps,typeof n=="function"&&(Sm(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&&Uc.enqueueReplaceState(o,o.state,null),bc(e,r,o,a),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function ns(e,t){try{var r="",a=t;do r+=Bk(a),a=a.return;while(a);var o=r}catch(n){o=`
7
7
  Error generating stack: `+n.message+`
8
- `+n.stack}return{value:e,source:t,stack:o,digest:null}}function jp(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function bm(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var lT=typeof WeakMap=="function"?WeakMap:Map;function O0(e,t,r){r=sa(-1,r),r.tag=3,r.payload={element:null};var a=t.value;return r.callback=function(){Tc||(Tc=!0,Dm=a),bm(e,t)},r}function B0(e,t,r){r=sa(-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(){bm(e,t)}}var n=e.stateNode;return n!==null&&typeof n.componentDidCatch=="function"&&(r.callback=function(){bm(e,t),typeof a!="function"&&(Ga===null?Ga=new Set([this]):Ga.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),r}function Kv(e,t,r){var a=e.pingCache;if(a===null){a=e.pingCache=new lT;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=CT.bind(null,e,t,r),t.then(e,e))}function Xv(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 Jv(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=sa(-1,1),t.tag=2,Wa(r,t,1))),r.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var uT=da.ReactCurrentOwner,Dt=!1;function kt(e,t,r,a){t.child=e===null?f0(t,null,r,a):as(t,e.child,r,a)}function Qv(e,t,r,a,o){r=r.render;var n=t.ref;return Yn(t,o),a=dh(e,t,r,a,n,o),r=fh(),e!==null&&!Dt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,ca(e,t,o)):(Ae&&r&&Zm(t),t.flags|=1,kt(e,t,a,o),t.child)}function Yv(e,t,r,a,o){if(e===null){var n=r.type;return typeof n=="function"&&!Ch(n)&&n.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=n,F0(e,t,n,a,o)):(e=ic(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:nl,r(s,a)&&e.ref===t.ref)return ca(e,t,o)}return t.flags|=1,e=Xa(n,a),e.ref=t.ref,e.return=t,t.child=e}function F0(e,t,r,a,o){if(e!==null){var n=e.memoizedProps;if(nl(n,a)&&e.ref===t.ref)if(Dt=!1,t.pendingProps=a=n,(e.lanes&o)!==0)(e.flags&131072)!==0&&(Dt=!0);else return t.lanes=e.lanes,ca(e,t,o)}return Lm(e,t,r,a,o)}function U0(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},Se(Gn,$t),$t|=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,Se(Gn,$t),$t|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},a=n!==null?n.baseLanes:r,Se(Gn,$t),$t|=a}else n!==null?(a=n.baseLanes|r,t.memoizedState=null):a=r,Se(Gn,$t),$t|=a;return kt(e,t,o,r),t.child}function V0(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Lm(e,t,r,a,o){var n=Mt(r)?jo:St.current;return n=ts(t,n),Yn(t,o),r=dh(e,t,r,a,n,o),a=fh(),e!==null&&!Dt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,ca(e,t,o)):(Ae&&a&&Zm(t),t.flags|=1,kt(e,t,r,o),t.child)}function Zv(e,t,r,a,o){if(Mt(r)){var n=!0;vc(t)}else n=!1;if(Yn(t,o),t.stateNode===null)oc(e,t),M0(t,r,a),Cm(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=pr(u):(u=Mt(r)?jo:St.current,u=ts(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)&&Gv(t,s,a,u),Ba=!1;var f=t.memoizedState;s.state=f,bc(t,a,s,o),l=t.memoizedState,i!==a||f!==l||Nt.current||Ba?(typeof c=="function"&&(Sm(t,r,c,a),l=t.memoizedState),(i=Ba||Wv(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,m0(e,t),i=t.memoizedProps,u=t.type===t.elementType?i:Sr(t.type,i),s.props=u,d=t.pendingProps,f=s.context,l=r.contextType,typeof l=="object"&&l!==null?l=pr(l):(l=Mt(r)?jo:St.current,l=ts(t,l));var h=r.getDerivedStateFromProps;(c=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(i!==d||f!==l)&&Gv(t,s,a,l),Ba=!1,f=t.memoizedState,s.state=f,bc(t,a,s,o);var v=t.memoizedState;i!==d||f!==v||Nt.current||Ba?(typeof h=="function"&&(Sm(t,r,h,a),v=t.memoizedState),(u=Ba||Wv(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 Im(e,t,r,a,n,o)}function Im(e,t,r,a,o,n){V0(e,t);var s=(t.flags&128)!==0;if(!a&&!s)return o&&Fv(t,r,!1),ca(e,t,n);a=t.stateNode,uT.current=t;var i=s&&typeof r.getDerivedStateFromError!="function"?null:a.render();return t.flags|=1,e!==null&&s?(t.child=as(t,e.child,null,n),t.child=as(t,null,i,n)):kt(e,t,i,n),t.memoizedState=a.state,o&&Fv(t,r,!0),t.child}function j0(e){var t=e.stateNode;t.pendingContext?Bv(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Bv(e,t.context,!1),ih(e,t.containerInfo)}function ex(e,t,r,a,o){return rs(),th(o),t.flags|=256,kt(e,t,r,a),t.child}var km={dehydrated:null,treeContext:null,retryLane:0};function Pm(e){return{baseLanes:e,cachePool:null,transitions:null}}function q0(e,t,r){var a=t.pendingProps,o=Re.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),Se(Re,o&1),e===null)return xm(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=qc(s,a,0,null),e=Vo(e,a,r,null),n.return=t,e.return=t,n.sibling=e,t.child=n,t.child.memoizedState=Pm(r),t.memoizedState=km,e):hh(t,s));if(o=e.memoizedState,o!==null&&(i=o.dehydrated,i!==null))return cT(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=Xa(o,l),a.subtreeFlags=o.subtreeFlags&14680064),i!==null?n=Xa(i,n):(n=Vo(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?Pm(r):{baseLanes:s.baseLanes|r,cachePool:null,transitions:s.transitions},n.memoizedState=s,n.childLanes=e.childLanes&~r,t.memoizedState=km,a}return n=e.child,e=n.sibling,a=Xa(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 hh(e,t){return t=qc({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Xu(e,t,r,a){return a!==null&&th(a),as(t,e.child,null,r),e=hh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function cT(e,t,r,a,o,n,s){if(r)return t.flags&256?(t.flags&=-257,a=jp(Error(R(422))),Xu(e,t,s,a)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(n=a.fallback,o=t.mode,a=qc({mode:"visible",children:a.children},o,0,null),n=Vo(n,o,s,null),n.flags|=2,a.return=t,n.return=t,a.sibling=n,t.child=a,(t.mode&1)!==0&&as(t,e.child,null,s),t.child.memoizedState=Pm(s),t.memoizedState=km,n);if((t.mode&1)===0)return Xu(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=jp(n,a,void 0),Xu(e,t,s,a)}if(i=(s&e.childLanes)!==0,Dt||i){if(a=at,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,ua(e,o),Ir(a,e,o,-1))}return Sh(),a=jp(Error(R(421))),Xu(e,t,s,a)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=bT.bind(null,e),o._reactRetry=t,null):(e=n.treeContext,Wt=$a(o.nextSibling),Gt=t,Ae=!0,br=null,e!==null&&(ur[cr++]=oa,ur[cr++]=na,ur[cr++]=qo,oa=e.id,na=e.overflow,qo=t),t=hh(t,a.children),t.flags|=4096,t)}function tx(e,t,r){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),wm(e.return,t,r)}function qp(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 H0(e,t,r){var a=t.pendingProps,o=a.revealOrder,n=a.tail;if(kt(e,t,a.children,r),a=Re.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&&tx(e,r,t);else if(e.tag===19)tx(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(Se(Re,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&&Lc(e)===null&&(o=r),r=r.sibling;r=o,r===null?(o=t.child,t.child=null):(o=r.sibling,r.sibling=null),qp(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&&Lc(e)===null){t.child=o;break}e=o.sibling,o.sibling=r,r=o,o=e}qp(t,!0,r,null,n);break;case"together":qp(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function oc(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ca(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),zo|=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=Xa(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Xa(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function dT(e,t,r){switch(t.tag){case 3:j0(t),rs();break;case 5:h0(t);break;case 1:Mt(t.type)&&vc(t);break;case 4:ih(t,t.stateNode.containerInfo);break;case 10:var a=t.type._context,o=t.memoizedProps.value;Se(Sc,a._currentValue),a._currentValue=o;break;case 13:if(a=t.memoizedState,a!==null)return a.dehydrated!==null?(Se(Re,Re.current&1),t.flags|=128,null):(r&t.child.childLanes)!==0?q0(e,t,r):(Se(Re,Re.current&1),e=ca(e,t,r),e!==null?e.sibling:null);Se(Re,Re.current&1);break;case 19:if(a=(r&t.childLanes)!==0,(e.flags&128)!==0){if(a)return H0(e,t,r);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Se(Re,Re.current),a)break;return null;case 22:case 23:return t.lanes=0,U0(e,t,r)}return ca(e,t,r)}var z0,Tm,$0,W0;z0=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}};Tm=function(){};$0=function(e,t,r,a){var o=e.memoizedProps;if(o!==a){e=t.stateNode,Fo(Ur.current);var n=null;switch(r){case"input":o=Jp(e,o),a=Jp(e,a),n=[];break;case"select":o=De({},o,{value:void 0}),a=De({},a,{value:void 0}),n=[];break;case"textarea":o=Zp(e,o),a=Zp(e,a),n=[];break;default:typeof o.onClick!="function"&&typeof a.onClick=="function"&&(e.onclick=gc)}tm(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"&&(Yi.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"&&(Yi.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Ie("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)}};W0=function(e,t,r,a){r!==a&&(t.flags|=4)};function Oi(e,t){if(!Ae)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 xt(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 fT(e,t,r){var a=t.pendingProps;switch(eh(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xt(t),null;case 1:return Mt(t.type)&&yc(),xt(t),null;case 3:return a=t.stateNode,os(),ke(Nt),ke(St),uh(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Gu(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,br!==null&&(Om(br),br=null))),Tm(e,t),xt(t),null;case 5:lh(t);var o=Fo(cl.current);if(r=t.type,e!==null&&t.stateNode!=null)$0(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 xt(t),null}if(e=Fo(Ur.current),Gu(t)){a=t.stateNode,r=t.type;var n=t.memoizedProps;switch(a[Br]=t,a[ll]=n,e=(t.mode&1)!==0,r){case"dialog":Ie("cancel",a),Ie("close",a);break;case"iframe":case"object":case"embed":Ie("load",a);break;case"video":case"audio":for(o=0;o<qi.length;o++)Ie(qi[o],a);break;case"source":Ie("error",a);break;case"img":case"image":case"link":Ie("error",a),Ie("load",a);break;case"details":Ie("toggle",a);break;case"input":uv(a,n),Ie("invalid",a);break;case"select":a._wrapperState={wasMultiple:!!n.multiple},Ie("invalid",a);break;case"textarea":dv(a,n),Ie("invalid",a)}tm(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&&Wu(a.textContent,i,e),o=["children",i]):typeof i=="number"&&a.textContent!==""+i&&(n.suppressHydrationWarning!==!0&&Wu(a.textContent,i,e),o=["children",""+i]):Yi.hasOwnProperty(s)&&i!=null&&s==="onScroll"&&Ie("scroll",a)}switch(r){case"input":Nu(a),cv(a,n,!0);break;case"textarea":Nu(a),fv(a);break;case"select":case"option":break;default:typeof n.onClick=="function"&&(a.onclick=gc)}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=wx(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[Br]=t,e[ll]=a,z0(e,t,!1,!1),t.stateNode=e;e:{switch(s=rm(r,a),r){case"dialog":Ie("cancel",e),Ie("close",e),o=a;break;case"iframe":case"object":case"embed":Ie("load",e),o=a;break;case"video":case"audio":for(o=0;o<qi.length;o++)Ie(qi[o],e);o=a;break;case"source":Ie("error",e),o=a;break;case"img":case"image":case"link":Ie("error",e),Ie("load",e),o=a;break;case"details":Ie("toggle",e),o=a;break;case"input":uv(e,a),o=Jp(e,a),Ie("invalid",e);break;case"option":o=a;break;case"select":e._wrapperState={wasMultiple:!!a.multiple},o=De({},a,{value:void 0}),Ie("invalid",e);break;case"textarea":dv(e,a),o=Zp(e,a),Ie("invalid",e);break;default:o=a}tm(r,o),i=o;for(n in i)if(i.hasOwnProperty(n)){var l=i[n];n==="style"?bx(e,l):n==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Sx(e,l)):n==="children"?typeof l=="string"?(r!=="textarea"||l!=="")&&Zi(e,l):typeof l=="number"&&Zi(e,""+l):n!=="suppressContentEditableWarning"&&n!=="suppressHydrationWarning"&&n!=="autoFocus"&&(Yi.hasOwnProperty(n)?l!=null&&n==="onScroll"&&Ie("scroll",e):l!=null&&Um(e,n,l,s))}switch(r){case"input":Nu(e),cv(e,a,!1);break;case"textarea":Nu(e),fv(e);break;case"option":a.value!=null&&e.setAttribute("value",""+Ja(a.value));break;case"select":e.multiple=!!a.multiple,n=a.value,n!=null?Kn(e,!!a.multiple,n,!1):a.defaultValue!=null&&Kn(e,!!a.multiple,a.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=gc)}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 xt(t),null;case 6:if(e&&t.stateNode!=null)W0(e,t,e.memoizedProps,a);else{if(typeof a!="string"&&t.stateNode===null)throw Error(R(166));if(r=Fo(cl.current),Fo(Ur.current),Gu(t)){if(a=t.stateNode,r=t.memoizedProps,a[Br]=t,(n=a.nodeValue!==r)&&(e=Gt,e!==null))switch(e.tag){case 3:Wu(a.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Wu(a.nodeValue,r,(e.mode&1)!==0)}n&&(t.flags|=4)}else a=(r.nodeType===9?r:r.ownerDocument).createTextNode(a),a[Br]=t,t.stateNode=a}return xt(t),null;case 13:if(ke(Re),a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ae&&Wt!==null&&(t.mode&1)!==0&&(t.flags&128)===0)c0(),rs(),t.flags|=98560,n=!1;else if(n=Gu(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[Br]=t}else rs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xt(t),n=!1}else br!==null&&(Om(br),br=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||(Re.current&1)!==0?Xe===0&&(Xe=3):Sh())),t.updateQueue!==null&&(t.flags|=4),xt(t),null);case 4:return os(),Tm(e,t),e===null&&sl(t.stateNode.containerInfo),xt(t),null;case 10:return oh(t.type._context),xt(t),null;case 17:return Mt(t.type)&&yc(),xt(t),null;case 19:if(ke(Re),n=t.memoizedState,n===null)return xt(t),null;if(a=(t.flags&128)!==0,s=n.rendering,s===null)if(a)Oi(n,!1);else{if(Xe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=Lc(e),s!==null){for(t.flags|=128,Oi(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 Se(Re,Re.current&1|2),t.child}e=e.sibling}n.tail!==null&&je()>ss&&(t.flags|=128,a=!0,Oi(n,!1),t.lanes=4194304)}else{if(!a)if(e=Lc(s),e!==null){if(t.flags|=128,a=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Oi(n,!0),n.tail===null&&n.tailMode==="hidden"&&!s.alternate&&!Ae)return xt(t),null}else 2*je()-n.renderingStartTime>ss&&r!==1073741824&&(t.flags|=128,a=!0,Oi(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=je(),t.sibling=null,r=Re.current,Se(Re,a?r&1|2:r&1),t):(xt(t),null);case 22:case 23:return wh(),a=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==a&&(t.flags|=8192),a&&(t.mode&1)!==0?($t&1073741824)!==0&&(xt(t),t.subtreeFlags&6&&(t.flags|=8192)):xt(t),null;case 24:return null;case 25:return null}throw Error(R(156,t.tag))}function pT(e,t){switch(eh(t),t.tag){case 1:return Mt(t.type)&&yc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return os(),ke(Nt),ke(St),uh(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return lh(t),null;case 13:if(ke(Re),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(R(340));rs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ke(Re),null;case 4:return os(),null;case 10:return oh(t.type._context),null;case 22:case 23:return wh(),null;case 24:return null;default:return null}}var Ju=!1,wt=!1,mT=typeof WeakSet=="function"?WeakSet:Set,U=null;function Wn(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(a){Fe(e,t,a)}else r.current=null}function _m(e,t,r){try{r()}catch(a){Fe(e,t,a)}}var rx=!1;function hT(e,t){if(fm=pc,e=Qx(),Ym(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 h;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),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===e)break t;if(f===r&&++u===o&&(i=s),f===n&&++c===a&&(l=s),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}r=i===-1||l===-1?null:{start:i,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(pm={focusedElem:e,selectionRange:r},pc=!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 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,p=g.getSnapshotBeforeUpdate(t.elementType===t.type?x:Sr(t.type,x),C);g.__reactInternalSnapshotBeforeUpdate=p}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){Fe(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,U=e;break}U=t.return}return v=rx,rx=!1,v}function Xi(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&&_m(t,r,n)}o=o.next}while(o!==a)}}function Vc(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 Am(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 G0(e){var t=e.alternate;t!==null&&(e.alternate=null,G0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Br],delete t[ll],delete t[gm],delete t[QP],delete t[YP])),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 K0(e){return e.tag===5||e.tag===3||e.tag===4}function ax(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||K0(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 Rm(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=gc));else if(a!==4&&(e=e.child,e!==null))for(Rm(e,t,r),e=e.sibling;e!==null;)Rm(e,t,r),e=e.sibling}function Em(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(Em(e,t,r),e=e.sibling;e!==null;)Em(e,t,r),e=e.sibling}var it=null,Cr=!1;function Ma(e,t,r){for(r=r.child;r!==null;)X0(e,t,r),r=r.sibling}function X0(e,t,r){if(Fr&&typeof Fr.onCommitFiberUnmount=="function")try{Fr.onCommitFiberUnmount(Ec,r)}catch{}switch(r.tag){case 5:wt||Wn(r,t);case 6:var a=it,o=Cr;it=null,Ma(e,t,r),it=a,Cr=o,it!==null&&(Cr?(e=it,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):it.removeChild(r.stateNode));break;case 18:it!==null&&(Cr?(e=it,r=r.stateNode,e.nodeType===8?Mp(e.parentNode,r):e.nodeType===1&&Mp(e,r),al(e)):Mp(it,r.stateNode));break;case 4:a=it,o=Cr,it=r.stateNode.containerInfo,Cr=!0,Ma(e,t,r),it=a,Cr=o;break;case 0:case 11:case 14:case 15:if(!wt&&(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)&&_m(r,t,s),o=o.next}while(o!==a)}Ma(e,t,r);break;case 1:if(!wt&&(Wn(r,t),a=r.stateNode,typeof a.componentWillUnmount=="function"))try{a.props=r.memoizedProps,a.state=r.memoizedState,a.componentWillUnmount()}catch(i){Fe(r,t,i)}Ma(e,t,r);break;case 21:Ma(e,t,r);break;case 22:r.mode&1?(wt=(a=wt)||r.memoizedState!==null,Ma(e,t,r),wt=a):Ma(e,t,r);break;default:Ma(e,t,r)}}function ox(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new mT),t.forEach(function(a){var o=LT.bind(null,e,a);r.has(a)||(r.add(a),a.then(o,o))})}}function wr(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:it=i.stateNode,Cr=!1;break e;case 3:it=i.stateNode.containerInfo,Cr=!0;break e;case 4:it=i.stateNode.containerInfo,Cr=!0;break e}i=i.return}if(it===null)throw Error(R(160));X0(n,s,o),it=null,Cr=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(u){Fe(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)J0(t,e),t=t.sibling}function J0(e,t){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(wr(t,e),Mr(e),a&4){try{Xi(3,e,e.return),Vc(3,e)}catch(x){Fe(e,e.return,x)}try{Xi(5,e,e.return)}catch(x){Fe(e,e.return,x)}}break;case 1:wr(t,e),Mr(e),a&512&&r!==null&&Wn(r,r.return);break;case 5:if(wr(t,e),Mr(e),a&512&&r!==null&&Wn(r,r.return),e.flags&32){var o=e.stateNode;try{Zi(o,"")}catch(x){Fe(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&&vx(o,n),rm(i,s);var u=rm(i,n);for(s=0;s<l.length;s+=2){var c=l[s],d=l[s+1];c==="style"?bx(o,d):c==="dangerouslySetInnerHTML"?Sx(o,d):c==="children"?Zi(o,d):Um(o,c,d,u)}switch(i){case"input":Qp(o,n);break;case"textarea":xx(o,n);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!n.multiple;var h=n.value;h!=null?Kn(o,!!n.multiple,h,!1):f!==!!n.multiple&&(n.defaultValue!=null?Kn(o,!!n.multiple,n.defaultValue,!0):Kn(o,!!n.multiple,n.multiple?[]:"",!1))}o[ll]=n}catch(x){Fe(e,e.return,x)}}break;case 6:if(wr(t,e),Mr(e),a&4){if(e.stateNode===null)throw Error(R(162));o=e.stateNode,n=e.memoizedProps;try{o.nodeValue=n}catch(x){Fe(e,e.return,x)}}break;case 3:if(wr(t,e),Mr(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{al(t.containerInfo)}catch(x){Fe(e,e.return,x)}break;case 4:wr(t,e),Mr(e);break;case 13:wr(t,e),Mr(e),o=e.child,o.flags&8192&&(n=o.memoizedState!==null,o.stateNode.isHidden=n,!n||o.alternate!==null&&o.alternate.memoizedState!==null||(vh=je())),a&4&&ox(e);break;case 22:if(c=r!==null&&r.memoizedState!==null,e.mode&1?(wt=(u=wt)||c,wr(t,e),wt=u):wr(t,e),Mr(e),a&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&(e.mode&1)!==0)for(U=e,c=e.child;c!==null;){for(d=U=c;U!==null;){switch(f=U,h=f.child,f.tag){case 0:case 11:case 14:case 15:Xi(4,f,f.return);break;case 1:Wn(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){Fe(a,r,x)}}break;case 5:Wn(f,f.return);break;case 22:if(f.memoizedState!==null){sx(d);continue}}h!==null?(h.return=f,U=h):sx(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){Fe(e,e.return,x)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(x){Fe(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:wr(t,e),Mr(e),a&4&&ox(e);break;case 21:break;default:wr(t,e),Mr(e)}}function Mr(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(K0(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&&(Zi(o,""),a.flags&=-33);var n=ax(e);Em(e,n,o);break;case 3:case 4:var s=a.stateNode.containerInfo,i=ax(e);Rm(e,i,s);break;default:throw Error(R(161))}}catch(l){Fe(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function gT(e,t,r){U=e,Q0(e,t,r)}function Q0(e,t,r){for(var a=(e.mode&1)!==0;U!==null;){var o=U,n=o.child;if(o.tag===22&&a){var s=o.memoizedState!==null||Ju;if(!s){var i=o.alternate,l=i!==null&&i.memoizedState!==null||wt;i=Ju;var u=wt;if(Ju=s,(wt=l)&&!u)for(U=o;U!==null;)s=U,l=s.child,s.tag===22&&s.memoizedState!==null?ix(o):l!==null?(l.return=s,U=l):ix(o);for(;n!==null;)U=n,Q0(n,t,r),n=n.sibling;U=o,Ju=i,wt=u}nx(e,t,r)}else(o.subtreeFlags&8772)!==0&&n!==null?(n.return=o,U=n):nx(e,t,r)}}function nx(e){for(;U!==null;){var t=U;if((t.flags&8772)!==0){var r=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:wt||Vc(5,t);break;case 1:var a=t.stateNode;if(t.flags&4&&!wt)if(r===null)a.componentDidMount();else{var o=t.elementType===t.type?r.memoizedProps:Sr(t.type,r.memoizedProps);a.componentDidUpdate(o,r.memoizedState,a.__reactInternalSnapshotBeforeUpdate)}var n=t.updateQueue;n!==null&&Hv(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}Hv(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&&al(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(R(163))}wt||t.flags&512&&Am(t)}catch(f){Fe(t,t.return,f)}}if(t===e){U=null;break}if(r=t.sibling,r!==null){r.return=t.return,U=r;break}U=t.return}}function sx(e){for(;U!==null;){var t=U;if(t===e){U=null;break}var r=t.sibling;if(r!==null){r.return=t.return,U=r;break}U=t.return}}function ix(e){for(;U!==null;){var t=U;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Vc(4,t)}catch(l){Fe(t,r,l)}break;case 1:var a=t.stateNode;if(typeof a.componentDidMount=="function"){var o=t.return;try{a.componentDidMount()}catch(l){Fe(t,o,l)}}var n=t.return;try{Am(t)}catch(l){Fe(t,n,l)}break;case 5:var s=t.return;try{Am(t)}catch(l){Fe(t,s,l)}}}catch(l){Fe(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 yT=Math.ceil,Pc=da.ReactCurrentDispatcher,gh=da.ReactCurrentOwner,fr=da.ReactCurrentBatchConfig,ce=0,at=null,ze=null,lt=0,$t=0,Gn=Za(0),Xe=0,ml=null,zo=0,jc=0,yh=0,Ji=null,Et=null,vh=0,ss=1/0,ra=null,Tc=!1,Dm=null,Ga=null,Qu=!1,ja=null,_c=0,Qi=0,Nm=null,nc=-1,sc=0;function Pt(){return(ce&6)!==0?je():nc!==-1?nc:nc=je()}function Ka(e){return(e.mode&1)===0?1:(ce&2)!==0&&lt!==0?lt&-lt:eT.transition!==null?(sc===0&&(sc=Mx()),sc):(e=he,e!==0||(e=window.event,e=e===void 0?16:qx(e.type)),e)}function Ir(e,t,r,a){if(50<Qi)throw Qi=0,Nm=null,Error(R(185));hl(e,r,a),((ce&2)===0||e!==at)&&(e===at&&((ce&2)===0&&(jc|=r),Xe===4&&Ua(e,lt)),Ot(e,a),r===1&&ce===0&&(t.mode&1)===0&&(ss=je()+500,Bc&&eo()))}function Ot(e,t){var r=e.callbackNode;rP(e,t);var a=fc(e,e===at?lt:0);if(a===0)r!==null&&hv(r),e.callbackNode=null,e.callbackPriority=0;else if(t=a&-a,e.callbackPriority!==t){if(r!=null&&hv(r),t===1)e.tag===0?ZP(lx.bind(null,e)):i0(lx.bind(null,e)),XP(function(){(ce&6)===0&&eo()}),r=null;else{switch(Ox(a)){case 1:r=zm;break;case 4:r=Dx;break;case 16:r=dc;break;case 536870912:r=Nx;break;default:r=dc}r=nw(r,Y0.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Y0(e,t){if(nc=-1,sc=0,(ce&6)!==0)throw Error(R(327));var r=e.callbackNode;if(Zn()&&e.callbackNode!==r)return null;var a=fc(e,e===at?lt:0);if(a===0)return null;if((a&30)!==0||(a&e.expiredLanes)!==0||t)t=Ac(e,a);else{t=a;var o=ce;ce|=2;var n=ew();(at!==e||lt!==t)&&(ra=null,ss=je()+500,Uo(e,t));do try{wT();break}catch(i){Z0(e,i)}while(!0);ah(),Pc.current=n,ce=o,ze!==null?t=0:(at=null,lt=0,t=Xe)}if(t!==0){if(t===2&&(o=im(e),o!==0&&(a=o,t=Mm(e,o))),t===1)throw r=ml,Uo(e,0),Ua(e,a),Ot(e,je()),r;if(t===6)Ua(e,a);else{if(o=e.current.alternate,(a&30)===0&&!vT(o)&&(t=Ac(e,a),t===2&&(n=im(e),n!==0&&(a=n,t=Mm(e,n))),t===1))throw r=ml,Uo(e,0),Ua(e,a),Ot(e,je()),r;switch(e.finishedWork=o,e.finishedLanes=a,t){case 0:case 1:throw Error(R(345));case 2:Mo(e,Et,ra);break;case 3:if(Ua(e,a),(a&130023424)===a&&(t=vh+500-je(),10<t)){if(fc(e,0)!==0)break;if(o=e.suspendedLanes,(o&a)!==a){Pt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=hm(Mo.bind(null,e,Et,ra),t);break}Mo(e,Et,ra);break;case 4:if(Ua(e,a),(a&4194240)===a)break;for(t=e.eventTimes,o=-1;0<a;){var s=31-Lr(a);n=1<<s,s=t[s],s>o&&(o=s),a&=~n}if(a=o,a=je()-a,a=(120>a?120:480>a?480:1080>a?1080:1920>a?1920:3e3>a?3e3:4320>a?4320:1960*yT(a/1960))-a,10<a){e.timeoutHandle=hm(Mo.bind(null,e,Et,ra),a);break}Mo(e,Et,ra);break;case 5:Mo(e,Et,ra);break;default:throw Error(R(329))}}}return Ot(e,je()),e.callbackNode===r?Y0.bind(null,e):null}function Mm(e,t){var r=Ji;return e.current.memoizedState.isDehydrated&&(Uo(e,t).flags|=256),e=Ac(e,t),e!==2&&(t=Et,Et=r,t!==null&&Om(t)),e}function Om(e){Et===null?Et=e:Et.push.apply(Et,e)}function vT(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(!kr(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 Ua(e,t){for(t&=~yh,t&=~jc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Lr(t),a=1<<r;e[r]=-1,t&=~a}}function lx(e){if((ce&6)!==0)throw Error(R(327));Zn();var t=fc(e,0);if((t&1)===0)return Ot(e,je()),null;var r=Ac(e,t);if(e.tag!==0&&r===2){var a=im(e);a!==0&&(t=a,r=Mm(e,a))}if(r===1)throw r=ml,Uo(e,0),Ua(e,t),Ot(e,je()),r;if(r===6)throw Error(R(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Mo(e,Et,ra),Ot(e,je()),null}function xh(e,t){var r=ce;ce|=1;try{return e(t)}finally{ce=r,ce===0&&(ss=je()+500,Bc&&eo())}}function $o(e){ja!==null&&ja.tag===0&&(ce&6)===0&&Zn();var t=ce;ce|=1;var r=fr.transition,a=he;try{if(fr.transition=null,he=1,e)return e()}finally{he=a,fr.transition=r,ce=t,(ce&6)===0&&eo()}}function wh(){$t=Gn.current,ke(Gn)}function Uo(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,KP(r)),ze!==null)for(r=ze.return;r!==null;){var a=r;switch(eh(a),a.tag){case 1:a=a.type.childContextTypes,a!=null&&yc();break;case 3:os(),ke(Nt),ke(St),uh();break;case 5:lh(a);break;case 4:os();break;case 13:ke(Re);break;case 19:ke(Re);break;case 10:oh(a.type._context);break;case 22:case 23:wh()}r=r.return}if(at=e,ze=e=Xa(e.current,null),lt=$t=t,Xe=0,ml=null,yh=jc=zo=0,Et=Ji=null,Bo!==null){for(t=0;t<Bo.length;t++)if(r=Bo[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}Bo=null}return e}function Z0(e,t){do{var r=ze;try{if(ah(),rc.current=kc,Ic){for(var a=Ee.memoizedState;a!==null;){var o=a.queue;o!==null&&(o.pending=null),a=a.next}Ic=!1}if(Ho=0,rt=Ke=Ee=null,Ki=!1,dl=0,gh.current=null,r===null||r.return===null){Xe=1,ml=t,ze=null;break}e:{var n=e,s=r.return,i=r,l=t;if(t=lt,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 h=Xv(s);if(h!==null){h.flags&=-257,Jv(h,s,i,n,t),h.mode&1&&Kv(n,u,t),t=h,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){Kv(n,u,t),Sh();break e}l=Error(R(426))}}else if(Ae&&i.mode&1){var C=Xv(s);if(C!==null){(C.flags&65536)===0&&(C.flags|=256),Jv(C,s,i,n,t),th(ns(l,i));break e}}n=l=ns(l,i),Xe!==4&&(Xe=2),Ji===null?Ji=[n]:Ji.push(n),n=s;do{switch(n.tag){case 3:n.flags|=65536,t&=-t,n.lanes|=t;var g=O0(n,l,t);qv(n,g);break e;case 1:i=l;var p=n.type,y=n.stateNode;if((n.flags&128)===0&&(typeof p.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Ga===null||!Ga.has(y)))){n.flags|=65536,t&=-t,n.lanes|=t;var b=B0(n,i,t);qv(n,b);break e}}n=n.return}while(n!==null)}rw(r)}catch(L){t=L,ze===r&&r!==null&&(ze=r=r.return);continue}break}while(!0)}function ew(){var e=Pc.current;return Pc.current=kc,e===null?kc:e}function Sh(){(Xe===0||Xe===3||Xe===2)&&(Xe=4),at===null||(zo&268435455)===0&&(jc&268435455)===0||Ua(at,lt)}function Ac(e,t){var r=ce;ce|=2;var a=ew();(at!==e||lt!==t)&&(ra=null,Uo(e,t));do try{xT();break}catch(o){Z0(e,o)}while(!0);if(ah(),ce=r,Pc.current=a,ze!==null)throw Error(R(261));return at=null,lt=0,Xe}function xT(){for(;ze!==null;)tw(ze)}function wT(){for(;ze!==null&&!Gk();)tw(ze)}function tw(e){var t=ow(e.alternate,e,$t);e.memoizedProps=e.pendingProps,t===null?rw(e):ze=t,gh.current=null}function rw(e){var t=e;do{var r=t.alternate;if(e=t.return,(t.flags&32768)===0){if(r=fT(r,t,$t),r!==null){ze=r;return}}else{if(r=pT(r,t),r!==null){r.flags&=32767,ze=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Xe=6,ze=null;return}}if(t=t.sibling,t!==null){ze=t;return}ze=t=e}while(t!==null);Xe===0&&(Xe=5)}function Mo(e,t,r){var a=he,o=fr.transition;try{fr.transition=null,he=1,ST(e,t,r,a)}finally{fr.transition=o,he=a}return null}function ST(e,t,r,a){do Zn();while(ja!==null);if((ce&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(aP(e,n),e===at&&(ze=at=null,lt=0),(r.subtreeFlags&2064)===0&&(r.flags&2064)===0||Qu||(Qu=!0,nw(dc,function(){return Zn(),null})),n=(r.flags&15990)!==0,(r.subtreeFlags&15990)!==0||n){n=fr.transition,fr.transition=null;var s=he;he=1;var i=ce;ce|=4,gh.current=null,hT(e,r),J0(r,e),HP(pm),pc=!!fm,pm=fm=null,e.current=r,gT(r,e,o),Kk(),ce=i,he=s,fr.transition=n}else e.current=r;if(Qu&&(Qu=!1,ja=e,_c=o),n=e.pendingLanes,n===0&&(Ga=null),Qk(r.stateNode,a),Ot(e,je()),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(Tc)throw Tc=!1,e=Dm,Dm=null,e;return(_c&1)!==0&&e.tag!==0&&Zn(),n=e.pendingLanes,(n&1)!==0?e===Nm?Qi++:(Qi=0,Nm=e):Qi=0,eo(),null}function Zn(){if(ja!==null){var e=Ox(_c),t=fr.transition,r=he;try{if(fr.transition=null,he=16>e?16:e,ja===null)var a=!1;else{if(e=ja,ja=null,_c=0,(ce&6)!==0)throw Error(R(331));var o=ce;for(ce|=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 c=U;switch(c.tag){case 0:case 11:case 15:Xi(8,c,n)}var d=c.child;if(d!==null)d.return=c,U=d;else for(;U!==null;){c=U;var f=c.sibling,h=c.return;if(G0(c),c===u){U=null;break}if(f!==null){f.return=h,U=f;break}U=h}}}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)}}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:Xi(9,n,n.return)}var g=n.sibling;if(g!==null){g.return=n.return,U=g;break e}U=n.return}}var p=e.current;for(U=p;U!==null;){s=U;var y=s.child;if((s.subtreeFlags&2064)!==0&&y!==null)y.return=s,U=y;else e:for(s=p;U!==null;){if(i=U,(i.flags&2048)!==0)try{switch(i.tag){case 0:case 11:case 15:Vc(9,i)}}catch(L){Fe(i,i.return,L)}if(i===s){U=null;break e}var b=i.sibling;if(b!==null){b.return=i.return,U=b;break e}U=i.return}}if(ce=o,eo(),Fr&&typeof Fr.onPostCommitFiberRoot=="function")try{Fr.onPostCommitFiberRoot(Ec,e)}catch{}a=!0}return a}finally{he=r,fr.transition=t}}return!1}function ux(e,t,r){t=ns(r,t),t=O0(e,t,1),e=Wa(e,t,1),t=Pt(),e!==null&&(hl(e,1,t),Ot(e,t))}function Fe(e,t,r){if(e.tag===3)ux(e,e,r);else for(;t!==null;){if(t.tag===3){ux(t,e,r);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Ga===null||!Ga.has(a))){e=ns(r,e),e=B0(t,e,1),t=Wa(t,e,1),e=Pt(),t!==null&&(hl(t,1,e),Ot(t,e));break}}t=t.return}}function CT(e,t,r){var a=e.pingCache;a!==null&&a.delete(t),t=Pt(),e.pingedLanes|=e.suspendedLanes&r,at===e&&(lt&r)===r&&(Xe===4||Xe===3&&(lt&130023424)===lt&&500>je()-vh?Uo(e,0):yh|=r),Ot(e,t)}function aw(e,t){t===0&&((e.mode&1)===0?t=1:(t=Bu,Bu<<=1,(Bu&130023424)===0&&(Bu=4194304)));var r=Pt();e=ua(e,t),e!==null&&(hl(e,t,r),Ot(e,r))}function bT(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),aw(e,r)}function LT(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),aw(e,r)}var ow;ow=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Nt.current)Dt=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return Dt=!1,dT(e,t,r);Dt=(e.flags&131072)!==0}else Dt=!1,Ae&&(t.flags&1048576)!==0&&l0(t,wc,t.index);switch(t.lanes=0,t.tag){case 2:var a=t.type;oc(e,t),e=t.pendingProps;var o=ts(t,St.current);Yn(t,r),o=dh(null,t,a,e,o,r);var n=fh();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,Mt(a)?(n=!0,vc(t)):n=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,sh(t),o.updater=Uc,t.stateNode=o,o._reactInternals=t,Cm(t,a,e,r),t=Im(null,t,a,!0,n,r)):(t.tag=0,Ae&&n&&Zm(t),kt(null,t,o,r),t=t.child),t;case 16:a=t.elementType;e:{switch(oc(e,t),e=t.pendingProps,o=a._init,a=o(a._payload),t.type=a,o=t.tag=kT(a),e=Sr(a,e),o){case 0:t=Lm(null,t,a,e,r);break e;case 1:t=Zv(null,t,a,e,r);break e;case 11:t=Qv(null,t,a,e,r);break e;case 14:t=Yv(null,t,a,Sr(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:Sr(a,o),Lm(e,t,a,o,r);case 1:return a=t.type,o=t.pendingProps,o=t.elementType===a?o:Sr(a,o),Zv(e,t,a,o,r);case 3:e:{if(j0(t),e===null)throw Error(R(387));a=t.pendingProps,n=t.memoizedState,o=n.element,m0(e,t),bc(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=ns(Error(R(423)),t),t=ex(e,t,a,r,o);break e}else if(a!==o){o=ns(Error(R(424)),t),t=ex(e,t,a,r,o);break e}else for(Wt=$a(t.stateNode.containerInfo.firstChild),Gt=t,Ae=!0,br=null,r=f0(t,null,a,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(rs(),a===o){t=ca(e,t,r);break e}kt(e,t,a,r)}t=t.child}return t;case 5:return h0(t),e===null&&xm(t),a=t.type,o=t.pendingProps,n=e!==null?e.memoizedProps:null,s=o.children,mm(a,o)?s=null:n!==null&&mm(a,n)&&(t.flags|=32),V0(e,t),kt(e,t,s,r),t.child;case 6:return e===null&&xm(t),null;case 13:return q0(e,t,r);case 4:return ih(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=as(t,null,a,r):kt(e,t,a,r),t.child;case 11:return a=t.type,o=t.pendingProps,o=t.elementType===a?o:Sr(a,o),Qv(e,t,a,o,r);case 7:return kt(e,t,t.pendingProps,r),t.child;case 8:return kt(e,t,t.pendingProps.children,r),t.child;case 12:return kt(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,Se(Sc,a._currentValue),a._currentValue=s,n!==null)if(kr(n.value,s)){if(n.children===o.children&&!Nt.current){t=ca(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=sa(-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),wm(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),wm(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}kt(e,t,o.children,r),t=t.child}return t;case 9:return o=t.type,a=t.pendingProps.children,Yn(t,r),o=pr(o),a=a(o),t.flags|=1,kt(e,t,a,r),t.child;case 14:return a=t.type,o=Sr(a,t.pendingProps),o=Sr(a.type,o),Yv(e,t,a,o,r);case 15:return F0(e,t,t.type,t.pendingProps,r);case 17:return a=t.type,o=t.pendingProps,o=t.elementType===a?o:Sr(a,o),oc(e,t),t.tag=1,Mt(a)?(e=!0,vc(t)):e=!1,Yn(t,r),M0(t,a,o),Cm(t,a,o,r),Im(null,t,a,!0,e,r);case 19:return H0(e,t,r);case 22:return U0(e,t,r)}throw Error(R(156,t.tag))};function nw(e,t){return Ex(e,t)}function IT(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 dr(e,t,r,a){return new IT(e,t,r,a)}function Ch(e){return e=e.prototype,!(!e||!e.isReactComponent)}function kT(e){if(typeof e=="function")return Ch(e)?1:0;if(e!=null){if(e=e.$$typeof,e===jm)return 11;if(e===qm)return 14}return 2}function Xa(e,t){var r=e.alternate;return r===null?(r=dr(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 ic(e,t,r,a,o,n){var s=2;if(a=e,typeof e=="function")Ch(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Bn:return Vo(r.children,o,n,t);case Vm:s=8,o|=8;break;case Wp:return e=dr(12,r,t,o|2),e.elementType=Wp,e.lanes=n,e;case Gp:return e=dr(13,r,t,o),e.elementType=Gp,e.lanes=n,e;case Kp:return e=dr(19,r,t,o),e.elementType=Kp,e.lanes=n,e;case hx:return qc(r,o,n,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case px:s=10;break e;case mx:s=9;break e;case jm:s=11;break e;case qm:s=14;break e;case Oa:s=16,a=null;break e}throw Error(R(130,e==null?e:typeof e,""))}return t=dr(s,r,t,o),t.elementType=e,t.type=a,t.lanes=n,t}function Vo(e,t,r,a){return e=dr(7,e,a,t),e.lanes=r,e}function qc(e,t,r,a){return e=dr(22,e,a,t),e.elementType=hx,e.lanes=r,e.stateNode={isHidden:!1},e}function Hp(e,t,r){return e=dr(6,e,null,t),e.lanes=r,e}function zp(e,t,r){return t=dr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function PT(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=Pp(0),this.expirationTimes=Pp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pp(0),this.identifierPrefix=a,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function bh(e,t,r,a,o,n,s,i,l){return e=new PT(e,t,r,i,l),t===1?(t=1,n===!0&&(t|=8)):t=0,n=dr(3,null,null,t),e.current=n,n.stateNode=e,n.memoizedState={element:a,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},sh(n),e}function TT(e,t,r){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:On,key:a==null?null:""+a,children:e,containerInfo:t,implementation:r}}function sw(e){if(!e)return Qa;e=e._reactInternals;e:{if(Go(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(Mt(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(Mt(r))return s0(e,r,t)}return t}function iw(e,t,r,a,o,n,s,i,l){return e=bh(r,a,!0,e,o,n,s,i,l),e.context=sw(null),r=e.current,a=Pt(),o=Ka(r),n=sa(a,o),n.callback=t??null,Wa(r,n,o),e.current.lanes=o,hl(e,o,a),Ot(e,a),e}function Hc(e,t,r,a){var o=t.current,n=Pt(),s=Ka(o);return r=sw(r),t.context===null?t.context=r:t.pendingContext=r,t=sa(n,s),t.payload={element:e},a=a===void 0?null:a,a!==null&&(t.callback=a),e=Wa(o,t,s),e!==null&&(Ir(e,o,s,n),tc(e,o,s)),s}function Rc(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function cx(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Lh(e,t){cx(e,t),(e=e.alternate)&&cx(e,t)}function _T(){return null}var lw=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ih(e){this._internalRoot=e}zc.prototype.render=Ih.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(R(409));Hc(e,t,null,null)};zc.prototype.unmount=Ih.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;$o(function(){Hc(null,e,null,null)}),t[la]=null}};function zc(e){this._internalRoot=e}zc.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ux();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Fa.length&&t!==0&&t<Fa[r].priority;r++);Fa.splice(r,0,e),r===0&&jx(e)}};function kh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function $c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function dx(){}function AT(e,t,r,a,o){if(o){if(typeof a=="function"){var n=a;a=function(){var u=Rc(s);n.call(u)}}var s=iw(t,a,e,0,null,!1,!1,"",dx);return e._reactRootContainer=s,e[la]=s.current,sl(e.nodeType===8?e.parentNode:e),$o(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof a=="function"){var i=a;a=function(){var u=Rc(l);i.call(u)}}var l=bh(e,0,!1,null,null,!1,!1,"",dx);return e._reactRootContainer=l,e[la]=l.current,sl(e.nodeType===8?e.parentNode:e),$o(function(){Hc(t,l,r,a)}),l}function Wc(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=Rc(s);i.call(l)}}Hc(t,s,e,o)}else s=AT(r,t,e,o,a);return Rc(s)}Bx=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=ji(t.pendingLanes);r!==0&&($m(t,r|1),Ot(t,je()),(ce&6)===0&&(ss=je()+500,eo()))}break;case 13:$o(function(){var a=ua(e,1);if(a!==null){var o=Pt();Ir(a,e,1,o)}}),Lh(e,1)}};Wm=function(e){if(e.tag===13){var t=ua(e,134217728);if(t!==null){var r=Pt();Ir(t,e,134217728,r)}Lh(e,134217728)}};Fx=function(e){if(e.tag===13){var t=Ka(e),r=ua(e,t);if(r!==null){var a=Pt();Ir(r,e,t,a)}Lh(e,t)}};Ux=function(){return he};Vx=function(e,t){var r=he;try{return he=e,t()}finally{he=r}};om=function(e,t,r){switch(t){case"input":if(Qp(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=Oc(a);if(!o)throw Error(R(90));yx(a),Qp(a,o)}}}break;case"textarea":xx(e,r);break;case"select":t=r.value,t!=null&&Kn(e,!!r.multiple,t,!1)}};kx=xh;Px=$o;var RT={usingClientEntryPoint:!1,Events:[yl,jn,Oc,Lx,Ix,xh]},Bi={findFiberByHostInstance:Oo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ET={bundleType:Bi.bundleType,version:Bi.version,rendererPackageName:Bi.rendererPackageName,rendererConfig:Bi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:da.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Ax(e),e===null?null:e.stateNode},findFiberByHostInstance:Bi.findFiberByHostInstance||_T,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Fi=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Fi.isDisabled&&Fi.supportsFiber))try{Ec=Fi.inject(ET),Fr=Fi}catch{}var Fi;Jt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=RT;Jt.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!kh(t))throw Error(R(200));return TT(e,t,null,r)};Jt.createRoot=function(e,t){if(!kh(e))throw Error(R(299));var r=!1,a="",o=lw;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=bh(e,1,!1,null,null,r,!1,a,o),e[la]=t.current,sl(e.nodeType===8?e.parentNode:e),new Ih(t)};Jt.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=Ax(t),e=e===null?null:e.stateNode,e};Jt.flushSync=function(e){return $o(e)};Jt.hydrate=function(e,t,r){if(!$c(t))throw Error(R(200));return Wc(null,e,t,!0,r)};Jt.hydrateRoot=function(e,t,r){if(!kh(e))throw Error(R(405));var a=r!=null&&r.hydratedSources||null,o=!1,n="",s=lw;if(r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(n=r.identifierPrefix),r.onRecoverableError!==void 0&&(s=r.onRecoverableError)),t=iw(t,null,e,1,r??null,o,!1,n,s),e[la]=t.current,sl(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 zc(t)};Jt.render=function(e,t,r){if(!$c(t))throw Error(R(200));return Wc(null,e,t,!1,r)};Jt.unmountComponentAtNode=function(e){if(!$c(e))throw Error(R(40));return e._reactRootContainer?($o(function(){Wc(null,null,e,!1,function(){e._reactRootContainer=null,e[la]=null})}),!0):!1};Jt.unstable_batchedUpdates=xh;Jt.unstable_renderSubtreeIntoContainer=function(e,t,r,a){if(!$c(r))throw Error(R(200));if(e==null||e._reactInternals===void 0)throw Error(R(38));return Wc(e,t,r,!1,a)};Jt.version="18.3.1-next-f1338f8080-20240426"});var Ph=ta((XD,dw)=>{"use strict";function cw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(cw)}catch(e){console.error(e)}}cw(),dw.exports=uw()});var pw=ta(Th=>{"use strict";var fw=Ph();Th.createRoot=fw.createRoot,Th.hydrateRoot=fw.hydrateRoot;var JD});var _S=ta(hd=>{"use strict";var qA=Q(),HA=Symbol.for("react.element"),zA=Symbol.for("react.fragment"),$A=Object.prototype.hasOwnProperty,WA=qA.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,GA={key:!0,ref:!0,__self:!0,__source:!0};function TS(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)$A.call(t,a)&&!GA.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:HA,type:e,key:n,ref:s,props:o,_owner:WA.current}}hd.Fragment=zA;hd.jsx=TS;hd.jsxs=TS});var ue=ta((OO,AS)=>{"use strict";AS.exports=_S()});var VD={};mk(VD,{initKiteChat:()=>xy});var Yr=O(Q(),1),KI=O(pw(),1);var F=O(Q(),1);function Ko(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 mw(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 hw=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);var us=class extends Error{constructor(t,r="FunctionsError",a){super(t),this.name=r,this.context=a}},xl=class extends us{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}},cs=class extends us{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}},ds=class extends us{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}},wl;(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"})(wl||(wl={}));var Sl=class{constructor(t,{headers:r={},customFetch:a,region:o=wl.Any}={}){this.url=t,this.headers=r,this.region=o,this.fetch=hw(a)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return mw(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:h}=a;h||(h=this.region);let v=new URL(`${this.url}/${r}`);h&&h!=="any"&&(f["x-region"]=h,v.searchParams.set("forceFunctionRegion",h));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 xl(L)}),p=g.headers.get("x-relay-error");if(p&&p==="true")throw new cs(g);if(!g.ok)throw new ds(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 ds||i instanceof cs?i.context:void 0}}finally{n&&clearTimeout(n)}})}};var yw=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}},DT=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 h;let g=await n.text();g===""||(r.headers.get("Accept")==="text/csv"||r.headers.get("Accept")&&(!((h=r.headers.get("Accept"))===null||h===void 0)&&h.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 yw(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+=`
8
+ `+n.stack}return{value:e,source:t,stack:o,digest:null}}function jp(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function bm(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var lT=typeof WeakMap=="function"?WeakMap:Map;function O0(e,t,r){r=sa(-1,r),r.tag=3,r.payload={element:null};var a=t.value;return r.callback=function(){Tc||(Tc=!0,Dm=a),bm(e,t)},r}function B0(e,t,r){r=sa(-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(){bm(e,t)}}var n=e.stateNode;return n!==null&&typeof n.componentDidCatch=="function"&&(r.callback=function(){bm(e,t),typeof a!="function"&&(Ga===null?Ga=new Set([this]):Ga.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),r}function Kv(e,t,r){var a=e.pingCache;if(a===null){a=e.pingCache=new lT;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=CT.bind(null,e,t,r),t.then(e,e))}function Xv(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 Jv(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=sa(-1,1),t.tag=2,Wa(r,t,1))),r.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var uT=da.ReactCurrentOwner,Dt=!1;function kt(e,t,r,a){t.child=e===null?f0(t,null,r,a):as(t,e.child,r,a)}function Qv(e,t,r,a,o){r=r.render;var n=t.ref;return Yn(t,o),a=dh(e,t,r,a,n,o),r=fh(),e!==null&&!Dt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,ca(e,t,o)):(Ae&&r&&Zm(t),t.flags|=1,kt(e,t,a,o),t.child)}function Yv(e,t,r,a,o){if(e===null){var n=r.type;return typeof n=="function"&&!Ch(n)&&n.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=n,F0(e,t,n,a,o)):(e=ic(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:nl,r(s,a)&&e.ref===t.ref)return ca(e,t,o)}return t.flags|=1,e=Xa(n,a),e.ref=t.ref,e.return=t,t.child=e}function F0(e,t,r,a,o){if(e!==null){var n=e.memoizedProps;if(nl(n,a)&&e.ref===t.ref)if(Dt=!1,t.pendingProps=a=n,(e.lanes&o)!==0)(e.flags&131072)!==0&&(Dt=!0);else return t.lanes=e.lanes,ca(e,t,o)}return Lm(e,t,r,a,o)}function U0(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},Se(Gn,$t),$t|=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,Se(Gn,$t),$t|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},a=n!==null?n.baseLanes:r,Se(Gn,$t),$t|=a}else n!==null?(a=n.baseLanes|r,t.memoizedState=null):a=r,Se(Gn,$t),$t|=a;return kt(e,t,o,r),t.child}function V0(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Lm(e,t,r,a,o){var n=Mt(r)?Vo:St.current;return n=ts(t,n),Yn(t,o),r=dh(e,t,r,a,n,o),a=fh(),e!==null&&!Dt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,ca(e,t,o)):(Ae&&a&&Zm(t),t.flags|=1,kt(e,t,r,o),t.child)}function Zv(e,t,r,a,o){if(Mt(r)){var n=!0;vc(t)}else n=!1;if(Yn(t,o),t.stateNode===null)oc(e,t),M0(t,r,a),Cm(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=pr(u):(u=Mt(r)?Vo:St.current,u=ts(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)&&Gv(t,s,a,u),Ba=!1;var f=t.memoizedState;s.state=f,bc(t,a,s,o),l=t.memoizedState,i!==a||f!==l||Nt.current||Ba?(typeof c=="function"&&(Sm(t,r,c,a),l=t.memoizedState),(i=Ba||Wv(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,m0(e,t),i=t.memoizedProps,u=t.type===t.elementType?i:Sr(t.type,i),s.props=u,d=t.pendingProps,f=s.context,l=r.contextType,typeof l=="object"&&l!==null?l=pr(l):(l=Mt(r)?Vo:St.current,l=ts(t,l));var h=r.getDerivedStateFromProps;(c=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(i!==d||f!==l)&&Gv(t,s,a,l),Ba=!1,f=t.memoizedState,s.state=f,bc(t,a,s,o);var v=t.memoizedState;i!==d||f!==v||Nt.current||Ba?(typeof h=="function"&&(Sm(t,r,h,a),v=t.memoizedState),(u=Ba||Wv(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 Im(e,t,r,a,n,o)}function Im(e,t,r,a,o,n){V0(e,t);var s=(t.flags&128)!==0;if(!a&&!s)return o&&Fv(t,r,!1),ca(e,t,n);a=t.stateNode,uT.current=t;var i=s&&typeof r.getDerivedStateFromError!="function"?null:a.render();return t.flags|=1,e!==null&&s?(t.child=as(t,e.child,null,n),t.child=as(t,null,i,n)):kt(e,t,i,n),t.memoizedState=a.state,o&&Fv(t,r,!0),t.child}function j0(e){var t=e.stateNode;t.pendingContext?Bv(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Bv(e,t.context,!1),ih(e,t.containerInfo)}function ex(e,t,r,a,o){return rs(),th(o),t.flags|=256,kt(e,t,r,a),t.child}var km={dehydrated:null,treeContext:null,retryLane:0};function Pm(e){return{baseLanes:e,cachePool:null,transitions:null}}function q0(e,t,r){var a=t.pendingProps,o=Re.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),Se(Re,o&1),e===null)return xm(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=qc(s,a,0,null),e=Uo(e,a,r,null),n.return=t,e.return=t,n.sibling=e,t.child=n,t.child.memoizedState=Pm(r),t.memoizedState=km,e):hh(t,s));if(o=e.memoizedState,o!==null&&(i=o.dehydrated,i!==null))return cT(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=Xa(o,l),a.subtreeFlags=o.subtreeFlags&14680064),i!==null?n=Xa(i,n):(n=Uo(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?Pm(r):{baseLanes:s.baseLanes|r,cachePool:null,transitions:s.transitions},n.memoizedState=s,n.childLanes=e.childLanes&~r,t.memoizedState=km,a}return n=e.child,e=n.sibling,a=Xa(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 hh(e,t){return t=qc({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Xu(e,t,r,a){return a!==null&&th(a),as(t,e.child,null,r),e=hh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function cT(e,t,r,a,o,n,s){if(r)return t.flags&256?(t.flags&=-257,a=jp(Error(R(422))),Xu(e,t,s,a)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(n=a.fallback,o=t.mode,a=qc({mode:"visible",children:a.children},o,0,null),n=Uo(n,o,s,null),n.flags|=2,a.return=t,n.return=t,a.sibling=n,t.child=a,(t.mode&1)!==0&&as(t,e.child,null,s),t.child.memoizedState=Pm(s),t.memoizedState=km,n);if((t.mode&1)===0)return Xu(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=jp(n,a,void 0),Xu(e,t,s,a)}if(i=(s&e.childLanes)!==0,Dt||i){if(a=at,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,ua(e,o),Ir(a,e,o,-1))}return Sh(),a=jp(Error(R(421))),Xu(e,t,s,a)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=bT.bind(null,e),o._reactRetry=t,null):(e=n.treeContext,Wt=$a(o.nextSibling),Gt=t,Ae=!0,br=null,e!==null&&(ur[cr++]=oa,ur[cr++]=na,ur[cr++]=jo,oa=e.id,na=e.overflow,jo=t),t=hh(t,a.children),t.flags|=4096,t)}function tx(e,t,r){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),wm(e.return,t,r)}function qp(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 H0(e,t,r){var a=t.pendingProps,o=a.revealOrder,n=a.tail;if(kt(e,t,a.children,r),a=Re.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&&tx(e,r,t);else if(e.tag===19)tx(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(Se(Re,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&&Lc(e)===null&&(o=r),r=r.sibling;r=o,r===null?(o=t.child,t.child=null):(o=r.sibling,r.sibling=null),qp(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&&Lc(e)===null){t.child=o;break}e=o.sibling,o.sibling=r,r=o,o=e}qp(t,!0,r,null,n);break;case"together":qp(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function oc(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ca(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Ho|=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=Xa(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Xa(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function dT(e,t,r){switch(t.tag){case 3:j0(t),rs();break;case 5:h0(t);break;case 1:Mt(t.type)&&vc(t);break;case 4:ih(t,t.stateNode.containerInfo);break;case 10:var a=t.type._context,o=t.memoizedProps.value;Se(Sc,a._currentValue),a._currentValue=o;break;case 13:if(a=t.memoizedState,a!==null)return a.dehydrated!==null?(Se(Re,Re.current&1),t.flags|=128,null):(r&t.child.childLanes)!==0?q0(e,t,r):(Se(Re,Re.current&1),e=ca(e,t,r),e!==null?e.sibling:null);Se(Re,Re.current&1);break;case 19:if(a=(r&t.childLanes)!==0,(e.flags&128)!==0){if(a)return H0(e,t,r);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Se(Re,Re.current),a)break;return null;case 22:case 23:return t.lanes=0,U0(e,t,r)}return ca(e,t,r)}var z0,Tm,$0,W0;z0=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}};Tm=function(){};$0=function(e,t,r,a){var o=e.memoizedProps;if(o!==a){e=t.stateNode,Bo(Ur.current);var n=null;switch(r){case"input":o=Jp(e,o),a=Jp(e,a),n=[];break;case"select":o=De({},o,{value:void 0}),a=De({},a,{value:void 0}),n=[];break;case"textarea":o=Zp(e,o),a=Zp(e,a),n=[];break;default:typeof o.onClick!="function"&&typeof a.onClick=="function"&&(e.onclick=gc)}tm(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"&&(Yi.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"&&(Yi.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Ie("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)}};W0=function(e,t,r,a){r!==a&&(t.flags|=4)};function Oi(e,t){if(!Ae)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 xt(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 fT(e,t,r){var a=t.pendingProps;switch(eh(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xt(t),null;case 1:return Mt(t.type)&&yc(),xt(t),null;case 3:return a=t.stateNode,os(),ke(Nt),ke(St),uh(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Gu(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,br!==null&&(Om(br),br=null))),Tm(e,t),xt(t),null;case 5:lh(t);var o=Bo(cl.current);if(r=t.type,e!==null&&t.stateNode!=null)$0(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 xt(t),null}if(e=Bo(Ur.current),Gu(t)){a=t.stateNode,r=t.type;var n=t.memoizedProps;switch(a[Br]=t,a[ll]=n,e=(t.mode&1)!==0,r){case"dialog":Ie("cancel",a),Ie("close",a);break;case"iframe":case"object":case"embed":Ie("load",a);break;case"video":case"audio":for(o=0;o<qi.length;o++)Ie(qi[o],a);break;case"source":Ie("error",a);break;case"img":case"image":case"link":Ie("error",a),Ie("load",a);break;case"details":Ie("toggle",a);break;case"input":uv(a,n),Ie("invalid",a);break;case"select":a._wrapperState={wasMultiple:!!n.multiple},Ie("invalid",a);break;case"textarea":dv(a,n),Ie("invalid",a)}tm(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&&Wu(a.textContent,i,e),o=["children",i]):typeof i=="number"&&a.textContent!==""+i&&(n.suppressHydrationWarning!==!0&&Wu(a.textContent,i,e),o=["children",""+i]):Yi.hasOwnProperty(s)&&i!=null&&s==="onScroll"&&Ie("scroll",a)}switch(r){case"input":Nu(a),cv(a,n,!0);break;case"textarea":Nu(a),fv(a);break;case"select":case"option":break;default:typeof n.onClick=="function"&&(a.onclick=gc)}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=wx(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[Br]=t,e[ll]=a,z0(e,t,!1,!1),t.stateNode=e;e:{switch(s=rm(r,a),r){case"dialog":Ie("cancel",e),Ie("close",e),o=a;break;case"iframe":case"object":case"embed":Ie("load",e),o=a;break;case"video":case"audio":for(o=0;o<qi.length;o++)Ie(qi[o],e);o=a;break;case"source":Ie("error",e),o=a;break;case"img":case"image":case"link":Ie("error",e),Ie("load",e),o=a;break;case"details":Ie("toggle",e),o=a;break;case"input":uv(e,a),o=Jp(e,a),Ie("invalid",e);break;case"option":o=a;break;case"select":e._wrapperState={wasMultiple:!!a.multiple},o=De({},a,{value:void 0}),Ie("invalid",e);break;case"textarea":dv(e,a),o=Zp(e,a),Ie("invalid",e);break;default:o=a}tm(r,o),i=o;for(n in i)if(i.hasOwnProperty(n)){var l=i[n];n==="style"?bx(e,l):n==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Sx(e,l)):n==="children"?typeof l=="string"?(r!=="textarea"||l!=="")&&Zi(e,l):typeof l=="number"&&Zi(e,""+l):n!=="suppressContentEditableWarning"&&n!=="suppressHydrationWarning"&&n!=="autoFocus"&&(Yi.hasOwnProperty(n)?l!=null&&n==="onScroll"&&Ie("scroll",e):l!=null&&Um(e,n,l,s))}switch(r){case"input":Nu(e),cv(e,a,!1);break;case"textarea":Nu(e),fv(e);break;case"option":a.value!=null&&e.setAttribute("value",""+Ja(a.value));break;case"select":e.multiple=!!a.multiple,n=a.value,n!=null?Kn(e,!!a.multiple,n,!1):a.defaultValue!=null&&Kn(e,!!a.multiple,a.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=gc)}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 xt(t),null;case 6:if(e&&t.stateNode!=null)W0(e,t,e.memoizedProps,a);else{if(typeof a!="string"&&t.stateNode===null)throw Error(R(166));if(r=Bo(cl.current),Bo(Ur.current),Gu(t)){if(a=t.stateNode,r=t.memoizedProps,a[Br]=t,(n=a.nodeValue!==r)&&(e=Gt,e!==null))switch(e.tag){case 3:Wu(a.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Wu(a.nodeValue,r,(e.mode&1)!==0)}n&&(t.flags|=4)}else a=(r.nodeType===9?r:r.ownerDocument).createTextNode(a),a[Br]=t,t.stateNode=a}return xt(t),null;case 13:if(ke(Re),a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ae&&Wt!==null&&(t.mode&1)!==0&&(t.flags&128)===0)c0(),rs(),t.flags|=98560,n=!1;else if(n=Gu(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[Br]=t}else rs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xt(t),n=!1}else br!==null&&(Om(br),br=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||(Re.current&1)!==0?Xe===0&&(Xe=3):Sh())),t.updateQueue!==null&&(t.flags|=4),xt(t),null);case 4:return os(),Tm(e,t),e===null&&sl(t.stateNode.containerInfo),xt(t),null;case 10:return oh(t.type._context),xt(t),null;case 17:return Mt(t.type)&&yc(),xt(t),null;case 19:if(ke(Re),n=t.memoizedState,n===null)return xt(t),null;if(a=(t.flags&128)!==0,s=n.rendering,s===null)if(a)Oi(n,!1);else{if(Xe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=Lc(e),s!==null){for(t.flags|=128,Oi(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 Se(Re,Re.current&1|2),t.child}e=e.sibling}n.tail!==null&&je()>ss&&(t.flags|=128,a=!0,Oi(n,!1),t.lanes=4194304)}else{if(!a)if(e=Lc(s),e!==null){if(t.flags|=128,a=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Oi(n,!0),n.tail===null&&n.tailMode==="hidden"&&!s.alternate&&!Ae)return xt(t),null}else 2*je()-n.renderingStartTime>ss&&r!==1073741824&&(t.flags|=128,a=!0,Oi(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=je(),t.sibling=null,r=Re.current,Se(Re,a?r&1|2:r&1),t):(xt(t),null);case 22:case 23:return wh(),a=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==a&&(t.flags|=8192),a&&(t.mode&1)!==0?($t&1073741824)!==0&&(xt(t),t.subtreeFlags&6&&(t.flags|=8192)):xt(t),null;case 24:return null;case 25:return null}throw Error(R(156,t.tag))}function pT(e,t){switch(eh(t),t.tag){case 1:return Mt(t.type)&&yc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return os(),ke(Nt),ke(St),uh(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return lh(t),null;case 13:if(ke(Re),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(R(340));rs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ke(Re),null;case 4:return os(),null;case 10:return oh(t.type._context),null;case 22:case 23:return wh(),null;case 24:return null;default:return null}}var Ju=!1,wt=!1,mT=typeof WeakSet=="function"?WeakSet:Set,U=null;function Wn(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(a){Fe(e,t,a)}else r.current=null}function _m(e,t,r){try{r()}catch(a){Fe(e,t,a)}}var rx=!1;function hT(e,t){if(fm=pc,e=Qx(),Ym(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 h;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),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===e)break t;if(f===r&&++u===o&&(i=s),f===n&&++c===a&&(l=s),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}r=i===-1||l===-1?null:{start:i,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(pm={focusedElem:e,selectionRange:r},pc=!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 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,p=g.getSnapshotBeforeUpdate(t.elementType===t.type?x:Sr(t.type,x),C);g.__reactInternalSnapshotBeforeUpdate=p}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){Fe(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,U=e;break}U=t.return}return v=rx,rx=!1,v}function Xi(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&&_m(t,r,n)}o=o.next}while(o!==a)}}function Vc(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 Am(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 G0(e){var t=e.alternate;t!==null&&(e.alternate=null,G0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Br],delete t[ll],delete t[gm],delete t[QP],delete t[YP])),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 K0(e){return e.tag===5||e.tag===3||e.tag===4}function ax(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||K0(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 Rm(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=gc));else if(a!==4&&(e=e.child,e!==null))for(Rm(e,t,r),e=e.sibling;e!==null;)Rm(e,t,r),e=e.sibling}function Em(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(Em(e,t,r),e=e.sibling;e!==null;)Em(e,t,r),e=e.sibling}var it=null,Cr=!1;function Ma(e,t,r){for(r=r.child;r!==null;)X0(e,t,r),r=r.sibling}function X0(e,t,r){if(Fr&&typeof Fr.onCommitFiberUnmount=="function")try{Fr.onCommitFiberUnmount(Ec,r)}catch{}switch(r.tag){case 5:wt||Wn(r,t);case 6:var a=it,o=Cr;it=null,Ma(e,t,r),it=a,Cr=o,it!==null&&(Cr?(e=it,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):it.removeChild(r.stateNode));break;case 18:it!==null&&(Cr?(e=it,r=r.stateNode,e.nodeType===8?Mp(e.parentNode,r):e.nodeType===1&&Mp(e,r),al(e)):Mp(it,r.stateNode));break;case 4:a=it,o=Cr,it=r.stateNode.containerInfo,Cr=!0,Ma(e,t,r),it=a,Cr=o;break;case 0:case 11:case 14:case 15:if(!wt&&(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)&&_m(r,t,s),o=o.next}while(o!==a)}Ma(e,t,r);break;case 1:if(!wt&&(Wn(r,t),a=r.stateNode,typeof a.componentWillUnmount=="function"))try{a.props=r.memoizedProps,a.state=r.memoizedState,a.componentWillUnmount()}catch(i){Fe(r,t,i)}Ma(e,t,r);break;case 21:Ma(e,t,r);break;case 22:r.mode&1?(wt=(a=wt)||r.memoizedState!==null,Ma(e,t,r),wt=a):Ma(e,t,r);break;default:Ma(e,t,r)}}function ox(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new mT),t.forEach(function(a){var o=LT.bind(null,e,a);r.has(a)||(r.add(a),a.then(o,o))})}}function wr(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:it=i.stateNode,Cr=!1;break e;case 3:it=i.stateNode.containerInfo,Cr=!0;break e;case 4:it=i.stateNode.containerInfo,Cr=!0;break e}i=i.return}if(it===null)throw Error(R(160));X0(n,s,o),it=null,Cr=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(u){Fe(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)J0(t,e),t=t.sibling}function J0(e,t){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(wr(t,e),Mr(e),a&4){try{Xi(3,e,e.return),Vc(3,e)}catch(x){Fe(e,e.return,x)}try{Xi(5,e,e.return)}catch(x){Fe(e,e.return,x)}}break;case 1:wr(t,e),Mr(e),a&512&&r!==null&&Wn(r,r.return);break;case 5:if(wr(t,e),Mr(e),a&512&&r!==null&&Wn(r,r.return),e.flags&32){var o=e.stateNode;try{Zi(o,"")}catch(x){Fe(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&&vx(o,n),rm(i,s);var u=rm(i,n);for(s=0;s<l.length;s+=2){var c=l[s],d=l[s+1];c==="style"?bx(o,d):c==="dangerouslySetInnerHTML"?Sx(o,d):c==="children"?Zi(o,d):Um(o,c,d,u)}switch(i){case"input":Qp(o,n);break;case"textarea":xx(o,n);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!n.multiple;var h=n.value;h!=null?Kn(o,!!n.multiple,h,!1):f!==!!n.multiple&&(n.defaultValue!=null?Kn(o,!!n.multiple,n.defaultValue,!0):Kn(o,!!n.multiple,n.multiple?[]:"",!1))}o[ll]=n}catch(x){Fe(e,e.return,x)}}break;case 6:if(wr(t,e),Mr(e),a&4){if(e.stateNode===null)throw Error(R(162));o=e.stateNode,n=e.memoizedProps;try{o.nodeValue=n}catch(x){Fe(e,e.return,x)}}break;case 3:if(wr(t,e),Mr(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{al(t.containerInfo)}catch(x){Fe(e,e.return,x)}break;case 4:wr(t,e),Mr(e);break;case 13:wr(t,e),Mr(e),o=e.child,o.flags&8192&&(n=o.memoizedState!==null,o.stateNode.isHidden=n,!n||o.alternate!==null&&o.alternate.memoizedState!==null||(vh=je())),a&4&&ox(e);break;case 22:if(c=r!==null&&r.memoizedState!==null,e.mode&1?(wt=(u=wt)||c,wr(t,e),wt=u):wr(t,e),Mr(e),a&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&(e.mode&1)!==0)for(U=e,c=e.child;c!==null;){for(d=U=c;U!==null;){switch(f=U,h=f.child,f.tag){case 0:case 11:case 14:case 15:Xi(4,f,f.return);break;case 1:Wn(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){Fe(a,r,x)}}break;case 5:Wn(f,f.return);break;case 22:if(f.memoizedState!==null){sx(d);continue}}h!==null?(h.return=f,U=h):sx(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){Fe(e,e.return,x)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(x){Fe(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:wr(t,e),Mr(e),a&4&&ox(e);break;case 21:break;default:wr(t,e),Mr(e)}}function Mr(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(K0(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&&(Zi(o,""),a.flags&=-33);var n=ax(e);Em(e,n,o);break;case 3:case 4:var s=a.stateNode.containerInfo,i=ax(e);Rm(e,i,s);break;default:throw Error(R(161))}}catch(l){Fe(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function gT(e,t,r){U=e,Q0(e,t,r)}function Q0(e,t,r){for(var a=(e.mode&1)!==0;U!==null;){var o=U,n=o.child;if(o.tag===22&&a){var s=o.memoizedState!==null||Ju;if(!s){var i=o.alternate,l=i!==null&&i.memoizedState!==null||wt;i=Ju;var u=wt;if(Ju=s,(wt=l)&&!u)for(U=o;U!==null;)s=U,l=s.child,s.tag===22&&s.memoizedState!==null?ix(o):l!==null?(l.return=s,U=l):ix(o);for(;n!==null;)U=n,Q0(n,t,r),n=n.sibling;U=o,Ju=i,wt=u}nx(e,t,r)}else(o.subtreeFlags&8772)!==0&&n!==null?(n.return=o,U=n):nx(e,t,r)}}function nx(e){for(;U!==null;){var t=U;if((t.flags&8772)!==0){var r=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:wt||Vc(5,t);break;case 1:var a=t.stateNode;if(t.flags&4&&!wt)if(r===null)a.componentDidMount();else{var o=t.elementType===t.type?r.memoizedProps:Sr(t.type,r.memoizedProps);a.componentDidUpdate(o,r.memoizedState,a.__reactInternalSnapshotBeforeUpdate)}var n=t.updateQueue;n!==null&&Hv(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}Hv(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&&al(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(R(163))}wt||t.flags&512&&Am(t)}catch(f){Fe(t,t.return,f)}}if(t===e){U=null;break}if(r=t.sibling,r!==null){r.return=t.return,U=r;break}U=t.return}}function sx(e){for(;U!==null;){var t=U;if(t===e){U=null;break}var r=t.sibling;if(r!==null){r.return=t.return,U=r;break}U=t.return}}function ix(e){for(;U!==null;){var t=U;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Vc(4,t)}catch(l){Fe(t,r,l)}break;case 1:var a=t.stateNode;if(typeof a.componentDidMount=="function"){var o=t.return;try{a.componentDidMount()}catch(l){Fe(t,o,l)}}var n=t.return;try{Am(t)}catch(l){Fe(t,n,l)}break;case 5:var s=t.return;try{Am(t)}catch(l){Fe(t,s,l)}}}catch(l){Fe(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 yT=Math.ceil,Pc=da.ReactCurrentDispatcher,gh=da.ReactCurrentOwner,fr=da.ReactCurrentBatchConfig,ce=0,at=null,ze=null,lt=0,$t=0,Gn=Za(0),Xe=0,ml=null,Ho=0,jc=0,yh=0,Ji=null,Et=null,vh=0,ss=1/0,ra=null,Tc=!1,Dm=null,Ga=null,Qu=!1,ja=null,_c=0,Qi=0,Nm=null,nc=-1,sc=0;function Pt(){return(ce&6)!==0?je():nc!==-1?nc:nc=je()}function Ka(e){return(e.mode&1)===0?1:(ce&2)!==0&&lt!==0?lt&-lt:eT.transition!==null?(sc===0&&(sc=Mx()),sc):(e=he,e!==0||(e=window.event,e=e===void 0?16:qx(e.type)),e)}function Ir(e,t,r,a){if(50<Qi)throw Qi=0,Nm=null,Error(R(185));hl(e,r,a),((ce&2)===0||e!==at)&&(e===at&&((ce&2)===0&&(jc|=r),Xe===4&&Ua(e,lt)),Ot(e,a),r===1&&ce===0&&(t.mode&1)===0&&(ss=je()+500,Bc&&eo()))}function Ot(e,t){var r=e.callbackNode;rP(e,t);var a=fc(e,e===at?lt:0);if(a===0)r!==null&&hv(r),e.callbackNode=null,e.callbackPriority=0;else if(t=a&-a,e.callbackPriority!==t){if(r!=null&&hv(r),t===1)e.tag===0?ZP(lx.bind(null,e)):i0(lx.bind(null,e)),XP(function(){(ce&6)===0&&eo()}),r=null;else{switch(Ox(a)){case 1:r=zm;break;case 4:r=Dx;break;case 16:r=dc;break;case 536870912:r=Nx;break;default:r=dc}r=nw(r,Y0.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Y0(e,t){if(nc=-1,sc=0,(ce&6)!==0)throw Error(R(327));var r=e.callbackNode;if(Zn()&&e.callbackNode!==r)return null;var a=fc(e,e===at?lt:0);if(a===0)return null;if((a&30)!==0||(a&e.expiredLanes)!==0||t)t=Ac(e,a);else{t=a;var o=ce;ce|=2;var n=ew();(at!==e||lt!==t)&&(ra=null,ss=je()+500,Fo(e,t));do try{wT();break}catch(i){Z0(e,i)}while(!0);ah(),Pc.current=n,ce=o,ze!==null?t=0:(at=null,lt=0,t=Xe)}if(t!==0){if(t===2&&(o=im(e),o!==0&&(a=o,t=Mm(e,o))),t===1)throw r=ml,Fo(e,0),Ua(e,a),Ot(e,je()),r;if(t===6)Ua(e,a);else{if(o=e.current.alternate,(a&30)===0&&!vT(o)&&(t=Ac(e,a),t===2&&(n=im(e),n!==0&&(a=n,t=Mm(e,n))),t===1))throw r=ml,Fo(e,0),Ua(e,a),Ot(e,je()),r;switch(e.finishedWork=o,e.finishedLanes=a,t){case 0:case 1:throw Error(R(345));case 2:No(e,Et,ra);break;case 3:if(Ua(e,a),(a&130023424)===a&&(t=vh+500-je(),10<t)){if(fc(e,0)!==0)break;if(o=e.suspendedLanes,(o&a)!==a){Pt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=hm(No.bind(null,e,Et,ra),t);break}No(e,Et,ra);break;case 4:if(Ua(e,a),(a&4194240)===a)break;for(t=e.eventTimes,o=-1;0<a;){var s=31-Lr(a);n=1<<s,s=t[s],s>o&&(o=s),a&=~n}if(a=o,a=je()-a,a=(120>a?120:480>a?480:1080>a?1080:1920>a?1920:3e3>a?3e3:4320>a?4320:1960*yT(a/1960))-a,10<a){e.timeoutHandle=hm(No.bind(null,e,Et,ra),a);break}No(e,Et,ra);break;case 5:No(e,Et,ra);break;default:throw Error(R(329))}}}return Ot(e,je()),e.callbackNode===r?Y0.bind(null,e):null}function Mm(e,t){var r=Ji;return e.current.memoizedState.isDehydrated&&(Fo(e,t).flags|=256),e=Ac(e,t),e!==2&&(t=Et,Et=r,t!==null&&Om(t)),e}function Om(e){Et===null?Et=e:Et.push.apply(Et,e)}function vT(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(!kr(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 Ua(e,t){for(t&=~yh,t&=~jc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Lr(t),a=1<<r;e[r]=-1,t&=~a}}function lx(e){if((ce&6)!==0)throw Error(R(327));Zn();var t=fc(e,0);if((t&1)===0)return Ot(e,je()),null;var r=Ac(e,t);if(e.tag!==0&&r===2){var a=im(e);a!==0&&(t=a,r=Mm(e,a))}if(r===1)throw r=ml,Fo(e,0),Ua(e,t),Ot(e,je()),r;if(r===6)throw Error(R(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,No(e,Et,ra),Ot(e,je()),null}function xh(e,t){var r=ce;ce|=1;try{return e(t)}finally{ce=r,ce===0&&(ss=je()+500,Bc&&eo())}}function zo(e){ja!==null&&ja.tag===0&&(ce&6)===0&&Zn();var t=ce;ce|=1;var r=fr.transition,a=he;try{if(fr.transition=null,he=1,e)return e()}finally{he=a,fr.transition=r,ce=t,(ce&6)===0&&eo()}}function wh(){$t=Gn.current,ke(Gn)}function Fo(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,KP(r)),ze!==null)for(r=ze.return;r!==null;){var a=r;switch(eh(a),a.tag){case 1:a=a.type.childContextTypes,a!=null&&yc();break;case 3:os(),ke(Nt),ke(St),uh();break;case 5:lh(a);break;case 4:os();break;case 13:ke(Re);break;case 19:ke(Re);break;case 10:oh(a.type._context);break;case 22:case 23:wh()}r=r.return}if(at=e,ze=e=Xa(e.current,null),lt=$t=t,Xe=0,ml=null,yh=jc=Ho=0,Et=Ji=null,Oo!==null){for(t=0;t<Oo.length;t++)if(r=Oo[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}Oo=null}return e}function Z0(e,t){do{var r=ze;try{if(ah(),rc.current=kc,Ic){for(var a=Ee.memoizedState;a!==null;){var o=a.queue;o!==null&&(o.pending=null),a=a.next}Ic=!1}if(qo=0,rt=Ke=Ee=null,Ki=!1,dl=0,gh.current=null,r===null||r.return===null){Xe=1,ml=t,ze=null;break}e:{var n=e,s=r.return,i=r,l=t;if(t=lt,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 h=Xv(s);if(h!==null){h.flags&=-257,Jv(h,s,i,n,t),h.mode&1&&Kv(n,u,t),t=h,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){Kv(n,u,t),Sh();break e}l=Error(R(426))}}else if(Ae&&i.mode&1){var C=Xv(s);if(C!==null){(C.flags&65536)===0&&(C.flags|=256),Jv(C,s,i,n,t),th(ns(l,i));break e}}n=l=ns(l,i),Xe!==4&&(Xe=2),Ji===null?Ji=[n]:Ji.push(n),n=s;do{switch(n.tag){case 3:n.flags|=65536,t&=-t,n.lanes|=t;var g=O0(n,l,t);qv(n,g);break e;case 1:i=l;var p=n.type,y=n.stateNode;if((n.flags&128)===0&&(typeof p.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Ga===null||!Ga.has(y)))){n.flags|=65536,t&=-t,n.lanes|=t;var b=B0(n,i,t);qv(n,b);break e}}n=n.return}while(n!==null)}rw(r)}catch(L){t=L,ze===r&&r!==null&&(ze=r=r.return);continue}break}while(!0)}function ew(){var e=Pc.current;return Pc.current=kc,e===null?kc:e}function Sh(){(Xe===0||Xe===3||Xe===2)&&(Xe=4),at===null||(Ho&268435455)===0&&(jc&268435455)===0||Ua(at,lt)}function Ac(e,t){var r=ce;ce|=2;var a=ew();(at!==e||lt!==t)&&(ra=null,Fo(e,t));do try{xT();break}catch(o){Z0(e,o)}while(!0);if(ah(),ce=r,Pc.current=a,ze!==null)throw Error(R(261));return at=null,lt=0,Xe}function xT(){for(;ze!==null;)tw(ze)}function wT(){for(;ze!==null&&!Gk();)tw(ze)}function tw(e){var t=ow(e.alternate,e,$t);e.memoizedProps=e.pendingProps,t===null?rw(e):ze=t,gh.current=null}function rw(e){var t=e;do{var r=t.alternate;if(e=t.return,(t.flags&32768)===0){if(r=fT(r,t,$t),r!==null){ze=r;return}}else{if(r=pT(r,t),r!==null){r.flags&=32767,ze=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Xe=6,ze=null;return}}if(t=t.sibling,t!==null){ze=t;return}ze=t=e}while(t!==null);Xe===0&&(Xe=5)}function No(e,t,r){var a=he,o=fr.transition;try{fr.transition=null,he=1,ST(e,t,r,a)}finally{fr.transition=o,he=a}return null}function ST(e,t,r,a){do Zn();while(ja!==null);if((ce&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(aP(e,n),e===at&&(ze=at=null,lt=0),(r.subtreeFlags&2064)===0&&(r.flags&2064)===0||Qu||(Qu=!0,nw(dc,function(){return Zn(),null})),n=(r.flags&15990)!==0,(r.subtreeFlags&15990)!==0||n){n=fr.transition,fr.transition=null;var s=he;he=1;var i=ce;ce|=4,gh.current=null,hT(e,r),J0(r,e),HP(pm),pc=!!fm,pm=fm=null,e.current=r,gT(r,e,o),Kk(),ce=i,he=s,fr.transition=n}else e.current=r;if(Qu&&(Qu=!1,ja=e,_c=o),n=e.pendingLanes,n===0&&(Ga=null),Qk(r.stateNode,a),Ot(e,je()),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(Tc)throw Tc=!1,e=Dm,Dm=null,e;return(_c&1)!==0&&e.tag!==0&&Zn(),n=e.pendingLanes,(n&1)!==0?e===Nm?Qi++:(Qi=0,Nm=e):Qi=0,eo(),null}function Zn(){if(ja!==null){var e=Ox(_c),t=fr.transition,r=he;try{if(fr.transition=null,he=16>e?16:e,ja===null)var a=!1;else{if(e=ja,ja=null,_c=0,(ce&6)!==0)throw Error(R(331));var o=ce;for(ce|=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 c=U;switch(c.tag){case 0:case 11:case 15:Xi(8,c,n)}var d=c.child;if(d!==null)d.return=c,U=d;else for(;U!==null;){c=U;var f=c.sibling,h=c.return;if(G0(c),c===u){U=null;break}if(f!==null){f.return=h,U=f;break}U=h}}}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)}}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:Xi(9,n,n.return)}var g=n.sibling;if(g!==null){g.return=n.return,U=g;break e}U=n.return}}var p=e.current;for(U=p;U!==null;){s=U;var y=s.child;if((s.subtreeFlags&2064)!==0&&y!==null)y.return=s,U=y;else e:for(s=p;U!==null;){if(i=U,(i.flags&2048)!==0)try{switch(i.tag){case 0:case 11:case 15:Vc(9,i)}}catch(L){Fe(i,i.return,L)}if(i===s){U=null;break e}var b=i.sibling;if(b!==null){b.return=i.return,U=b;break e}U=i.return}}if(ce=o,eo(),Fr&&typeof Fr.onPostCommitFiberRoot=="function")try{Fr.onPostCommitFiberRoot(Ec,e)}catch{}a=!0}return a}finally{he=r,fr.transition=t}}return!1}function ux(e,t,r){t=ns(r,t),t=O0(e,t,1),e=Wa(e,t,1),t=Pt(),e!==null&&(hl(e,1,t),Ot(e,t))}function Fe(e,t,r){if(e.tag===3)ux(e,e,r);else for(;t!==null;){if(t.tag===3){ux(t,e,r);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Ga===null||!Ga.has(a))){e=ns(r,e),e=B0(t,e,1),t=Wa(t,e,1),e=Pt(),t!==null&&(hl(t,1,e),Ot(t,e));break}}t=t.return}}function CT(e,t,r){var a=e.pingCache;a!==null&&a.delete(t),t=Pt(),e.pingedLanes|=e.suspendedLanes&r,at===e&&(lt&r)===r&&(Xe===4||Xe===3&&(lt&130023424)===lt&&500>je()-vh?Fo(e,0):yh|=r),Ot(e,t)}function aw(e,t){t===0&&((e.mode&1)===0?t=1:(t=Bu,Bu<<=1,(Bu&130023424)===0&&(Bu=4194304)));var r=Pt();e=ua(e,t),e!==null&&(hl(e,t,r),Ot(e,r))}function bT(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),aw(e,r)}function LT(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),aw(e,r)}var ow;ow=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Nt.current)Dt=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return Dt=!1,dT(e,t,r);Dt=(e.flags&131072)!==0}else Dt=!1,Ae&&(t.flags&1048576)!==0&&l0(t,wc,t.index);switch(t.lanes=0,t.tag){case 2:var a=t.type;oc(e,t),e=t.pendingProps;var o=ts(t,St.current);Yn(t,r),o=dh(null,t,a,e,o,r);var n=fh();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,Mt(a)?(n=!0,vc(t)):n=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,sh(t),o.updater=Uc,t.stateNode=o,o._reactInternals=t,Cm(t,a,e,r),t=Im(null,t,a,!0,n,r)):(t.tag=0,Ae&&n&&Zm(t),kt(null,t,o,r),t=t.child),t;case 16:a=t.elementType;e:{switch(oc(e,t),e=t.pendingProps,o=a._init,a=o(a._payload),t.type=a,o=t.tag=kT(a),e=Sr(a,e),o){case 0:t=Lm(null,t,a,e,r);break e;case 1:t=Zv(null,t,a,e,r);break e;case 11:t=Qv(null,t,a,e,r);break e;case 14:t=Yv(null,t,a,Sr(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:Sr(a,o),Lm(e,t,a,o,r);case 1:return a=t.type,o=t.pendingProps,o=t.elementType===a?o:Sr(a,o),Zv(e,t,a,o,r);case 3:e:{if(j0(t),e===null)throw Error(R(387));a=t.pendingProps,n=t.memoizedState,o=n.element,m0(e,t),bc(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=ns(Error(R(423)),t),t=ex(e,t,a,r,o);break e}else if(a!==o){o=ns(Error(R(424)),t),t=ex(e,t,a,r,o);break e}else for(Wt=$a(t.stateNode.containerInfo.firstChild),Gt=t,Ae=!0,br=null,r=f0(t,null,a,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(rs(),a===o){t=ca(e,t,r);break e}kt(e,t,a,r)}t=t.child}return t;case 5:return h0(t),e===null&&xm(t),a=t.type,o=t.pendingProps,n=e!==null?e.memoizedProps:null,s=o.children,mm(a,o)?s=null:n!==null&&mm(a,n)&&(t.flags|=32),V0(e,t),kt(e,t,s,r),t.child;case 6:return e===null&&xm(t),null;case 13:return q0(e,t,r);case 4:return ih(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=as(t,null,a,r):kt(e,t,a,r),t.child;case 11:return a=t.type,o=t.pendingProps,o=t.elementType===a?o:Sr(a,o),Qv(e,t,a,o,r);case 7:return kt(e,t,t.pendingProps,r),t.child;case 8:return kt(e,t,t.pendingProps.children,r),t.child;case 12:return kt(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,Se(Sc,a._currentValue),a._currentValue=s,n!==null)if(kr(n.value,s)){if(n.children===o.children&&!Nt.current){t=ca(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=sa(-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),wm(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),wm(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}kt(e,t,o.children,r),t=t.child}return t;case 9:return o=t.type,a=t.pendingProps.children,Yn(t,r),o=pr(o),a=a(o),t.flags|=1,kt(e,t,a,r),t.child;case 14:return a=t.type,o=Sr(a,t.pendingProps),o=Sr(a.type,o),Yv(e,t,a,o,r);case 15:return F0(e,t,t.type,t.pendingProps,r);case 17:return a=t.type,o=t.pendingProps,o=t.elementType===a?o:Sr(a,o),oc(e,t),t.tag=1,Mt(a)?(e=!0,vc(t)):e=!1,Yn(t,r),M0(t,a,o),Cm(t,a,o,r),Im(null,t,a,!0,e,r);case 19:return H0(e,t,r);case 22:return U0(e,t,r)}throw Error(R(156,t.tag))};function nw(e,t){return Ex(e,t)}function IT(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 dr(e,t,r,a){return new IT(e,t,r,a)}function Ch(e){return e=e.prototype,!(!e||!e.isReactComponent)}function kT(e){if(typeof e=="function")return Ch(e)?1:0;if(e!=null){if(e=e.$$typeof,e===jm)return 11;if(e===qm)return 14}return 2}function Xa(e,t){var r=e.alternate;return r===null?(r=dr(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 ic(e,t,r,a,o,n){var s=2;if(a=e,typeof e=="function")Ch(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Bn:return Uo(r.children,o,n,t);case Vm:s=8,o|=8;break;case Wp:return e=dr(12,r,t,o|2),e.elementType=Wp,e.lanes=n,e;case Gp:return e=dr(13,r,t,o),e.elementType=Gp,e.lanes=n,e;case Kp:return e=dr(19,r,t,o),e.elementType=Kp,e.lanes=n,e;case hx:return qc(r,o,n,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case px:s=10;break e;case mx:s=9;break e;case jm:s=11;break e;case qm:s=14;break e;case Oa:s=16,a=null;break e}throw Error(R(130,e==null?e:typeof e,""))}return t=dr(s,r,t,o),t.elementType=e,t.type=a,t.lanes=n,t}function Uo(e,t,r,a){return e=dr(7,e,a,t),e.lanes=r,e}function qc(e,t,r,a){return e=dr(22,e,a,t),e.elementType=hx,e.lanes=r,e.stateNode={isHidden:!1},e}function Hp(e,t,r){return e=dr(6,e,null,t),e.lanes=r,e}function zp(e,t,r){return t=dr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function PT(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=Pp(0),this.expirationTimes=Pp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pp(0),this.identifierPrefix=a,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function bh(e,t,r,a,o,n,s,i,l){return e=new PT(e,t,r,i,l),t===1?(t=1,n===!0&&(t|=8)):t=0,n=dr(3,null,null,t),e.current=n,n.stateNode=e,n.memoizedState={element:a,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},sh(n),e}function TT(e,t,r){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:On,key:a==null?null:""+a,children:e,containerInfo:t,implementation:r}}function sw(e){if(!e)return Qa;e=e._reactInternals;e:{if(Wo(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(Mt(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(Mt(r))return s0(e,r,t)}return t}function iw(e,t,r,a,o,n,s,i,l){return e=bh(r,a,!0,e,o,n,s,i,l),e.context=sw(null),r=e.current,a=Pt(),o=Ka(r),n=sa(a,o),n.callback=t??null,Wa(r,n,o),e.current.lanes=o,hl(e,o,a),Ot(e,a),e}function Hc(e,t,r,a){var o=t.current,n=Pt(),s=Ka(o);return r=sw(r),t.context===null?t.context=r:t.pendingContext=r,t=sa(n,s),t.payload={element:e},a=a===void 0?null:a,a!==null&&(t.callback=a),e=Wa(o,t,s),e!==null&&(Ir(e,o,s,n),tc(e,o,s)),s}function Rc(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function cx(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Lh(e,t){cx(e,t),(e=e.alternate)&&cx(e,t)}function _T(){return null}var lw=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ih(e){this._internalRoot=e}zc.prototype.render=Ih.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(R(409));Hc(e,t,null,null)};zc.prototype.unmount=Ih.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;zo(function(){Hc(null,e,null,null)}),t[la]=null}};function zc(e){this._internalRoot=e}zc.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ux();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Fa.length&&t!==0&&t<Fa[r].priority;r++);Fa.splice(r,0,e),r===0&&jx(e)}};function kh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function $c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function dx(){}function AT(e,t,r,a,o){if(o){if(typeof a=="function"){var n=a;a=function(){var u=Rc(s);n.call(u)}}var s=iw(t,a,e,0,null,!1,!1,"",dx);return e._reactRootContainer=s,e[la]=s.current,sl(e.nodeType===8?e.parentNode:e),zo(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof a=="function"){var i=a;a=function(){var u=Rc(l);i.call(u)}}var l=bh(e,0,!1,null,null,!1,!1,"",dx);return e._reactRootContainer=l,e[la]=l.current,sl(e.nodeType===8?e.parentNode:e),zo(function(){Hc(t,l,r,a)}),l}function Wc(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=Rc(s);i.call(l)}}Hc(t,s,e,o)}else s=AT(r,t,e,o,a);return Rc(s)}Bx=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=ji(t.pendingLanes);r!==0&&($m(t,r|1),Ot(t,je()),(ce&6)===0&&(ss=je()+500,eo()))}break;case 13:zo(function(){var a=ua(e,1);if(a!==null){var o=Pt();Ir(a,e,1,o)}}),Lh(e,1)}};Wm=function(e){if(e.tag===13){var t=ua(e,134217728);if(t!==null){var r=Pt();Ir(t,e,134217728,r)}Lh(e,134217728)}};Fx=function(e){if(e.tag===13){var t=Ka(e),r=ua(e,t);if(r!==null){var a=Pt();Ir(r,e,t,a)}Lh(e,t)}};Ux=function(){return he};Vx=function(e,t){var r=he;try{return he=e,t()}finally{he=r}};om=function(e,t,r){switch(t){case"input":if(Qp(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=Oc(a);if(!o)throw Error(R(90));yx(a),Qp(a,o)}}}break;case"textarea":xx(e,r);break;case"select":t=r.value,t!=null&&Kn(e,!!r.multiple,t,!1)}};kx=xh;Px=zo;var RT={usingClientEntryPoint:!1,Events:[yl,jn,Oc,Lx,Ix,xh]},Bi={findFiberByHostInstance:Mo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ET={bundleType:Bi.bundleType,version:Bi.version,rendererPackageName:Bi.rendererPackageName,rendererConfig:Bi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:da.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Ax(e),e===null?null:e.stateNode},findFiberByHostInstance:Bi.findFiberByHostInstance||_T,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Fi=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Fi.isDisabled&&Fi.supportsFiber))try{Ec=Fi.inject(ET),Fr=Fi}catch{}var Fi;Jt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=RT;Jt.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!kh(t))throw Error(R(200));return TT(e,t,null,r)};Jt.createRoot=function(e,t){if(!kh(e))throw Error(R(299));var r=!1,a="",o=lw;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=bh(e,1,!1,null,null,r,!1,a,o),e[la]=t.current,sl(e.nodeType===8?e.parentNode:e),new Ih(t)};Jt.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=Ax(t),e=e===null?null:e.stateNode,e};Jt.flushSync=function(e){return zo(e)};Jt.hydrate=function(e,t,r){if(!$c(t))throw Error(R(200));return Wc(null,e,t,!0,r)};Jt.hydrateRoot=function(e,t,r){if(!kh(e))throw Error(R(405));var a=r!=null&&r.hydratedSources||null,o=!1,n="",s=lw;if(r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(n=r.identifierPrefix),r.onRecoverableError!==void 0&&(s=r.onRecoverableError)),t=iw(t,null,e,1,r??null,o,!1,n,s),e[la]=t.current,sl(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 zc(t)};Jt.render=function(e,t,r){if(!$c(t))throw Error(R(200));return Wc(null,e,t,!1,r)};Jt.unmountComponentAtNode=function(e){if(!$c(e))throw Error(R(40));return e._reactRootContainer?(zo(function(){Wc(null,null,e,!1,function(){e._reactRootContainer=null,e[la]=null})}),!0):!1};Jt.unstable_batchedUpdates=xh;Jt.unstable_renderSubtreeIntoContainer=function(e,t,r,a){if(!$c(r))throw Error(R(200));if(e==null||e._reactInternals===void 0)throw Error(R(38));return Wc(e,t,r,!1,a)};Jt.version="18.3.1-next-f1338f8080-20240426"});var Ph=ta((JD,dw)=>{"use strict";function cw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(cw)}catch(e){console.error(e)}}cw(),dw.exports=uw()});var pw=ta(Th=>{"use strict";var fw=Ph();Th.createRoot=fw.createRoot,Th.hydrateRoot=fw.hydrateRoot;var QD});var _S=ta(hd=>{"use strict";var qA=Q(),HA=Symbol.for("react.element"),zA=Symbol.for("react.fragment"),$A=Object.prototype.hasOwnProperty,WA=qA.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,GA={key:!0,ref:!0,__self:!0,__source:!0};function TS(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)$A.call(t,a)&&!GA.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:HA,type:e,key:n,ref:s,props:o,_owner:WA.current}}hd.Fragment=zA;hd.jsx=TS;hd.jsxs=TS});var ue=ta((BO,AS)=>{"use strict";AS.exports=_S()});var jD={};mk(jD,{initKiteChat:()=>xy});var Yr=O(Q(),1),KI=O(pw(),1);var F=O(Q(),1);function Go(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 mw(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 hw=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);var us=class extends Error{constructor(t,r="FunctionsError",a){super(t),this.name=r,this.context=a}},xl=class extends us{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}},cs=class extends us{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}},ds=class extends us{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}},wl;(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"})(wl||(wl={}));var Sl=class{constructor(t,{headers:r={},customFetch:a,region:o=wl.Any}={}){this.url=t,this.headers=r,this.region=o,this.fetch=hw(a)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return mw(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:h}=a;h||(h=this.region);let v=new URL(`${this.url}/${r}`);h&&h!=="any"&&(f["x-region"]=h,v.searchParams.set("forceFunctionRegion",h));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 xl(L)}),p=g.headers.get("x-relay-error");if(p&&p==="true")throw new cs(g);if(!g.ok)throw new ds(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 ds||i instanceof cs?i.context:void 0}}finally{n&&clearTimeout(n)}})}};var yw=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}},DT=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 h;let g=await n.text();g===""||(r.headers.get("Accept")==="text/csv"||r.headers.get("Accept")&&(!((h=r.headers.get("Accept"))===null||h===void 0)&&h.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 yw(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+=`
9
9
 
10
10
  Caused by: ${(f=l?.name)!==null&&f!==void 0?f:"Error"}: ${v}`,x&&(i+=` (${x})`),l?.stack&&(i+=`
11
11
  ${l.stack}`)}else{var h;i=(h=n?.stack)!==null&&h!==void 0?h:""}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}},NT=class extends DT{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}},gw=new RegExp("[,()]"),fs=class extends NT{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"&&gw.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"&&gw.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}},MT=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 fs({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 fs({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 fs({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 fs({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 fs({method:r,url:a,headers:o,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch})}},vw=class xw{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 MT(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(t){return new xw(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=h=>h!==null&&typeof h=="object"&&(!Array.isArray(h)||h.some(c)),d=a&&Object.values(r).some(c);d?(i="POST",u=r):a||o?(i=a?"HEAD":"GET",Object.entries(r).filter(([h,v])=>v!==void 0).map(([h,v])=>[h,Array.isArray(v)?`{${v.join(",")}}`:`${v}`]).forEach(([h,v])=>{l.searchParams.append(h,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 fs({method:i,url:l,headers:f,schema:this.schemaName,body:u,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch})}};var _h=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:
12
12
  import ws from "ws"
13
13
  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+=`
14
14
 
15
- 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}}},Ah=_h;var ww="2.90.1";var Sw=`realtime-js/${ww}`,Rh="1.0.0",Cw="2.0.0",Eh=Rh;var Cl=1e4,bw=1e3,Lw=100,fa;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(fa||(fa={}));var $e;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})($e||($e={}));var Qt;(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"})(Qt||(Qt={}));var Gc;(function(e){e.websocket="websocket"})(Gc||(Gc={}));var to;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(to||(to={}));var bl=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,h=new ArrayBuffer(this.HEADER_LENGTH+f),v=new DataView(h),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(h.byteLength+a.byteLength);return C.set(new Uint8Array(h),0),C.set(new Uint8Array(a),h.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),h=i===this.JSON_ENCODING?JSON.parse(a.decode(f)):f,v={type:this.BROADCAST_EVENT,event:c,payload:h};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 Xo=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 Nh=(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]=OT(s,e,t,o),n),{}):{}},OT=(e,t,r,a)=>{let o=t.find(i=>i.name===e),n=o?.type,s=r[e];return n&&!a.includes(n)?Iw(n,s):Dh(s)},Iw=(e,t)=>{if(e.charAt(0)==="_"){let r=e.slice(1,e.length);return VT(t,r)}switch(e){case Ce.bool:return BT(t);case Ce.float4:case Ce.float8:case Ce.int2:case Ce.int4:case Ce.int8:case Ce.numeric:case Ce.oid:return FT(t);case Ce.json:case Ce.jsonb:return UT(t);case Ce.timestamp:return jT(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 Dh(t);default:return Dh(t)}},Dh=e=>e,BT=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},FT=e=>{if(typeof e=="string"){let t=parseFloat(e);if(!Number.isNaN(t))return t}return e},UT=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},VT=(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=>Iw(t,i))}return e},jT=e=>typeof e=="string"?e.replace(" ","T"):e,Kc=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 Jo=class{constructor(t,r,a={},o=Cl){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 Mh;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(Mh||(Mh={}));var ps=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),h=d.map(C=>C.presence_ref),v=c.filter(C=>h.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(h=>h.presence_ref),f=c.filter(h=>d.indexOf(h.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 Oh;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(Oh||(Oh={}));var ms;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(ms||(ms={}));var Vr;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Vr||(Vr={}));var hs=class e{constructor(t,r={config:{}},a){var o,n;if(this.topic=t,this.params=r,this.socket=a,this.bindings={},this.state=$e.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 Jo(this,Qt.join,this.params,this.timeout),this.rejoinTimer=new Xo(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=$e.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=$e.closed,this.socket._remove(this)}),this._onError(s=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,s),this.state=$e.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=$e.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",s=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,s),this.state=$e.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Qt.reply,{},(s,i)=>{this._trigger(this._replyEventName(i),s)}),this.presence=new ps(this),this.broadcastEndpointURL=Kc(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==$e.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(h=>h.filter))!==null&&o!==void 0?o:[],c=!!this.bindings[ms.PRESENCE]&&this.bindings[ms.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(h=>t?.(Vr.CHANNEL_ERROR,h)),this._onClose(()=>t?.(Vr.CLOSED)),this.updateJoinPayload(Object.assign({config:f},d)),this.joinedOnce=!0,this._rejoin(r),this.joinPush.receive("ok",async({postgres_changes:h})=>{var v;if(this.socket._isManualToken()||this.socket.setAuth(),h===void 0){t?.(Vr.SUBSCRIBED);return}else{let x=this.bindings.postgres_changes,C=(v=x?.length)!==null&&v!==void 0?v:0,g=[];for(let p=0;p<C;p++){let y=x[p],{filter:{event:b,schema:L,table:P,filter:T}}=y,A=h&&h[p];if(A&&A.event===b&&e.isFilterValueEqual(A.schema,L)&&e.isFilterValueEqual(A.table,P)&&e.isFilterValueEqual(A.filter,T))g.push(Object.assign(Object.assign({},y),{id:A.id}));else{this.unsubscribe(),this.state=$e.errored,t?.(Vr.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=g,t&&t(Vr.SUBSCRIBED);return}}).receive("error",h=>{this.state=$e.errored,t?.(Vr.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(h).join(", ")||"error")))}).receive("timeout",()=>{t?.(Vr.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===$e.joined&&t===ms.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=$e.leaving;let r=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Qt.close,"leave",this._joinRef())};this.joinPush.destroy();let a=null;return new Promise(o=>{a=new Jo(this,Qt.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=$e.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 Jo(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>Lw){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}=Qt;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(h=>{var v,x,C;return((v=h.filter)===null||v===void 0?void 0:v.event)==="*"||((C=(x=h.filter)===null||x===void 0?void 0:x.event)===null||C===void 0?void 0:C.toLocaleLowerCase())===s}).map(h=>h.callback(f,a)):(n=this.bindings[s])===null||n===void 0||n.filter(h=>{var v,x,C,g,p,y,b,L;if(["broadcast","presence","postgres_changes"].includes(s))if("id"in h){let P=h.id,T=(v=h.filter)===null||v===void 0?void 0:v.event;return P&&((x=r.ids)===null||x===void 0?void 0:x.includes(P))&&(T==="*"||T?.toLocaleLowerCase()===((C=r.data)===null||C===void 0?void 0:C.type.toLocaleLowerCase()))&&(!(!((g=h.filter)===null||g===void 0)&&g.table)||h.filter.table===((p=r.data)===null||p===void 0?void 0:p.table))}else{let P=(b=(y=h?.filter)===null||y===void 0?void 0:y.event)===null||b===void 0?void 0:b.toLocaleLowerCase();return P==="*"||P===((L=r?.event)===null||L===void 0?void 0:L.toLocaleLowerCase())}else return h.type.toLocaleLowerCase()===s}).map(h=>{if(typeof f=="object"&&"ids"in f){let v=f.data,{schema:x,table:C,commit_timestamp:g,type:p,errors:y}=v;f=Object.assign(Object.assign({},{schema:x,table:C,commit_timestamp:g,eventType:p,new:{},old:{},errors:y}),this._getPayloadRecords(v))}h.callback(f,a)})}_isClosed(){return this.state===$e.closed}_isJoined(){return this.state===$e.joined}_isJoining(){return this.state===$e.joining}_isLeaving(){return this.state===$e.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(Qt.close,{},t)}_onError(t){this._on(Qt.error,{},r=>t(r))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=$e.joining,this.joinPush.resend(t))}_getPayloadRecords(t){let r={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(r.new=Nh(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(r.old=Nh(t.columns,t.old_record)),r}};var Bh=()=>{},Xc={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},HT=[1e3,2e3,5e3,1e4],zT=1e4,$T=`
15
+ 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}}},Ah=_h;var ww="2.90.1";var Sw=`realtime-js/${ww}`,Rh="1.0.0",Cw="2.0.0",Eh=Rh;var Cl=1e4,bw=1e3,Lw=100,fa;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(fa||(fa={}));var $e;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})($e||($e={}));var Qt;(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"})(Qt||(Qt={}));var Gc;(function(e){e.websocket="websocket"})(Gc||(Gc={}));var to;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(to||(to={}));var bl=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,h=new ArrayBuffer(this.HEADER_LENGTH+f),v=new DataView(h),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(h.byteLength+a.byteLength);return C.set(new Uint8Array(h),0),C.set(new Uint8Array(a),h.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),h=i===this.JSON_ENCODING?JSON.parse(a.decode(f)):f,v={type:this.BROADCAST_EVENT,event:c,payload:h};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 Ko=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 Nh=(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]=OT(s,e,t,o),n),{}):{}},OT=(e,t,r,a)=>{let o=t.find(i=>i.name===e),n=o?.type,s=r[e];return n&&!a.includes(n)?Iw(n,s):Dh(s)},Iw=(e,t)=>{if(e.charAt(0)==="_"){let r=e.slice(1,e.length);return VT(t,r)}switch(e){case Ce.bool:return BT(t);case Ce.float4:case Ce.float8:case Ce.int2:case Ce.int4:case Ce.int8:case Ce.numeric:case Ce.oid:return FT(t);case Ce.json:case Ce.jsonb:return UT(t);case Ce.timestamp:return jT(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 Dh(t);default:return Dh(t)}},Dh=e=>e,BT=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},FT=e=>{if(typeof e=="string"){let t=parseFloat(e);if(!Number.isNaN(t))return t}return e},UT=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},VT=(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=>Iw(t,i))}return e},jT=e=>typeof e=="string"?e.replace(" ","T"):e,Kc=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 Xo=class{constructor(t,r,a={},o=Cl){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 Mh;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(Mh||(Mh={}));var ps=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),h=d.map(C=>C.presence_ref),v=c.filter(C=>h.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(h=>h.presence_ref),f=c.filter(h=>d.indexOf(h.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 Oh;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(Oh||(Oh={}));var ms;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(ms||(ms={}));var Vr;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Vr||(Vr={}));var hs=class e{constructor(t,r={config:{}},a){var o,n;if(this.topic=t,this.params=r,this.socket=a,this.bindings={},this.state=$e.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 Xo(this,Qt.join,this.params,this.timeout),this.rejoinTimer=new Ko(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=$e.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=$e.closed,this.socket._remove(this)}),this._onError(s=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,s),this.state=$e.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=$e.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",s=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,s),this.state=$e.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Qt.reply,{},(s,i)=>{this._trigger(this._replyEventName(i),s)}),this.presence=new ps(this),this.broadcastEndpointURL=Kc(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==$e.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(h=>h.filter))!==null&&o!==void 0?o:[],c=!!this.bindings[ms.PRESENCE]&&this.bindings[ms.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(h=>t?.(Vr.CHANNEL_ERROR,h)),this._onClose(()=>t?.(Vr.CLOSED)),this.updateJoinPayload(Object.assign({config:f},d)),this.joinedOnce=!0,this._rejoin(r),this.joinPush.receive("ok",async({postgres_changes:h})=>{var v;if(this.socket._isManualToken()||this.socket.setAuth(),h===void 0){t?.(Vr.SUBSCRIBED);return}else{let x=this.bindings.postgres_changes,C=(v=x?.length)!==null&&v!==void 0?v:0,g=[];for(let p=0;p<C;p++){let y=x[p],{filter:{event:b,schema:L,table:P,filter:T}}=y,A=h&&h[p];if(A&&A.event===b&&e.isFilterValueEqual(A.schema,L)&&e.isFilterValueEqual(A.table,P)&&e.isFilterValueEqual(A.filter,T))g.push(Object.assign(Object.assign({},y),{id:A.id}));else{this.unsubscribe(),this.state=$e.errored,t?.(Vr.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=g,t&&t(Vr.SUBSCRIBED);return}}).receive("error",h=>{this.state=$e.errored,t?.(Vr.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(h).join(", ")||"error")))}).receive("timeout",()=>{t?.(Vr.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===$e.joined&&t===ms.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=$e.leaving;let r=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Qt.close,"leave",this._joinRef())};this.joinPush.destroy();let a=null;return new Promise(o=>{a=new Xo(this,Qt.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=$e.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 Xo(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>Lw){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}=Qt;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(h=>{var v,x,C;return((v=h.filter)===null||v===void 0?void 0:v.event)==="*"||((C=(x=h.filter)===null||x===void 0?void 0:x.event)===null||C===void 0?void 0:C.toLocaleLowerCase())===s}).map(h=>h.callback(f,a)):(n=this.bindings[s])===null||n===void 0||n.filter(h=>{var v,x,C,g,p,y,b,L;if(["broadcast","presence","postgres_changes"].includes(s))if("id"in h){let P=h.id,T=(v=h.filter)===null||v===void 0?void 0:v.event;return P&&((x=r.ids)===null||x===void 0?void 0:x.includes(P))&&(T==="*"||T?.toLocaleLowerCase()===((C=r.data)===null||C===void 0?void 0:C.type.toLocaleLowerCase()))&&(!(!((g=h.filter)===null||g===void 0)&&g.table)||h.filter.table===((p=r.data)===null||p===void 0?void 0:p.table))}else{let P=(b=(y=h?.filter)===null||y===void 0?void 0:y.event)===null||b===void 0?void 0:b.toLocaleLowerCase();return P==="*"||P===((L=r?.event)===null||L===void 0?void 0:L.toLocaleLowerCase())}else return h.type.toLocaleLowerCase()===s}).map(h=>{if(typeof f=="object"&&"ids"in f){let v=f.data,{schema:x,table:C,commit_timestamp:g,type:p,errors:y}=v;f=Object.assign(Object.assign({},{schema:x,table:C,commit_timestamp:g,eventType:p,new:{},old:{},errors:y}),this._getPayloadRecords(v))}h.callback(f,a)})}_isClosed(){return this.state===$e.closed}_isJoined(){return this.state===$e.joined}_isJoining(){return this.state===$e.joining}_isLeaving(){return this.state===$e.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(Qt.close,{},t)}_onError(t){this._on(Qt.error,{},r=>t(r))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=$e.joining,this.joinPush.resend(t))}_getPayloadRecords(t){let r={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(r.new=Nh(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(r.old=Nh(t.columns,t.old_record)),r}};var Bh=()=>{},Xc={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},HT=[1e3,2e3,5e3,1e4],zT=1e4,$T=`
16
16
  addEventListener("message", (e) => {
17
17
  if (e.data.event === "start") {
18
18
  setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
@@ -30,8 +30,8 @@ Option 2: Install and provide the "ws" package:
30
30
  const client = new RealtimeClient(url, {
31
31
  ...options,
32
32
  transport: ws
33
- })`):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 fa.connecting:return to.Connecting;case fa.open:return to.Open;case fa.closing:return to.Closing;default:return to.Closed}}isConnected(){return this.connectionState()===to.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 hs(`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(bw,"heartbeat timeout"),setTimeout(()=>{var r;this.isConnected()||(r=this.reconnectTimer)===null||r===void 0||r.scheduleTimeout()},Xc.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===fa.open&&this._onConnOpen())}_teardownConnection(){if(this.conn){if(this.conn.readyState===fa.open||this.conn.readyState===fa.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(Qt.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([$T],{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:Sw};r&&o.updateJoinPayload(n),o.joinedOnce&&o._isJoined()&&o._push(Qt.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 Xo(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},Xc.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(t){var r,a,o,n,s,i,l,u,c,d,f,h;switch(this.transport=(r=t?.transport)!==null&&r!==void 0?r:null,this.timeout=(a=t?.timeout)!==null&&a!==void 0?a:Cl,this.heartbeatIntervalMs=(o=t?.heartbeatIntervalMs)!==null&&o!==void 0?o:Xc.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:Bh,this.vsn=(l=t?.vsn)!==null&&l!==void 0?l:Eh,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=>HT[v-1]||zT),this.vsn){case Rh: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 Cw:this.encode=(f=t?.encode)!==null&&f!==void 0?f:this.serializer.encode.bind(this.serializer),this.decode=(h=t?.decode)!==null&&h!==void 0?h: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 Ll=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 WT(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 GT(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 KT(e){let t=e.fetchImpl??globalThis.fetch;return{async request({method:r,path:a,query:o,body:n,headers:s}){let i=WT(e.baseUrl,a,o),l=await GT(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 h=d?f:void 0,v=h?.error;throw new Ll(v?.message??`Request failed with status ${u.status}`,{status:u.status,icebergType:v?.type,icebergCode:v?.code,details:h})}return{status:u.status,headers:u.headers,data:f}}}}function Jc(e){return e.join("")}var XT=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){let t=e?{parent:Jc(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/${Jc(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Jc(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Jc(e.namespace)}`}),!0}catch(t){if(t instanceof Ll&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(r){if(r instanceof Ll&&r.status===409)return;throw r}}};function ys(e){return e.join("")}var JT=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/${ys(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/${ys(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/${ys(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/${ys(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/${ys(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/${ys(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(r){if(r instanceof Ll&&r.status===404)return!1;throw r}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(r){if(r instanceof Ll&&r.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw r}}},kw=class{constructor(e){let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);let r=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=KT({baseUrl:r,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=e.accessDelegation?.join(","),this.namespaceOps=new XT(this.client,t),this.tableOps=new JT(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 Qc=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 QT=class extends Qc{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}}},Vh=class extends Qc{constructor(e,t){super(e),this.name="StorageUnknownError",this.originalError=t}},Hh=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),YT=()=>Response,jh=e=>{if(Array.isArray(e))return e.map(r=>jh(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]=jh(a)}),t},ZT=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)},e_=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e);function Il(e){"@babel/helpers - typeof";return Il=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},Il(e)}function t_(e,t){if(Il(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t||"default");if(Il(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function r_(e){var t=t_(e,"string");return Il(t)=="symbol"?t:t+""}function a_(e,t,r){return(t=r_(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Pw(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 K(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Pw(Object(r),!0).forEach(function(a){a_(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pw(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}var Fh=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)},o_=async(e,t,r)=>{e instanceof await YT()&&!r?.noResolveJson?e.json().then(a=>{let o=e.status||500,n=a?.statusCode||o+"";t(new QT(Fh(a),o,n))}).catch(a=>{t(new Vh(Fh(a),a))}):t(new Vh(Fh(e),e))},n_=(e,t,r,a)=>{let o={method:e,headers:t?.headers||{}};return e==="GET"||!a?o:(ZT(a)?(o.headers=K({"Content-Type":"application/json"},t?.headers),o.body=JSON.stringify(a)):o.body=a,t?.duplex&&(o.duplex=t.duplex),K(K({},o),r))};async function Pl(e,t,r,a,o,n){return new Promise((s,i)=>{e(r,n_(t,a,o,n)).then(l=>{if(!l.ok)throw l;return a?.noResolveJson?l:l.json()}).then(l=>s(l)).catch(l=>o_(l,i,a))})}async function kl(e,t,r,a){return Pl(e,"GET",t,r,a)}async function Pr(e,t,r,a,o){return Pl(e,"POST",t,a,o,r)}async function qh(e,t,r,a,o){return Pl(e,"PUT",t,a,o,r)}async function s_(e,t,r,a){return Pl(e,"HEAD",t,K(K({},r),{},{noResolveJson:!0}),a)}async function zh(e,t,r,a,o){return Pl(e,"DELETE",t,a,o,r)}var i_=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}}},Aw;Aw=Symbol.toStringTag;var l_=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[Aw]="BlobDownloadBuilder",this.promise=null}asStream(){return new i_(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}}},u_={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Tw={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},c_=class{constructor(e,t={},r,a){this.shouldThrowOnError=!1,this.url=e,this.headers=t,this.bucketId=r,this.fetch=Hh(a)}throwOnError(){return this.shouldThrowOnError=!0,this}async uploadOrUpdate(e,t,r,a){var o=this;try{let n,s=K(K({},Tw),a),i=K(K({},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=K(K({},i),a.headers));let u=o._removeEmptyFolders(t),c=o._getFinalPath(u),d=await(e=="PUT"?qh:Pr)(o.fetch,`${o.url}/object/${c}`,n,K({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=K({upsert:Tw.upsert},a),c=K(K({},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 qh(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=K({},r.headers);t?.upsert&&(o["x-upsert"]="true");let n=await Pr(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 Qc("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 Pr(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 Pr(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 Pr(a.fetch,`${a.url}/object/sign/${o}`,K({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 Pr(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=>K(K({},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=()=>kl(this.fetch,`${this.url}/${r}/${n}${o}`,{headers:this.headers,noResolveJson:!0});return new l_(s,this.shouldThrowOnError)}async info(e){var t=this;let r=t._getFinalPath(e);try{return{data:jh(await kl(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 s_(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 Vh){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 zh(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=K(K(K({},u_),t),{},{prefix:e||""});return{data:await Pr(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=K({},e);return{data:await Pr(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("&")}},Rw="2.90.1",Ew={"X-Client-Info":`storage-js/${Rw}`},d_=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=K(K({},Ew),t),this.fetch=Hh(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async listBuckets(e){var t=this;try{let r=t.listBucketOptionsToQueryString(e);return{data:await kl(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 kl(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 Pr(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 qh(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 Pr(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 zh(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():""}},f_=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=K(K({},Ew),t),this.fetch=Hh(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async createBucket(e){var t=this;try{return{data:await Pr(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 kl(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 zh(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(!e_(e))throw new Qc("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 kw({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}}}}})}},$h={"X-Client-Info":`storage-js/${Rw}`,"Content-Type":"application/json"},Dw=class extends Error{constructor(e){super(e),this.__isStorageVectorsError=!0,this.name="StorageVectorsError"}};function Yt(e){return typeof e=="object"&&e!==null&&"__isStorageVectorsError"in e}var Uh=class extends Dw{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}}},p_=class extends Dw{constructor(e,t){super(e),this.name="StorageVectorsUnknownError",this.originalError=t}};var Wh=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);var m_=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 _w=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),h_=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 Uh(_w(n),a,s))}).catch(()=>{let n=a+"";t(new Uh(o.statusText||`HTTP ${a} error`,a,n))});else{let n=a+"";t(new Uh(o.statusText||`HTTP ${a} error`,a,n))}}else t(new p_(_w(e),e))},g_=(e,t,r,a)=>{let o={method:e,headers:t?.headers||{}};return e==="GET"||!a?o:(m_(a)?(o.headers=K({"Content-Type":"application/json"},t?.headers),o.body=JSON.stringify(a)):o.body=a,K(K({},o),r))};async function y_(e,t,r,a,o,n){return new Promise((s,i)=>{e(r,g_(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=>h_(l,i,a))})}async function Zt(e,t,r,a,o){return y_(e,"POST",t,a,o,r)}var v_=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=K(K({},$h),t),this.fetch=Wh(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async createIndex(e){var t=this;try{return{data:await Zt(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Yt(r))return{data:null,error:r};throw r}}async getIndex(e,t){var r=this;try{return{data:await Zt(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers}),error:null}}catch(a){if(r.shouldThrowOnError)throw a;if(Yt(a))return{data:null,error:a};throw a}}async listIndexes(e){var t=this;try{return{data:await Zt(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Yt(r))return{data:null,error:r};throw r}}async deleteIndex(e,t){var r=this;try{return{data:await Zt(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers})||{},error:null}}catch(a){if(r.shouldThrowOnError)throw a;if(Yt(a))return{data:null,error:a};throw a}}},x_=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=K(K({},$h),t),this.fetch=Wh(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 Zt(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Yt(r))return{data:null,error:r};throw r}}async getVectors(e){var t=this;try{return{data:await Zt(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Yt(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 Zt(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Yt(r))return{data:null,error:r};throw r}}async queryVectors(e){var t=this;try{return{data:await Zt(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Yt(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 Zt(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Yt(r))return{data:null,error:r};throw r}}},w_=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=K(K({},$h),t),this.fetch=Wh(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async createBucket(e){var t=this;try{return{data:await Zt(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Yt(r))return{data:null,error:r};throw r}}async getBucket(e){var t=this;try{return{data:await Zt(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Yt(r))return{data:null,error:r};throw r}}async listBuckets(e={}){var t=this;try{return{data:await Zt(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Yt(r))return{data:null,error:r};throw r}}async deleteBucket(e){var t=this;try{return{data:await Zt(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Yt(r))return{data:null,error:r};throw r}}},S_=class extends w_{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new C_(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)}},C_=class extends v_{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,K(K({},e),{},{vectorBucketName:r.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,r=this;return t().call(r,K(K({},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 b_(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},b_=class extends x_{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,K(K({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(e){var t=()=>super.getVectors,r=this;return t().call(r,K(K({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,r=this;return t().call(r,K(K({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,r=this;return t().call(r,K(K({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,r=this;return t().call(r,K(K({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},Nw=class extends d_{constructor(e,t={},r,a){super(e,t,r,a)}from(e){return new c_(this.url,this.headers,e,this.fetch)}get vectors(){return new S_(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new f_(this.url+"/iceberg",this.headers,this.fetch)}};var Yc="2.90.1";var Qo=30*1e3,Zc=3,ed=Zc*Qo,Mw="http://localhost:9999",Ow="supabase.auth.token";var Bw={"X-Client-Info":`gotrue-js/${Yc}`};var Tl="X-Supabase-Api-Version",Gh={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},Fw=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,Uw=600*1e3;var ro=class extends Error{constructor(t,r,a){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=a}};function H(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}var td=class extends ro{constructor(t,r,a){super(t,r,a),this.name="AuthApiError",this.status=r,this.code=a}};function Vw(e){return H(e)&&e.name==="AuthApiError"}var hr=class extends ro{constructor(t,r){super(t),this.name="AuthUnknownError",this.originalError=r}},Tr=class extends ro{constructor(t,r,a,o){super(t,a,o),this.name=r,this.status=a}},ct=class extends Tr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};function jw(e){return H(e)&&e.name==="AuthSessionMissingError"}var pa=class extends Tr{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}},Yo=class extends Tr{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}},Zo=class extends Tr{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 qw(e){return H(e)&&e.name==="AuthImplicitGrantRedirectError"}var _l=class extends Tr{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}}},rd=class extends Tr{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 vs=class extends Tr{constructor(t,r){super(t,"AuthRetryableFetchError",r,void 0)}};function ad(e){return H(e)&&e.name==="AuthRetryableFetchError"}var Al=class extends Tr{constructor(t,r,a){super(t,"AuthWeakPasswordError",r,"weak_password"),this.reasons=a}};var en=class extends Tr{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}};var od="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Hw=`
34
- \r=`.split(""),L_=(()=>{let e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<Hw.length;t+=1)e[Hw[t].charCodeAt(0)]=-2;for(let t=0;t<od.length;t+=1)e[od[t].charCodeAt(0)]=t;return e})();function zw(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(od[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(od[a]),t.queuedBits-=6}}function $w(e,t,r){let a=L_[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 Kh(e){let t=[],r=s=>{t.push(String.fromCodePoint(s))},a={utf8seq:0,codepoint:0},o={queue:0,queuedBits:0},n=s=>{P_(s,a,r)};for(let s=0;s<e.length;s+=1)$w(e.charCodeAt(s),o,n);return t.join("")}function I_(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 k_(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}I_(a,t)}}function P_(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 ao(e){let t=[],r={queue:0,queuedBits:0},a=o=>{t.push(o)};for(let o=0;o<e.length;o+=1)$w(e.charCodeAt(o),r,a);return new Uint8Array(t)}function Ww(e){let t=[];return k_(e,r=>t.push(r)),new Uint8Array(t)}function ma(e){let t=[],r={queue:0,queuedBits:0},a=o=>{t.push(o)};return e.forEach(o=>zw(o,r,a)),zw(null,r,a),t.join("")}function Gw(e){return Math.round(Date.now()/1e3)+e}function Kw(){return Symbol("auth-callback")}var Je=()=>typeof window<"u"&&typeof document<"u",tn={tested:!1,writable:!1},nd=()=>{if(!Je())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(tn.tested)return tn.writable;let e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),tn.tested=!0,tn.writable=!0}catch{tn.tested=!0,tn.writable=!1}return tn.writable};function Xw(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 sd=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),Jw=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",rn=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},oo=async(e,t)=>{let r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch{return r}},ot=async(e,t)=>{await e.removeItem(t)},Rl=class e{constructor(){this.promise=new e.promiseConstructor((t,r)=>{this.resolve=t,this.reject=r})}};Rl.promiseConstructor=Promise;function id(e){let t=e.split(".");if(t.length!==3)throw new en("Invalid JWT structure");for(let a=0;a<t.length;a++)if(!Fw.test(t[a]))throw new en("JWT not in base64url format");return{header:JSON.parse(Kh(t[0])),payload:JSON.parse(Kh(t[1])),signature:ao(t[2]),raw:{header:t[0],payload:t[1]}}}async function Qw(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function Yw(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 T_(e){return("0"+e.toString(16)).substr(-2)}function __(){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,T_).join("")}async function A_(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 R_(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 A_(e);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function an(e,t,r=!1){let a=__(),o=a;r&&(o+="/PASSWORD_RECOVERY"),await rn(e,`${t}-code-verifier`,o);let n=await R_(a);return[n,a===n?"plain":"s256"]}var E_=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function Zw(e){let t=e.headers.get(Tl);if(!t||!t.match(E_))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function eS(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 tS(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 D_=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function on(e){if(!D_.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function ld(){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 rS(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 Xh(e){return JSON.parse(JSON.stringify(e))}var nn=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),N_=[502,503,504];async function aS(e){var t;if(!Jw(e))throw new vs(nn(e),0);if(N_.includes(e.status))throw new vs(nn(e),e.status);let r;try{r=await e.json()}catch(n){throw new hr(nn(n),n)}let a,o=Zw(e);if(o&&o.getTime()>=Gh["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 Al(nn(r),e.status,((t=r.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(a==="session_not_found")throw new ct}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 Al(nn(r),e.status,r.weak_password.reasons);throw new td(nn(r),e.status||500,a)}var M_=(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 G(e,t,r,a){var o;let n=Object.assign({},a?.headers);n[Tl]||(n[Tl]=Gh["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 O_(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 O_(e,t,r,a,o,n){let s=M_(t,a,o,n),i;try{i=await e(r,Object.assign({},s))}catch(l){throw console.error(l),new vs(nn(l),0)}if(i.ok||await aS(i),a?.noResolveJson)return i;try{return await i.json()}catch(l){await aS(l)}}function gr(e){var t;let r=null;B_(e)&&(r=Object.assign({},e),e.expires_at||(r.expires_at=Gw(e.expires_in)));let a=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:r,user:a},error:null}}function Jh(e){let t=gr(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 jr(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function oS(e){return{data:e,error:null}}function nS(e){let{action_link:t,email_otp:r,hashed_token:a,redirect_to:o,verification_type:n}=e,s=Ko(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 Qh(e){return e}function B_(e){return e.access_token&&e.refresh_token&&e.expires_in}var ud=["global","local","others"];var sn=class{constructor({url:t="",headers:r={},fetch:a}){this.url=t,this.headers=r,this.fetch=sd(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=ud[0]){if(ud.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${ud.join(", ")}`);try{return await G(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(a){if(H(a))return{data:null,error:a};throw a}}async inviteUserByEmail(t,r={}){try{return await G(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:jr})}catch(a){if(H(a))return{data:{user:null},error:a};throw a}}async generateLink(t){try{let{options:r}=t,a=Ko(t,["options"]),o=Object.assign(Object.assign({},a),r);return"newEmail"in a&&(o.new_email=a?.newEmail,delete o.newEmail),await G(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:o,headers:this.headers,xform:nS,redirectTo:r?.redirectTo})}catch(r){if(H(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(t){try{return await G(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:jr})}catch(r){if(H(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 G(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:Qh});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,h=(l=(i=c.headers.get("link"))===null||i===void 0?void 0:i.split(","))!==null&&l!==void 0?l:[];return h.length>0&&(h.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(H(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){on(t);try{return await G(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:jr})}catch(r){if(H(r))return{data:{user:null},error:r};throw r}}async updateUserById(t,r){on(t);try{return await G(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:r,headers:this.headers,xform:jr})}catch(a){if(H(a))return{data:{user:null},error:a};throw a}}async deleteUser(t,r=!1){on(t);try{return await G(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:r},xform:jr})}catch(a){if(H(a))return{data:{user:null},error:a};throw a}}async _listFactors(t){on(t.userId);try{let{data:r,error:a}=await G(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(H(r))return{data:null,error:r};throw r}}async _deleteFactor(t){on(t.userId),on(t.id);try{return{data:await G(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(r){if(H(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 G(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:Qh});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,h=(l=(i=c.headers.get("link"))===null||i===void 0?void 0:i.split(","))!==null&&l!==void 0?l:[];return h.length>0&&(h.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(H(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(t){try{return await G(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(H(r))return{data:null,error:r};throw r}}async _getOAuthClient(t){try{return await G(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(H(r))return{data:null,error:r};throw r}}async _updateOAuthClient(t,r){try{return await G(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:r,headers:this.headers,xform:a=>({data:a,error:null})})}catch(a){if(H(a))return{data:null,error:a};throw a}}async _deleteOAuthClient(t){try{return await G(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(H(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(t){try{return await G(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(H(r))return{data:null,error:r};throw r}}};function Yh(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}var ln={debug:!!(globalThis&&nd()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")},El=class extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}},cd=class extends El{};async function Zh(e,t,r){ln.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);let a=new globalThis.AbortController;return t>0&&setTimeout(()=>{a.abort(),ln.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){ln.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,o.name);try{return await r()}finally{ln.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,o.name)}}else{if(t===0)throw ln.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new cd(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(ln.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 sS(){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 eg(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function iS(e){return parseInt(e,16)}function lS(e){let t=new TextEncoder().encode(e);return"0x"+Array.from(t,a=>a.toString(16).padStart(2,"0")).join("")}function uS(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(`
33
+ })`):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 fa.connecting:return to.Connecting;case fa.open:return to.Open;case fa.closing:return to.Closing;default:return to.Closed}}isConnected(){return this.connectionState()===to.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 hs(`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(bw,"heartbeat timeout"),setTimeout(()=>{var r;this.isConnected()||(r=this.reconnectTimer)===null||r===void 0||r.scheduleTimeout()},Xc.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===fa.open&&this._onConnOpen())}_teardownConnection(){if(this.conn){if(this.conn.readyState===fa.open||this.conn.readyState===fa.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(Qt.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([$T],{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:Sw};r&&o.updateJoinPayload(n),o.joinedOnce&&o._isJoined()&&o._push(Qt.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 Ko(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},Xc.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(t){var r,a,o,n,s,i,l,u,c,d,f,h;switch(this.transport=(r=t?.transport)!==null&&r!==void 0?r:null,this.timeout=(a=t?.timeout)!==null&&a!==void 0?a:Cl,this.heartbeatIntervalMs=(o=t?.heartbeatIntervalMs)!==null&&o!==void 0?o:Xc.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:Bh,this.vsn=(l=t?.vsn)!==null&&l!==void 0?l:Eh,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=>HT[v-1]||zT),this.vsn){case Rh: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 Cw:this.encode=(f=t?.encode)!==null&&f!==void 0?f:this.serializer.encode.bind(this.serializer),this.decode=(h=t?.decode)!==null&&h!==void 0?h: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 Ll=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 WT(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 GT(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 KT(e){let t=e.fetchImpl??globalThis.fetch;return{async request({method:r,path:a,query:o,body:n,headers:s}){let i=WT(e.baseUrl,a,o),l=await GT(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 h=d?f:void 0,v=h?.error;throw new Ll(v?.message??`Request failed with status ${u.status}`,{status:u.status,icebergType:v?.type,icebergCode:v?.code,details:h})}return{status:u.status,headers:u.headers,data:f}}}}function Jc(e){return e.join("")}var XT=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){let t=e?{parent:Jc(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/${Jc(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Jc(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Jc(e.namespace)}`}),!0}catch(t){if(t instanceof Ll&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(r){if(r instanceof Ll&&r.status===409)return;throw r}}};function ys(e){return e.join("")}var JT=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/${ys(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/${ys(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/${ys(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/${ys(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/${ys(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/${ys(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(r){if(r instanceof Ll&&r.status===404)return!1;throw r}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(r){if(r instanceof Ll&&r.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw r}}},kw=class{constructor(e){let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);let r=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=KT({baseUrl:r,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=e.accessDelegation?.join(","),this.namespaceOps=new XT(this.client,t),this.tableOps=new JT(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 Qc=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 QT=class extends Qc{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}}},Vh=class extends Qc{constructor(e,t){super(e),this.name="StorageUnknownError",this.originalError=t}},Hh=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),YT=()=>Response,jh=e=>{if(Array.isArray(e))return e.map(r=>jh(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]=jh(a)}),t},ZT=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)},e_=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e);function Il(e){"@babel/helpers - typeof";return Il=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},Il(e)}function t_(e,t){if(Il(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t||"default");if(Il(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function r_(e){var t=t_(e,"string");return Il(t)=="symbol"?t:t+""}function a_(e,t,r){return(t=r_(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Pw(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 K(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Pw(Object(r),!0).forEach(function(a){a_(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pw(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}var Fh=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)},o_=async(e,t,r)=>{e instanceof await YT()&&!r?.noResolveJson?e.json().then(a=>{let o=e.status||500,n=a?.statusCode||o+"";t(new QT(Fh(a),o,n))}).catch(a=>{t(new Vh(Fh(a),a))}):t(new Vh(Fh(e),e))},n_=(e,t,r,a)=>{let o={method:e,headers:t?.headers||{}};return e==="GET"||!a?o:(ZT(a)?(o.headers=K({"Content-Type":"application/json"},t?.headers),o.body=JSON.stringify(a)):o.body=a,t?.duplex&&(o.duplex=t.duplex),K(K({},o),r))};async function Pl(e,t,r,a,o,n){return new Promise((s,i)=>{e(r,n_(t,a,o,n)).then(l=>{if(!l.ok)throw l;return a?.noResolveJson?l:l.json()}).then(l=>s(l)).catch(l=>o_(l,i,a))})}async function kl(e,t,r,a){return Pl(e,"GET",t,r,a)}async function Pr(e,t,r,a,o){return Pl(e,"POST",t,a,o,r)}async function qh(e,t,r,a,o){return Pl(e,"PUT",t,a,o,r)}async function s_(e,t,r,a){return Pl(e,"HEAD",t,K(K({},r),{},{noResolveJson:!0}),a)}async function zh(e,t,r,a,o){return Pl(e,"DELETE",t,a,o,r)}var i_=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}}},Aw;Aw=Symbol.toStringTag;var l_=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[Aw]="BlobDownloadBuilder",this.promise=null}asStream(){return new i_(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}}},u_={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Tw={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},c_=class{constructor(e,t={},r,a){this.shouldThrowOnError=!1,this.url=e,this.headers=t,this.bucketId=r,this.fetch=Hh(a)}throwOnError(){return this.shouldThrowOnError=!0,this}async uploadOrUpdate(e,t,r,a){var o=this;try{let n,s=K(K({},Tw),a),i=K(K({},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=K(K({},i),a.headers));let u=o._removeEmptyFolders(t),c=o._getFinalPath(u),d=await(e=="PUT"?qh:Pr)(o.fetch,`${o.url}/object/${c}`,n,K({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=K({upsert:Tw.upsert},a),c=K(K({},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 qh(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=K({},r.headers);t?.upsert&&(o["x-upsert"]="true");let n=await Pr(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 Qc("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 Pr(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 Pr(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 Pr(a.fetch,`${a.url}/object/sign/${o}`,K({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 Pr(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=>K(K({},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=()=>kl(this.fetch,`${this.url}/${r}/${n}${o}`,{headers:this.headers,noResolveJson:!0});return new l_(s,this.shouldThrowOnError)}async info(e){var t=this;let r=t._getFinalPath(e);try{return{data:jh(await kl(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 s_(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 Vh){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 zh(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=K(K(K({},u_),t),{},{prefix:e||""});return{data:await Pr(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=K({},e);return{data:await Pr(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("&")}},Rw="2.90.1",Ew={"X-Client-Info":`storage-js/${Rw}`},d_=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=K(K({},Ew),t),this.fetch=Hh(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async listBuckets(e){var t=this;try{let r=t.listBucketOptionsToQueryString(e);return{data:await kl(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 kl(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 Pr(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 qh(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 Pr(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 zh(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():""}},f_=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=K(K({},Ew),t),this.fetch=Hh(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async createBucket(e){var t=this;try{return{data:await Pr(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 kl(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 zh(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(!e_(e))throw new Qc("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 kw({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}}}}})}},$h={"X-Client-Info":`storage-js/${Rw}`,"Content-Type":"application/json"},Dw=class extends Error{constructor(e){super(e),this.__isStorageVectorsError=!0,this.name="StorageVectorsError"}};function Yt(e){return typeof e=="object"&&e!==null&&"__isStorageVectorsError"in e}var Uh=class extends Dw{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}}},p_=class extends Dw{constructor(e,t){super(e),this.name="StorageVectorsUnknownError",this.originalError=t}};var Wh=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);var m_=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 _w=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),h_=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 Uh(_w(n),a,s))}).catch(()=>{let n=a+"";t(new Uh(o.statusText||`HTTP ${a} error`,a,n))});else{let n=a+"";t(new Uh(o.statusText||`HTTP ${a} error`,a,n))}}else t(new p_(_w(e),e))},g_=(e,t,r,a)=>{let o={method:e,headers:t?.headers||{}};return e==="GET"||!a?o:(m_(a)?(o.headers=K({"Content-Type":"application/json"},t?.headers),o.body=JSON.stringify(a)):o.body=a,K(K({},o),r))};async function y_(e,t,r,a,o,n){return new Promise((s,i)=>{e(r,g_(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=>h_(l,i,a))})}async function Zt(e,t,r,a,o){return y_(e,"POST",t,a,o,r)}var v_=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=K(K({},$h),t),this.fetch=Wh(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async createIndex(e){var t=this;try{return{data:await Zt(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Yt(r))return{data:null,error:r};throw r}}async getIndex(e,t){var r=this;try{return{data:await Zt(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers}),error:null}}catch(a){if(r.shouldThrowOnError)throw a;if(Yt(a))return{data:null,error:a};throw a}}async listIndexes(e){var t=this;try{return{data:await Zt(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Yt(r))return{data:null,error:r};throw r}}async deleteIndex(e,t){var r=this;try{return{data:await Zt(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers})||{},error:null}}catch(a){if(r.shouldThrowOnError)throw a;if(Yt(a))return{data:null,error:a};throw a}}},x_=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=K(K({},$h),t),this.fetch=Wh(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 Zt(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Yt(r))return{data:null,error:r};throw r}}async getVectors(e){var t=this;try{return{data:await Zt(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Yt(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 Zt(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Yt(r))return{data:null,error:r};throw r}}async queryVectors(e){var t=this;try{return{data:await Zt(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Yt(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 Zt(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Yt(r))return{data:null,error:r};throw r}}},w_=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=K(K({},$h),t),this.fetch=Wh(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async createBucket(e){var t=this;try{return{data:await Zt(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Yt(r))return{data:null,error:r};throw r}}async getBucket(e){var t=this;try{return{data:await Zt(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Yt(r))return{data:null,error:r};throw r}}async listBuckets(e={}){var t=this;try{return{data:await Zt(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Yt(r))return{data:null,error:r};throw r}}async deleteBucket(e){var t=this;try{return{data:await Zt(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Yt(r))return{data:null,error:r};throw r}}},S_=class extends w_{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new C_(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)}},C_=class extends v_{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,K(K({},e),{},{vectorBucketName:r.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,r=this;return t().call(r,K(K({},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 b_(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},b_=class extends x_{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,K(K({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(e){var t=()=>super.getVectors,r=this;return t().call(r,K(K({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,r=this;return t().call(r,K(K({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,r=this;return t().call(r,K(K({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,r=this;return t().call(r,K(K({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},Nw=class extends d_{constructor(e,t={},r,a){super(e,t,r,a)}from(e){return new c_(this.url,this.headers,e,this.fetch)}get vectors(){return new S_(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new f_(this.url+"/iceberg",this.headers,this.fetch)}};var Yc="2.90.1";var Jo=30*1e3,Zc=3,ed=Zc*Jo,Mw="http://localhost:9999",Ow="supabase.auth.token";var Bw={"X-Client-Info":`gotrue-js/${Yc}`};var Tl="X-Supabase-Api-Version",Gh={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},Fw=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,Uw=600*1e3;var ro=class extends Error{constructor(t,r,a){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=a}};function H(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}var td=class extends ro{constructor(t,r,a){super(t,r,a),this.name="AuthApiError",this.status=r,this.code=a}};function Vw(e){return H(e)&&e.name==="AuthApiError"}var hr=class extends ro{constructor(t,r){super(t),this.name="AuthUnknownError",this.originalError=r}},Tr=class extends ro{constructor(t,r,a,o){super(t,a,o),this.name=r,this.status=a}},ct=class extends Tr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};function jw(e){return H(e)&&e.name==="AuthSessionMissingError"}var pa=class extends Tr{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}},Qo=class extends Tr{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}},Yo=class extends Tr{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 qw(e){return H(e)&&e.name==="AuthImplicitGrantRedirectError"}var _l=class extends Tr{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}}},rd=class extends Tr{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 vs=class extends Tr{constructor(t,r){super(t,"AuthRetryableFetchError",r,void 0)}};function ad(e){return H(e)&&e.name==="AuthRetryableFetchError"}var Al=class extends Tr{constructor(t,r,a){super(t,"AuthWeakPasswordError",r,"weak_password"),this.reasons=a}};var Zo=class extends Tr{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}};var od="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Hw=`
34
+ \r=`.split(""),L_=(()=>{let e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<Hw.length;t+=1)e[Hw[t].charCodeAt(0)]=-2;for(let t=0;t<od.length;t+=1)e[od[t].charCodeAt(0)]=t;return e})();function zw(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(od[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(od[a]),t.queuedBits-=6}}function $w(e,t,r){let a=L_[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 Kh(e){let t=[],r=s=>{t.push(String.fromCodePoint(s))},a={utf8seq:0,codepoint:0},o={queue:0,queuedBits:0},n=s=>{P_(s,a,r)};for(let s=0;s<e.length;s+=1)$w(e.charCodeAt(s),o,n);return t.join("")}function I_(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 k_(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}I_(a,t)}}function P_(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 ao(e){let t=[],r={queue:0,queuedBits:0},a=o=>{t.push(o)};for(let o=0;o<e.length;o+=1)$w(e.charCodeAt(o),r,a);return new Uint8Array(t)}function Ww(e){let t=[];return k_(e,r=>t.push(r)),new Uint8Array(t)}function ma(e){let t=[],r={queue:0,queuedBits:0},a=o=>{t.push(o)};return e.forEach(o=>zw(o,r,a)),zw(null,r,a),t.join("")}function Gw(e){return Math.round(Date.now()/1e3)+e}function Kw(){return Symbol("auth-callback")}var Je=()=>typeof window<"u"&&typeof document<"u",en={tested:!1,writable:!1},nd=()=>{if(!Je())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(en.tested)return en.writable;let e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),en.tested=!0,en.writable=!0}catch{en.tested=!0,en.writable=!1}return en.writable};function Xw(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 sd=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),Jw=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",tn=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},oo=async(e,t)=>{let r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch{return r}},ot=async(e,t)=>{await e.removeItem(t)},Rl=class e{constructor(){this.promise=new e.promiseConstructor((t,r)=>{this.resolve=t,this.reject=r})}};Rl.promiseConstructor=Promise;function id(e){let t=e.split(".");if(t.length!==3)throw new Zo("Invalid JWT structure");for(let a=0;a<t.length;a++)if(!Fw.test(t[a]))throw new Zo("JWT not in base64url format");return{header:JSON.parse(Kh(t[0])),payload:JSON.parse(Kh(t[1])),signature:ao(t[2]),raw:{header:t[0],payload:t[1]}}}async function Qw(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function Yw(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 T_(e){return("0"+e.toString(16)).substr(-2)}function __(){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,T_).join("")}async function A_(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 R_(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 A_(e);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function rn(e,t,r=!1){let a=__(),o=a;r&&(o+="/PASSWORD_RECOVERY"),await tn(e,`${t}-code-verifier`,o);let n=await R_(a);return[n,a===n?"plain":"s256"]}var E_=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function Zw(e){let t=e.headers.get(Tl);if(!t||!t.match(E_))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function eS(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 tS(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 D_=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function an(e){if(!D_.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function ld(){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 rS(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 Xh(e){return JSON.parse(JSON.stringify(e))}var on=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),N_=[502,503,504];async function aS(e){var t;if(!Jw(e))throw new vs(on(e),0);if(N_.includes(e.status))throw new vs(on(e),e.status);let r;try{r=await e.json()}catch(n){throw new hr(on(n),n)}let a,o=Zw(e);if(o&&o.getTime()>=Gh["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 Al(on(r),e.status,((t=r.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(a==="session_not_found")throw new ct}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 Al(on(r),e.status,r.weak_password.reasons);throw new td(on(r),e.status||500,a)}var M_=(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 G(e,t,r,a){var o;let n=Object.assign({},a?.headers);n[Tl]||(n[Tl]=Gh["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 O_(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 O_(e,t,r,a,o,n){let s=M_(t,a,o,n),i;try{i=await e(r,Object.assign({},s))}catch(l){throw console.error(l),new vs(on(l),0)}if(i.ok||await aS(i),a?.noResolveJson)return i;try{return await i.json()}catch(l){await aS(l)}}function gr(e){var t;let r=null;B_(e)&&(r=Object.assign({},e),e.expires_at||(r.expires_at=Gw(e.expires_in)));let a=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:r,user:a},error:null}}function Jh(e){let t=gr(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 jr(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function oS(e){return{data:e,error:null}}function nS(e){let{action_link:t,email_otp:r,hashed_token:a,redirect_to:o,verification_type:n}=e,s=Go(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 Qh(e){return e}function B_(e){return e.access_token&&e.refresh_token&&e.expires_in}var ud=["global","local","others"];var nn=class{constructor({url:t="",headers:r={},fetch:a}){this.url=t,this.headers=r,this.fetch=sd(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=ud[0]){if(ud.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${ud.join(", ")}`);try{return await G(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(a){if(H(a))return{data:null,error:a};throw a}}async inviteUserByEmail(t,r={}){try{return await G(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:jr})}catch(a){if(H(a))return{data:{user:null},error:a};throw a}}async generateLink(t){try{let{options:r}=t,a=Go(t,["options"]),o=Object.assign(Object.assign({},a),r);return"newEmail"in a&&(o.new_email=a?.newEmail,delete o.newEmail),await G(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:o,headers:this.headers,xform:nS,redirectTo:r?.redirectTo})}catch(r){if(H(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(t){try{return await G(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:jr})}catch(r){if(H(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 G(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:Qh});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,h=(l=(i=c.headers.get("link"))===null||i===void 0?void 0:i.split(","))!==null&&l!==void 0?l:[];return h.length>0&&(h.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(H(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){an(t);try{return await G(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:jr})}catch(r){if(H(r))return{data:{user:null},error:r};throw r}}async updateUserById(t,r){an(t);try{return await G(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:r,headers:this.headers,xform:jr})}catch(a){if(H(a))return{data:{user:null},error:a};throw a}}async deleteUser(t,r=!1){an(t);try{return await G(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:r},xform:jr})}catch(a){if(H(a))return{data:{user:null},error:a};throw a}}async _listFactors(t){an(t.userId);try{let{data:r,error:a}=await G(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(H(r))return{data:null,error:r};throw r}}async _deleteFactor(t){an(t.userId),an(t.id);try{return{data:await G(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(r){if(H(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 G(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:Qh});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,h=(l=(i=c.headers.get("link"))===null||i===void 0?void 0:i.split(","))!==null&&l!==void 0?l:[];return h.length>0&&(h.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(H(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(t){try{return await G(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(H(r))return{data:null,error:r};throw r}}async _getOAuthClient(t){try{return await G(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(H(r))return{data:null,error:r};throw r}}async _updateOAuthClient(t,r){try{return await G(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:r,headers:this.headers,xform:a=>({data:a,error:null})})}catch(a){if(H(a))return{data:null,error:a};throw a}}async _deleteOAuthClient(t){try{return await G(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(H(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(t){try{return await G(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(H(r))return{data:null,error:r};throw r}}};function Yh(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}var sn={debug:!!(globalThis&&nd()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")},El=class extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}},cd=class extends El{};async function Zh(e,t,r){sn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);let a=new globalThis.AbortController;return t>0&&setTimeout(()=>{a.abort(),sn.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){sn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,o.name);try{return await r()}finally{sn.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,o.name)}}else{if(t===0)throw sn.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new cd(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(sn.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 sS(){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 eg(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function iS(e){return parseInt(e,16)}function lS(e){let t=new TextEncoder().encode(e);return"0x"+Array.from(t,a=>a.toString(16).padStart(2,"0")).join("")}function uS(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(`
35
35
  `))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}let h=eg(e.address),v=c?`${c}://${a}`:a,x=e.statement?`${e.statement}
36
36
  `:"",C=`${v} wants you to sign in with your Ethereum account:
37
37
  ${h}
@@ -46,8 +46,8 @@ Not Before: ${i.toISOString()}`),l&&(g+=`
46
46
  Request ID: ${l}`),u){let p=`
47
47
  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}`);p+=`
48
48
  - ${y}`}g+=p}return`${C}
49
- ${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}},un=class extends Me{constructor(t,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:t}),this.name="WebAuthnUnknownError",this.originalError=r}};function cS({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(tg(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 dS({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(tg(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 rg=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}}},F_=new rg;function pS(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=Ko(e,["challenge","user","excludeCredentials"]),n=ao(t).buffer,s=Object.assign(Object.assign({},r),{id:ao(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:ao(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return i}function mS(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=Ko(e,["challenge","allowCredentials"]),o=ao(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:ao(i.id).buffer,type:i.type||"public-key",transports:i.transports})}}return n}function hS(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:ma(new Uint8Array(e.response.attestationObject)),clientDataJSON:ma(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function gS(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:ma(new Uint8Array(o.authenticatorData)),clientDataJSON:ma(new Uint8Array(o.clientDataJSON)),signature:ma(new Uint8Array(o.signature)),userHandle:o.userHandle?ma(new Uint8Array(o.userHandle)):void 0},type:"public-key",clientExtensionResults:a,authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function tg(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function fS(){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 U_(e){try{let t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new un("Browser returned unexpected credential type",t)}:{data:null,error:new un("Empty credential response",t)}}catch(t){return{data:null,error:cS({error:t,options:e})}}}async function V_(e){try{let t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new un("Browser returned unexpected credential type",t)}:{data:null,error:new un("Empty credential response",t)}}catch(t){return{data:null,error:dS({error:t,options:e})}}}var j_={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},q_={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function dd(...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]=dd(i,s):a[n]=dd(s)}else a[n]=s}return a}function H_(e,t){return dd(j_,e,t||{})}function z_(e,t){return dd(q_,e,t||{})}var fd=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??F_.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=H_(s.webauthn.credential_options.publicKey,n?.create),{data:c,error:d}=await U_({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=z_(s.webauthn.credential_options.publicKey,n?.request),{data:c,error:d}=await V_(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 H(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 ro("rpId is required for WebAuthn authentication")};try{if(!fS())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 H(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 ro("rpId is required for WebAuthn registration")};try{if(!fS())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 H(s)?{data:null,error:s}:{data:null,error:new hr("Unexpected error in register",s)}}}};sS();var $_={url:Mw,storageKey:Ow,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Bw,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:1e4};async function yS(e,t,r){return await r()}var xs={},pd=class e{get jwks(){var t,r;return(r=(t=xs[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(t){xs[this.storageKey]=Object.assign(Object.assign({},xs[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,r;return(r=(t=xs[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){xs[this.storageKey]=Object.assign(Object.assign({},xs[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({},$_),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 sn({url:n.url,headers:n.headers,fetch:n.fetch}),this.url=n.url,this.headers=n.headers,this.fetch=sd(n.fetch),this.lock=n.lock||yS,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=Zh:this.lock=yS,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 fd(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:nd()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Yh(this.memoryStorage)),n.userStorage&&(this.userStorage=n.userStorage)):(this.memoryStorage={},this.storage=Yh(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} (${Yc}) ${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=Xw(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),qw(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 H(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 G(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:gr}),{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(H(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,h=null,v=null;this.flowType==="pkce"&&([h,v]=await an(this.storage,this.storageKey)),n=await G(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:h,code_challenge_method:v},xform:gr})}else if("phone"in t){let{phone:c,password:d,options:f}=t;n=await G(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:gr})}else throw new Yo("You must provide either an email or phone number and a password");let{data:s,error:i}=n;if(i||!s)return await ot(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 ot(this.storage,`${this.storageKey}-code-verifier`),H(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 G(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:Jh})}else if("phone"in t){let{phone:n,password:s,options:i}=t;r=await G(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:Jh})}else throw new Yo("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 pa;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(H(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 h,v;if("message"in t)h=t.message,v=t.signature;else{let{chain:x,wallet:C,statement:g,options:p}=t,y;if(Je())if(typeof C=="object")y=C;else{let N=window;if("ethereum"in N&&typeof N.ethereum=="object"&&"request"in N.ethereum&&typeof N.ethereum.request=="function")y=N.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"||!p?.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=p?.url)!==null&&r!==void 0?r:window.location.href),L=await y.request({method:"eth_requestAccounts"}).then(N=>N).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 P=eg(L[0]),T=(a=p?.signInWithEthereum)===null||a===void 0?void 0:a.chainId;if(!T){let N=await y.request({method:"eth_chainId"});T=iS(N)}let A={domain:b.host,address:P,statement:g,uri:b.href,version:"1",chainId:T,nonce:(o=p?.signInWithEthereum)===null||o===void 0?void 0:o.nonce,issuedAt:(s=(n=p?.signInWithEthereum)===null||n===void 0?void 0:n.issuedAt)!==null&&s!==void 0?s:new Date,expirationTime:(i=p?.signInWithEthereum)===null||i===void 0?void 0:i.expirationTime,notBefore:(l=p?.signInWithEthereum)===null||l===void 0?void 0:l.notBefore,requestId:(u=p?.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(c=p?.signInWithEthereum)===null||c===void 0?void 0:c.resources};h=uS(A),v=await y.request({method:"personal_sign",params:[lS(h),P]})}try{let{data:x,error:C}=await G(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:h,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:gr});if(C)throw C;if(!x||!x.session||!x.user){let g=new pa;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(H(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,h;let v,x;if("message"in t)v=t.message,x=t.signature;else{let{chain:C,wallet:g,statement:p,options:y}=t,b;if(Je())if(typeof g=="object")b=g;else{let P=window;if("solana"in P&&typeof P.solana=="object"&&("signIn"in P.solana&&typeof P.solana.signIn=="function"||"signMessage"in P.solana&&typeof P.solana.signMessage=="function"))b=P.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 P=await b.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},y?.signInWithSolana),{version:"1",domain:L.host,uri:L.href}),p?{statement:p}:null)),T;if(Array.isArray(P)&&P[0]&&typeof P[0]=="object")T=P[0];else if(P&&typeof P=="object"&&"signedMessage"in P&&"signature"in P)T=P;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in T&&"signature"in T&&(typeof T.signedMessage=="string"||T.signedMessage instanceof Uint8Array)&&T.signature instanceof Uint8Array)v=typeof T.signedMessage=="string"?T.signedMessage:new TextDecoder().decode(T.signedMessage),x=T.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(),...p?["",p,""]:[""],"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(T=>`- ${T}`)]:[]].join(`
50
- `);let P=await b.signMessage(new TextEncoder().encode(v),"utf8");if(!P||!(P instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");x=P}}try{let{data:C,error:g}=await G(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:v,signature:ma(x)},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(h=t.options)===null||h===void 0?void 0:h.captchaToken}}:null),xform:gr});if(g)throw g;if(!C||!C.session||!C.user){let p=new pa;return this._returnResult({data:{user:null,session:null},error:p})}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(H(C))return this._returnResult({data:{user:null,session:null},error:C});throw C}}async _exchangeCodeForSession(t){let r=await oo(this.storage,`${this.storageKey}-code-verifier`),[a,o]=(r??"").split("/");try{if(!a&&this.flowType==="pkce")throw new rd;let{data:n,error:s}=await G(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:a},xform:gr});if(await ot(this.storage,`${this.storageKey}-code-verifier`),s)throw s;if(!n||!n.session||!n.user){let i=new pa;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 ot(this.storage,`${this.storageKey}-code-verifier`),H(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 G(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:gr}),{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 pa;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(H(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 an(this.storage,this.storageKey));let{error:d}=await G(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 G(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 Yo("You must provide either an email or phone number.")}catch(i){if(await ot(this.storage,`${this.storageKey}-code-verifier`),H(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 G(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:n}}),redirectTo:o,xform:gr});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(H(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 an(this.storage,this.storageKey));let u=await G(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:oS});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 ot(this.storage,`${this.storageKey}-code-verifier`),H(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 ct;let{error:o}=await G(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(H(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 G(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 G(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 Yo("You must provide either an email or phone number and a type")}catch(r){if(H(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 oo(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()<ed:!1;if(this._debug("#__loadSession()",`session has${a?"":" not"} expired`,"expires_at",t.expires_at),!a){if(this.userStorage){let s=await oo(this.userStorage,this.storageKey+"-user");s?.user?t.user=s.user:t.user=ld()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){let s={value:this.suppressGetSessionWarning};t.user=rS(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 G(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:jr}):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 ct}:await G(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:jr})})}catch(r){if(H(r))return jw(r)&&(await this._removeSession(),await ot(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 ct;let s=o.session,i=null,l=null;this.flowType==="pkce"&&t.email!=null&&([i,l]=await an(this.storage,this.storageKey));let{data:u,error:c}=await G(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:jr});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 ot(this.storage,`${this.storageKey}-code-verifier`),H(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 ct;let r=Date.now()/1e3,a=r,o=!0,n=null,{payload:s}=id(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(H(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 ct;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(H(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(t,r){try{if(!Je())throw new Zo("No browser detected.");if(t.error||t.error_description||t.error_code)throw new Zo(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 _l("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Zo("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 _l("No code detected.");let{data:p,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:p.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 Zo("No session defined in URL");let c=Math.round(Date.now()/1e3),d=parseInt(i),f=c+d;l&&(f=parseInt(l));let h=f-c;h*1e3<=Qo&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${h}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(H(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 oo(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&&!(Vw(i)&&(i.status===404||i.status===401||i.status===403)))return this._returnResult({error:i})}return t!=="others"&&(await this._removeSession(),await ot(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){let r=Kw(),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 an(this.storage,this.storageKey,!0));try{return await G(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 ot(this.storage,`${this.storageKey}-code-verifier`),H(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(H(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 h=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 G(this.fetch,"GET",h,{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(H(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 G(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:gr}),{data:f,error:h}=d;return h?this._returnResult({data:{user:null,session:null},error:h}):!f||!f.session||!f.user?this._returnResult({data:{user:null,session:null},error:new pa}):(f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("USER_UPDATED",f.session)),this._returnResult({data:f,error:h}))}catch(o){if(await ot(this.storage,`${this.storageKey}-code-verifier`),H(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 G(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(H(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 Yw(async o=>(o>0&&await Qw(200*Math.pow(2,o-1)),this._debug(r,"refreshing attempt",o),await G(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:gr})),(o,n)=>{let s=200*Math.pow(2,o);return n&&ad(n)&&Date.now()+s-a<Qo})}catch(a){if(this._debug(r,"error",a),H(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 oo(this.storage,this.storageKey);if(o&&this.userStorage){let s=await oo(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!s&&(s={user:o.user},await rn(this.userStorage,this.storageKey+"-user",s)),o.user=(t=s?.user)!==null&&t!==void 0?t:ld()}else if(o&&!o.user&&!o.user){let s=await oo(this.storage,this.storageKey+"-user");s&&s?.user?(o.user=s.user,await ot(this.storage,this.storageKey+"-user"),await rn(this.storage,this.storageKey,o)):o.user=ld()}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()<ed;if(this._debug(a,`session has${n?"":" not"} expired with margin of ${ed}s`),n){if(this.autoRefreshToken&&o.refresh_token){let{error:s}=await this._callRefreshToken(o.refresh_token);s&&(console.error(s),ad(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 ct;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let o=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(o,"begin");try{this.refreshingDeferred=new Rl;let{data:n,error:s}=await this._refreshAccessToken(t);if(s)throw s;if(!n.session)throw new ct;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),H(n)){let s={data:null,error:n};return ad(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 ot(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 rn(this.userStorage,this.storageKey+"-user",{user:r.user});let o=Object.assign({},r);delete o.user;let n=Xh(o);await rn(this.storage,this.storageKey,n)}else{let o=Xh(r);await rn(this.storage,this.storageKey,o)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await ot(this.storage,this.storageKey),await ot(this.storage,this.storageKey+"-code-verifier"),await ot(this.storage,this.storageKey+"-user"),this.userStorage&&await ot(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(),Qo);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)/Qo);this._debug("#_autoRefreshTokenTick()",`access token expires in ${o} ticks, a tick lasts ${Qo}ms, refresh threshold is ${Zc} ticks`),o<=Zc&&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 El)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 an(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 G(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(H(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 G(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(H(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"?hS(t.webauthn.credential_response):gS(t.webauthn.credential_response)})}:{code:t.code}),{data:i,error:l}=await G(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(H(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 G(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:pS(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:mS(i.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(H(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}=id(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 G(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 ct})})}catch(r){if(H(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 ct});let s=await G(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(H(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 ct});let s=await G(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(H(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 G(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 ct})})}catch(t){if(H(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 G(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 ct})})}catch(r){if(H(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+Uw>o)return a;let{data:n,error:s}=await G(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:h,error:v}=await this.getSession();if(v||!h.session)return this._returnResult({data:null,error:v});a=h.session.access_token}let{header:o,payload:n,signature:s,raw:{header:i,payload:l}}=id(a);r?.allowExpired||eS(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:h}=await this.getUser(a);if(h)throw h;return{data:{claims:n,header:o,signature:s},error:null}}let c=tS(o.alg),d=await crypto.subtle.importKey("jwk",u,c,!0,["verify"]);if(!await crypto.subtle.verify(c,d,s,Ww(`${i}.${l}`)))throw new en("Invalid JWT signature");return{data:{claims:n,header:o,signature:s},error:null}}catch(a){if(H(a))return this._returnResult({data:null,error:a});throw a}}};pd.nextInstanceID={};var ag=pd;var W_=ag,og=W_;var G_="2.90.1",Dl="";typeof Deno<"u"?Dl="deno":typeof document<"u"?Dl="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Dl="react-native":Dl="node";var K_={"X-Client-Info":`supabase-js-${Dl}/${G_}`},X_={headers:K_},J_={schema:"public"},Q_={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},Y_={};function Nl(e){"@babel/helpers - typeof";return Nl=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},Nl(e)}function Z_(e,t){if(Nl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t||"default");if(Nl(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function eA(e){var t=Z_(e,"string");return Nl(t)=="symbol"?t:t+""}function tA(e,t,r){return(t=eA(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vS(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 Ue(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?vS(Object(r),!0).forEach(function(a){tA(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vS(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}var rA=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),aA=()=>Headers,oA=(e,t,r)=>{let a=rA(r),o=aA();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,Ue(Ue({},s),{},{headers:u}))}};function nA(e){return e.endsWith("/")?e:e+"/"}function sA(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:Ue(Ue({},l),o),auth:Ue(Ue({},u),n),realtime:Ue(Ue({},c),s),storage:{},global:Ue(Ue(Ue({},d),i),{},{headers:Ue(Ue({},(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 iA(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(nA(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var lA=class extends og{constructor(e){super(e)}},uA=class{constructor(e,t,r){var a,o;this.supabaseUrl=e,this.supabaseKey=t;let n=iA(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:J_,realtime:Y_,auth:Ue(Ue({},Q_),{},{storageKey:s}),global:X_},l=sA(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=oA(t,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(Ue({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 vw(new URL("rest/v1",n).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch}),this.storage=new Nw(this.storageUrl.href,this.headers,this.fetch,r?.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new Sl(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 lA({url:this.authUrl.href,headers:Ue(Ue({},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(h=>h.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new gs(this.realtimeUrl.href,Ue(Ue({},e),{},{params:Ue(Ue({},{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)}},xS=(e,t,r)=>new uA(e,t,r);function cA(){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}cA()&&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");function wS(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=wS(e[t]))&&(a&&(a+=" "),a+=r)}else for(r in e)e[r]&&(a&&(a+=" "),a+=r);return a}function md(){for(var e,t,r=0,a="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=wS(e))&&(a&&(a+=" "),a+=t);return a}var dA=e=>{let t=pA(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:s=>{let i=s.split("-");return i[0]===""&&i.length!==1&&i.shift(),bS(i,t)||fA(s)},getConflictingClassGroupIds:(s,i)=>{let l=r[s]||[];return i&&a[s]?[...l,...a[s]]:l}}},bS=(e,t)=>{if(e.length===0)return t.classGroupId;let r=e[0],a=t.nextPart.get(r),o=a?bS(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},SS=/^\[(.+)\]$/,fA=e=>{if(SS.test(e)){let t=SS.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},pA=e=>{let{theme:t,prefix:r}=e,a={nextPart:new Map,validators:[]};return hA(Object.entries(e.classGroups),r).forEach(([n,s])=>{sg(s,a,n,t)}),a},sg=(e,t,r,a)=>{e.forEach(o=>{if(typeof o=="string"){let n=o===""?t:CS(t,o);n.classGroupId=r;return}if(typeof o=="function"){if(mA(o)){sg(o(a),t,r,a);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([n,s])=>{sg(s,CS(t,n),r,a)})})},CS=(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},mA=e=>e.isThemeGetter,hA=(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,gA=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 yA=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),h=f.startsWith("!"),v=h?f.substring(1):f,x=d&&d>c?d-c:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:v,maybePostfixModifierPosition:x}};return r?i=>r({className:i,parseClassName:s}):s},vA=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},xA=e=>({cache:gA(e.cacheSize),parseClassName:yA(e),...dA(e)}),wA=/\s+/,SA=(e,t)=>{let{parseClassName:r,getClassGroupId:a,getConflictingClassGroupIds:o}=t,n=[],s=e.trim().split(wA),i="";for(let l=s.length-1;l>=0;l-=1){let u=s[l],{modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=r(u),v=!!h,x=a(v?f.substring(0,h):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=vA(c).join(":"),g=d?C+"!":C,p=g+x;if(n.includes(p))continue;n.push(p);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 CA(){let e=0,t,r,a="";for(;e<arguments.length;)(t=arguments[e++])&&(r=LS(t))&&(a&&(a+=" "),a+=r);return a}var LS=e=>{if(typeof e=="string")return e;let t,r="";for(let a=0;a<e.length;a++)e[a]&&(t=LS(e[a]))&&(r&&(r+=" "),r+=t);return r};function bA(e,...t){let r,a,o,n=s;function s(l){let u=t.reduce((c,d)=>d(c),e());return r=xA(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=SA(l,r);return o(l,c),c}return function(){return n(CA.apply(null,arguments))}}var Pe=e=>{let t=r=>r[e]||[];return t.isThemeGetter=!0,t},IS=/^\[(?:([a-z-]+):)?(.+)\]$/i,LA=/^\d+\/\d+$/,IA=new Set(["px","full","screen"]),kA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,PA=/\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$/,TA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,_A=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,AA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ha=e=>ws(e)||IA.has(e)||LA.test(e),no=e=>Ss(e,"length",FA),ws=e=>!!e&&!Number.isNaN(Number(e)),ng=e=>Ss(e,"number",ws),Ml=e=>!!e&&Number.isInteger(Number(e)),RA=e=>e.endsWith("%")&&ws(e.slice(0,-1)),te=e=>IS.test(e),so=e=>kA.test(e),EA=new Set(["length","size","percentage"]),DA=e=>Ss(e,EA,kS),NA=e=>Ss(e,"position",kS),MA=new Set(["image","url"]),OA=e=>Ss(e,MA,VA),BA=e=>Ss(e,"",UA),Ol=()=>!0,Ss=(e,t,r)=>{let a=IS.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):r(a[2]):!1},FA=e=>PA.test(e)&&!TA.test(e),kS=()=>!1,UA=e=>_A.test(e),VA=e=>AA.test(e);var jA=()=>{let e=Pe("colors"),t=Pe("spacing"),r=Pe("blur"),a=Pe("brightness"),o=Pe("borderColor"),n=Pe("borderRadius"),s=Pe("borderSpacing"),i=Pe("borderWidth"),l=Pe("contrast"),u=Pe("grayscale"),c=Pe("hueRotate"),d=Pe("invert"),f=Pe("gap"),h=Pe("gradientColorStops"),v=Pe("gradientColorStopPositions"),x=Pe("inset"),C=Pe("margin"),g=Pe("opacity"),p=Pe("padding"),y=Pe("saturate"),b=Pe("scale"),L=Pe("sepia"),P=Pe("skew"),T=Pe("space"),A=Pe("translate"),N=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],pe=()=>["auto",te,t],ee=()=>[te,t],ir=()=>["",ha,no],zt=()=>["auto",ws,te],Po=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Dr=()=>["solid","dashed","dotted","double","none"],ve=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ye=()=>["start","end","center","between","around","evenly","stretch"],mt=()=>["","0",te],Aa=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ht=()=>[ws,te];return{cacheSize:500,separator:":",theme:{colors:[Ol],spacing:[ha,no],blur:["none","",so,te],brightness:ht(),borderColor:[e],borderRadius:["none","","full",so,te],borderSpacing:ee(),borderWidth:ir(),contrast:ht(),grayscale:mt(),hueRotate:ht(),invert:mt(),gap:ee(),gradientColorStops:[e],gradientColorStopPositions:[RA,no],inset:pe(),margin:pe(),opacity:ht(),padding:ee(),saturate:ht(),scale:ht(),sepia:mt(),skew:ht(),space:ee(),translate:ee()},classGroups:{aspect:[{aspect:["auto","square","video",te]}],container:["container"],columns:[{columns:[so]}],"break-after":[{"break-after":Aa()}],"break-before":[{"break-before":Aa()}],"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:[...Po(),te]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],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",Ml,te]}],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",te]}],grow:[{grow:mt()}],shrink:[{shrink:mt()}],order:[{order:["first","last","none",Ml,te]}],"grid-cols":[{"grid-cols":[Ol]}],"col-start-end":[{col:["auto",{span:["full",Ml,te]},te]}],"col-start":[{"col-start":zt()}],"col-end":[{"col-end":zt()}],"grid-rows":[{"grid-rows":[Ol]}],"row-start-end":[{row:["auto",{span:[Ml,te]},te]}],"row-start":[{"row-start":zt()}],"row-end":[{"row-end":zt()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",te]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",te]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...Ye()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Ye(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Ye(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[p]}],px:[{px:[p]}],py:[{py:[p]}],ps:[{ps:[p]}],pe:[{pe:[p]}],pt:[{pt:[p]}],pr:[{pr:[p]}],pb:[{pb:[p]}],pl:[{pl:[p]}],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":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",te,t]}],"min-w":[{"min-w":[te,t,"min","max","fit"]}],"max-w":[{"max-w":[te,t,"none","full","min","max","fit","prose",{screen:[so]},so]}],h:[{h:[te,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[te,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[te,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[te,t,"auto","min","max","fit"]}],"font-size":[{text:["base",so,no]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ng]}],"font-family":[{font:[Ol]}],"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",te]}],"line-clamp":[{"line-clamp":["none",ws,ng]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ha,te]}],"list-image":[{"list-image":["none",te]}],"list-style-type":[{list:["none","disc","decimal",te]}],"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:[...Dr(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ha,no]}],"underline-offset":[{"underline-offset":["auto",ha,te]}],"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:ee()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",te]}],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",te]}],"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:[...Po(),NA]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",DA]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},OA]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],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:[...Dr(),"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:Dr()}],"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:["",...Dr()]}],"outline-offset":[{"outline-offset":[ha,te]}],"outline-w":[{outline:[ha,no]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ir()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[ha,no]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",so,BA]}],"shadow-color":[{shadow:[Ol]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...ve(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ve()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[a]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",so,te]}],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",te]}],duration:[{duration:ht()}],ease:[{ease:["linear","in","out","in-out",te]}],delay:[{delay:ht()}],animate:[{animate:["none","spin","ping","pulse","bounce",te]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[Ml,te]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",te]}],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",te]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ee()}],"scroll-mx":[{"scroll-mx":ee()}],"scroll-my":[{"scroll-my":ee()}],"scroll-ms":[{"scroll-ms":ee()}],"scroll-me":[{"scroll-me":ee()}],"scroll-mt":[{"scroll-mt":ee()}],"scroll-mr":[{"scroll-mr":ee()}],"scroll-mb":[{"scroll-mb":ee()}],"scroll-ml":[{"scroll-ml":ee()}],"scroll-p":[{"scroll-p":ee()}],"scroll-px":[{"scroll-px":ee()}],"scroll-py":[{"scroll-py":ee()}],"scroll-ps":[{"scroll-ps":ee()}],"scroll-pe":[{"scroll-pe":ee()}],"scroll-pt":[{"scroll-pt":ee()}],"scroll-pr":[{"scroll-pr":ee()}],"scroll-pb":[{"scroll-pb":ee()}],"scroll-pl":[{"scroll-pl":ee()}],"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",te]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ha,no,ng]}],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 PS=bA(jA);function er(...e){return PS(md(e))}var RS=O(ue(),1);function Oe({className:e,type:t,...r}){return(0,RS.jsx)("input",{type:t,"data-slot":"input",className:er("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 We=O(Q(),1);var DS=O(Q(),1);function ES(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Bl(...e){return t=>{let r=!1,a=e.map(o=>{let n=ES(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():ES(e[o],null)}}}}function ga(...e){return DS.useCallback(Bl(...e),e)}var gd=O(ue(),1),KA=Symbol.for("react.lazy"),yd=We[" use ".trim().toString()];function XA(e){return typeof e=="object"&&e!==null&&"then"in e}function NS(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===KA&&"_payload"in e&&XA(e._payload)}function JA(e){let t=QA(e),r=We.forwardRef((a,o)=>{let{children:n,...s}=a;NS(n)&&typeof yd=="function"&&(n=yd(n._payload));let i=We.Children.toArray(n),l=i.find(ZA);if(l){let u=l.props.children,c=i.map(d=>d===l?We.Children.count(u)>1?We.Children.only(null):We.isValidElement(u)?u.props.children:null:d);return(0,gd.jsx)(t,{...s,ref:o,children:We.isValidElement(u)?We.cloneElement(u,void 0,c):null})}return(0,gd.jsx)(t,{...s,ref:o,children:n})});return r.displayName=`${e}.Slot`,r}var MS=JA("Slot");function QA(e){let t=We.forwardRef((r,a)=>{let{children:o,...n}=r;if(NS(o)&&typeof yd=="function"&&(o=yd(o._payload)),We.isValidElement(o)){let s=tR(o),i=eR(n,o.props);return o.type!==We.Fragment&&(i.ref=a?Bl(a,s):s),We.cloneElement(o,i)}return We.Children.count(o)>1?We.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var YA=Symbol("radix.slottable");function ZA(e){return We.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===YA}function eR(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 tR(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 OS=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,BS=md,FS=(e,t)=>r=>{var a;if(t?.variants==null)return BS(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=OS(c)||OS(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,...h}=c;return Object.entries(h).every(v=>{let[x,C]=v;return Array.isArray(C)?C.includes({...n,...i}[x]):{...n,...i}[x]===C})?[...u,d,f]:u},[]);return BS(e,s,l,r?.class,r?.className)};var US=O(ue(),1),rR=FS("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 Bt({className:e,variant:t,size:r,asChild:a=!1,...o}){return(0,US.jsx)(a?MS:"button",{"data-slot":"button",className:er(rR({variant:t,size:r,className:e})),...o})}var dC=O(Q(),1);var W=O(Q(),1);var jS=O(Q(),1),lR=O(Ph(),1);var Qe=O(Q(),1);var vd=O(ue(),1);function VS(e){let t=aR(e),r=Qe.forwardRef((a,o)=>{let{children:n,...s}=a,i=Qe.Children.toArray(n),l=i.find(nR);if(l){let u=l.props.children,c=i.map(d=>d===l?Qe.Children.count(u)>1?Qe.Children.only(null):Qe.isValidElement(u)?u.props.children:null:d);return(0,vd.jsx)(t,{...s,ref:o,children:Qe.isValidElement(u)?Qe.cloneElement(u,void 0,c):null})}return(0,vd.jsx)(t,{...s,ref:o,children:n})});return r.displayName=`${e}.Slot`,r}function aR(e){let t=Qe.forwardRef((r,a)=>{let{children:o,...n}=r;if(Qe.isValidElement(o)){let s=iR(o),i=sR(n,o.props);return o.type!==Qe.Fragment&&(i.ref=a?Bl(a,s):s),Qe.cloneElement(o,i)}return Qe.Children.count(o)>1?Qe.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var oR=Symbol("radix.slottable");function nR(e){return Qe.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===oR}function sR(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 iR(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 qS=O(ue(),1),uR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Cs=uR.reduce((e,t)=>{let r=VS(`Primitive.${t}`),a=jS.forwardRef((o,n)=>{let{asChild:s,...i}=o,l=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,qS.jsx)(l,{...i,ref:n})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});var Ft=O(Q(),1);var HS=O(Q(),1),Fl=globalThis?.document?HS.useLayoutEffect:()=>{};var zS=O(Q(),1);function cR(e,t){return zS.useReducer((r,a)=>t[r][a]??r,e)}var bs=e=>{let{present:t,children:r}=e,a=dR(t),o=typeof r=="function"?r({present:a.isPresent}):Ft.Children.only(r),n=ga(a.ref,fR(o));return typeof r=="function"||a.isPresent?Ft.cloneElement(o,{ref:n}):null};bs.displayName="Presence";function dR(e){let[t,r]=Ft.useState(),a=Ft.useRef(null),o=Ft.useRef(e),n=Ft.useRef("none"),s=e?"mounted":"unmounted",[i,l]=cR(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return Ft.useEffect(()=>{let u=xd(a.current);n.current=i==="mounted"?u:"none"},[i]),Fl(()=>{let u=a.current,c=o.current;if(c!==e){let f=n.current,h=xd(u);e?l("MOUNT"):h==="none"||u?.display==="none"?l("UNMOUNT"):l(c&&f!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Fl(()=>{if(t){let u,c=t.ownerDocument.defaultView??window,d=h=>{let x=xd(a.current).includes(CSS.escape(h.animationName));if(h.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=h=>{h.target===t&&(n.current=xd(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:Ft.useCallback(u=>{a.current=u?getComputedStyle(u):null,r(u)},[])}}function xd(e){return e?.animationName||"none"}function fR(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 ya=O(Q(),1),$S=O(ue(),1);function WS(e,t=[]){let r=[];function a(n,s){let i=ya.createContext(s),l=r.length;r=[...r,s];let u=d=>{let{scope:f,children:h,...v}=d,x=f?.[e]?.[l]||i,C=ya.useMemo(()=>v,Object.values(v));return(0,$S.jsx)(x.Provider,{value:C,children:h})};u.displayName=n+"Provider";function c(d,f){let h=f?.[e]?.[l]||i,v=ya.useContext(h);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=>ya.createContext(s));return function(i){let l=i?.[e]||n;return ya.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[a,pR(o,...t)]}function pR(...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 ya.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var Ls=O(Q(),1);function io(e){let t=Ls.useRef(e);return Ls.useEffect(()=>{t.current=e}),Ls.useMemo(()=>(...r)=>t.current?.(...r),[])}var wd=O(Q(),1),mR=O(ue(),1),hR=wd.createContext(void 0);function GS(e){let t=wd.useContext(hR);return e||t||"ltr"}function KS(e,[t,r]){return Math.min(r,Math.max(t,e))}var s2=!!(typeof window<"u"&&window.document&&window.document.createElement);function lo(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}var JS=O(Q(),1),fe=O(ue(),1);function gR(e,t){return JS.useReducer((r,a)=>t[r][a]??r,e)}var ig="ScrollArea",[QS,y2]=WS(ig),[yR,yr]=QS(ig),YS=W.forwardRef((e,t)=>{let{__scopeScrollArea:r,type:a="hover",dir:o,scrollHideDelay:n=600,...s}=e,[i,l]=W.useState(null),[u,c]=W.useState(null),[d,f]=W.useState(null),[h,v]=W.useState(null),[x,C]=W.useState(null),[g,p]=W.useState(0),[y,b]=W.useState(0),[L,P]=W.useState(!1),[T,A]=W.useState(!1),N=ga(t,pe=>l(pe)),j=GS(o);return(0,fe.jsx)(yR,{scope:r,type:a,dir:j,scrollHideDelay:n,scrollArea:i,viewport:u,onViewportChange:c,content:d,onContentChange:f,scrollbarX:h,onScrollbarXChange:v,scrollbarXEnabled:L,onScrollbarXEnabledChange:P,scrollbarY:x,onScrollbarYChange:C,scrollbarYEnabled:T,onScrollbarYEnabledChange:A,onCornerWidthChange:p,onCornerHeightChange:b,children:(0,fe.jsx)(Cs.div,{dir:j,...s,ref:N,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":y+"px",...e.style}})})});YS.displayName=ig;var ZS="ScrollAreaViewport",eC=W.forwardRef((e,t)=>{let{__scopeScrollArea:r,children:a,nonce:o,...n}=e,s=yr(ZS,r),i=W.useRef(null),l=ga(t,i,s.onViewportChange);return(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.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,fe.jsx)(Cs.div,{"data-radix-scroll-area-viewport":"",...n,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:(0,fe.jsx)("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:a})})]})});eC.displayName=ZS;var qr="ScrollAreaScrollbar",lg=W.forwardRef((e,t)=>{let{forceMount:r,...a}=e,o=yr(qr,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,fe.jsx)(vR,{...a,ref:t,forceMount:r}):o.type==="scroll"?(0,fe.jsx)(xR,{...a,ref:t,forceMount:r}):o.type==="auto"?(0,fe.jsx)(tC,{...a,ref:t,forceMount:r}):o.type==="always"?(0,fe.jsx)(ug,{...a,ref:t}):null});lg.displayName=qr;var vR=W.forwardRef((e,t)=>{let{forceMount:r,...a}=e,o=yr(qr,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)},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,fe.jsx)(bs,{present:r||n,children:(0,fe.jsx)(tC,{"data-state":n?"visible":"hidden",...a,ref:t})})}),xR=W.forwardRef((e,t)=>{let{forceMount:r,...a}=e,o=yr(qr,e.__scopeScrollArea),n=e.orientation==="horizontal",s=Ld(()=>l("SCROLL_END"),100),[i,l]=gR("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,c=n?"scrollLeft":"scrollTop";if(u){let d=u[c],f=()=>{let h=u[c];d!==h&&(l("SCROLL"),s()),d=h};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[o.viewport,n,l,s]),(0,fe.jsx)(bs,{present:r||i!=="hidden",children:(0,fe.jsx)(ug,{"data-state":i==="hidden"?"hidden":"visible",...a,ref:t,onPointerEnter:lo(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:lo(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),tC=W.forwardRef((e,t)=>{let r=yr(qr,e.__scopeScrollArea),{forceMount:a,...o}=e,[n,s]=W.useState(!1),i=e.orientation==="horizontal",l=Ld(()=>{if(r.viewport){let u=r.viewport.offsetWidth<r.viewport.scrollWidth,c=r.viewport.offsetHeight<r.viewport.scrollHeight;s(i?u:c)}},10);return Is(r.viewport,l),Is(r.content,l),(0,fe.jsx)(bs,{present:a||n,children:(0,fe.jsx)(ug,{"data-state":n?"visible":"hidden",...o,ref:t})})}),ug=W.forwardRef((e,t)=>{let{orientation:r="vertical",...a}=e,o=yr(qr,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=nC(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,h){return IR(f,s.current,i,h)}return r==="horizontal"?(0,fe.jsx)(wR,{...c,ref:t,onThumbPositionChange:()=>{if(o.viewport&&n.current){let f=o.viewport.scrollLeft,h=XS(f,i,o.dir);n.current.style.transform=`translate3d(${h}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,fe.jsx)(SR,{...c,ref:t,onThumbPositionChange:()=>{if(o.viewport&&n.current){let f=o.viewport.scrollTop,h=XS(f,i);n.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollTop=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollTop=d(f))}}):null}),wR=W.forwardRef((e,t)=>{let{sizes:r,onSizesChange:a,...o}=e,n=yr(qr,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,fe.jsx)(aC,{"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":bd(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),iC(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:Cd(s.paddingLeft),paddingEnd:Cd(s.paddingRight)}})}})}),SR=W.forwardRef((e,t)=>{let{sizes:r,onSizesChange:a,...o}=e,n=yr(qr,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,fe.jsx)(aC,{"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":bd(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),iC(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:Cd(s.paddingTop),paddingEnd:Cd(s.paddingBottom)}})}})}),[CR,rC]=QS(qr),aC=W.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,h=yr(qr,r),[v,x]=W.useState(null),C=ga(t,N=>x(N)),g=W.useRef(null),p=W.useRef(""),y=h.viewport,b=a.content-a.viewport,L=io(c),P=io(l),T=Ld(d,10);function A(N){if(g.current){let j=N.clientX-g.current.left,pe=N.clientY-g.current.top;u({x:j,y:pe})}}return W.useEffect(()=>{let N=j=>{let pe=j.target;v?.contains(pe)&&L(j,b)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[y,v,b,L]),W.useEffect(P,[a,P]),Is(v,T),Is(h.content,T),(0,fe.jsx)(CR,{scope:r,scrollbar:v,hasThumb:o,onThumbChange:io(n),onThumbPointerUp:io(s),onThumbPositionChange:P,onThumbPointerDown:io(i),children:(0,fe.jsx)(Cs.div,{...f,ref:C,style:{position:"absolute",...f.style},onPointerDown:lo(e.onPointerDown,N=>{N.button===0&&(N.target.setPointerCapture(N.pointerId),g.current=v.getBoundingClientRect(),p.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),A(N))}),onPointerMove:lo(e.onPointerMove,A),onPointerUp:lo(e.onPointerUp,N=>{let j=N.target;j.hasPointerCapture(N.pointerId)&&j.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=p.current,h.viewport&&(h.viewport.style.scrollBehavior=""),g.current=null})})})}),Sd="ScrollAreaThumb",cg=W.forwardRef((e,t)=>{let{forceMount:r,...a}=e,o=rC(Sd,e.__scopeScrollArea);return(0,fe.jsx)(bs,{present:r||o.hasThumb,children:(0,fe.jsx)(bR,{ref:t,...a})})}),bR=W.forwardRef((e,t)=>{let{__scopeScrollArea:r,style:a,...o}=e,n=yr(Sd,r),s=rC(Sd,r),{onThumbPositionChange:i}=s,l=ga(t,d=>s.onThumbChange(d)),u=W.useRef(void 0),c=Ld(()=>{u.current&&(u.current(),u.current=void 0)},100);return W.useEffect(()=>{let d=n.viewport;if(d){let f=()=>{if(c(),!u.current){let h=kR(d,i);u.current=h,i()}};return i(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[n.viewport,c,i]),(0,fe.jsx)(Cs.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:lo(e.onPointerDownCapture,d=>{let h=d.target.getBoundingClientRect(),v=d.clientX-h.left,x=d.clientY-h.top;s.onThumbPointerDown({x:v,y:x})}),onPointerUp:lo(e.onPointerUp,s.onThumbPointerUp)})});cg.displayName=Sd;var dg="ScrollAreaCorner",oC=W.forwardRef((e,t)=>{let r=yr(dg,e.__scopeScrollArea),a=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&a?(0,fe.jsx)(LR,{...e,ref:t}):null});oC.displayName=dg;var LR=W.forwardRef((e,t)=>{let{__scopeScrollArea:r,...a}=e,o=yr(dg,r),[n,s]=W.useState(0),[i,l]=W.useState(0),u=!!(n&&i);return Is(o.scrollbarX,()=>{let c=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(c),l(c)}),Is(o.scrollbarY,()=>{let c=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(c),s(c)}),u?(0,fe.jsx)(Cs.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 Cd(e){return e?parseInt(e,10):0}function nC(e,t){let r=e/t;return isNaN(r)?0:r}function bd(e){let t=nC(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,a=(e.scrollbar.size-r)*t;return Math.max(a,18)}function IR(e,t,r,a="ltr"){let o=bd(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 sC([l,u],d)(e)}function XS(e,t,r="ltr"){let a=bd(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=KS(e,l);return sC([0,s],[0,i])(u)}function sC(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 iC(e,t){return e>0&&e<t}var kR=(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 Ld(e,t){let r=io(e),a=W.useRef(0);return W.useEffect(()=>()=>window.clearTimeout(a.current),[]),W.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(r,t)},[r,t])}function Is(e,t){let r=io(t);Fl(()=>{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 lC=YS,uC=eC;var cC=oC;var uo=O(ue(),1),fg=dC.forwardRef(({className:e,children:t,...r},a)=>(0,uo.jsxs)(lC,{"data-slot":"scroll-area",className:er("relative",e),...r,children:[(0,uo.jsx)(uC,{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,uo.jsx)(TR,{}),(0,uo.jsx)(cC,{})]}));fg.displayName="ScrollArea";function TR({className:e,orientation:t="vertical",...r}){return(0,uo.jsx)(lg,{"data-slot":"scroll-area-scrollbar",orientation:t,className:er("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,uo.jsx)(cg,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}var kd=O(Q());var fC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_R=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,a)=>a?a.toUpperCase():r.toLowerCase()),pg=e=>{let t=_R(e);return t.charAt(0).toUpperCase()+t.slice(1)},Id=(...e)=>e.filter((t,r,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===r).join(" ").trim(),pC=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Ul=O(Q());var mC={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 hC=(0,Ul.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:a,className:o="",children:n,iconNode:s,...i},l)=>(0,Ul.createElement)("svg",{ref:l,...mC,width:t,height:t,stroke:e,strokeWidth:a?Number(r)*24/Number(t):r,className:Id("lucide",o),...!n&&!pC(i)&&{"aria-hidden":"true"},...i},[...s.map(([u,c])=>(0,Ul.createElement)(u,c)),...Array.isArray(n)?n:[n]]));var V=(e,t)=>{let r=(0,kd.forwardRef)(({className:a,...o},n)=>(0,kd.createElement)(hC,{ref:n,iconNode:t,className:Id(`lucide-${fC(pg(e))}`,`lucide-${e}`,a),...o}));return r.displayName=pg(e),r};var AR=[["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"}]],Vl=V("activity",AR);var RR=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],ks=V("arrow-left",RR);var ER=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],jl=V("arrow-up",ER);var DR=[["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"}]],ql=V("calendar",DR);var NR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Hl=V("chevron-down",NR);var MR=[["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"}]],_r=V("circle-alert",MR);var OR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],nt=V("circle-check",OR);var BR=[["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"}]],Ar=V("circle-x",BR);var FR=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],cn=V("clock",FR);var UR=[["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"}]],va=V("command",UR);var VR=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],xa=V("corner-down-left",VR);var jR=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],dn=V("credit-card",jR);var qR=[["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"}]],fn=V("crown",qR);var HR=[["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"}]],pn=V("dollar-sign",HR);var zR=[["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"}]],Ps=V("file-spreadsheet",zR);var $R=[["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"}]],Ts=V("key",$R);var WR=[["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"}]],zl=V("laptop",WR);var GR=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],tr=V("loader-circle",GR);var KR=[["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"}]],_s=V("mail",KR);var XR=[["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"}]],As=V("map-pin",XR);var JR=[["path",{d:"M5 12h14",key:"1ays0h"}]],$l=V("minus",JR);var QR=[["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"}]],Wl=V("paperclip",QR);var YR=[["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"}]],Rs=V("refresh-cw",YR);var ZR=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],mn=V("search",ZR);var e1=[["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"}]],Es=V("shield",e1);var t1=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],Gl=V("smartphone",t1);var r1=[["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"}]],Hr=V("sparkles",r1);var a1=[["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"}]],Ut=V("square-pen",a1);var o1=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Kl=V("trending-up",o1);var n1=[["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"}]],Ds=V("users",n1);var s1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],hn=V("x",s1);var i1=[["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"}]],Xl=V("zap",i1);var Ve=O(ue(),1);function gC({phase:e,progressSteps:t=[]}){return(0,Ve.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,Ve.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ve.jsx)(tr,{className:"h-3.5 w-3.5 animate-spin"}),(0,Ve.jsx)("span",{children:"Thinking\u2026"})]}),e==="searching"&&(0,Ve.jsxs)("div",{className:"space-y-2 animate-in fade-in-0 duration-300",children:[(0,Ve.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ve.jsx)(mn,{className:"h-3.5 w-3.5 opacity-70"}),(0,Ve.jsx)("span",{children:"Searching across pages\u2026"})]}),(0,Ve.jsxs)("ul",{className:"ml-6 list-disc space-y-1",children:[(0,Ve.jsx)("li",{className:"opacity-90",children:"Checking recent changes"}),(0,Ve.jsx)("li",{className:"opacity-90",children:"Scanning documentation"}),(0,Ve.jsx)("li",{className:"opacity-90",children:"Summarizing relevant sections"})]})]}),(e==="thinking"||e==="executing"||e==="responding")&&t.length>0&&(0,Ve.jsxs)("div",{className:"space-y-2 animate-in fade-in-0 duration-200",children:[t.map((r,a)=>(0,Ve.jsxs)("div",{className:`flex items-center gap-2 transition-opacity duration-200 ${r.completed?"opacity-60":"opacity-100"}`,children:[r.completed?(0,Ve.jsx)(nt,{className:"h-3.5 w-3.5 text-green-500 flex-shrink-0"}):(0,Ve.jsx)(tr,{className:"h-3.5 w-3.5 animate-spin flex-shrink-0"}),(0,Ve.jsx)("span",{className:r.completed?"line-through":"",children:r.message})]},a)),e==="responding"&&(0,Ve.jsxs)("div",{className:"flex items-center gap-2 opacity-100 animate-in fade-in-0 duration-200",children:[(0,Ve.jsx)(tr,{className:"h-3.5 w-3.5 animate-spin flex-shrink-0"}),(0,Ve.jsx)("span",{children:"Preparing response..."})]})]})]})}var yC=O(Q(),1);var Rr=O(ue(),1);function vC({title:e,links:t}){let[r,a]=yC.useState(!1);return(0,Rr.jsxs)("div",{className:"text-xs text-muted-foreground",children:[(0,Rr.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,Rr.jsxs)("div",{className:"flex items-center gap-1.5",children:[r?(0,Rr.jsx)(Hl,{className:"h-3 w-3 opacity-70"}):(0,Rr.jsx)(mn,{className:"h-3 w-3 opacity-70"}),(0,Rr.jsx)("span",{children:e})]})}),r&&t.length>0&&(0,Rr.jsx)("ul",{className:"ml-5 mt-1 space-y-0.5",children:t.map(o=>(0,Rr.jsx)("li",{children:(0,Rr.jsx)("a",{href:o.href,target:"_blank",rel:"noreferrer",className:"text-primary hover:underline",children:o.label})},o.href))})]})}var Ql=O(ue(),1),zr=O(Q(),1);var xC=O(Q(),1),Ns=(0,xC.createContext)({});var wC=O(Q(),1);function Ms(e){let t=(0,wC.useRef)(null);return t.current===null&&(t.current=e()),t.current}var hg=O(ue(),1),IC=O(Q(),1),gn=O(Q(),1);var SC=O(Q(),1),co=(0,SC.createContext)(null);var bC=O(ue(),1),Pd=O(Q(),1),wa=O(Q(),1);var CC=O(Q(),1),Os=(0,CC.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});var mg=class extends Pd.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 LC({children:e,isPresent:t}){let r=(0,wa.useId)(),a=(0,wa.useRef)(null),o=(0,wa.useRef)({width:0,height:0,top:0,left:0}),{nonce:n}=(0,wa.useContext)(Os);return(0,wa.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(`
49
+ ${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}},ln=class extends Me{constructor(t,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:t}),this.name="WebAuthnUnknownError",this.originalError=r}};function cS({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(tg(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 dS({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(tg(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 rg=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}}},F_=new rg;function pS(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=Go(e,["challenge","user","excludeCredentials"]),n=ao(t).buffer,s=Object.assign(Object.assign({},r),{id:ao(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:ao(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return i}function mS(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=Go(e,["challenge","allowCredentials"]),o=ao(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:ao(i.id).buffer,type:i.type||"public-key",transports:i.transports})}}return n}function hS(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:ma(new Uint8Array(e.response.attestationObject)),clientDataJSON:ma(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function gS(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:ma(new Uint8Array(o.authenticatorData)),clientDataJSON:ma(new Uint8Array(o.clientDataJSON)),signature:ma(new Uint8Array(o.signature)),userHandle:o.userHandle?ma(new Uint8Array(o.userHandle)):void 0},type:"public-key",clientExtensionResults:a,authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function tg(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function fS(){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 U_(e){try{let t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new ln("Browser returned unexpected credential type",t)}:{data:null,error:new ln("Empty credential response",t)}}catch(t){return{data:null,error:cS({error:t,options:e})}}}async function V_(e){try{let t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new ln("Browser returned unexpected credential type",t)}:{data:null,error:new ln("Empty credential response",t)}}catch(t){return{data:null,error:dS({error:t,options:e})}}}var j_={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},q_={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function dd(...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]=dd(i,s):a[n]=dd(s)}else a[n]=s}return a}function H_(e,t){return dd(j_,e,t||{})}function z_(e,t){return dd(q_,e,t||{})}var fd=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??F_.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=H_(s.webauthn.credential_options.publicKey,n?.create),{data:c,error:d}=await U_({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=z_(s.webauthn.credential_options.publicKey,n?.request),{data:c,error:d}=await V_(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 H(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 ro("rpId is required for WebAuthn authentication")};try{if(!fS())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 H(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 ro("rpId is required for WebAuthn registration")};try{if(!fS())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 H(s)?{data:null,error:s}:{data:null,error:new hr("Unexpected error in register",s)}}}};sS();var $_={url:Mw,storageKey:Ow,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Bw,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:1e4};async function yS(e,t,r){return await r()}var xs={},pd=class e{get jwks(){var t,r;return(r=(t=xs[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(t){xs[this.storageKey]=Object.assign(Object.assign({},xs[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,r;return(r=(t=xs[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){xs[this.storageKey]=Object.assign(Object.assign({},xs[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({},$_),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 nn({url:n.url,headers:n.headers,fetch:n.fetch}),this.url=n.url,this.headers=n.headers,this.fetch=sd(n.fetch),this.lock=n.lock||yS,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=Zh:this.lock=yS,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 fd(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:nd()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Yh(this.memoryStorage)),n.userStorage&&(this.userStorage=n.userStorage)):(this.memoryStorage={},this.storage=Yh(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} (${Yc}) ${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=Xw(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),qw(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 H(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 G(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:gr}),{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(H(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,h=null,v=null;this.flowType==="pkce"&&([h,v]=await rn(this.storage,this.storageKey)),n=await G(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:h,code_challenge_method:v},xform:gr})}else if("phone"in t){let{phone:c,password:d,options:f}=t;n=await G(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:gr})}else throw new Qo("You must provide either an email or phone number and a password");let{data:s,error:i}=n;if(i||!s)return await ot(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 ot(this.storage,`${this.storageKey}-code-verifier`),H(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 G(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:Jh})}else if("phone"in t){let{phone:n,password:s,options:i}=t;r=await G(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:Jh})}else throw new Qo("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 pa;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(H(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 h,v;if("message"in t)h=t.message,v=t.signature;else{let{chain:x,wallet:C,statement:g,options:p}=t,y;if(Je())if(typeof C=="object")y=C;else{let N=window;if("ethereum"in N&&typeof N.ethereum=="object"&&"request"in N.ethereum&&typeof N.ethereum.request=="function")y=N.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"||!p?.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=p?.url)!==null&&r!==void 0?r:window.location.href),L=await y.request({method:"eth_requestAccounts"}).then(N=>N).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 P=eg(L[0]),T=(a=p?.signInWithEthereum)===null||a===void 0?void 0:a.chainId;if(!T){let N=await y.request({method:"eth_chainId"});T=iS(N)}let A={domain:b.host,address:P,statement:g,uri:b.href,version:"1",chainId:T,nonce:(o=p?.signInWithEthereum)===null||o===void 0?void 0:o.nonce,issuedAt:(s=(n=p?.signInWithEthereum)===null||n===void 0?void 0:n.issuedAt)!==null&&s!==void 0?s:new Date,expirationTime:(i=p?.signInWithEthereum)===null||i===void 0?void 0:i.expirationTime,notBefore:(l=p?.signInWithEthereum)===null||l===void 0?void 0:l.notBefore,requestId:(u=p?.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(c=p?.signInWithEthereum)===null||c===void 0?void 0:c.resources};h=uS(A),v=await y.request({method:"personal_sign",params:[lS(h),P]})}try{let{data:x,error:C}=await G(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:h,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:gr});if(C)throw C;if(!x||!x.session||!x.user){let g=new pa;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(H(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,h;let v,x;if("message"in t)v=t.message,x=t.signature;else{let{chain:C,wallet:g,statement:p,options:y}=t,b;if(Je())if(typeof g=="object")b=g;else{let P=window;if("solana"in P&&typeof P.solana=="object"&&("signIn"in P.solana&&typeof P.solana.signIn=="function"||"signMessage"in P.solana&&typeof P.solana.signMessage=="function"))b=P.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 P=await b.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},y?.signInWithSolana),{version:"1",domain:L.host,uri:L.href}),p?{statement:p}:null)),T;if(Array.isArray(P)&&P[0]&&typeof P[0]=="object")T=P[0];else if(P&&typeof P=="object"&&"signedMessage"in P&&"signature"in P)T=P;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in T&&"signature"in T&&(typeof T.signedMessage=="string"||T.signedMessage instanceof Uint8Array)&&T.signature instanceof Uint8Array)v=typeof T.signedMessage=="string"?T.signedMessage:new TextDecoder().decode(T.signedMessage),x=T.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(),...p?["",p,""]:[""],"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(T=>`- ${T}`)]:[]].join(`
50
+ `);let P=await b.signMessage(new TextEncoder().encode(v),"utf8");if(!P||!(P instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");x=P}}try{let{data:C,error:g}=await G(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:v,signature:ma(x)},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(h=t.options)===null||h===void 0?void 0:h.captchaToken}}:null),xform:gr});if(g)throw g;if(!C||!C.session||!C.user){let p=new pa;return this._returnResult({data:{user:null,session:null},error:p})}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(H(C))return this._returnResult({data:{user:null,session:null},error:C});throw C}}async _exchangeCodeForSession(t){let r=await oo(this.storage,`${this.storageKey}-code-verifier`),[a,o]=(r??"").split("/");try{if(!a&&this.flowType==="pkce")throw new rd;let{data:n,error:s}=await G(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:a},xform:gr});if(await ot(this.storage,`${this.storageKey}-code-verifier`),s)throw s;if(!n||!n.session||!n.user){let i=new pa;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 ot(this.storage,`${this.storageKey}-code-verifier`),H(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 G(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:gr}),{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 pa;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(H(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 rn(this.storage,this.storageKey));let{error:d}=await G(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 G(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 Qo("You must provide either an email or phone number.")}catch(i){if(await ot(this.storage,`${this.storageKey}-code-verifier`),H(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 G(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:n}}),redirectTo:o,xform:gr});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(H(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 rn(this.storage,this.storageKey));let u=await G(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:oS});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 ot(this.storage,`${this.storageKey}-code-verifier`),H(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 ct;let{error:o}=await G(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(H(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 G(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 G(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 Qo("You must provide either an email or phone number and a type")}catch(r){if(H(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 oo(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()<ed:!1;if(this._debug("#__loadSession()",`session has${a?"":" not"} expired`,"expires_at",t.expires_at),!a){if(this.userStorage){let s=await oo(this.userStorage,this.storageKey+"-user");s?.user?t.user=s.user:t.user=ld()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){let s={value:this.suppressGetSessionWarning};t.user=rS(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 G(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:jr}):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 ct}:await G(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:jr})})}catch(r){if(H(r))return jw(r)&&(await this._removeSession(),await ot(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 ct;let s=o.session,i=null,l=null;this.flowType==="pkce"&&t.email!=null&&([i,l]=await rn(this.storage,this.storageKey));let{data:u,error:c}=await G(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:jr});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 ot(this.storage,`${this.storageKey}-code-verifier`),H(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 ct;let r=Date.now()/1e3,a=r,o=!0,n=null,{payload:s}=id(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(H(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 ct;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(H(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(t,r){try{if(!Je())throw new Yo("No browser detected.");if(t.error||t.error_description||t.error_code)throw new Yo(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 _l("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Yo("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 _l("No code detected.");let{data:p,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:p.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 Yo("No session defined in URL");let c=Math.round(Date.now()/1e3),d=parseInt(i),f=c+d;l&&(f=parseInt(l));let h=f-c;h*1e3<=Jo&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${h}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(H(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 oo(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&&!(Vw(i)&&(i.status===404||i.status===401||i.status===403)))return this._returnResult({error:i})}return t!=="others"&&(await this._removeSession(),await ot(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){let r=Kw(),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 rn(this.storage,this.storageKey,!0));try{return await G(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 ot(this.storage,`${this.storageKey}-code-verifier`),H(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(H(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 h=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 G(this.fetch,"GET",h,{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(H(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 G(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:gr}),{data:f,error:h}=d;return h?this._returnResult({data:{user:null,session:null},error:h}):!f||!f.session||!f.user?this._returnResult({data:{user:null,session:null},error:new pa}):(f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("USER_UPDATED",f.session)),this._returnResult({data:f,error:h}))}catch(o){if(await ot(this.storage,`${this.storageKey}-code-verifier`),H(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 G(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(H(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 Yw(async o=>(o>0&&await Qw(200*Math.pow(2,o-1)),this._debug(r,"refreshing attempt",o),await G(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:gr})),(o,n)=>{let s=200*Math.pow(2,o);return n&&ad(n)&&Date.now()+s-a<Jo})}catch(a){if(this._debug(r,"error",a),H(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 oo(this.storage,this.storageKey);if(o&&this.userStorage){let s=await oo(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!s&&(s={user:o.user},await tn(this.userStorage,this.storageKey+"-user",s)),o.user=(t=s?.user)!==null&&t!==void 0?t:ld()}else if(o&&!o.user&&!o.user){let s=await oo(this.storage,this.storageKey+"-user");s&&s?.user?(o.user=s.user,await ot(this.storage,this.storageKey+"-user"),await tn(this.storage,this.storageKey,o)):o.user=ld()}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()<ed;if(this._debug(a,`session has${n?"":" not"} expired with margin of ${ed}s`),n){if(this.autoRefreshToken&&o.refresh_token){let{error:s}=await this._callRefreshToken(o.refresh_token);s&&(console.error(s),ad(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 ct;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let o=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(o,"begin");try{this.refreshingDeferred=new Rl;let{data:n,error:s}=await this._refreshAccessToken(t);if(s)throw s;if(!n.session)throw new ct;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),H(n)){let s={data:null,error:n};return ad(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 ot(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 tn(this.userStorage,this.storageKey+"-user",{user:r.user});let o=Object.assign({},r);delete o.user;let n=Xh(o);await tn(this.storage,this.storageKey,n)}else{let o=Xh(r);await tn(this.storage,this.storageKey,o)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await ot(this.storage,this.storageKey),await ot(this.storage,this.storageKey+"-code-verifier"),await ot(this.storage,this.storageKey+"-user"),this.userStorage&&await ot(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(),Jo);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)/Jo);this._debug("#_autoRefreshTokenTick()",`access token expires in ${o} ticks, a tick lasts ${Jo}ms, refresh threshold is ${Zc} ticks`),o<=Zc&&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 El)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 rn(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 G(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(H(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 G(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(H(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"?hS(t.webauthn.credential_response):gS(t.webauthn.credential_response)})}:{code:t.code}),{data:i,error:l}=await G(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(H(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 G(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:pS(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:mS(i.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(H(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}=id(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 G(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 ct})})}catch(r){if(H(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 ct});let s=await G(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(H(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 ct});let s=await G(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(H(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 G(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 ct})})}catch(t){if(H(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 G(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 ct})})}catch(r){if(H(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+Uw>o)return a;let{data:n,error:s}=await G(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:h,error:v}=await this.getSession();if(v||!h.session)return this._returnResult({data:null,error:v});a=h.session.access_token}let{header:o,payload:n,signature:s,raw:{header:i,payload:l}}=id(a);r?.allowExpired||eS(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:h}=await this.getUser(a);if(h)throw h;return{data:{claims:n,header:o,signature:s},error:null}}let c=tS(o.alg),d=await crypto.subtle.importKey("jwk",u,c,!0,["verify"]);if(!await crypto.subtle.verify(c,d,s,Ww(`${i}.${l}`)))throw new Zo("Invalid JWT signature");return{data:{claims:n,header:o,signature:s},error:null}}catch(a){if(H(a))return this._returnResult({data:null,error:a});throw a}}};pd.nextInstanceID={};var ag=pd;var W_=ag,og=W_;var G_="2.90.1",Dl="";typeof Deno<"u"?Dl="deno":typeof document<"u"?Dl="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Dl="react-native":Dl="node";var K_={"X-Client-Info":`supabase-js-${Dl}/${G_}`},X_={headers:K_},J_={schema:"public"},Q_={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},Y_={};function Nl(e){"@babel/helpers - typeof";return Nl=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},Nl(e)}function Z_(e,t){if(Nl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t||"default");if(Nl(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function eA(e){var t=Z_(e,"string");return Nl(t)=="symbol"?t:t+""}function tA(e,t,r){return(t=eA(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vS(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 Ue(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?vS(Object(r),!0).forEach(function(a){tA(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vS(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}var rA=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),aA=()=>Headers,oA=(e,t,r)=>{let a=rA(r),o=aA();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,Ue(Ue({},s),{},{headers:u}))}};function nA(e){return e.endsWith("/")?e:e+"/"}function sA(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:Ue(Ue({},l),o),auth:Ue(Ue({},u),n),realtime:Ue(Ue({},c),s),storage:{},global:Ue(Ue(Ue({},d),i),{},{headers:Ue(Ue({},(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 iA(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(nA(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var lA=class extends og{constructor(e){super(e)}},uA=class{constructor(e,t,r){var a,o;this.supabaseUrl=e,this.supabaseKey=t;let n=iA(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:J_,realtime:Y_,auth:Ue(Ue({},Q_),{},{storageKey:s}),global:X_},l=sA(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=oA(t,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(Ue({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 vw(new URL("rest/v1",n).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch}),this.storage=new Nw(this.storageUrl.href,this.headers,this.fetch,r?.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new Sl(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 lA({url:this.authUrl.href,headers:Ue(Ue({},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(h=>h.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new gs(this.realtimeUrl.href,Ue(Ue({},e),{},{params:Ue(Ue({},{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)}},xS=(e,t,r)=>new uA(e,t,r);function cA(){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}cA()&&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");function wS(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=wS(e[t]))&&(a&&(a+=" "),a+=r)}else for(r in e)e[r]&&(a&&(a+=" "),a+=r);return a}function md(){for(var e,t,r=0,a="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=wS(e))&&(a&&(a+=" "),a+=t);return a}var dA=e=>{let t=pA(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:s=>{let i=s.split("-");return i[0]===""&&i.length!==1&&i.shift(),bS(i,t)||fA(s)},getConflictingClassGroupIds:(s,i)=>{let l=r[s]||[];return i&&a[s]?[...l,...a[s]]:l}}},bS=(e,t)=>{if(e.length===0)return t.classGroupId;let r=e[0],a=t.nextPart.get(r),o=a?bS(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},SS=/^\[(.+)\]$/,fA=e=>{if(SS.test(e)){let t=SS.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},pA=e=>{let{theme:t,prefix:r}=e,a={nextPart:new Map,validators:[]};return hA(Object.entries(e.classGroups),r).forEach(([n,s])=>{sg(s,a,n,t)}),a},sg=(e,t,r,a)=>{e.forEach(o=>{if(typeof o=="string"){let n=o===""?t:CS(t,o);n.classGroupId=r;return}if(typeof o=="function"){if(mA(o)){sg(o(a),t,r,a);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([n,s])=>{sg(s,CS(t,n),r,a)})})},CS=(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},mA=e=>e.isThemeGetter,hA=(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,gA=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 yA=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),h=f.startsWith("!"),v=h?f.substring(1):f,x=d&&d>c?d-c:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:v,maybePostfixModifierPosition:x}};return r?i=>r({className:i,parseClassName:s}):s},vA=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},xA=e=>({cache:gA(e.cacheSize),parseClassName:yA(e),...dA(e)}),wA=/\s+/,SA=(e,t)=>{let{parseClassName:r,getClassGroupId:a,getConflictingClassGroupIds:o}=t,n=[],s=e.trim().split(wA),i="";for(let l=s.length-1;l>=0;l-=1){let u=s[l],{modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=r(u),v=!!h,x=a(v?f.substring(0,h):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=vA(c).join(":"),g=d?C+"!":C,p=g+x;if(n.includes(p))continue;n.push(p);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 CA(){let e=0,t,r,a="";for(;e<arguments.length;)(t=arguments[e++])&&(r=LS(t))&&(a&&(a+=" "),a+=r);return a}var LS=e=>{if(typeof e=="string")return e;let t,r="";for(let a=0;a<e.length;a++)e[a]&&(t=LS(e[a]))&&(r&&(r+=" "),r+=t);return r};function bA(e,...t){let r,a,o,n=s;function s(l){let u=t.reduce((c,d)=>d(c),e());return r=xA(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=SA(l,r);return o(l,c),c}return function(){return n(CA.apply(null,arguments))}}var Pe=e=>{let t=r=>r[e]||[];return t.isThemeGetter=!0,t},IS=/^\[(?:([a-z-]+):)?(.+)\]$/i,LA=/^\d+\/\d+$/,IA=new Set(["px","full","screen"]),kA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,PA=/\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$/,TA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,_A=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,AA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ha=e=>ws(e)||IA.has(e)||LA.test(e),no=e=>Ss(e,"length",FA),ws=e=>!!e&&!Number.isNaN(Number(e)),ng=e=>Ss(e,"number",ws),Ml=e=>!!e&&Number.isInteger(Number(e)),RA=e=>e.endsWith("%")&&ws(e.slice(0,-1)),te=e=>IS.test(e),so=e=>kA.test(e),EA=new Set(["length","size","percentage"]),DA=e=>Ss(e,EA,kS),NA=e=>Ss(e,"position",kS),MA=new Set(["image","url"]),OA=e=>Ss(e,MA,VA),BA=e=>Ss(e,"",UA),Ol=()=>!0,Ss=(e,t,r)=>{let a=IS.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):r(a[2]):!1},FA=e=>PA.test(e)&&!TA.test(e),kS=()=>!1,UA=e=>_A.test(e),VA=e=>AA.test(e);var jA=()=>{let e=Pe("colors"),t=Pe("spacing"),r=Pe("blur"),a=Pe("brightness"),o=Pe("borderColor"),n=Pe("borderRadius"),s=Pe("borderSpacing"),i=Pe("borderWidth"),l=Pe("contrast"),u=Pe("grayscale"),c=Pe("hueRotate"),d=Pe("invert"),f=Pe("gap"),h=Pe("gradientColorStops"),v=Pe("gradientColorStopPositions"),x=Pe("inset"),C=Pe("margin"),g=Pe("opacity"),p=Pe("padding"),y=Pe("saturate"),b=Pe("scale"),L=Pe("sepia"),P=Pe("skew"),T=Pe("space"),A=Pe("translate"),N=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],pe=()=>["auto",te,t],ee=()=>[te,t],ir=()=>["",ha,no],zt=()=>["auto",ws,te],Po=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Dr=()=>["solid","dashed","dotted","double","none"],ve=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ye=()=>["start","end","center","between","around","evenly","stretch"],mt=()=>["","0",te],Aa=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ht=()=>[ws,te];return{cacheSize:500,separator:":",theme:{colors:[Ol],spacing:[ha,no],blur:["none","",so,te],brightness:ht(),borderColor:[e],borderRadius:["none","","full",so,te],borderSpacing:ee(),borderWidth:ir(),contrast:ht(),grayscale:mt(),hueRotate:ht(),invert:mt(),gap:ee(),gradientColorStops:[e],gradientColorStopPositions:[RA,no],inset:pe(),margin:pe(),opacity:ht(),padding:ee(),saturate:ht(),scale:ht(),sepia:mt(),skew:ht(),space:ee(),translate:ee()},classGroups:{aspect:[{aspect:["auto","square","video",te]}],container:["container"],columns:[{columns:[so]}],"break-after":[{"break-after":Aa()}],"break-before":[{"break-before":Aa()}],"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:[...Po(),te]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],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",Ml,te]}],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",te]}],grow:[{grow:mt()}],shrink:[{shrink:mt()}],order:[{order:["first","last","none",Ml,te]}],"grid-cols":[{"grid-cols":[Ol]}],"col-start-end":[{col:["auto",{span:["full",Ml,te]},te]}],"col-start":[{"col-start":zt()}],"col-end":[{"col-end":zt()}],"grid-rows":[{"grid-rows":[Ol]}],"row-start-end":[{row:["auto",{span:[Ml,te]},te]}],"row-start":[{"row-start":zt()}],"row-end":[{"row-end":zt()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",te]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",te]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...Ye()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Ye(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Ye(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[p]}],px:[{px:[p]}],py:[{py:[p]}],ps:[{ps:[p]}],pe:[{pe:[p]}],pt:[{pt:[p]}],pr:[{pr:[p]}],pb:[{pb:[p]}],pl:[{pl:[p]}],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":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",te,t]}],"min-w":[{"min-w":[te,t,"min","max","fit"]}],"max-w":[{"max-w":[te,t,"none","full","min","max","fit","prose",{screen:[so]},so]}],h:[{h:[te,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[te,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[te,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[te,t,"auto","min","max","fit"]}],"font-size":[{text:["base",so,no]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ng]}],"font-family":[{font:[Ol]}],"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",te]}],"line-clamp":[{"line-clamp":["none",ws,ng]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ha,te]}],"list-image":[{"list-image":["none",te]}],"list-style-type":[{list:["none","disc","decimal",te]}],"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:[...Dr(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ha,no]}],"underline-offset":[{"underline-offset":["auto",ha,te]}],"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:ee()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",te]}],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",te]}],"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:[...Po(),NA]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",DA]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},OA]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],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:[...Dr(),"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:Dr()}],"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:["",...Dr()]}],"outline-offset":[{"outline-offset":[ha,te]}],"outline-w":[{outline:[ha,no]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ir()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[ha,no]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",so,BA]}],"shadow-color":[{shadow:[Ol]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...ve(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ve()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[a]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",so,te]}],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",te]}],duration:[{duration:ht()}],ease:[{ease:["linear","in","out","in-out",te]}],delay:[{delay:ht()}],animate:[{animate:["none","spin","ping","pulse","bounce",te]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[Ml,te]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",te]}],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",te]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ee()}],"scroll-mx":[{"scroll-mx":ee()}],"scroll-my":[{"scroll-my":ee()}],"scroll-ms":[{"scroll-ms":ee()}],"scroll-me":[{"scroll-me":ee()}],"scroll-mt":[{"scroll-mt":ee()}],"scroll-mr":[{"scroll-mr":ee()}],"scroll-mb":[{"scroll-mb":ee()}],"scroll-ml":[{"scroll-ml":ee()}],"scroll-p":[{"scroll-p":ee()}],"scroll-px":[{"scroll-px":ee()}],"scroll-py":[{"scroll-py":ee()}],"scroll-ps":[{"scroll-ps":ee()}],"scroll-pe":[{"scroll-pe":ee()}],"scroll-pt":[{"scroll-pt":ee()}],"scroll-pr":[{"scroll-pr":ee()}],"scroll-pb":[{"scroll-pb":ee()}],"scroll-pl":[{"scroll-pl":ee()}],"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",te]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ha,no,ng]}],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 PS=bA(jA);function er(...e){return PS(md(e))}var RS=O(ue(),1);function Oe({className:e,type:t,...r}){return(0,RS.jsx)("input",{type:t,"data-slot":"input",className:er("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 We=O(Q(),1);var DS=O(Q(),1);function ES(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Bl(...e){return t=>{let r=!1,a=e.map(o=>{let n=ES(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():ES(e[o],null)}}}}function ga(...e){return DS.useCallback(Bl(...e),e)}var gd=O(ue(),1),KA=Symbol.for("react.lazy"),yd=We[" use ".trim().toString()];function XA(e){return typeof e=="object"&&e!==null&&"then"in e}function NS(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===KA&&"_payload"in e&&XA(e._payload)}function JA(e){let t=QA(e),r=We.forwardRef((a,o)=>{let{children:n,...s}=a;NS(n)&&typeof yd=="function"&&(n=yd(n._payload));let i=We.Children.toArray(n),l=i.find(ZA);if(l){let u=l.props.children,c=i.map(d=>d===l?We.Children.count(u)>1?We.Children.only(null):We.isValidElement(u)?u.props.children:null:d);return(0,gd.jsx)(t,{...s,ref:o,children:We.isValidElement(u)?We.cloneElement(u,void 0,c):null})}return(0,gd.jsx)(t,{...s,ref:o,children:n})});return r.displayName=`${e}.Slot`,r}var MS=JA("Slot");function QA(e){let t=We.forwardRef((r,a)=>{let{children:o,...n}=r;if(NS(o)&&typeof yd=="function"&&(o=yd(o._payload)),We.isValidElement(o)){let s=tR(o),i=eR(n,o.props);return o.type!==We.Fragment&&(i.ref=a?Bl(a,s):s),We.cloneElement(o,i)}return We.Children.count(o)>1?We.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var YA=Symbol("radix.slottable");function ZA(e){return We.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===YA}function eR(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 tR(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 OS=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,BS=md,FS=(e,t)=>r=>{var a;if(t?.variants==null)return BS(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=OS(c)||OS(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,...h}=c;return Object.entries(h).every(v=>{let[x,C]=v;return Array.isArray(C)?C.includes({...n,...i}[x]):{...n,...i}[x]===C})?[...u,d,f]:u},[]);return BS(e,s,l,r?.class,r?.className)};var US=O(ue(),1),rR=FS("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 Bt({className:e,variant:t,size:r,asChild:a=!1,...o}){return(0,US.jsx)(a?MS:"button",{"data-slot":"button",className:er(rR({variant:t,size:r,className:e})),...o})}var dC=O(Q(),1);var W=O(Q(),1);var jS=O(Q(),1),lR=O(Ph(),1);var Qe=O(Q(),1);var vd=O(ue(),1);function VS(e){let t=aR(e),r=Qe.forwardRef((a,o)=>{let{children:n,...s}=a,i=Qe.Children.toArray(n),l=i.find(nR);if(l){let u=l.props.children,c=i.map(d=>d===l?Qe.Children.count(u)>1?Qe.Children.only(null):Qe.isValidElement(u)?u.props.children:null:d);return(0,vd.jsx)(t,{...s,ref:o,children:Qe.isValidElement(u)?Qe.cloneElement(u,void 0,c):null})}return(0,vd.jsx)(t,{...s,ref:o,children:n})});return r.displayName=`${e}.Slot`,r}function aR(e){let t=Qe.forwardRef((r,a)=>{let{children:o,...n}=r;if(Qe.isValidElement(o)){let s=iR(o),i=sR(n,o.props);return o.type!==Qe.Fragment&&(i.ref=a?Bl(a,s):s),Qe.cloneElement(o,i)}return Qe.Children.count(o)>1?Qe.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var oR=Symbol("radix.slottable");function nR(e){return Qe.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===oR}function sR(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 iR(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 qS=O(ue(),1),uR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Cs=uR.reduce((e,t)=>{let r=VS(`Primitive.${t}`),a=jS.forwardRef((o,n)=>{let{asChild:s,...i}=o,l=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,qS.jsx)(l,{...i,ref:n})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});var Ft=O(Q(),1);var HS=O(Q(),1),Fl=globalThis?.document?HS.useLayoutEffect:()=>{};var zS=O(Q(),1);function cR(e,t){return zS.useReducer((r,a)=>t[r][a]??r,e)}var bs=e=>{let{present:t,children:r}=e,a=dR(t),o=typeof r=="function"?r({present:a.isPresent}):Ft.Children.only(r),n=ga(a.ref,fR(o));return typeof r=="function"||a.isPresent?Ft.cloneElement(o,{ref:n}):null};bs.displayName="Presence";function dR(e){let[t,r]=Ft.useState(),a=Ft.useRef(null),o=Ft.useRef(e),n=Ft.useRef("none"),s=e?"mounted":"unmounted",[i,l]=cR(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return Ft.useEffect(()=>{let u=xd(a.current);n.current=i==="mounted"?u:"none"},[i]),Fl(()=>{let u=a.current,c=o.current;if(c!==e){let f=n.current,h=xd(u);e?l("MOUNT"):h==="none"||u?.display==="none"?l("UNMOUNT"):l(c&&f!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Fl(()=>{if(t){let u,c=t.ownerDocument.defaultView??window,d=h=>{let x=xd(a.current).includes(CSS.escape(h.animationName));if(h.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=h=>{h.target===t&&(n.current=xd(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:Ft.useCallback(u=>{a.current=u?getComputedStyle(u):null,r(u)},[])}}function xd(e){return e?.animationName||"none"}function fR(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 ya=O(Q(),1),$S=O(ue(),1);function WS(e,t=[]){let r=[];function a(n,s){let i=ya.createContext(s),l=r.length;r=[...r,s];let u=d=>{let{scope:f,children:h,...v}=d,x=f?.[e]?.[l]||i,C=ya.useMemo(()=>v,Object.values(v));return(0,$S.jsx)(x.Provider,{value:C,children:h})};u.displayName=n+"Provider";function c(d,f){let h=f?.[e]?.[l]||i,v=ya.useContext(h);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=>ya.createContext(s));return function(i){let l=i?.[e]||n;return ya.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[a,pR(o,...t)]}function pR(...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 ya.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var Ls=O(Q(),1);function io(e){let t=Ls.useRef(e);return Ls.useEffect(()=>{t.current=e}),Ls.useMemo(()=>(...r)=>t.current?.(...r),[])}var wd=O(Q(),1),mR=O(ue(),1),hR=wd.createContext(void 0);function GS(e){let t=wd.useContext(hR);return e||t||"ltr"}function KS(e,[t,r]){return Math.min(r,Math.max(t,e))}var i2=!!(typeof window<"u"&&window.document&&window.document.createElement);function lo(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}var JS=O(Q(),1),fe=O(ue(),1);function gR(e,t){return JS.useReducer((r,a)=>t[r][a]??r,e)}var ig="ScrollArea",[QS,v2]=WS(ig),[yR,yr]=QS(ig),YS=W.forwardRef((e,t)=>{let{__scopeScrollArea:r,type:a="hover",dir:o,scrollHideDelay:n=600,...s}=e,[i,l]=W.useState(null),[u,c]=W.useState(null),[d,f]=W.useState(null),[h,v]=W.useState(null),[x,C]=W.useState(null),[g,p]=W.useState(0),[y,b]=W.useState(0),[L,P]=W.useState(!1),[T,A]=W.useState(!1),N=ga(t,pe=>l(pe)),j=GS(o);return(0,fe.jsx)(yR,{scope:r,type:a,dir:j,scrollHideDelay:n,scrollArea:i,viewport:u,onViewportChange:c,content:d,onContentChange:f,scrollbarX:h,onScrollbarXChange:v,scrollbarXEnabled:L,onScrollbarXEnabledChange:P,scrollbarY:x,onScrollbarYChange:C,scrollbarYEnabled:T,onScrollbarYEnabledChange:A,onCornerWidthChange:p,onCornerHeightChange:b,children:(0,fe.jsx)(Cs.div,{dir:j,...s,ref:N,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":y+"px",...e.style}})})});YS.displayName=ig;var ZS="ScrollAreaViewport",eC=W.forwardRef((e,t)=>{let{__scopeScrollArea:r,children:a,nonce:o,...n}=e,s=yr(ZS,r),i=W.useRef(null),l=ga(t,i,s.onViewportChange);return(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.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,fe.jsx)(Cs.div,{"data-radix-scroll-area-viewport":"",...n,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:(0,fe.jsx)("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:a})})]})});eC.displayName=ZS;var qr="ScrollAreaScrollbar",lg=W.forwardRef((e,t)=>{let{forceMount:r,...a}=e,o=yr(qr,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,fe.jsx)(vR,{...a,ref:t,forceMount:r}):o.type==="scroll"?(0,fe.jsx)(xR,{...a,ref:t,forceMount:r}):o.type==="auto"?(0,fe.jsx)(tC,{...a,ref:t,forceMount:r}):o.type==="always"?(0,fe.jsx)(ug,{...a,ref:t}):null});lg.displayName=qr;var vR=W.forwardRef((e,t)=>{let{forceMount:r,...a}=e,o=yr(qr,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)},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,fe.jsx)(bs,{present:r||n,children:(0,fe.jsx)(tC,{"data-state":n?"visible":"hidden",...a,ref:t})})}),xR=W.forwardRef((e,t)=>{let{forceMount:r,...a}=e,o=yr(qr,e.__scopeScrollArea),n=e.orientation==="horizontal",s=Ld(()=>l("SCROLL_END"),100),[i,l]=gR("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,c=n?"scrollLeft":"scrollTop";if(u){let d=u[c],f=()=>{let h=u[c];d!==h&&(l("SCROLL"),s()),d=h};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[o.viewport,n,l,s]),(0,fe.jsx)(bs,{present:r||i!=="hidden",children:(0,fe.jsx)(ug,{"data-state":i==="hidden"?"hidden":"visible",...a,ref:t,onPointerEnter:lo(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:lo(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),tC=W.forwardRef((e,t)=>{let r=yr(qr,e.__scopeScrollArea),{forceMount:a,...o}=e,[n,s]=W.useState(!1),i=e.orientation==="horizontal",l=Ld(()=>{if(r.viewport){let u=r.viewport.offsetWidth<r.viewport.scrollWidth,c=r.viewport.offsetHeight<r.viewport.scrollHeight;s(i?u:c)}},10);return Is(r.viewport,l),Is(r.content,l),(0,fe.jsx)(bs,{present:a||n,children:(0,fe.jsx)(ug,{"data-state":n?"visible":"hidden",...o,ref:t})})}),ug=W.forwardRef((e,t)=>{let{orientation:r="vertical",...a}=e,o=yr(qr,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=nC(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,h){return IR(f,s.current,i,h)}return r==="horizontal"?(0,fe.jsx)(wR,{...c,ref:t,onThumbPositionChange:()=>{if(o.viewport&&n.current){let f=o.viewport.scrollLeft,h=XS(f,i,o.dir);n.current.style.transform=`translate3d(${h}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,fe.jsx)(SR,{...c,ref:t,onThumbPositionChange:()=>{if(o.viewport&&n.current){let f=o.viewport.scrollTop,h=XS(f,i);n.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollTop=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollTop=d(f))}}):null}),wR=W.forwardRef((e,t)=>{let{sizes:r,onSizesChange:a,...o}=e,n=yr(qr,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,fe.jsx)(aC,{"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":bd(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),iC(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:Cd(s.paddingLeft),paddingEnd:Cd(s.paddingRight)}})}})}),SR=W.forwardRef((e,t)=>{let{sizes:r,onSizesChange:a,...o}=e,n=yr(qr,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,fe.jsx)(aC,{"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":bd(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),iC(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:Cd(s.paddingTop),paddingEnd:Cd(s.paddingBottom)}})}})}),[CR,rC]=QS(qr),aC=W.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,h=yr(qr,r),[v,x]=W.useState(null),C=ga(t,N=>x(N)),g=W.useRef(null),p=W.useRef(""),y=h.viewport,b=a.content-a.viewport,L=io(c),P=io(l),T=Ld(d,10);function A(N){if(g.current){let j=N.clientX-g.current.left,pe=N.clientY-g.current.top;u({x:j,y:pe})}}return W.useEffect(()=>{let N=j=>{let pe=j.target;v?.contains(pe)&&L(j,b)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[y,v,b,L]),W.useEffect(P,[a,P]),Is(v,T),Is(h.content,T),(0,fe.jsx)(CR,{scope:r,scrollbar:v,hasThumb:o,onThumbChange:io(n),onThumbPointerUp:io(s),onThumbPositionChange:P,onThumbPointerDown:io(i),children:(0,fe.jsx)(Cs.div,{...f,ref:C,style:{position:"absolute",...f.style},onPointerDown:lo(e.onPointerDown,N=>{N.button===0&&(N.target.setPointerCapture(N.pointerId),g.current=v.getBoundingClientRect(),p.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),A(N))}),onPointerMove:lo(e.onPointerMove,A),onPointerUp:lo(e.onPointerUp,N=>{let j=N.target;j.hasPointerCapture(N.pointerId)&&j.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=p.current,h.viewport&&(h.viewport.style.scrollBehavior=""),g.current=null})})})}),Sd="ScrollAreaThumb",cg=W.forwardRef((e,t)=>{let{forceMount:r,...a}=e,o=rC(Sd,e.__scopeScrollArea);return(0,fe.jsx)(bs,{present:r||o.hasThumb,children:(0,fe.jsx)(bR,{ref:t,...a})})}),bR=W.forwardRef((e,t)=>{let{__scopeScrollArea:r,style:a,...o}=e,n=yr(Sd,r),s=rC(Sd,r),{onThumbPositionChange:i}=s,l=ga(t,d=>s.onThumbChange(d)),u=W.useRef(void 0),c=Ld(()=>{u.current&&(u.current(),u.current=void 0)},100);return W.useEffect(()=>{let d=n.viewport;if(d){let f=()=>{if(c(),!u.current){let h=kR(d,i);u.current=h,i()}};return i(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[n.viewport,c,i]),(0,fe.jsx)(Cs.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:lo(e.onPointerDownCapture,d=>{let h=d.target.getBoundingClientRect(),v=d.clientX-h.left,x=d.clientY-h.top;s.onThumbPointerDown({x:v,y:x})}),onPointerUp:lo(e.onPointerUp,s.onThumbPointerUp)})});cg.displayName=Sd;var dg="ScrollAreaCorner",oC=W.forwardRef((e,t)=>{let r=yr(dg,e.__scopeScrollArea),a=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&a?(0,fe.jsx)(LR,{...e,ref:t}):null});oC.displayName=dg;var LR=W.forwardRef((e,t)=>{let{__scopeScrollArea:r,...a}=e,o=yr(dg,r),[n,s]=W.useState(0),[i,l]=W.useState(0),u=!!(n&&i);return Is(o.scrollbarX,()=>{let c=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(c),l(c)}),Is(o.scrollbarY,()=>{let c=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(c),s(c)}),u?(0,fe.jsx)(Cs.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 Cd(e){return e?parseInt(e,10):0}function nC(e,t){let r=e/t;return isNaN(r)?0:r}function bd(e){let t=nC(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,a=(e.scrollbar.size-r)*t;return Math.max(a,18)}function IR(e,t,r,a="ltr"){let o=bd(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 sC([l,u],d)(e)}function XS(e,t,r="ltr"){let a=bd(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=KS(e,l);return sC([0,s],[0,i])(u)}function sC(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 iC(e,t){return e>0&&e<t}var kR=(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 Ld(e,t){let r=io(e),a=W.useRef(0);return W.useEffect(()=>()=>window.clearTimeout(a.current),[]),W.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(r,t)},[r,t])}function Is(e,t){let r=io(t);Fl(()=>{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 lC=YS,uC=eC;var cC=oC;var uo=O(ue(),1),fg=dC.forwardRef(({className:e,children:t,...r},a)=>(0,uo.jsxs)(lC,{"data-slot":"scroll-area",className:er("relative",e),...r,children:[(0,uo.jsx)(uC,{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,uo.jsx)(TR,{}),(0,uo.jsx)(cC,{})]}));fg.displayName="ScrollArea";function TR({className:e,orientation:t="vertical",...r}){return(0,uo.jsx)(lg,{"data-slot":"scroll-area-scrollbar",orientation:t,className:er("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,uo.jsx)(cg,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}var kd=O(Q());var fC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_R=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,a)=>a?a.toUpperCase():r.toLowerCase()),pg=e=>{let t=_R(e);return t.charAt(0).toUpperCase()+t.slice(1)},Id=(...e)=>e.filter((t,r,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===r).join(" ").trim(),pC=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Ul=O(Q());var mC={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 hC=(0,Ul.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:a,className:o="",children:n,iconNode:s,...i},l)=>(0,Ul.createElement)("svg",{ref:l,...mC,width:t,height:t,stroke:e,strokeWidth:a?Number(r)*24/Number(t):r,className:Id("lucide",o),...!n&&!pC(i)&&{"aria-hidden":"true"},...i},[...s.map(([u,c])=>(0,Ul.createElement)(u,c)),...Array.isArray(n)?n:[n]]));var V=(e,t)=>{let r=(0,kd.forwardRef)(({className:a,...o},n)=>(0,kd.createElement)(hC,{ref:n,iconNode:t,className:Id(`lucide-${fC(pg(e))}`,`lucide-${e}`,a),...o}));return r.displayName=pg(e),r};var AR=[["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"}]],Vl=V("activity",AR);var RR=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],ks=V("arrow-left",RR);var ER=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],jl=V("arrow-up",ER);var DR=[["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"}]],ql=V("calendar",DR);var NR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Hl=V("chevron-down",NR);var MR=[["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"}]],_r=V("circle-alert",MR);var OR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],nt=V("circle-check",OR);var BR=[["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"}]],Ar=V("circle-x",BR);var FR=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],un=V("clock",FR);var UR=[["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"}]],va=V("command",UR);var VR=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],xa=V("corner-down-left",VR);var jR=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],cn=V("credit-card",jR);var qR=[["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"}]],dn=V("crown",qR);var HR=[["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"}]],fn=V("dollar-sign",HR);var zR=[["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"}]],Ps=V("file-spreadsheet",zR);var $R=[["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"}]],Ts=V("key",$R);var WR=[["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"}]],zl=V("laptop",WR);var GR=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],tr=V("loader-circle",GR);var KR=[["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"}]],_s=V("mail",KR);var XR=[["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"}]],As=V("map-pin",XR);var JR=[["path",{d:"M5 12h14",key:"1ays0h"}]],$l=V("minus",JR);var QR=[["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"}]],Wl=V("paperclip",QR);var YR=[["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"}]],Rs=V("refresh-cw",YR);var ZR=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],pn=V("search",ZR);var e1=[["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"}]],Es=V("shield",e1);var t1=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],Gl=V("smartphone",t1);var r1=[["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"}]],Hr=V("sparkles",r1);var a1=[["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"}]],Ut=V("square-pen",a1);var o1=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Kl=V("trending-up",o1);var n1=[["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"}]],Ds=V("users",n1);var s1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],mn=V("x",s1);var i1=[["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"}]],Xl=V("zap",i1);var Ve=O(ue(),1);function gC({phase:e,progressSteps:t=[]}){return(0,Ve.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,Ve.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ve.jsx)(tr,{className:"h-3.5 w-3.5 animate-spin"}),(0,Ve.jsx)("span",{children:"Thinking\u2026"})]}),e==="searching"&&(0,Ve.jsxs)("div",{className:"space-y-2 animate-in fade-in-0 duration-300",children:[(0,Ve.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ve.jsx)(pn,{className:"h-3.5 w-3.5 opacity-70"}),(0,Ve.jsx)("span",{children:"Searching across pages\u2026"})]}),(0,Ve.jsxs)("ul",{className:"ml-6 list-disc space-y-1",children:[(0,Ve.jsx)("li",{className:"opacity-90",children:"Checking recent changes"}),(0,Ve.jsx)("li",{className:"opacity-90",children:"Scanning documentation"}),(0,Ve.jsx)("li",{className:"opacity-90",children:"Summarizing relevant sections"})]})]}),(e==="thinking"||e==="executing"||e==="responding")&&t.length>0&&(0,Ve.jsxs)("div",{className:"space-y-2 animate-in fade-in-0 duration-200",children:[t.map((r,a)=>(0,Ve.jsxs)("div",{className:`flex items-center gap-2 transition-opacity duration-200 ${r.completed?"opacity-60":"opacity-100"}`,children:[r.completed?(0,Ve.jsx)(nt,{className:"h-3.5 w-3.5 text-green-500 flex-shrink-0"}):(0,Ve.jsx)(tr,{className:"h-3.5 w-3.5 animate-spin flex-shrink-0"}),(0,Ve.jsx)("span",{className:r.completed?"line-through":"",children:r.message})]},a)),e==="responding"&&(0,Ve.jsxs)("div",{className:"flex items-center gap-2 opacity-100 animate-in fade-in-0 duration-200",children:[(0,Ve.jsx)(tr,{className:"h-3.5 w-3.5 animate-spin flex-shrink-0"}),(0,Ve.jsx)("span",{children:"Preparing response..."})]})]})]})}var yC=O(Q(),1);var Rr=O(ue(),1);function vC({title:e,links:t}){let[r,a]=yC.useState(!1);return(0,Rr.jsxs)("div",{className:"text-xs text-muted-foreground",children:[(0,Rr.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,Rr.jsxs)("div",{className:"flex items-center gap-1.5",children:[r?(0,Rr.jsx)(Hl,{className:"h-3 w-3 opacity-70"}):(0,Rr.jsx)(pn,{className:"h-3 w-3 opacity-70"}),(0,Rr.jsx)("span",{children:e})]})}),r&&t.length>0&&(0,Rr.jsx)("ul",{className:"ml-5 mt-1 space-y-0.5",children:t.map(o=>(0,Rr.jsx)("li",{children:(0,Rr.jsx)("a",{href:o.href,target:"_blank",rel:"noreferrer",className:"text-primary hover:underline",children:o.label})},o.href))})]})}var Ql=O(ue(),1),zr=O(Q(),1);var xC=O(Q(),1),Ns=(0,xC.createContext)({});var wC=O(Q(),1);function Ms(e){let t=(0,wC.useRef)(null);return t.current===null&&(t.current=e()),t.current}var hg=O(ue(),1),IC=O(Q(),1),hn=O(Q(),1);var SC=O(Q(),1),co=(0,SC.createContext)(null);var bC=O(ue(),1),Pd=O(Q(),1),wa=O(Q(),1);var CC=O(Q(),1),Os=(0,CC.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});var mg=class extends Pd.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 LC({children:e,isPresent:t}){let r=(0,wa.useId)(),a=(0,wa.useRef)(null),o=(0,wa.useRef)({width:0,height:0,top:0,left:0}),{nonce:n}=(0,wa.useContext)(Os);return(0,wa.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(`
51
51
  [data-motion-pop-id="${r}"] {
52
52
  position: absolute !important;
53
53
  width: ${s}px !important;
@@ -55,11 +55,11 @@ ${g}`}var Me=class extends Error{constructor({message:t,code:r,cause:a,name:o}){
55
55
  top: ${l}px !important;
56
56
  left: ${u}px !important;
57
57
  }
58
- `),()=>{document.head.removeChild(c)}},[t]),(0,bC.jsx)(mg,{isPresent:t,childRef:a,sizeRef:o,children:Pd.cloneElement(e,{ref:a})})}var kC=({children:e,initial:t,isPresent:r,onExitComplete:a,custom:o,presenceAffectsLayout:n,mode:s})=>{let i=Ms(l1),l=(0,gn.useId)(),u=(0,gn.useCallback)(d=>{i.set(d,!0);for(let f of i.values())if(!f)return;a&&a()},[i,a]),c=(0,gn.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,gn.useMemo)(()=>{i.forEach((d,f)=>i.set(f,!1))},[r]),IC.useEffect(()=>{!r&&!i.size&&a&&a()},[r]),s==="popLayout"&&(e=(0,hg.jsx)(LC,{isPresent:r,children:e})),(0,hg.jsx)(co.Provider,{value:c,children:e})};function l1(){return new Map}var fo=O(Q(),1);function Td(e=!0){let t=(0,fo.useContext)(co);if(t===null)return[!0,null];let{isPresent:r,onExitComplete:a,register:o}=t,n=(0,fo.useId)();(0,fo.useEffect)(()=>{e&&o(n)},[e]);let s=(0,fo.useCallback)(()=>e&&a&&a(n),[n,a,e]);return!r&&a?[!1,s]:[!0]}var _d=O(Q(),1),Jl=e=>e.key||"";function gg(e){let t=[];return _d.Children.forEach(e,r=>{(0,_d.isValidElement)(r)&&t.push(r)}),t}var Ad=O(Q(),1);var Bs=typeof window<"u";var Rd=Bs?Ad.useLayoutEffect:Ad.useEffect;var yg=({children:e,custom:t,initial:r=!0,onExitComplete:a,presenceAffectsLayout:o=!0,mode:n="sync",propagate:s=!1})=>{let[i,l]=Td(s),u=(0,zr.useMemo)(()=>gg(e),[e]),c=s&&!i?[]:u.map(Jl),d=(0,zr.useRef)(!0),f=(0,zr.useRef)(u),h=Ms(()=>new Map),[v,x]=(0,zr.useState)(u),[C,g]=(0,zr.useState)(u);Rd(()=>{d.current=!1,f.current=u;for(let b=0;b<C.length;b++){let L=Jl(C[b]);c.includes(L)?h.delete(L):h.get(L)!==!0&&h.set(L,!1)}},[C,c.length,c.join("-")]);let p=[];if(u!==v){let b=[...u];for(let L=0;L<C.length;L++){let P=C[L],T=Jl(P);c.includes(T)||(b.splice(L,0,P),p.push(P))}n==="wait"&&p.length&&(b=p),g(gg(b)),x(u);return}let{forceRender:y}=(0,zr.useContext)(Ns);return(0,Ql.jsx)(Ql.Fragment,{children:C.map(b=>{let L=Jl(b),P=s&&!i?!1:u===C||c.includes(L),T=()=>{if(h.has(L))h.set(L,!0);else return;let A=!0;h.forEach(N=>{N||(A=!1)}),A&&(y?.(),g(f.current),s&&l?.(),a&&a())};return(0,Ql.jsx)(kC,{isPresent:P,initial:!d.current||r?void 0:!1,custom:P?void 0:t,presenceAffectsLayout:o,mode:n,onExitComplete:P?void 0:T,children:b},L)})})};var ye=e=>e;var Sa=ye,Er=ye;function yn(e){let t;return()=>(t===void 0&&(t=e()),t)}var rr=(e,t,r)=>{let a=t-e;return a===0?1:(r-e)/a};var qe=e=>e*1e3,dt=e=>e/1e3;var Fs={skipAnimations:!1,useManualTiming:!1};function PC(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 h=d&&a?t:r;return c&&n.add(u),h.has(u)||h.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 Ed=["read","resolveKeyframes","update","preRender","render","postRender"],u1=40;function Dd(e,t){let r=!1,a=!0,o={delta:0,timestamp:0,isProcessing:!1},n=()=>r=!0,s=Ed.reduce((g,p)=>(g[p]=PC(n),g),{}),{read:i,resolveKeyframes:l,update:u,preRender:c,render:d,postRender:f}=s,h=()=>{let g=Fs.useManualTiming?o.timestamp:performance.now();r=!1,o.delta=a?1e3/60:Math.max(Math.min(g-o.timestamp,u1),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(h))},v=()=>{r=!0,a=!0,o.isProcessing||e(h)};return{schedule:Ed.reduce((g,p)=>{let y=s[p];return g[p]=(b,L=!1,P=!1)=>(r||v(),y.schedule(b,L,P)),g},{}),cancel:g=>{for(let p=0;p<Ed.length;p++)s[Ed[p]].cancel(g)},state:o,steps:s}}var{schedule:re,cancel:ar,state:He,steps:Nd}=Dd(typeof requestAnimationFrame<"u"?requestAnimationFrame:ye,!0);var TC=O(Q(),1),Md=(0,TC.createContext)({strict:!1});var _C={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"]},Ca={};for(let e in _C)Ca[e]={isEnabled:t=>_C[e].some(r=>!!t[r])};function AC(e){for(let t in e)Ca[t]={...Ca[t],...e[t]}}var c1=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 Yl(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||c1.has(e)}var RC=e=>!Yl(e);function d1(e){e&&(RC=t=>t.startsWith("on")?!Yl(t):e(t))}try{d1(pk("@emotion/is-prop-valid").default)}catch{}function EC(e,t,r){let a={};for(let o in e)o==="values"&&typeof e.values=="object"||(RC(o)||r===!0&&Yl(o)||!t&&!Yl(o)||e.draggable&&o.startsWith("onDrag"))&&(a[o]=e[o]);return a}function DC(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 jd=O(ue(),1);var js=O(Q(),1);var NC=O(Q(),1),po=(0,NC.createContext)({});var Fd=O(Q(),1);function ba(e){return typeof e=="string"||Array.isArray(e)}function mo(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}var Od=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Zl=["initial",...Od];function vn(e){return mo(e.animate)||Zl.some(t=>ba(e[t]))}function Bd(e){return!!(vn(e)||e.variants)}function MC(e,t){if(vn(e)){let{initial:r,animate:a}=e;return{initial:r===!1||ba(r)?r:void 0,animate:ba(a)?a:void 0}}return e.inherit!==!1?t:{}}function BC(e){let{initial:t,animate:r}=MC(e,(0,Fd.useContext)(po));return(0,Fd.useMemo)(()=>({initial:t,animate:r}),[OC(t),OC(r)])}function OC(e){return Array.isArray(e)?e.join(" "):e}var FC=Symbol.for("motionComponentSymbol");var UC=O(Q(),1);function La(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function VC(e,t,r){return(0,UC.useCallback)(a=>{a&&e.onMount&&e.onMount(a),t&&(a?t.mount(a):t.unmount()),r&&(typeof r=="function"?r(a):La(r)&&(r.current=a))},[t])}var Vt=O(Q(),1);var Us=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase();var f1="framerAppearId",Ud="data-"+Us(f1);var{schedule:Vs,cancel:VU}=Dd(queueMicrotask,!1);var jC=O(Q(),1),Vd=(0,jC.createContext)({});function qC(e,t,r,a,o){var n,s;let{visualElement:i}=(0,Vt.useContext)(po),l=(0,Vt.useContext)(Md),u=(0,Vt.useContext)(co),c=(0,Vt.useContext)(Os).reducedMotion,d=(0,Vt.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,h=(0,Vt.useContext)(Vd);f&&!f.projection&&o&&(f.type==="html"||f.type==="svg")&&p1(d.current,r,o,h);let v=(0,Vt.useRef)(!1);(0,Vt.useInsertionEffect)(()=>{f&&v.current&&f.update(r,u)});let x=r[Ud],C=(0,Vt.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(),Vs.render(f.render),C.current&&f.animationState&&f.animationState.animateChanges())}),(0,Vt.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 p1(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:HC(e.parent)),e.projection.setOptions({layoutId:o,layout:n,alwaysMeasureLayout:!!s||i&&La(i),visualElement:e,animationType:typeof n=="string"?n:"both",initialPromotionConfig:a,layoutScroll:l,layoutRoot:u})}function HC(e){if(e)return e.options.allowProjection!==!1?e.projection:HC(e.parent)}function zC({preloadedFeatures:e,createVisualElement:t,useRender:r,useVisualState:a,Component:o}){var n,s;e&&AC(e);function i(u,c){let d,f={...(0,js.useContext)(Os),...u,layoutId:m1(u)},{isStatic:h}=f,v=BC(u),x=a(u,h);if(!h&&Bs){h1(f,e);let C=g1(f);d=C.MeasureLayout,v.visualElement=qC(o,x,f,t,C.ProjectionNode)}return(0,jd.jsxs)(po.Provider,{value:v,children:[d&&v.visualElement?(0,jd.jsx)(d,{visualElement:v.visualElement,...f}):null,r(o,u,VC(x,v.visualElement,c),x,h,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,js.forwardRef)(i);return l[FC]=o,l}function m1({layoutId:e}){let t=(0,js.useContext)(Ns).id;return t&&e!==void 0?t+"-"+e:e}function h1(e,t){let r=(0,js.useContext)(Md).strict}function g1(e){let{drag:t,layout:r}=Ca;if(!t&&!r)return{};let a={...t,...r};return{MeasureLayout:t?.isEnabled(e)||r?.isEnabled(e)?a.MeasureLayout:void 0,ProjectionNode:a.ProjectionNode}}var $C=["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 qs(e){return typeof e!="string"||e.includes("-")?!1:!!($C.indexOf(e)>-1||/[A-Z]/u.test(e))}var vg=O(Q(),1);function WC(e){let t=[{},{}];return e?.values.forEach((r,a)=>{t[0][a]=r.get(),t[1][a]=r.getVelocity()}),t}function Hs(e,t,r,a){if(typeof t=="function"){let[o,n]=WC(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]=WC(a);t=t(r!==void 0?r:e.custom,o,n)}return t}var eu=e=>Array.isArray(e);var GC=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),KC=e=>eu(e)?e[e.length-1]||0:e;var be=e=>!!(e&&e.getVelocity);function zs(e){let t=be(e)?e.get():e;return GC(t)?t.toValue():t}function y1({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:r},a,o,n){let s={latestValues:v1(a,o,n,e),renderState:t()};return r&&(s.onMount=i=>r({props:a,current:i,...s}),s.onUpdate=i=>r(i)),s}var qd=e=>(t,r)=>{let a=(0,vg.useContext)(po),o=(0,vg.useContext)(co),n=()=>y1(e,t,a,o);return r?n():Ms(n)};function v1(e,t,r,a){let o={},n=a(e,{});for(let f in n)o[f]=zs(n[f]);let{initial:s,animate:i}=e,l=vn(e),u=Bd(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"&&!mo(d)){let f=Array.isArray(d)?d:[d];for(let h=0;h<f.length;h++){let v=Hs(e,f[h]);if(v){let{transitionEnd:x,transition:C,...g}=v;for(let p in g){let y=g[p];if(Array.isArray(y)){let b=c?y.length-1:0;y=y[b]}y!==null&&(o[p]=y)}for(let p in x)o[p]=x[p]}}}return o}var $r=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],jt=new Set($r);var XC=e=>t=>typeof t=="string"&&t.startsWith(e),Hd=XC("--"),x1=XC("var(--"),$s=e=>x1(e)?w1.test(e.split("/*")[0].trim()):!1,w1=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;var zd=(e,t)=>t&&typeof e=="number"?t.transform(e):e;var ft=(e,t,r)=>r>t?t:r<e?e:r;var Wr={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ia={...Wr,transform:e=>ft(0,1,e)},tu={...Wr,default:1};var ru=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Gr=ru("deg"),_t=ru("%"),z=ru("px"),JC=ru("vh"),QC=ru("vw"),xg={..._t,parse:e=>_t.parse(e)/100,transform:e=>_t.transform(e*100)};var YC={borderWidth:z,borderTopWidth:z,borderRightWidth:z,borderBottomWidth:z,borderLeftWidth:z,borderRadius:z,radius:z,borderTopLeftRadius:z,borderTopRightRadius:z,borderBottomRightRadius:z,borderBottomLeftRadius:z,width:z,maxWidth:z,height:z,maxHeight:z,top:z,right:z,bottom:z,left:z,padding:z,paddingTop:z,paddingRight:z,paddingBottom:z,paddingLeft:z,margin:z,marginTop:z,marginRight:z,marginBottom:z,marginLeft:z,backgroundPositionX:z,backgroundPositionY:z};var ZC={rotate:Gr,rotateX:Gr,rotateY:Gr,rotateZ:Gr,scale:tu,scaleX:tu,scaleY:tu,scaleZ:tu,skew:Gr,skewX:Gr,skewY:Gr,distance:z,translateX:z,translateY:z,translateZ:z,x:z,y:z,z,perspective:z,transformPerspective:z,opacity:Ia,originX:xg,originY:xg,originZ:z};var wg={...Wr,transform:Math.round};var Ws={...YC,...ZC,zIndex:wg,size:z,fillOpacity:Ia,strokeOpacity:Ia,numOctaves:wg};var S1={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},C1=$r.length;function eb(e,t,r){let a="",o=!0;for(let n=0;n<C1;n++){let s=$r[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=zd(i,Ws[s]);if(!l){o=!1;let c=S1[s]||s;a+=`${c}(${u}) `}r&&(t[s]=u)}}return a=a.trim(),r?a=r(t,o?"":a):o&&(a="none"),a}function Gs(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(jt.has(l)){s=!0;continue}else if(Hd(l)){o[l]=u;continue}else{let c=zd(u,Ws[l]);l.startsWith("origin")?(i=!0,n[l]=c):a[l]=c}}if(t.transform||(s||r?a.transform=eb(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 b1={offset:"stroke-dashoffset",array:"stroke-dasharray"},L1={offset:"strokeDashoffset",array:"strokeDasharray"};function tb(e,t,r=1,a=0,o=!0){e.pathLength=1;let n=o?b1:L1;e[n.offset]=z.transform(-a);let s=z.transform(t),i=z.transform(r);e[n.array]=`${s} ${i}`}function rb(e,t,r){return typeof e=="string"?e:z.transform(t+r*e)}function ab(e,t,r){let a=rb(t,e.x,e.width),o=rb(r,e.y,e.height);return`${a} ${o}`}function Ks(e,{attrX:t,attrY:r,attrScale:a,originX:o,originY:n,pathLength:s,pathSpacing:i=1,pathOffset:l=0,...u},c,d){if(Gs(e,u,d),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:f,style:h,dimensions:v}=e;f.transform&&(v&&(h.transform=f.transform),delete f.transform),v&&(o!==void 0||n!==void 0||h.transform)&&(h.transformOrigin=ab(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&&tb(f,s,i,l,!1)}var Xs=()=>({style:{},transform:{},transformOrigin:{},vars:{}});var $d=()=>({...Xs(),attrs:{}});var Js=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Wd(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 Gd=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 Kd(e,t,r,a){Wd(e,t,void 0,a);for(let o in t.attrs)e.setAttribute(Gd.has(o)?o:Us(o),t.attrs[o])}var Qs={};function ob(e){Object.assign(Qs,e)}function Xd(e,{layout:t,layoutId:r}){return jt.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!Qs[e]||e==="opacity")}function Ys(e,t,r){var a;let{style:o}=e,n={};for(let s in o)(be(o[s])||t.style&&be(t.style[s])||Xd(s,e)||((a=r?.getValue(s))===null||a===void 0?void 0:a.liveStyle)!==void 0)&&(n[s]=o[s]);return n}function Jd(e,t,r){let a=Ys(e,t,r);for(let o in e)if(be(e[o])||be(t[o])){let n=$r.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;a[n]=e[o]}return a}function I1(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 nb=["x","y","width","height","cx","cy","r"],sb={useVisualState:qd({scrapeMotionValuesFromProps:Jd,createRenderState:$d,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(jt.has(i)){n=!0;break}}if(!n)return;let s=!t;if(t)for(let i=0;i<nb.length;i++){let l=nb[i];e[l]!==t[l]&&(s=!0)}s&&re.read(()=>{I1(r,a),re.render(()=>{Ks(a,o,Js(r.tagName),e.transformTemplate),Kd(r,a)})})}})};var ib={useVisualState:qd({scrapeMotionValuesFromProps:Ys,createRenderState:Xs})};var Zs=O(Q(),1);var lb=O(Q(),1);function Sg(e,t,r){for(let a in t)!be(t[a])&&!Xd(a,r)&&(e[a]=t[a])}function k1({transformTemplate:e},t){return(0,lb.useMemo)(()=>{let r=Xs();return Gs(r,t,e),Object.assign({},r.vars,r.style)},[t])}function P1(e,t){let r=e.style||{},a={};return Sg(a,r,e),Object.assign(a,k1(e,t)),a}function ub(e,t){let r={},a=P1(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 cb=O(Q(),1);function db(e,t,r,a){let o=(0,cb.useMemo)(()=>{let n=$d();return Ks(n,t,Js(a),e.transformTemplate),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let n={};Sg(n,e.style,e),o.style={...n,...o.style}}return o}function fb(e=!1){return(r,a,o,{latestValues:n},s)=>{let l=(qs(r)?db:ub)(a,n,s,r),u=EC(a,typeof r=="string",e),c=r!==Zs.Fragment?{...u,...l,ref:o}:{},{children:d}=a,f=(0,Zs.useMemo)(()=>be(d)?d.get():d,[d]);return(0,Zs.createElement)(r,{...c,children:f})}}function pb(e,t){return function(a,{forwardMotionProps:o}={forwardMotionProps:!1}){let s={...qs(a)?sb:ib,preloadedFeatures:e,useRender:fb(o),createVisualElement:t,Component:a};return zC(s)}}function Cg(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 ho(e,t,r){let a=e.getProps();return Hs(a,t,r!==void 0?r:a.custom,e)}var bg=yn(()=>window.ScrollTimeline!==void 0);var au=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(bg()&&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 ou=class extends au{then(t,r){return Promise.all(this.animations).then(t).catch(r)}};function go(e,t){return e?e[t]||e.default||e:void 0}function ei(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 yo(e){return typeof e=="function"}function nu(e,t){e.timeline=t,e.onfinish=null}var ti=e=>Array.isArray(e)&&typeof e[0]=="number";var Ig={linearEasing:void 0};function mb(e,t){let r=yn(e);return()=>{var a;return(a=Ig[t])!==null&&a!==void 0?a:r()}}var vo=mb(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");var su=(e,t,r=10)=>{let a="",o=Math.max(Math.round(t/r),2);for(let n=0;n<o;n++)a+=e(rr(0,o-1,n))+", ";return`linear(${a.substring(0,a.length-2)})`};function Yd(e){return!!(typeof e=="function"&&vo()||!e||typeof e=="string"&&(e in Qd||vo())||ti(e)||Array.isArray(e)&&e.every(Yd))}var ri=([e,t,r,a])=>`cubic-bezier(${e}, ${t}, ${r}, ${a})`,Qd={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ri([0,.65,.55,1]),circOut:ri([.55,0,1,.45]),backIn:ri([.31,.01,.66,-.59]),backOut:ri([.33,1.53,.69,.99])};function ai(e,t){if(e)return typeof e=="function"&&vo()?su(e,t):ti(e)?ri(e):Array.isArray(e)?e.map(r=>ai(r,t)||Qd.easeOut):Qd[e]}var or={x:!1,y:!1};function oi(){return or.x||or.y}function kg(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 Zd(e,t){let r=kg(e),a=new AbortController,o={passive:!0,...t,signal:a.signal};return[r,o,()=>a.abort()]}function hb(e){return t=>{t.pointerType==="touch"||oi()||e(t)}}function Pg(e,t,r={}){let[a,o,n]=Zd(e,r),s=hb(i=>{let{target:l}=i,u=t(i);if(typeof u!="function"||!l)return;let c=hb(d=>{u(d),l.removeEventListener("pointerleave",c)});l.addEventListener("pointerleave",c,o)});return a.forEach(i=>{i.addEventListener("pointerenter",s,o)}),n}var ef=(e,t)=>t?e===t?!0:ef(e,t.parentElement):!1;var xn=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;var T1=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function gb(e){return T1.has(e.tagName)||e.tabIndex!==-1}var wn=new WeakSet;function yb(e){return t=>{t.key==="Enter"&&e(t)}}function Tg(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}var vb=(e,t)=>{let r=e.currentTarget;if(!r)return;let a=yb(()=>{if(wn.has(r))return;Tg(r,"down");let o=yb(()=>{Tg(r,"up")}),n=()=>Tg(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 xb(e){return xn(e)&&!oi()}function _g(e,t,r={}){let[a,o,n]=Zd(e,r),s=i=>{let l=i.currentTarget;if(!xb(i)||wn.has(l))return;wn.add(l);let u=t(i),c=(h,v)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),!(!xb(h)||!wn.has(l))&&(wn.delete(l),typeof u=="function"&&u(h,{success:v}))},d=h=>{c(h,r.useGlobalTarget||ef(l,h.target))},f=h=>{c(h,!1)};window.addEventListener("pointerup",d,o),window.addEventListener("pointercancel",f,o)};return a.forEach(i=>{!gb(i)&&i.getAttribute("tabindex")===null&&(i.tabIndex=0),(r.useGlobalTarget?window:i).addEventListener("pointerdown",s,o),i.addEventListener("focus",u=>vb(u,o),o)}),n}function Ag(e){return e==="x"||e==="y"?or[e]?null:(or[e]=!0,()=>{or[e]=!1}):or.x||or.y?null:(or.x=or.y=!0,()=>{or.x=or.y=!1})}var tf=new Set(["width","height","top","left","right","bottom",...$r]);var rf;function A1(){rf=void 0}var Ct={now:()=>(rf===void 0&&Ct.set(He.isProcessing||Fs.useManualTiming?He.timestamp:performance.now()),rf),set:e=>{rf=e,queueMicrotask(A1)}};function ni(e,t){e.indexOf(t)===-1&&e.push(t)}function si(e,t){let r=e.indexOf(t);r>-1&&e.splice(r,1)}var xo=class{constructor(){this.subscriptions=[]}add(t){return ni(this.subscriptions,t),()=>si(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 af(e,t){return t?e*(1e3/t):0}var Sb=30,R1=e=>!isNaN(parseFloat(e)),Cb={current:void 0},Rg=class{constructor(t,r={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(a,o=!0)=>{let n=Ct.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=Ct.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=R1(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 xo);let a=this.events[t].add(r);return t==="change"?()=>{a(),re.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 Cb.current&&Cb.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let t=Ct.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Sb)return 0;let r=Math.min(this.updatedAt-this.prevUpdatedAt,Sb);return af(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 ka(e,t){return new Rg(e,t)}function E1(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,ka(r))}function bb(e,t){let r=ho(e,t),{transitionEnd:a={},transition:o={},...n}=r||{};n={...n,...a};for(let s in n){let i=KC(n[s]);E1(e,s,i)}}function Lb(e){return!!(be(e)&&e.add)}function iu(e,t){let r=e.getValue("willChange");if(Lb(r))return r.add(t)}function of(e){return e.props[Ud]}var nf={current:!1};var Ib=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,D1=1e-7,N1=12;function M1(e,t,r,a,o){let n,s,i=0;do s=t+(r-t)/2,n=Ib(s,a,o)-e,n>0?r=s:t=s;while(Math.abs(n)>D1&&++i<N1);return s}function wo(e,t,r,a){if(e===t&&r===a)return ye;let o=n=>M1(n,0,1,e,r);return n=>n===0||n===1?n:Ib(o(n),t,a)}var sf=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2;var lf=e=>t=>1-e(1-t);var Eg=wo(.33,1.53,.69,.99),lu=lf(Eg),uf=sf(lu);var cf=e=>(e*=2)<1?.5*lu(e):.5*(2-Math.pow(2,-10*(e-1)));var df=e=>1-Math.sin(Math.acos(e)),ff=lf(df),pf=sf(df);var mf=e=>/^0[^.\s]+$/u.test(e);function kb(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||mf(e):!0}var So=e=>Math.round(e*1e5)/1e5;var ii=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Pb(e){return e==null}var Tb=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var li=(e,t)=>r=>!!(typeof r=="string"&&Tb.test(r)&&r.startsWith(e)||t&&!Pb(r)&&Object.prototype.hasOwnProperty.call(r,t)),hf=(e,t,r)=>a=>{if(typeof a!="string")return a;let[o,n,s,i]=a.match(ii);return{[e]:parseFloat(o),[t]:parseFloat(n),[r]:parseFloat(s),alpha:i!==void 0?parseFloat(i):1}};var O1=e=>ft(0,255,e),Dg={...Wr,transform:e=>Math.round(O1(e))},Kr={test:li("rgb","red"),parse:hf("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:a=1})=>"rgba("+Dg.transform(e)+", "+Dg.transform(t)+", "+Dg.transform(r)+", "+So(Ia.transform(a))+")"};function B1(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 uu={test:li("#"),parse:B1,transform:Kr.transform};var Co={test:li("hsl","hue"),parse:hf("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:a=1})=>"hsla("+Math.round(e)+", "+_t.transform(So(t))+", "+_t.transform(So(r))+", "+So(Ia.transform(a))+")"};var Ge={test:e=>Kr.test(e)||uu.test(e)||Co.test(e),parse:e=>Kr.test(e)?Kr.parse(e):Co.test(e)?Co.parse(e):uu.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Kr.transform(e):Co.transform(e)};var _b=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function F1(e){var t,r;return isNaN(e)&&typeof e=="string"&&(((t=e.match(ii))===null||t===void 0?void 0:t.length)||0)+(((r=e.match(_b))===null||r===void 0?void 0:r.length)||0)>0}var Rb="number",Eb="color",U1="var",V1="var(",Ab="${}",j1=/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 Sn(e){let t=e.toString(),r=[],a={color:[],number:[],var:[]},o=[],n=0,i=t.replace(j1,l=>(Ge.test(l)?(a.color.push(n),o.push(Eb),r.push(Ge.parse(l))):l.startsWith(V1)?(a.var.push(n),o.push(U1),r.push(l)):(a.number.push(n),o.push(Rb),r.push(parseFloat(l))),++n,Ab)).split(Ab);return{values:r,split:i,indexes:a,types:o}}function Db(e){return Sn(e).values}function Nb(e){let{split:t,types:r}=Sn(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===Rb?n+=So(o[s]):i===Eb?n+=Ge.transform(o[s]):n+=o[s]}return n}}var q1=e=>typeof e=="number"?0:e;function H1(e){let t=Db(e);return Nb(e)(t.map(q1))}var At={test:F1,parse:Db,createTransformer:Nb,getAnimatableNone:H1};var z1=new Set(["brightness","contrast","saturate","opacity"]);function $1(e){let[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;let[a]=r.match(ii)||[];if(!a)return e;let o=r.replace(a,""),n=z1.has(t)?1:0;return a!==r&&(n*=100),t+"("+n+o+")"}var W1=/\b([a-z-]*)\(.*?\)/gu,cu={...At,getAnimatableNone:e=>{let t=e.match(W1);return t?t.map($1).join(" "):e}};var G1={...Ws,color:Ge,backgroundColor:Ge,outlineColor:Ge,fill:Ge,stroke:Ge,borderColor:Ge,borderTopColor:Ge,borderRightColor:Ge,borderBottomColor:Ge,borderLeftColor:Ge,filter:cu,WebkitFilter:cu},ui=e=>G1[e];function gf(e,t){let r=ui(e);return r!==cu&&(r=At),r.getAnimatableNone?r.getAnimatableNone(t):void 0}var K1=new Set(["auto","none","0"]);function Mb(e,t,r){let a=0,o;for(;a<e.length&&!o;){let n=e[a];typeof n=="string"&&!K1.has(n)&&Sn(n).values.length&&(o=e[a]),a++}if(o&&r)for(let n of t)e[n]=gf(r,o)}var Ng=e=>e===Wr||e===z,Ob=(e,t)=>parseFloat(e.split(", ")[t]),Bb=(e,t)=>(r,{transform:a})=>{if(a==="none"||!a)return 0;let o=a.match(/^matrix3d\((.+)\)$/u);if(o)return Ob(o[1],t);{let n=a.match(/^matrix\((.+)\)$/u);return n?Ob(n[1],e):0}},X1=new Set(["x","y","z"]),J1=$r.filter(e=>!X1.has(e));function Fb(e){let t=[];return J1.forEach(r=>{let a=e.getValue(r);a!==void 0&&(t.push([r,a.get()]),a.set(r.startsWith("scale")?1:0))}),t}var Cn={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:Bb(4,13),y:Bb(5,14)};Cn.translateX=Cn.x;Cn.translateY=Cn.y;var bn=new Set,Mg=!1,Og=!1;function Ub(){if(Og){let e=Array.from(bn).filter(a=>a.needsMeasurement),t=new Set(e.map(a=>a.element)),r=new Map;t.forEach(a=>{let o=Fb(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)})}Og=!1,Mg=!1,bn.forEach(e=>e.complete()),bn.clear()}function Vb(){bn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Og=!0)})}function jb(){Vb(),Ub()}var bo=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?(bn.add(this),Mg||(Mg=!0,re.read(Vb),re.resolveKeyframes(Ub))):(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),bn.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,bn.delete(this))}resume(){this.isComplete||this.scheduleResolve()}};var yf=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);var Q1=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Y1(e){let t=Q1.exec(e);if(!t)return[,];let[,r,a,o]=t;return[`--${r??a}`,o]}var Z1=4;function Bg(e,t,r=1){Er(r<=Z1,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);let[a,o]=Y1(e);if(!a)return;let n=window.getComputedStyle(t).getPropertyValue(a);if(n){let s=n.trim();return yf(s)?parseFloat(s):s}return $s(o)?Bg(o,t,r+1):o}var vf=e=>t=>t.test(e);var qb={test:e=>e==="auto",parse:e=>e};var Fg=[Wr,z,_t,Gr,QC,JC,qb],Ug=e=>Fg.find(vf(e));var ci=class extends bo{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(),$s(u))){let c=Bg(u,r.current);c!==void 0&&(t[l]=c),l===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!tf.has(a)||t.length!==2)return;let[o,n]=t,s=Ug(o),i=Ug(n);if(s!==i)if(Ng(s)&&Ng(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++)kb(t[o])&&a.push(o);a.length&&Mb(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=Cn[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]=Cn[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 Vg=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(At.test(e)||e==="0")&&!e.startsWith("url("));function eE(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 Hb(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=Vg(o,t),i=Vg(n,t);return Sa(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:eE(e)||(r==="spring"||yo(r))&&a}var tE=e=>e!==null;function Lo(e,{repeat:t,repeatType:r="loop"},a){let o=e.filter(tE),n=t&&r!=="loop"&&t%2===1?0:o.length-1;return!n||a===void 0?o[n]:a}var rE=40,di=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=Ct.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>rE?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&jb(),this._resolved}onKeyframesResolved(t,r){this.resolvedAt=Ct.now(),this.hasAttemptedResolve=!0;let{name:a,type:o,velocity:n,delay:s,onComplete:i,onUpdate:l,isGenerator:u}=this.options;if(!u&&!Hb(t,a,o,n))if(nf.current||!s){l&&l(Lo(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 jg(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 zb({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=jg(l,i,e+1/3),n=jg(l,i,e),s=jg(l,i,e-1/3)}return{red:Math.round(o*255),green:Math.round(n*255),blue:Math.round(s*255),alpha:a}}function fi(e,t){return r=>r>0?t:e}var qg=(e,t,r)=>{let a=e*e,o=r*(t*t-a)+a;return o<0?0:Math.sqrt(o)},aE=[uu,Kr,Co],oE=e=>aE.find(t=>t.test(e));function $b(e){let t=oE(e);if(Sa(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let r=t.parse(e);return t===Co&&(r=zb(r)),r}var Hg=(e,t)=>{let r=$b(e),a=$b(t);if(!r||!a)return fi(e,t);let o={...r};return n=>(o.red=qg(r.red,a.red,n),o.green=qg(r.green,a.green,n),o.blue=qg(r.blue,a.blue,n),o.alpha=le(r.alpha,a.alpha,n),Kr.transform(o))};var nE=(e,t)=>r=>t(e(r)),Xr=(...e)=>e.reduce(nE);var xf=new Set(["none","hidden"]);function Wb(e,t){return xf.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function sE(e,t){return r=>le(e,t,r)}function wf(e){return typeof e=="number"?sE:typeof e=="string"?$s(e)?fi:Ge.test(e)?Hg:uE:Array.isArray(e)?Gb:typeof e=="object"?Ge.test(e)?Hg:iE:fi}function Gb(e,t){let r=[...e],a=r.length,o=e.map((n,s)=>wf(n)(n,t[s]));return n=>{for(let s=0;s<a;s++)r[s]=o[s](n);return r}}function iE(e,t){let r={...e,...t},a={};for(let o in r)e[o]!==void 0&&t[o]!==void 0&&(a[o]=wf(e[o])(e[o],t[o]));return o=>{for(let n in a)r[n]=a[n](o);return r}}function lE(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 uE=(e,t)=>{let r=At.createTransformer(t),a=Sn(e),o=Sn(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?xf.has(e)&&!o.values.length||xf.has(t)&&!a.values.length?Wb(e,t):Xr(Gb(lE(a,o),o.values),r):(Sa(!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.`),fi(e,t))};function Sf(e,t,r){return typeof e=="number"&&typeof t=="number"&&typeof r=="number"?le(e,t,r):wf(e)(e,t)}var cE=5;function Cf(e,t,r){let a=Math.max(t-cE,0);return af(r-e(a),t-a)}var Te={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 zg=.001;function Kb({duration:e=Te.duration,bounce:t=Te.bounce,velocity:r=Te.velocity,mass:a=Te.mass}){let o,n;Sa(e<=qe(Te.maxDuration),"Spring duration must be 10 seconds or less");let s=1-t;s=ft(Te.minDamping,Te.maxDamping,s),e=ft(Te.minDuration,Te.maxDuration,dt(e)),s<1?(o=u=>{let c=u*s,d=c*e,f=c-r,h=bf(u,s),v=Math.exp(-d);return zg-f/h*v},n=u=>{let d=u*s*e,f=d*r+r,h=Math.pow(s,2)*Math.pow(u,2)*e,v=Math.exp(-d),x=bf(Math.pow(u,2),s);return(-o(u)+zg>0?-1:1)*((f-h)*v)/x}):(o=u=>{let c=Math.exp(-u*e),d=(u-r)*e+1;return-zg+c*d},n=u=>{let c=Math.exp(-u*e),d=(r-u)*(e*e);return c*d});let i=5/e,l=fE(o,n,i);if(e=qe(e),isNaN(l))return{stiffness:Te.stiffness,damping:Te.damping,duration:e};{let u=Math.pow(l,2)*a;return{stiffness:u,damping:s*2*Math.sqrt(a*u),duration:e}}}var dE=12;function fE(e,t,r){let a=r;for(let o=1;o<dE;o++)a=a-e(a)/t(a);return a}function bf(e,t){return e*Math.sqrt(1-t*t)}var pE=["duration","bounce"],mE=["stiffness","damping","mass"];function Xb(e,t){return t.some(r=>e[r]!==void 0)}function hE(e){let t={velocity:Te.velocity,stiffness:Te.stiffness,damping:Te.damping,mass:Te.mass,isResolvedFromDuration:!1,...e};if(!Xb(e,mE)&&Xb(e,pE))if(e.visualDuration){let r=e.visualDuration,a=2*Math.PI/(r*1.2),o=a*a,n=2*ft(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Te.mass,stiffness:o,damping:n}}else{let r=Kb(e);t={...t,...r,mass:Te.mass},t.isResolvedFromDuration=!0}return t}function Lf(e=Te.visualDuration,t=Te.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:h}=hE({...r,velocity:-dt(r.velocity||0)}),v=f||0,x=u/(2*Math.sqrt(l*c)),C=s-n,g=dt(Math.sqrt(l/c)),p=Math.abs(C)<5;a||(a=p?Te.restSpeed.granular:Te.restSpeed.default),o||(o=p?Te.restDelta.granular:Te.restDelta.default);let y;if(x<1){let L=bf(g,x);y=P=>{let T=Math.exp(-x*g*P);return s-T*((v+x*g*C)/L*Math.sin(L*P)+C*Math.cos(L*P))}}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=P=>{let T=Math.exp(-x*g*P),A=Math.min(L*P,300);return s-T*((v+x*g*C)*Math.sinh(A)+L*C*Math.cosh(A))/L}}let b={calculatedDuration:h&&d||null,next:L=>{let P=y(L);if(h)i.done=L>=d;else{let T=0;x<1&&(T=L===0?qe(v):Cf(y,L,P));let A=Math.abs(T)<=a,N=Math.abs(s-P)<=o;i.done=A&&N}return i.value=i.done?s:P,i},toString:()=>{let L=Math.min(ei(b),2e4),P=su(T=>b.next(L*T).value,L,30);return L+"ms "+P}};return b}function $g({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},h=A=>i!==void 0&&A<i||l!==void 0&&A>l,v=A=>i===void 0?l:l===void 0||Math.abs(i-A)<Math.abs(l-A)?i:l,x=r*t,C=d+x,g=s===void 0?C:s(C);g!==C&&(x=g-d);let p=A=>-x*Math.exp(-A/a),y=A=>g+p(A),b=A=>{let N=p(A),j=y(A);f.done=Math.abs(N)<=u,f.value=f.done?g:j},L,P,T=A=>{h(f.value)&&(L=A,P=Lf({keyframes:[f.value,v(f.value)],velocity:Cf(y,A,f.value),damping:o,stiffness:n,restDelta:u,restSpeed:c}))};return T(0),{calculatedDuration:null,next:A=>{let N=!1;return!P&&L===void 0&&(N=!0,b(A),T(A)),L!==void 0&&A>=L?P.next(A-L):(!N&&b(A),f)}}}var Jb=wo(.42,0,1,1),Qb=wo(0,0,.58,1),If=wo(.42,0,.58,1);var Yb=e=>Array.isArray(e)&&typeof e[0]!="number";var Zb={linear:ye,easeIn:Jb,easeInOut:If,easeOut:Qb,circIn:df,circInOut:pf,circOut:ff,backIn:lu,backInOut:uf,backOut:Eg,anticipate:cf},Wg=e=>{if(ti(e)){Er(e.length===4,"Cubic bezier arrays must contain four numerical values.");let[t,r,a,o]=e;return wo(t,r,a,o)}else if(typeof e=="string")return Er(Zb[e]!==void 0,`Invalid easing type '${e}'`),Zb[e];return e};function gE(e,t,r){let a=[],o=r||Sf,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]||ye:t;i=Xr(l,i)}a.push(i)}return a}function eL(e,t,{clamp:r=!0,ease:a,mixer:o}={}){let n=e.length;if(Er(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=gE(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=rr(e[d],e[d+1],c);return i[d](f)};return r?c=>u(ft(e[0],e[n-1],c)):u}function tL(e,t){let r=e[e.length-1];for(let a=1;a<=t;a++){let o=rr(0,t,a);e.push(le(r,1,o))}}function rL(e){let t=[0];return tL(t,e.length-1),t}function aL(e,t){return e.map(r=>r*t)}function yE(e,t){return e.map(()=>t||If).splice(0,e.length-1)}function du({duration:e=300,keyframes:t,times:r,ease:a="easeInOut"}){let o=Yb(a)?a.map(Wg):Wg(a),n={done:!1,value:t[0]},s=aL(r&&r.length===t.length?r:rL(t),e),i=eL(s,t,{ease:Array.isArray(o)?o:yE(t,o)});return{calculatedDuration:e,next:l=>(n.value=i(l),n.done=l>=e,n)}}var oL=e=>{let t=({timestamp:r})=>e(r);return{start:()=>re.update(t,!0),stop:()=>ar(t),now:()=>He.isProcessing?He.timestamp:Ct.now()}};var vE={decay:$g,inertia:$g,tween:du,keyframes:du,spring:Lf},xE=e=>e/100,Ln=class extends di{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||bo,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=yo(r)?r:vE[r]||du,l,u;i!==du&&typeof t[0]!="number"&&(l=Xr(xE,Sf(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=ei(c));let{calculatedDuration:d}=c,f=d+o,h=f*(a+1)-o;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:d,resolvedDuration:f,totalDuration:h}}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:A}=this.options;return{done:!0,value:A[A.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:h,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),p=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(h){let A=Math.min(this.currentTime,c)/d,N=Math.floor(A),j=A%1;!j&&A>=1&&(j=1),j===1&&N--,N=Math.min(N,h+1),N%2&&(v==="reverse"?(j=1-j,x&&(j-=x/d)):v==="mirror"&&(b=s)),y=ft(0,1,j)*d}let L=p?{done:!1,value:l[0]}:b.next(y);i&&(L.value=i(L.value));let{done:P}=L;!p&&u!==null&&(P=this.speed>=0?this.currentTime>=c:this.currentTime<=0);let T=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&P);return T&&o!==void 0&&(L.value=Lo(l,this.options,o)),C&&C(L.value),T&&this.finish(),L}get duration(){let{resolved:t}=this;return t?dt(t.calculatedDuration):0}get time(){return dt(this.currentTime)}set time(t){t=qe(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=dt(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;let{driver:t=oL,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 nL=new Set(["opacity","clipPath","filter","transform"]);function sL(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=ai(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 iL=yn(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));var kf=10,wE=2e4;function SE(e){return yo(e.type)||e.type==="spring"||!Yd(e.ease)}function CE(e,t){let r=new Ln({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0}),a={done:!1,value:e[0]},o=[],n=0;for(;!a.done&&n<wE;)a=r.sample(n),o.push(a.value),n+=kf;return{times:void 0,keyframes:o,duration:n-kf,ease:"linear"}}var lL={anticipate:cf,backInOut:uf,circInOut:pf};function bE(e){return e in lL}var fu=class extends di{constructor(t){super(t);let{name:r,motionValue:a,element:o,keyframes:n}=this.options;this.resolver=new ci(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"&&vo()&&bE(n)&&(n=lL[n]),SE(this.options)){let{onComplete:d,onUpdate:f,motionValue:h,element:v,...x}=this.options,C=CE(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=sL(i.owner.current,l,t,{...this.options,duration:a,times:o,ease:n});return c.startTime=u??this.calcStartTime(),this.pendingTimeline?(nu(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{let{onComplete:d}=this.options;i.set(Lo(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 dt(r)}get time(){let{resolved:t}=this;if(!t)return 0;let{animation:r}=t;return dt(r.currentTime||0)}set time(t){let{resolved:r}=this;if(!r)return;let{animation:a}=r;a.currentTime=qe(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 ye;let{animation:a}=r;nu(a,t)}return ye}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,...h}=this.options,v=new Ln({...h,keyframes:a,duration:o,type:n,ease:s,times:i,isGenerator:!0}),x=qe(this.time);u.setWithVelocity(v.sample(x-kf).value,v.sample(x).value,kf)}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 iL()&&a&&nL.has(a)&&!l&&!u&&!o&&n!=="mirror"&&s!==0&&i!=="inertia"}};var LE={type:"spring",stiffness:500,damping:25,restSpeed:10},IE=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),kE={type:"keyframes",duration:.8},PE={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},uL=(e,{keyframes:t})=>t.length>2?kE:jt.has(e)?e.startsWith("scale")?IE(t[1]):LE:PE;function cL({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 pi=(e,t,r,a={},o,n)=>s=>{let i=go(a,e)||{},l=i.delay||a.delay||0,{elapsed:u=0}=a;u=u-qe(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};cL(i)||(c={...c,...uL(e,c)}),c.duration&&(c.duration=qe(c.duration)),c.repeatDelay&&(c.repeatDelay=qe(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)),(nf.current||Fs.skipAnimations)&&(d=!0,c.duration=0,c.delay=0),d&&!n&&t.get()!==void 0){let f=Lo(c.keyframes,i);if(f!==void 0)return re.update(()=>{c.onUpdate(f),c.onComplete()}),new ou([])}return!n&&fu.supports(c)?new fu(c):new Ln(c)};function TE({protectedKeys:e,needsAnimating:t},r){let a=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,a}function Pf(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),h=l[d];if(h===void 0||c&&TE(c,d))continue;let v={delay:r,...go(s||{},d)},x=!1;if(window.MotionHandoffAnimation){let g=of(e);if(g){let p=window.MotionHandoffAnimation(g,d,re);p!==null&&(v.startTime=p,x=!0)}}iu(e,d),f.start(pi(d,f,h,e.shouldReduceMotion&&tf.has(d)?{type:!1}:v,e,x));let C=f.animation;C&&u.push(C)}return i&&Promise.all(u).then(()=>{re.update(()=>{i&&bb(e,i)})}),u}function Tf(e,t,r={}){var a;let o=ho(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(Pf(e,o,r)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(u=0)=>{let{delayChildren:c=0,staggerChildren:d,staggerDirection:f}=n;return _E(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 _E(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(AE).forEach((u,c)=>{u.notify("AnimationStart",t),s.push(Tf(u,t,{...n,delay:r+l(c)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(s)}function AE(e,t){return e.sortNodePosition(t)}function dL(e,t,r={}){e.notify("AnimationStart",t);let a;if(Array.isArray(t)){let o=t.map(n=>Tf(e,n,r));a=Promise.all(o)}else if(typeof t=="string")a=Tf(e,t,r);else{let o=typeof t=="function"?ho(e,t,r.custom):t;a=Promise.all(Pf(e,o,r))}return a.then(()=>{e.notify("AnimationComplete",t)})}var RE=Zl.length;function Gg(e){if(!e)return;if(!e.isControllingVariants){let r=e.parent?Gg(e.parent)||{}:{};return e.props.initial!==void 0&&(r.initial=e.props.initial),r}let t={};for(let r=0;r<RE;r++){let a=Zl[r],o=e.props[a];(ba(o)||o===!1)&&(t[a]=o)}return t}var EE=[...Od].reverse(),DE=Od.length;function NE(e){return t=>Promise.all(t.map(({animation:r,options:a})=>dL(e,r,a)))}function pL(e){let t=NE(e),r=fL(),a=!0,o=l=>(u,c)=>{var d;let f=ho(e,c,l==="exit"?(d=e.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(f){let{transition:h,transitionEnd:v,...x}=f;u={...u,...x,...v}}return u};function n(l){t=l(e)}function s(l){let{props:u}=e,c=Gg(e.parent)||{},d=[],f=new Set,h={},v=1/0;for(let C=0;C<DE;C++){let g=EE[C],p=r[g],y=u[g]!==void 0?u[g]:c[g],b=ba(y),L=g===l?p.isActive:null;L===!1&&(v=C);let P=y===c[g]&&y!==u[g]&&b;if(P&&a&&e.manuallyAnimateOnMount&&(P=!1),p.protectedKeys={...h},!p.isActive&&L===null||!y&&!p.prevProp||mo(y)||typeof y=="boolean")continue;let T=ME(p.prevProp,y),A=T||g===l&&p.isActive&&!P&&b||C>v&&b,N=!1,j=Array.isArray(y)?y:[y],pe=j.reduce(o(g),{});L===!1&&(pe={});let{prevResolvedValues:ee={}}=p,ir={...ee,...pe},zt=ve=>{A=!0,f.has(ve)&&(N=!0,f.delete(ve)),p.needsAnimating[ve]=!0;let Ye=e.getValue(ve);Ye&&(Ye.liveStyle=!1)};for(let ve in ir){let Ye=pe[ve],mt=ee[ve];if(h.hasOwnProperty(ve))continue;let Aa=!1;eu(Ye)&&eu(mt)?Aa=!Cg(Ye,mt):Aa=Ye!==mt,Aa?Ye!=null?zt(ve):f.add(ve):Ye!==void 0&&f.has(ve)?zt(ve):p.protectedKeys[ve]=!0}p.prevProp=y,p.prevResolvedValues=pe,p.isActive&&(h={...h,...pe}),a&&e.blockInitialAnimation&&(A=!1),A&&(!(P&&T)||N)&&d.push(...j.map(ve=>({animation:ve,options:{type:g}})))}if(f.size){let C={};f.forEach(g=>{let p=e.getBaseTarget(g),y=e.getValue(g);y&&(y.liveStyle=!0),C[g]=p??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 h;return(h=f.animationState)===null||h===void 0?void 0:h.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=fL(),a=!0}}}function ME(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Cg(t,e):!1}function In(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function fL(){return{animate:In(!0),whileInView:In(),whileHover:In(),whileTap:In(),whileDrag:In(),whileFocus:In(),exit:In()}}var st=class{constructor(t){this.isMounted=!1,this.node=t}update(){}};var _f=class extends st{constructor(t){super(t),t.animationState||(t.animationState=pL(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();mo(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 OE=0,Af=class extends st{constructor(){super(...arguments),this.id=OE++}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 mL={animation:{Feature:_f},exit:{Feature:Af}};function Pa(e,t,r,a={passive:!0}){return e.addEventListener(t,r,a),()=>e.removeEventListener(t,r)}function Ta(e){return{point:{x:e.pageX,y:e.pageY}}}var hL=e=>t=>xn(t)&&e(t,Ta(t));function Io(e,t,r,a){return Pa(e,t,hL(r),a)}var gL=(e,t)=>Math.abs(e-t);function yL(e,t){let r=gL(e.x,t.x),a=gL(e.y,t.y);return Math.sqrt(r**2+a**2)}var mi=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=Xg(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,h=yL(d.offset,{x:0,y:0})>=3;if(!f&&!h)return;let{point:v}=d,{timestamp:x}=He;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=Kg(f,this.transformPagePoint),re.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();let{onEnd:h,onSessionEnd:v,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let C=Xg(d.type==="pointercancel"?this.lastMoveEventInfo:Kg(f,this.transformPagePoint),this.history);this.startEvent&&h&&h(d,C),v&&v(d,C)},!xn(t))return;this.dragSnapToOrigin=n,this.handlers=r,this.transformPagePoint=a,this.contextWindow=o||window;let s=Ta(t),i=Kg(s,this.transformPagePoint),{point:l}=i,{timestamp:u}=He;this.history=[{...l,timestamp:u}];let{onSessionStart:c}=r;c&&c(t,Xg(i,this.history)),this.removeListeners=Xr(Io(this.contextWindow,"pointermove",this.handlePointerMove),Io(this.contextWindow,"pointerup",this.handlePointerUp),Io(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),ar(this.updatePoint)}};function Kg(e,t){return t?{point:t(e.point)}:e}function vL(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Xg({point:e},t){return{point:e,delta:vL(e,xL(t)),offset:vL(e,BE(t)),velocity:FE(t,.1)}}function BE(e){return e[0]}function xL(e){return e[e.length-1]}function FE(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,a=null,o=xL(e);for(;r>=0&&(a=e[r],!(o.timestamp-a.timestamp>qe(t)));)r--;if(!a)return{x:0,y:0};let n=dt(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 bL=1e-4,UE=1-bL,VE=1+bL,LL=.01,jE=0-LL,qE=0+LL;function pt(e){return e.max-e.min}function IL(e,t,r){return Math.abs(e-t)<=r}function wL(e,t,r,a=.5){e.origin=a,e.originPoint=le(t.min,t.max,e.origin),e.scale=pt(r)/pt(t),e.translate=le(r.min,r.max,e.origin)-e.originPoint,(e.scale>=UE&&e.scale<=VE||isNaN(e.scale))&&(e.scale=1),(e.translate>=jE&&e.translate<=qE||isNaN(e.translate))&&(e.translate=0)}function hi(e,t,r,a){wL(e.x,t.x,r.x,a?a.originX:void 0),wL(e.y,t.y,r.y,a?a.originY:void 0)}function SL(e,t,r){e.min=r.min+t.min,e.max=e.min+pt(t)}function kL(e,t,r){SL(e.x,t.x,r.x),SL(e.y,t.y,r.y)}function CL(e,t,r){e.min=t.min-r.min,e.max=e.min+pt(t)}function gi(e,t,r){CL(e.x,t.x,r.x),CL(e.y,t.y,r.y)}function RL(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 PL(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 EL(e,{top:t,left:r,bottom:a,right:o}){return{x:PL(e.x,r,o),y:PL(e.y,t,a)}}function TL(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 DL(e,t){return{x:TL(e.x,t.x),y:TL(e.y,t.y)}}function NL(e,t){let r=.5,a=pt(e),o=pt(t);return o>a?r=rr(t.min,t.max-a,e.min):a>o&&(r=rr(e.min,e.max-o,t.min)),ft(0,1,r)}function ML(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 Rf=.35;function OL(e=Rf){return e===!1?e=0:e===!0&&(e=Rf),{x:_L(e,"left","right"),y:_L(e,"top","bottom")}}function _L(e,t,r){return{min:AL(e,t),max:AL(e,r)}}function AL(e,t){return typeof e=="number"?e:e[t]||0}var BL=()=>({translate:0,scale:1,origin:0,originPoint:0}),kn=()=>({x:BL(),y:BL()}),FL=()=>({min:0,max:0}),_e=()=>({x:FL(),y:FL()});function qt(e){return[e("x"),e("y")]}function Ef({top:e,left:t,right:r,bottom:a}){return{x:{min:t,max:r},y:{min:e,max:a}}}function UL({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function VL(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 Jg(e){return e===void 0||e===1}function Df({scale:e,scaleX:t,scaleY:r}){return!Jg(e)||!Jg(t)||!Jg(r)}function _a(e){return Df(e)||Qg(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Qg(e){return jL(e.x)||jL(e.y)}function jL(e){return e&&e!=="0%"}function pu(e,t,r){let a=e-r,o=t*a;return r+o}function qL(e,t,r,a,o){return o!==void 0&&(e=pu(e,o,a)),pu(e,r,a)+t}function Yg(e,t=0,r=1,a,o){e.min=qL(e.min,t,r,a,o),e.max=qL(e.max,t,r,a,o)}function Zg(e,{x:t,y:r}){Yg(e.x,t.translate,t.scale,t.originPoint),Yg(e.y,r.translate,r.scale,r.originPoint)}var HL=.999999999999,zL=1.0000000000001;function WL(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&&Pn(e,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,Zg(e,s)),a&&_a(n.latestValues)&&Pn(e,n.latestValues))}t.x<zL&&t.x>HL&&(t.x=1),t.y<zL&&t.y>HL&&(t.y=1)}function ko(e,t){e.min=e.min+t,e.max=e.max+t}function $L(e,t,r,a,o=.5){let n=le(e.min,e.max,o);Yg(e,t,r,n,a)}function Pn(e,t){$L(e.x,t.x,t.scaleX,t.scale,t.originX),$L(e.y,t.y,t.scaleY,t.scale,t.originY)}function ey(e,t){return Ef(VL(e.getBoundingClientRect(),t))}function GL(e,t,r){let a=ey(e,r),{scroll:o}=t;return o&&(ko(a.x,o.offset.x),ko(a.y,o.offset.y)),a}var Nf=({current:e})=>e?e.ownerDocument.defaultView:null;var HE=new WeakMap,Of=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=_e(),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(Ta(c).point)},n=(c,d)=>{let{drag:f,dragPropagation:h,onDragStart:v}=this.getProps();if(f&&!h&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ag(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),qt(C=>{let g=this.getAxisMotionValue(C).get()||0;if(_t.test(g)){let{projection:p}=this.visualElement;if(p&&p.layout){let y=p.layout.layoutBox[C];y&&(g=pt(y)*(parseFloat(g)/100))}}this.originPoint[C]=g}),v&&re.postRender(()=>v(c,d)),iu(this.visualElement,"transform");let{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},s=(c,d)=>{let{dragPropagation:f,dragDirectionLock:h,onDirectionLock:v,onDrag:x}=this.getProps();if(!f&&!this.openDragLock)return;let{offset:C}=d;if(h&&this.currentDirection===null){this.currentDirection=zE(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=()=>qt(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 mi(t,{onSessionStart:o,onStart:n,onMove:s,onSessionEnd:i,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:Nf(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&&re.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||!Mf(t,o,this.currentDirection))return;let n=this.getAxisMotionValue(t),s=this.originPoint[t]+a[t];this.constraints&&this.constraints[t]&&(s=RL(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&&La(r)?this.constraints||(this.constraints=this.resolveRefConstraints()):r&&o?this.constraints=EL(o.layoutBox,r):this.constraints=!1,this.elastic=OL(a),n!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&qt(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=ML(o.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){let{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!La(t))return!1;let a=t.current;Er(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=GL(a,o.root,this.visualElement.getTransformPagePoint()),s=DL(o.layout.layoutBox,n);if(r){let i=r(UL(s));this.hasMutatedConstraints=!!i,i&&(s=Ef(i))}return s}startAnimation(t){let{drag:r,dragMomentum:a,dragElastic:o,dragTransition:n,dragSnapToOrigin:s,onDragTransitionEnd:i}=this.getProps(),l=this.constraints||{},u=qt(c=>{if(!Mf(c,r,this.currentDirection))return;let d=l&&l[c]||{};s&&(d={min:0,max:0});let f=o?200:1e6,h=o?40:1e7,v={type:"inertia",velocity:a?t[c]:0,bounceStiffness:f,bounceDamping:h,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 iu(this.visualElement,t),a.start(pi(t,a,0,r,this.visualElement,!1))}stopAnimation(){qt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){qt(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){qt(r=>{let{drag:a}=this.getProps();if(!Mf(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(!La(r)||!a||!this.constraints)return;this.stopAnimation();let o={x:0,y:0};qt(s=>{let i=this.getAxisMotionValue(s);if(i&&this.constraints!==!1){let l=i.get();o[s]=NL({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(),qt(s=>{if(!Mf(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;HE.set(this.visualElement,this);let t=this.visualElement.current,r=Io(t,"pointerdown",l=>{let{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),a=()=>{let{dragConstraints:l}=this.getProps();La(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()),re.read(a);let s=Pa(window,"resize",()=>this.scalePositionWithinConstraints()),i=o.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(qt(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=Rf,dragMomentum:i=!0}=t;return{...t,drag:r,dragDirectionLock:a,dragPropagation:o,dragConstraints:n,dragElastic:s,dragMomentum:i}}};function Mf(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function zE(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}var Bf=class extends st{constructor(t){super(t),this.removeGroupControls=ye,this.removeListeners=ye,this.controls=new Of(t)}mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ye}unmount(){this.removeGroupControls(),this.removeListeners()}};var KL=e=>(t,r)=>{e&&re.postRender(()=>e(t,r))},Ff=class extends st{constructor(){super(...arguments),this.removePointerDownListener=ye}onPointerDown(t){this.session=new mi(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Nf(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:r,onPan:a,onPanEnd:o}=this.node.getProps();return{onSessionStart:KL(t),onStart:KL(r),onMove:a,onEnd:(n,s)=>{delete this.session,o&&re.postRender(()=>o(n,s))}}}mount(){this.removePointerDownListener=Io(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 QL=O(ue(),1),mu=O(Q(),1);var yi={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function XL(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var vi={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(z.test(e))e=parseFloat(e);else return e;let r=XL(e,t.target.x),a=XL(e,t.target.y);return`${r}% ${a}%`}};var JL={correct:(e,{treeScale:t,projectionDelta:r})=>{let a=e,o=At.parse(e);if(o.length>5)return a;let n=At.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 ty=class extends mu.Component{componentDidMount(){let{visualElement:t,layoutGroup:r,switchLayoutGroup:a,layoutId:o}=this.props,{projection:n}=t;ob($E),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()})),yi.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()||re.postRender(()=>{let i=s.getStack();(!i||!i.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Vs.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 Uf(e){let[t,r]=Td(),a=(0,mu.useContext)(Ns);return(0,QL.jsx)(ty,{...e,layoutGroup:a,switchLayoutGroup:(0,mu.useContext)(Vd),isPresent:t,safeToRemove:r})}var $E={borderRadius:{...vi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:vi,borderTopRightRadius:vi,borderBottomLeftRadius:vi,borderBottomRightRadius:vi,boxShadow:JL};function YL(e,t,r){let a=be(e)?e:ka(e);return a.start(pi("",a,t,r)),a.animation}function ZL(e){return e instanceof SVGElement&&e.tagName!=="svg"}var eI=(e,t)=>e.depth-t.depth;var Vf=class{constructor(){this.children=[],this.isDirty=!1}add(t){ni(this.children,t),this.isDirty=!0}remove(t){si(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(eI),this.isDirty=!1,this.children.forEach(t)}};function tI(e,t){let r=Ct.now(),a=({timestamp:o})=>{let n=o-r;n>=t&&(ar(a),e(n-t))};return re.read(a,!0),()=>ar(a)}var nI=["TopLeft","TopRight","BottomLeft","BottomRight"],WE=nI.length,rI=e=>typeof e=="string"?parseFloat(e):e,aI=e=>typeof e=="number"||z.test(e);function sI(e,t,r,a,o,n){o?(e.opacity=le(0,r.opacity!==void 0?r.opacity:1,GE(a)),e.opacityExit=le(t.opacity!==void 0?t.opacity:1,0,KE(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<WE;s++){let i=`border${nI[s]}Radius`,l=oI(t,i),u=oI(r,i);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||aI(l)===aI(u)?(e[i]=Math.max(le(rI(l),rI(u),a),0),(_t.test(u)||_t.test(l))&&(e[i]+="%")):e[i]=u}(t.rotate||r.rotate)&&(e.rotate=le(t.rotate||0,r.rotate||0,a))}function oI(e,t){return e[t]!==void 0?e[t]:e.borderRadius}var GE=iI(0,.5,ff),KE=iI(.5,.95,ye);function iI(e,t,r){return a=>a<e?0:a>t?1:r(rr(e,t,a))}function lI(e,t){e.min=t.min,e.max=t.max}function nr(e,t){lI(e.x,t.x),lI(e.y,t.y)}function ry(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function uI(e,t,r,a,o){return e-=t,e=pu(e,1/r,a),o!==void 0&&(e=pu(e,1/o,a)),e}function XE(e,t=0,r=1,a=.5,o,n=e,s=e){if(_t.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=uI(e.min,t,r,i,o),e.max=uI(e.max,t,r,i,o)}function cI(e,t,[r,a,o],n,s){XE(e,t[r],t[a],t[o],t.scale,n,s)}var JE=["x","scaleX","originX"],QE=["y","scaleY","originY"];function ay(e,t,r,a){cI(e.x,t,JE,r?r.x:void 0,a?a.x:void 0),cI(e.y,t,QE,r?r.y:void 0,a?a.y:void 0)}function dI(e){return e.translate===0&&e.scale===1}function oy(e){return dI(e.x)&&dI(e.y)}function fI(e,t){return e.min===t.min&&e.max===t.max}function mI(e,t){return fI(e.x,t.x)&&fI(e.y,t.y)}function pI(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function ny(e,t){return pI(e.x,t.x)&&pI(e.y,t.y)}function sy(e){return pt(e.x)/pt(e.y)}function iy(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var jf=class{constructor(){this.members=[]}add(t){ni(this.members,t),t.scheduleRender()}remove(t){if(si(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 hI(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:h,skewY:v}=r;u&&(a=`perspective(${u}px) ${a}`),c&&(a+=`rotate(${c}deg) `),d&&(a+=`rotateX(${d}deg) `),f&&(a+=`rotateY(${f}deg) `),h&&(a+=`skewX(${h}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 Tn={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},hu=typeof window<"u"&&window.MotionDebug!==void 0,ly=["","X","Y","Z"],YE={visibility:"hidden"},gI=1e3,ZE=0;function uy(e,t,r,a){let{latestValues:o}=t;o[e]&&(r[e]=o[e],t.setStaticValue(e,0),a&&(a[e]=0))}function LI(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let r=of(t);if(window.MotionHasOptimisedAnimation(r,"transform")){let{layout:o,layoutId:n}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",re,!(o||n))}let{parent:a}=e;a&&!a.hasCheckedOptimisedAppear&&LI(a)}function qf({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:a,resetTransform:o}){return class{constructor(s={},i=t?.()){this.id=ZE++,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,hu&&(Tn.totalNodes=Tn.resolvedTargetDeltas=Tn.recalculatedProjection=0),this.nodes.forEach(rD),this.nodes.forEach(iD),this.nodes.forEach(lD),this.nodes.forEach(aD),hu&&window.MotionDebug.record(Tn)},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 Vf)}addEventListener(s,i){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new xo),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=ZL(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=tI(f,250),yi.hasAnimatedSinceResize&&(yi.hasAnimatedSinceResize=!1,this.nodes.forEach(vI))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeTargetChanged:h,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let x=this.options.transition||c.getDefaultTransition()||pD,{onLayoutAnimationStart:C,onLayoutAnimationComplete:g}=c.getProps(),p=!this.targetLayout||!ny(this.targetLayout,v)||h,y=!f&&h;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||y||f&&(p||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,y);let b={...go(x,"layout"),onPlay:C,onComplete:g};(c.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b)}else f||vI(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,ar(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(uD),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&&LI(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(yI);return}this.isUpdating||this.nodes.forEach(nD),this.isUpdating=!1,this.nodes.forEach(sD),this.nodes.forEach(eD),this.nodes.forEach(tD),this.clearAllSnapshots();let i=Ct.now();He.delta=ft(0,1e3/60,i-He.timestamp),He.timestamp=i,He.isProcessing=!0,Nd.update.process(He),Nd.preRender.process(He),Nd.render.process(He),He.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Vs.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(oD),this.sharedNodes.forEach(cD)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,re.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){re.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=_e(),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&&!oy(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;s&&(i||_a(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)),mD(l),{animationId:this.root.animationId,measuredBox:i,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var s;let{visualElement:i}=this.options;if(!i)return _e();let l=i.measureViewportBox();if(!(((s=this.scroll)===null||s===void 0?void 0:s.wasRoot)||this.path.some(hD))){let{scroll:c}=this.root;c&&(ko(l.x,c.offset.x),ko(l.y,c.offset.y))}return l}removeElementScroll(s){var i;let l=_e();if(nr(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&&nr(l,s),ko(l.x,d.offset.x),ko(l.y,d.offset.y))}return l}applyTransform(s,i=!1){let l=_e();nr(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&&Pn(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),_a(c.latestValues)&&Pn(l,c.latestValues)}return _a(this.latestValues)&&Pn(l,this.latestValues),l}removeTransform(s){let i=_e();nr(i,s);for(let l=0;l<this.path.length;l++){let u=this.path[l];if(!u.instance||!_a(u.latestValues))continue;Df(u.latestValues)&&u.updateSnapshot();let c=_e(),d=u.measurePageBox();nr(c,d),ay(i,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return _a(this.latestValues)&&ay(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!==He.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=He.timestamp,!this.targetDelta&&!this.relativeTarget){let h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=_e(),this.relativeTargetOrigin=_e(),gi(this.relativeTargetOrigin,this.layout.layoutBox,h.layout.layoutBox),nr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=_e(),this.targetWithTransforms=_e()),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):nr(this.target,this.layout.layoutBox),Zg(this.target,this.targetDelta)):nr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;let h=this.getClosestProjectingParent();h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=_e(),this.relativeTargetOrigin=_e(),gi(this.relativeTargetOrigin,this.target,h.target),nr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}hu&&Tn.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Df(this.parent.latestValues)||Qg(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===He.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;nr(this.layoutCorrected,this.layout.layoutBox);let f=this.treeScale.x,h=this.treeScale.y;WL(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=_e());let{target:v}=i;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ry(this.prevProjectionDelta.x,this.projectionDelta.x),ry(this.prevProjectionDelta.y,this.projectionDelta.y)),hi(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!iy(this.projectionDelta.x,this.prevProjectionDelta.x)||!iy(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v)),hu&&Tn.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=kn(),this.projectionDelta=kn(),this.projectionDeltaWithTransform=kn()}setAnimationOrigin(s,i=!1){let l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},d=kn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!i;let f=_e(),h=l?l.source:void 0,v=this.layout?this.layout.source:void 0,x=h!==v,C=this.getStack(),g=!C||C.members.length<=1,p=!!(x&&!g&&this.options.crossfade===!0&&!this.path.some(fD));this.animationProgress=0;let y;this.mixTargetDelta=b=>{let L=b/1e3;xI(d.x,s.x,L),xI(d.y,s.y,L),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(gi(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),dD(this.relativeTarget,this.relativeTargetOrigin,f,L),y&&mI(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=_e()),nr(y,this.relativeTarget)),x&&(this.animationValues=c,sI(c,u,this.latestValues,L,p,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&&(ar(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=re.update(()=>{yi.hasAnimatedSinceResize=!0,this.currentAnimation=YL(0,gI,{...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(gI),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&&II(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||_e();let d=pt(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+d;let f=pt(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+f}nr(i,l),Pn(i,c),hi(this.projectionDeltaWithTransform,this.layoutCorrected,i,c)}}registerSharedNode(s,i){this.sharedNodes.has(s)||this.sharedNodes.set(s,new jf),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&&uy("z",s,u,this.animationValues);for(let c=0;c<ly.length;c++)uy(`rotate${ly[c]}`,s,u,this.animationValues),uy(`skew${ly[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 YE;let u={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=zs(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=zs(s?.pointerEvents)||""),this.hasProjected&&!_a(this.latestValues)&&(x.transform=c?c({},""):"none",this.hasProjected=!1),x}let f=d.animationValues||d.latestValues;this.applyTransformsToTarget(),u.transform=hI(this.projectionDeltaWithTransform,this.treeScale,f),c&&(u.transform=c(f,u.transform));let{x:h,y:v}=this.projectionDelta;u.transformOrigin=`${h.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 Qs){if(f[x]===void 0)continue;let{correct:C,applyTo:g}=Qs[x],p=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]]=p}else u[x]=p}return this.options.layoutId&&(u.pointerEvents=d===this?zs(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(yI),this.root.sharedNodes.clear()}}}function eD(e){e.updateLayout()}function tD(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"?qt(d=>{let f=s?r.measuredBox[d]:r.layoutBox[d],h=pt(f);f.min=a[d].min,f.max=f.min+h}):II(n,r.layoutBox,a)&&qt(d=>{let f=s?r.measuredBox[d]:r.layoutBox[d],h=pt(a[d]);f.max=f.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+h)});let i=kn();hi(i,a,r.layoutBox);let l=kn();s?hi(l,e.applyTransform(o,!0),r.measuredBox):hi(l,a,r.layoutBox);let u=!oy(i),c=!1;if(!e.resumeFrom){let d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){let{snapshot:f,layout:h}=d;if(f&&h){let v=_e();gi(v,r.layoutBox,f.layoutBox);let x=_e();gi(x,a,h.layoutBox),ny(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 rD(e){hu&&Tn.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 aD(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function oD(e){e.clearSnapshot()}function yI(e){e.clearMeasurements()}function nD(e){e.isLayoutDirty=!1}function sD(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function vI(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function iD(e){e.resolveTargetDelta()}function lD(e){e.calcProjection()}function uD(e){e.resetSkewAndRotation()}function cD(e){e.removeLeadSnapshot()}function xI(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 wI(e,t,r,a){e.min=le(t.min,r.min,a),e.max=le(t.max,r.max,a)}function dD(e,t,r,a){wI(e.x,t.x,r.x,a),wI(e.y,t.y,r.y,a)}function fD(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var pD={duration:.45,ease:[.4,0,.1,1]},SI=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),CI=SI("applewebkit/")&&!SI("chrome/")?Math.round:ye;function bI(e){e.min=CI(e.min),e.max=CI(e.max)}function mD(e){bI(e.x),bI(e.y)}function II(e,t,r){return e==="position"||e==="preserve-aspect"&&!IL(sy(t),sy(r),.2)}function hD(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}var kI=qf({attachResizeListener:(e,t)=>Pa(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0});var cy={current:void 0},Hf=qf({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!cy.current){let e=new kI({});e.mount(window),e.setOptions({layoutScroll:!0}),cy.current=e}return cy.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"});var PI={pan:{Feature:Ff},drag:{Feature:Bf,ProjectionNode:Hf,MeasureLayout:Uf}};function TI(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&&re.postRender(()=>n(t,Ta(t)))}var zf=class extends st{mount(){let{current:t}=this.node;t&&(this.unmount=Pg(t,r=>(TI(this.node,r,"Start"),a=>TI(this.node,a,"End"))))}unmount(){}};var $f=class extends st{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=Xr(Pa(this.node.current,"focus",()=>this.onFocus()),Pa(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function _I(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&&re.postRender(()=>n(t,Ta(t)))}var Wf=class extends st{mount(){let{current:t}=this.node;t&&(this.unmount=_g(t,r=>(_I(this.node,r,"Start"),(a,{success:o})=>_I(this.node,a,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}};var fy=new WeakMap,dy=new WeakMap,gD=e=>{let t=fy.get(e.target);t&&t(e)},yD=e=>{e.forEach(gD)};function vD({root:e,...t}){let r=e||document;dy.has(r)||dy.set(r,{});let a=dy.get(r),o=JSON.stringify(t);return a[o]||(a[o]=new IntersectionObserver(yD,{root:e,...t})),a[o]}function AI(e,t,r){let a=vD(t);return fy.set(e,r),a.observe(e),()=>{fy.delete(e),a.unobserve(e)}}var xD={some:0,all:1},Gf=class extends st{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:xD[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 AI(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(wD(t,r))&&this.startObserver()}unmount(){}};function wD({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}var RI={inView:{Feature:Gf},tap:{Feature:Wf},focus:{Feature:$f},hover:{Feature:zf}};var EI={layout:{ProjectionNode:Hf,MeasureLayout:Uf}};var BI=O(Q(),1);var gu={current:null},Kf={current:!1};function DI(){if(Kf.current=!0,!!Bs)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>gu.current=e.matches;e.addListener(t),t()}else gu.current=!1}var SD=[...Fg,Ge,At],NI=e=>SD.find(vf(e));var py=new WeakMap;function MI(e,t,r){for(let a in t){let o=t[a],n=r[a];if(be(o))e.addValue(a,o);else if(be(n))e.addValue(a,ka(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,ka(s!==void 0?s:o,{owner:e}))}}for(let a in r)t[a]===void 0&&e.removeValue(a);return t}var OI=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Xf=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=bo,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 h=Ct.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,re.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=vn(r),this.isVariantNode=Bd(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);let{willChange:d,...f}=this.scrapeMotionValuesFromProps(r,{},this);for(let h in f){let v=f[h];l[h]!==void 0&&be(v)&&v.set(l[h],!1)}}mount(t){this.current=t,py.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)),Kf.current||DI(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:gu.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){py.delete(this.current),this.projection&&this.projection.unmount(),ar(this.notifyUpdate),ar(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=jt.has(t),o=r.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&re.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 Ca){let r=Ca[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):_e()}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<OI.length;a++){let o=OI[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=MI(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=ka(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"&&(yf(o)||mf(o))?o=parseFloat(o):!NI(o)&&At.test(r)&&(o=gf(t,r)),this.setBaseTarget(t,be(o)?o.get():o)),be(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=Hs(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&&!be(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 xo),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}};var xi=class extends Xf{constructor(){super(...arguments),this.KeyframeResolver=ci}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;be(t)&&(this.childSubscription=t.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}};function CD(e){return window.getComputedStyle(e)}var Jf=class extends xi{constructor(){super(...arguments),this.type="html",this.renderInstance=Wd}readValueFromInstance(t,r){if(jt.has(r)){let a=ui(r);return a&&a.default||0}else{let a=CD(t),o=(Hd(r)?a.getPropertyValue(r):a[r])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:r}){return ey(t,r)}build(t,r,a){Gs(t,r,a.transformTemplate)}scrapeMotionValuesFromProps(t,r,a){return Ys(t,r,a)}};var Qf=class extends xi{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=_e}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(jt.has(r)){let a=ui(r);return a&&a.default||0}return r=Gd.has(r)?r:Us(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,a){return Jd(t,r,a)}build(t,r,a){Ks(t,r,this.isSVGTag,a.transformTemplate)}renderInstance(t,r,a,o){Kd(t,r,a,o)}mount(t){this.isSVGTag=Js(t.tagName),super.mount(t)}};var FI=(e,t)=>qs(e)?new Qf(t):new Jf(t,{allowProjection:e!==BI.Fragment});var UI=pb({...mL,...RI,...PI,...EI},FI);var my=DC(UI);var yu=O(ue(),1);function VI({x:e,y:t,visible:r,onClick:a=!1}){return(0,yu.jsx)(yg,{children:r&&(0,yu.jsx)(my.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,yu.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,yu.jsx)("path",{d:"M3 3L10.07 19.97L12.58 12.58L19.97 10.07L3 3Z",fill:"#C4B5FD"})})})})}var wi=O(Q(),1);function jI(){let[e,t]=wi.useState({x:0,y:0,visible:!1,onClick:!1}),r=wi.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=wi.useCallback(()=>{t(n=>({...n,visible:!1}))},[]),o=wi.useCallback(()=>{t(n=>({...n,visible:!0}))},[]);return{cursorState:e,moveTo:r,hide:a,show:o}}var Si=O(ue(),1);function bt({className:e,...t}){return(0,Si.jsx)("div",{"data-slot":"card",className:er("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Jr({className:e,...t}){return(0,Si.jsx)("div",{"data-slot":"card-header",className:er("@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 Qr({className:e,...t}){return(0,Si.jsx)("div",{"data-slot":"card-title",className:er("leading-none font-semibold",e),...t})}function hy({className:e,...t}){return(0,Si.jsx)("div",{"data-slot":"card-description",className:er("text-muted-foreground text-sm",e),...t})}function Lt({className:e,...t}){return(0,Si.jsx)("div",{"data-slot":"card-content",className:er("px-6",e),...t})}var S=O(ue(),1),gy=e=>new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),Yf=(e,t="USD")=>new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e),yy=e=>{switch(e){case"Enterprise":return fn;case"Professional":return Xl;default:return Vl}},Zf=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 vu({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:nt};case"failed":return{color:"bg-red-50 text-red-700 border-red-200",icon:Ar};case"pending":return{color:"bg-amber-50 text-amber-700 border-amber-200",icon:cn};case"refunded":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:Rs};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:_r}}if(t==="subscription")switch(n){case"active":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:nt};case"cancelled":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:Ar};case"past_due":return{color:"bg-red-50 text-red-700 border-red-200",icon:_r};case"trialing":return{color:"bg-blue-50 text-blue-700 border-blue-200",icon:cn};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:_r}}switch(n){case"active":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:nt};case"inactive":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:Ar};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:_r}}})(),o=a.icon;return(0,S.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,S.jsx)(o,{className:"h-3 w-3"}),e]})}function bD({subscription:e}){let t=yy(e.plan);return(0,S.jsxs)(bt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)("div",{className:`h-1 ${e.status==="active"?"bg-emerald-500":e.status==="past_due"?"bg-red-500":"bg-slate-300"}`}),(0,S.jsx)(Jr,{className:"pb-3",children:(0,S.jsxs)("div",{className:"flex items-start justify-between",children:[(0,S.jsxs)("div",{className:"space-y-1",children:[(0,S.jsxs)(Qr,{className:"text-base font-semibold text-gray-900 flex items-center gap-2",children:[(0,S.jsx)(dn,{className:"h-4 w-4 text-gray-500"}),e.id]}),e.customer_email&&(0,S.jsxs)(hy,{className:"text-sm text-gray-500 flex items-center gap-1.5",children:[(0,S.jsx)(_s,{className:"h-3 w-3"}),e.customer_email]})]}),(0,S.jsx)(vu,{status:e.status,type:"subscription"})]})}),(0,S.jsx)(Lt,{className:"pt-0",children:(0,S.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,S.jsxs)("div",{className:"space-y-3",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Plan"}),(0,S.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium border ${Zf(e.plan)}`,children:[(0,S.jsx)(t,{className:"h-3 w-3"}),e.plan]})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Billing"}),(0,S.jsxs)("div",{className:"text-sm font-medium text-gray-900",children:[Yf(e.amount,e.currency)," / ",e.billing_cycle]})]})]}),(0,S.jsxs)("div",{className:"space-y-3",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Current Period"}),(0,S.jsxs)("div",{className:"text-sm text-gray-700",children:[gy(e.current_period_start)," - ",gy(e.current_period_end)]})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Created"}),(0,S.jsx)("div",{className:"text-sm text-gray-700",children:gy(e.created_at)})]})]})]})})]})}function LD({subscriptions:e,maxItems:t=5}){let r=e.slice(0,t),a=e.length>t;return e.length===0?(0,S.jsx)(bt,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Lt,{className:"py-8 text-center",children:[(0,S.jsx)(dn,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No subscriptions found"})]})}):(0,S.jsxs)(bt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Jr,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Qr,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(dn,{className:"h-4 w-4"}),e.length," Subscription",e.length!==1?"s":""]})}),(0,S.jsxs)(Lt,{className:"p-0",children:[(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:r.map(o=>{let n=yy(o.plan);return(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,S.jsx)("div",{className:`p-2 rounded-lg ${Zf(o.plan).replace("text-","text-").replace("border-","bg-").split(" ")[0]}`,children:(0,S.jsx)(n,{className:"h-4 w-4"})}),(0,S.jsxs)("div",{className:"min-w-0",children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:o.customer_email||o.customer_id}),(0,S.jsxs)("div",{className:"text-xs text-gray-500",children:[o.plan," \xB7 ",Yf(o.amount,o.currency),"/",o.billing_cycle]})]})]}),(0,S.jsx)(vu,{status:o.status,type:"subscription"})]})},o.id)})}),a&&(0,S.jsx)("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-100 text-center",children:(0,S.jsxs)("span",{className:"text-xs text-gray-500",children:["+",e.length-t," more subscription",e.length-t!==1?"s":""]})})]})]})}function ID({customer:e}){let t=yy(e.subscription);return(0,S.jsxs)(bt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)("div",{className:`h-1 ${e.status==="active"?"bg-emerald-500":"bg-slate-300"}`}),(0,S.jsx)(Jr,{className:"pb-3",children:(0,S.jsxs)("div",{className:"flex items-start justify-between",children:[(0,S.jsx)("div",{className:"flex items-center gap-3",children:(0,S.jsxs)("div",{children:[(0,S.jsx)(Qr,{className:"text-base font-semibold text-gray-900",children:e.name}),(0,S.jsxs)(hy,{className:"text-sm text-gray-500 flex items-center gap-1",children:[(0,S.jsx)(_s,{className:"h-3 w-3"}),e.email]})]})}),(0,S.jsx)(vu,{status:e.status,type:"customer"})]})}),(0,S.jsx)(Lt,{className:"pt-0",children:(0,S.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,S.jsxs)("div",{className:"space-y-3",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Plan"}),(0,S.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium border ${Zf(e.subscription)}`,children:[(0,S.jsx)(t,{className:"h-3 w-3"}),e.subscription]})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Revenue"}),(0,S.jsxs)("div",{className:"text-sm font-medium text-gray-900 flex items-center gap-1",children:[(0,S.jsx)(pn,{className:"h-3 w-3 text-emerald-500"}),e.revenue]})]})]}),(0,S.jsxs)("div",{className:"space-y-3",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Location"}),(0,S.jsxs)("div",{className:"text-sm text-gray-700 flex items-center gap-1",children:[(0,S.jsx)(As,{className:"h-3 w-3 text-gray-400"}),e.location||"Not specified"]})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Customer Since"}),(0,S.jsxs)("div",{className:"text-sm text-gray-700 flex items-center gap-1",children:[(0,S.jsx)(ql,{className:"h-3 w-3 text-gray-400"}),e.joinDate]})]})]})]})})]})}function kD({customers:e,maxItems:t=5}){let r=e.slice(0,t),a=e.length>t;return e.length===0?(0,S.jsx)(bt,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Lt,{className:"py-8 text-center",children:[(0,S.jsx)(Ds,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No customers found"})]})}):(0,S.jsxs)(bt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Jr,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Qr,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(Ds,{className:"h-4 w-4"}),e.length," Customer",e.length!==1?"s":""]})}),(0,S.jsxs)(Lt,{className:"p-0",children:[(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:r.map(o=>(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsx)("div",{className:"flex items-center gap-3 min-w-0",children:(0,S.jsxs)("div",{className:"min-w-0",children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:o.name}),(0,S.jsx)("div",{className:"text-xs text-gray-500 truncate",children:o.email})]})}),(0,S.jsxs)("div",{className:"flex items-center gap-2",children:[(0,S.jsx)("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${Zf(o.subscription)}`,children:o.subscription}),(0,S.jsx)(vu,{status:o.status,type:"customer"})]})]})},o.id))}),a&&(0,S.jsx)("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-100 text-center",children:(0,S.jsxs)("span",{className:"text-xs text-gray-500",children:["+",e.length-t," more customer",e.length-t!==1?"s":""]})})]})]})}function qI({transactions:e,maxItems:t=5}){let r=e.slice(0,t),a=e.length>t;return e.length===0?(0,S.jsx)(bt,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Lt,{className:"py-8 text-center",children:[(0,S.jsx)(pn,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No transactions found"})]})}):(0,S.jsxs)(bt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Jr,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Qr,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(pn,{className:"h-4 w-4"}),e.length," Transaction",e.length!==1?"s":""]})}),(0,S.jsxs)(Lt,{className:"p-0",children:[(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:r.map(o=>(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,S.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,S.jsx)(nt,{className:"h-4 w-4 text-emerald-600"}):o.status==="failed"?(0,S.jsx)(Ar,{className:"h-4 w-4 text-red-600"}):o.status==="refunded"?(0,S.jsx)(Rs,{className:"h-4 w-4 text-slate-600"}):(0,S.jsx)(cn,{className:"h-4 w-4 text-amber-600"})}),(0,S.jsxs)("div",{className:"min-w-0",children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:o.customer}),(0,S.jsxs)("div",{className:"text-xs text-gray-500",children:[o.date,o.decline_reason&&(0,S.jsxs)("span",{className:"text-red-500 ml-2",children:["\xB7 ",o.decline_reason]})]})]})]}),(0,S.jsxs)("div",{className:"flex items-center gap-3",children:[(0,S.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,S.jsx)(vu,{status:o.status,type:"transaction"})]})]})},o.id))}),a&&(0,S.jsx)("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-100 text-center",children:(0,S.jsxs)("span",{className:"text-xs text-gray-500",children:["+",e.length-t," more transaction",e.length-t!==1?"s":""]})})]})]})}function PD({apiKeys:e}){return e.length===0?(0,S.jsx)(bt,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Lt,{className:"py-8 text-center",children:[(0,S.jsx)(Ts,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No API keys found"})]})}):(0,S.jsxs)(bt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Jr,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Qr,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(Ts,{className:"h-4 w-4"}),e.length," API Key",e.length!==1?"s":""]})}),(0,S.jsx)(Lt,{className:"p-0",children:(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((t,r)=>(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"min-w-0",children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900",children:t.name}),(0,S.jsxs)("div",{className:"text-xs text-gray-500 font-mono",children:[t.key.slice(0,12),"...",t.key.slice(-4)]})]}),(0,S.jsxs)("div",{className:"text-xs text-gray-500",children:["Last used: ",t.lastUsed]})]})},r))})})]})}function TD({sessions:e}){let t=r=>{let a=r.toLowerCase();return a.includes("mobile")||a.includes("iphone")||a.includes("android")?Gl:zl};return e.length===0?(0,S.jsx)(bt,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Lt,{className:"py-8 text-center",children:[(0,S.jsx)(Es,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No active sessions"})]})}):(0,S.jsxs)(bt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Jr,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Qr,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(Es,{className:"h-4 w-4"}),e.length," Active Session",e.length!==1?"s":""]})}),(0,S.jsx)(Lt,{className:"p-0",children:(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((r,a)=>{let o=t(r.device);return(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"flex items-center gap-3",children:[(0,S.jsx)("div",{className:"p-2 rounded-lg bg-gray-100",children:(0,S.jsx)(o,{className:"h-4 w-4 text-gray-600"})}),(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900",children:r.device}),(0,S.jsxs)("div",{className:"text-xs text-gray-500 flex items-center gap-1",children:[(0,S.jsx)(As,{className:"h-3 w-3"}),r.location]})]})]}),(0,S.jsx)("div",{className:"text-xs text-gray-500",children:r.time})]})},a)})})})]})}function _D({stats:e}){return(0,S.jsxs)(bt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Jr,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Qr,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(Kl,{className:"h-4 w-4"}),"Dashboard Overview"]})}),(0,S.jsx)(Lt,{className:"p-4",children:(0,S.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[e.revenue&&(0,S.jsxs)("div",{className:"p-3 rounded-lg bg-emerald-50 border border-emerald-100",children:[(0,S.jsx)("div",{className:"text-xs text-emerald-600 font-medium mb-1",children:"Revenue"}),(0,S.jsx)("div",{className:"text-lg font-bold text-emerald-700",children:Yf(e.revenue.total)}),e.revenue.change!==0&&(0,S.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,S.jsxs)("div",{className:"p-3 rounded-lg bg-blue-50 border border-blue-100",children:[(0,S.jsx)("div",{className:"text-xs text-blue-600 font-medium mb-1",children:"Subscriptions"}),(0,S.jsxs)("div",{className:"text-lg font-bold text-blue-700",children:[e.subscriptions.active," active"]}),(0,S.jsxs)("div",{className:"text-xs text-blue-600",children:[e.subscriptions.total," total"]})]}),e.customers&&(0,S.jsxs)("div",{className:"p-3 rounded-lg bg-purple-50 border border-purple-100",children:[(0,S.jsx)("div",{className:"text-xs text-purple-600 font-medium mb-1",children:"Customers"}),(0,S.jsx)("div",{className:"text-lg font-bold text-purple-700",children:e.customers.total}),e.customers.new>0&&(0,S.jsxs)("div",{className:"text-xs text-purple-600",children:["+",e.customers.new," new this period"]})]}),e.transactions&&(0,S.jsxs)("div",{className:"p-3 rounded-lg bg-amber-50 border border-amber-100",children:[(0,S.jsx)("div",{className:"text-xs text-amber-600 font-medium mb-1",children:"Transactions"}),(0,S.jsxs)("div",{className:"text-lg font-bold text-amber-700",children:[e.transactions.successful," successful"]}),e.transactions.failed>0&&(0,S.jsxs)("div",{className:"text-xs text-red-600",children:[e.transactions.failed," failed"]})]})]})})]})}function AD({customers:e}){return e.length===0?(0,S.jsx)(bt,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Lt,{className:"py-8 text-center",children:[(0,S.jsx)(fn,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No top customers data"})]})}):(0,S.jsxs)(bt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Jr,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Qr,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(fn,{className:"h-4 w-4 text-amber-500"}),"Top Customers"]})}),(0,S.jsx)(Lt,{className:"p-0",children:(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((t,r)=>(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,S.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,S.jsxs)("div",{className:"min-w-0",children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:t.name}),(0,S.jsx)("div",{className:"text-xs text-gray-500 truncate",children:t.email})]})]}),(0,S.jsx)("div",{className:"text-sm font-semibold text-emerald-600",children:typeof t.revenue=="number"?Yf(t.revenue):t.revenue})]})},r))})})]})}function HI({type:e,data:t}){if(!t)return null;switch(e){case"subscription":return(0,S.jsx)(bD,{subscription:t});case"subscriptions":let r=t.subscriptions||t||[];return(0,S.jsx)(LD,{subscriptions:Array.isArray(r)?r:[r]});case"customer":return(0,S.jsx)(ID,{customer:t.customer||t});case"customers":let a=t.customers||t||[];return(0,S.jsx)(kD,{customers:Array.isArray(a)?a:[a]});case"transactions":let o=t.transactions||t||[];return(0,S.jsx)(qI,{transactions:Array.isArray(o)?o:[o]});case"transaction":return(0,S.jsx)(qI,{transactions:[t],maxItems:1});case"dashboard_stats":return(0,S.jsx)(_D,{stats:t});case"top_customers":let n=t.customers||t||[];return(0,S.jsx)(AD,{customers:Array.isArray(n)?n:[n]});case"api_keys":let s=t.api_keys||t||[];return(0,S.jsx)(PD,{apiKeys:Array.isArray(s)?s:[s]});case"sessions":let i=t.sessions||t||[];return(0,S.jsx)(TD,{sessions:Array.isArray(i)?i:[i]});default:return null}}var _n=O(ue(),1);function zI({className:e=""}){return(0,_n.jsx)("div",{className:`flex items-center gap-1 px-4 py-3 ${e}`,children:(0,_n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,_n.jsx)("span",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"0ms",animationDuration:"600ms"}}),(0,_n.jsx)("span",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"150ms",animationDuration:"600ms"}}),(0,_n.jsx)("span",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"300ms",animationDuration:"600ms"}})]})})}var m=O(ue(),1),RD="http://localhost:5002",WI=340;function ED(e){return e.replace(/\\\\n/g,`
58
+ `),()=>{document.head.removeChild(c)}},[t]),(0,bC.jsx)(mg,{isPresent:t,childRef:a,sizeRef:o,children:Pd.cloneElement(e,{ref:a})})}var kC=({children:e,initial:t,isPresent:r,onExitComplete:a,custom:o,presenceAffectsLayout:n,mode:s})=>{let i=Ms(l1),l=(0,hn.useId)(),u=(0,hn.useCallback)(d=>{i.set(d,!0);for(let f of i.values())if(!f)return;a&&a()},[i,a]),c=(0,hn.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,hn.useMemo)(()=>{i.forEach((d,f)=>i.set(f,!1))},[r]),IC.useEffect(()=>{!r&&!i.size&&a&&a()},[r]),s==="popLayout"&&(e=(0,hg.jsx)(LC,{isPresent:r,children:e})),(0,hg.jsx)(co.Provider,{value:c,children:e})};function l1(){return new Map}var fo=O(Q(),1);function Td(e=!0){let t=(0,fo.useContext)(co);if(t===null)return[!0,null];let{isPresent:r,onExitComplete:a,register:o}=t,n=(0,fo.useId)();(0,fo.useEffect)(()=>{e&&o(n)},[e]);let s=(0,fo.useCallback)(()=>e&&a&&a(n),[n,a,e]);return!r&&a?[!1,s]:[!0]}var _d=O(Q(),1),Jl=e=>e.key||"";function gg(e){let t=[];return _d.Children.forEach(e,r=>{(0,_d.isValidElement)(r)&&t.push(r)}),t}var Ad=O(Q(),1);var Bs=typeof window<"u";var Rd=Bs?Ad.useLayoutEffect:Ad.useEffect;var yg=({children:e,custom:t,initial:r=!0,onExitComplete:a,presenceAffectsLayout:o=!0,mode:n="sync",propagate:s=!1})=>{let[i,l]=Td(s),u=(0,zr.useMemo)(()=>gg(e),[e]),c=s&&!i?[]:u.map(Jl),d=(0,zr.useRef)(!0),f=(0,zr.useRef)(u),h=Ms(()=>new Map),[v,x]=(0,zr.useState)(u),[C,g]=(0,zr.useState)(u);Rd(()=>{d.current=!1,f.current=u;for(let b=0;b<C.length;b++){let L=Jl(C[b]);c.includes(L)?h.delete(L):h.get(L)!==!0&&h.set(L,!1)}},[C,c.length,c.join("-")]);let p=[];if(u!==v){let b=[...u];for(let L=0;L<C.length;L++){let P=C[L],T=Jl(P);c.includes(T)||(b.splice(L,0,P),p.push(P))}n==="wait"&&p.length&&(b=p),g(gg(b)),x(u);return}let{forceRender:y}=(0,zr.useContext)(Ns);return(0,Ql.jsx)(Ql.Fragment,{children:C.map(b=>{let L=Jl(b),P=s&&!i?!1:u===C||c.includes(L),T=()=>{if(h.has(L))h.set(L,!0);else return;let A=!0;h.forEach(N=>{N||(A=!1)}),A&&(y?.(),g(f.current),s&&l?.(),a&&a())};return(0,Ql.jsx)(kC,{isPresent:P,initial:!d.current||r?void 0:!1,custom:P?void 0:t,presenceAffectsLayout:o,mode:n,onExitComplete:P?void 0:T,children:b},L)})})};var ye=e=>e;var Sa=ye,Er=ye;function gn(e){let t;return()=>(t===void 0&&(t=e()),t)}var rr=(e,t,r)=>{let a=t-e;return a===0?1:(r-e)/a};var qe=e=>e*1e3,dt=e=>e/1e3;var Fs={skipAnimations:!1,useManualTiming:!1};function PC(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 h=d&&a?t:r;return c&&n.add(u),h.has(u)||h.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 Ed=["read","resolveKeyframes","update","preRender","render","postRender"],u1=40;function Dd(e,t){let r=!1,a=!0,o={delta:0,timestamp:0,isProcessing:!1},n=()=>r=!0,s=Ed.reduce((g,p)=>(g[p]=PC(n),g),{}),{read:i,resolveKeyframes:l,update:u,preRender:c,render:d,postRender:f}=s,h=()=>{let g=Fs.useManualTiming?o.timestamp:performance.now();r=!1,o.delta=a?1e3/60:Math.max(Math.min(g-o.timestamp,u1),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(h))},v=()=>{r=!0,a=!0,o.isProcessing||e(h)};return{schedule:Ed.reduce((g,p)=>{let y=s[p];return g[p]=(b,L=!1,P=!1)=>(r||v(),y.schedule(b,L,P)),g},{}),cancel:g=>{for(let p=0;p<Ed.length;p++)s[Ed[p]].cancel(g)},state:o,steps:s}}var{schedule:re,cancel:ar,state:He,steps:Nd}=Dd(typeof requestAnimationFrame<"u"?requestAnimationFrame:ye,!0);var TC=O(Q(),1),Md=(0,TC.createContext)({strict:!1});var _C={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"]},Ca={};for(let e in _C)Ca[e]={isEnabled:t=>_C[e].some(r=>!!t[r])};function AC(e){for(let t in e)Ca[t]={...Ca[t],...e[t]}}var c1=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 Yl(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||c1.has(e)}var RC=e=>!Yl(e);function d1(e){e&&(RC=t=>t.startsWith("on")?!Yl(t):e(t))}try{d1(pk("@emotion/is-prop-valid").default)}catch{}function EC(e,t,r){let a={};for(let o in e)o==="values"&&typeof e.values=="object"||(RC(o)||r===!0&&Yl(o)||!t&&!Yl(o)||e.draggable&&o.startsWith("onDrag"))&&(a[o]=e[o]);return a}function DC(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 jd=O(ue(),1);var js=O(Q(),1);var NC=O(Q(),1),po=(0,NC.createContext)({});var Fd=O(Q(),1);function ba(e){return typeof e=="string"||Array.isArray(e)}function mo(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}var Od=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Zl=["initial",...Od];function yn(e){return mo(e.animate)||Zl.some(t=>ba(e[t]))}function Bd(e){return!!(yn(e)||e.variants)}function MC(e,t){if(yn(e)){let{initial:r,animate:a}=e;return{initial:r===!1||ba(r)?r:void 0,animate:ba(a)?a:void 0}}return e.inherit!==!1?t:{}}function BC(e){let{initial:t,animate:r}=MC(e,(0,Fd.useContext)(po));return(0,Fd.useMemo)(()=>({initial:t,animate:r}),[OC(t),OC(r)])}function OC(e){return Array.isArray(e)?e.join(" "):e}var FC=Symbol.for("motionComponentSymbol");var UC=O(Q(),1);function La(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function VC(e,t,r){return(0,UC.useCallback)(a=>{a&&e.onMount&&e.onMount(a),t&&(a?t.mount(a):t.unmount()),r&&(typeof r=="function"?r(a):La(r)&&(r.current=a))},[t])}var Vt=O(Q(),1);var Us=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase();var f1="framerAppearId",Ud="data-"+Us(f1);var{schedule:Vs,cancel:jU}=Dd(queueMicrotask,!1);var jC=O(Q(),1),Vd=(0,jC.createContext)({});function qC(e,t,r,a,o){var n,s;let{visualElement:i}=(0,Vt.useContext)(po),l=(0,Vt.useContext)(Md),u=(0,Vt.useContext)(co),c=(0,Vt.useContext)(Os).reducedMotion,d=(0,Vt.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,h=(0,Vt.useContext)(Vd);f&&!f.projection&&o&&(f.type==="html"||f.type==="svg")&&p1(d.current,r,o,h);let v=(0,Vt.useRef)(!1);(0,Vt.useInsertionEffect)(()=>{f&&v.current&&f.update(r,u)});let x=r[Ud],C=(0,Vt.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(),Vs.render(f.render),C.current&&f.animationState&&f.animationState.animateChanges())}),(0,Vt.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 p1(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:HC(e.parent)),e.projection.setOptions({layoutId:o,layout:n,alwaysMeasureLayout:!!s||i&&La(i),visualElement:e,animationType:typeof n=="string"?n:"both",initialPromotionConfig:a,layoutScroll:l,layoutRoot:u})}function HC(e){if(e)return e.options.allowProjection!==!1?e.projection:HC(e.parent)}function zC({preloadedFeatures:e,createVisualElement:t,useRender:r,useVisualState:a,Component:o}){var n,s;e&&AC(e);function i(u,c){let d,f={...(0,js.useContext)(Os),...u,layoutId:m1(u)},{isStatic:h}=f,v=BC(u),x=a(u,h);if(!h&&Bs){h1(f,e);let C=g1(f);d=C.MeasureLayout,v.visualElement=qC(o,x,f,t,C.ProjectionNode)}return(0,jd.jsxs)(po.Provider,{value:v,children:[d&&v.visualElement?(0,jd.jsx)(d,{visualElement:v.visualElement,...f}):null,r(o,u,VC(x,v.visualElement,c),x,h,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,js.forwardRef)(i);return l[FC]=o,l}function m1({layoutId:e}){let t=(0,js.useContext)(Ns).id;return t&&e!==void 0?t+"-"+e:e}function h1(e,t){let r=(0,js.useContext)(Md).strict}function g1(e){let{drag:t,layout:r}=Ca;if(!t&&!r)return{};let a={...t,...r};return{MeasureLayout:t?.isEnabled(e)||r?.isEnabled(e)?a.MeasureLayout:void 0,ProjectionNode:a.ProjectionNode}}var $C=["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 qs(e){return typeof e!="string"||e.includes("-")?!1:!!($C.indexOf(e)>-1||/[A-Z]/u.test(e))}var vg=O(Q(),1);function WC(e){let t=[{},{}];return e?.values.forEach((r,a)=>{t[0][a]=r.get(),t[1][a]=r.getVelocity()}),t}function Hs(e,t,r,a){if(typeof t=="function"){let[o,n]=WC(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]=WC(a);t=t(r!==void 0?r:e.custom,o,n)}return t}var eu=e=>Array.isArray(e);var GC=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),KC=e=>eu(e)?e[e.length-1]||0:e;var be=e=>!!(e&&e.getVelocity);function zs(e){let t=be(e)?e.get():e;return GC(t)?t.toValue():t}function y1({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:r},a,o,n){let s={latestValues:v1(a,o,n,e),renderState:t()};return r&&(s.onMount=i=>r({props:a,current:i,...s}),s.onUpdate=i=>r(i)),s}var qd=e=>(t,r)=>{let a=(0,vg.useContext)(po),o=(0,vg.useContext)(co),n=()=>y1(e,t,a,o);return r?n():Ms(n)};function v1(e,t,r,a){let o={},n=a(e,{});for(let f in n)o[f]=zs(n[f]);let{initial:s,animate:i}=e,l=yn(e),u=Bd(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"&&!mo(d)){let f=Array.isArray(d)?d:[d];for(let h=0;h<f.length;h++){let v=Hs(e,f[h]);if(v){let{transitionEnd:x,transition:C,...g}=v;for(let p in g){let y=g[p];if(Array.isArray(y)){let b=c?y.length-1:0;y=y[b]}y!==null&&(o[p]=y)}for(let p in x)o[p]=x[p]}}}return o}var $r=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],jt=new Set($r);var XC=e=>t=>typeof t=="string"&&t.startsWith(e),Hd=XC("--"),x1=XC("var(--"),$s=e=>x1(e)?w1.test(e.split("/*")[0].trim()):!1,w1=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;var zd=(e,t)=>t&&typeof e=="number"?t.transform(e):e;var ft=(e,t,r)=>r>t?t:r<e?e:r;var Wr={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ia={...Wr,transform:e=>ft(0,1,e)},tu={...Wr,default:1};var ru=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Gr=ru("deg"),_t=ru("%"),z=ru("px"),JC=ru("vh"),QC=ru("vw"),xg={..._t,parse:e=>_t.parse(e)/100,transform:e=>_t.transform(e*100)};var YC={borderWidth:z,borderTopWidth:z,borderRightWidth:z,borderBottomWidth:z,borderLeftWidth:z,borderRadius:z,radius:z,borderTopLeftRadius:z,borderTopRightRadius:z,borderBottomRightRadius:z,borderBottomLeftRadius:z,width:z,maxWidth:z,height:z,maxHeight:z,top:z,right:z,bottom:z,left:z,padding:z,paddingTop:z,paddingRight:z,paddingBottom:z,paddingLeft:z,margin:z,marginTop:z,marginRight:z,marginBottom:z,marginLeft:z,backgroundPositionX:z,backgroundPositionY:z};var ZC={rotate:Gr,rotateX:Gr,rotateY:Gr,rotateZ:Gr,scale:tu,scaleX:tu,scaleY:tu,scaleZ:tu,skew:Gr,skewX:Gr,skewY:Gr,distance:z,translateX:z,translateY:z,translateZ:z,x:z,y:z,z,perspective:z,transformPerspective:z,opacity:Ia,originX:xg,originY:xg,originZ:z};var wg={...Wr,transform:Math.round};var Ws={...YC,...ZC,zIndex:wg,size:z,fillOpacity:Ia,strokeOpacity:Ia,numOctaves:wg};var S1={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},C1=$r.length;function eb(e,t,r){let a="",o=!0;for(let n=0;n<C1;n++){let s=$r[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=zd(i,Ws[s]);if(!l){o=!1;let c=S1[s]||s;a+=`${c}(${u}) `}r&&(t[s]=u)}}return a=a.trim(),r?a=r(t,o?"":a):o&&(a="none"),a}function Gs(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(jt.has(l)){s=!0;continue}else if(Hd(l)){o[l]=u;continue}else{let c=zd(u,Ws[l]);l.startsWith("origin")?(i=!0,n[l]=c):a[l]=c}}if(t.transform||(s||r?a.transform=eb(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 b1={offset:"stroke-dashoffset",array:"stroke-dasharray"},L1={offset:"strokeDashoffset",array:"strokeDasharray"};function tb(e,t,r=1,a=0,o=!0){e.pathLength=1;let n=o?b1:L1;e[n.offset]=z.transform(-a);let s=z.transform(t),i=z.transform(r);e[n.array]=`${s} ${i}`}function rb(e,t,r){return typeof e=="string"?e:z.transform(t+r*e)}function ab(e,t,r){let a=rb(t,e.x,e.width),o=rb(r,e.y,e.height);return`${a} ${o}`}function Ks(e,{attrX:t,attrY:r,attrScale:a,originX:o,originY:n,pathLength:s,pathSpacing:i=1,pathOffset:l=0,...u},c,d){if(Gs(e,u,d),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:f,style:h,dimensions:v}=e;f.transform&&(v&&(h.transform=f.transform),delete f.transform),v&&(o!==void 0||n!==void 0||h.transform)&&(h.transformOrigin=ab(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&&tb(f,s,i,l,!1)}var Xs=()=>({style:{},transform:{},transformOrigin:{},vars:{}});var $d=()=>({...Xs(),attrs:{}});var Js=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Wd(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 Gd=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 Kd(e,t,r,a){Wd(e,t,void 0,a);for(let o in t.attrs)e.setAttribute(Gd.has(o)?o:Us(o),t.attrs[o])}var Qs={};function ob(e){Object.assign(Qs,e)}function Xd(e,{layout:t,layoutId:r}){return jt.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!Qs[e]||e==="opacity")}function Ys(e,t,r){var a;let{style:o}=e,n={};for(let s in o)(be(o[s])||t.style&&be(t.style[s])||Xd(s,e)||((a=r?.getValue(s))===null||a===void 0?void 0:a.liveStyle)!==void 0)&&(n[s]=o[s]);return n}function Jd(e,t,r){let a=Ys(e,t,r);for(let o in e)if(be(e[o])||be(t[o])){let n=$r.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;a[n]=e[o]}return a}function I1(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 nb=["x","y","width","height","cx","cy","r"],sb={useVisualState:qd({scrapeMotionValuesFromProps:Jd,createRenderState:$d,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(jt.has(i)){n=!0;break}}if(!n)return;let s=!t;if(t)for(let i=0;i<nb.length;i++){let l=nb[i];e[l]!==t[l]&&(s=!0)}s&&re.read(()=>{I1(r,a),re.render(()=>{Ks(a,o,Js(r.tagName),e.transformTemplate),Kd(r,a)})})}})};var ib={useVisualState:qd({scrapeMotionValuesFromProps:Ys,createRenderState:Xs})};var Zs=O(Q(),1);var lb=O(Q(),1);function Sg(e,t,r){for(let a in t)!be(t[a])&&!Xd(a,r)&&(e[a]=t[a])}function k1({transformTemplate:e},t){return(0,lb.useMemo)(()=>{let r=Xs();return Gs(r,t,e),Object.assign({},r.vars,r.style)},[t])}function P1(e,t){let r=e.style||{},a={};return Sg(a,r,e),Object.assign(a,k1(e,t)),a}function ub(e,t){let r={},a=P1(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 cb=O(Q(),1);function db(e,t,r,a){let o=(0,cb.useMemo)(()=>{let n=$d();return Ks(n,t,Js(a),e.transformTemplate),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let n={};Sg(n,e.style,e),o.style={...n,...o.style}}return o}function fb(e=!1){return(r,a,o,{latestValues:n},s)=>{let l=(qs(r)?db:ub)(a,n,s,r),u=EC(a,typeof r=="string",e),c=r!==Zs.Fragment?{...u,...l,ref:o}:{},{children:d}=a,f=(0,Zs.useMemo)(()=>be(d)?d.get():d,[d]);return(0,Zs.createElement)(r,{...c,children:f})}}function pb(e,t){return function(a,{forwardMotionProps:o}={forwardMotionProps:!1}){let s={...qs(a)?sb:ib,preloadedFeatures:e,useRender:fb(o),createVisualElement:t,Component:a};return zC(s)}}function Cg(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 ho(e,t,r){let a=e.getProps();return Hs(a,t,r!==void 0?r:a.custom,e)}var bg=gn(()=>window.ScrollTimeline!==void 0);var au=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(bg()&&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 ou=class extends au{then(t,r){return Promise.all(this.animations).then(t).catch(r)}};function go(e,t){return e?e[t]||e.default||e:void 0}function ei(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 yo(e){return typeof e=="function"}function nu(e,t){e.timeline=t,e.onfinish=null}var ti=e=>Array.isArray(e)&&typeof e[0]=="number";var Ig={linearEasing:void 0};function mb(e,t){let r=gn(e);return()=>{var a;return(a=Ig[t])!==null&&a!==void 0?a:r()}}var vo=mb(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");var su=(e,t,r=10)=>{let a="",o=Math.max(Math.round(t/r),2);for(let n=0;n<o;n++)a+=e(rr(0,o-1,n))+", ";return`linear(${a.substring(0,a.length-2)})`};function Yd(e){return!!(typeof e=="function"&&vo()||!e||typeof e=="string"&&(e in Qd||vo())||ti(e)||Array.isArray(e)&&e.every(Yd))}var ri=([e,t,r,a])=>`cubic-bezier(${e}, ${t}, ${r}, ${a})`,Qd={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ri([0,.65,.55,1]),circOut:ri([.55,0,1,.45]),backIn:ri([.31,.01,.66,-.59]),backOut:ri([.33,1.53,.69,.99])};function ai(e,t){if(e)return typeof e=="function"&&vo()?su(e,t):ti(e)?ri(e):Array.isArray(e)?e.map(r=>ai(r,t)||Qd.easeOut):Qd[e]}var or={x:!1,y:!1};function oi(){return or.x||or.y}function kg(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 Zd(e,t){let r=kg(e),a=new AbortController,o={passive:!0,...t,signal:a.signal};return[r,o,()=>a.abort()]}function hb(e){return t=>{t.pointerType==="touch"||oi()||e(t)}}function Pg(e,t,r={}){let[a,o,n]=Zd(e,r),s=hb(i=>{let{target:l}=i,u=t(i);if(typeof u!="function"||!l)return;let c=hb(d=>{u(d),l.removeEventListener("pointerleave",c)});l.addEventListener("pointerleave",c,o)});return a.forEach(i=>{i.addEventListener("pointerenter",s,o)}),n}var ef=(e,t)=>t?e===t?!0:ef(e,t.parentElement):!1;var vn=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;var T1=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function gb(e){return T1.has(e.tagName)||e.tabIndex!==-1}var xn=new WeakSet;function yb(e){return t=>{t.key==="Enter"&&e(t)}}function Tg(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}var vb=(e,t)=>{let r=e.currentTarget;if(!r)return;let a=yb(()=>{if(xn.has(r))return;Tg(r,"down");let o=yb(()=>{Tg(r,"up")}),n=()=>Tg(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 xb(e){return vn(e)&&!oi()}function _g(e,t,r={}){let[a,o,n]=Zd(e,r),s=i=>{let l=i.currentTarget;if(!xb(i)||xn.has(l))return;xn.add(l);let u=t(i),c=(h,v)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),!(!xb(h)||!xn.has(l))&&(xn.delete(l),typeof u=="function"&&u(h,{success:v}))},d=h=>{c(h,r.useGlobalTarget||ef(l,h.target))},f=h=>{c(h,!1)};window.addEventListener("pointerup",d,o),window.addEventListener("pointercancel",f,o)};return a.forEach(i=>{!gb(i)&&i.getAttribute("tabindex")===null&&(i.tabIndex=0),(r.useGlobalTarget?window:i).addEventListener("pointerdown",s,o),i.addEventListener("focus",u=>vb(u,o),o)}),n}function Ag(e){return e==="x"||e==="y"?or[e]?null:(or[e]=!0,()=>{or[e]=!1}):or.x||or.y?null:(or.x=or.y=!0,()=>{or.x=or.y=!1})}var tf=new Set(["width","height","top","left","right","bottom",...$r]);var rf;function A1(){rf=void 0}var Ct={now:()=>(rf===void 0&&Ct.set(He.isProcessing||Fs.useManualTiming?He.timestamp:performance.now()),rf),set:e=>{rf=e,queueMicrotask(A1)}};function ni(e,t){e.indexOf(t)===-1&&e.push(t)}function si(e,t){let r=e.indexOf(t);r>-1&&e.splice(r,1)}var xo=class{constructor(){this.subscriptions=[]}add(t){return ni(this.subscriptions,t),()=>si(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 af(e,t){return t?e*(1e3/t):0}var Sb=30,R1=e=>!isNaN(parseFloat(e)),Cb={current:void 0},Rg=class{constructor(t,r={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(a,o=!0)=>{let n=Ct.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=Ct.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=R1(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 xo);let a=this.events[t].add(r);return t==="change"?()=>{a(),re.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 Cb.current&&Cb.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let t=Ct.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Sb)return 0;let r=Math.min(this.updatedAt-this.prevUpdatedAt,Sb);return af(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 ka(e,t){return new Rg(e,t)}function E1(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,ka(r))}function bb(e,t){let r=ho(e,t),{transitionEnd:a={},transition:o={},...n}=r||{};n={...n,...a};for(let s in n){let i=KC(n[s]);E1(e,s,i)}}function Lb(e){return!!(be(e)&&e.add)}function iu(e,t){let r=e.getValue("willChange");if(Lb(r))return r.add(t)}function of(e){return e.props[Ud]}var nf={current:!1};var Ib=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,D1=1e-7,N1=12;function M1(e,t,r,a,o){let n,s,i=0;do s=t+(r-t)/2,n=Ib(s,a,o)-e,n>0?r=s:t=s;while(Math.abs(n)>D1&&++i<N1);return s}function wo(e,t,r,a){if(e===t&&r===a)return ye;let o=n=>M1(n,0,1,e,r);return n=>n===0||n===1?n:Ib(o(n),t,a)}var sf=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2;var lf=e=>t=>1-e(1-t);var Eg=wo(.33,1.53,.69,.99),lu=lf(Eg),uf=sf(lu);var cf=e=>(e*=2)<1?.5*lu(e):.5*(2-Math.pow(2,-10*(e-1)));var df=e=>1-Math.sin(Math.acos(e)),ff=lf(df),pf=sf(df);var mf=e=>/^0[^.\s]+$/u.test(e);function kb(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||mf(e):!0}var So=e=>Math.round(e*1e5)/1e5;var ii=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Pb(e){return e==null}var Tb=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var li=(e,t)=>r=>!!(typeof r=="string"&&Tb.test(r)&&r.startsWith(e)||t&&!Pb(r)&&Object.prototype.hasOwnProperty.call(r,t)),hf=(e,t,r)=>a=>{if(typeof a!="string")return a;let[o,n,s,i]=a.match(ii);return{[e]:parseFloat(o),[t]:parseFloat(n),[r]:parseFloat(s),alpha:i!==void 0?parseFloat(i):1}};var O1=e=>ft(0,255,e),Dg={...Wr,transform:e=>Math.round(O1(e))},Kr={test:li("rgb","red"),parse:hf("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:a=1})=>"rgba("+Dg.transform(e)+", "+Dg.transform(t)+", "+Dg.transform(r)+", "+So(Ia.transform(a))+")"};function B1(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 uu={test:li("#"),parse:B1,transform:Kr.transform};var Co={test:li("hsl","hue"),parse:hf("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:a=1})=>"hsla("+Math.round(e)+", "+_t.transform(So(t))+", "+_t.transform(So(r))+", "+So(Ia.transform(a))+")"};var Ge={test:e=>Kr.test(e)||uu.test(e)||Co.test(e),parse:e=>Kr.test(e)?Kr.parse(e):Co.test(e)?Co.parse(e):uu.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Kr.transform(e):Co.transform(e)};var _b=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function F1(e){var t,r;return isNaN(e)&&typeof e=="string"&&(((t=e.match(ii))===null||t===void 0?void 0:t.length)||0)+(((r=e.match(_b))===null||r===void 0?void 0:r.length)||0)>0}var Rb="number",Eb="color",U1="var",V1="var(",Ab="${}",j1=/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 wn(e){let t=e.toString(),r=[],a={color:[],number:[],var:[]},o=[],n=0,i=t.replace(j1,l=>(Ge.test(l)?(a.color.push(n),o.push(Eb),r.push(Ge.parse(l))):l.startsWith(V1)?(a.var.push(n),o.push(U1),r.push(l)):(a.number.push(n),o.push(Rb),r.push(parseFloat(l))),++n,Ab)).split(Ab);return{values:r,split:i,indexes:a,types:o}}function Db(e){return wn(e).values}function Nb(e){let{split:t,types:r}=wn(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===Rb?n+=So(o[s]):i===Eb?n+=Ge.transform(o[s]):n+=o[s]}return n}}var q1=e=>typeof e=="number"?0:e;function H1(e){let t=Db(e);return Nb(e)(t.map(q1))}var At={test:F1,parse:Db,createTransformer:Nb,getAnimatableNone:H1};var z1=new Set(["brightness","contrast","saturate","opacity"]);function $1(e){let[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;let[a]=r.match(ii)||[];if(!a)return e;let o=r.replace(a,""),n=z1.has(t)?1:0;return a!==r&&(n*=100),t+"("+n+o+")"}var W1=/\b([a-z-]*)\(.*?\)/gu,cu={...At,getAnimatableNone:e=>{let t=e.match(W1);return t?t.map($1).join(" "):e}};var G1={...Ws,color:Ge,backgroundColor:Ge,outlineColor:Ge,fill:Ge,stroke:Ge,borderColor:Ge,borderTopColor:Ge,borderRightColor:Ge,borderBottomColor:Ge,borderLeftColor:Ge,filter:cu,WebkitFilter:cu},ui=e=>G1[e];function gf(e,t){let r=ui(e);return r!==cu&&(r=At),r.getAnimatableNone?r.getAnimatableNone(t):void 0}var K1=new Set(["auto","none","0"]);function Mb(e,t,r){let a=0,o;for(;a<e.length&&!o;){let n=e[a];typeof n=="string"&&!K1.has(n)&&wn(n).values.length&&(o=e[a]),a++}if(o&&r)for(let n of t)e[n]=gf(r,o)}var Ng=e=>e===Wr||e===z,Ob=(e,t)=>parseFloat(e.split(", ")[t]),Bb=(e,t)=>(r,{transform:a})=>{if(a==="none"||!a)return 0;let o=a.match(/^matrix3d\((.+)\)$/u);if(o)return Ob(o[1],t);{let n=a.match(/^matrix\((.+)\)$/u);return n?Ob(n[1],e):0}},X1=new Set(["x","y","z"]),J1=$r.filter(e=>!X1.has(e));function Fb(e){let t=[];return J1.forEach(r=>{let a=e.getValue(r);a!==void 0&&(t.push([r,a.get()]),a.set(r.startsWith("scale")?1:0))}),t}var Sn={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:Bb(4,13),y:Bb(5,14)};Sn.translateX=Sn.x;Sn.translateY=Sn.y;var Cn=new Set,Mg=!1,Og=!1;function Ub(){if(Og){let e=Array.from(Cn).filter(a=>a.needsMeasurement),t=new Set(e.map(a=>a.element)),r=new Map;t.forEach(a=>{let o=Fb(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)})}Og=!1,Mg=!1,Cn.forEach(e=>e.complete()),Cn.clear()}function Vb(){Cn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Og=!0)})}function jb(){Vb(),Ub()}var bo=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?(Cn.add(this),Mg||(Mg=!0,re.read(Vb),re.resolveKeyframes(Ub))):(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),Cn.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Cn.delete(this))}resume(){this.isComplete||this.scheduleResolve()}};var yf=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);var Q1=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Y1(e){let t=Q1.exec(e);if(!t)return[,];let[,r,a,o]=t;return[`--${r??a}`,o]}var Z1=4;function Bg(e,t,r=1){Er(r<=Z1,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);let[a,o]=Y1(e);if(!a)return;let n=window.getComputedStyle(t).getPropertyValue(a);if(n){let s=n.trim();return yf(s)?parseFloat(s):s}return $s(o)?Bg(o,t,r+1):o}var vf=e=>t=>t.test(e);var qb={test:e=>e==="auto",parse:e=>e};var Fg=[Wr,z,_t,Gr,QC,JC,qb],Ug=e=>Fg.find(vf(e));var ci=class extends bo{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(),$s(u))){let c=Bg(u,r.current);c!==void 0&&(t[l]=c),l===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!tf.has(a)||t.length!==2)return;let[o,n]=t,s=Ug(o),i=Ug(n);if(s!==i)if(Ng(s)&&Ng(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++)kb(t[o])&&a.push(o);a.length&&Mb(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=Sn[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]=Sn[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 Vg=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(At.test(e)||e==="0")&&!e.startsWith("url("));function eE(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 Hb(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=Vg(o,t),i=Vg(n,t);return Sa(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:eE(e)||(r==="spring"||yo(r))&&a}var tE=e=>e!==null;function Lo(e,{repeat:t,repeatType:r="loop"},a){let o=e.filter(tE),n=t&&r!=="loop"&&t%2===1?0:o.length-1;return!n||a===void 0?o[n]:a}var rE=40,di=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=Ct.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>rE?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&jb(),this._resolved}onKeyframesResolved(t,r){this.resolvedAt=Ct.now(),this.hasAttemptedResolve=!0;let{name:a,type:o,velocity:n,delay:s,onComplete:i,onUpdate:l,isGenerator:u}=this.options;if(!u&&!Hb(t,a,o,n))if(nf.current||!s){l&&l(Lo(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 jg(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 zb({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=jg(l,i,e+1/3),n=jg(l,i,e),s=jg(l,i,e-1/3)}return{red:Math.round(o*255),green:Math.round(n*255),blue:Math.round(s*255),alpha:a}}function fi(e,t){return r=>r>0?t:e}var qg=(e,t,r)=>{let a=e*e,o=r*(t*t-a)+a;return o<0?0:Math.sqrt(o)},aE=[uu,Kr,Co],oE=e=>aE.find(t=>t.test(e));function $b(e){let t=oE(e);if(Sa(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let r=t.parse(e);return t===Co&&(r=zb(r)),r}var Hg=(e,t)=>{let r=$b(e),a=$b(t);if(!r||!a)return fi(e,t);let o={...r};return n=>(o.red=qg(r.red,a.red,n),o.green=qg(r.green,a.green,n),o.blue=qg(r.blue,a.blue,n),o.alpha=le(r.alpha,a.alpha,n),Kr.transform(o))};var nE=(e,t)=>r=>t(e(r)),Xr=(...e)=>e.reduce(nE);var xf=new Set(["none","hidden"]);function Wb(e,t){return xf.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function sE(e,t){return r=>le(e,t,r)}function wf(e){return typeof e=="number"?sE:typeof e=="string"?$s(e)?fi:Ge.test(e)?Hg:uE:Array.isArray(e)?Gb:typeof e=="object"?Ge.test(e)?Hg:iE:fi}function Gb(e,t){let r=[...e],a=r.length,o=e.map((n,s)=>wf(n)(n,t[s]));return n=>{for(let s=0;s<a;s++)r[s]=o[s](n);return r}}function iE(e,t){let r={...e,...t},a={};for(let o in r)e[o]!==void 0&&t[o]!==void 0&&(a[o]=wf(e[o])(e[o],t[o]));return o=>{for(let n in a)r[n]=a[n](o);return r}}function lE(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 uE=(e,t)=>{let r=At.createTransformer(t),a=wn(e),o=wn(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?xf.has(e)&&!o.values.length||xf.has(t)&&!a.values.length?Wb(e,t):Xr(Gb(lE(a,o),o.values),r):(Sa(!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.`),fi(e,t))};function Sf(e,t,r){return typeof e=="number"&&typeof t=="number"&&typeof r=="number"?le(e,t,r):wf(e)(e,t)}var cE=5;function Cf(e,t,r){let a=Math.max(t-cE,0);return af(r-e(a),t-a)}var Te={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 zg=.001;function Kb({duration:e=Te.duration,bounce:t=Te.bounce,velocity:r=Te.velocity,mass:a=Te.mass}){let o,n;Sa(e<=qe(Te.maxDuration),"Spring duration must be 10 seconds or less");let s=1-t;s=ft(Te.minDamping,Te.maxDamping,s),e=ft(Te.minDuration,Te.maxDuration,dt(e)),s<1?(o=u=>{let c=u*s,d=c*e,f=c-r,h=bf(u,s),v=Math.exp(-d);return zg-f/h*v},n=u=>{let d=u*s*e,f=d*r+r,h=Math.pow(s,2)*Math.pow(u,2)*e,v=Math.exp(-d),x=bf(Math.pow(u,2),s);return(-o(u)+zg>0?-1:1)*((f-h)*v)/x}):(o=u=>{let c=Math.exp(-u*e),d=(u-r)*e+1;return-zg+c*d},n=u=>{let c=Math.exp(-u*e),d=(r-u)*(e*e);return c*d});let i=5/e,l=fE(o,n,i);if(e=qe(e),isNaN(l))return{stiffness:Te.stiffness,damping:Te.damping,duration:e};{let u=Math.pow(l,2)*a;return{stiffness:u,damping:s*2*Math.sqrt(a*u),duration:e}}}var dE=12;function fE(e,t,r){let a=r;for(let o=1;o<dE;o++)a=a-e(a)/t(a);return a}function bf(e,t){return e*Math.sqrt(1-t*t)}var pE=["duration","bounce"],mE=["stiffness","damping","mass"];function Xb(e,t){return t.some(r=>e[r]!==void 0)}function hE(e){let t={velocity:Te.velocity,stiffness:Te.stiffness,damping:Te.damping,mass:Te.mass,isResolvedFromDuration:!1,...e};if(!Xb(e,mE)&&Xb(e,pE))if(e.visualDuration){let r=e.visualDuration,a=2*Math.PI/(r*1.2),o=a*a,n=2*ft(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Te.mass,stiffness:o,damping:n}}else{let r=Kb(e);t={...t,...r,mass:Te.mass},t.isResolvedFromDuration=!0}return t}function Lf(e=Te.visualDuration,t=Te.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:h}=hE({...r,velocity:-dt(r.velocity||0)}),v=f||0,x=u/(2*Math.sqrt(l*c)),C=s-n,g=dt(Math.sqrt(l/c)),p=Math.abs(C)<5;a||(a=p?Te.restSpeed.granular:Te.restSpeed.default),o||(o=p?Te.restDelta.granular:Te.restDelta.default);let y;if(x<1){let L=bf(g,x);y=P=>{let T=Math.exp(-x*g*P);return s-T*((v+x*g*C)/L*Math.sin(L*P)+C*Math.cos(L*P))}}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=P=>{let T=Math.exp(-x*g*P),A=Math.min(L*P,300);return s-T*((v+x*g*C)*Math.sinh(A)+L*C*Math.cosh(A))/L}}let b={calculatedDuration:h&&d||null,next:L=>{let P=y(L);if(h)i.done=L>=d;else{let T=0;x<1&&(T=L===0?qe(v):Cf(y,L,P));let A=Math.abs(T)<=a,N=Math.abs(s-P)<=o;i.done=A&&N}return i.value=i.done?s:P,i},toString:()=>{let L=Math.min(ei(b),2e4),P=su(T=>b.next(L*T).value,L,30);return L+"ms "+P}};return b}function $g({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},h=A=>i!==void 0&&A<i||l!==void 0&&A>l,v=A=>i===void 0?l:l===void 0||Math.abs(i-A)<Math.abs(l-A)?i:l,x=r*t,C=d+x,g=s===void 0?C:s(C);g!==C&&(x=g-d);let p=A=>-x*Math.exp(-A/a),y=A=>g+p(A),b=A=>{let N=p(A),j=y(A);f.done=Math.abs(N)<=u,f.value=f.done?g:j},L,P,T=A=>{h(f.value)&&(L=A,P=Lf({keyframes:[f.value,v(f.value)],velocity:Cf(y,A,f.value),damping:o,stiffness:n,restDelta:u,restSpeed:c}))};return T(0),{calculatedDuration:null,next:A=>{let N=!1;return!P&&L===void 0&&(N=!0,b(A),T(A)),L!==void 0&&A>=L?P.next(A-L):(!N&&b(A),f)}}}var Jb=wo(.42,0,1,1),Qb=wo(0,0,.58,1),If=wo(.42,0,.58,1);var Yb=e=>Array.isArray(e)&&typeof e[0]!="number";var Zb={linear:ye,easeIn:Jb,easeInOut:If,easeOut:Qb,circIn:df,circInOut:pf,circOut:ff,backIn:lu,backInOut:uf,backOut:Eg,anticipate:cf},Wg=e=>{if(ti(e)){Er(e.length===4,"Cubic bezier arrays must contain four numerical values.");let[t,r,a,o]=e;return wo(t,r,a,o)}else if(typeof e=="string")return Er(Zb[e]!==void 0,`Invalid easing type '${e}'`),Zb[e];return e};function gE(e,t,r){let a=[],o=r||Sf,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]||ye:t;i=Xr(l,i)}a.push(i)}return a}function eL(e,t,{clamp:r=!0,ease:a,mixer:o}={}){let n=e.length;if(Er(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=gE(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=rr(e[d],e[d+1],c);return i[d](f)};return r?c=>u(ft(e[0],e[n-1],c)):u}function tL(e,t){let r=e[e.length-1];for(let a=1;a<=t;a++){let o=rr(0,t,a);e.push(le(r,1,o))}}function rL(e){let t=[0];return tL(t,e.length-1),t}function aL(e,t){return e.map(r=>r*t)}function yE(e,t){return e.map(()=>t||If).splice(0,e.length-1)}function du({duration:e=300,keyframes:t,times:r,ease:a="easeInOut"}){let o=Yb(a)?a.map(Wg):Wg(a),n={done:!1,value:t[0]},s=aL(r&&r.length===t.length?r:rL(t),e),i=eL(s,t,{ease:Array.isArray(o)?o:yE(t,o)});return{calculatedDuration:e,next:l=>(n.value=i(l),n.done=l>=e,n)}}var oL=e=>{let t=({timestamp:r})=>e(r);return{start:()=>re.update(t,!0),stop:()=>ar(t),now:()=>He.isProcessing?He.timestamp:Ct.now()}};var vE={decay:$g,inertia:$g,tween:du,keyframes:du,spring:Lf},xE=e=>e/100,bn=class extends di{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||bo,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=yo(r)?r:vE[r]||du,l,u;i!==du&&typeof t[0]!="number"&&(l=Xr(xE,Sf(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=ei(c));let{calculatedDuration:d}=c,f=d+o,h=f*(a+1)-o;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:d,resolvedDuration:f,totalDuration:h}}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:A}=this.options;return{done:!0,value:A[A.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:h,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),p=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(h){let A=Math.min(this.currentTime,c)/d,N=Math.floor(A),j=A%1;!j&&A>=1&&(j=1),j===1&&N--,N=Math.min(N,h+1),N%2&&(v==="reverse"?(j=1-j,x&&(j-=x/d)):v==="mirror"&&(b=s)),y=ft(0,1,j)*d}let L=p?{done:!1,value:l[0]}:b.next(y);i&&(L.value=i(L.value));let{done:P}=L;!p&&u!==null&&(P=this.speed>=0?this.currentTime>=c:this.currentTime<=0);let T=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&P);return T&&o!==void 0&&(L.value=Lo(l,this.options,o)),C&&C(L.value),T&&this.finish(),L}get duration(){let{resolved:t}=this;return t?dt(t.calculatedDuration):0}get time(){return dt(this.currentTime)}set time(t){t=qe(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=dt(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;let{driver:t=oL,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 nL=new Set(["opacity","clipPath","filter","transform"]);function sL(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=ai(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 iL=gn(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));var kf=10,wE=2e4;function SE(e){return yo(e.type)||e.type==="spring"||!Yd(e.ease)}function CE(e,t){let r=new bn({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0}),a={done:!1,value:e[0]},o=[],n=0;for(;!a.done&&n<wE;)a=r.sample(n),o.push(a.value),n+=kf;return{times:void 0,keyframes:o,duration:n-kf,ease:"linear"}}var lL={anticipate:cf,backInOut:uf,circInOut:pf};function bE(e){return e in lL}var fu=class extends di{constructor(t){super(t);let{name:r,motionValue:a,element:o,keyframes:n}=this.options;this.resolver=new ci(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"&&vo()&&bE(n)&&(n=lL[n]),SE(this.options)){let{onComplete:d,onUpdate:f,motionValue:h,element:v,...x}=this.options,C=CE(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=sL(i.owner.current,l,t,{...this.options,duration:a,times:o,ease:n});return c.startTime=u??this.calcStartTime(),this.pendingTimeline?(nu(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{let{onComplete:d}=this.options;i.set(Lo(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 dt(r)}get time(){let{resolved:t}=this;if(!t)return 0;let{animation:r}=t;return dt(r.currentTime||0)}set time(t){let{resolved:r}=this;if(!r)return;let{animation:a}=r;a.currentTime=qe(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 ye;let{animation:a}=r;nu(a,t)}return ye}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,...h}=this.options,v=new bn({...h,keyframes:a,duration:o,type:n,ease:s,times:i,isGenerator:!0}),x=qe(this.time);u.setWithVelocity(v.sample(x-kf).value,v.sample(x).value,kf)}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 iL()&&a&&nL.has(a)&&!l&&!u&&!o&&n!=="mirror"&&s!==0&&i!=="inertia"}};var LE={type:"spring",stiffness:500,damping:25,restSpeed:10},IE=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),kE={type:"keyframes",duration:.8},PE={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},uL=(e,{keyframes:t})=>t.length>2?kE:jt.has(e)?e.startsWith("scale")?IE(t[1]):LE:PE;function cL({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 pi=(e,t,r,a={},o,n)=>s=>{let i=go(a,e)||{},l=i.delay||a.delay||0,{elapsed:u=0}=a;u=u-qe(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};cL(i)||(c={...c,...uL(e,c)}),c.duration&&(c.duration=qe(c.duration)),c.repeatDelay&&(c.repeatDelay=qe(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)),(nf.current||Fs.skipAnimations)&&(d=!0,c.duration=0,c.delay=0),d&&!n&&t.get()!==void 0){let f=Lo(c.keyframes,i);if(f!==void 0)return re.update(()=>{c.onUpdate(f),c.onComplete()}),new ou([])}return!n&&fu.supports(c)?new fu(c):new bn(c)};function TE({protectedKeys:e,needsAnimating:t},r){let a=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,a}function Pf(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),h=l[d];if(h===void 0||c&&TE(c,d))continue;let v={delay:r,...go(s||{},d)},x=!1;if(window.MotionHandoffAnimation){let g=of(e);if(g){let p=window.MotionHandoffAnimation(g,d,re);p!==null&&(v.startTime=p,x=!0)}}iu(e,d),f.start(pi(d,f,h,e.shouldReduceMotion&&tf.has(d)?{type:!1}:v,e,x));let C=f.animation;C&&u.push(C)}return i&&Promise.all(u).then(()=>{re.update(()=>{i&&bb(e,i)})}),u}function Tf(e,t,r={}){var a;let o=ho(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(Pf(e,o,r)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(u=0)=>{let{delayChildren:c=0,staggerChildren:d,staggerDirection:f}=n;return _E(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 _E(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(AE).forEach((u,c)=>{u.notify("AnimationStart",t),s.push(Tf(u,t,{...n,delay:r+l(c)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(s)}function AE(e,t){return e.sortNodePosition(t)}function dL(e,t,r={}){e.notify("AnimationStart",t);let a;if(Array.isArray(t)){let o=t.map(n=>Tf(e,n,r));a=Promise.all(o)}else if(typeof t=="string")a=Tf(e,t,r);else{let o=typeof t=="function"?ho(e,t,r.custom):t;a=Promise.all(Pf(e,o,r))}return a.then(()=>{e.notify("AnimationComplete",t)})}var RE=Zl.length;function Gg(e){if(!e)return;if(!e.isControllingVariants){let r=e.parent?Gg(e.parent)||{}:{};return e.props.initial!==void 0&&(r.initial=e.props.initial),r}let t={};for(let r=0;r<RE;r++){let a=Zl[r],o=e.props[a];(ba(o)||o===!1)&&(t[a]=o)}return t}var EE=[...Od].reverse(),DE=Od.length;function NE(e){return t=>Promise.all(t.map(({animation:r,options:a})=>dL(e,r,a)))}function pL(e){let t=NE(e),r=fL(),a=!0,o=l=>(u,c)=>{var d;let f=ho(e,c,l==="exit"?(d=e.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(f){let{transition:h,transitionEnd:v,...x}=f;u={...u,...x,...v}}return u};function n(l){t=l(e)}function s(l){let{props:u}=e,c=Gg(e.parent)||{},d=[],f=new Set,h={},v=1/0;for(let C=0;C<DE;C++){let g=EE[C],p=r[g],y=u[g]!==void 0?u[g]:c[g],b=ba(y),L=g===l?p.isActive:null;L===!1&&(v=C);let P=y===c[g]&&y!==u[g]&&b;if(P&&a&&e.manuallyAnimateOnMount&&(P=!1),p.protectedKeys={...h},!p.isActive&&L===null||!y&&!p.prevProp||mo(y)||typeof y=="boolean")continue;let T=ME(p.prevProp,y),A=T||g===l&&p.isActive&&!P&&b||C>v&&b,N=!1,j=Array.isArray(y)?y:[y],pe=j.reduce(o(g),{});L===!1&&(pe={});let{prevResolvedValues:ee={}}=p,ir={...ee,...pe},zt=ve=>{A=!0,f.has(ve)&&(N=!0,f.delete(ve)),p.needsAnimating[ve]=!0;let Ye=e.getValue(ve);Ye&&(Ye.liveStyle=!1)};for(let ve in ir){let Ye=pe[ve],mt=ee[ve];if(h.hasOwnProperty(ve))continue;let Aa=!1;eu(Ye)&&eu(mt)?Aa=!Cg(Ye,mt):Aa=Ye!==mt,Aa?Ye!=null?zt(ve):f.add(ve):Ye!==void 0&&f.has(ve)?zt(ve):p.protectedKeys[ve]=!0}p.prevProp=y,p.prevResolvedValues=pe,p.isActive&&(h={...h,...pe}),a&&e.blockInitialAnimation&&(A=!1),A&&(!(P&&T)||N)&&d.push(...j.map(ve=>({animation:ve,options:{type:g}})))}if(f.size){let C={};f.forEach(g=>{let p=e.getBaseTarget(g),y=e.getValue(g);y&&(y.liveStyle=!0),C[g]=p??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 h;return(h=f.animationState)===null||h===void 0?void 0:h.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=fL(),a=!0}}}function ME(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Cg(t,e):!1}function Ln(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function fL(){return{animate:Ln(!0),whileInView:Ln(),whileHover:Ln(),whileTap:Ln(),whileDrag:Ln(),whileFocus:Ln(),exit:Ln()}}var st=class{constructor(t){this.isMounted=!1,this.node=t}update(){}};var _f=class extends st{constructor(t){super(t),t.animationState||(t.animationState=pL(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();mo(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 OE=0,Af=class extends st{constructor(){super(...arguments),this.id=OE++}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 mL={animation:{Feature:_f},exit:{Feature:Af}};function Pa(e,t,r,a={passive:!0}){return e.addEventListener(t,r,a),()=>e.removeEventListener(t,r)}function Ta(e){return{point:{x:e.pageX,y:e.pageY}}}var hL=e=>t=>vn(t)&&e(t,Ta(t));function Io(e,t,r,a){return Pa(e,t,hL(r),a)}var gL=(e,t)=>Math.abs(e-t);function yL(e,t){let r=gL(e.x,t.x),a=gL(e.y,t.y);return Math.sqrt(r**2+a**2)}var mi=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=Xg(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,h=yL(d.offset,{x:0,y:0})>=3;if(!f&&!h)return;let{point:v}=d,{timestamp:x}=He;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=Kg(f,this.transformPagePoint),re.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();let{onEnd:h,onSessionEnd:v,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let C=Xg(d.type==="pointercancel"?this.lastMoveEventInfo:Kg(f,this.transformPagePoint),this.history);this.startEvent&&h&&h(d,C),v&&v(d,C)},!vn(t))return;this.dragSnapToOrigin=n,this.handlers=r,this.transformPagePoint=a,this.contextWindow=o||window;let s=Ta(t),i=Kg(s,this.transformPagePoint),{point:l}=i,{timestamp:u}=He;this.history=[{...l,timestamp:u}];let{onSessionStart:c}=r;c&&c(t,Xg(i,this.history)),this.removeListeners=Xr(Io(this.contextWindow,"pointermove",this.handlePointerMove),Io(this.contextWindow,"pointerup",this.handlePointerUp),Io(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),ar(this.updatePoint)}};function Kg(e,t){return t?{point:t(e.point)}:e}function vL(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Xg({point:e},t){return{point:e,delta:vL(e,xL(t)),offset:vL(e,BE(t)),velocity:FE(t,.1)}}function BE(e){return e[0]}function xL(e){return e[e.length-1]}function FE(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,a=null,o=xL(e);for(;r>=0&&(a=e[r],!(o.timestamp-a.timestamp>qe(t)));)r--;if(!a)return{x:0,y:0};let n=dt(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 bL=1e-4,UE=1-bL,VE=1+bL,LL=.01,jE=0-LL,qE=0+LL;function pt(e){return e.max-e.min}function IL(e,t,r){return Math.abs(e-t)<=r}function wL(e,t,r,a=.5){e.origin=a,e.originPoint=le(t.min,t.max,e.origin),e.scale=pt(r)/pt(t),e.translate=le(r.min,r.max,e.origin)-e.originPoint,(e.scale>=UE&&e.scale<=VE||isNaN(e.scale))&&(e.scale=1),(e.translate>=jE&&e.translate<=qE||isNaN(e.translate))&&(e.translate=0)}function hi(e,t,r,a){wL(e.x,t.x,r.x,a?a.originX:void 0),wL(e.y,t.y,r.y,a?a.originY:void 0)}function SL(e,t,r){e.min=r.min+t.min,e.max=e.min+pt(t)}function kL(e,t,r){SL(e.x,t.x,r.x),SL(e.y,t.y,r.y)}function CL(e,t,r){e.min=t.min-r.min,e.max=e.min+pt(t)}function gi(e,t,r){CL(e.x,t.x,r.x),CL(e.y,t.y,r.y)}function RL(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 PL(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 EL(e,{top:t,left:r,bottom:a,right:o}){return{x:PL(e.x,r,o),y:PL(e.y,t,a)}}function TL(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 DL(e,t){return{x:TL(e.x,t.x),y:TL(e.y,t.y)}}function NL(e,t){let r=.5,a=pt(e),o=pt(t);return o>a?r=rr(t.min,t.max-a,e.min):a>o&&(r=rr(e.min,e.max-o,t.min)),ft(0,1,r)}function ML(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 Rf=.35;function OL(e=Rf){return e===!1?e=0:e===!0&&(e=Rf),{x:_L(e,"left","right"),y:_L(e,"top","bottom")}}function _L(e,t,r){return{min:AL(e,t),max:AL(e,r)}}function AL(e,t){return typeof e=="number"?e:e[t]||0}var BL=()=>({translate:0,scale:1,origin:0,originPoint:0}),In=()=>({x:BL(),y:BL()}),FL=()=>({min:0,max:0}),_e=()=>({x:FL(),y:FL()});function qt(e){return[e("x"),e("y")]}function Ef({top:e,left:t,right:r,bottom:a}){return{x:{min:t,max:r},y:{min:e,max:a}}}function UL({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function VL(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 Jg(e){return e===void 0||e===1}function Df({scale:e,scaleX:t,scaleY:r}){return!Jg(e)||!Jg(t)||!Jg(r)}function _a(e){return Df(e)||Qg(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Qg(e){return jL(e.x)||jL(e.y)}function jL(e){return e&&e!=="0%"}function pu(e,t,r){let a=e-r,o=t*a;return r+o}function qL(e,t,r,a,o){return o!==void 0&&(e=pu(e,o,a)),pu(e,r,a)+t}function Yg(e,t=0,r=1,a,o){e.min=qL(e.min,t,r,a,o),e.max=qL(e.max,t,r,a,o)}function Zg(e,{x:t,y:r}){Yg(e.x,t.translate,t.scale,t.originPoint),Yg(e.y,r.translate,r.scale,r.originPoint)}var HL=.999999999999,zL=1.0000000000001;function WL(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&&kn(e,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,Zg(e,s)),a&&_a(n.latestValues)&&kn(e,n.latestValues))}t.x<zL&&t.x>HL&&(t.x=1),t.y<zL&&t.y>HL&&(t.y=1)}function ko(e,t){e.min=e.min+t,e.max=e.max+t}function $L(e,t,r,a,o=.5){let n=le(e.min,e.max,o);Yg(e,t,r,n,a)}function kn(e,t){$L(e.x,t.x,t.scaleX,t.scale,t.originX),$L(e.y,t.y,t.scaleY,t.scale,t.originY)}function ey(e,t){return Ef(VL(e.getBoundingClientRect(),t))}function GL(e,t,r){let a=ey(e,r),{scroll:o}=t;return o&&(ko(a.x,o.offset.x),ko(a.y,o.offset.y)),a}var Nf=({current:e})=>e?e.ownerDocument.defaultView:null;var HE=new WeakMap,Of=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=_e(),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(Ta(c).point)},n=(c,d)=>{let{drag:f,dragPropagation:h,onDragStart:v}=this.getProps();if(f&&!h&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ag(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),qt(C=>{let g=this.getAxisMotionValue(C).get()||0;if(_t.test(g)){let{projection:p}=this.visualElement;if(p&&p.layout){let y=p.layout.layoutBox[C];y&&(g=pt(y)*(parseFloat(g)/100))}}this.originPoint[C]=g}),v&&re.postRender(()=>v(c,d)),iu(this.visualElement,"transform");let{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},s=(c,d)=>{let{dragPropagation:f,dragDirectionLock:h,onDirectionLock:v,onDrag:x}=this.getProps();if(!f&&!this.openDragLock)return;let{offset:C}=d;if(h&&this.currentDirection===null){this.currentDirection=zE(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=()=>qt(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 mi(t,{onSessionStart:o,onStart:n,onMove:s,onSessionEnd:i,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:Nf(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&&re.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||!Mf(t,o,this.currentDirection))return;let n=this.getAxisMotionValue(t),s=this.originPoint[t]+a[t];this.constraints&&this.constraints[t]&&(s=RL(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&&La(r)?this.constraints||(this.constraints=this.resolveRefConstraints()):r&&o?this.constraints=EL(o.layoutBox,r):this.constraints=!1,this.elastic=OL(a),n!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&qt(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=ML(o.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){let{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!La(t))return!1;let a=t.current;Er(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=GL(a,o.root,this.visualElement.getTransformPagePoint()),s=DL(o.layout.layoutBox,n);if(r){let i=r(UL(s));this.hasMutatedConstraints=!!i,i&&(s=Ef(i))}return s}startAnimation(t){let{drag:r,dragMomentum:a,dragElastic:o,dragTransition:n,dragSnapToOrigin:s,onDragTransitionEnd:i}=this.getProps(),l=this.constraints||{},u=qt(c=>{if(!Mf(c,r,this.currentDirection))return;let d=l&&l[c]||{};s&&(d={min:0,max:0});let f=o?200:1e6,h=o?40:1e7,v={type:"inertia",velocity:a?t[c]:0,bounceStiffness:f,bounceDamping:h,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 iu(this.visualElement,t),a.start(pi(t,a,0,r,this.visualElement,!1))}stopAnimation(){qt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){qt(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){qt(r=>{let{drag:a}=this.getProps();if(!Mf(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(!La(r)||!a||!this.constraints)return;this.stopAnimation();let o={x:0,y:0};qt(s=>{let i=this.getAxisMotionValue(s);if(i&&this.constraints!==!1){let l=i.get();o[s]=NL({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(),qt(s=>{if(!Mf(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;HE.set(this.visualElement,this);let t=this.visualElement.current,r=Io(t,"pointerdown",l=>{let{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),a=()=>{let{dragConstraints:l}=this.getProps();La(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()),re.read(a);let s=Pa(window,"resize",()=>this.scalePositionWithinConstraints()),i=o.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(qt(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=Rf,dragMomentum:i=!0}=t;return{...t,drag:r,dragDirectionLock:a,dragPropagation:o,dragConstraints:n,dragElastic:s,dragMomentum:i}}};function Mf(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function zE(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}var Bf=class extends st{constructor(t){super(t),this.removeGroupControls=ye,this.removeListeners=ye,this.controls=new Of(t)}mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ye}unmount(){this.removeGroupControls(),this.removeListeners()}};var KL=e=>(t,r)=>{e&&re.postRender(()=>e(t,r))},Ff=class extends st{constructor(){super(...arguments),this.removePointerDownListener=ye}onPointerDown(t){this.session=new mi(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Nf(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:r,onPan:a,onPanEnd:o}=this.node.getProps();return{onSessionStart:KL(t),onStart:KL(r),onMove:a,onEnd:(n,s)=>{delete this.session,o&&re.postRender(()=>o(n,s))}}}mount(){this.removePointerDownListener=Io(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 QL=O(ue(),1),mu=O(Q(),1);var yi={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function XL(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var vi={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(z.test(e))e=parseFloat(e);else return e;let r=XL(e,t.target.x),a=XL(e,t.target.y);return`${r}% ${a}%`}};var JL={correct:(e,{treeScale:t,projectionDelta:r})=>{let a=e,o=At.parse(e);if(o.length>5)return a;let n=At.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 ty=class extends mu.Component{componentDidMount(){let{visualElement:t,layoutGroup:r,switchLayoutGroup:a,layoutId:o}=this.props,{projection:n}=t;ob($E),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()})),yi.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()||re.postRender(()=>{let i=s.getStack();(!i||!i.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Vs.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 Uf(e){let[t,r]=Td(),a=(0,mu.useContext)(Ns);return(0,QL.jsx)(ty,{...e,layoutGroup:a,switchLayoutGroup:(0,mu.useContext)(Vd),isPresent:t,safeToRemove:r})}var $E={borderRadius:{...vi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:vi,borderTopRightRadius:vi,borderBottomLeftRadius:vi,borderBottomRightRadius:vi,boxShadow:JL};function YL(e,t,r){let a=be(e)?e:ka(e);return a.start(pi("",a,t,r)),a.animation}function ZL(e){return e instanceof SVGElement&&e.tagName!=="svg"}var eI=(e,t)=>e.depth-t.depth;var Vf=class{constructor(){this.children=[],this.isDirty=!1}add(t){ni(this.children,t),this.isDirty=!0}remove(t){si(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(eI),this.isDirty=!1,this.children.forEach(t)}};function tI(e,t){let r=Ct.now(),a=({timestamp:o})=>{let n=o-r;n>=t&&(ar(a),e(n-t))};return re.read(a,!0),()=>ar(a)}var nI=["TopLeft","TopRight","BottomLeft","BottomRight"],WE=nI.length,rI=e=>typeof e=="string"?parseFloat(e):e,aI=e=>typeof e=="number"||z.test(e);function sI(e,t,r,a,o,n){o?(e.opacity=le(0,r.opacity!==void 0?r.opacity:1,GE(a)),e.opacityExit=le(t.opacity!==void 0?t.opacity:1,0,KE(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<WE;s++){let i=`border${nI[s]}Radius`,l=oI(t,i),u=oI(r,i);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||aI(l)===aI(u)?(e[i]=Math.max(le(rI(l),rI(u),a),0),(_t.test(u)||_t.test(l))&&(e[i]+="%")):e[i]=u}(t.rotate||r.rotate)&&(e.rotate=le(t.rotate||0,r.rotate||0,a))}function oI(e,t){return e[t]!==void 0?e[t]:e.borderRadius}var GE=iI(0,.5,ff),KE=iI(.5,.95,ye);function iI(e,t,r){return a=>a<e?0:a>t?1:r(rr(e,t,a))}function lI(e,t){e.min=t.min,e.max=t.max}function nr(e,t){lI(e.x,t.x),lI(e.y,t.y)}function ry(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function uI(e,t,r,a,o){return e-=t,e=pu(e,1/r,a),o!==void 0&&(e=pu(e,1/o,a)),e}function XE(e,t=0,r=1,a=.5,o,n=e,s=e){if(_t.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=uI(e.min,t,r,i,o),e.max=uI(e.max,t,r,i,o)}function cI(e,t,[r,a,o],n,s){XE(e,t[r],t[a],t[o],t.scale,n,s)}var JE=["x","scaleX","originX"],QE=["y","scaleY","originY"];function ay(e,t,r,a){cI(e.x,t,JE,r?r.x:void 0,a?a.x:void 0),cI(e.y,t,QE,r?r.y:void 0,a?a.y:void 0)}function dI(e){return e.translate===0&&e.scale===1}function oy(e){return dI(e.x)&&dI(e.y)}function fI(e,t){return e.min===t.min&&e.max===t.max}function mI(e,t){return fI(e.x,t.x)&&fI(e.y,t.y)}function pI(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function ny(e,t){return pI(e.x,t.x)&&pI(e.y,t.y)}function sy(e){return pt(e.x)/pt(e.y)}function iy(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var jf=class{constructor(){this.members=[]}add(t){ni(this.members,t),t.scheduleRender()}remove(t){if(si(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 hI(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:h,skewY:v}=r;u&&(a=`perspective(${u}px) ${a}`),c&&(a+=`rotate(${c}deg) `),d&&(a+=`rotateX(${d}deg) `),f&&(a+=`rotateY(${f}deg) `),h&&(a+=`skewX(${h}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 Pn={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},hu=typeof window<"u"&&window.MotionDebug!==void 0,ly=["","X","Y","Z"],YE={visibility:"hidden"},gI=1e3,ZE=0;function uy(e,t,r,a){let{latestValues:o}=t;o[e]&&(r[e]=o[e],t.setStaticValue(e,0),a&&(a[e]=0))}function LI(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let r=of(t);if(window.MotionHasOptimisedAnimation(r,"transform")){let{layout:o,layoutId:n}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",re,!(o||n))}let{parent:a}=e;a&&!a.hasCheckedOptimisedAppear&&LI(a)}function qf({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:a,resetTransform:o}){return class{constructor(s={},i=t?.()){this.id=ZE++,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,hu&&(Pn.totalNodes=Pn.resolvedTargetDeltas=Pn.recalculatedProjection=0),this.nodes.forEach(rD),this.nodes.forEach(iD),this.nodes.forEach(lD),this.nodes.forEach(aD),hu&&window.MotionDebug.record(Pn)},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 Vf)}addEventListener(s,i){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new xo),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=ZL(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=tI(f,250),yi.hasAnimatedSinceResize&&(yi.hasAnimatedSinceResize=!1,this.nodes.forEach(vI))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeTargetChanged:h,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let x=this.options.transition||c.getDefaultTransition()||pD,{onLayoutAnimationStart:C,onLayoutAnimationComplete:g}=c.getProps(),p=!this.targetLayout||!ny(this.targetLayout,v)||h,y=!f&&h;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||y||f&&(p||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,y);let b={...go(x,"layout"),onPlay:C,onComplete:g};(c.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b)}else f||vI(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,ar(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(uD),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&&LI(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(yI);return}this.isUpdating||this.nodes.forEach(nD),this.isUpdating=!1,this.nodes.forEach(sD),this.nodes.forEach(eD),this.nodes.forEach(tD),this.clearAllSnapshots();let i=Ct.now();He.delta=ft(0,1e3/60,i-He.timestamp),He.timestamp=i,He.isProcessing=!0,Nd.update.process(He),Nd.preRender.process(He),Nd.render.process(He),He.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Vs.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(oD),this.sharedNodes.forEach(cD)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,re.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){re.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=_e(),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&&!oy(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;s&&(i||_a(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)),mD(l),{animationId:this.root.animationId,measuredBox:i,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var s;let{visualElement:i}=this.options;if(!i)return _e();let l=i.measureViewportBox();if(!(((s=this.scroll)===null||s===void 0?void 0:s.wasRoot)||this.path.some(hD))){let{scroll:c}=this.root;c&&(ko(l.x,c.offset.x),ko(l.y,c.offset.y))}return l}removeElementScroll(s){var i;let l=_e();if(nr(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&&nr(l,s),ko(l.x,d.offset.x),ko(l.y,d.offset.y))}return l}applyTransform(s,i=!1){let l=_e();nr(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&&kn(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),_a(c.latestValues)&&kn(l,c.latestValues)}return _a(this.latestValues)&&kn(l,this.latestValues),l}removeTransform(s){let i=_e();nr(i,s);for(let l=0;l<this.path.length;l++){let u=this.path[l];if(!u.instance||!_a(u.latestValues))continue;Df(u.latestValues)&&u.updateSnapshot();let c=_e(),d=u.measurePageBox();nr(c,d),ay(i,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return _a(this.latestValues)&&ay(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!==He.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=He.timestamp,!this.targetDelta&&!this.relativeTarget){let h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=_e(),this.relativeTargetOrigin=_e(),gi(this.relativeTargetOrigin,this.layout.layoutBox,h.layout.layoutBox),nr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=_e(),this.targetWithTransforms=_e()),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):nr(this.target,this.layout.layoutBox),Zg(this.target,this.targetDelta)):nr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;let h=this.getClosestProjectingParent();h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=_e(),this.relativeTargetOrigin=_e(),gi(this.relativeTargetOrigin,this.target,h.target),nr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}hu&&Pn.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Df(this.parent.latestValues)||Qg(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===He.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;nr(this.layoutCorrected,this.layout.layoutBox);let f=this.treeScale.x,h=this.treeScale.y;WL(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=_e());let{target:v}=i;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ry(this.prevProjectionDelta.x,this.projectionDelta.x),ry(this.prevProjectionDelta.y,this.projectionDelta.y)),hi(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!iy(this.projectionDelta.x,this.prevProjectionDelta.x)||!iy(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v)),hu&&Pn.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=In(),this.projectionDelta=In(),this.projectionDeltaWithTransform=In()}setAnimationOrigin(s,i=!1){let l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},d=In();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!i;let f=_e(),h=l?l.source:void 0,v=this.layout?this.layout.source:void 0,x=h!==v,C=this.getStack(),g=!C||C.members.length<=1,p=!!(x&&!g&&this.options.crossfade===!0&&!this.path.some(fD));this.animationProgress=0;let y;this.mixTargetDelta=b=>{let L=b/1e3;xI(d.x,s.x,L),xI(d.y,s.y,L),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(gi(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),dD(this.relativeTarget,this.relativeTargetOrigin,f,L),y&&mI(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=_e()),nr(y,this.relativeTarget)),x&&(this.animationValues=c,sI(c,u,this.latestValues,L,p,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&&(ar(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=re.update(()=>{yi.hasAnimatedSinceResize=!0,this.currentAnimation=YL(0,gI,{...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(gI),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&&II(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||_e();let d=pt(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+d;let f=pt(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+f}nr(i,l),kn(i,c),hi(this.projectionDeltaWithTransform,this.layoutCorrected,i,c)}}registerSharedNode(s,i){this.sharedNodes.has(s)||this.sharedNodes.set(s,new jf),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&&uy("z",s,u,this.animationValues);for(let c=0;c<ly.length;c++)uy(`rotate${ly[c]}`,s,u,this.animationValues),uy(`skew${ly[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 YE;let u={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=zs(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=zs(s?.pointerEvents)||""),this.hasProjected&&!_a(this.latestValues)&&(x.transform=c?c({},""):"none",this.hasProjected=!1),x}let f=d.animationValues||d.latestValues;this.applyTransformsToTarget(),u.transform=hI(this.projectionDeltaWithTransform,this.treeScale,f),c&&(u.transform=c(f,u.transform));let{x:h,y:v}=this.projectionDelta;u.transformOrigin=`${h.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 Qs){if(f[x]===void 0)continue;let{correct:C,applyTo:g}=Qs[x],p=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]]=p}else u[x]=p}return this.options.layoutId&&(u.pointerEvents=d===this?zs(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(yI),this.root.sharedNodes.clear()}}}function eD(e){e.updateLayout()}function tD(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"?qt(d=>{let f=s?r.measuredBox[d]:r.layoutBox[d],h=pt(f);f.min=a[d].min,f.max=f.min+h}):II(n,r.layoutBox,a)&&qt(d=>{let f=s?r.measuredBox[d]:r.layoutBox[d],h=pt(a[d]);f.max=f.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+h)});let i=In();hi(i,a,r.layoutBox);let l=In();s?hi(l,e.applyTransform(o,!0),r.measuredBox):hi(l,a,r.layoutBox);let u=!oy(i),c=!1;if(!e.resumeFrom){let d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){let{snapshot:f,layout:h}=d;if(f&&h){let v=_e();gi(v,r.layoutBox,f.layoutBox);let x=_e();gi(x,a,h.layoutBox),ny(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 rD(e){hu&&Pn.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 aD(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function oD(e){e.clearSnapshot()}function yI(e){e.clearMeasurements()}function nD(e){e.isLayoutDirty=!1}function sD(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function vI(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function iD(e){e.resolveTargetDelta()}function lD(e){e.calcProjection()}function uD(e){e.resetSkewAndRotation()}function cD(e){e.removeLeadSnapshot()}function xI(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 wI(e,t,r,a){e.min=le(t.min,r.min,a),e.max=le(t.max,r.max,a)}function dD(e,t,r,a){wI(e.x,t.x,r.x,a),wI(e.y,t.y,r.y,a)}function fD(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var pD={duration:.45,ease:[.4,0,.1,1]},SI=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),CI=SI("applewebkit/")&&!SI("chrome/")?Math.round:ye;function bI(e){e.min=CI(e.min),e.max=CI(e.max)}function mD(e){bI(e.x),bI(e.y)}function II(e,t,r){return e==="position"||e==="preserve-aspect"&&!IL(sy(t),sy(r),.2)}function hD(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}var kI=qf({attachResizeListener:(e,t)=>Pa(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0});var cy={current:void 0},Hf=qf({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!cy.current){let e=new kI({});e.mount(window),e.setOptions({layoutScroll:!0}),cy.current=e}return cy.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"});var PI={pan:{Feature:Ff},drag:{Feature:Bf,ProjectionNode:Hf,MeasureLayout:Uf}};function TI(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&&re.postRender(()=>n(t,Ta(t)))}var zf=class extends st{mount(){let{current:t}=this.node;t&&(this.unmount=Pg(t,r=>(TI(this.node,r,"Start"),a=>TI(this.node,a,"End"))))}unmount(){}};var $f=class extends st{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=Xr(Pa(this.node.current,"focus",()=>this.onFocus()),Pa(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function _I(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&&re.postRender(()=>n(t,Ta(t)))}var Wf=class extends st{mount(){let{current:t}=this.node;t&&(this.unmount=_g(t,r=>(_I(this.node,r,"Start"),(a,{success:o})=>_I(this.node,a,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}};var fy=new WeakMap,dy=new WeakMap,gD=e=>{let t=fy.get(e.target);t&&t(e)},yD=e=>{e.forEach(gD)};function vD({root:e,...t}){let r=e||document;dy.has(r)||dy.set(r,{});let a=dy.get(r),o=JSON.stringify(t);return a[o]||(a[o]=new IntersectionObserver(yD,{root:e,...t})),a[o]}function AI(e,t,r){let a=vD(t);return fy.set(e,r),a.observe(e),()=>{fy.delete(e),a.unobserve(e)}}var xD={some:0,all:1},Gf=class extends st{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:xD[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 AI(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(wD(t,r))&&this.startObserver()}unmount(){}};function wD({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}var RI={inView:{Feature:Gf},tap:{Feature:Wf},focus:{Feature:$f},hover:{Feature:zf}};var EI={layout:{ProjectionNode:Hf,MeasureLayout:Uf}};var BI=O(Q(),1);var gu={current:null},Kf={current:!1};function DI(){if(Kf.current=!0,!!Bs)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>gu.current=e.matches;e.addListener(t),t()}else gu.current=!1}var SD=[...Fg,Ge,At],NI=e=>SD.find(vf(e));var py=new WeakMap;function MI(e,t,r){for(let a in t){let o=t[a],n=r[a];if(be(o))e.addValue(a,o);else if(be(n))e.addValue(a,ka(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,ka(s!==void 0?s:o,{owner:e}))}}for(let a in r)t[a]===void 0&&e.removeValue(a);return t}var OI=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Xf=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=bo,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 h=Ct.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,re.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=yn(r),this.isVariantNode=Bd(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);let{willChange:d,...f}=this.scrapeMotionValuesFromProps(r,{},this);for(let h in f){let v=f[h];l[h]!==void 0&&be(v)&&v.set(l[h],!1)}}mount(t){this.current=t,py.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)),Kf.current||DI(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:gu.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){py.delete(this.current),this.projection&&this.projection.unmount(),ar(this.notifyUpdate),ar(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=jt.has(t),o=r.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&re.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 Ca){let r=Ca[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):_e()}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<OI.length;a++){let o=OI[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=MI(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=ka(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"&&(yf(o)||mf(o))?o=parseFloat(o):!NI(o)&&At.test(r)&&(o=gf(t,r)),this.setBaseTarget(t,be(o)?o.get():o)),be(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=Hs(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&&!be(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 xo),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}};var xi=class extends Xf{constructor(){super(...arguments),this.KeyframeResolver=ci}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;be(t)&&(this.childSubscription=t.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}};function CD(e){return window.getComputedStyle(e)}var Jf=class extends xi{constructor(){super(...arguments),this.type="html",this.renderInstance=Wd}readValueFromInstance(t,r){if(jt.has(r)){let a=ui(r);return a&&a.default||0}else{let a=CD(t),o=(Hd(r)?a.getPropertyValue(r):a[r])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:r}){return ey(t,r)}build(t,r,a){Gs(t,r,a.transformTemplate)}scrapeMotionValuesFromProps(t,r,a){return Ys(t,r,a)}};var Qf=class extends xi{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=_e}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(jt.has(r)){let a=ui(r);return a&&a.default||0}return r=Gd.has(r)?r:Us(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,a){return Jd(t,r,a)}build(t,r,a){Ks(t,r,this.isSVGTag,a.transformTemplate)}renderInstance(t,r,a,o){Kd(t,r,a,o)}mount(t){this.isSVGTag=Js(t.tagName),super.mount(t)}};var FI=(e,t)=>qs(e)?new Qf(t):new Jf(t,{allowProjection:e!==BI.Fragment});var UI=pb({...mL,...RI,...PI,...EI},FI);var my=DC(UI);var yu=O(ue(),1);function VI({x:e,y:t,visible:r,onClick:a=!1}){return(0,yu.jsx)(yg,{children:r&&(0,yu.jsx)(my.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,yu.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,yu.jsx)("path",{d:"M3 3L10.07 19.97L12.58 12.58L19.97 10.07L3 3Z",fill:"#C4B5FD"})})})})}var wi=O(Q(),1);function jI(){let[e,t]=wi.useState({x:0,y:0,visible:!1,onClick:!1}),r=wi.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=wi.useCallback(()=>{t(n=>({...n,visible:!1}))},[]),o=wi.useCallback(()=>{t(n=>({...n,visible:!0}))},[]);return{cursorState:e,moveTo:r,hide:a,show:o}}var Si=O(ue(),1);function bt({className:e,...t}){return(0,Si.jsx)("div",{"data-slot":"card",className:er("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Jr({className:e,...t}){return(0,Si.jsx)("div",{"data-slot":"card-header",className:er("@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 Qr({className:e,...t}){return(0,Si.jsx)("div",{"data-slot":"card-title",className:er("leading-none font-semibold",e),...t})}function hy({className:e,...t}){return(0,Si.jsx)("div",{"data-slot":"card-description",className:er("text-muted-foreground text-sm",e),...t})}function Lt({className:e,...t}){return(0,Si.jsx)("div",{"data-slot":"card-content",className:er("px-6",e),...t})}var S=O(ue(),1),gy=e=>new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),Yf=(e,t="USD")=>new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e),yy=e=>{switch(e){case"Enterprise":return dn;case"Professional":return Xl;default:return Vl}},Zf=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 vu({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:nt};case"failed":return{color:"bg-red-50 text-red-700 border-red-200",icon:Ar};case"pending":return{color:"bg-amber-50 text-amber-700 border-amber-200",icon:un};case"refunded":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:Rs};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:_r}}if(t==="subscription")switch(n){case"active":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:nt};case"cancelled":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:Ar};case"past_due":return{color:"bg-red-50 text-red-700 border-red-200",icon:_r};case"trialing":return{color:"bg-blue-50 text-blue-700 border-blue-200",icon:un};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:_r}}switch(n){case"active":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:nt};case"inactive":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:Ar};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:_r}}})(),o=a.icon;return(0,S.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,S.jsx)(o,{className:"h-3 w-3"}),e]})}function bD({subscription:e}){let t=yy(e.plan);return(0,S.jsxs)(bt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)("div",{className:`h-1 ${e.status==="active"?"bg-emerald-500":e.status==="past_due"?"bg-red-500":"bg-slate-300"}`}),(0,S.jsx)(Jr,{className:"pb-3",children:(0,S.jsxs)("div",{className:"flex items-start justify-between",children:[(0,S.jsxs)("div",{className:"space-y-1",children:[(0,S.jsxs)(Qr,{className:"text-base font-semibold text-gray-900 flex items-center gap-2",children:[(0,S.jsx)(cn,{className:"h-4 w-4 text-gray-500"}),e.id]}),e.customer_email&&(0,S.jsxs)(hy,{className:"text-sm text-gray-500 flex items-center gap-1.5",children:[(0,S.jsx)(_s,{className:"h-3 w-3"}),e.customer_email]})]}),(0,S.jsx)(vu,{status:e.status,type:"subscription"})]})}),(0,S.jsx)(Lt,{className:"pt-0",children:(0,S.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,S.jsxs)("div",{className:"space-y-3",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Plan"}),(0,S.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium border ${Zf(e.plan)}`,children:[(0,S.jsx)(t,{className:"h-3 w-3"}),e.plan]})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Billing"}),(0,S.jsxs)("div",{className:"text-sm font-medium text-gray-900",children:[Yf(e.amount,e.currency)," / ",e.billing_cycle]})]})]}),(0,S.jsxs)("div",{className:"space-y-3",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Current Period"}),(0,S.jsxs)("div",{className:"text-sm text-gray-700",children:[gy(e.current_period_start)," - ",gy(e.current_period_end)]})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Created"}),(0,S.jsx)("div",{className:"text-sm text-gray-700",children:gy(e.created_at)})]})]})]})})]})}function LD({subscriptions:e,maxItems:t=5}){let r=e.slice(0,t),a=e.length>t;return e.length===0?(0,S.jsx)(bt,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Lt,{className:"py-8 text-center",children:[(0,S.jsx)(cn,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No subscriptions found"})]})}):(0,S.jsxs)(bt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Jr,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Qr,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(cn,{className:"h-4 w-4"}),e.length," Subscription",e.length!==1?"s":""]})}),(0,S.jsxs)(Lt,{className:"p-0",children:[(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:r.map(o=>{let n=yy(o.plan);return(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,S.jsx)("div",{className:`p-2 rounded-lg ${Zf(o.plan).replace("text-","text-").replace("border-","bg-").split(" ")[0]}`,children:(0,S.jsx)(n,{className:"h-4 w-4"})}),(0,S.jsxs)("div",{className:"min-w-0",children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:o.customer_email||o.customer_id}),(0,S.jsxs)("div",{className:"text-xs text-gray-500",children:[o.plan," \xB7 ",Yf(o.amount,o.currency),"/",o.billing_cycle]})]})]}),(0,S.jsx)(vu,{status:o.status,type:"subscription"})]})},o.id)})}),a&&(0,S.jsx)("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-100 text-center",children:(0,S.jsxs)("span",{className:"text-xs text-gray-500",children:["+",e.length-t," more subscription",e.length-t!==1?"s":""]})})]})]})}function ID({customer:e}){let t=yy(e.subscription);return(0,S.jsxs)(bt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)("div",{className:`h-1 ${e.status==="active"?"bg-emerald-500":"bg-slate-300"}`}),(0,S.jsx)(Jr,{className:"pb-3",children:(0,S.jsxs)("div",{className:"flex items-start justify-between",children:[(0,S.jsx)("div",{className:"flex items-center gap-3",children:(0,S.jsxs)("div",{children:[(0,S.jsx)(Qr,{className:"text-base font-semibold text-gray-900",children:e.name}),(0,S.jsxs)(hy,{className:"text-sm text-gray-500 flex items-center gap-1",children:[(0,S.jsx)(_s,{className:"h-3 w-3"}),e.email]})]})}),(0,S.jsx)(vu,{status:e.status,type:"customer"})]})}),(0,S.jsx)(Lt,{className:"pt-0",children:(0,S.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,S.jsxs)("div",{className:"space-y-3",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Plan"}),(0,S.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium border ${Zf(e.subscription)}`,children:[(0,S.jsx)(t,{className:"h-3 w-3"}),e.subscription]})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Revenue"}),(0,S.jsxs)("div",{className:"text-sm font-medium text-gray-900 flex items-center gap-1",children:[(0,S.jsx)(fn,{className:"h-3 w-3 text-emerald-500"}),e.revenue]})]})]}),(0,S.jsxs)("div",{className:"space-y-3",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Location"}),(0,S.jsxs)("div",{className:"text-sm text-gray-700 flex items-center gap-1",children:[(0,S.jsx)(As,{className:"h-3 w-3 text-gray-400"}),e.location||"Not specified"]})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Customer Since"}),(0,S.jsxs)("div",{className:"text-sm text-gray-700 flex items-center gap-1",children:[(0,S.jsx)(ql,{className:"h-3 w-3 text-gray-400"}),e.joinDate]})]})]})]})})]})}function kD({customers:e,maxItems:t=5}){let r=e.slice(0,t),a=e.length>t;return e.length===0?(0,S.jsx)(bt,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Lt,{className:"py-8 text-center",children:[(0,S.jsx)(Ds,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No customers found"})]})}):(0,S.jsxs)(bt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Jr,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Qr,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(Ds,{className:"h-4 w-4"}),e.length," Customer",e.length!==1?"s":""]})}),(0,S.jsxs)(Lt,{className:"p-0",children:[(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:r.map(o=>(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsx)("div",{className:"flex items-center gap-3 min-w-0",children:(0,S.jsxs)("div",{className:"min-w-0",children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:o.name}),(0,S.jsx)("div",{className:"text-xs text-gray-500 truncate",children:o.email})]})}),(0,S.jsxs)("div",{className:"flex items-center gap-2",children:[(0,S.jsx)("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${Zf(o.subscription)}`,children:o.subscription}),(0,S.jsx)(vu,{status:o.status,type:"customer"})]})]})},o.id))}),a&&(0,S.jsx)("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-100 text-center",children:(0,S.jsxs)("span",{className:"text-xs text-gray-500",children:["+",e.length-t," more customer",e.length-t!==1?"s":""]})})]})]})}function qI({transactions:e,maxItems:t=5}){let r=e.slice(0,t),a=e.length>t;return e.length===0?(0,S.jsx)(bt,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Lt,{className:"py-8 text-center",children:[(0,S.jsx)(fn,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No transactions found"})]})}):(0,S.jsxs)(bt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Jr,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Qr,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(fn,{className:"h-4 w-4"}),e.length," Transaction",e.length!==1?"s":""]})}),(0,S.jsxs)(Lt,{className:"p-0",children:[(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:r.map(o=>(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,S.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,S.jsx)(nt,{className:"h-4 w-4 text-emerald-600"}):o.status==="failed"?(0,S.jsx)(Ar,{className:"h-4 w-4 text-red-600"}):o.status==="refunded"?(0,S.jsx)(Rs,{className:"h-4 w-4 text-slate-600"}):(0,S.jsx)(un,{className:"h-4 w-4 text-amber-600"})}),(0,S.jsxs)("div",{className:"min-w-0",children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:o.customer}),(0,S.jsxs)("div",{className:"text-xs text-gray-500",children:[o.date,o.decline_reason&&(0,S.jsxs)("span",{className:"text-red-500 ml-2",children:["\xB7 ",o.decline_reason]})]})]})]}),(0,S.jsxs)("div",{className:"flex items-center gap-3",children:[(0,S.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,S.jsx)(vu,{status:o.status,type:"transaction"})]})]})},o.id))}),a&&(0,S.jsx)("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-100 text-center",children:(0,S.jsxs)("span",{className:"text-xs text-gray-500",children:["+",e.length-t," more transaction",e.length-t!==1?"s":""]})})]})]})}function PD({apiKeys:e}){return e.length===0?(0,S.jsx)(bt,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Lt,{className:"py-8 text-center",children:[(0,S.jsx)(Ts,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No API keys found"})]})}):(0,S.jsxs)(bt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Jr,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Qr,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(Ts,{className:"h-4 w-4"}),e.length," API Key",e.length!==1?"s":""]})}),(0,S.jsx)(Lt,{className:"p-0",children:(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((t,r)=>(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"min-w-0",children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900",children:t.name}),(0,S.jsxs)("div",{className:"text-xs text-gray-500 font-mono",children:[t.key.slice(0,12),"...",t.key.slice(-4)]})]}),(0,S.jsxs)("div",{className:"text-xs text-gray-500",children:["Last used: ",t.lastUsed]})]})},r))})})]})}function TD({sessions:e}){let t=r=>{let a=r.toLowerCase();return a.includes("mobile")||a.includes("iphone")||a.includes("android")?Gl:zl};return e.length===0?(0,S.jsx)(bt,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Lt,{className:"py-8 text-center",children:[(0,S.jsx)(Es,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No active sessions"})]})}):(0,S.jsxs)(bt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Jr,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Qr,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(Es,{className:"h-4 w-4"}),e.length," Active Session",e.length!==1?"s":""]})}),(0,S.jsx)(Lt,{className:"p-0",children:(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((r,a)=>{let o=t(r.device);return(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"flex items-center gap-3",children:[(0,S.jsx)("div",{className:"p-2 rounded-lg bg-gray-100",children:(0,S.jsx)(o,{className:"h-4 w-4 text-gray-600"})}),(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900",children:r.device}),(0,S.jsxs)("div",{className:"text-xs text-gray-500 flex items-center gap-1",children:[(0,S.jsx)(As,{className:"h-3 w-3"}),r.location]})]})]}),(0,S.jsx)("div",{className:"text-xs text-gray-500",children:r.time})]})},a)})})})]})}function _D({stats:e}){return(0,S.jsxs)(bt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Jr,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Qr,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(Kl,{className:"h-4 w-4"}),"Dashboard Overview"]})}),(0,S.jsx)(Lt,{className:"p-4",children:(0,S.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[e.revenue&&(0,S.jsxs)("div",{className:"p-3 rounded-lg bg-emerald-50 border border-emerald-100",children:[(0,S.jsx)("div",{className:"text-xs text-emerald-600 font-medium mb-1",children:"Revenue"}),(0,S.jsx)("div",{className:"text-lg font-bold text-emerald-700",children:Yf(e.revenue.total)}),e.revenue.change!==0&&(0,S.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,S.jsxs)("div",{className:"p-3 rounded-lg bg-blue-50 border border-blue-100",children:[(0,S.jsx)("div",{className:"text-xs text-blue-600 font-medium mb-1",children:"Subscriptions"}),(0,S.jsxs)("div",{className:"text-lg font-bold text-blue-700",children:[e.subscriptions.active," active"]}),(0,S.jsxs)("div",{className:"text-xs text-blue-600",children:[e.subscriptions.total," total"]})]}),e.customers&&(0,S.jsxs)("div",{className:"p-3 rounded-lg bg-purple-50 border border-purple-100",children:[(0,S.jsx)("div",{className:"text-xs text-purple-600 font-medium mb-1",children:"Customers"}),(0,S.jsx)("div",{className:"text-lg font-bold text-purple-700",children:e.customers.total}),e.customers.new>0&&(0,S.jsxs)("div",{className:"text-xs text-purple-600",children:["+",e.customers.new," new this period"]})]}),e.transactions&&(0,S.jsxs)("div",{className:"p-3 rounded-lg bg-amber-50 border border-amber-100",children:[(0,S.jsx)("div",{className:"text-xs text-amber-600 font-medium mb-1",children:"Transactions"}),(0,S.jsxs)("div",{className:"text-lg font-bold text-amber-700",children:[e.transactions.successful," successful"]}),e.transactions.failed>0&&(0,S.jsxs)("div",{className:"text-xs text-red-600",children:[e.transactions.failed," failed"]})]})]})})]})}function AD({customers:e}){return e.length===0?(0,S.jsx)(bt,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Lt,{className:"py-8 text-center",children:[(0,S.jsx)(dn,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No top customers data"})]})}):(0,S.jsxs)(bt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Jr,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Qr,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(dn,{className:"h-4 w-4 text-amber-500"}),"Top Customers"]})}),(0,S.jsx)(Lt,{className:"p-0",children:(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((t,r)=>(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,S.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,S.jsxs)("div",{className:"min-w-0",children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:t.name}),(0,S.jsx)("div",{className:"text-xs text-gray-500 truncate",children:t.email})]})]}),(0,S.jsx)("div",{className:"text-sm font-semibold text-emerald-600",children:typeof t.revenue=="number"?Yf(t.revenue):t.revenue})]})},r))})})]})}function HI({type:e,data:t}){if(!t)return null;switch(e){case"subscription":return(0,S.jsx)(bD,{subscription:t});case"subscriptions":let r=t.subscriptions||t||[];return(0,S.jsx)(LD,{subscriptions:Array.isArray(r)?r:[r]});case"customer":return(0,S.jsx)(ID,{customer:t.customer||t});case"customers":let a=t.customers||t||[];return(0,S.jsx)(kD,{customers:Array.isArray(a)?a:[a]});case"transactions":let o=t.transactions||t||[];return(0,S.jsx)(qI,{transactions:Array.isArray(o)?o:[o]});case"transaction":return(0,S.jsx)(qI,{transactions:[t],maxItems:1});case"dashboard_stats":return(0,S.jsx)(_D,{stats:t});case"top_customers":let n=t.customers||t||[];return(0,S.jsx)(AD,{customers:Array.isArray(n)?n:[n]});case"api_keys":let s=t.api_keys||t||[];return(0,S.jsx)(PD,{apiKeys:Array.isArray(s)?s:[s]});case"sessions":let i=t.sessions||t||[];return(0,S.jsx)(TD,{sessions:Array.isArray(i)?i:[i]});default:return null}}var Tn=O(ue(),1);function zI({className:e=""}){return(0,Tn.jsx)("div",{className:`flex items-center gap-1 px-4 py-3 ${e}`,children:(0,Tn.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Tn.jsx)("span",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"0ms",animationDuration:"600ms"}}),(0,Tn.jsx)("span",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"150ms",animationDuration:"600ms"}}),(0,Tn.jsx)("span",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"300ms",animationDuration:"600ms"}})]})})}var m=O(ue(),1),RD="0.2.36",ED="http://localhost:5002",WI=340;function DD(e){return e.replace(/\\\\n/g,`
59
59
  `).replace(/\\\\t/g," ").replace(/\\\\"/g,'"').replace(/\\\\\\\\/g,"\\").replace(/\\n/g,`
60
- `).replace(/\\t/g," ").replace(/\\"/g,'"').replace(/\\\\/g,"\\")}function DD(e){if(!e)return null;let t=e.split(`
60
+ `).replace(/\\t/g," ").replace(/\\"/g,'"').replace(/\\\\/g,"\\")}function ND(e){if(!e)return null;let t=e.split(`
61
61
  `),r=[],a=null,o=!1,n=[],s="",i=u=>{let c=[],d=u,f=0;for(;d.length>0;){let h=d.match(/^`([^`]+)`/);if(h){c.push((0,m.jsx)("code",{className:"bg-gray-100 px-1 py-0.5 rounded text-xs font-mono",children:h[1]},f++)),d=d.slice(h[0].length);continue}let v=d.match(/^\*\*([^*]+)\*\*/);if(v){c.push((0,m.jsx)("strong",{children:v[1]},f++)),d=d.slice(v[0].length);continue}let x=d.match(/^\*([^*]+)\*/);if(x){c.push((0,m.jsx)("em",{children:x[1]},f++)),d=d.slice(x[0].length);continue}let C=d.match(/^\[([^\]]+)\]\(([^)]+)\)/);if(C){c.push((0,m.jsx)("a",{href:C[2],className:"kite-link",target:"_blank",rel:"noopener noreferrer",children:C[1]},f++)),d=d.slice(C[0].length);continue}let g=d.match(/^(https?:\/\/[^\s<>]+|www\.[^\s<>]+)/);if(g){let b=g[1],L=b.startsWith("www.")?`https://${b}`:b;c.push((0,m.jsx)("a",{href:L,className:"kite-link",target:"_blank",rel:"noopener noreferrer",children:b},f++)),d=d.slice(b.length);continue}let p=d.match(/^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})/);if(p){let b=p[1];c.push((0,m.jsx)("a",{href:`mailto:${b}`,className:"kite-link",children:b},f++)),d=d.slice(b.length);continue}let y=d.search(/[`*\[@h]/);if(y===-1){c.push(d);break}else y===0?(c.push(d[0]),d=d.slice(1)):(c.push(d.slice(0,y)),d=d.slice(y))}return c.length===1?c[0]:(0,m.jsx)(m.Fragment,{children:c})},l=()=>{if(a){let u=a.type==="ul"?"ul":"ol";r.push((0,m.jsx)(u,{className:`${a.type==="ul"?"list-disc":"list-decimal"} ml-4 my-1`,children:a.items.map((c,d)=>(0,m.jsx)("li",{className:"ml-2",children:c},d))},r.length)),a=null}};for(let u=0;u<t.length;u++){let c=t[u];if(c.startsWith("```")){o?(r.push((0,m.jsx)("pre",{className:"bg-gray-100 rounded p-2 my-1 overflow-x-auto",children:(0,m.jsx)("code",{className:"text-xs font-mono",children:n.join(`
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,m.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 h=c.match(/^\d+[.)]\s+(.+)/);if(h){(!a||a.type!=="ol")&&(l(),a={type:"ol",items:[]}),a.items.push(i(h[1]));continue}if(c.trim()===""){l(),r.push((0,m.jsx)("div",{className:"h-2"},r.length));continue}if(c.match(/^[-*_]{3,}$/)){l(),r.push((0,m.jsx)("hr",{className:"my-2 border-gray-200"},r.length));continue}l(),r.push((0,m.jsx)("div",{children:i(c)},r.length))}return l(),(0,m.jsx)(m.Fragment,{children:r})}var ND=[{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"}],$I=[{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?"}]}],vy={"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}}]}},MD=[];function OD({isOpen:e=!0,onClose:t,onOpen:r,onBack:a,onNavigate:o,onActionComplete:n,currentPage:s,agentUrl:i=RD,startingQuestions:l,startingQuestionsEndpoint:u,userId:c,orgId:d,userName:f,userEmail:h,userOrganization:v,supabaseUrl:x,supabaseAnonKey:C}={}){let[g,p]=F.useState(MD),[y,b]=F.useState(""),[L,P]=F.useState(()=>crypto.randomUUID()),[T,A]=F.useState(!1),N=F.useRef(null),[j,pe]=F.useState(!1),ee=F.useRef(null),ir=F.useRef(null),zt=F.useRef(null),Po=F.useCallback(()=>{T&&ee.current&&L&&ee.current.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",L),P(crypto.randomUUID()),A(!1),N.current&&(N.current.close(),N.current=null),pe(!1),ir.current&&(ir.current.unsubscribe(),ir.current=null)},[T,L]);F.useEffect(()=>{x&&C&&!ee.current&&(ee.current=xS(x,C))},[x,C]),F.useEffect(()=>{if(!T||!L||!ee.current)return;let w=`typing:${L}`,k=ee.current.channel(w);return k.on("broadcast",{event:"typing"},B=>{let{sender:D,isTyping:E}=B.payload;D==="agent"&&(pe(E),E&&(zt.current&&window.clearTimeout(zt.current),zt.current=window.setTimeout(()=>{pe(!1)},5e3)))}).subscribe(B=>{B==="SUBSCRIBED"&&(ir.current=k)}),()=>{k.unsubscribe(),ir.current=null,zt.current&&window.clearTimeout(zt.current)}},[T,L]);let Dr=F.useRef(null),ve=F.useCallback(async w=>{if(!(!ee.current||!L))try{await ee.current.from("escalations").update({customer_status:w,customer_last_seen:new Date().toISOString()}).eq("session_id",L)}catch(k){console.error("[KiteChat] Failed to update customer status:",k)}},[L]);F.useEffect(()=>{if(!T||!L||!ee.current)return;let w=L,k=ee.current;ve("active"),Dr.current=window.setInterval(()=>{ve("active")},6e4);let B=()=>{k.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",w)},D=()=>{document.visibilityState==="hidden"?k.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",w):document.visibilityState==="visible"&&ve("active")};return window.addEventListener("beforeunload",B),document.addEventListener("visibilitychange",D),()=>{window.removeEventListener("beforeunload",B),document.removeEventListener("visibilitychange",D),k.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",w).then(()=>{console.log("[KiteChat] Marked customer as disconnected")},E=>{console.error("[KiteChat] Failed to mark disconnected:",E)}),Dr.current&&(window.clearInterval(Dr.current),Dr.current=null)}},[T,L,ve]);let Ye=F.useCallback(w=>{!ir.current||!T||ir.current.send({type:"broadcast",event:"typing",payload:{sender:"user",isTyping:w}})},[T]),mt=F.useRef(null),Aa=F.useCallback(()=>{!T||!ee.current||(Ye(!0),ve("active"),mt.current&&window.clearTimeout(mt.current),mt.current=window.setTimeout(()=>{Ye(!1)},1500))},[T,Ye,ve]),ht=F.useRef({}),Sy=g.length===0,[To,xe]=F.useState("idle"),[XI,Le]=F.useState([]),Ra=F.useRef([]),JI=g.length?g[g.length-1].role:void 0,[ep,_o]=F.useState("landing"),[Cy,Ao]=F.useState(void 0),[QI,by]=F.useState(l||ND),[YI,Ly]=F.useState(!1);F.useEffect(()=>{u&&!l&&(Ly(!0),fetch(u).then(w=>w.json()).then(w=>{Array.isArray(w)&&w.length>0&&by(w)}).catch(w=>{console.warn("[KiteChat] Failed to fetch starting questions:",w)}).finally(()=>Ly(!1)))},[u,l]),F.useEffect(()=>{l&&by(l)},[l]);let[ge,Ea]=F.useState(void 0),Be=F.useRef(void 0),Iy=F.useRef(null),[bi,Li]=F.useState(!1);F.useEffect(()=>{window.resetIntegrationNotification=()=>{localStorage.removeItem("gmailNotificationSeen"),console.log("Integration notification reset! Click the Integrations tab to see it again.")};let w=()=>{if(!localStorage.getItem("gmailNotificationSeen")){_o("landing"),Ao(void 0);let B=Date.now(),D="I see you're exploring integrations. Let me know if there are any other connections we should add.",E={id:B,role:"assistant",kind:"text",content:"",isNotificationMessage:!0};p(Z=>[...Z,E]),Zr(B,D),localStorage.setItem("gmailNotificationSeen","true")}};return window.addEventListener("integrationTabClicked",w),()=>{window.removeEventListener("integrationTabClicked",w)}},[]),F.useEffect(()=>{ge?(!Be.current||Be.current.id!==ge.id||Be.current.stepIndex!==ge.stepIndex)&&(Be.current=ge):Be.current=void 0},[ge]);let[Ii,xu]=F.useState(null),[Ze,tp]=F.useState(null),[se,ie]=F.useState({}),ky=F.useRef(null),rp=F.useRef(null),wu=F.useRef(null),{cursorState:Su,moveTo:Ro,hide:An}=jI(),[Eo,ap]=F.useState(null),[Py,Da]=F.useState(null),op=F.useRef(null),Rn=F.useRef(null),[Ty,ki]=F.useState(!1),[En,Cu]=F.useState(""),_y=F.useRef(null);F.useEffect(()=>{if(!ge||ge.id!=="add-api-key"||ge.stepIndex!==2)return;let k=setInterval(()=>{let B=document.querySelector('[role="dialog"]'),D=Be.current;if(B&&D&&D.id==="add-api-key"&&D.stepIndex===2){An();let E=Date.now()+1;p(Z=>[...Z,{id:E,role:"assistant",kind:"guideComplete",content:"Perfect! The dialog is now open. You can enter a name and create your API key."}]),Ea(void 0),Li(!0)}},300);return()=>clearInterval(k)},[ge,An]),F.useEffect(()=>()=>{Object.values(ht.current).forEach(w=>window.clearInterval(w)),ht.current={},Ra.current.forEach(w=>window.clearTimeout(w)),Ra.current=[]},[]),F.useEffect(()=>{if(ge&&g.length>0){let w=g[g.length-1];if((w.kind==="guideStep"||w.kind==="guideComplete")&&wu.current&&rp.current){let k=rp.current,B=wu.current,D=k.getBoundingClientRect(),Z=B.getBoundingClientRect().top-D.top+k.scrollTop;k.scrollTop=Z}}else!ge&&g.length>0&&ky.current?.scrollIntoView({behavior:"smooth"})},[g,To,ge]);let Ay=F.useMemo(()=>{for(let w=g.length-1;w>=0;w--){let k=g[w];if(k.kind==="bulkSummary"&&k.bulkSummary?.navigationPage&&k.bulkSummary.successes>0)return k.bulkSummary.navigationPage}return null},[g]);F.useEffect(()=>{Iy.current=Ay},[Ay]),F.useEffect(()=>{op.current=Py},[Py]),F.useEffect(()=>{let w=k=>{if((k.metaKey||k.ctrlKey)&&k.key==="Enter"){let B=op.current;if(B){k.preventDefault(),k.stopPropagation(),ip(B);return}if(Ze){k.preventDefault(),k.stopPropagation(),sp();return}if(Ii){k.preventDefault(),k.stopPropagation(),np(Ii);return}let D=Iy.current;if(console.log("[DEBUG] Keyboard handler - latestBulkSummaryNavigation:",D,"onNavigate:",!!o),D&&o){console.log("[DEBUG] Navigating via keyboard to:",D.page),k.preventDefault(),k.stopPropagation(),o(D.page,D.subtab);return}if(bi){k.preventDefault(),k.stopPropagation(),Ey();return}if(Be.current){k.preventDefault(),k.stopPropagation(),lp();return}}};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[Ze,Ii,ge,bi,o]);let Ry=F.useCallback(w=>{if(!i)return;N.current&&N.current.close();let k=i.replace(/^http/,"ws")+`/ws/escalation/${w}`,B=new WebSocket(k);B.onmessage=D=>{try{let E=JSON.parse(D.data);E.type==="agent_message"?p(Z=>{let Y=E.content,_=E.message_id;return(_?Z.some(I=>I.serverMessageId===_):Z.slice(-5).some(I=>I.content===Y))?(console.debug("[KiteChat] Skipping duplicate agent message:",_||Y.slice(0,30)),Z):[...Z,{id:Date.now(),role:"agent",kind:"text",content:Y,serverMessageId:_}]}):E.type==="error"&&console.error("[KiteChat] Escalation error:",E.message)}catch(E){console.error("[KiteChat] Failed to parse escalation message:",E)}},B.onerror=D=>{console.error("[KiteChat] Escalation WebSocket error:",D)},B.onclose=()=>{console.log("[KiteChat] Escalation WebSocket closed")},N.current=B},[i]),ZI=F.useCallback(async w=>{if(!N.current||N.current.readyState!==WebSocket.OPEN)return console.error("[KiteChat] Escalation WebSocket not connected"),!1;try{return N.current.send(JSON.stringify({type:"user_message",content:w})),ve("active"),!0}catch(k){return console.error("[KiteChat] Failed to send escalated message:",k),!1}},[ve]);F.useEffect(()=>()=>{N.current&&N.current.close()},[]),F.useEffect(()=>{T&&L&&Ry(L)},[T,L,Ry]);function Zr(w,k,B){let D=k||"",E=B;if(k&&k.startsWith("{")&&k.includes('"response"'))try{let M=0,I=0;for(let X=0;X<k.length;X++)if(k[X]==="{")M++;else if(k[X]==="}"&&(M--,M===0)){I=X+1;break}let J=I>0?k.slice(0,I):k,ae=JSON.parse(J);ae.response&&typeof ae.response=="string"&&(D=ae.response,!E&&ae.followups&&(E=ae.followups))}catch{}D=ED(D);let Z=D.split(" "),Y=0,_=window.setInterval(()=>{Y+=1,p(M=>M.map(I=>I.id===w?{...I,content:Z.slice(0,Y).join(" ")}:I)),Y>=Z.length&&(window.clearInterval(_),delete ht.current[w],E&&E.length>0&&p(M=>M.map(I=>I.id===w?{...I,followups:E}:I)),xe("idle"))},25);ht.current[w]=_}function ek(w,k){p(B=>B.map(D=>D.id===w?{...D,followupSelected:!0}:D)),bu(k.label)}function Ey(){Object.values(ht.current).forEach(w=>window.clearInterval(w)),ht.current={},Ra.current.forEach(w=>window.clearTimeout(w)),Ra.current=[],An(),Po(),p([]),b(""),xe("idle"),_o("landing"),Ao(void 0),Ea(void 0),Li(!1),xu(null),tp(null),ie({}),a&&a()}function jD(w){_o("folder"),Ao(w)}function tk(){_o("landing"),Ao(void 0)}function rk(w){w.preventDefault();let k=y.trim();if(Eo){if(!k){let B={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(D=>[...D,B]);return}ok(k,Eo),b(""),ap(null),Rn.current&&(Rn.current.value="");return}if(k){if(T){let B={id:Date.now(),role:"user",content:k};p(D=>[...D,B]),ZI(k),Ye(!1),mt.current&&(window.clearTimeout(mt.current),mt.current=null),b("");return}bu(k),b("")}}function ak(w){let k={dashboard:"dashboard",customers:"customers page",payments:"payments page",settings:"settings page",support:"support page",disputes:"disputes page",radar:"radar page"};if(w.page==="settings"&&w.subtab){let B={general:"General",billing:"Billing",security:"Security",api:"API Keys",notifications:"Notifications",integrations:"Integrations"};return`${k.settings} (${B[w.subtab]} tab)`}return k[w.page]}function np(w){o&&o(w.page,w.subtab),xu(null),p(k=>k.map(B=>B.kind==="navigationAction"&&B.navigationTarget?.page===w.page&&B.navigationTarget?.subtab===w.subtab?{...B,navigationTarget:void 0}:B))}function sp(){if(!Ze)return;let w=se;if(Ze.type!=="updateCompanyInfo"){if(Ze.type==="addApiKey"){let k=w;if(!k.name||!k.name.trim())return}else if(Ze.type==="addCustomer"){let k=w;if(!k.name||!k.name.trim()||!k.email||!k.email.trim())return}else if(Ze.type==="changePassword"){let k=w;if(!k.currentPassword||!k.newPassword||!k.confirmPassword||k.newPassword!==k.confirmPassword)return}else if(Ze.type==="addWebhook"){let k=w;if(!k.url||!k.url.trim())return}else if(Ze.type==="addPaymentMethod"){let k=w;if(!k.cardNumber||!k.expiryDate)return}else if(Ze.type==="deleteApiKey"){let k=w;if(!k.keyId&&!k.name)return}else if(Ze.type==="refundPayment"){let k=w;if(!k.transactionId&&!k.customer)return}else if(Ze.type==="createSubscription"){let k=w;if(!k.customerEmail&&!k.customerId)return}else if((Ze.type==="toggleBlockRule"||Ze.type==="enableBlockRule"||Ze.type==="disableBlockRule")&&!w.ruleId)return}n&&n(Ze.type,w),p(k=>k.map(B=>B.kind==="actionForm"&&B.actionType===Ze.type?{...B,isSubmitted:!0}:B)),tp(null),ie({})}async function bu(w){Ra.current.forEach(Y=>window.clearTimeout(Y)),Ra.current=[];let B=[...g].reverse().find(Y=>Y.role==="assistant")?.isNotificationMessage===!0,D=Date.now(),E={id:D,role:"user",content:w};if(p(Y=>Y.map(_=>_.followups&&_.followups.length>0?{..._,followupSelected:!0}:_).concat(E)),B){let Y=Date.now()+1,_={id:Y,role:"assistant",kind:"text",content:""};p(M=>[...M,_]),Zr(Y,"Thank you, your feedback is saved.");return}xu(null),xe("thinking"),Le([]);let Z=!1;try{let Y=new AbortController,_=setTimeout(()=>Y.abort(),6e4),M=await fetch(`${i}/chat/stream`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:L,message:w,current_page:s||"dashboard",user_id:c,user_name:f,user_email:h,user_organization:v,org_id:d}),signal:Y.signal});if(clearTimeout(_),!M.ok)throw new Error(`Agent request failed: ${M.status}`);let I=M.body?.getReader();if(!I)throw new Error("No response body");let J=new TextDecoder,ae="";for(;;){let{done:X,value:me}=await I.read();if(X)break;ae+=J.decode(me,{stream:!0});let et=ae.split(`
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,m.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 h=c.match(/^\d+[.)]\s+(.+)/);if(h){(!a||a.type!=="ol")&&(l(),a={type:"ol",items:[]}),a.items.push(i(h[1]));continue}if(c.trim()===""){l(),r.push((0,m.jsx)("div",{className:"h-2"},r.length));continue}if(c.match(/^[-*_]{3,}$/)){l(),r.push((0,m.jsx)("hr",{className:"my-2 border-gray-200"},r.length));continue}l(),r.push((0,m.jsx)("div",{children:i(c)},r.length))}return l(),(0,m.jsx)(m.Fragment,{children:r})}var MD=[{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"}],$I=[{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?"}]}],vy={"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}}]}},OD=[];function BD({isOpen:e=!0,onClose:t,onOpen:r,onBack:a,onNavigate:o,onActionComplete:n,currentPage:s,agentUrl:i=ED,startingQuestions:l,startingQuestionsEndpoint:u,userId:c,orgId:d,userName:f,userEmail:h,userOrganization:v,supabaseUrl:x,supabaseAnonKey:C}={}){let[g,p]=F.useState(OD),[y,b]=F.useState(""),[L,P]=F.useState(()=>crypto.randomUUID()),[T,A]=F.useState(!1),N=F.useRef(null),[j,pe]=F.useState(!1),ee=F.useRef(null),ir=F.useRef(null),zt=F.useRef(null);F.useEffect(()=>{console.log(`[KiteChat] Chat Panel v${RD} loaded`)},[]);let Po=F.useCallback(()=>{T&&ee.current&&L&&ee.current.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",L),P(crypto.randomUUID()),A(!1),N.current&&(N.current.close(),N.current=null),pe(!1),ir.current&&(ir.current.unsubscribe(),ir.current=null)},[T,L]);F.useEffect(()=>{x&&C&&!ee.current&&(ee.current=xS(x,C))},[x,C]),F.useEffect(()=>{if(!T||!L||!ee.current)return;let w=`typing:${L}`,k=ee.current.channel(w);return console.log(`[KiteChat] Subscribing to typing channel: ${w}`),k.on("broadcast",{event:"typing"},B=>{console.log("[KiteChat] Received typing broadcast:",B);let{sender:D,isTyping:E}=B.payload;D==="agent"&&(console.log(`[KiteChat] Agent typing: ${E}`),pe(E),E&&(zt.current&&window.clearTimeout(zt.current),zt.current=window.setTimeout(()=>{pe(!1)},5e3)))}).subscribe(B=>{console.log(`[KiteChat] Typing channel status: ${B}`),B==="SUBSCRIBED"&&(ir.current=k,console.log("[KiteChat] Typing channel ready"))}),()=>{k.unsubscribe(),ir.current=null,zt.current&&window.clearTimeout(zt.current)}},[T,L]);let Dr=F.useRef(null),ve=F.useCallback(async w=>{if(!(!ee.current||!L))try{await ee.current.from("escalations").update({customer_status:w,customer_last_seen:new Date().toISOString()}).eq("session_id",L)}catch(k){console.error("[KiteChat] Failed to update customer status:",k)}},[L]);F.useEffect(()=>{if(!T||!L||!ee.current)return;let w=L,k=ee.current;ve("active"),Dr.current=window.setInterval(()=>{ve("active")},6e4);let B=()=>{k.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",w)},D=()=>{document.visibilityState==="hidden"?k.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",w):document.visibilityState==="visible"&&ve("active")};return window.addEventListener("beforeunload",B),document.addEventListener("visibilitychange",D),()=>{window.removeEventListener("beforeunload",B),document.removeEventListener("visibilitychange",D),k.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",w).then(()=>{console.log("[KiteChat] Marked customer as disconnected")},E=>{console.error("[KiteChat] Failed to mark disconnected:",E)}),Dr.current&&(window.clearInterval(Dr.current),Dr.current=null)}},[T,L,ve]);let Ye=F.useCallback(w=>{if(!ir.current){console.log("[KiteChat] Cannot send typing - channel not ready");return}if(!T){console.log("[KiteChat] Cannot send typing - not escalated");return}console.log(`[KiteChat] Sending typing indicator: ${w}`),ir.current.send({type:"broadcast",event:"typing",payload:{sender:"user",isTyping:w}})},[T]),mt=F.useRef(null),Aa=F.useCallback(()=>{!T||!ee.current||(Ye(!0),ve("active"),mt.current&&window.clearTimeout(mt.current),mt.current=window.setTimeout(()=>{Ye(!1)},1500))},[T,Ye,ve]),ht=F.useRef({}),Sy=g.length===0,[_n,xe]=F.useState("idle"),[XI,Le]=F.useState([]),Ra=F.useRef([]),JI=g.length?g[g.length-1].role:void 0,[ep,To]=F.useState("landing"),[Cy,_o]=F.useState(void 0),[QI,by]=F.useState(l||MD),[YI,Ly]=F.useState(!1);F.useEffect(()=>{u&&!l&&(Ly(!0),fetch(u).then(w=>w.json()).then(w=>{Array.isArray(w)&&w.length>0&&by(w)}).catch(w=>{console.warn("[KiteChat] Failed to fetch starting questions:",w)}).finally(()=>Ly(!1)))},[u,l]),F.useEffect(()=>{l&&by(l)},[l]);let[ge,Ea]=F.useState(void 0),Be=F.useRef(void 0),Iy=F.useRef(null),[bi,Li]=F.useState(!1);F.useEffect(()=>{window.resetIntegrationNotification=()=>{localStorage.removeItem("gmailNotificationSeen"),console.log("Integration notification reset! Click the Integrations tab to see it again.")};let w=()=>{if(!localStorage.getItem("gmailNotificationSeen")){To("landing"),_o(void 0);let B=Date.now(),D="I see you're exploring integrations. Let me know if there are any other connections we should add.",E={id:B,role:"assistant",kind:"text",content:"",isNotificationMessage:!0};p(Z=>[...Z,E]),Zr(B,D),localStorage.setItem("gmailNotificationSeen","true")}};return window.addEventListener("integrationTabClicked",w),()=>{window.removeEventListener("integrationTabClicked",w)}},[]),F.useEffect(()=>{ge?(!Be.current||Be.current.id!==ge.id||Be.current.stepIndex!==ge.stepIndex)&&(Be.current=ge):Be.current=void 0},[ge]);let[Ii,xu]=F.useState(null),[Ze,tp]=F.useState(null),[se,ie]=F.useState({}),ky=F.useRef(null),rp=F.useRef(null),wu=F.useRef(null),{cursorState:Su,moveTo:Ao,hide:An}=jI(),[Ro,ap]=F.useState(null),[Py,Da]=F.useState(null),op=F.useRef(null),Rn=F.useRef(null),[Ty,ki]=F.useState(!1),[En,Cu]=F.useState(""),_y=F.useRef(null);F.useEffect(()=>{if(!ge||ge.id!=="add-api-key"||ge.stepIndex!==2)return;let k=setInterval(()=>{let B=document.querySelector('[role="dialog"]'),D=Be.current;if(B&&D&&D.id==="add-api-key"&&D.stepIndex===2){An();let E=Date.now()+1;p(Z=>[...Z,{id:E,role:"assistant",kind:"guideComplete",content:"Perfect! The dialog is now open. You can enter a name and create your API key."}]),Ea(void 0),Li(!0)}},300);return()=>clearInterval(k)},[ge,An]),F.useEffect(()=>()=>{Object.values(ht.current).forEach(w=>window.clearInterval(w)),ht.current={},Ra.current.forEach(w=>window.clearTimeout(w)),Ra.current=[]},[]),F.useEffect(()=>{if(ge&&g.length>0){let w=g[g.length-1];if((w.kind==="guideStep"||w.kind==="guideComplete")&&wu.current&&rp.current){let k=rp.current,B=wu.current,D=k.getBoundingClientRect(),Z=B.getBoundingClientRect().top-D.top+k.scrollTop;k.scrollTop=Z}}else!ge&&g.length>0&&ky.current?.scrollIntoView({behavior:"smooth"})},[g,_n,ge]);let Ay=F.useMemo(()=>{for(let w=g.length-1;w>=0;w--){let k=g[w];if(k.kind==="bulkSummary"&&k.bulkSummary?.navigationPage&&k.bulkSummary.successes>0)return k.bulkSummary.navigationPage}return null},[g]);F.useEffect(()=>{Iy.current=Ay},[Ay]),F.useEffect(()=>{op.current=Py},[Py]),F.useEffect(()=>{let w=k=>{if((k.metaKey||k.ctrlKey)&&k.key==="Enter"){let B=op.current;if(B){k.preventDefault(),k.stopPropagation(),ip(B);return}if(Ze){k.preventDefault(),k.stopPropagation(),sp();return}if(Ii){k.preventDefault(),k.stopPropagation(),np(Ii);return}let D=Iy.current;if(console.log("[DEBUG] Keyboard handler - latestBulkSummaryNavigation:",D,"onNavigate:",!!o),D&&o){console.log("[DEBUG] Navigating via keyboard to:",D.page),k.preventDefault(),k.stopPropagation(),o(D.page,D.subtab);return}if(bi){k.preventDefault(),k.stopPropagation(),Ey();return}if(Be.current){k.preventDefault(),k.stopPropagation(),lp();return}}};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[Ze,Ii,ge,bi,o]);let Ry=F.useCallback(w=>{if(!i)return;N.current&&N.current.close();let k=i.replace(/^http/,"ws")+`/ws/escalation/${w}`,B=new WebSocket(k);B.onmessage=D=>{try{let E=JSON.parse(D.data);E.type==="agent_message"?p(Z=>{let Y=E.content,_=E.message_id;return(_?Z.some(I=>I.serverMessageId===_):Z.slice(-5).some(I=>I.content===Y))?(console.debug("[KiteChat] Skipping duplicate agent message:",_||Y.slice(0,30)),Z):[...Z,{id:Date.now(),role:"agent",kind:"text",content:Y,serverMessageId:_}]}):E.type==="error"&&console.error("[KiteChat] Escalation error:",E.message)}catch(E){console.error("[KiteChat] Failed to parse escalation message:",E)}},B.onerror=D=>{console.error("[KiteChat] Escalation WebSocket error:",D)},B.onclose=()=>{console.log("[KiteChat] Escalation WebSocket closed")},N.current=B},[i]),ZI=F.useCallback(async w=>{if(!N.current||N.current.readyState!==WebSocket.OPEN)return console.error("[KiteChat] Escalation WebSocket not connected"),!1;try{return N.current.send(JSON.stringify({type:"user_message",content:w})),ve("active"),!0}catch(k){return console.error("[KiteChat] Failed to send escalated message:",k),!1}},[ve]);F.useEffect(()=>()=>{N.current&&N.current.close()},[]),F.useEffect(()=>{T&&L&&Ry(L)},[T,L,Ry]);function Zr(w,k,B){let D=k||"",E=B;if(k&&k.startsWith("{")&&k.includes('"response"'))try{let M=0,I=0;for(let X=0;X<k.length;X++)if(k[X]==="{")M++;else if(k[X]==="}"&&(M--,M===0)){I=X+1;break}let J=I>0?k.slice(0,I):k,ae=JSON.parse(J);ae.response&&typeof ae.response=="string"&&(D=ae.response,!E&&ae.followups&&(E=ae.followups))}catch{}D=DD(D);let Z=D.split(" "),Y=0,_=window.setInterval(()=>{Y+=1,p(M=>M.map(I=>I.id===w?{...I,content:Z.slice(0,Y).join(" ")}:I)),Y>=Z.length&&(window.clearInterval(_),delete ht.current[w],E&&E.length>0&&p(M=>M.map(I=>I.id===w?{...I,followups:E}:I)),xe("idle"))},25);ht.current[w]=_}function ek(w,k){p(B=>B.map(D=>D.id===w?{...D,followupSelected:!0}:D)),bu(k.label)}function Ey(){Object.values(ht.current).forEach(w=>window.clearInterval(w)),ht.current={},Ra.current.forEach(w=>window.clearTimeout(w)),Ra.current=[],An(),Po(),p([]),b(""),xe("idle"),To("landing"),_o(void 0),Ea(void 0),Li(!1),xu(null),tp(null),ie({}),a&&a()}function qD(w){To("folder"),_o(w)}function tk(){To("landing"),_o(void 0)}function rk(w){w.preventDefault();let k=y.trim();if(Ro){if(!k){let B={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(D=>[...D,B]);return}ok(k,Ro),b(""),ap(null),Rn.current&&(Rn.current.value="");return}if(k){if(T){let B={id:Date.now(),role:"user",content:k};p(D=>[...D,B]),ZI(k),Ye(!1),mt.current&&(window.clearTimeout(mt.current),mt.current=null),b("");return}bu(k),b("")}}function ak(w){let k={dashboard:"dashboard",customers:"customers page",payments:"payments page",settings:"settings page",support:"support page",disputes:"disputes page",radar:"radar page"};if(w.page==="settings"&&w.subtab){let B={general:"General",billing:"Billing",security:"Security",api:"API Keys",notifications:"Notifications",integrations:"Integrations"};return`${k.settings} (${B[w.subtab]} tab)`}return k[w.page]}function np(w){o&&o(w.page,w.subtab),xu(null),p(k=>k.map(B=>B.kind==="navigationAction"&&B.navigationTarget?.page===w.page&&B.navigationTarget?.subtab===w.subtab?{...B,navigationTarget:void 0}:B))}function sp(){if(!Ze)return;let w=se;if(Ze.type!=="updateCompanyInfo"){if(Ze.type==="addApiKey"){let k=w;if(!k.name||!k.name.trim())return}else if(Ze.type==="addCustomer"){let k=w;if(!k.name||!k.name.trim()||!k.email||!k.email.trim())return}else if(Ze.type==="changePassword"){let k=w;if(!k.currentPassword||!k.newPassword||!k.confirmPassword||k.newPassword!==k.confirmPassword)return}else if(Ze.type==="addWebhook"){let k=w;if(!k.url||!k.url.trim())return}else if(Ze.type==="addPaymentMethod"){let k=w;if(!k.cardNumber||!k.expiryDate)return}else if(Ze.type==="deleteApiKey"){let k=w;if(!k.keyId&&!k.name)return}else if(Ze.type==="refundPayment"){let k=w;if(!k.transactionId&&!k.customer)return}else if(Ze.type==="createSubscription"){let k=w;if(!k.customerEmail&&!k.customerId)return}else if((Ze.type==="toggleBlockRule"||Ze.type==="enableBlockRule"||Ze.type==="disableBlockRule")&&!w.ruleId)return}n&&n(Ze.type,w),p(k=>k.map(B=>B.kind==="actionForm"&&B.actionType===Ze.type?{...B,isSubmitted:!0}:B)),tp(null),ie({})}async function bu(w){Ra.current.forEach(Y=>window.clearTimeout(Y)),Ra.current=[];let B=[...g].reverse().find(Y=>Y.role==="assistant")?.isNotificationMessage===!0,D=Date.now(),E={id:D,role:"user",content:w};if(p(Y=>Y.map(_=>_.followups&&_.followups.length>0?{..._,followupSelected:!0}:_).concat(E)),B){let Y=Date.now()+1,_={id:Y,role:"assistant",kind:"text",content:""};p(M=>[...M,_]),Zr(Y,"Thank you, your feedback is saved.");return}xu(null),xe("thinking"),Le([]);let Z=!1;try{let Y=new AbortController,_=setTimeout(()=>Y.abort(),6e4),M=await fetch(`${i}/chat/stream`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:L,message:w,current_page:s||"dashboard",user_id:c,user_name:f,user_email:h,user_organization:v,org_id:d}),signal:Y.signal});if(clearTimeout(_),!M.ok)throw new Error(`Agent request failed: ${M.status}`);let I=M.body?.getReader();if(!I)throw new Error("No response body");let J=new TextDecoder,ae="";for(;;){let{done:X,value:me}=await I.read();if(X)break;ae+=J.decode(me,{stream:!0});let et=ae.split(`
63
63
 
64
64
  `);ae=et.pop()||"";for(let gt of et){if(!gt.trim())continue;let ea=gt.split(`
65
65
  `),tt="",vr="";for(let $ of ea)$.startsWith("event: ")?tt=$.slice(7):$.startsWith("data: ")&&(vr=$.slice(6));if(!(!tt||!vr))try{let $=JSON.parse(vr);if(tt==="progress")$.status==="thinking"?(xe("thinking"),Le([{message:$.message,completed:!1}])):$.status==="searching"?(xe("thinking"),Le([{message:$.message||"Searching knowledge base...",completed:!1}])):$.status==="evaluating"?(xe("thinking"),Le([{message:$.message||"Evaluating sources...",completed:!1}])):$.status==="executing"?(xe("executing"),Le(q=>{let oe=q.map(Rt=>({...Rt,completed:!0})),de=oe[oe.length-1];return(!de||de.message!==$.message)&&oe.push({message:$.message,completed:!1}),oe})):$.status==="responding"&&(xe("responding"),Le(q=>q.map(oe=>({...oe,completed:!0}))));else if(tt==="response"){Le([]),Z=!0;let q=$;if(q.action==="navigate"&&q.navigation){let oe={page:q.navigation.page,subtab:q.navigation.subtab};xu(oe);let de={id:D+1,role:"assistant",kind:"navigationAction",content:q.response||`I can take you to the ${ak(oe)}.`,navigationTarget:oe};p(Rt=>[...Rt,de]),xe("idle")}else if(q.action==="show_form"&&q.actionType){tp({type:q.actionType,data:q.actionData||{}}),ie(q.actionData||{});let oe={id:D+1,role:"assistant",kind:"actionForm",content:q.response||q.message||"Please fill in the details below:",actionType:q.actionType,actionData:q.actionData||{}};p(de=>[...de,oe]),xe("idle")}else if(q.action==="suggest_bulk"){let oe=D+1,de={id:oe,role:"assistant",kind:"text",content:""};p(Rt=>[...Rt,de]),Zr(oe,q.response||q.message||"For bulk operations, you can upload a CSV file - just click the \u{1F4CE} button!",q.followups),Z=!0}else if(q.action==="bulk_preview"){Da(q.bulk_session_id);let oe={id:D+1,role:"assistant",kind:"bulkPreview",content:q.message||`I found ${q.csv_data?.rowCount||0} items. Here's a preview:`,csvData:q.csv_data?{rowCount:q.csv_data.rowCount,columns:q.csv_data.columns,sampleRows:q.csv_data.sampleRows,fileName:"From context"}:void 0,suggestedAction:q.suggested_action,bulkSessionId:q.bulk_session_id};p(de=>[...de,oe]),xe("idle"),Z=!0}else if(q.action==="execute"&&q.executionResult){let oe=D+1,de={id:oe,role:"assistant",kind:"text",content:"",structuredData:q.structuredData||void 0};p(Rt=>[...Rt,de]),Zr(oe,q.response||"Action completed successfully.",q.followups),Z=!0,setTimeout(()=>{window.dispatchEvent(new CustomEvent("agentActionComplete",{detail:{result:q.executionResult}}))},100)}else{let oe=D+1,de={id:oe,role:"assistant",kind:"text",content:""};p(Rt=>[...Rt,de]),Zr(oe,q.response||q.message||"",q.followups),Z=!0}}else if(tt==="error"){xe("idle"),Le([]),Z=!0;let q=D+1,oe={id:q,role:"assistant",kind:"text",content:""};p(de=>[...de,oe]),Zr(q,$.message||"An error occurred processing your request.")}else if(tt==="done")Le([]),xe("idle"),Z=!0;else if(tt==="escalation"){A(!0),xe("idle");let oe={id:Date.now()+2,role:"assistant",kind:"text",content:$.message||"You've been connected to our support queue. An agent will be with you shortly."};p(de=>[...de,oe])}}catch($){console.error("Failed to parse SSE event:",$)}}}Le([]),Z||xe("idle")}catch(Y){console.error("Agent request failed:",Y),Le([]);let _=D+1,M={id:_,role:"assistant",kind:"text",content:""};p(J=>[...J,M]);let I="I'm having trouble connecting to my backend.";Y instanceof Error&&(Y.name==="AbortError"?I="The request timed out. The server might be busy - please try again.":Y.message.includes("Failed to fetch")||Y.message.includes("NetworkError")?I="I'm having trouble connecting to my backend. Please make sure the agent server is running on port 5002.":Y.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.",Zr(_,I)}finally{Le([])}}async function ok(w,k){Ra.current.forEach(E=>window.clearTimeout(E)),Ra.current=[];let B=Date.now(),D={id:B,role:"user",content:`\u{1F4CE} ${k.name}
@@ -70,15 +70,15 @@ ${w}`};p(E=>[...E,D]),xe("thinking"),Le([{message:"Analyzing CSV file...",comple
70
70
  `),tt="",vr="";for(let $ of ea)$.startsWith("event: ")?tt=$.slice(7):$.startsWith("data: ")&&(vr=$.slice(6));if(!(!tt||!vr))try{let $=JSON.parse(vr);if(tt==="preview"){xe("idle"),Le([]),ae=$.bulk_session_id,Da(ae);let q={id:B+1,role:"assistant",kind:"bulkPreview",content:$.message||`I found ${$.csv_data.rowCount} rows in your CSV. Here's a preview:`,csvData:{rowCount:$.csv_data.rowCount,columns:$.csv_data.columns,sampleRows:$.csv_data.sampleRows,fileName:k.name},suggestedAction:$.suggested_action,bulkSessionId:ae||void 0};p(oe=>[...oe,q])}else if(tt==="progress")xe("executing"),Le([{message:`Processing row ${$.row} of ${$.total}...`,completed:!1}]),p(q=>q[q.length-1]?.kind==="bulkProgress"?q.map((de,Rt)=>Rt===q.length-1?{...de,bulkProgress:{processed:$.row,total:$.total,successes:$.successes||0,failures:$.failures||0}}:de):[...q,{id:Date.now(),role:"assistant",kind:"bulkProgress",bulkProgress:{processed:$.row,total:$.total,successes:$.successes||0,failures:$.failures||0}}]);else if(tt==="summary")xe("idle"),Le([]),Da(null),p(q=>[...q.filter(de=>de.kind!=="bulkProgress"),{id:Date.now(),role:"assistant",kind:"bulkSummary",content:$.message,bulkSummary:{total:$.total,successes:$.successes,failures:$.failures||[],navigationPage:$.navigationPage}}]),setTimeout(()=>{window.dispatchEvent(new CustomEvent("agentActionComplete",{detail:{result:{bulk:!0,total:$.total,successes:$.successes}}}))},100);else if(tt==="error"){xe("idle"),Le([]),Da(null);let q={id:B+1,role:"assistant",kind:"text",content:$.message||"An error occurred processing your CSV file."};p(oe=>[...oe,q])}else tt==="done"&&(xe("idle"),Le([]))}catch($){console.error("Failed to parse bulk SSE event:",$)}}}Le([]),xe("idle")}catch(E){console.error("Bulk upload failed:",E),Le([]),xe("idle");let Z="I'm having trouble processing your CSV file.";E instanceof Error&&(E.name==="AbortError"?Z="The bulk upload request timed out. The file might be too large or the server is busy - please try again.":E.message.includes("Failed to fetch")||E.message.includes("NetworkError")?Z="I'm having trouble connecting to my backend. Please make sure the agent server is running on port 5002.":E.message.includes("Bulk upload failed:")&&(Z="The server encountered an error processing your CSV file. Please try again.")),Z+=" Please try again.";let Y={id:B+1,role:"assistant",kind:"text",content:Z};p(_=>[..._,Y])}}async function ip(w){xe("executing"),Le([{message:"Starting bulk operation...",completed:!1}]);try{let k=await fetch(`${i}/chat/bulk/confirm`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({bulk_session_id:w})});if(!k.ok)throw new Error(`Confirm failed: ${k.status}`);let B=k.body?.getReader();if(!B)throw new Error("No response body");let D=new TextDecoder,E="";for(;;){let{done:Z,value:Y}=await B.read();if(Z)break;E+=D.decode(Y,{stream:!0});let _=E.split(`
71
71
 
72
72
  `);E=_.pop()||"";for(let M of _){if(!M.trim())continue;let I=M.split(`
73
- `),J="",ae="";for(let X of I)X.startsWith("event: ")?J=X.slice(7):X.startsWith("data: ")&&(ae=X.slice(6));if(!(!J||!ae))try{let X=JSON.parse(ae);if(J==="progress")Le([{message:`Processing row ${X.row} of ${X.total}...`,completed:!1}]),p(me=>me[me.length-1]?.kind==="bulkProgress"?me.map((gt,ea)=>ea===me.length-1?{...gt,bulkProgress:{processed:X.row,total:X.total,successes:X.successes||0,failures:X.failures||0}}:gt):[...me,{id:Date.now(),role:"assistant",kind:"bulkProgress",bulkProgress:{processed:X.row,total:X.total,successes:X.successes||0,failures:X.failures||0}}]);else if(J==="summary")console.log("[DEBUG] Received summary event - data:",X),console.log("[DEBUG] navigationPage from backend:",X.navigationPage),xe("idle"),Le([]),Da(null),p(me=>{let et=me.filter(ea=>ea.kind!=="bulkProgress"&&ea.kind!=="bulkPreview"),gt={id:Date.now(),role:"assistant",kind:"bulkSummary",content:X.message,bulkSummary:{total:X.total,successes:X.successes,failures:X.failures||[],navigationPage:X.navigationPage}};return console.log("[DEBUG] Creating bulkSummary message:",gt),[...et,gt]}),setTimeout(()=>{window.dispatchEvent(new CustomEvent("agentActionComplete",{detail:{result:{bulk:!0,total:X.total,successes:X.successes}}}))},100);else if(J==="error"){xe("idle"),Le([]),Da(null);let me={id:Date.now(),role:"assistant",kind:"text",content:X.message||"An error occurred during bulk processing."};p(et=>[...et,me])}}catch(X){console.error("Failed to parse confirm SSE event:",X)}}}}catch(k){console.error("Bulk confirm failed:",k),xe("idle"),Le([]),Da(null);let B={id:Date.now(),role:"assistant",kind:"text",content:"Failed to start bulk operation. Please try again."};p(D=>[...D,B])}}function nk(){Da(null),p(w=>w.filter(k=>k.kind!=="bulkPreview"))}function Dy(w){bu(w)}function sk(w){let k=Date.now()+Math.floor(Math.random()*1e3);p(B=>[...B,{id:k,role:"assistant",kind:"text",content:w}])}function qD(w){let k=vy[w];if(!k)return;_o("landing"),Ao(void 0);let B={id:w,stepIndex:0};Ea(B),Be.current=B,sk(`I'll help you with ${k.title}.`);let D=k.steps[0],E=D.cursorTarget?.selector.includes("[data-page="),Z=D.cursorTarget?.selector.includes("[data-settings-tab=");if(D.cursorTarget&&(E||Z)){let _=D.cursorTarget;Z&&D.navigation&&o&&o(D.navigation.page,void 0),setTimeout(()=>{let I=()=>{let J=document.querySelector(_.selector);J&&J.offsetParent!==null?(Ro(_),_.onClick&&setTimeout(()=>{J.click()},1200)):setTimeout(I,200)};I()},Z?800:400)}else if(D.navigation&&o&&o(D.navigation.page,D.navigation.subtab),D.cursorTarget){let _=D.cursorTarget,M=_.selector.includes("data-settings-tab"),I=_.selector.includes("dialog")||_.selector.includes("api-key-name-input");setTimeout(()=>{let ae=()=>{let X=document.querySelector(_.selector);X&&X.offsetParent!==null?(Ro(_),_.onClick&&setTimeout(()=>{X.click()},1e3)):M||I?setTimeout(ae,200):(Ro(_),_.onClick&&setTimeout(()=>{let me=document.querySelector(_.selector);me&&me.click()},1e3))};ae()},I?700:M?600:400)}let Y={id:Date.now()+1,role:"assistant",kind:"guideStep",content:"",guideStepIndex:0};p(_=>[..._,Y]),Zr(Y.id,D.text)}function lp(){if(!ge)return;let w=vy[ge.id];if(!w)return;let k=Be.current;(!k||k.id!==ge.id)&&(k=ge,Be.current=ge);let D=k.stepIndex+1;if(D>=w.steps.length){An();let I=Date.now()+1;p(J=>[...J,{id:I,role:"assistant",kind:"guideComplete",content:"Guide Complete"}]),Ea(void 0),Li(!0);return}let E=w.steps[D],Z={id:ge.id,stepIndex:D};Ea(Z),Be.current=Z;let Y={id:Date.now()+1,role:"assistant",kind:"guideStep",content:"",guideStepIndex:D};p(I=>[...I,Y]);let _=E.cursorTarget?.selector.includes("[data-page="),M=E.cursorTarget?.selector.includes("[data-settings-tab=");if(E.cursorTarget&&(_||M)){let I=E.cursorTarget;M&&E.navigation&&o&&o(E.navigation.page,void 0),setTimeout(()=>{let ae=Be.current;if(!ae||ae.id!==w.id||ae.stepIndex!==D)return;let X=()=>{let me=Be.current;if(!me||me.id!==w.id||me.stepIndex!==D)return;let et=document.querySelector(I.selector);et&&et.offsetParent!==null?(Ro(I),I.onClick&&setTimeout(()=>{let gt=Be.current;!gt||gt.id!==w.id||gt.stepIndex!==D||et.click()},1200)):setTimeout(X,200)};X()},M?800:400)}else if(E.navigation&&o&&o(E.navigation.page,E.navigation.subtab),E.cursorTarget){let I=E.cursorTarget,J=I.selector.includes("dialog")||I.selector.includes("api-key-name-input"),ae=I.selector.includes("data-settings-tab"),X=E.navigation?.subtab&&ae&&I.selector.includes(`data-settings-tab="${E.navigation.subtab}"`),me=I.onClick&&!X,et=!!E.navigation,tt=(!!E.navigation?.subtab?700:et?400:0)+(J?700:ae?600:400);setTimeout(()=>{let vr=Be.current;if(!vr||vr.id!==w.id||vr.stepIndex!==D)return;let $=()=>{let q=Be.current;if(!q||q.id!==w.id||q.stepIndex!==D)return;let oe=document.querySelector(I.selector);oe&&oe.offsetParent!==null?(Ro(I),me&&setTimeout(()=>{let de=Be.current;!de||de.id!==w.id||de.stepIndex!==D||oe.click()},1e3)):J||ae||I.selector.includes("data-testid")?setTimeout($,200):(Ro(I),me&&setTimeout(()=>{let de=Be.current;if(!de||de.id!==w.id||de.stepIndex!==D)return;let Rt=document.querySelector(I.selector);Rt&&Rt.click()},1e3))};$()},tt)}else An();Zr(Y.id,E.text)}function ik(){if(!ge)return;let w=vy[ge.id];if(!w)return;let k=ge.stepIndex-1;if(k>=0){Ea({id:ge.id,stepIndex:k});let B=w.steps[k];B.navigation&&o&&o(B.navigation.page,B.navigation.subtab),B.cursorTarget?setTimeout(()=>{Ro(B.cursorTarget)},500):An();let D=g.filter(E=>E.kind!=="guideStep"&&E.kind!=="guideComplete");p([...D,{id:Date.now(),role:"assistant",kind:"guideStep",content:B.text}])}}return e?(0,m.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:`${WI}px`},children:[(0,m.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,m.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,m.jsx)(Hr,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"}),(0,m.jsx)("h3",{className:"text-sm font-semibold text-gray-800",children:"Copilot"})]}),(0,m.jsxs)("div",{className:"flex items-center gap-1",children:[(0,m.jsx)(Bt,{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:()=>{Po(),p([]),_o("landing"),Ao(void 0),Ea(void 0),Be.current=void 0,Li(!1)},children:(0,m.jsx)(Ut,{className:"h-3 w-3"})}),(0,m.jsx)(Bt,{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&&(Po(),p([]),_o("landing"),Ao(void 0),Ea(void 0),Be.current=void 0,Li(!1)),t?.()},children:(0,m.jsx)($l,{className:"h-3.5 w-3.5"})})]})]}),(0,m.jsx)("div",{className:Sy?"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:Sy?(0,m.jsxs)("div",{className:"w-full overflow-y-auto px-4",children:[(0,m.jsx)("div",{className:"py-3 transition-all duration-300",children:(0,m.jsx)("h2",{className:"text-center text-2xl font-semibold text-gray-900",children:ep==="folder"?$I.find(w=>w.id===Cy)?.title||"":"How can I help?"})}),(0,m.jsxs)("div",{className:"pb-4 px-4",children:[ep==="landing"&&(0,m.jsx)(m.Fragment,{children:(0,m.jsx)("div",{className:"flex flex-col gap-1",children:YI?(0,m.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,m.jsx)(tr,{className:"h-4 w-4 animate-spin text-gray-400"})}):QI.map((w,k)=>{let B=["bg-blue-400","bg-green-400","bg-purple-400","bg-orange-400","bg-pink-400"];return(0,m.jsxs)(Bt,{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:()=>Dy(w.prompt),children:[(0,m.jsx)("span",{className:`mr-2 inline-block h-1.5 w-1.5 rounded-full ${B[k%B.length]}`}),w.label]},w.id)})})}),ep==="folder"&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,m.jsx)(Bt,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 rounded-full hover:bg-gray-100",onClick:tk,"aria-label":"Back to suggestions",children:(0,m.jsx)(ks,{className:"h-4 w-4 text-gray-500"})}),(0,m.jsx)("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-400",children:"Topics"})]}),(0,m.jsx)("div",{className:"flex flex-col gap-1.5",children:$I.find(w=>w.id===Cy)?.topics.map(w=>(0,m.jsx)(Bt,{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:()=>Dy(w.prompt),children:w.label},w.id))})]})]})]}):(0,m.jsx)(m.Fragment,{children:(0,m.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:(0,m.jsx)(fg,{ref:rp,className:"h-full",children:(0,m.jsxs)("div",{className:"flex flex-col gap-2 px-4 py-3",children:[g.map((w,k)=>{let B=w.role==="user",D=k>0?g[k-1].role:void 0,E=D!==void 0&&D!==w.role,Z=Be.current||ge,Y=!1;if(Z&&w.kind==="guideStep"?w.guideStepIndex!==void 0?Y=w.guideStepIndex===Z.stepIndex:Y=k===g.length-1:w.kind==="guideComplete"&&(Y=k===g.length-1),w.kind==="guideStep"&&!Y)return null;if(B)return(0,m.jsx)("div",{className:`flex justify-end ${E?"mt-3":""}`,children:(0,m.jsx)("div",{className:"max-w-[260px] rounded-2xl rounded-br-md bg-gray-900 px-3 py-2 text-xs text-white shadow-sm",children:w.content})},w.id);if(w.role==="agent")return(0,m.jsxs)("div",{className:`flex flex-col items-start ${E?"mt-3":""}`,children:[E&&(0,m.jsx)("span",{className:"text-[10px] text-gray-500 mb-1 ml-1",children:"Agent"}),(0,m.jsx)("div",{className:"max-w-[260px] rounded-2xl rounded-bl-md bg-white border border-gray-200 px-3 py-2 text-xs text-gray-800 shadow-sm",children:w.content})]},w.id);if(w.kind==="searchSummary")return(0,m.jsx)("div",{className:`${E?"mt-3":""}`,children:(0,m.jsx)(vC,{title:w.title??"Search results",links:w.links??[]})},w.id);if(w.kind==="guideComplete")return(0,m.jsx)("div",{ref:Y?wu:null,className:`${E?"mt-3":""}`,children:(0,m.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,m.jsx)(nt,{className:"h-5 w-5 text-green-600 flex-shrink-0"}),(0,m.jsx)("span",{className:"font-medium text-green-800",children:w.content})]})},w.id);if(w.kind==="navigationAction")return(0,m.jsxs)("div",{className:`${E?"mt-3":""}`,children:[(0,m.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 mb-2 text-gray-700",children:w.content||""}),w.navigationTarget&&(0,m.jsx)("div",{className:"mt-2",children:(0,m.jsxs)(Bt,{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:()=>w.navigationTarget&&np(w.navigationTarget),children:[(0,m.jsx)("span",{children:"Confirm"}),(0,m.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,m.jsx)(va,{className:"h-3 w-3"}),(0,m.jsx)(xa,{className:"h-3 w-3"})]})]})})]},w.id);if(w.kind==="actionForm"){let _=w.actionType,M=Object.keys(se).length>0?se:w.actionData||{};if(w.isSubmitted){let I="";return _==="updateCompanyInfo"?I="Company information has been updated successfully.":_==="addApiKey"?I="API key has been added successfully.":_==="addCustomer"?I="Customer has been added successfully.":_==="enable2FA"?I="Two-factor authentication has been enabled successfully.":_==="disable2FA"?I="Two-factor authentication has been disabled successfully.":_==="changePassword"?I="Your password has been changed successfully.":_==="revokeSession"?I="Session has been revoked successfully.":_==="toggleNotification"?I="Notification preferences have been updated successfully.":_==="connectIntegration"?I="Integration has been connected successfully.":_==="disconnectIntegration"?I="Integration has been disconnected successfully.":_==="addPaymentMethod"?I="Payment method has been added successfully.":_==="removePaymentMethod"?I="Payment method has been removed successfully.":_==="deleteApiKey"?I="API key has been deleted successfully.":_==="addWebhook"?I="Webhook endpoint has been added successfully.":_==="updateCurrency"?I="Currency preference has been updated successfully.":_==="updateTimezone"?I="Timezone has been updated successfully.":_==="refundPayment"?I="Refund has been processed successfully.":_==="exportCertificate"?I="Certificate of Incorporation has been downloaded successfully.":_==="createSubscription"?I="Subscription has been created successfully.":_==="toggleBlockRule"||_==="enableBlockRule"||_==="disableBlockRule"?I="Block rule has been updated successfully.":I="Action completed successfully.",(0,m.jsx)("div",{className:`${E?"mt-3":""}`,children:(0,m.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 text-gray-700",children:I})},w.id)}return(0,m.jsxs)("div",{className:`min-w-0 ${E?"mt-3":""}`,children:[(0,m.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 mb-3 text-gray-700",children:w.content||""}),_==="updateCompanyInfo"&&(0,m.jsxs)("div",{className:"space-y-2 bg-gray-50 rounded-lg p-2 border border-gray-200 overflow-hidden",children:[(0,m.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Company Name"}),(0,m.jsx)(Oe,{placeholder:"Acme Corporation",value:M.companyName||"",onChange:I=>ie({...se,companyName:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Email"}),(0,m.jsx)(Oe,{type:"email",placeholder:"contact@acme.com",value:M.email||"",onChange:I=>ie({...se,email:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Address"}),(0,m.jsx)(Oe,{placeholder:"123 Main St, San Francisco, CA",value:M.address||"",onChange:I=>ie({...se,address:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,m.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Phone"}),(0,m.jsx)(Oe,{type:"tel",placeholder:"+1 (555) 123-4567",value:M.phone||"",onChange:I=>ie({...se,phone:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Website"}),(0,m.jsx)(Oe,{type:"url",placeholder:"https://acme.com",value:M.website||"",onChange:I=>ie({...se,website:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]})]}),_==="addApiKey"&&(0,m.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"API Key Name"}),(0,m.jsx)(Oe,{placeholder:"Production Key",value:M.name||"",onChange:I=>ie({...se,name:I.target.value}),className:"h-8 text-xs border-gray-200"})]})}),_==="addCustomer"&&(0,m.jsxs)("div",{className:"space-y-2 bg-gray-50 rounded-lg p-2 border border-gray-200 overflow-hidden",children:[(0,m.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Company Name"}),(0,m.jsx)(Oe,{placeholder:"Acme Corporation",value:M.name||"",onChange:I=>ie({...se,name:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Email"}),(0,m.jsx)(Oe,{type:"email",placeholder:"contact@acme.com",value:M.email||"",onChange:I=>ie({...se,email:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Location"}),(0,m.jsx)(Oe,{placeholder:"San Francisco, CA",value:M.location||"",onChange:I=>ie({...se,location:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Subscription Tier"}),(0,m.jsxs)("select",{value:M.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,m.jsx)("option",{value:"Starter",children:"Starter"}),(0,m.jsx)("option",{value:"Professional",children:"Professional"}),(0,m.jsx)("option",{value:"Enterprise",children:"Enterprise"})]})]})]}),(_==="enable2FA"||_==="disable2FA")&&(0,m.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,m.jsx)("p",{className:"text-xs text-black",children:_==="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."})}),_==="changePassword"&&(0,m.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Current Password"}),(0,m.jsx)(Oe,{type:"password",value:M.currentPassword||"",onChange:I=>ie({...se,currentPassword:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"New Password"}),(0,m.jsx)(Oe,{type:"password",value:M.newPassword||"",onChange:I=>ie({...se,newPassword:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Confirm New Password"}),(0,m.jsx)(Oe,{type:"password",value:M.confirmPassword||"",onChange:I=>ie({...se,confirmPassword:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),_==="toggleNotification"&&(0,m.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Notification Type"}),(0,m.jsxs)("select",{value:M.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,m.jsx)("option",{value:"paymentReceived",children:"Payment Received"}),(0,m.jsx)("option",{value:"paymentFailed",children:"Payment Failed"}),(0,m.jsx)("option",{value:"invoicePaid",children:"Invoice Paid"}),(0,m.jsx)("option",{value:"monthlySummary",children:"Monthly Summary"}),(0,m.jsx)("option",{value:"productUpdates",children:"Product Updates"})]})]}),(0,m.jsxs)("div",{className:"flex items-center gap-2",children:[(0,m.jsx)("input",{type:"checkbox",checked:M.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,m.jsx)("label",{className:"text-xs text-black",children:"Enable this notification"})]})]}),(_==="connectIntegration"||_==="disconnectIntegration")&&(0,m.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Integration"}),(0,m.jsxs)("select",{value:M.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,m.jsx)("option",{value:"Slack",children:"Slack"}),(0,m.jsx)("option",{value:"Zapier",children:"Zapier"}),(0,m.jsx)("option",{value:"Webhook",children:"Webhook"})]})]})}),_==="addPaymentMethod"&&(0,m.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Card Number"}),(0,m.jsx)(Oe,{placeholder:"1234 5678 9012 3456",value:M.cardNumber||"",onChange:I=>ie({...se,cardNumber:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Expiry Date"}),(0,m.jsx)(Oe,{placeholder:"MM/YY",value:M.expiryDate||"",onChange:I=>ie({...se,expiryDate:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),_==="removePaymentMethod"&&(0,m.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,m.jsx)("p",{className:"text-xs text-black",children:"This will remove the default payment method from your account."})}),_==="refundPayment"&&(0,m.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Transaction ID or Customer Name"}),(0,m.jsx)(Oe,{placeholder:"e.g., txn_1234 or Acme Corp",value:M.transactionId||M.customer||"",onChange:I=>{let J=I.target.value;J.startsWith("txn_")||/^\d+$/.test(J)?ie({...se,transactionId:J,customer:void 0}):ie({...se,customer:J,transactionId:void 0})},className:"h-8 text-xs border-gray-200"})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Amount (optional)"}),(0,m.jsx)(Oe,{placeholder:"$0.00",value:M.amount||"",onChange:I=>ie({...se,amount:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Reason (optional)"}),(0,m.jsx)(Oe,{placeholder:"e.g., Customer request",value:M.reason||"",onChange:I=>ie({...se,reason:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),_==="deleteApiKey"&&(0,m.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"API Key Name or ID"}),(0,m.jsx)(Oe,{placeholder:"Production Key",value:M.keyId||M.name||"",onChange:I=>ie({...se,keyId:I.target.value,name:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,m.jsx)("p",{className:"text-xs text-red-600",children:"Warning: This action cannot be undone. The API key will be permanently deleted."})]}),_==="addWebhook"&&(0,m.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Webhook URL"}),(0,m.jsx)(Oe,{type:"url",placeholder:"https://example.com/webhook",value:M.url||"",onChange:I=>ie({...se,url:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Name (optional)"}),(0,m.jsx)(Oe,{placeholder:"Production Webhook",value:M.name||"",onChange:I=>ie({...se,name:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),_==="updateCurrency"&&(0,m.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Currency"}),(0,m.jsxs)("select",{value:M.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,m.jsx)("option",{value:"USD",children:"USD ($)"}),(0,m.jsx)("option",{value:"EUR",children:"EUR (\u20AC)"}),(0,m.jsx)("option",{value:"GBP",children:"GBP (\xA3)"}),(0,m.jsx)("option",{value:"JPY",children:"JPY (\xA5)"})]})]})}),_==="updateTimezone"&&(0,m.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Timezone"}),(0,m.jsxs)("select",{value:M.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,m.jsx)("option",{value:"America/Los_Angeles",children:"Pacific Time (PT)"}),(0,m.jsx)("option",{value:"America/New_York",children:"Eastern Time (ET)"}),(0,m.jsx)("option",{value:"Europe/London",children:"GMT"}),(0,m.jsx)("option",{value:"Asia/Tokyo",children:"JST"})]})]})}),_==="revokeSession"&&(0,m.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Device/Session"}),(0,m.jsx)(Oe,{placeholder:"MacBook Pro",value:M.device||"",onChange:I=>ie({...se,device:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,m.jsx)("p",{className:"text-xs text-black",children:"This will sign out the device and invalidate its session."})]}),_==="createSubscription"&&(0,m.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Customer Email"}),(0,m.jsx)(Oe,{type:"email",placeholder:"customer@example.com",value:M.customerEmail||"",onChange:I=>ie({...se,customerEmail:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Plan"}),(0,m.jsxs)("select",{value:M.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,m.jsx)("option",{value:"Starter",children:"Starter ($29/mo)"}),(0,m.jsx)("option",{value:"Professional",children:"Professional ($99/mo)"}),(0,m.jsx)("option",{value:"Enterprise",children:"Enterprise ($299/mo)"})]})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Billing Cycle"}),(0,m.jsxs)("select",{value:M.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,m.jsx)("option",{value:"monthly",children:"Monthly"}),(0,m.jsx)("option",{value:"yearly",children:"Yearly (Save 15%)"})]})]})]}),_==="exportCertificate"&&(0,m.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,m.jsx)("p",{className:"text-xs text-black",children:"This will export your certificate of incorporation document."}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Format"}),(0,m.jsxs)("select",{value:M.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,m.jsx)("option",{value:"pdf",children:"PDF"}),(0,m.jsx)("option",{value:"json",children:"JSON"})]})]})]}),(_==="toggleBlockRule"||_==="enableBlockRule"||_==="disableBlockRule")&&(0,m.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Block Rule"}),(0,m.jsxs)("select",{value:M.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,m.jsx)("option",{value:"rule_1",children:"Block if risk level = 'highest'"}),(0,m.jsx)("option",{value:"rule_2",children:"Block if matches Stripe block lists"}),(0,m.jsx)("option",{value:"rule_3",children:"Block if CVC verification fails"}),(0,m.jsx)("option",{value:"rule_4",children:"Block if Postal code verification fails"})]})]}),(0,m.jsx)("p",{className:"text-xs text-black",children:_==="enableBlockRule"?"This will enable the selected block rule to actively block matching payments.":_==="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,m.jsx)("div",{className:"mt-3",children:(0,m.jsxs)(Bt,{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:sp,children:[(0,m.jsx)("span",{children:"Confirm"}),(0,m.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,m.jsx)(va,{className:"h-3 w-3"}),(0,m.jsx)(xa,{className:"h-3 w-3"})]})]})})]},w.id)}if(w.kind==="bulkPreview"&&w.csvData)return(0,m.jsxs)("div",{className:`${E?"mt-3":""}`,children:[(0,m.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 mb-3 text-gray-700",children:w.content||""}),(0,m.jsxs)("div",{className:"bg-gray-50 rounded-lg border border-gray-200 overflow-hidden",children:[(0,m.jsxs)("div",{className:"bg-gray-100 px-3 py-2 border-b border-gray-200 flex items-center gap-2",children:[(0,m.jsx)(Ps,{className:"h-4 w-4 text-gray-600"}),(0,m.jsx)("span",{className:"text-xs font-medium text-gray-700",children:w.csvData.fileName}),(0,m.jsxs)("span",{className:"text-xs text-gray-500",children:["\u2022 ",w.csvData.rowCount," rows"]})]}),(0,m.jsxs)("div",{className:"px-3 py-2 border-b border-gray-100",children:[(0,m.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-gray-500 mb-1",children:"Columns"}),(0,m.jsx)("div",{className:"flex flex-wrap gap-1",children:w.csvData.columns.map((_,M)=>(0,m.jsx)("span",{className:"text-xs bg-blue-100 text-blue-700 px-1.5 py-0.5 rounded",children:_},M))})]}),w.csvData.sampleRows.length>0&&(0,m.jsxs)("div",{className:"px-3 py-2",children:[(0,m.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-gray-500 mb-1",children:"Sample Data"}),(0,m.jsx)("div",{className:"space-y-1",children:w.csvData.sampleRows.slice(0,3).map((_,M)=>(0,m.jsxs)("div",{className:"text-xs text-gray-600 bg-white rounded px-2 py-1 border border-gray-100",children:[Object.entries(_).slice(0,3).map(([I,J],ae)=>(0,m.jsxs)("span",{children:[ae>0&&" \u2022 ",(0,m.jsxs)("span",{className:"text-gray-400",children:[I,":"]})," ",J]},I)),Object.keys(_).length>3&&(0,m.jsxs)("span",{className:"text-gray-400",children:[" ","..."]})]},M))})]}),w.suggestedAction&&(0,m.jsx)("div",{className:"px-3 py-2 bg-blue-50 border-t border-blue-100",children:(0,m.jsxs)("span",{className:"text-xs text-blue-700",children:["Suggested action:"," ",(0,m.jsx)("strong",{children:w.suggestedAction.replace(/_/g," ")})]})})]}),w.bulkSessionId&&(0,m.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[(0,m.jsxs)(Bt,{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:()=>w.bulkSessionId&&ip(w.bulkSessionId),children:[(0,m.jsxs)("span",{children:["Process ",w.csvData.rowCount," rows"]}),(0,m.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,m.jsx)(va,{className:"h-3 w-3"}),(0,m.jsx)(xa,{className:"h-3 w-3"})]})]}),(0,m.jsx)(Bt,{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:nk,children:"Cancel"})]})]},w.id);if(w.kind==="bulkProgress"&&w.bulkProgress){let{processed:_,total:M,successes:I,failures:J}=w.bulkProgress,ae=Math.round(_/M*100);return(0,m.jsx)("div",{className:`${E?"mt-3":""}`,children:(0,m.jsxs)("div",{className:"bg-gray-50 rounded-lg border border-gray-200 p-3",children:[(0,m.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,m.jsx)(tr,{className:"h-4 w-4 animate-spin text-blue-600"}),(0,m.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Processing... ",_," of ",M]})]}),(0,m.jsx)("div",{className:"h-2 bg-gray-200 rounded-full overflow-hidden mb-2",children:(0,m.jsx)("div",{className:"h-full bg-blue-600 transition-all duration-300",style:{width:`${ae}%`}})}),(0,m.jsxs)("div",{className:"flex items-center gap-3 text-xs text-gray-600",children:[(0,m.jsxs)("span",{className:"flex items-center gap-1",children:[(0,m.jsx)(nt,{className:"h-3 w-3 text-green-600"}),I," successful"]}),J>0&&(0,m.jsxs)("span",{className:"flex items-center gap-1 text-red-600",children:[(0,m.jsx)(hn,{className:"h-3 w-3"}),J," failed"]})]})]})},w.id)}if(w.kind==="bulkSummary"&&w.bulkSummary){let{total:_,successes:M,failures:I,navigationPage:J}=w.bulkSummary,ae=I.length>0,X=J?.page==="customers"?"Customers":J?.page==="dashboard"?"Dashboard":J?.page==="settings"?"Settings":"Results";return(0,m.jsx)("div",{className:`${E?"mt-3":""}`,children:(0,m.jsxs)("div",{className:`rounded-lg border p-3 ${ae?"bg-amber-50 border-amber-200":"bg-green-50 border-green-200"}`,children:[(0,m.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,m.jsx)(nt,{className:`h-5 w-5 ${ae?"text-amber-600":"text-green-600"}`}),(0,m.jsx)("span",{className:"text-sm font-medium text-gray-800",children:"Bulk operation complete"})]}),(0,m.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:w.content||`Processed ${_} rows: ${M} successful${ae?`, ${I.length} failed`:""}.`}),(0,m.jsxs)("div",{className:"flex items-center gap-4 text-xs",children:[(0,m.jsxs)("span",{className:"flex items-center gap-1 text-green-700",children:[(0,m.jsx)(nt,{className:"h-3 w-3"}),M," successful"]}),ae&&(0,m.jsxs)("span",{className:"flex items-center gap-1 text-red-600",children:[(0,m.jsx)(hn,{className:"h-3 w-3"}),I.length," failed"]})]}),ae&&(0,m.jsxs)("div",{className:"mt-3 pt-2 border-t border-amber-200",children:[(0,m.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-amber-700 mb-1",children:"Failed Rows"}),(0,m.jsxs)("div",{className:"space-y-1 max-h-32 overflow-y-auto",children:[I.slice(0,5).map((me,et)=>(0,m.jsxs)("div",{className:"text-xs text-red-700 bg-red-50 rounded px-2 py-1",children:["Row ",me.row,":"," ",me.error||"Unknown error"]},et)),I.length>5&&(0,m.jsxs)("div",{className:"text-xs text-amber-600",children:["...and ",I.length-5," more"]})]})]}),J&&M>0&&(0,m.jsx)("div",{className:"mt-3 pt-2 border-t border-gray-200",children:(0,m.jsxs)("button",{type:"button",onClick:me=>{me.preventDefault(),me.stopPropagation(),console.log("[DEBUG] Button clicked - navigationPage:",J,"onNavigate:",!!o),o&&J.page?(console.log("[DEBUG] Calling onNavigate with page:",J.page),o(J.page,J.subtab)):console.log("[DEBUG] Condition failed - onNavigate:",!!o,"navigationPage.page:",J.page)},className:"flex items-center gap-2 text-xs text-gray-500 hover:text-gray-700 transition-colors group cursor-pointer",children:[(0,m.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,m.jsx)(va,{className:"h-2.5 w-2.5"}),(0,m.jsx)("span",{children:"+"}),(0,m.jsx)(xa,{className:"h-2.5 w-2.5"})]}),(0,m.jsxs)("span",{children:["View ",X]})]})})]})},w.id)}return(0,m.jsx)(F.Fragment,{children:(0,m.jsxs)("div",{ref:Y?wu:null,className:`${E?"mt-3":""}`,children:[(0,m.jsx)("div",{className:"text-sm leading-6 text-gray-700",children:(()=>{let _=w.content||"";if(w.kind==="guideStep"){let M=_.match(/^(Step\s+\d+:)([\s\S]*)/);if(M)return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("strong",{children:M[1]}),M[2]]})}return w.role==="assistant"&&_?DD(_):_||(0,m.jsx)("span",{className:"opacity-70",children:"Thinking\u2026"})})()}),w.role==="assistant"&&w.structuredData&&(0,m.jsx)("div",{className:"mt-3",children:(0,m.jsx)(HI,{type:w.structuredData.type,data:w.structuredData.data})}),w.role==="assistant"&&w.followups&&w.followups.length>0&&!w.followupSelected&&(0,m.jsx)("div",{className:"mt-3 flex flex-wrap gap-1.5",children:w.followups.map(_=>(0,m.jsx)("button",{type:"button",onClick:()=>ek(w.id,_),className:`inline-flex items-center px-3 py-1.5 text-xs font-medium rounded-xl
73
+ `),J="",ae="";for(let X of I)X.startsWith("event: ")?J=X.slice(7):X.startsWith("data: ")&&(ae=X.slice(6));if(!(!J||!ae))try{let X=JSON.parse(ae);if(J==="progress")Le([{message:`Processing row ${X.row} of ${X.total}...`,completed:!1}]),p(me=>me[me.length-1]?.kind==="bulkProgress"?me.map((gt,ea)=>ea===me.length-1?{...gt,bulkProgress:{processed:X.row,total:X.total,successes:X.successes||0,failures:X.failures||0}}:gt):[...me,{id:Date.now(),role:"assistant",kind:"bulkProgress",bulkProgress:{processed:X.row,total:X.total,successes:X.successes||0,failures:X.failures||0}}]);else if(J==="summary")console.log("[DEBUG] Received summary event - data:",X),console.log("[DEBUG] navigationPage from backend:",X.navigationPage),xe("idle"),Le([]),Da(null),p(me=>{let et=me.filter(ea=>ea.kind!=="bulkProgress"&&ea.kind!=="bulkPreview"),gt={id:Date.now(),role:"assistant",kind:"bulkSummary",content:X.message,bulkSummary:{total:X.total,successes:X.successes,failures:X.failures||[],navigationPage:X.navigationPage}};return console.log("[DEBUG] Creating bulkSummary message:",gt),[...et,gt]}),setTimeout(()=>{window.dispatchEvent(new CustomEvent("agentActionComplete",{detail:{result:{bulk:!0,total:X.total,successes:X.successes}}}))},100);else if(J==="error"){xe("idle"),Le([]),Da(null);let me={id:Date.now(),role:"assistant",kind:"text",content:X.message||"An error occurred during bulk processing."};p(et=>[...et,me])}}catch(X){console.error("Failed to parse confirm SSE event:",X)}}}}catch(k){console.error("Bulk confirm failed:",k),xe("idle"),Le([]),Da(null);let B={id:Date.now(),role:"assistant",kind:"text",content:"Failed to start bulk operation. Please try again."};p(D=>[...D,B])}}function nk(){Da(null),p(w=>w.filter(k=>k.kind!=="bulkPreview"))}function Dy(w){bu(w)}function sk(w){let k=Date.now()+Math.floor(Math.random()*1e3);p(B=>[...B,{id:k,role:"assistant",kind:"text",content:w}])}function HD(w){let k=vy[w];if(!k)return;To("landing"),_o(void 0);let B={id:w,stepIndex:0};Ea(B),Be.current=B,sk(`I'll help you with ${k.title}.`);let D=k.steps[0],E=D.cursorTarget?.selector.includes("[data-page="),Z=D.cursorTarget?.selector.includes("[data-settings-tab=");if(D.cursorTarget&&(E||Z)){let _=D.cursorTarget;Z&&D.navigation&&o&&o(D.navigation.page,void 0),setTimeout(()=>{let I=()=>{let J=document.querySelector(_.selector);J&&J.offsetParent!==null?(Ao(_),_.onClick&&setTimeout(()=>{J.click()},1200)):setTimeout(I,200)};I()},Z?800:400)}else if(D.navigation&&o&&o(D.navigation.page,D.navigation.subtab),D.cursorTarget){let _=D.cursorTarget,M=_.selector.includes("data-settings-tab"),I=_.selector.includes("dialog")||_.selector.includes("api-key-name-input");setTimeout(()=>{let ae=()=>{let X=document.querySelector(_.selector);X&&X.offsetParent!==null?(Ao(_),_.onClick&&setTimeout(()=>{X.click()},1e3)):M||I?setTimeout(ae,200):(Ao(_),_.onClick&&setTimeout(()=>{let me=document.querySelector(_.selector);me&&me.click()},1e3))};ae()},I?700:M?600:400)}let Y={id:Date.now()+1,role:"assistant",kind:"guideStep",content:"",guideStepIndex:0};p(_=>[..._,Y]),Zr(Y.id,D.text)}function lp(){if(!ge)return;let w=vy[ge.id];if(!w)return;let k=Be.current;(!k||k.id!==ge.id)&&(k=ge,Be.current=ge);let D=k.stepIndex+1;if(D>=w.steps.length){An();let I=Date.now()+1;p(J=>[...J,{id:I,role:"assistant",kind:"guideComplete",content:"Guide Complete"}]),Ea(void 0),Li(!0);return}let E=w.steps[D],Z={id:ge.id,stepIndex:D};Ea(Z),Be.current=Z;let Y={id:Date.now()+1,role:"assistant",kind:"guideStep",content:"",guideStepIndex:D};p(I=>[...I,Y]);let _=E.cursorTarget?.selector.includes("[data-page="),M=E.cursorTarget?.selector.includes("[data-settings-tab=");if(E.cursorTarget&&(_||M)){let I=E.cursorTarget;M&&E.navigation&&o&&o(E.navigation.page,void 0),setTimeout(()=>{let ae=Be.current;if(!ae||ae.id!==w.id||ae.stepIndex!==D)return;let X=()=>{let me=Be.current;if(!me||me.id!==w.id||me.stepIndex!==D)return;let et=document.querySelector(I.selector);et&&et.offsetParent!==null?(Ao(I),I.onClick&&setTimeout(()=>{let gt=Be.current;!gt||gt.id!==w.id||gt.stepIndex!==D||et.click()},1200)):setTimeout(X,200)};X()},M?800:400)}else if(E.navigation&&o&&o(E.navigation.page,E.navigation.subtab),E.cursorTarget){let I=E.cursorTarget,J=I.selector.includes("dialog")||I.selector.includes("api-key-name-input"),ae=I.selector.includes("data-settings-tab"),X=E.navigation?.subtab&&ae&&I.selector.includes(`data-settings-tab="${E.navigation.subtab}"`),me=I.onClick&&!X,et=!!E.navigation,tt=(!!E.navigation?.subtab?700:et?400:0)+(J?700:ae?600:400);setTimeout(()=>{let vr=Be.current;if(!vr||vr.id!==w.id||vr.stepIndex!==D)return;let $=()=>{let q=Be.current;if(!q||q.id!==w.id||q.stepIndex!==D)return;let oe=document.querySelector(I.selector);oe&&oe.offsetParent!==null?(Ao(I),me&&setTimeout(()=>{let de=Be.current;!de||de.id!==w.id||de.stepIndex!==D||oe.click()},1e3)):J||ae||I.selector.includes("data-testid")?setTimeout($,200):(Ao(I),me&&setTimeout(()=>{let de=Be.current;if(!de||de.id!==w.id||de.stepIndex!==D)return;let Rt=document.querySelector(I.selector);Rt&&Rt.click()},1e3))};$()},tt)}else An();Zr(Y.id,E.text)}function ik(){if(!ge)return;let w=vy[ge.id];if(!w)return;let k=ge.stepIndex-1;if(k>=0){Ea({id:ge.id,stepIndex:k});let B=w.steps[k];B.navigation&&o&&o(B.navigation.page,B.navigation.subtab),B.cursorTarget?setTimeout(()=>{Ao(B.cursorTarget)},500):An();let D=g.filter(E=>E.kind!=="guideStep"&&E.kind!=="guideComplete");p([...D,{id:Date.now(),role:"assistant",kind:"guideStep",content:B.text}])}}return e?(0,m.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:`${WI}px`},children:[(0,m.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,m.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,m.jsx)(Hr,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"}),(0,m.jsx)("h3",{className:"text-sm font-semibold text-gray-800",children:"Copilot"})]}),(0,m.jsxs)("div",{className:"flex items-center gap-1",children:[(0,m.jsx)(Bt,{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:()=>{Po(),p([]),To("landing"),_o(void 0),Ea(void 0),Be.current=void 0,Li(!1)},children:(0,m.jsx)(Ut,{className:"h-3 w-3"})}),(0,m.jsx)(Bt,{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&&(Po(),p([]),To("landing"),_o(void 0),Ea(void 0),Be.current=void 0,Li(!1)),t?.()},children:(0,m.jsx)($l,{className:"h-3.5 w-3.5"})})]})]}),(0,m.jsx)("div",{className:Sy?"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:Sy?(0,m.jsxs)("div",{className:"w-full overflow-y-auto px-4",children:[(0,m.jsx)("div",{className:"py-3 transition-all duration-300",children:(0,m.jsx)("h2",{className:"text-center text-2xl font-semibold text-gray-900",children:ep==="folder"?$I.find(w=>w.id===Cy)?.title||"":"How can I help?"})}),(0,m.jsxs)("div",{className:"pb-4 px-4",children:[ep==="landing"&&(0,m.jsx)(m.Fragment,{children:(0,m.jsx)("div",{className:"flex flex-col gap-1",children:YI?(0,m.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,m.jsx)(tr,{className:"h-4 w-4 animate-spin text-gray-400"})}):QI.map((w,k)=>{let B=["bg-blue-400","bg-green-400","bg-purple-400","bg-orange-400","bg-pink-400"];return(0,m.jsxs)(Bt,{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:()=>Dy(w.prompt),children:[(0,m.jsx)("span",{className:`mr-2 inline-block h-1.5 w-1.5 rounded-full ${B[k%B.length]}`}),w.label]},w.id)})})}),ep==="folder"&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,m.jsx)(Bt,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 rounded-full hover:bg-gray-100",onClick:tk,"aria-label":"Back to suggestions",children:(0,m.jsx)(ks,{className:"h-4 w-4 text-gray-500"})}),(0,m.jsx)("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-400",children:"Topics"})]}),(0,m.jsx)("div",{className:"flex flex-col gap-1.5",children:$I.find(w=>w.id===Cy)?.topics.map(w=>(0,m.jsx)(Bt,{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:()=>Dy(w.prompt),children:w.label},w.id))})]})]})]}):(0,m.jsx)(m.Fragment,{children:(0,m.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:(0,m.jsx)(fg,{ref:rp,className:"h-full",children:(0,m.jsxs)("div",{className:"flex flex-col gap-2 px-4 py-3",children:[g.map((w,k)=>{let B=w.role==="user",D=k>0?g[k-1].role:void 0,E=D!==void 0&&D!==w.role,Z=Be.current||ge,Y=!1;if(Z&&w.kind==="guideStep"?w.guideStepIndex!==void 0?Y=w.guideStepIndex===Z.stepIndex:Y=k===g.length-1:w.kind==="guideComplete"&&(Y=k===g.length-1),w.kind==="guideStep"&&!Y)return null;if(B)return(0,m.jsx)("div",{className:`flex justify-end ${E?"mt-3":""}`,children:(0,m.jsx)("div",{className:"max-w-[260px] rounded-2xl rounded-br-md bg-gray-900 px-3 py-2 text-xs text-white shadow-sm",children:w.content})},w.id);if(w.role==="agent")return(0,m.jsxs)("div",{className:`flex flex-col items-start ${E?"mt-3":""}`,children:[E&&(0,m.jsx)("span",{className:"text-[10px] text-gray-500 mb-1 ml-1",children:"Agent"}),(0,m.jsx)("div",{className:"max-w-[260px] rounded-2xl rounded-bl-md bg-white border border-gray-200 px-3 py-2 text-xs text-gray-800 shadow-sm",children:w.content})]},w.id);if(w.kind==="searchSummary")return(0,m.jsx)("div",{className:`${E?"mt-3":""}`,children:(0,m.jsx)(vC,{title:w.title??"Search results",links:w.links??[]})},w.id);if(w.kind==="guideComplete")return(0,m.jsx)("div",{ref:Y?wu:null,className:`${E?"mt-3":""}`,children:(0,m.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,m.jsx)(nt,{className:"h-5 w-5 text-green-600 flex-shrink-0"}),(0,m.jsx)("span",{className:"font-medium text-green-800",children:w.content})]})},w.id);if(w.kind==="navigationAction")return(0,m.jsxs)("div",{className:`${E?"mt-3":""}`,children:[(0,m.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 mb-2 text-gray-700",children:w.content||""}),w.navigationTarget&&(0,m.jsx)("div",{className:"mt-2",children:(0,m.jsxs)(Bt,{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:()=>w.navigationTarget&&np(w.navigationTarget),children:[(0,m.jsx)("span",{children:"Confirm"}),(0,m.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,m.jsx)(va,{className:"h-3 w-3"}),(0,m.jsx)(xa,{className:"h-3 w-3"})]})]})})]},w.id);if(w.kind==="actionForm"){let _=w.actionType,M=Object.keys(se).length>0?se:w.actionData||{};if(w.isSubmitted){let I="";return _==="updateCompanyInfo"?I="Company information has been updated successfully.":_==="addApiKey"?I="API key has been added successfully.":_==="addCustomer"?I="Customer has been added successfully.":_==="enable2FA"?I="Two-factor authentication has been enabled successfully.":_==="disable2FA"?I="Two-factor authentication has been disabled successfully.":_==="changePassword"?I="Your password has been changed successfully.":_==="revokeSession"?I="Session has been revoked successfully.":_==="toggleNotification"?I="Notification preferences have been updated successfully.":_==="connectIntegration"?I="Integration has been connected successfully.":_==="disconnectIntegration"?I="Integration has been disconnected successfully.":_==="addPaymentMethod"?I="Payment method has been added successfully.":_==="removePaymentMethod"?I="Payment method has been removed successfully.":_==="deleteApiKey"?I="API key has been deleted successfully.":_==="addWebhook"?I="Webhook endpoint has been added successfully.":_==="updateCurrency"?I="Currency preference has been updated successfully.":_==="updateTimezone"?I="Timezone has been updated successfully.":_==="refundPayment"?I="Refund has been processed successfully.":_==="exportCertificate"?I="Certificate of Incorporation has been downloaded successfully.":_==="createSubscription"?I="Subscription has been created successfully.":_==="toggleBlockRule"||_==="enableBlockRule"||_==="disableBlockRule"?I="Block rule has been updated successfully.":I="Action completed successfully.",(0,m.jsx)("div",{className:`${E?"mt-3":""}`,children:(0,m.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 text-gray-700",children:I})},w.id)}return(0,m.jsxs)("div",{className:`min-w-0 ${E?"mt-3":""}`,children:[(0,m.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 mb-3 text-gray-700",children:w.content||""}),_==="updateCompanyInfo"&&(0,m.jsxs)("div",{className:"space-y-2 bg-gray-50 rounded-lg p-2 border border-gray-200 overflow-hidden",children:[(0,m.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Company Name"}),(0,m.jsx)(Oe,{placeholder:"Acme Corporation",value:M.companyName||"",onChange:I=>ie({...se,companyName:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Email"}),(0,m.jsx)(Oe,{type:"email",placeholder:"contact@acme.com",value:M.email||"",onChange:I=>ie({...se,email:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Address"}),(0,m.jsx)(Oe,{placeholder:"123 Main St, San Francisco, CA",value:M.address||"",onChange:I=>ie({...se,address:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,m.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Phone"}),(0,m.jsx)(Oe,{type:"tel",placeholder:"+1 (555) 123-4567",value:M.phone||"",onChange:I=>ie({...se,phone:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Website"}),(0,m.jsx)(Oe,{type:"url",placeholder:"https://acme.com",value:M.website||"",onChange:I=>ie({...se,website:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]})]}),_==="addApiKey"&&(0,m.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"API Key Name"}),(0,m.jsx)(Oe,{placeholder:"Production Key",value:M.name||"",onChange:I=>ie({...se,name:I.target.value}),className:"h-8 text-xs border-gray-200"})]})}),_==="addCustomer"&&(0,m.jsxs)("div",{className:"space-y-2 bg-gray-50 rounded-lg p-2 border border-gray-200 overflow-hidden",children:[(0,m.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Company Name"}),(0,m.jsx)(Oe,{placeholder:"Acme Corporation",value:M.name||"",onChange:I=>ie({...se,name:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Email"}),(0,m.jsx)(Oe,{type:"email",placeholder:"contact@acme.com",value:M.email||"",onChange:I=>ie({...se,email:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Location"}),(0,m.jsx)(Oe,{placeholder:"San Francisco, CA",value:M.location||"",onChange:I=>ie({...se,location:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Subscription Tier"}),(0,m.jsxs)("select",{value:M.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,m.jsx)("option",{value:"Starter",children:"Starter"}),(0,m.jsx)("option",{value:"Professional",children:"Professional"}),(0,m.jsx)("option",{value:"Enterprise",children:"Enterprise"})]})]})]}),(_==="enable2FA"||_==="disable2FA")&&(0,m.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,m.jsx)("p",{className:"text-xs text-black",children:_==="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."})}),_==="changePassword"&&(0,m.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Current Password"}),(0,m.jsx)(Oe,{type:"password",value:M.currentPassword||"",onChange:I=>ie({...se,currentPassword:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"New Password"}),(0,m.jsx)(Oe,{type:"password",value:M.newPassword||"",onChange:I=>ie({...se,newPassword:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Confirm New Password"}),(0,m.jsx)(Oe,{type:"password",value:M.confirmPassword||"",onChange:I=>ie({...se,confirmPassword:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),_==="toggleNotification"&&(0,m.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Notification Type"}),(0,m.jsxs)("select",{value:M.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,m.jsx)("option",{value:"paymentReceived",children:"Payment Received"}),(0,m.jsx)("option",{value:"paymentFailed",children:"Payment Failed"}),(0,m.jsx)("option",{value:"invoicePaid",children:"Invoice Paid"}),(0,m.jsx)("option",{value:"monthlySummary",children:"Monthly Summary"}),(0,m.jsx)("option",{value:"productUpdates",children:"Product Updates"})]})]}),(0,m.jsxs)("div",{className:"flex items-center gap-2",children:[(0,m.jsx)("input",{type:"checkbox",checked:M.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,m.jsx)("label",{className:"text-xs text-black",children:"Enable this notification"})]})]}),(_==="connectIntegration"||_==="disconnectIntegration")&&(0,m.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Integration"}),(0,m.jsxs)("select",{value:M.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,m.jsx)("option",{value:"Slack",children:"Slack"}),(0,m.jsx)("option",{value:"Zapier",children:"Zapier"}),(0,m.jsx)("option",{value:"Webhook",children:"Webhook"})]})]})}),_==="addPaymentMethod"&&(0,m.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Card Number"}),(0,m.jsx)(Oe,{placeholder:"1234 5678 9012 3456",value:M.cardNumber||"",onChange:I=>ie({...se,cardNumber:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Expiry Date"}),(0,m.jsx)(Oe,{placeholder:"MM/YY",value:M.expiryDate||"",onChange:I=>ie({...se,expiryDate:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),_==="removePaymentMethod"&&(0,m.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,m.jsx)("p",{className:"text-xs text-black",children:"This will remove the default payment method from your account."})}),_==="refundPayment"&&(0,m.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Transaction ID or Customer Name"}),(0,m.jsx)(Oe,{placeholder:"e.g., txn_1234 or Acme Corp",value:M.transactionId||M.customer||"",onChange:I=>{let J=I.target.value;J.startsWith("txn_")||/^\d+$/.test(J)?ie({...se,transactionId:J,customer:void 0}):ie({...se,customer:J,transactionId:void 0})},className:"h-8 text-xs border-gray-200"})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Amount (optional)"}),(0,m.jsx)(Oe,{placeholder:"$0.00",value:M.amount||"",onChange:I=>ie({...se,amount:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Reason (optional)"}),(0,m.jsx)(Oe,{placeholder:"e.g., Customer request",value:M.reason||"",onChange:I=>ie({...se,reason:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),_==="deleteApiKey"&&(0,m.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"API Key Name or ID"}),(0,m.jsx)(Oe,{placeholder:"Production Key",value:M.keyId||M.name||"",onChange:I=>ie({...se,keyId:I.target.value,name:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,m.jsx)("p",{className:"text-xs text-red-600",children:"Warning: This action cannot be undone. The API key will be permanently deleted."})]}),_==="addWebhook"&&(0,m.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Webhook URL"}),(0,m.jsx)(Oe,{type:"url",placeholder:"https://example.com/webhook",value:M.url||"",onChange:I=>ie({...se,url:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Name (optional)"}),(0,m.jsx)(Oe,{placeholder:"Production Webhook",value:M.name||"",onChange:I=>ie({...se,name:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),_==="updateCurrency"&&(0,m.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Currency"}),(0,m.jsxs)("select",{value:M.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,m.jsx)("option",{value:"USD",children:"USD ($)"}),(0,m.jsx)("option",{value:"EUR",children:"EUR (\u20AC)"}),(0,m.jsx)("option",{value:"GBP",children:"GBP (\xA3)"}),(0,m.jsx)("option",{value:"JPY",children:"JPY (\xA5)"})]})]})}),_==="updateTimezone"&&(0,m.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Timezone"}),(0,m.jsxs)("select",{value:M.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,m.jsx)("option",{value:"America/Los_Angeles",children:"Pacific Time (PT)"}),(0,m.jsx)("option",{value:"America/New_York",children:"Eastern Time (ET)"}),(0,m.jsx)("option",{value:"Europe/London",children:"GMT"}),(0,m.jsx)("option",{value:"Asia/Tokyo",children:"JST"})]})]})}),_==="revokeSession"&&(0,m.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Device/Session"}),(0,m.jsx)(Oe,{placeholder:"MacBook Pro",value:M.device||"",onChange:I=>ie({...se,device:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,m.jsx)("p",{className:"text-xs text-black",children:"This will sign out the device and invalidate its session."})]}),_==="createSubscription"&&(0,m.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Customer Email"}),(0,m.jsx)(Oe,{type:"email",placeholder:"customer@example.com",value:M.customerEmail||"",onChange:I=>ie({...se,customerEmail:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Plan"}),(0,m.jsxs)("select",{value:M.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,m.jsx)("option",{value:"Starter",children:"Starter ($29/mo)"}),(0,m.jsx)("option",{value:"Professional",children:"Professional ($99/mo)"}),(0,m.jsx)("option",{value:"Enterprise",children:"Enterprise ($299/mo)"})]})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Billing Cycle"}),(0,m.jsxs)("select",{value:M.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,m.jsx)("option",{value:"monthly",children:"Monthly"}),(0,m.jsx)("option",{value:"yearly",children:"Yearly (Save 15%)"})]})]})]}),_==="exportCertificate"&&(0,m.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,m.jsx)("p",{className:"text-xs text-black",children:"This will export your certificate of incorporation document."}),(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Format"}),(0,m.jsxs)("select",{value:M.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,m.jsx)("option",{value:"pdf",children:"PDF"}),(0,m.jsx)("option",{value:"json",children:"JSON"})]})]})]}),(_==="toggleBlockRule"||_==="enableBlockRule"||_==="disableBlockRule")&&(0,m.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Block Rule"}),(0,m.jsxs)("select",{value:M.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,m.jsx)("option",{value:"rule_1",children:"Block if risk level = 'highest'"}),(0,m.jsx)("option",{value:"rule_2",children:"Block if matches Stripe block lists"}),(0,m.jsx)("option",{value:"rule_3",children:"Block if CVC verification fails"}),(0,m.jsx)("option",{value:"rule_4",children:"Block if Postal code verification fails"})]})]}),(0,m.jsx)("p",{className:"text-xs text-black",children:_==="enableBlockRule"?"This will enable the selected block rule to actively block matching payments.":_==="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,m.jsx)("div",{className:"mt-3",children:(0,m.jsxs)(Bt,{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:sp,children:[(0,m.jsx)("span",{children:"Confirm"}),(0,m.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,m.jsx)(va,{className:"h-3 w-3"}),(0,m.jsx)(xa,{className:"h-3 w-3"})]})]})})]},w.id)}if(w.kind==="bulkPreview"&&w.csvData)return(0,m.jsxs)("div",{className:`${E?"mt-3":""}`,children:[(0,m.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 mb-3 text-gray-700",children:w.content||""}),(0,m.jsxs)("div",{className:"bg-gray-50 rounded-lg border border-gray-200 overflow-hidden",children:[(0,m.jsxs)("div",{className:"bg-gray-100 px-3 py-2 border-b border-gray-200 flex items-center gap-2",children:[(0,m.jsx)(Ps,{className:"h-4 w-4 text-gray-600"}),(0,m.jsx)("span",{className:"text-xs font-medium text-gray-700",children:w.csvData.fileName}),(0,m.jsxs)("span",{className:"text-xs text-gray-500",children:["\u2022 ",w.csvData.rowCount," rows"]})]}),(0,m.jsxs)("div",{className:"px-3 py-2 border-b border-gray-100",children:[(0,m.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-gray-500 mb-1",children:"Columns"}),(0,m.jsx)("div",{className:"flex flex-wrap gap-1",children:w.csvData.columns.map((_,M)=>(0,m.jsx)("span",{className:"text-xs bg-blue-100 text-blue-700 px-1.5 py-0.5 rounded",children:_},M))})]}),w.csvData.sampleRows.length>0&&(0,m.jsxs)("div",{className:"px-3 py-2",children:[(0,m.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-gray-500 mb-1",children:"Sample Data"}),(0,m.jsx)("div",{className:"space-y-1",children:w.csvData.sampleRows.slice(0,3).map((_,M)=>(0,m.jsxs)("div",{className:"text-xs text-gray-600 bg-white rounded px-2 py-1 border border-gray-100",children:[Object.entries(_).slice(0,3).map(([I,J],ae)=>(0,m.jsxs)("span",{children:[ae>0&&" \u2022 ",(0,m.jsxs)("span",{className:"text-gray-400",children:[I,":"]})," ",J]},I)),Object.keys(_).length>3&&(0,m.jsxs)("span",{className:"text-gray-400",children:[" ","..."]})]},M))})]}),w.suggestedAction&&(0,m.jsx)("div",{className:"px-3 py-2 bg-blue-50 border-t border-blue-100",children:(0,m.jsxs)("span",{className:"text-xs text-blue-700",children:["Suggested action:"," ",(0,m.jsx)("strong",{children:w.suggestedAction.replace(/_/g," ")})]})})]}),w.bulkSessionId&&(0,m.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[(0,m.jsxs)(Bt,{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:()=>w.bulkSessionId&&ip(w.bulkSessionId),children:[(0,m.jsxs)("span",{children:["Process ",w.csvData.rowCount," rows"]}),(0,m.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,m.jsx)(va,{className:"h-3 w-3"}),(0,m.jsx)(xa,{className:"h-3 w-3"})]})]}),(0,m.jsx)(Bt,{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:nk,children:"Cancel"})]})]},w.id);if(w.kind==="bulkProgress"&&w.bulkProgress){let{processed:_,total:M,successes:I,failures:J}=w.bulkProgress,ae=Math.round(_/M*100);return(0,m.jsx)("div",{className:`${E?"mt-3":""}`,children:(0,m.jsxs)("div",{className:"bg-gray-50 rounded-lg border border-gray-200 p-3",children:[(0,m.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,m.jsx)(tr,{className:"h-4 w-4 animate-spin text-blue-600"}),(0,m.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Processing... ",_," of ",M]})]}),(0,m.jsx)("div",{className:"h-2 bg-gray-200 rounded-full overflow-hidden mb-2",children:(0,m.jsx)("div",{className:"h-full bg-blue-600 transition-all duration-300",style:{width:`${ae}%`}})}),(0,m.jsxs)("div",{className:"flex items-center gap-3 text-xs text-gray-600",children:[(0,m.jsxs)("span",{className:"flex items-center gap-1",children:[(0,m.jsx)(nt,{className:"h-3 w-3 text-green-600"}),I," successful"]}),J>0&&(0,m.jsxs)("span",{className:"flex items-center gap-1 text-red-600",children:[(0,m.jsx)(mn,{className:"h-3 w-3"}),J," failed"]})]})]})},w.id)}if(w.kind==="bulkSummary"&&w.bulkSummary){let{total:_,successes:M,failures:I,navigationPage:J}=w.bulkSummary,ae=I.length>0,X=J?.page==="customers"?"Customers":J?.page==="dashboard"?"Dashboard":J?.page==="settings"?"Settings":"Results";return(0,m.jsx)("div",{className:`${E?"mt-3":""}`,children:(0,m.jsxs)("div",{className:`rounded-lg border p-3 ${ae?"bg-amber-50 border-amber-200":"bg-green-50 border-green-200"}`,children:[(0,m.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,m.jsx)(nt,{className:`h-5 w-5 ${ae?"text-amber-600":"text-green-600"}`}),(0,m.jsx)("span",{className:"text-sm font-medium text-gray-800",children:"Bulk operation complete"})]}),(0,m.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:w.content||`Processed ${_} rows: ${M} successful${ae?`, ${I.length} failed`:""}.`}),(0,m.jsxs)("div",{className:"flex items-center gap-4 text-xs",children:[(0,m.jsxs)("span",{className:"flex items-center gap-1 text-green-700",children:[(0,m.jsx)(nt,{className:"h-3 w-3"}),M," successful"]}),ae&&(0,m.jsxs)("span",{className:"flex items-center gap-1 text-red-600",children:[(0,m.jsx)(mn,{className:"h-3 w-3"}),I.length," failed"]})]}),ae&&(0,m.jsxs)("div",{className:"mt-3 pt-2 border-t border-amber-200",children:[(0,m.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-amber-700 mb-1",children:"Failed Rows"}),(0,m.jsxs)("div",{className:"space-y-1 max-h-32 overflow-y-auto",children:[I.slice(0,5).map((me,et)=>(0,m.jsxs)("div",{className:"text-xs text-red-700 bg-red-50 rounded px-2 py-1",children:["Row ",me.row,":"," ",me.error||"Unknown error"]},et)),I.length>5&&(0,m.jsxs)("div",{className:"text-xs text-amber-600",children:["...and ",I.length-5," more"]})]})]}),J&&M>0&&(0,m.jsx)("div",{className:"mt-3 pt-2 border-t border-gray-200",children:(0,m.jsxs)("button",{type:"button",onClick:me=>{me.preventDefault(),me.stopPropagation(),console.log("[DEBUG] Button clicked - navigationPage:",J,"onNavigate:",!!o),o&&J.page?(console.log("[DEBUG] Calling onNavigate with page:",J.page),o(J.page,J.subtab)):console.log("[DEBUG] Condition failed - onNavigate:",!!o,"navigationPage.page:",J.page)},className:"flex items-center gap-2 text-xs text-gray-500 hover:text-gray-700 transition-colors group cursor-pointer",children:[(0,m.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,m.jsx)(va,{className:"h-2.5 w-2.5"}),(0,m.jsx)("span",{children:"+"}),(0,m.jsx)(xa,{className:"h-2.5 w-2.5"})]}),(0,m.jsxs)("span",{children:["View ",X]})]})})]})},w.id)}return(0,m.jsx)(F.Fragment,{children:(0,m.jsxs)("div",{ref:Y?wu:null,className:`${E?"mt-3":""}`,children:[(0,m.jsx)("div",{className:"text-sm leading-6 text-gray-700",children:(()=>{let _=w.content||"";if(w.kind==="guideStep"){let M=_.match(/^(Step\s+\d+:)([\s\S]*)/);if(M)return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("strong",{children:M[1]}),M[2]]})}return w.role==="assistant"&&_?ND(_):_||(0,m.jsx)("span",{className:"opacity-70",children:"Thinking\u2026"})})()}),w.role==="assistant"&&w.structuredData&&(0,m.jsx)("div",{className:"mt-3",children:(0,m.jsx)(HI,{type:w.structuredData.type,data:w.structuredData.data})}),w.role==="assistant"&&w.followups&&w.followups.length>0&&!w.followupSelected&&(0,m.jsx)("div",{className:"mt-3 flex flex-wrap gap-1.5",children:w.followups.map(_=>(0,m.jsx)("button",{type:"button",onClick:()=>ek(w.id,_),className:`inline-flex items-center px-3 py-1.5 text-xs font-medium rounded-xl
74
74
  bg-white hover:bg-gray-50 text-gray-600 hover:text-gray-800
75
75
  border border-gray-200 hover:border-gray-300 shadow-sm
76
- transition-all duration-150 ease-in-out`,children:_.label},_.id))})]})},w.id)}),(ge||bi)&&(0,m.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[ge&&ge.stepIndex>0&&(0,m.jsx)(Bt,{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:ik,children:(0,m.jsx)(ks,{className:"h-3.5 w-3.5 text-gray-600"})}),(0,m.jsxs)(Bt,{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:bi?Ey:lp,children:[(0,m.jsx)("span",{children:bi?"Done":"Next"}),(0,m.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,m.jsx)(va,{className:"h-3 w-3"}),(0,m.jsx)(xa,{className:"h-3 w-3"})]})]})]}),(To==="thinking"||To==="searching"||To==="executing"||To==="responding")&&(0,m.jsx)("div",{className:`${JI==="user"?"mt-3":""}`,children:(0,m.jsx)(gC,{phase:To,progressSteps:XI})}),T&&j&&To==="idle"&&(0,m.jsx)("div",{className:"mt-2",children:(0,m.jsx)(zI,{})}),!ge&&(0,m.jsx)("div",{ref:ky})]})})})})}),(0,m.jsxs)("div",{className:"px-4 py-3 border-t border-gray-100 bg-gray-50/50 shrink-0",children:[Eo&&(0,m.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,m.jsx)(Ps,{className:"h-4 w-4 text-blue-600"}),(0,m.jsx)("span",{className:"text-xs text-blue-700 flex-1 truncate",children:Eo.name}),(0,m.jsx)("button",{type:"button",onClick:()=>{ap(null),Rn.current&&(Rn.current.value="")},className:"text-blue-600 hover:text-blue-800",children:(0,m.jsx)(hn,{className:"h-4 w-4"})})]}),(0,m.jsxs)("form",{onSubmit:rk,className:"w-full",children:[(0,m.jsx)("input",{ref:Rn,type:"file",accept:".csv",className:"hidden",onChange:w=>{let k=w.target.files?.[0];k&&ap(k)}}),(0,m.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,m.jsx)(Bt,{type:"button",size:"icon",variant:"ghost",onClick:()=>Rn.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,m.jsx)(Wl,{className:"h-2.5 w-2.5"})}),(0,m.jsx)("textarea",{placeholder:Eo?"Describe what to do with this CSV...":"Ask anything...",value:y,onChange:w=>{b(w.target.value),w.target.value.length>0&&Aa()},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:w=>{let k=w.target;k.style.height="auto",k.style.height=Math.min(k.scrollHeight,120)+"px"},onKeyDown:w=>{if(w.key==="Enter"&&!w.shiftKey&&!w.metaKey&&!w.ctrlKey){if(w.preventDefault(),y.trim()||Eo){let k=w.currentTarget.closest("form");k&&k.requestSubmit()}return}if((w.metaKey||w.ctrlKey)&&w.key==="Enter"){let k=op.current;if(k){w.preventDefault(),w.stopPropagation(),ip(k);return}if(Ze){w.preventDefault(),w.stopPropagation(),sp();return}if(Ii){w.preventDefault(),w.stopPropagation(),np(Ii);return}if(Be.current){w.preventDefault(),w.stopPropagation(),lp();return}}}}),(0,m.jsx)(Bt,{type:"submit",size:"icon",disabled:!y.trim()&&!Eo,className:"h-6 w-6 rounded-full bg-gray-900 hover:bg-gray-800 disabled:bg-gray-300",children:(0,m.jsx)(jl,{className:"h-2.5 w-2.5"})})]})]})]}),(0,m.jsx)(VI,{x:Su.x,y:Su.y,visible:Su.visible,onClick:Su.onClick})]}):(0,m.jsx)("div",{className:"fixed bottom-6 left-1/2 -translate-x-1/2 z-50",children:(0,m.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 ${Ty?"w-[480px]":"w-[320px]"}`,children:Ty?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("input",{ref:_y,type:"text",value:En,onChange:w=>Cu(w.target.value),onKeyDown:w=>{w.key==="Enter"&&En.trim()?(w.preventDefault(),r?.(),bu(En.trim()),Cu(""),ki(!1)):w.key==="Escape"&&(ki(!1),Cu(""))},onBlur:()=>{En.trim()||setTimeout(()=>ki(!1),200)},placeholder:"Ask a question...",className:"flex-1 text-sm text-gray-700 outline-none bg-transparent"}),(0,m.jsxs)("div",{className:"flex items-center gap-2",children:[(0,m.jsx)("span",{className:"text-xs text-gray-400 font-medium",children:"\u21B5 Enter"}),(0,m.jsx)("button",{onClick:()=>{r?.(),En.trim()&&b(En),Cu(""),ki(!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,m.jsx)(Hr,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"})})]})]}):(0,m.jsxs)("div",{className:"flex items-center gap-3 w-full",children:[(0,m.jsxs)("button",{onClick:()=>{ki(!0),setTimeout(()=>_y.current?.focus(),100)},className:"flex items-center gap-3 flex-1 group",children:[(0,m.jsx)("span",{className:"text-sm text-gray-500 flex-1 text-left",children:"Ask a question..."}),(0,m.jsx)("span",{className:"text-xs text-gray-400 font-medium",children:"\u2318I"})]}),(0,m.jsx)("button",{onClick:()=>{r?.()},className:"h-7 w-7 rounded-lg bg-gray-100 hover:bg-gray-200 flex items-center justify-center transition-colors",children:(0,m.jsx)(Hr,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"})})]})})})}function GI({onNavigate:e,onActionComplete:t,currentPage:r,agentUrl:a,startingQuestions:o,startingQuestionsEndpoint:n,defaultOpen:s=!1,isOpen:i,onOpenChange:l,userId:u,orgId:c,userName:d,userEmail:f,userOrganization:h,supabaseUrl:v,supabaseAnonKey:x}){let[C,g]=F.useState(s),p=i!==void 0?i:C,y=b=>{i===void 0&&g(b),l?.(b)};return F.useEffect(()=>{let b=document.body.style.paddingRight,L=document.body.style.transition;return document.body.style.transition="padding-right 0.3s ease",document.body.style.paddingRight=p?`${WI}px`:"0px",()=>{document.body.style.paddingRight=b,document.body.style.transition=L}},[p]),(0,m.jsx)(OD,{isOpen:p,onClose:()=>y(!1),onOpen:()=>y(!0),onNavigate:e,onActionComplete:t,currentPage:r,agentUrl:a,startingQuestions:o,startingQuestionsEndpoint:n,userId:u,orgId:c,userName:d,userEmail:f,userOrganization:h,supabaseUrl:v,supabaseAnonKey:x})}var wy=O(ue(),1),Ci=null,Ht=null,sr={};function BD({initialConfig:e}){let[t,r]=(0,Yr.useState)(e),[a,o]=(0,Yr.useState)(e.currentPage||"dashboard"),[n,s]=(0,Yr.useState)(!1),i=(0,Yr.useRef)(!1);return(0,Yr.useEffect)(()=>{i.current=n},[n]),(0,Yr.useEffect)(()=>(sr.setCurrentPage=o,sr.setConfig=l=>r(u=>({...u,...l})),sr.setIsOpen=s,sr.getIsOpen=()=>i.current,()=>{sr={}}),[]),(0,Yr.useEffect)(()=>{t.theme==="dark"?Ht?.classList.add("dark"):Ht?.classList.remove("dark")},[t.theme]),(0,wy.jsx)(GI,{isOpen:n,onOpenChange:s,currentPage:a,agentUrl:t.agentUrl,onNavigate:(l,u)=>t.onNavigate?.(l,u),onActionComplete:t.onActionComplete,startingQuestions:t.startingQuestions,startingQuestionsEndpoint:t.startingQuestionsEndpoint,userId:t.userId,orgId:t.orgId,userName:t.userName,userEmail:t.userEmail,userOrganization:t.userOrganization})}function FD(){if(console.log("[KiteChat-Debug] injectStyles called",{existingStyle:!!document.getElementById("kite-chat-styles"),cssContentLength:47758}),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 */
76
+ transition-all duration-150 ease-in-out`,children:_.label},_.id))})]})},w.id)}),(ge||bi)&&(0,m.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[ge&&ge.stepIndex>0&&(0,m.jsx)(Bt,{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:ik,children:(0,m.jsx)(ks,{className:"h-3.5 w-3.5 text-gray-600"})}),(0,m.jsxs)(Bt,{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:bi?Ey:lp,children:[(0,m.jsx)("span",{children:bi?"Done":"Next"}),(0,m.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,m.jsx)(va,{className:"h-3 w-3"}),(0,m.jsx)(xa,{className:"h-3 w-3"})]})]})]}),(_n==="thinking"||_n==="searching"||_n==="executing"||_n==="responding")&&(0,m.jsx)("div",{className:`${JI==="user"?"mt-3":""}`,children:(0,m.jsx)(gC,{phase:_n,progressSteps:XI})}),T&&j&&(0,m.jsx)("div",{className:"mt-2",children:(0,m.jsx)(zI,{})}),!ge&&(0,m.jsx)("div",{ref:ky})]})})})})}),(0,m.jsxs)("div",{className:"px-4 py-3 border-t border-gray-100 bg-gray-50/50 shrink-0",children:[Ro&&(0,m.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,m.jsx)(Ps,{className:"h-4 w-4 text-blue-600"}),(0,m.jsx)("span",{className:"text-xs text-blue-700 flex-1 truncate",children:Ro.name}),(0,m.jsx)("button",{type:"button",onClick:()=>{ap(null),Rn.current&&(Rn.current.value="")},className:"text-blue-600 hover:text-blue-800",children:(0,m.jsx)(mn,{className:"h-4 w-4"})})]}),(0,m.jsxs)("form",{onSubmit:rk,className:"w-full",children:[(0,m.jsx)("input",{ref:Rn,type:"file",accept:".csv",className:"hidden",onChange:w=>{let k=w.target.files?.[0];k&&ap(k)}}),(0,m.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,m.jsx)(Bt,{type:"button",size:"icon",variant:"ghost",onClick:()=>Rn.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,m.jsx)(Wl,{className:"h-2.5 w-2.5"})}),(0,m.jsx)("textarea",{placeholder:Ro?"Describe what to do with this CSV...":"Ask anything...",value:y,onChange:w=>{b(w.target.value),w.target.value.length>0&&Aa()},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:w=>{let k=w.target;k.style.height="auto",k.style.height=Math.min(k.scrollHeight,120)+"px"},onKeyDown:w=>{if(w.key==="Enter"&&!w.shiftKey&&!w.metaKey&&!w.ctrlKey){if(w.preventDefault(),y.trim()||Ro){let k=w.currentTarget.closest("form");k&&k.requestSubmit()}return}if((w.metaKey||w.ctrlKey)&&w.key==="Enter"){let k=op.current;if(k){w.preventDefault(),w.stopPropagation(),ip(k);return}if(Ze){w.preventDefault(),w.stopPropagation(),sp();return}if(Ii){w.preventDefault(),w.stopPropagation(),np(Ii);return}if(Be.current){w.preventDefault(),w.stopPropagation(),lp();return}}}}),(0,m.jsx)(Bt,{type:"submit",size:"icon",disabled:!y.trim()&&!Ro,className:"h-6 w-6 rounded-full bg-gray-900 hover:bg-gray-800 disabled:bg-gray-300",children:(0,m.jsx)(jl,{className:"h-2.5 w-2.5"})})]})]})]}),(0,m.jsx)(VI,{x:Su.x,y:Su.y,visible:Su.visible,onClick:Su.onClick})]}):(0,m.jsx)("div",{className:"fixed bottom-6 left-1/2 -translate-x-1/2 z-50",children:(0,m.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 ${Ty?"w-[480px]":"w-[320px]"}`,children:Ty?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("input",{ref:_y,type:"text",value:En,onChange:w=>Cu(w.target.value),onKeyDown:w=>{w.key==="Enter"&&En.trim()?(w.preventDefault(),r?.(),bu(En.trim()),Cu(""),ki(!1)):w.key==="Escape"&&(ki(!1),Cu(""))},onBlur:()=>{En.trim()||setTimeout(()=>ki(!1),200)},placeholder:"Ask a question...",className:"flex-1 text-sm text-gray-700 outline-none bg-transparent"}),(0,m.jsxs)("div",{className:"flex items-center gap-2",children:[(0,m.jsx)("span",{className:"text-xs text-gray-400 font-medium",children:"\u21B5 Enter"}),(0,m.jsx)("button",{onClick:()=>{r?.(),En.trim()&&b(En),Cu(""),ki(!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,m.jsx)(Hr,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"})})]})]}):(0,m.jsxs)("div",{className:"flex items-center gap-3 w-full",children:[(0,m.jsxs)("button",{onClick:()=>{ki(!0),setTimeout(()=>_y.current?.focus(),100)},className:"flex items-center gap-3 flex-1 group",children:[(0,m.jsx)("span",{className:"text-sm text-gray-500 flex-1 text-left",children:"Ask a question..."}),(0,m.jsx)("span",{className:"text-xs text-gray-400 font-medium",children:"\u2318I"})]}),(0,m.jsx)("button",{onClick:()=>{r?.()},className:"h-7 w-7 rounded-lg bg-gray-100 hover:bg-gray-200 flex items-center justify-center transition-colors",children:(0,m.jsx)(Hr,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"})})]})})})}function GI({onNavigate:e,onActionComplete:t,currentPage:r,agentUrl:a,startingQuestions:o,startingQuestionsEndpoint:n,defaultOpen:s=!1,isOpen:i,onOpenChange:l,userId:u,orgId:c,userName:d,userEmail:f,userOrganization:h,supabaseUrl:v,supabaseAnonKey:x}){let[C,g]=F.useState(s),p=i!==void 0?i:C,y=b=>{i===void 0&&g(b),l?.(b)};return F.useEffect(()=>{let b=document.body.style.paddingRight,L=document.body.style.transition;return document.body.style.transition="padding-right 0.3s ease",document.body.style.paddingRight=p?`${WI}px`:"0px",()=>{document.body.style.paddingRight=b,document.body.style.transition=L}},[p]),(0,m.jsx)(BD,{isOpen:p,onClose:()=>y(!1),onOpen:()=>y(!0),onNavigate:e,onActionComplete:t,currentPage:r,agentUrl:a,startingQuestions:o,startingQuestionsEndpoint:n,userId:u,orgId:c,userName:d,userEmail:f,userOrganization:h,supabaseUrl:v,supabaseAnonKey:x})}var wy=O(ue(),1),Ci=null,Ht=null,sr={};function FD({initialConfig:e}){let[t,r]=(0,Yr.useState)(e),[a,o]=(0,Yr.useState)(e.currentPage||"dashboard"),[n,s]=(0,Yr.useState)(!1),i=(0,Yr.useRef)(!1);return(0,Yr.useEffect)(()=>{i.current=n},[n]),(0,Yr.useEffect)(()=>(sr.setCurrentPage=o,sr.setConfig=l=>r(u=>({...u,...l})),sr.setIsOpen=s,sr.getIsOpen=()=>i.current,()=>{sr={}}),[]),(0,Yr.useEffect)(()=>{t.theme==="dark"?Ht?.classList.add("dark"):Ht?.classList.remove("dark")},[t.theme]),(0,wy.jsx)(GI,{isOpen:n,onOpenChange:s,currentPage:a,agentUrl:t.agentUrl,onNavigate:(l,u)=>t.onNavigate?.(l,u),onActionComplete:t.onActionComplete,startingQuestions:t.startingQuestions,startingQuestionsEndpoint:t.startingQuestionsEndpoint,userId:t.userId,orgId:t.orgId,userName:t.userName,userEmail:t.userEmail,userOrganization:t.userOrganization})}function UD(){if(console.log("[KiteChat-Debug] injectStyles called",{existingStyle:!!document.getElementById("kite-chat-styles"),cssContentLength:47758}),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 */
77
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-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;--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;--animate-bounce:bounce 1s 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-1{margin-left:calc(var(--spacing)*1)}#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{width:calc(var(--spacing)*2)}#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-bounce{animation:var(--animate-bounce)}#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-400{background-color:var(--color-gray-400)}#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-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 .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}@keyframes bounce{0%,to{animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}#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
78
  #kite-chat-root {
79
79
  /* Container is just a mount point - ChatPanel handles its own positioning */
80
80
  }
81
- `,document.head.appendChild(t)}function xy(){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(Ci){console.warn("[KiteChat] Already initialized");return}if(FD(),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}Ht=document.createElement("div"),Ht.id="kite-chat-root",t.appendChild(Ht),console.log("[KiteChat-Debug] Created inner wrapper with kite-chat-root ID inside custom container")}else Ht=document.createElement("div"),Ht.id="kite-chat-root",document.body.appendChild(Ht),console.log("[KiteChat-Debug] Created default container",{containerId:Ht.id});console.log("[KiteChat-Debug] About to render",{finalContainerId:Ht?.id||"NO_ID",finalContainerClasses:Ht?.className||""}),Ci=(0,KI.createRoot)(Ht),Ci.render((0,wy.jsx)(BD,{initialConfig:e})),window.KiteChat=UD(),console.log("[KiteChat] Initialized")}function UD(){return{setCurrentPage:e=>sr.setCurrentPage?.(e),setUser:(e,t)=>sr.setConfig?.({userId:e,orgId:t}),setConfig:e=>sr.setConfig?.(e),open:()=>sr.setIsOpen?.(!0),close:()=>sr.setIsOpen?.(!1),toggle:()=>{let e=sr.getIsOpen?.()??!1;sr.setIsOpen?.(!e)},isOpen:()=>sr.getIsOpen?.()??!1,destroy:()=>{Ci?.unmount(),Ci=null,Ht?.remove(),Ht=null,window.KiteChat=void 0},isMounted:()=>Ci!==null}}typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",xy):xy());return hk(VD);})();
81
+ `,document.head.appendChild(t)}function xy(){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(Ci){console.warn("[KiteChat] Already initialized");return}if(UD(),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}Ht=document.createElement("div"),Ht.id="kite-chat-root",t.appendChild(Ht),console.log("[KiteChat-Debug] Created inner wrapper with kite-chat-root ID inside custom container")}else Ht=document.createElement("div"),Ht.id="kite-chat-root",document.body.appendChild(Ht),console.log("[KiteChat-Debug] Created default container",{containerId:Ht.id});console.log("[KiteChat-Debug] About to render",{finalContainerId:Ht?.id||"NO_ID",finalContainerClasses:Ht?.className||""}),Ci=(0,KI.createRoot)(Ht),Ci.render((0,wy.jsx)(FD,{initialConfig:e})),window.KiteChat=VD(),console.log("[KiteChat] Initialized")}function VD(){return{setCurrentPage:e=>sr.setCurrentPage?.(e),setUser:(e,t)=>sr.setConfig?.({userId:e,orgId:t}),setConfig:e=>sr.setConfig?.(e),open:()=>sr.setIsOpen?.(!0),close:()=>sr.setIsOpen?.(!1),toggle:()=>{let e=sr.getIsOpen?.()??!1;sr.setIsOpen?.(!e)},isOpen:()=>sr.getIsOpen?.()??!1,destroy:()=>{Ci?.unmount(),Ci=null,Ht?.remove(),Ht=null,window.KiteChat=void 0},isMounted:()=>Ci!==null}}typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",xy):xy());return hk(jD);})();
82
82
  /*! Bundled license information:
83
83
 
84
84
  react/cjs/react.production.min.js: