vendor: 6,772 bytes, lines 1-9
1var cA=t=>{throw TypeError(t)};var wG=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var D1=(t,e,n)=>e.has(t)||cA("Cannot "+n);var ue=(t,e,n)=>(D1(t,e,"read from private field"),n?n.call(t):e.get(t)),Nt=(t,e,n)=>e.has(t)?cA("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),dt=(t,e,n,r)=>(D1(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),br=(t,e,n)=>(D1(t,e,"access private method"),n);var vv=(t,e,n,r)=>({set _(i){dt(t,e,i,n)},get _(){return ue(t,e,r)}});var ZFe=wG((xBe,Zg)=>{function x8(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(t,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();var yv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Lt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function SG(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var w8={exports:{}},gx={},S8={exports:{}},_t={};/** 2 * @license React 3 * react.production.min.js 4 * 5 * Copyright (c) Facebook, Inc. and its affiliates. 6 * 7 * This source code is licensed under the MIT license found in the 8 * LICENSE file in the root directory of this source tree. 9 */var Mg=Symbol.for("react.element"),kG=Symbol.for("react.portal"),_G=Symbol.for("react.fragment"),CG=Symbol.for("react.strict_mode"),TG=Symbol.for("react.profiler"),EG=Symbol.for("react.provider"),jG=Symbol.for("react.context"),PG=Symbol.for("react.forward_ref"),NG=Symbol.for("react.suspense"),AG=Symbol.for("react.memo"),OG=Symbol.for("react.lazy"),lA=Symbol.iterator;function RG(t){return t===null||typeof t!="object"?null:(t=lA&&t[lA]||t["@@iterator"],typeof t=="function"?t:null)}var k8={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_8=Object.assign,C8={};function of(t,e,n){this.props=t,this.context=e,this.refs=C8,this.updater=n||k8}of.prototype.isReactComponent={};of.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=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,t,e,"setState")};of.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function T8(){}T8.prototype=of.prototype;function KE(t,e,n){this.props=t,this.context=e,this.refs=C8,this.updater=n||k8}var GE=KE.prototype=new T8;GE.constructor=KE;_8(GE,of.prototype);GE.isPureReactComponent=!0;var uA=Array.isArray,E8=Object.prototype.hasOwnProperty,YE={current:null},j8={key:!0,ref:!0,__self:!0,__source:!0};function P8(t,e,n){var r,i={},a=null,s=null;if(e!=null)for(r in e.ref!==void 0&&(s=e.ref),e.key!==void 0&&(a=""+e.key),e)E8.call(e,r)&&!j8.hasOwnProperty(r)&&(i[r]=e[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var c=Array(o),u=0;u<o;u++)c[u]=arguments[u+2];i.children=c}if(t&&t.defaultProps)for(r in o=t.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return{$$typeof:Mg,type:t,key:a,ref:s,props:i,_owner:YE.current}}function DG(t,e){return{$$typeof:Mg,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function JE(t){return typeof t=="object"&&t!==null&&t.$$typeof===Mg}function MG(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var dA=/\/+/g;function M1(t,e){return typeof t=="object"&&t!==null&&t.key!=null?MG(""+t.key):e.toString(36)}function Sy(t,e,n,r,i){var a=typeof t;(a==="undefined"||a==="boolean")&&(t=null);var s=!1;if(t===null)s=!0;else switch(a){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case Mg:case kG:s=!0}}if(s)return s=t,i=i(s),t=r===""?"."+M1(s,0):r,uA(i)?(n="",t!=null&&(n=t.replace(dA,"$&/")+"/"),Sy(i,e,n,"",function(u){return u})):i!=null&&(JE(i)&&(i=DG(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(dA,"$&/")+"/")+t)),e.push(i)),1;if(s=0,r=r===""?".":r+":",uA(t))for(var o=0;o<t.length;o++){a=t[o];var c=r+M1(a,o);s+=Sy(a,e,n,c,i)}else if(c=RG(t),typeof c=="function")for(t=c.call(t),o=0;!(a=t.next()).done;)a=a.value,c=r+M1(a,o++),s+=Sy(a,e,n,c,i);else if(a==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return s}function bv(t,e,n){if(t==null)return t;var r=[],i=0;return Sy(t,r,"","",function(a){return e.call(n,a,i++)}),r}function IG(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var Kr={current:null},ky={transition:null},LG={ReactCurrentDispatcher:Kr,ReactCurrentBatchConfig:ky,ReactCurrentOwner:YE};function N8(){throw Error("act(...) is not supported in production builds of React.")}_t.Children={map:bv,forEach:function(t,e,n){bv(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return bv(t,function(){e++}),e},toArray:function(t){return bv(t,function(e){return e})||[]},only:function(t){if(!JE(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};_t.Component=of;_t.Fragment=_G;_t.Profiler=TG;_t.PureComponent=KE;_t.StrictMode=CG;_t.Suspense=NG;
vendor: 9,001 bytes, lines 9-33
9_t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=LG;_t.act=N8;_t.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=_8({},t.props),i=t.key,a=t.ref,s=t._owner;if(e!=null){if(e.ref!==void 0&&(a=e.ref,s=YE.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var o=t.type.defaultProps;for(c in e)E8.call(e,c)&&!j8.hasOwnProperty(c)&&(r[c]=e[c]===void 0&&o!==void 0?o[c]:e[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){o=Array(c);for(var u=0;u<c;u++)o[u]=arguments[u+2];r.children=o}return{$$typeof:Mg,type:t.type,key:i,ref:a,props:r,_owner:s}};_t.createContext=function(t){return t={$$typeof:jG,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:EG,_context:t},t.Consumer=t};_t.createElement=P8;_t.createFactory=function(t){var e=P8.bind(null,t);return e.type=t,e};_t.createRef=function(){return{current:null}};_t.forwardRef=function(t){return{$$typeof:PG,render:t}};_t.isValidElement=JE;_t.lazy=function(t){return{$$typeof:OG,_payload:{_status:-1,_result:t},_init:IG}};_t.memo=function(t,e){return{$$typeof:AG,type:t,compare:e===void 0?null:e}};_t.startTransition=function(t){var e=ky.transition;ky.transition={};try{t()}finally{ky.transition=e}};_t.unstable_act=N8;_t.useCallback=function(t,e){return Kr.current.useCallback(t,e)};_t.useContext=function(t){return Kr.current.useContext(t)};_t.useDebugValue=function(){};_t.useDeferredValue=function(t){return Kr.current.useDeferredValue(t)};_t.useEffect=function(t,e){return Kr.current.useEffect(t,e)};_t.useId=function(){return Kr.current.useId()};_t.useImperativeHandle=function(t,e,n){return Kr.current.useImperativeHandle(t,e,n)};_t.useInsertionEffect=function(t,e){return Kr.current.useInsertionEffect(t,e)};_t.useLayoutEffect=function(t,e){return Kr.current.useLayoutEffect(t,e)};_t.useMemo=function(t,e){return Kr.current.useMemo(t,e)};_t.useReducer=function(t,e,n){return Kr.current.useReducer(t,e,n)};_t.useRef=function(t){return Kr.current.useRef(t)};_t.useState=function(t){return Kr.current.useState(t)};_t.useSyncExternalStore=function(t,e,n){return Kr.current.useSyncExternalStore(t,e,n)};_t.useTransition=function(){return Kr.current.useTransition()};_t.version="18.3.1";S8.exports=_t;var b=S8.exports;const D=Lt(b),XE=x8({__proto__:null,default:D},[b]);/** 10 * @license React 11 * react-jsx-runtime.production.min.js 12 * 13 * Copyright (c) Facebook, Inc. and its affiliates. 14 * 15 * This source code is licensed under the MIT license found in the 16 * LICENSE file in the root directory of this source tree. 17 */var $G=b,FG=Symbol.for("react.element"),BG=Symbol.for("react.fragment"),UG=Object.prototype.hasOwnProperty,zG=$G.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,WG={key:!0,ref:!0,__self:!0,__source:!0};function A8(t,e,n){var r,i={},a=null,s=null;n!==void 0&&(a=""+n),e.key!==void 0&&(a=""+e.key),e.ref!==void 0&&(s=e.ref);for(r in e)UG.call(e,r)&&!WG.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:FG,type:t,key:a,ref:s,props:i,_owner:zG.current}}gx.Fragment=BG;gx.jsx=A8;gx.jsxs=A8;w8.exports=gx;var l=w8.exports,O8={exports:{}},Di={},R8={exports:{}},D8={};/** 18 * @license React 19 * scheduler.production.min.js 20 * 21 * Copyright (c) Facebook, Inc. and its affiliates. 22 * 23 * This source code is licensed under the MIT license found in the 24 * LICENSE file in the root directory of this source tree. 25 */(function(t){function e(R,z){var O=R.length;R.push(z);e:for(;0<O;){var A=O-1>>>1,L=R[A];if(0<i(L,z))R[A]=z,R[O]=L,O=A;else break e}}function n(R){return R.length===0?null:R[0]}function r(R){if(R.length===0)return null;var z=R[0],O=R.pop();if(O!==z){R[0]=O;e:for(var A=0,L=R.length,V=L>>>1;A<V;){var Y=2*(A+1)-1,Q=R[Y],re=Y+1,J=R[re];if(0>i(Q,O))re<L&&0>i(J,Q)?(R[A]=J,R[re]=O,A=re):(R[A]=Q,R[Y]=O,A=Y);else if(re<L&&0>i(J,O))R[A]=J,R[re]=O,A=re;else break e}}return z}function i(R,z){var O=R.sortIndex-z.sortIndex;return O!==0?O:R.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,o=s.now();t.unstable_now=function(){return s.now()-o}}var c=[],u=[],d=1,h=null,f=3,p=!1,g=!1,m=!1,v=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(R){for(var z=n(u);z!==null;){if(z.callback===null)r(u);else if(z.startTime<=R)r(u),z.sortIndex=z.expirationTime,e(c,z);else break;z=n(u)}}function k(R){if(m=!1,y(R),!g)if(n(c)!==null)g=!0,$(S);else{var z=n(u);z!==null&&I(k,z.startTime-R)}}function S(R,z){g=!1,m&&(m=!1,x(T),T=-1),p=!0;var O=f;try{for(y(z),h=n(c);h!==null&&(!(h.expirationTime>z)||R&&!P());){var A=h.callback;if(typeof A=="function"){h.callback=null,f=h.priorityLevel;var L=A(h.expirationTime<=z);z=t.unstable_now(),typeof L=="function"?h.callback=L:h===n(c)&&r(c),y(z)}else r(c);h=n(c)}if(h!==null)var V=!0;else{var Y=n(u);Y!==null&&I(k,Y.startTime-z),V=!1}return V}finally{h=null,f=O,p=!1}}var _=!1,C=null,T=-1,E=5,j=-1;function P(){return!(t.unstable_now()-j<E)}function M(){if(C!==null){var R=t.unstable_now();j=R;var z=!0;try{z=C(!0,R)}finally{z?U():(_=!1,C=null)}}else _=!1}var U;if(typeof w=="function")U=function(){w(M)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,B=N.port2;N.port1.onmessage=M,U=function(){B.postMessage(null)}}else U=function(){v(M,0)};function $(R){C=R,_||(_=!0,U())}function I(R,z){T=v(function(){R(t.unstable_now())},z)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(R){R.callback=null},t.unstable_continueExecution=function(){g||p||(g=!0,$(S))},t.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<R?Math.floor(1e3/R):5},t.unstable_getCurrentPriorityLevel=function(){return f},t.unstable_getFirstCallbackNode=function(){return n(c)},t.unstable_next=function(R){switch(f){case 1:case 2:case 3:var z=3;break;default:z=f}var O=f;f=z;try{return R()}finally{f=O}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(R,z){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var O=f;f=R;try{return z()}finally{f=O}},t.unstable_scheduleCallback=function(R,z,O){var A=t.unstable_now();switch(typeof O=="object"&&O!==null?(O=O.delay,O=typeof O=="number"&&0<O?A+O:A):O=A,R){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=O+L,R={id:d++,callback:z,priorityLevel:R,startTime:O,expirationTime:L,sortIndex:-1},O>A?(R.sortIndex=O,e(u,R),n(c)===null&&R===n(u)&&(m?(x(T),T=-1):m=!0,I(k,O-A))):(R.sortIndex=L,e(c,R),g||p||(g=!0,$(S))),R},t.unstable_shouldYield=P,t.unstable_wrapCallback=function(R){var z=f;return function(){var O=f;f=z;try{return R.apply(this,arguments)}finally{f=O}}}})(D8);R8.exports=D8;var VG=R8.exports;/** 26 * @license React 27 * react-dom.production.min.js 28 * 29 * Copyright (c) Facebook, Inc. and its affiliates. 30 * 31 * This source code is licensed under the MIT license found in the 32 * LICENSE file in the root directory of this source tree. 33 */var HG=b,Ai=VG;function we(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var M8=new Set,nm={};function yu(t,e){th(t,e),th(t+"Capture",e)}function th(t,e){for(nm[t]=e,t=0;t<e.length;t++)M8.add(e[t])}var ho=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Gk=Object.prototype.hasOwnProperty,qG=/^[: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]*$/,hA={},fA={};function KG(t){return Gk.call(fA,t)?!0:Gk.call(hA,t)?!1:qG.test(t)?fA[t]=!0:(hA[t]=!0,!1)}function GG(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function YG(t,e,n,r){if(e===null||typeof e>"u"||GG(t,e,n,r))return!0;
vendor: 5,200 bytes, lines 33-34
33if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Gr(t,e,n,r,i,a,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=a,this.removeEmptyString=s}var vr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){vr[t]=new Gr(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];vr[e]=new Gr(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){vr[t]=new Gr(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){vr[t]=new Gr(t,2,!1,t,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(t){vr[t]=new Gr(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){vr[t]=new Gr(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){vr[t]=new Gr(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){vr[t]=new Gr(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){vr[t]=new Gr(t,5,!1,t.toLowerCase(),null,!1,!1)});var ZE=/[\-:]([a-z])/g;function QE(t){return t[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(t){var e=t.replace(ZE,QE);vr[e]=new Gr(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(ZE,QE);vr[e]=new Gr(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(ZE,QE);vr[e]=new Gr(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){vr[t]=new Gr(t,1,!1,t.toLowerCase(),null,!1,!1)});vr.xlinkHref=new Gr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){vr[t]=new Gr(t,1,!1,t.toLowerCase(),null,!0,!0)});function e2(t,e,n,r){var i=vr.hasOwnProperty(e)?vr[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(YG(e,n,i,r)&&(n=null),r||i===null?KG(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):i.mustUseProperty?t[i.propertyName]=n===null?i.type===3?!1:"":n:(e=i.attributeName,r=i.attributeNamespace,n===null?t.removeAttribute(e):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var ko=HG.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,xv=Symbol.for("react.element"),rd=Symbol.for("react.portal"),id=Symbol.for("react.fragment"),t2=Symbol.for("react.strict_mode"),Yk=Symbol.for("react.profiler"),I8=Symbol.for("react.provider"),L8=Symbol.for("react.context"),n2=Symbol.for("react.forward_ref"),Jk=Symbol.for("react.suspense"),Xk=Symbol.for("react.suspense_list"),r2=Symbol.for("react.memo"),Fo=Symbol.for("react.lazy"),$8=Symbol.for("react.offscreen"),pA=Symbol.iterator;function Ff(t){return t===null||typeof t!="object"?null:(t=pA&&t[pA]||t["@@iterator"],typeof t=="function"?t:null)}var _n=Object.assign,I1;function gp(t){if(I1===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);I1=e&&e[1]||""}return` 34`+I1+t}var L1=!1;function $1(t,e){if(!t||L1)return"";L1=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(u){var r=u}Reflect.construct(t,[],e)}else{try{e.call()}catch(u){r=u}t.call(e.prototype)}else{try{throw Error()}catch(u){r=u}t()}}
vendor: 14,784 bytes, lines 34-37
34catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(` 35`),a=r.stack.split(` 36`),s=i.length-1,o=a.length-1;1<=s&&0<=o&&i[s]!==a[o];)o--;for(;1<=s&&0<=o;s--,o--)if(i[s]!==a[o]){if(s!==1||o!==1)do if(s--,o--,0>o||i[s]!==a[o]){var c=` 37`+i[s].replace(" at new "," at ");return t.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",t.displayName)),c}while(1<=s&&0<=o);break}}}finally{L1=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?gp(t):""}function JG(t){switch(t.tag){case 5:return gp(t.type);case 16:return gp("Lazy");case 13:return gp("Suspense");case 19:return gp("SuspenseList");case 0:case 2:case 15:return t=$1(t.type,!1),t;case 11:return t=$1(t.type.render,!1),t;case 1:return t=$1(t.type,!0),t;default:return""}}function Zk(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case id:return"Fragment";case rd:return"Portal";case Yk:return"Profiler";case t2:return"StrictMode";case Jk:return"Suspense";case Xk:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case L8:return(t.displayName||"Context")+".Consumer";case I8:return(t._context.displayName||"Context")+".Provider";case n2:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case r2:return e=t.displayName||null,e!==null?e:Zk(t.type)||"Memo";case Fo:e=t._payload,t=t._init;try{return Zk(t(e))}catch{}}return null}function XG(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Zk(e);case 8:return e===t2?"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 e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Ec(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function F8(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function ZG(t){var e=F8(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,a=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,a.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function wv(t){t._valueTracker||(t._valueTracker=ZG(t))}function B8(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=F8(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function n0(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Qk(t,e){var n=e.checked;return _n({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function mA(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Ec(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function U8(t,e){e=e.checked,e!=null&&e2(t,"checked",e,!1)}function e_(t,e){U8(t,e);var n=Ec(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?t_(t,e.type,n):e.hasOwnProperty("defaultValue")&&t_(t,e.type,Ec(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function gA(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function t_(t,e,n){(e!=="number"||n0(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var vp=Array.isArray;function kd(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i<n.length;i++)e["$"+n[i]]=!0;for(n=0;n<t.length;n++)i=e.hasOwnProperty("$"+t[n].value),t[n].selected!==i&&(t[n].selected=i),i&&r&&(t[n].defaultSelected=!0)}else{for(n=""+Ec(n),e=null,i=0;i<t.length;i++){if(t[i].value===n){t[i].selected=!0,r&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function n_(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(we(91));return _n({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function vA(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(we(92));if(vp(n)){if(1<n.length)throw Error(we(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:Ec(n)}}function z8(t,e){var n=Ec(e.value),r=Ec(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function yA(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function W8(t){switch(t){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 r_(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?W8(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Sv,V8=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,i){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,i)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(Sv=Sv||document.createElement("div"),Sv.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Sv.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function rm(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var jp={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},QG=["Webkit","ms","Moz","O"];Object.keys(jp).forEach(function(t){QG.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),jp[e]=jp[t]})});function H8(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||jp.hasOwnProperty(t)&&jp[t]?(""+e).trim():e+"px"}function q8(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=H8(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var eY=_n({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 i_(t,e){if(e){if(eY[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(we(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(we(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(we(61))}if(e.style!=null&&typeof e.style!="object")throw Error(we(62))}}function a_(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 s_=null;function i2(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var o_=null,_d=null,Cd=null;function bA(t){if(t=$g(t)){if(typeof o_!="function")throw Error(we(280));var e=t.stateNode;e&&(e=wx(e),o_(t.stateNode,t.type,e))}}function K8(t){_d?Cd?Cd.push(t):Cd=[t]:_d=t}function G8(){if(_d){var t=_d,e=Cd;if(Cd=_d=null,bA(t),e)for(t=0;t<e.length;t++)bA(e[t])}}function Y8(t,e){return t(e)}function J8(){}var F1=!1;function X8(t,e,n){if(F1)return t(e,n);F1=!0;try{return Y8(t,e,n)}finally{F1=!1,(_d!==null||Cd!==null)&&(J8(),G8())}}function im(t,e){var n=t.stateNode;if(n===null)return null;var r=wx(n);if(r===null)return null;n=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(we(231,e,typeof n));return n}var c_=!1;if(ho)try{var Bf={};Object.defineProperty(Bf,"passive",{get:function(){c_=!0}}),window.addEventListener("test",Bf,Bf),window.removeEventListener("test",Bf,Bf)}catch{c_=!1}function tY(t,e,n,r,i,a,s,o,c){var u=Array.prototype.slice.call(arguments,3);try{e.apply(n,u)}catch(d){this.onError(d)}}var Pp=!1,r0=null,i0=!1,l_=null,nY={onError:function(t){Pp=!0,r0=t}};function rY(t,e,n,r,i,a,s,o,c){Pp=!1,r0=null,tY.apply(nY,arguments)}function iY(t,e,n,r,i,a,s,o,c){if(rY.apply(this,arguments),Pp){if(Pp){var u=r0;Pp=!1,r0=null}else throw Error(we(198));i0||(i0=!0,l_=u)}}function bu(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function Z8(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function xA(t){if(bu(t)!==t)throw Error(we(188))}function aY(t){var e=t.alternate;if(!e){if(e=bu(t),e===null)throw Error(we(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return xA(i),t;if(a===r)return xA(i),e;a=a.sibling}throw Error(we(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,o=i.child;o;){if(o===n){s=!0,n=i,r=a;break}if(o===r){s=!0,r=i,n=a;break}o=o.sibling}if(!s){for(o=a.child;o;){if(o===n){s=!0,n=a,r=i;break}if(o===r){s=!0,r=a,n=i;break}o=o.sibling}if(!s)throw Error(we(189))}}if(n.alternate!==r)throw Error(we(190))}if(n.tag!==3)throw Error(we(188));return n.stateNode.current===n?t:e}function Q8(t){return t=aY(t),t!==null?e6(t):null}function e6(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=e6(t);if(e!==null)return e;t=t.sibling}return null}var t6=Ai.unstable_scheduleCallback,wA=Ai.unstable_cancelCallback,sY=Ai.unstable_shouldYield,oY=Ai.unstable_requestPaint,Mn=Ai.unstable_now,cY=Ai.unstable_getCurrentPriorityLevel,a2=Ai.unstable_ImmediatePriority,n6=Ai.unstable_UserBlockingPriority,a0=Ai.unstable_NormalPriority,lY=Ai.unstable_LowPriority,r6=Ai.unstable_IdlePriority,vx=null,ps=null;function uY(t){if(ps&&typeof ps.onCommitFiberRoot=="function")try{ps.onCommitFiberRoot(vx,t,void 0,(t.current.flags&128)===128)}catch{}}var Ha=Math.clz32?Math.clz32:fY,dY=Math.log,hY=Math.LN2;function fY(t){return t>>>=0,t===0?32:31-(dY(t)/hY|0)|0}var kv=64,_v=4194304;function yp(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function s0(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,a=t.pingedLanes,s=n&268435455;if(s!==0){var o=s&~i;o!==0?r=yp(o):(a&=s,a!==0&&(r=yp(a)))}else s=n&~i,s!==0?r=yp(s):a!==0&&(r=yp(a));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,a=e&-e,i>=a||i===16&&(a&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-Ha(e),i=1<<n,r|=t[n],e&=~i;return r}function pY(t,e){switch(t){case 1:case 2:case 4:return e+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 e+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 mY(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,i=t.expirationTimes,a=t.pendingLanes;0<a;){var s=31-Ha(a),o=1<<s,c=i[s];c===-1?(!(o&n)||o&r)&&(i[s]=pY(o,e)):c<=e&&(t.expiredLanes|=o),a&=~o}}function u_(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function i6(){var t=kv;return kv<<=1,!(kv&4194240)&&(kv=64),t}function B1(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Ig(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Ha(e),t[e]=n}function gY(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0<n;){var i=31-Ha(n),a=1<<i;e[i]=0,r[i]=-1,t[i]=-1,n&=~a}}function s2(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-Ha(n),i=1<<r;i&e|t[r]&e&&(t[r]|=e),n&=~i}}var Ut=0;function a6(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var s6,o2,o6,c6,l6,d_=!1,Cv=[],lc=null,uc=null,dc=null,am=new Map,sm=new Map,Wo=[],vY="mou
37sedown 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 SA(t,e){switch(t){case"focusin":case"focusout":lc=null;break;case"dragenter":case"dragleave":uc=null;break;case"mouseover":case"mouseout":dc=null;break;case"pointerover":case"pointerout":am.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":sm.delete(e.pointerId)}}function Uf(t,e,n,r,i,a){return t===null||t.nativeEvent!==a?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},e!==null&&(e=$g(e),e!==null&&o2(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function yY(t,e,n,r,i){switch(e){case"focusin":return lc=Uf(lc,t,e,n,r,i),!0;case"dragenter":return uc=Uf(uc,t,e,n,r,i),!0;case"mouseover":return dc=Uf(dc,t,e,n,r,i),!0;case"pointerover":var a=i.pointerId;return am.set(a,Uf(am.get(a)||null,t,e,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,sm.set(a,Uf(sm.get(a)||null,t,e,n,r,i)),!0}return!1}function u6(t){var e=Cl(t.target);if(e!==null){var n=bu(e);if(n!==null){if(e=n.tag,e===13){if(e=Z8(n),e!==null){t.blockedOn=e,l6(t.priority,function(){o6(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function _y(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=h_(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);s_=r,n.target.dispatchEvent(r),s_=null}else return e=$g(n),e!==null&&o2(e),t.blockedOn=n,!1;e.shift()}return!0}function kA(t,e,n){_y(t)&&n.delete(e)}function bY(){d_=!1,lc!==null&&_y(lc)&&(lc=null),uc!==null&&_y(uc)&&(uc=null),dc!==null&&_y(dc)&&(dc=null),am.forEach(kA),sm.forEach(kA)}function zf(t,e){t.blockedOn===e&&(t.blockedOn=null,d_||(d_=!0,Ai.unstable_scheduleCallback(Ai.unstable_NormalPriority,bY)))}function om(t){function e(i){return zf(i,t)}if(0<Cv.length){zf(Cv[0],t);for(var n=1;n<Cv.length;n++){var r=Cv[n];r.blockedOn===t&&(r.blockedOn=null)}}for(lc!==null&&zf(lc,t),uc!==null&&zf(uc,t),dc!==null&&zf(dc,t),am.forEach(e),sm.forEach(e),n=0;n<Wo.length;n++)r=Wo[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<Wo.length&&(n=Wo[0],n.blockedOn===null);)u6(n),n.blockedOn===null&&Wo.shift()}var Td=ko.ReactCurrentBatchConfig,o0=!0;function xY(t,e,n,r){var i=Ut,a=Td.transition;Td.transition=null;try{Ut=1,c2(t,e,n,r)}finally{Ut=i,Td.transition=a}}function wY(t,e,n,r){var i=Ut,a=Td.transition;Td.transition=null;try{Ut=4,c2(t,e,n,r)}finally{Ut=i,Td.transition=a}}function c2(t,e,n,r){if(o0){var i=h_(t,e,n,r);if(i===null)J1(t,e,r,c0,n),SA(t,r);else if(yY(i,t,e,n,r))r.stopPropagation();else if(SA(t,r),e&4&&-1<vY.indexOf(t)){for(;i!==null;){var a=$g(i);if(a!==null&&s6(a),a=h_(t,e,n,r),a===null&&J1(t,e,r,c0,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else J1(t,e,r,null,n)}}var c0=null;function h_(t,e,n,r){if(c0=null,t=i2(r),t=Cl(t),t!==null)if(e=bu(t),e===null)t=null;else if(n=e.tag,n===13){if(t=Z8(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return c0=t,null}function d6(t){switch(t){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(cY()){case a2:return 1;case n6:return 4;case a0:case lY:return 16;case r6:return 536870912;default:return 16}default:return 16}}var tc=null,l2=null,Cy=null;function h6(){if(Cy)return Cy;var t,e=l2,n=e.length,r,i="value"in tc?tc.value:tc.textContent,a=i.length;for(t=0;t<n&&e[t]===i[t];t++);var s=n-t;for(r=1;r<=s&&e[n-r]===i[a-r];r++);return Cy=i.slice(t,1<r?1-r:void 0)}function Ty(t){var e=t.keyCode;
vendor: 5,348 bytes, line 37
37return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Tv(){return!0}function _A(){return!1}function Mi(t){function e(n,r,i,a,s){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=a,this.target=s,this.currentTarget=null;for(var o in t)t.hasOwnProperty(o)&&(n=t[o],this[o]=n?n(a):a[o]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Tv:_A,this.isPropagationStopped=_A,this}return _n(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Tv)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Tv)},persist:function(){},isPersistent:Tv}),e}var cf={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},u2=Mi(cf),Lg=_n({},cf,{view:0,detail:0}),SY=Mi(Lg),U1,z1,Wf,yx=_n({},Lg,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:d2,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Wf&&(Wf&&t.type==="mousemove"?(U1=t.screenX-Wf.screenX,z1=t.screenY-Wf.screenY):z1=U1=0,Wf=t),U1)},movementY:function(t){return"movementY"in t?t.movementY:z1}}),CA=Mi(yx),kY=_n({},yx,{dataTransfer:0}),_Y=Mi(kY),CY=_n({},Lg,{relatedTarget:0}),W1=Mi(CY),TY=_n({},cf,{animationName:0,elapsedTime:0,pseudoElement:0}),EY=Mi(TY),jY=_n({},cf,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),PY=Mi(jY),NY=_n({},cf,{data:0}),TA=Mi(NY),AY={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},OY={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"},RY={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function DY(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=RY[t])?!!e[t]:!1}function d2(){return DY}var MY=_n({},Lg,{key:function(t){if(t.key){var e=AY[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Ty(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?OY[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:d2,charCode:function(t){return t.type==="keypress"?Ty(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Ty(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),IY=Mi(MY),LY=_n({},yx,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),EA=Mi(LY),$Y=_n({},Lg,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:d2}),FY=Mi($Y),BY=_n({},cf,{propertyName:0,elapsedTime:0,pseudoElement:0}),UY=Mi(BY),zY=_n({},yx,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),WY=Mi(zY),VY=[9,13,27,32],h2=ho&&"CompositionEvent"in window,Np=null;ho&&"documentMode"in document&&(Np=document.documentMode);var HY=ho&&"TextEvent"in window&&!Np,f6=ho&&(!h2||Np&&8<Np&&11>=Np),jA=" ",PA=!1;function p6(t,e){switch(t){case"keyup":return VY.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function m6(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ad=!1;function qY(t,e){switch(t){case"compositionend":return m6(e);case"keypress":return e.which!==32?null:(PA=!0,jA);case"textInput":return t=e.data,t===jA&&PA?null:t;default:return null}}function KY(t,e){if(ad)return t==="compositionend"||!h2&&p6(t,e)?(t=h6(),Cy=l2=tc=null,ad=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return f6&&e.locale!=="ko"?null:e.data;default:return null}}var GY={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 NA(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!GY[t.type]:e==="textarea"}function g6(t,e,n,r){K8(r),e=l0(e,"onChange"),0<e.length&&(n=new u2("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var Ap=null,cm=null;
vendor: 5,768 bytes, line 37
37function YY(t){E6(t,0)}function bx(t){var e=cd(t);if(B8(e))return t}function JY(t,e){if(t==="change")return e}var v6=!1;if(ho){var V1;if(ho){var H1="oninput"in document;if(!H1){var AA=document.createElement("div");AA.setAttribute("oninput","return;"),H1=typeof AA.oninput=="function"}V1=H1}else V1=!1;v6=V1&&(!document.documentMode||9<document.documentMode)}function OA(){Ap&&(Ap.detachEvent("onpropertychange",y6),cm=Ap=null)}function y6(t){if(t.propertyName==="value"&&bx(cm)){var e=[];g6(e,cm,t,i2(t)),X8(YY,e)}}function XY(t,e,n){t==="focusin"?(OA(),Ap=e,cm=n,Ap.attachEvent("onpropertychange",y6)):t==="focusout"&&OA()}function ZY(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return bx(cm)}function QY(t,e){if(t==="click")return bx(e)}function eJ(t,e){if(t==="input"||t==="change")return bx(e)}function tJ(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Ya=typeof Object.is=="function"?Object.is:tJ;function lm(t,e){if(Ya(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Gk.call(e,i)||!Ya(t[i],e[i]))return!1}return!0}function RA(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function DA(t,e){var n=RA(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=RA(n)}}function b6(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?b6(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function x6(){for(var t=window,e=n0();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=n0(t.document)}return e}function f2(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function nJ(t){var e=x6(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&b6(n.ownerDocument.documentElement,n)){if(r!==null&&f2(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!t.extend&&a>r&&(i=r,r=a,a=i),i=DA(n,a);var s=DA(n,r);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),a>r?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var rJ=ho&&"documentMode"in document&&11>=document.documentMode,sd=null,f_=null,Op=null,p_=!1;function MA(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;p_||sd==null||sd!==n0(r)||(r=sd,"selectionStart"in r&&f2(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Op&&lm(Op,r)||(Op=r,r=l0(f_,"onSelect"),0<r.length&&(e=new u2("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=sd)))}function Ev(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var od={animationend:Ev("Animation","AnimationEnd"),animationiteration:Ev("Animation","AnimationIteration"),animationstart:Ev("Animation","AnimationStart"),transitionend:Ev("Transition","TransitionEnd")},q1={},w6={};ho&&(w6=document.createElement("div").style,"AnimationEvent"in window||(delete od.animationend.animation,delete od.animationiteration.animation,delete od.animationstart.animation),"TransitionEvent"in window||delete od.transitionend.transition);function xx(t){if(q1[t])return q1[t];if(!od[t])return t;var e=od[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in w6)return q1[t]=e[n];return t}var S6=xx("animationend"),k6=xx("animationiteration"),_6=xx("animationstart"),C6=xx("transitionend"),T6=new Map,IA="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 Ic(t,e){T6.set(t,e),yu(e,[t])}for(var K1=0;K1<IA.length;K1++){var G1=IA[K1],iJ=G1.toLowerCase(),aJ=G1[0].toUpperCase()+G1.slice(1);Ic(iJ,"on"+aJ)}Ic(S6,"onAnimationEnd");Ic(k6,"onAnimationIteration");Ic(_6,"onAnimationStart");Ic("dblclick","onDoubleClick");Ic("focusin","onFocus");Ic("focusout","onBlur");Ic(C6,"onTransitionEnd");th("onMouseEnter",["mouseout","mouseover"]);th("onMouseLeave",["mouseout","mouseover"]);th("onPointerEnter",["pointerout","pointerover"]);th("onPointerLeave",["pointerout","pointerover"]);yu("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));
vendor: 4,770 bytes, line 37
37yu("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));yu("onBeforeInput",["compositionend","keypress","textInput","paste"]);yu("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));yu("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));yu("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bp="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(" "),sJ=new Set("cancel close invalid load scroll toggle".split(" ").concat(bp));function LA(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,iY(r,e,void 0,t),t.currentTarget=null}function E6(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],i=r.event;r=r.listeners;e:{var a=void 0;if(e)for(var s=r.length-1;0<=s;s--){var o=r[s],c=o.instance,u=o.currentTarget;if(o=o.listener,c!==a&&i.isPropagationStopped())break e;LA(i,o,u),a=c}else for(s=0;s<r.length;s++){if(o=r[s],c=o.instance,u=o.currentTarget,o=o.listener,c!==a&&i.isPropagationStopped())break e;LA(i,o,u),a=c}}}if(i0)throw t=l_,i0=!1,l_=null,t}function on(t,e){var n=e[b_];n===void 0&&(n=e[b_]=new Set);var r=t+"__bubble";n.has(r)||(j6(e,t,2,!1),n.add(r))}function Y1(t,e,n){var r=0;e&&(r|=4),j6(n,t,r,e)}var jv="_reactListening"+Math.random().toString(36).slice(2);function um(t){if(!t[jv]){t[jv]=!0,M8.forEach(function(n){n!=="selectionchange"&&(sJ.has(n)||Y1(n,!1,t),Y1(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[jv]||(e[jv]=!0,Y1("selectionchange",!1,e))}}function j6(t,e,n,r){switch(d6(e)){case 1:var i=xY;break;case 4:i=wY;break;default:i=c2}n=i.bind(null,e,n,t),i=void 0,!c_||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?t.addEventListener(e,n,{capture:!0,passive:i}):t.addEventListener(e,n,!0):i!==void 0?t.addEventListener(e,n,{passive:i}):t.addEventListener(e,n,!1)}function J1(t,e,n,r,i){var a=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var o=r.stateNode.containerInfo;if(o===i||o.nodeType===8&&o.parentNode===i)break;if(s===4)for(s=r.return;s!==null;){var c=s.tag;if((c===3||c===4)&&(c=s.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;s=s.return}for(;o!==null;){if(s=Cl(o),s===null)return;if(c=s.tag,c===5||c===6){r=a=s;continue e}o=o.parentNode}}r=r.return}X8(function(){var u=a,d=i2(n),h=[];e:{var f=T6.get(t);if(f!==void 0){var p=u2,g=t;switch(t){case"keypress":if(Ty(n)===0)break e;case"keydown":case"keyup":p=IY;break;case"focusin":g="focus",p=W1;break;case"focusout":g="blur",p=W1;break;case"beforeblur":case"afterblur":p=W1;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=CA;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=_Y;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=FY;break;case S6:case k6:case _6:p=EY;break;case C6:p=UY;break;case"scroll":p=SY;break;case"wheel":p=WY;break;case"copy":case"cut":case"paste":p=PY;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=EA}var m=(e&4)!==0,v=!m&&t==="scroll",x=m?f!==null?f+"Capture":null:f;m=[];for(var w=u,y;w!==null;){y=w;var k=y.stateNode;if(y.tag===5&&k!==null&&(y=k,x!==null&&(k=im(w,x),k!=null&&m.push(dm(w,k,y)))),v)break;w=w.return}0<m.length&&(f=new p(f,g,null,n,d),h.push({event:f,listeners:m}))}}if(!(e&7)){e:{if(f=t==="mouseover"||t==="pointerover",p=t==="mouseout"||t==="pointerout",f&&n!==s_&&(g=n.relatedTarget||n.fromElement)&&(Cl(g)||g[fo]))break e;if((p||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,p?(g=n.relatedTarget||n.toElement,p=u,g=g?Cl(g):null,g!==null&&(v=bu(g),g!==v||g.tag!==5&&g.tag!==6)&&(g=null)):(p=null,g=u),p!==g)){if(m=CA,k="onMouseLeave",x="onMouseEnter",w="mouse",(t==="pointerout"||t==="pointerover")&&(m=EA,k="onPointerLeave",x="onPointerEnter",w="pointer"),v=p==null?f:cd(p),y=g==null?f:cd(g),f=new m(k,w+"leave",p,n,d),f.target=v,f.relatedTarget=y,k=null,Cl(d)===u&&(m=new m(x,w+"enter",g,n,d),m.target=y,m.relatedTarget=v,k=m),v=k,p&&g)t:{for(m=p,x=g,w=0,y=m;y;y=Du(y))w++;for(y=0,k=x;k;k=Du(k))y++;for(;0<w-y;)m=Du(m),w--;for(;0<y-w;)x=Du(x),y--;for(;w--;){if(m===x||x!==null&&m===x.alternate)break t;m=Du(m),x=Du(x)}m=null}else m=null;p!==null&&$A(h,f,p,m,!1),g!==null&&v!==null&&$A(h,v,g,m,!0)}}
vendor: 7,622 bytes, lines 37-38
37e:{if(f=u?cd(u):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var S=JY;else if(NA(f))if(v6)S=eJ;else{S=ZY;var _=XY}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(S=QY);if(S&&(S=S(t,u))){g6(h,S,n,d);break e}_&&_(t,f,u),t==="focusout"&&(_=f._wrapperState)&&_.controlled&&f.type==="number"&&t_(f,"number",f.value)}switch(_=u?cd(u):window,t){case"focusin":(NA(_)||_.contentEditable==="true")&&(sd=_,f_=u,Op=null);break;case"focusout":Op=f_=sd=null;break;case"mousedown":p_=!0;break;case"contextmenu":case"mouseup":case"dragend":p_=!1,MA(h,n,d);break;case"selectionchange":if(rJ)break;case"keydown":case"keyup":MA(h,n,d)}var C;if(h2)e:{switch(t){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else ad?p6(t,n)&&(T="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(f6&&n.locale!=="ko"&&(ad||T!=="onCompositionStart"?T==="onCompositionEnd"&&ad&&(C=h6()):(tc=d,l2="value"in tc?tc.value:tc.textContent,ad=!0)),_=l0(u,T),0<_.length&&(T=new TA(T,t,null,n,d),h.push({event:T,listeners:_}),C?T.data=C:(C=m6(n),C!==null&&(T.data=C)))),(C=HY?qY(t,n):KY(t,n))&&(u=l0(u,"onBeforeInput"),0<u.length&&(d=new TA("onBeforeInput","beforeinput",null,n,d),h.push({event:d,listeners:u}),d.data=C))}E6(h,e)})}function dm(t,e,n){return{instance:t,listener:e,currentTarget:n}}function l0(t,e){for(var n=e+"Capture",r=[];t!==null;){var i=t,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=im(t,n),a!=null&&r.unshift(dm(t,a,i)),a=im(t,e),a!=null&&r.push(dm(t,a,i))),t=t.return}return r}function Du(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function $A(t,e,n,r,i){for(var a=e._reactName,s=[];n!==null&&n!==r;){var o=n,c=o.alternate,u=o.stateNode;if(c!==null&&c===r)break;o.tag===5&&u!==null&&(o=u,i?(c=im(n,a),c!=null&&s.unshift(dm(n,c,o))):i||(c=im(n,a),c!=null&&s.push(dm(n,c,o)))),n=n.return}s.length!==0&&t.push({event:e,listeners:s})}var oJ=/\r\n?/g,cJ=/\u0000|\uFFFD/g;function FA(t){return(typeof t=="string"?t:""+t).replace(oJ,` 38`).replace(cJ,"")}function Pv(t,e,n){if(e=FA(e),FA(t)!==e&&n)throw Error(we(425))}function u0(){}var m_=null,g_=null;function v_(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var y_=typeof setTimeout=="function"?setTimeout:void 0,lJ=typeof clearTimeout=="function"?clearTimeout:void 0,BA=typeof Promise=="function"?Promise:void 0,uJ=typeof queueMicrotask=="function"?queueMicrotask:typeof BA<"u"?function(t){return BA.resolve(null).then(t).catch(dJ)}:y_;function dJ(t){setTimeout(function(){throw t})}function X1(t,e){var n=e,r=0;do{var i=n.nextSibling;if(t.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){t.removeChild(i),om(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);om(e)}function hc(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function UA(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var lf=Math.random().toString(36).slice(2),ds="__reactFiber$"+lf,hm="__reactProps$"+lf,fo="__reactContainer$"+lf,b_="__reactEvents$"+lf,hJ="__reactListeners$"+lf,fJ="__reactHandles$"+lf;function Cl(t){var e=t[ds];if(e)return e;for(var n=t.parentNode;n;){if(e=n[fo]||n[ds]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=UA(t);t!==null;){if(n=t[ds])return n;t=UA(t)}return e}t=n,n=t.parentNode}return null}function $g(t){return t=t[ds]||t[fo],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function cd(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(we(33))}function wx(t){return t[hm]||null}var x_=[],ld=-1;function Lc(t){return{current:t}}function un(t){0>ld||(t.current=x_[ld],x_[ld]=null,ld--)}function en(t,e){ld++,x_[ld]=t.current,t.current=e}var jc={},Ar=Lc(jc),ii=Lc(!1),Kl=jc;function nh(t,e){var n=t.type.contextTypes;if(!n)return jc;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=e[a];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function ai(t){return t=t.childContextTypes,t!=null}function d0(){un(ii),un(Ar)}function zA(t,e,n){if(Ar.current!==jc)throw Error(we(168));en(Ar,e),en(ii,n)}function P6(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(we(108,XG(t)||"Unknown",i));return _n({},n,r)}function h0(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||jc,Kl=Ar.current,en(Ar,t),en(ii,ii.current),!0}function WA(t,e,n){var r=t.stateNode;if(!r)throw Error(we(169));n?(t=P6(t,e,Kl),r.__reactInternalMemoizedMergedChildContext=t,un(ii),un(Ar),en(Ar,t)):un(ii),en(ii,n)}var Gs=null,Sx=!1,Z1=!1;function N6(t){Gs===null?Gs=[t]:Gs.push(t)}function pJ(t){Sx=!0,N6(t)}function $c(){if(!Z1&&Gs!==null){Z1=!0;var t=0,e=Ut;try{var n=Gs;for(Ut=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}Gs=null,Sx=!1}catch(i){throw Gs!==null&&(Gs=Gs.slice(t+1)),t6(a2,$c),i}finally{Ut=e,Z1=!1}}return null}var ud=[],dd=0,f0=null,p0=0,qi=[],Ki=0,Gl=null,eo=1,to="";function al(t,e){ud[dd++]=p0,ud[dd++]=f0,f0=t,p0=e}function A6(t,e,n){qi[Ki++]=eo,qi[Ki++]=to,qi[Ki++]=Gl,Gl=t;var r=eo;t=to;var i=32-Ha(r)-1;r&=~(1<<i),n+=1;var a=32-Ha(e)+i;if(30<a){var s=i-i%5;a=(r&(1<<s)-1).toString(32),r>>=s,i-=s,eo=1<<32-Ha(e)+i|n<<i|r,to=a+t}else eo=1<<a|n<<i|r,to=t}function p2(t){t.return!==null&&(al(t,1),A6(t,1,0))}function m2(t){for(;t===f0;)f0=ud[--dd],ud[dd]=null,p0=ud[--dd],ud[dd]=null;for(;t===Gl;)Gl=qi[--Ki],qi[Ki]=null,to=qi[--Ki],qi[Ki]=null,eo=qi[--Ki],qi[Ki]=null}var Ei=null,Ci=null,pn=!1,Oa=null;function O6(t,e){var n=Ji(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function VA(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,Ei=t,Ci=hc(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,Ei=t,Ci=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=Gl!==null?{id:eo,overflow:to}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=Ji(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,Ei=t,Ci=null,!0):!1;default:return!1}}function w_(t){return(t.mode&1)!==0&&(t.flags&128)===0}function S_(t){if(pn){var e=Ci;if(e){var n=e;if(!VA(t,e)){if(w_(t))throw Error(we(418));e=hc(n.nextSibling);var r=Ei;e&&VA(t,e)?O6(r,n):(t.flags=t.flags&-4097|2,pn=!1,Ei=t)}}else{if(w_(t))throw Error(we(418));t.flags=t.flags&-4097|2,pn=!1,Ei=t}}}function HA(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Ei=t}function Nv(t){if(t!==Ei)return!1;if(!pn)return HA(t),pn=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!v_(t.type,t.memoizedProps)),e&&(e=Ci)){if(w_(t))throw R6(),Error(we(418));for(;e;)O6(t,e),e=hc(e.nextSibling)}if(HA(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(we(317));e:{for(t=t.nextSibling,e=0;t;
vendor: 25,615 bytes, lines 38-40
38){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){Ci=hc(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}Ci=null}}else Ci=Ei?hc(t.stateNode.nextSibling):null;return!0}function R6(){for(var t=Ci;t;)t=hc(t.nextSibling)}function rh(){Ci=Ei=null,pn=!1}function g2(t){Oa===null?Oa=[t]:Oa.push(t)}var mJ=ko.ReactCurrentBatchConfig;function Vf(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(we(309));var r=n.stateNode}if(!r)throw Error(we(147,t));var i=r,a=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===a?e.ref:(e=function(s){var o=i.refs;s===null?delete o[a]:o[a]=s},e._stringRef=a,e)}if(typeof t!="string")throw Error(we(284));if(!n._owner)throw Error(we(290,t))}return t}function Av(t,e){throw t=Object.prototype.toString.call(e),Error(we(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function qA(t){var e=t._init;return e(t._payload)}function D6(t){function e(x,w){if(t){var y=x.deletions;y===null?(x.deletions=[w],x.flags|=16):y.push(w)}}function n(x,w){if(!t)return null;for(;w!==null;)e(x,w),w=w.sibling;return null}function r(x,w){for(x=new Map;w!==null;)w.key!==null?x.set(w.key,w):x.set(w.index,w),w=w.sibling;return x}function i(x,w){return x=gc(x,w),x.index=0,x.sibling=null,x}function a(x,w,y){return x.index=y,t?(y=x.alternate,y!==null?(y=y.index,y<w?(x.flags|=2,w):y):(x.flags|=2,w)):(x.flags|=1048576,w)}function s(x){return t&&x.alternate===null&&(x.flags|=2),x}function o(x,w,y,k){return w===null||w.tag!==6?(w=aS(y,x.mode,k),w.return=x,w):(w=i(w,y),w.return=x,w)}function c(x,w,y,k){var S=y.type;return S===id?d(x,w,y.props.children,k,y.key):w!==null&&(w.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Fo&&qA(S)===w.type)?(k=i(w,y.props),k.ref=Vf(x,w,y),k.return=x,k):(k=Ry(y.type,y.key,y.props,null,x.mode,k),k.ref=Vf(x,w,y),k.return=x,k)}function u(x,w,y,k){return w===null||w.tag!==4||w.stateNode.containerInfo!==y.containerInfo||w.stateNode.implementation!==y.implementation?(w=sS(y,x.mode,k),w.return=x,w):(w=i(w,y.children||[]),w.return=x,w)}function d(x,w,y,k,S){return w===null||w.tag!==7?(w=Ul(y,x.mode,k,S),w.return=x,w):(w=i(w,y),w.return=x,w)}function h(x,w,y){if(typeof w=="string"&&w!==""||typeof w=="number")return w=aS(""+w,x.mode,y),w.return=x,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case xv:return y=Ry(w.type,w.key,w.props,null,x.mode,y),y.ref=Vf(x,null,w),y.return=x,y;case rd:return w=sS(w,x.mode,y),w.return=x,w;case Fo:var k=w._init;return h(x,k(w._payload),y)}if(vp(w)||Ff(w))return w=Ul(w,x.mode,y,null),w.return=x,w;Av(x,w)}return null}function f(x,w,y,k){var S=w!==null?w.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return S!==null?null:o(x,w,""+y,k);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case xv:return y.key===S?c(x,w,y,k):null;case rd:return y.key===S?u(x,w,y,k):null;case Fo:return S=y._init,f(x,w,S(y._payload),k)}if(vp(y)||Ff(y))return S!==null?null:d(x,w,y,k,null);Av(x,y)}return null}function p(x,w,y,k,S){if(typeof k=="string"&&k!==""||typeof k=="number")return x=x.get(y)||null,o(w,x,""+k,S);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case xv:return x=x.get(k.key===null?y:k.key)||null,c(w,x,k,S);case rd:return x=x.get(k.key===null?y:k.key)||null,u(w,x,k,S);case Fo:var _=k._init;return p(x,w,y,_(k._payload),S)}if(vp(k)||Ff(k))return x=x.get(y)||null,d(w,x,k,S,null);Av(w,k)}return null}function g(x,w,y,k){for(var S=null,_=null,C=w,T=w=0,E=null;C!==null&&T<y.length;T++){C.index>T?(E=C,C=null):E=C.sibling;var j=f(x,C,y[T],k);if(j===null){C===null&&(C=E);break}t&&C&&j.alternate===null&&e(x,C),w=a(j,w,T),_===null?S=j:_.sibling=j,_=j,C=E}if(T===y.length)return n(x,C),pn&&al(x,T),S;if(C===null){for(;T<y.length;T++)C=h(x,y[T],k),C!==null&&(w=a(C,w,T),_===null?S=C:_.sibling=C,_=C);return pn&&al(x,T),S}for(C=r(x,C);T<y.length;T++)E=p(C,x,T,y[T],k),E!==null&&(t&&E.alternate!==null&&C.delete(E.key===null?T:E.key),w=a(E,w,T),_===null?S=E:_.sibling=E,_=E);return t&&C.forEach(function(P){return e(x,P)}),pn&&al(x,T),S}function m(x,w,y,k){var S=Ff(y);if(typeof S!="function")throw Error(we(150));if(y=S.call(y),y==null)throw Error(we(151));for(var _=S=null,C=w,T=w=0,E=null,j=y.next();C!==null&&!j.done;T++,j=y.next()){C.index>T?(E=C,C=null):E=C.sibling;var P=f(x,C,j.value,k);if(P===null){C===null&&(C=E);break}t&&C&&P.alternate===null&&e(x,C),w=a(P,w,T),_===null?S=P:_.sibling=P,_=P,C=E}if(j.done)return n(x,C),pn&&al(x,T),S;if(C===null){for(;!j.done;T++,j=y.next())j=h(x,j.value,k),j!==null&&(w=a(j,w,T),_===null?S=j:_.sibling=j,_=j);return pn&&al(x,T),S}for(C=r(x,C);!j.done;T++,j=y.next())j=p(C,x,T,j.value,k),j!==null&&(t&&j.alternate!==null&&C.delete(j.key===null?T:j.key),w=a(j,w,T),_===null?S=j:_.sibling=j,_=j);return t&&C.forEach(function(M){return e(x,M)}),pn&&al(x,T),S}function v(x,w,y,k){if(typeof y=="object"&&y!==null&&y.type===id&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case xv:e:{for(var S=y.key,_=w;_!==null;){if(_.key===S){if(S=y.type,S===id){if(_.tag===7){n(x,_.sibling),w=i(_,y.props.children),w.return=x,x=w;break e}}else if(_.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Fo&&qA(S)===_.type){n(x,_.sibling),w=i(_,y.props),w.ref=Vf(x,_,y),w.return=x,x=w;break e}n(x,_);break}else e(x,_);_=_.sibling}y.type===id?(w=Ul(y.props.children,x.mode,k,y.key),w.return=x,x=w):(k=Ry(y.type,y.key,y.props,null,x.mode,k),k.ref=Vf(x,w,y),k.return=x,x=k)}return s(x);case rd:e:{for(_=y.key;w!==null;){if(w.key===_)if(w.tag===4&&w.stateNode.containerInfo===y.containerInfo&&w.stateNode.implementation===y.implementation){n(x,w.sibling),w=i(w,y.children||[]),w.return=x,x=w;break e}else{n(x,w);break}else e(x,w);w=w.sibling}w=sS(y,x.mode,k),w.return=x,x=w}return s(x);case Fo:return _=y._init,v(x,w,_(y._payload),k)}if(vp(y))return g(x,w,y,k);if(Ff(y))return m(x,w,y,k);Av(x,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,w!==null&&w.tag===6?(n(x,w.sibling),w=i(w,y),w.return=x,x=w):(n(x,w),w=aS(y,x.mode,k),w.return=x,x=w),s(x)):n(x,w)}return v}var ih=D6(!0),M6=D6(!1),m0=Lc(null),g0=null,hd=null,v2=null;function y2(){v2=hd=g0=null}function b2(t){var e=m0.current;un(m0),t._currentValue=e}function k_(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Ed(t,e){g0=t,v2=hd=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(ti=!0),t.firstContext=null)}function Qi(t){var e=t._currentValue;if(v2!==t)if(t={context:t,memoizedValue:e,next:null},hd===null){if(g0===null)throw Error(we(308));hd=t,g0.dependencies={lanes:0,firstContext:t}}else hd=hd.next=t;return e}var Tl=null;function x2(t){Tl===null?Tl=[t]:Tl.push(t)}function I6(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,x2(e)):(n.next=i.next,i.next=n),e.interleaved=n,po(t,r)}function po(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Bo=!1;function w2(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function L6(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function oo(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function fc(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,Et&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,po(t,n)}return i=r.interleaved,i===null?(e.next=e,x2(r)):(e.next=i.next,i.next=e),r.interleaved=e,po(t,n)}function Ey(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,s2(t,n)}}function KA(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=s:a=a.next=s,n=n.next}while(n!==null);a===null?i=a=e:a=a.next=e}else i=a=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function v0(t,e,n,r){var i=t.updateQueue;Bo=!1;var a=i.firstBaseUpdate,s=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var c=o,u=c.next;c.next=null,s===null?a=u:s.next=u,s=c;var d=t.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==s&&(o===null?d.firstBaseUpdate=u:o.next=u,d.lastBaseUpdate=c))}if(a!==null){var h=i.baseState;s=0,d=u=c=null,o=a;do{var f=o.lane,p=o.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:p,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var g=t,m=o;switch(f=e,p=n,m.tag){case 1:if(g=m.payload,typeof g=="function"){h=g.call(p,h,f);break e}h=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=m.payload,f=typeof g=="function"?g.call(p,h,f):g,f==null)break e;h=_n({},h,f);break e;case 2:Bo=!0}}o.callback!==null&&o.lane!==0&&(t.flags|=64,f=i.effects,f===null?i.effects=[o]:f.push(o))}else p={eventTime:p,lane:f,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(u=d=p,c=h):d=d.next=p,s|=f;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;f=o,o=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(d===null&&(c=h),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=d,e=i.shared.interleaved,e!==null){i=e;do s|=i.lane,i=i.next;while(i!==e)}else a===null&&(i.shared.lanes=0);Jl|=s,t.lanes=s,t.memoizedState=h}}function GA(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(we(191,i));i.call(r)}}}var Fg={},ms=Lc(Fg),fm=Lc(Fg),pm=Lc(Fg);function El(t){if(t===Fg)throw Error(we(174));return t}function S2(t,e){switch(en(pm,e),en(fm,t),en(ms,Fg),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:r_(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=r_(e,t)}un(ms),en(ms,e)}function ah(){un(ms),un(fm),un(pm)}function $6(t){El(pm.current);var e=El(ms.current),n=r_(e,t.type);e!==n&&(en(fm,t),en(ms,n))}function k2(t){fm.current===t&&(un(ms),un(fm))}var Sn=Lc(0);function y0(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Q1=[];function _2(){for(var t=0;t<Q1.length;t++)Q1[t]._workInProgressVersionPrimary=null;Q1.length=0}var jy=ko.ReactCurrentDispatcher,eS=ko.ReactCurrentBatchConfig,Yl=0,kn=null,Xn=null,sr=null,b0=!1,Rp=!1,mm=0,gJ=0;function xr(){throw Error(we(321))}function C2(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!Ya(t[n],e[n]))return!1;return!0}function T2(t,e,n,r,i,a){if(Yl=a,kn=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,jy.current=t===null||t.memoizedState===null?xJ:wJ,t=n(r,i),Rp){a=0;do{if(Rp=!1,mm=0,25<=a)throw Error(we(301));a+=1,sr=Xn=null,e.updateQueue=null,jy.current=SJ,t=n(r,i)}while(Rp)}if(jy.current=x0,e=Xn!==null&&Xn.next!==null,Yl=0,sr=Xn=kn=null,b0=!1,e)throw Error(we(300));return t}function E2(){var t=mm!==0;return mm=0,t}function ss(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return sr===null?kn.memoizedState=sr=t:sr=sr.next=t,sr}function ea(){if(Xn===null){var t=kn.alternate;t=t!==null?t.memoizedState:null}else t=Xn.next;var e=sr===null?kn.memoizedState:sr.next;if(e!==null)sr=e,Xn=t;else{if(t===null)throw Error(we(310));Xn=t,t={memoizedState:Xn.memoizedState,baseState:Xn.baseState,baseQueue:Xn.baseQueue,queue:Xn.queue,next:null},sr===null?kn.memoizedState=sr=t:sr=sr.next=t}return sr}function gm(t,e){return typeof e=="function"?e(t):e}function tS(t){var e=ea(),n=e.queue;if(n===null)throw Error(we(311));n.lastRenderedReducer=t;var r=Xn,i=r.baseQueue,a=n.pending;if(a!==null){if(i!==null){var s=i.next;i.next=a.next,a.next=s}r.baseQueue=i=a,n.pending=null}if(i!==null){a=i.next,r=r.baseState;var o=s=null,c=null,u=a;do{var d=u.lane;if((Yl&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:t(r,u.action);else{var h={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(o=c=h,s=r):c=c.next=h,kn.lanes|=d,Jl|=d}u=u.next}while(u!==null&&u!==a);c===null?s=r:c.next=o,Ya(r,e.memoizedState)||(ti=!0),e.memoizedState=r,e.baseState=s,e.baseQueue=c,n.lastRenderedState=r}if(t=n.interleaved,t!==null){i=t;do a=i.lane,kn.lanes|=a,Jl|=a,i=i.next;while(i!==t)}else i===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function nS(t){var e=ea(),n=e.queue;if(n===null)throw Error(we(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,a=e.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do a=t(a,s.action),s=s.next;while(s!==i);Ya(a,e.memoizedState)||(ti=!0),e.memoizedState=a,e.baseQueue===null&&(e.baseState=a),n.lastRenderedState=a}return[a,r]}function F6(){}function B6(t,e){var n=kn,r=ea(),i=e(),a=!Ya(r.memoizedState,i);if(a&&(r.memoizedState=i,ti=!0),r=r.queue,j2(W6.bind(null,n,r,t),[t]),r.getSnapshot!==e||a||sr!==null&&sr.memoizedState.tag&1){if(n.flags|=2048,vm(9,z6.bind(null,n,r,i,e),void 0,null),ur===null)throw Error(we(349));Yl&30||U6(n,e,i)}return i}function U6(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=kn.updateQueue,e===null?(e={lastEffect:null,stores:null},kn.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function z6(t,e,n,r){e.value=n,e.getSnapshot=r,V6(e)&&H6(t)}function W6(t,e,n){return n(function(){V6(e)&&H6(t)})}function V6(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Ya(t,n)}catch{return!0}}function H6(t){var e=po(t,1);e!==null&&qa(e,t,1,-1)}function YA(t){var e=ss();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:gm,lastRenderedState:t},e.queue=t,t=t.dispatch=bJ.bind(null,kn,t),[e.memoizedState,t]}function vm(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=kn.updateQueue,e===null?(e={lastEffect:null,stores:null},kn.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function q6(){return ea().memoizedState}function Py(t,e,n,r){var i=ss();kn.flags|=t,i.memoizedState=vm(1|e,n,void 0,r===void 0?null:r)}function kx(t,e,n,r){var i=ea();r=r===void 0?null:r;var a=void 0;if(Xn!==null){var s=Xn.memoizedState;if(a=s.destroy,r!==null&&C2(r,s.deps)){i.memoizedState=vm(e,n,a,r);return}}kn.flags|=t,i.memoizedState=vm(1|e,n,a,r)}function JA(t,e){return Py(8390656,8,t,e)}function j2(t,e){return kx(2048,8,t,e)}function K6(t,e){return kx(4,2,t,e)}function G6(t,e){return kx(4,4,t,e)}function Y6(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function J6(t,e,n){return n=n!=null?n.concat([t]):null,kx(4,4,Y6.bind(null,e,t),n)}function P2(){}function X6(t,e){var n=ea();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&C2(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function Z6(t,e){var n=ea();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&C2(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function Q6(t,e,n){return Yl&21?(Ya(n,e)||(n=i6(),kn.lanes|=n,Jl|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,ti=!0),t.memoizedState=n)}function vJ(t,e){var n=Ut;Ut=n!==0&&4>n?n:4,t(!0);var r=eS.transition;eS.transition={};try{t(!1),e()}finally{Ut=n,eS.transition=r}}function eL(){return ea().memoizedState}function yJ(t,e,n){var r=mc(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},tL(t))nL(e,n);else if(n=I6(t,e,n,r),n!==null){var i=Hr();qa(n,t,r,i),rL(n,e,r)}}function bJ(t,e,n){var r=mc(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(tL(t))nL(e,i);else{var a=t.alternate;if(t.lanes===0&&(a===null||a.lanes===0)&&(a=e.lastRenderedReducer,a!==null))try{var s=e.lastRenderedState,o=a(s,n);if(i.hasEagerState=!0,i.eagerState=o,Ya(o,s)){var c=e.interleaved;c===null?(i.next=i,x2(e)):(i.next=c.next,c.next=i),e.interleaved=i;return}}catch{}finally{}n=I6(t,e,i,r),n!==null&&(i=Hr(),qa(n,t,r,i),rL(n,e,r))}}function tL(t){var e=t.alternate;return t===kn||e!==null&&e===kn}function nL(t,e){Rp=b0=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function rL(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,s2(t,n)}}var x0={readContext:Qi,useCallback:xr,useContext:xr,useEffect:xr,useImperativeHandle:xr,useInsertionEffect:xr,useLayoutEffect:xr,useMemo:xr,useReducer:xr,useRef:xr,useState:xr,useDebugValue:xr,useDeferredValue:xr,useTransition:xr,useMutableSource:xr,useSyncExternalStore:xr,useId:xr,unstable_isNewReconciler:!1},xJ={readContext:Qi,useCallback:function(t,e){return ss().memoizedState=[t,e===void 0?null:e],t},useContext:Qi,useEffect:JA,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Py(4194308,4,Y6.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Py(4194308,4,t,e)},useInsertionEffect:function(t,e){return Py(4,2,t,e)},useMemo:function(t,e){var n=ss();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=ss();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=yJ.bind(null,kn,t),[r.memoizedState,t]},useRef:function(t){var e=ss();return t={current:t},e.memoizedState=t},useState:YA,useDebugValue:P2,useDeferredValue:function(t){return ss().memoizedState=t},useTransition:function(){var t=YA(!1),e=t[0];return t=vJ.bind(null,t[1]),ss().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=kn,i=ss();if(pn){if(n===void 0)throw Error(we(407));n=n()}else{if(n=e(),ur===null)throw Error(we(349));Yl&30||U6(r,e,n)}i.memoizedState=n;var a={value:n,getSnapshot:e};return i.queue=a,JA(W6.bind(null,r,a,t),[t]),r.flags|=2048,vm(9,z6.bind(null,r,a,n,e),void 0,null),n},useId:function(){var t=ss(),e=ur.identifierPrefix;if(pn){var n=to,r=eo;n=(r&~(1<<32-Ha(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=mm++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=gJ++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},wJ={readContext:Qi,useCallback:X6,useContext:Qi,useEffect:j2,useImperativeHandle:J6,useInsertionEffect:K6,useLayoutEffect:G6,useMemo:Z6,useReducer:tS,useRef:q6,useState:function(){return tS(gm)},useDebugValue:P2,useDeferredValue:function(t){var e=ea();return Q6(e,Xn.memoizedState,t)},useTransition:function(){var t=tS(gm)[0],e=ea().memoizedState;return[t,e]},useMutableSource:F6,useSyncExternalStore:B6,useId:eL,unstable_isNewReconciler:!1},SJ={readContext:Qi,useCallback:X6,useContext:Qi,useEffect:j2,useImperativeHandle:J6,useInsertionEffect:K6,useLayoutEffect:G6,useMemo:Z6,useReducer:nS,useRef:q6,useState:function(){return nS(gm)},useDebugValue:P2,useDeferredValue:function(t){var e=ea();return Xn===null?e.memoizedState=t:Q6(e,Xn.memoizedState,t)},useTransition:function(){var t=nS(gm)[0],e=ea().memoizedState;return[t,e]},useMutableSource:F6,useSyncExternalStore:B6,useId:eL,unstable_isNewReconciler:!1};function wa(t,e){if(t&&t.defaultProps){e=_n({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function __(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:_n({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var _x={isMounted:function(t){return(t=t._reactInternals)?bu(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=Hr(),i=mc(t),a=oo(r,i);a.payload=e,n!=null&&(a.callback=n),e=fc(t,a,i),e!==null&&(qa(e,t,i,r),Ey(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=Hr(),i=mc(t),a=oo(r,i);a.tag=1,a.payload=e,n!=null&&(a.callback=n),e=fc(t,a,i),e!==null&&(qa(e,t,i,r),Ey(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=Hr(),r=mc(t),i=oo(n,r);i.tag=2,e!=null&&(i.callback=e),e=fc(t,i,r),e!==null&&(qa(e,t,r,n),Ey(e,t,r))}};function XA(t,e,n,r,i,a,s){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,a,s):e.prototype&&e.prototype.isPureReactComponent?!lm(n,r)||!lm(i,a):!0}function iL(t,e,n){var r=!1,i=jc,a=e.contextType;return typeof a=="object"&&a!==null?a=Qi(a):(i=ai(e)?Kl:Ar.current,r=e.contextTypes,a=(r=r!=null)?nh(t,i):jc),e=new e(n,a),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=_x,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=a),e}function ZA(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&_x.enqueueReplaceState(e,e.state,null)}function C_(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs={},w2(t);var a=e.contextType;typeof a=="object"&&a!==null?i.context=Qi(a):(a=ai(e)?Kl:Ar.current,i.context=nh(t,a)),i.state=t.memoizedState,a=e.getDerivedStateFromProps,typeof a=="function"&&(__(t,e,a,n),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&_x.enqueueReplaceState(i,i.state,null),v0(t,n,i,r),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function sh(t,e){try{var n="",r=e;do n+=JG(r),r=r.return;while(r);var i=n}catch(a){i=` 39Error generating stack: `+a.message+` 40`+a.stack}return{value:t,source:e,stack:i,digest:null}}function rS(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function T_(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var kJ=typeof WeakMap=="function"?WeakMap:Map;function aL(t,e,n){n=oo(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){S0||(S0=!0,I_=r),T_(t,e)},n}function sL(t,e,n){n=oo(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return r(i)},n.callback=function(){T_(t,e)}}var a=t.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){T_(t,e),typeof r!="function"&&(pc===null?pc=new Set([this]):pc.add(this));var s=e.stack;this.componentDidCatch(e.value,{componentStack:s!==null?s:""})}),n}function QA(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new kJ;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(n)||(i.add(n),t=LJ.bind(null,t,e,n),e.then(t,t))}function eO(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function tO(t,e,n,r,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=oo(-1,1),e.tag=2,fc(n,e,1))),n.lanes|=1),t)}var _J=ko.ReactCurrentOwner,ti=!1;function Mr(t,e,n,r){e.child=t===null?M6(e,null,n,r):ih(e,t.child,n,r)}function nO(t,e,n,r,i){n=n.render;var a=e.ref;return Ed(e,i),r=T2(t,e,n,r,a,i),n=E2(),t!==null&&!ti?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,mo(t,e,i)):(pn&&n&&p2(e),e.flags|=1,Mr(t,e,r,i),e.child)}function rO(t,e,n,r,i){if(t===null){var a=n.type;return typeof a=="function"&&!L2(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=a,oL(t,e,a,r,i)):(t=Ry(n.type,null,r,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(a=t.child,!(t.lanes&i)){var s=a.memoizedProps;if(n=n.compare,n=n!==null?n:lm,n(s,r)&&t.ref===e.ref)return mo(t,e,i)}return e.flags|=1,t=gc(a,r),t.ref=e.ref,t.return=e,e.child=t}function oL(t,e,n,r,i){if(t!==null){var a=t.memoizedProps;if(lm(a,r)&&t.ref===e.ref)if(ti=!1,e.pendingProps=r=a,(t.lanes&i)!==0)t.flags&131072&&(ti=!0);else return e.lanes=t.lanes,mo(t,e,i)}return E_(t,e,n,r,i)}function cL(t,e,n){var r=e.pendingProps,i=r.children,a=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},en(pd,yi),yi|=n;else{if(!(n&1073741824))return t=a!==null?a.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,en(pd,yi),yi|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,en(pd,yi),yi|=r}else a!==null?(r=a.baseLanes|n,e.memoizedState=null):r=n,en(pd,yi),yi|=r;return Mr(t,e,i,n),e.child}function lL(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}
vendor: 5,244 bytes, line 40
40function E_(t,e,n,r,i){var a=ai(n)?Kl:Ar.current;return a=nh(e,a),Ed(e,i),n=T2(t,e,n,r,a,i),r=E2(),t!==null&&!ti?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,mo(t,e,i)):(pn&&r&&p2(e),e.flags|=1,Mr(t,e,n,i),e.child)}function iO(t,e,n,r,i){if(ai(n)){var a=!0;h0(e)}else a=!1;if(Ed(e,i),e.stateNode===null)Ny(t,e),iL(e,n,r),C_(e,n,r,i),r=!0;else if(t===null){var s=e.stateNode,o=e.memoizedProps;s.props=o;var c=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=Qi(u):(u=ai(n)?Kl:Ar.current,u=nh(e,u));var d=n.getDerivedStateFromProps,h=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function";h||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(o!==r||c!==u)&&ZA(e,s,r,u),Bo=!1;var f=e.memoizedState;s.state=f,v0(e,r,s,i),c=e.memoizedState,o!==r||f!==c||ii.current||Bo?(typeof d=="function"&&(__(e,n,d,r),c=e.memoizedState),(o=Bo||XA(e,n,o,r,f,c,u))?(h||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"&&(e.flags|=4194308)):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=c),s.props=r,s.state=c,s.context=u,r=o):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{s=e.stateNode,L6(t,e),o=e.memoizedProps,u=e.type===e.elementType?o:wa(e.type,o),s.props=u,h=e.pendingProps,f=s.context,c=n.contextType,typeof c=="object"&&c!==null?c=Qi(c):(c=ai(n)?Kl:Ar.current,c=nh(e,c));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(o!==h||f!==c)&&ZA(e,s,r,c),Bo=!1,f=e.memoizedState,s.state=f,v0(e,r,s,i);var g=e.memoizedState;o!==h||f!==g||ii.current||Bo?(typeof p=="function"&&(__(e,n,p,r),g=e.memoizedState),(u=Bo||XA(e,n,u,r,f,g,c)||!1)?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,g,c),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,g,c)),typeof s.componentDidUpdate=="function"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof s.componentDidUpdate!="function"||o===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=g),s.props=r,s.state=g,s.context=c,r=u):(typeof s.componentDidUpdate!="function"||o===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),r=!1)}return j_(t,e,n,r,a,i)}function j_(t,e,n,r,i,a){lL(t,e);var s=(e.flags&128)!==0;if(!r&&!s)return i&&WA(e,n,!1),mo(t,e,a);r=e.stateNode,_J.current=e;var o=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&s?(e.child=ih(e,t.child,null,a),e.child=ih(e,null,o,a)):Mr(t,e,o,a),e.memoizedState=r.state,i&&WA(e,n,!0),e.child}function uL(t){var e=t.stateNode;e.pendingContext?zA(t,e.pendingContext,e.pendingContext!==e.context):e.context&&zA(t,e.context,!1),S2(t,e.containerInfo)}function aO(t,e,n,r,i){return rh(),g2(i),e.flags|=256,Mr(t,e,n,r),e.child}var P_={dehydrated:null,treeContext:null,retryLane:0};function N_(t){return{baseLanes:t,cachePool:null,transitions:null}}function dL(t,e,n){var r=e.pendingProps,i=Sn.current,a=!1,s=(e.flags&128)!==0,o;if((o=s)||(o=t!==null&&t.memoizedState===null?!1:(i&2)!==0),o?(a=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),en(Sn,i&1),t===null)return S_(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(s=r.children,t=r.fallback,a?(r=e.mode,a=e.child,s={mode:"hidden",children:s},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=s):a=Ex(s,r,0,null),t=Ul(t,r,n,null),a.return=e,t.return=e,a.sibling=t,e.child=a,e.child.memoizedState=N_(n),e.memoizedState=P_,t):N2(e,s));if(i=t.memoizedState,i!==null&&(o=i.dehydrated,o!==null))return CJ(t,e,s,r,o,i,n);if(a){a=r.fallback,s=e.mode,i=t.child,o=i.sibling;var c={mode:"hidden",children:r.children};return!(s&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=c,e.deletions=null):(r=gc(i,c),r.subtreeFlags=i.subtreeFlags&14680064),o!==null?a=gc(o,a):(a=Ul(a,s,n,null),a.flags|=2),a.return=e,r.return=e,r.sibling=a,e.child=r,r=a,a=e.child,s=t.child.memoizedState,s=s===null?N_(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},a.memoizedState=s,a.childLanes=t.childLanes&~n,e.memoizedState=P_,r}return a=t.child,t=a.sibling,r=gc(a,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function N2(t,e){return e=Ex({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Ov(t,e,n,r){return r!==null&&g2(r),ih(e,t.child,null,n),t=N2(e,e.pen
vendor: 7,685 bytes, line 40
40dingProps.children),t.flags|=2,e.memoizedState=null,t}function CJ(t,e,n,r,i,a,s){if(n)return e.flags&256?(e.flags&=-257,r=rS(Error(we(422))),Ov(t,e,s,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(a=r.fallback,i=e.mode,r=Ex({mode:"visible",children:r.children},i,0,null),a=Ul(a,i,s,null),a.flags|=2,r.return=e,a.return=e,r.sibling=a,e.child=r,e.mode&1&&ih(e,t.child,null,s),e.child.memoizedState=N_(s),e.memoizedState=P_,a);if(!(e.mode&1))return Ov(t,e,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var o=r.dgst;return r=o,a=Error(we(419)),r=rS(a,r,void 0),Ov(t,e,s,r)}if(o=(s&t.childLanes)!==0,ti||o){if(r=ur,r!==null){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|s)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,po(t,i),qa(r,t,i,-1))}return I2(),r=rS(Error(we(421))),Ov(t,e,s,r)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=$J.bind(null,t),i._reactRetry=e,null):(t=a.treeContext,Ci=hc(i.nextSibling),Ei=e,pn=!0,Oa=null,t!==null&&(qi[Ki++]=eo,qi[Ki++]=to,qi[Ki++]=Gl,eo=t.id,to=t.overflow,Gl=e),e=N2(e,r.children),e.flags|=4096,e)}function sO(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),k_(t.return,e,n)}function iS(t,e,n,r,i){var a=t.memoizedState;a===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=e,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function hL(t,e,n){var r=e.pendingProps,i=r.revealOrder,a=r.tail;if(Mr(t,e,r.children,n),r=Sn.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&sO(t,n,e);else if(t.tag===19)sO(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(en(Sn,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&y0(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),iS(e,!1,i,n,a);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&y0(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}iS(e,!0,n,null,a);break;case"together":iS(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Ny(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function mo(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Jl|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(we(153));if(e.child!==null){for(t=e.child,n=gc(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=gc(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function TJ(t,e,n){switch(e.tag){case 3:uL(e),rh();break;case 5:$6(e);break;case 1:ai(e.type)&&h0(e);break;case 4:S2(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;en(m0,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(en(Sn,Sn.current&1),e.flags|=128,null):n&e.child.childLanes?dL(t,e,n):(en(Sn,Sn.current&1),t=mo(t,e,n),t!==null?t.sibling:null);en(Sn,Sn.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return hL(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),en(Sn,Sn.current),r)break;return null;case 22:case 23:return e.lanes=0,cL(t,e,n)}return mo(t,e,n)}var fL,A_,pL,mL;fL=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};A_=function(){};pL=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,El(ms.current);var a=null;switch(n){case"input":i=Qk(t,i),r=Qk(t,r),a=[];break;case"select":i=_n({},i,{value:void 0}),r=_n({},r,{value:void 0}),a=[];break;case"textarea":i=n_(t,i),r=n_(t,r),a=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=u0)}i_(n,r);var s;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var o=i[u];for(s in o)o.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(nm.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in r){var c=r[u];if(o=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&c!==o&&(c!=null||o!=null))if(u==="style")if(o){for(s in o)!o.hasOwnProperty(s)||c&&c.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in c)c.hasOwnProperty(s)&&o[s]!==c[s]&&(n||(n={}),n[s]=c[s])}else n||(a||(a=[]),a.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,o=o?o.__html:void 0,c!=null&&o!==c&&(a=a||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(a=a||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(nm.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&on("scroll",t),a||o===c||(a=[])):(a=a||[]).push(u,c))}n&&(a=a||[]).push("style",n);var u=a;(e.updateQueue=u)&&(e.flags|=4)}};mL=function(t,e,n,r){n!==r&&(e.flags|=4)};function Hf(t,e){if(!pn)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function wr(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function EJ(t,e,n){var r=e.pendingProps;switch(m2(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wr(e),null;case 1:return ai(e.type)&&d0(),wr(e),null;case 3:return r=e.stateNode,ah(),un(ii),un(Ar),_2(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(Nv(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Oa!==null&&(F_(Oa),Oa=null))),A_(t,e),wr(e),null;case 5:k2(e);var i=El(pm.current);if(n=e.type,t!==null&&e.stateNode!=null)pL(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(we(166));return wr(e),null}if(t=El(ms.current),Nv(e)){r=e.stateNode,n=e.type;var a=e.memoizedProps;switch(r[ds]=e,r[hm]=a,t=(e.mode&1)!==0,n){case"dialog":on("cancel",r),on("close",r);break;case"iframe":case"object":case"embed":on("load",r);break;case"video":case"audio":for(i=0;i<bp.length;i++)on(bp[i],r);break;case"source":on("error",r);break;case"img":case"image":case"link":on("error",r),on("load",r);break;case"details":on("toggle",r);break;case"input":mA(r,a),on("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},on("invalid",r);break;case"textarea":vA(r,a),on("invalid",r)}i_(n,a),i=null;for(var s in a)if(a.hasOwnProperty(s)){var o=a[s];
vendor: 30,215 bytes, line 40
40s==="children"?typeof o=="string"?r.textContent!==o&&(a.suppressHydrationWarning!==!0&&Pv(r.textContent,o,t),i=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(a.suppressHydrationWarning!==!0&&Pv(r.textContent,o,t),i=["children",""+o]):nm.hasOwnProperty(s)&&o!=null&&s==="onScroll"&&on("scroll",r)}switch(n){case"input":wv(r),gA(r,a,!0);break;case"textarea":wv(r),yA(r);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(r.onclick=u0)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{s=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=W8(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=s.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=s.createElement(n,{is:r.is}):(t=s.createElement(n),n==="select"&&(s=t,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):t=s.createElementNS(t,n),t[ds]=e,t[hm]=r,fL(t,e,!1,!1),e.stateNode=t;e:{switch(s=a_(n,r),n){case"dialog":on("cancel",t),on("close",t),i=r;break;case"iframe":case"object":case"embed":on("load",t),i=r;break;case"video":case"audio":for(i=0;i<bp.length;i++)on(bp[i],t);i=r;break;case"source":on("error",t),i=r;break;case"img":case"image":case"link":on("error",t),on("load",t),i=r;break;case"details":on("toggle",t),i=r;break;case"input":mA(t,r),i=Qk(t,r),on("invalid",t);break;case"option":i=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},i=_n({},r,{value:void 0}),on("invalid",t);break;case"textarea":vA(t,r),i=n_(t,r),on("invalid",t);break;default:i=r}i_(n,i),o=i;for(a in o)if(o.hasOwnProperty(a)){var c=o[a];a==="style"?q8(t,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&V8(t,c)):a==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&rm(t,c):typeof c=="number"&&rm(t,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(nm.hasOwnProperty(a)?c!=null&&a==="onScroll"&&on("scroll",t):c!=null&&e2(t,a,c,s))}switch(n){case"input":wv(t),gA(t,r,!1);break;case"textarea":wv(t),yA(t);break;case"option":r.value!=null&&t.setAttribute("value",""+Ec(r.value));break;case"select":t.multiple=!!r.multiple,a=r.value,a!=null?kd(t,!!r.multiple,a,!1):r.defaultValue!=null&&kd(t,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=u0)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return wr(e),null;case 6:if(t&&e.stateNode!=null)mL(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(we(166));if(n=El(pm.current),El(ms.current),Nv(e)){if(r=e.stateNode,n=e.memoizedProps,r[ds]=e,(a=r.nodeValue!==n)&&(t=Ei,t!==null))switch(t.tag){case 3:Pv(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Pv(r.nodeValue,n,(t.mode&1)!==0)}a&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[ds]=e,e.stateNode=r}return wr(e),null;case 13:if(un(Sn),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(pn&&Ci!==null&&e.mode&1&&!(e.flags&128))R6(),rh(),e.flags|=98560,a=!1;else if(a=Nv(e),r!==null&&r.dehydrated!==null){if(t===null){if(!a)throw Error(we(318));if(a=e.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(we(317));a[ds]=e}else rh(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;wr(e),a=!1}else Oa!==null&&(F_(Oa),Oa=null),a=!0;if(!a)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(t===null||Sn.current&1?tr===0&&(tr=3):I2())),e.updateQueue!==null&&(e.flags|=4),wr(e),null);case 4:return ah(),A_(t,e),t===null&&um(e.stateNode.containerInfo),wr(e),null;case 10:return b2(e.type._context),wr(e),null;case 17:return ai(e.type)&&d0(),wr(e),null;case 19:if(un(Sn),a=e.memoizedState,a===null)return wr(e),null;if(r=(e.flags&128)!==0,s=a.rendering,s===null)if(r)Hf(a,!1);else{if(tr!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(s=y0(t),s!==null){for(e.flags|=128,Hf(a,!1),r=s.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)a=n,t=r,a.flags&=14680066,s=a.alternate,s===null?(a.childLanes=0,a.lanes=t,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=s.childLanes,a.lanes=s.lanes,a.child=s.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=s.memoizedProps,a.memoizedState=s.memoizedState,a.updateQueue=s.updateQueue,a.type=s.type,t=s.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return en(Sn,Sn.current&1|2),e.child}t=t.sibling}a.tail!==null&&Mn()>oh&&(e.flags|=128,r=!0,Hf(a,!1),e.lanes=4194304)}else{if(!r)if(t=y0(s),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Hf(a,!0),a.tail===null&&a.tailMode==="hidden"&&!s.alternate&&!pn)return wr(e),null}else 2*Mn()-a.renderingStartTime>oh&&n!==1073741824&&(e.flags|=128,r=!0,Hf(a,!1),e.lanes=4194304);a.isBackwards?(s.sibling=e.child,e.child=s):(n=a.last,n!==null?n.sibling=s:e.child=s,a.last=s)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=Mn(),e.sibling=null,n=Sn.current,en(Sn,r?n&1|2:n&1),e):(wr(e),null);case 22:case 23:return M2(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?yi&1073741824&&(wr(e),e.subtreeFlags&6&&(e.flags|=8192)):wr(e),null;case 24:return null;case 25:return null}throw Error(we(156,e.tag))}function jJ(t,e){switch(m2(e),e.tag){case 1:return ai(e.type)&&d0(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return ah(),un(ii),un(Ar),_2(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return k2(e),null;case 13:if(un(Sn),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(we(340));rh()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return un(Sn),null;case 4:return ah(),null;case 10:return b2(e.type._context),null;case 22:case 23:return M2(),null;case 24:return null;default:return null}}var Rv=!1,Cr=!1,PJ=typeof WeakSet=="function"?WeakSet:Set,Le=null;function fd(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){En(t,e,r)}else n.current=null}function O_(t,e,n){try{n()}catch(r){En(t,e,r)}}var oO=!1;function NJ(t,e){if(m_=o0,t=x6(),f2(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var s=0,o=-1,c=-1,u=0,d=0,h=t,f=null;t:for(;;){for(var p;h!==n||i!==0&&h.nodeType!==3||(o=s+i),h!==a||r!==0&&h.nodeType!==3||(c=s+r),h.nodeType===3&&(s+=h.nodeValue.length),(p=h.firstChild)!==null;)f=h,h=p;for(;;){if(h===t)break t;if(f===n&&++u===i&&(o=s),f===a&&++d===r&&(c=s),(p=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=p}n=o===-1||c===-1?null:{start:o,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(g_={focusedElem:t,selectionRange:n},o0=!1,Le=e;Le!==null;)if(e=Le,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Le=t;else for(;Le!==null;){e=Le;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var m=g.memoizedProps,v=g.memoizedState,x=e.stateNode,w=x.getSnapshotBeforeUpdate(e.elementType===e.type?m:wa(e.type,m),v);x.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var y=e.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(we(163))}}catch(k){En(e,e.return,k)}if(t=e.sibling,t!==null){t.return=e.return,Le=t;break}Le=e.return}return g=oO,oO=!1,g}function Dp(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var a=i.destroy;i.destroy=void 0,a!==void 0&&O_(e,n,a)}i=i.next}while(i!==r)}}function Cx(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function R_(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function gL(t){var e=t.alternate;e!==null&&(t.alternate=null,gL(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[ds],delete e[hm],delete e[b_],delete e[hJ],delete e[fJ])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function vL(t){return t.tag===5||t.tag===3||t.tag===4}function cO(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||vL(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function D_(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=u0));else if(r!==4&&(t=t.child,t!==null))for(D_(t,e,n),t=t.sibling;t!==null;)D_(t,e,n),t=t.sibling}function M_(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(M_(t,e,n),t=t.sibling;t!==null;)M_(t,e,n),t=t.sibling}var pr=null,Ta=!1;function Po(t,e,n){for(n=n.child;n!==null;)yL(t,e,n),n=n.sibling}function yL(t,e,n){if(ps&&typeof ps.onCommitFiberUnmount=="function")try{ps.onCommitFiberUnmount(vx,n)}catch{}switch(n.tag){case 5:Cr||fd(n,e);case 6:var r=pr,i=Ta;pr=null,Po(t,e,n),pr=r,Ta=i,pr!==null&&(Ta?(t=pr,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):pr.removeChild(n.stateNode));break;case 18:pr!==null&&(Ta?(t=pr,n=n.stateNode,t.nodeType===8?X1(t.parentNode,n):t.nodeType===1&&X1(t,n),om(t)):X1(pr,n.stateNode));break;case 4:r=pr,i=Ta,pr=n.stateNode.containerInfo,Ta=!0,Po(t,e,n),pr=r,Ta=i;break;case 0:case 11:case 14:case 15:if(!Cr&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,s=a.destroy;a=a.tag,s!==void 0&&(a&2||a&4)&&O_(n,e,s),i=i.next}while(i!==r)}Po(t,e,n);break;case 1:if(!Cr&&(fd(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){En(n,e,o)}Po(t,e,n);break;case 21:Po(t,e,n);break;case 22:n.mode&1?(Cr=(r=Cr)||n.memoizedState!==null,Po(t,e,n),Cr=r):Po(t,e,n);break;default:Po(t,e,n)}}function lO(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new PJ),e.forEach(function(r){var i=FJ.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function pa(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var a=t,s=e,o=s;e:for(;o!==null;){switch(o.tag){case 5:pr=o.stateNode,Ta=!1;break e;case 3:pr=o.stateNode.containerInfo,Ta=!0;break e;case 4:pr=o.stateNode.containerInfo,Ta=!0;break e}o=o.return}if(pr===null)throw Error(we(160));yL(a,s,i),pr=null,Ta=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(u){En(i,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)bL(e,t),e=e.sibling}function bL(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(pa(e,t),rs(t),r&4){try{Dp(3,t,t.return),Cx(3,t)}catch(m){En(t,t.return,m)}try{Dp(5,t,t.return)}catch(m){En(t,t.return,m)}}break;case 1:pa(e,t),rs(t),r&512&&n!==null&&fd(n,n.return);break;case 5:if(pa(e,t),rs(t),r&512&&n!==null&&fd(n,n.return),t.flags&32){var i=t.stateNode;try{rm(i,"")}catch(m){En(t,t.return,m)}}if(r&4&&(i=t.stateNode,i!=null)){var a=t.memoizedProps,s=n!==null?n.memoizedProps:a,o=t.type,c=t.updateQueue;if(t.updateQueue=null,c!==null)try{o==="input"&&a.type==="radio"&&a.name!=null&&U8(i,a),a_(o,s);var u=a_(o,a);for(s=0;s<c.length;s+=2){var d=c[s],h=c[s+1];d==="style"?q8(i,h):d==="dangerouslySetInnerHTML"?V8(i,h):d==="children"?rm(i,h):e2(i,d,h,u)}switch(o){case"input":e_(i,a);break;case"textarea":z8(i,a);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var p=a.value;p!=null?kd(i,!!a.multiple,p,!1):f!==!!a.multiple&&(a.defaultValue!=null?kd(i,!!a.multiple,a.defaultValue,!0):kd(i,!!a.multiple,a.multiple?[]:"",!1))}i[hm]=a}catch(m){En(t,t.return,m)}}break;case 6:if(pa(e,t),rs(t),r&4){if(t.stateNode===null)throw Error(we(162));i=t.stateNode,a=t.memoizedProps;try{i.nodeValue=a}catch(m){En(t,t.return,m)}}break;case 3:if(pa(e,t),rs(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{om(e.containerInfo)}catch(m){En(t,t.return,m)}break;case 4:pa(e,t),rs(t);break;case 13:pa(e,t),rs(t),i=t.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(R2=Mn())),r&4&&lO(t);break;case 22:if(d=n!==null&&n.memoizedState!==null,t.mode&1?(Cr=(u=Cr)||d,pa(e,t),Cr=u):pa(e,t),rs(t),r&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!d&&t.mode&1)for(Le=t,d=t.child;d!==null;){for(h=Le=d;Le!==null;){switch(f=Le,p=f.child,f.tag){case 0:case 11:case 14:case 15:Dp(4,f,f.return);break;case 1:fd(f,f.return);var g=f.stateNode;if(typeof g.componentWillUnmount=="function"){r=f,n=f.return;try{e=r,g.props=e.memoizedProps,g.state=e.memoizedState,g.componentWillUnmount()}catch(m){En(r,n,m)}}break;case 5:fd(f,f.return);break;case 22:if(f.memoizedState!==null){dO(h);continue}}p!==null?(p.return=f,Le=p):dO(h)}d=d.sibling}e:for(d=null,h=t;;){if(h.tag===5){if(d===null){d=h;try{i=h.stateNode,u?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(o=h.stateNode,c=h.memoizedProps.style,s=c!=null&&c.hasOwnProperty("display")?c.display:null,o.style.display=H8("display",s))}catch(m){En(t,t.return,m)}}}else if(h.tag===6){if(d===null)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(m){En(t,t.return,m)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===t)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:pa(e,t),rs(t),r&4&&lO(t);break;case 21:break;default:pa(e,t),rs(t)}}function rs(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(vL(n)){var r=n;break e}n=n.return}throw Error(we(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(rm(i,""),r.flags&=-33);var a=cO(t);M_(t,a,i);break;case 3:case 4:var s=r.stateNode.containerInfo,o=cO(t);D_(t,o,s);break;default:throw Error(we(161))}}catch(c){En(t,t.return,c)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function AJ(t,e,n){Le=t,xL(t)}function xL(t,e,n){for(var r=(t.mode&1)!==0;Le!==null;){var i=Le,a=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||Rv;if(!s){var o=i.alternate,c=o!==null&&o.memoizedState!==null||Cr;o=Rv;var u=Cr;if(Rv=s,(Cr=c)&&!u)for(Le=i;Le!==null;)s=Le,c=s.child,s.tag===22&&s.memoizedState!==null?hO(i):c!==null?(c.return=s,Le=c):hO(i);for(;a!==null;)Le=a,xL(a),a=a.sibling;Le=i,Rv=o,Cr=u}uO(t)}else i.subtreeFlags&8772&&a!==null?(a.return=i,Le=a):uO(t)}}function uO(t){for(;Le!==null;){var e=Le;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Cr||Cx(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!Cr)if(n===null)r.componentDidMount();else{var i=e.elementType===e.type?n.memoizedProps:wa(e.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=e.updateQueue;a!==null&&GA(e,a,r);break;case 3:var s=e.updateQueue;if(s!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}GA(e,s,n)}break;case 5:var o=e.stateNode;if(n===null&&e.flags&4){n=o;var c=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var u=e.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var h=d.dehydrated;h!==null&&om(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(we(163))}Cr||e.flags&512&&R_(e)}catch(f){En(e,e.return,f)}}if(e===t){Le=null;break}if(n=e.sibling,n!==null){n.return=e.return,Le=n;break}Le=e.return}}function dO(t){for(;Le!==null;){var e=Le;if(e===t){Le=null;break}var n=e.sibling;if(n!==null){n.return=e.return,Le=n;break}Le=e.return}}function hO(t){for(;Le!==null;){var e=Le;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{Cx(4,e)}catch(c){En(e,n,c)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(c){En(e,i,c)}}var a=e.return;try{R_(e)}catch(c){En(e,a,c)}break;case 5:var s=e.return;try{R_(e)}catch(c){En(e,s,c)}}}catch(c){En(e,e.return,c)}if(e===t){Le=null;break}var o=e.sibling;if(o!==null){o.return=e.return,Le=o;break}Le=e.return}}var OJ=Math.ceil,w0=ko.ReactCurrentDispatcher,A2=ko.ReactCurrentOwner,Zi=ko.ReactCurrentBatchConfig,Et=0,ur=null,zn=null,mr=0,yi=0,pd=Lc(0),tr=0,ym=null,Jl=0,Tx=0,O2=0,Mp=null,Qr=null,R2=0,oh=1/0,Vs=null,S0=!1,I_=null,pc=null,Dv=!1,nc=null,k0=0,Ip=0,L_=null,Ay=-1,Oy=0;function Hr(){return Et&6?Mn():Ay!==-1?Ay:Ay=Mn()}function mc(t){return t.mode&1?Et&2&&mr!==0?mr&-mr:mJ.transition!==null?(Oy===0&&(Oy=i6()),Oy):(t=Ut,t!==0||(t=window.event,t=t===void 0?16:d6(t.type)),t):1}function qa(t,e,n,r){if(50<Ip)throw Ip=0,L_=null,Error(we(185));Ig(t,n,r),(!(Et&2)||t!==ur)&&(t===ur&&(!(Et&2)&&(Tx|=n),tr===4&&Vo(t,mr)),si(t,r),n===1&&Et===0&&!(e.mode&1)&&(oh=Mn()+500,Sx&&$c()))}function si(t,e){var n=t.callbackNode;mY(t,e);var r=s0(t,t===ur?mr:0);if(r===0)n!==null&&wA(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&wA(n),e===1)t.tag===0?pJ(fO.bind(null,t)):N6(fO.bind(null,t)),uJ(function(){!(Et&6)&&$c()}),n=null;else{switch(a6(r)){case 1:n=a2;break;case 4:n=n6;break;case 16:n=a0;break;case 536870912:n=r6;break;default:n=a0}n=jL(n,wL.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function wL(t,e){if(Ay=-1,Oy=0,Et&6)throw Error(we(327));var n=t.callbackNode;if(jd()&&t.callbackNode!==n)return null;var r=s0(t,t===ur?mr:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=_0(t,r);else{e=r;var i=Et;Et|=2;var a=kL();(ur!==t||mr!==e)&&(Vs=null,oh=Mn()+500,Bl(t,e));do try{MJ();break}catch(o){SL(t,o)}while(!0);y2(),w0.current=a,Et=i,zn!==null?e=0:(ur=null,mr=0,e=tr)}if(e!==0){if(e===2&&(i=u_(t),i!==0&&(r=i,e=$_(t,i))),e===1)throw n=ym,Bl(t,0),Vo(t,r),si(t,Mn()),n;if(e===6)Vo(t,r);else{if(i=t.current.alternate,!(r&30)&&!RJ(i)&&(e=_0(t,r),e===2&&(a=u_(t),a!==0&&(r=a,e=$_(t,a))),e===1))throw n=ym,Bl(t,0),Vo(t,r),si(t,Mn()),n;switch(t.finishedWork=i,t.finishedLanes=r,e){case 0:case 1:throw Error(we(345));case 2:sl(t,Qr,Vs);break;case 3:if(Vo(t,r),(r&130023424)===r&&(e=R2+500-Mn(),10<e)){if(s0(t,0)!==0)break;if(i=t.suspendedLanes,(i&r)!==r){Hr(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=y_(sl.bind(null,t,Qr,Vs),e);break}sl(t,Qr,Vs);break;case 4:if(Vo(t,r),(r&4194240)===r)break;for(e=t.eventTimes,i=-1;0<r;){var s=31-Ha(r);a=1<<s,s=e[s],s>i&&(i=s),r&=~a}if(r=i,r=Mn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*OJ(r/1960))-r,10<r){t.timeoutHandle=y_(sl.bind(null,t,Qr,Vs),r);break}sl(t,Qr,Vs);break;case 5:sl(t,Qr,Vs);break;default:throw Error(we(329))}}}return si(t,Mn()),t.callbackNode===n?wL.bind(null,t):null}function $_(t,e){var n=Mp;return t.current.memoizedState.isDehydrated&&(Bl(t,e).flags|=256),t=_0(t,e),t!==2&&(e=Qr,Qr=n,e!==null&&F_(e)),t}function F_(t){Qr===null?Qr=t:Qr.push.apply(Qr,t)}function RJ(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Ya(a(),i))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Vo(t,e){for(e&=~O2,e&=~Tx,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-Ha(e),r=1<<n;t[n]=-1,e&=~r}}function fO(t){if(Et&6)throw Error(we(327));jd();var e=s0(t,0);if(!(e&1))return si(t,Mn()),null;var n=_0(t,e);if(t.tag!==0&&n===2){var r=u_(t);r!==0&&(e=r,n=$_(t,r))}if(n===1)throw n=ym,Bl(t,0),Vo(t,e),si(t,Mn()),n;if(n===6)throw Error(we(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,sl(t,Qr,Vs),si(t,Mn()),null}function D2(t,e){var n=Et;Et|=1;try{return t(e)}finally{Et=n,Et===0&&(oh=Mn()+500,Sx&&$c())}}function Xl(t){nc!==null&&nc.tag===0&&!(Et&6)&&jd();var e=Et;Et|=1;var n=Zi.transition,r=Ut;try{if(Zi.transition=null,Ut=1,t)return t()}finally{Ut=r,Zi.transition=n,Et=e,!(Et&6)&&$c()}}function M2(){yi=pd.current,un(pd)}function Bl(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,lJ(n)),zn!==null)for(n=zn.return;n!==null;){var r=n;switch(m2(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&d0();break;case 3:ah(),un(ii),un(Ar),_2();break;case 5:k2(r);break;case 4:ah();break;case 13:un(Sn);break;case 19:un(Sn);break;case 10:b2(r.type._context);break;case 22:case 23:M2()}n=n.return}if(ur=t,zn=t=gc(t.current,null),mr=yi=e,tr=0,ym=null,O2=Tx=Jl=0,Qr=Mp=null,Tl!==null){for(e=0;e<Tl.length;e++)if(n=Tl[e],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var s=a.next;a.next=i,r.next=s}n.pending=r}Tl=null}return t}function SL(t,e){do{var n=zn;try{if(y2(),jy.current=x0,b0){for(var r=kn.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}b0=!1}if(Yl=0,sr=Xn=kn=null,Rp=!1,mm=0,A2.current=null,n===null||n.return===null){tr=1,ym=e,zn=null;break}e:{var a=t,s=n.return,o=n,c=e;if(e=mr,o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=o,h=d.tag;if(!(d.mode&1)&&(h===0||h===11||h===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=eO(s);if(p!==null){p.flags&=-257,tO(p,s,o,a,e),p.mode&1&&QA(a,u,e),e=p,c=u;var g=e.updateQueue;if(g===null){var m=new Set;m.add(c),e.updateQueue=m}else g.add(c);break e}else{if(!(e&1)){QA(a,u,e),I2();break e}c=Error(we(426))}}else if(pn&&o.mode&1){var v=eO(s);if(v!==null){!(v.flags&65536)&&(v.flags|=256),tO(v,s,o,a,e),g2(sh(c,o));break e}}a=c=sh(c,o),tr!==4&&(tr=2),Mp===null?Mp=[a]:Mp.push(a),a=s;do{switch(a.tag){case 3:a.flags|=65536,e&=-e,a.lanes|=e;var x=aL(a,c,e);KA(a,x);break e;case 1:o=c;var w=a.type,y=a.stateNode;if(!(a.flags&128)&&(typeof w.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(pc===null||!pc.has(y)))){a.flags|=65536,e&=-e,a.lanes|=e;var k=sL(a,o,e);KA(a,k);break e}}a=a.return}while(a!==null)}CL(n)}catch(S){e=S,zn===n&&n!==null&&(zn=n=n.return);continue}break}while(!0)}function kL(){var t=w0.current;return w0.current=x0,t===null?x0:t}function I2(){(tr===0||tr===3||tr===2)&&(tr=4),ur===null||!(Jl&268435455)&&!(Tx&268435455)||Vo(ur,mr)}function _0(t,e){var n=Et;Et|=2;var r=kL();(ur!==t||mr!==e)&&(Vs=null,Bl(t,e));do try{DJ();break}catch(i){SL(t,i)}while(!0);if(y2(),Et=n,w0.current=r,zn!==null)throw Error(we(261));return ur=null,mr=0,tr}function DJ(){for(;zn!==null;)_L(zn)}function MJ(){for(;zn!==null&&!sY();)_L(zn)}function _L(t){var e=EL(t.alternate,t,yi);t.memoizedProps=t.pendingProps,e===null?CL(t):zn=e,A2.current=null}function CL(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=jJ(n,e),n!==null){n.flags&=32767,zn=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{tr=6,zn=null;return}}else if(n=EJ(n,e,yi),n!==null){zn=n;return}if(e=e.sibling,e!==null){zn=e;return}zn=e=t}while(e!==null);tr===0&&(tr=5)}function sl(t,e,n){var r=Ut,i=Zi.transition;try{Zi.transition=null,Ut=1,IJ(t,e,n,r)}finally{Zi.transition=i,Ut=r}return null}function IJ(t,e,n,r){do jd();while(nc!==null);if(Et&6)throw Error(we(327));n=t.finishedWork;var i=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(we(177));t.callbackNode=null,t.callbackPriority=0;var a=n.lanes|n.childLanes;if(gY(t,a),t===ur&&(zn=ur=null,mr=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Dv||(Dv=!0,jL(a0,function(){return jd(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=Zi.transition,Zi.transition=null;var s=Ut;Ut=1;var o=Et;Et|=4,A2.current=null,NJ(t,n),bL(n,t),nJ(g_),o0=!!m_,g_=m_=null,t.current=n,AJ(n),oY(),Et=o,Ut=s,Zi.transition=a}else t.current=n;if(Dv&&(Dv=!1,nc=t,k0=i),a=t.pendingLanes,a===0&&(pc=null),uY(n.stateNode),si(t,Mn()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)i=e[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(S0)throw S0=!1,t=I_,I_=null,t;return k0&1&&t.tag!==0&&jd(),a=t.pendingLanes,a&1?t===L_?Ip++:(Ip=0,L_=t):Ip=0,$c(),null}function jd(){if(nc!==null){var t=a6(k0),e=Zi.transition,n=Ut;try{if(Zi.transition=null,Ut=16>t?16:t,nc===null)var r=!1;else{if(t=nc,nc=null,k0=0,Et&6)throw Error(we(331));var i=Et;for(Et|=4,Le=t.current;Le!==null;){var a=Le,s=a.child;if(Le.flags&16){var o=a.deletions;if(o!==null){for(var c=0;c<o.length;c++){var u=o[c];for(Le=u;Le!==null;){var d=Le;switch(d.tag){case 0:case 11:case 15:Dp(8,d,a)}var h=d.child;if(h!==null)h.return=d,Le=h;else for(;Le!==null;){d=Le;var f=d.sibling,p=d.return;if(gL(d),d===u){Le=null;break}if(f!==null){f.return=p,Le=f;break}Le=p}}}var g=a.alternate;if(g!==null){var m=g.child;if(m!==null){g.child=null;do{var v=m.sibling;m.sibling=null,m=v}while(m!==null)}}Le=a}}if(a.subtreeFlags&2064&&s!==null)s.return=a,Le=s;else e:for(;Le!==null;){if(a=Le,a.flags&2048)switch(a.tag){case 0:case 11:case 15:Dp(9,a,a.return)}var x=a.sibling;if(x!==null){x.return=a.return,Le=x;break e}Le=a.return}}var w=t.current;for(Le=w;Le!==null;){s=Le;var y=s.child;if(s.subtreeFlags&2064&&y!==null)y.return=s,Le=y;else e:for(s=w;Le!==null;){if(o=Le,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:Cx(9,o)}}catch(S){En(o,o.return,S)}if(o===s){Le=null;break e}var k=o.sibling;if(k!==null){k.return=o.return,Le=k;break e}Le=o.return}}if(Et=i,$c(),ps&&typeof ps.onPostCommitFiberRoot=="function")try{ps.onPostCommitFiberRoot(vx,t)}catch{}r=!0}return r}finally{Ut=n,Zi.transition=e}}return!1}function pO(t,e,n){e=sh(n,e),e=aL(t,e,1),t=fc(t,e,1),e=Hr(),t!==null&&(Ig(t,1,e),si(t,e))}function En(t,e,n){if(t.tag===3)pO(t,t,n);else for(;e!==null;){if(e.tag===3){pO(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(pc===null||!pc.has(r))){t=sh(n,t),t=sL(e,t,1),e=fc(e,t,1),t=Hr(),e!==null&&(Ig(e,1,t),si(e,t));break}}e=e.return}}function LJ(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=Hr(),t.pingedLanes|=t.suspendedLanes&n,ur===t&&(mr&n)===n&&(tr===4||tr===3&&(mr&130023424)===mr&&500>Mn()-R2?Bl(t,0):O2|=n),si(t,e)}function TL(t,e){e===0&&(t.mode&1?(e=_v,_v<<=1,!(_v&130023424)&&(_v=4194304)):e=1);var n=Hr();t=po(t,e),t!==null&&(Ig(t,e,n),si(t,n))}function $J(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),TL(t,n)}function FJ(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(we(314))}r!==null&&r.delete(e),TL(t,n)}var EL;EL=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||ii.current)ti=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return ti=!1,TJ(t,e,n);ti=!!(t.flags&131072)}else ti=!1,pn&&e.flags&1048576&&A6(e,p0,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Ny(t,e),t=e.pendingProps;var i=nh(e,Ar.current);Ed(e,n),i=T2(null,e,r,t,i,n);var a=E2();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,ai(r)?(a=!0,h0(e)):a=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,w2(e),i.updater=_x,e.stateNode=i,i._reactInternals=e,C_(e,r,t,n),e=j_(null,e,r,!0,a,n)):(e.tag=0,pn&&a&&p2(e),Mr(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Ny(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=UJ(r),t=wa(r,t),i){case 0:e=E_(null,e,r,t,n);break e;case 1:e=iO(null,e,r,t,n);break e;case 11:e=nO(null,e,r,t,n);break e;case 14:e=rO(null,e,r,wa(r.type,t),n);break e}throw Error(we(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:wa(r,i),E_(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:wa(r,i),iO(t,e,r,i,n);case 3:e:{if(uL(e),t===null)throw Error(we(387));r=e.pendingProps,a=e.memoizedState,i=a.element,L6(t,e),v0(e,r,null,n);var s=e.memoizedState;if(r=s.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=a,e.memoizedState=a,e.flags&256){i=sh(Error(we(423)),e),e=aO(t,e,r,n,i);break e}else if(r!==i){i=sh(Error(we(424)),e),e=aO(t,e,r,n,i);break e}else for(Ci=hc(e.stateNode.containerInfo.firstChild),Ei=e,pn=!0,Oa=null,n=M6(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(rh(),r===i){e=mo(t,e,n);break e}Mr(t,e,r,n)}e=e.child}return e;case 5:return $6(e),t===null&&S_(e),r=e.type,i=e.pendingProps,a=t!==null?t.memoizedProps:null,s=i.children,v_(r,i)?s=null:a!==null&&v_(r,a)&&(e.flags|=32),lL(t,e),Mr(t,e,s,n),e.child;case 6:return t===null&&S_(e),null;case 13:return dL(t,e,n);case 4:return S2(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=ih(e,null,r,n):Mr(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:wa(r,i),nO(t,e,r,i,n);case 7:return Mr(t,e,e.pendingProps,n),e.child;case 8:return Mr(t,e,e.pendingProps.children,n),e.child;case 12:return Mr(t,e,e.pendingProps.children,n),e.child;
vendor: 9,147 bytes, line 40
40case 10:e:{if(r=e.type._context,i=e.pendingProps,a=e.memoizedProps,s=i.value,en(m0,r._currentValue),r._currentValue=s,a!==null)if(Ya(a.value,s)){if(a.children===i.children&&!ii.current){e=mo(t,e,n);break e}}else for(a=e.child,a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){s=a.child;for(var c=o.firstContext;c!==null;){if(c.context===r){if(a.tag===1){c=oo(-1,n&-n),c.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),k_(a.return,n,e),o.lanes|=n;break}c=c.next}}else if(a.tag===10)s=a.type===e.type?null:a.child;else if(a.tag===18){if(s=a.return,s===null)throw Error(we(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),k_(s,n,e),s=a.sibling}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}Mr(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Ed(e,n),i=Qi(i),r=r(i),e.flags|=1,Mr(t,e,r,n),e.child;case 14:return r=e.type,i=wa(r,e.pendingProps),i=wa(r.type,i),rO(t,e,r,i,n);case 15:return oL(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:wa(r,i),Ny(t,e),e.tag=1,ai(r)?(t=!0,h0(e)):t=!1,Ed(e,n),iL(e,r,i),C_(e,r,i,n),j_(null,e,r,!0,t,n);case 19:return hL(t,e,n);case 22:return cL(t,e,n)}throw Error(we(156,e.tag))};function jL(t,e){return t6(t,e)}function BJ(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ji(t,e,n,r){return new BJ(t,e,n,r)}function L2(t){return t=t.prototype,!(!t||!t.isReactComponent)}function UJ(t){if(typeof t=="function")return L2(t)?1:0;if(t!=null){if(t=t.$$typeof,t===n2)return 11;if(t===r2)return 14}return 2}function gc(t,e){var n=t.alternate;return n===null?(n=Ji(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Ry(t,e,n,r,i,a){var s=2;if(r=t,typeof t=="function")L2(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case id:return Ul(n.children,i,a,e);case t2:s=8,i|=8;break;case Yk:return t=Ji(12,n,e,i|2),t.elementType=Yk,t.lanes=a,t;case Jk:return t=Ji(13,n,e,i),t.elementType=Jk,t.lanes=a,t;case Xk:return t=Ji(19,n,e,i),t.elementType=Xk,t.lanes=a,t;case $8:return Ex(n,i,a,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case I8:s=10;break e;case L8:s=9;break e;case n2:s=11;break e;case r2:s=14;break e;case Fo:s=16,r=null;break e}throw Error(we(130,t==null?t:typeof t,""))}return e=Ji(s,n,e,i),e.elementType=t,e.type=r,e.lanes=a,e}function Ul(t,e,n,r){return t=Ji(7,t,r,e),t.lanes=n,t}function Ex(t,e,n,r){return t=Ji(22,t,r,e),t.elementType=$8,t.lanes=n,t.stateNode={isHidden:!1},t}function aS(t,e,n){return t=Ji(6,t,null,e),t.lanes=n,t}function sS(t,e,n){return e=Ji(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function zJ(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=B1(0),this.expirationTimes=B1(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=B1(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function $2(t,e,n,r,i,a,s,o,c){return t=new zJ(t,e,n,o,c),e===1?(e=1,a===!0&&(e|=8)):e=0,a=Ji(3,null,null,e),t.current=a,a.stateNode=t,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},w2(a),t}function WJ(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:rd,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function PL(t){if(!t)return jc;t=t._reactInternals;e:{if(bu(t)!==t||t.tag!==1)throw Error(we(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(ai(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(we(171))}if(t.tag===1){var n=t.type;if(ai(n))return P6(t,n,e)}return e}function NL(t,e,n,r,i,a,s,o,c){return t=$2(n,r,!0,t,i,a,s,o,c),t.context=PL(null),n=t.current,r=Hr(),i=mc(n),a=oo(r,i),a.callback=e??null,fc(n,a,i),t.current.lanes=i,Ig(t,i,r),si(t,r),t}function jx(t,e,n,r){var i=e.current,a=Hr(),s=mc(i);return n=PL(n),e.context===null?e.context=n:e.pendingContext=n,e=oo(a,s),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=fc(i,e,s),t!==null&&(qa(t,i,s,a),Ey(t,i,s)),s}function C0(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function mO(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function F2(t,e){mO(t,e),(t=t.alternate)&&mO(t,e)}function VJ(){return null}var AL=typeof reportError=="function"?reportError:function(t){console.error(t)};function B2(t){this._internalRoot=t}Px.prototype.render=B2.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(we(409));jx(t,e,null,null)};Px.prototype.unmount=B2.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Xl(function(){jx(null,t,null,null)}),e[fo]=null}};function Px(t){this._internalRoot=t}Px.prototype.unstable_scheduleHydration=function(t){if(t){var e=c6();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Wo.length&&e!==0&&e<Wo[n].priority;n++);Wo.splice(n,0,t),n===0&&u6(t)}};function U2(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Nx(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function gO(){}function HJ(t,e,n,r,i){if(i){if(typeof r=="function"){var a=r;r=function(){var u=C0(s);a.call(u)}}var s=NL(e,r,t,0,null,!1,!1,"",gO);return t._reactRootContainer=s,t[fo]=s.current,um(t.nodeType===8?t.parentNode:t),Xl(),s}for(;i=t.lastChild;)t.removeChild(i);if(typeof r=="function"){var o=r;r=function(){var u=C0(c);o.call(u)}}var c=$2(t,0,!1,null,null,!1,!1,"",gO);return t._reactRootContainer=c,t[fo]=c.current,um(t.nodeType===8?t.parentNode:t),Xl(function(){jx(e,c,n,r)}),c}function Ax(t,e,n,r,i){var a=n._reactRootContainer;if(a){var s=a;if(typeof i=="function"){var o=i;i=function(){var c=C0(s);o.call(c)}}jx(e,s,t,i)}else s=HJ(n,e,t,i,r);return C0(s)}s6=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=yp(e.pendingLanes);n!==0&&(s2(e,n|1),si(e,Mn()),!(Et&6)&&(oh=Mn()+500,$c()))}break;case 13:Xl(function(){var r=po(t,1);if(r!==null){var i=Hr();qa(r,t,1,i)}}),F2(t,1)}};o2=function(t){if(t.tag===13){var e=po(t,134217728);if(e!==null){var n=Hr();qa(e,t,134217728,n)}F2(t,134217728)}};o6=function(t){if(t.tag===13){var e=mc(t),n=po(t,e);if(n!==null){var r=Hr();qa(n,t,e,r)}F2(t,e)}};c6=function(){return Ut};l6=function(t,e){var n=Ut;try{return Ut=t,e()}finally{Ut=n}};o_=function(t,e,n){switch(e){case"input":if(e_(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var i=wx(r);if(!i)throw Error(we(90));B8(r),e_(r,i)}}}break;case"textarea":z8(t,n);break;case"select":e=n.value,e!=null&&kd(t,!!n.multiple,e,!1)}};Y8=D2;J8=Xl;var qJ={usingClientEntryPoint:!1,Events:[$g,cd,wx,K8,G8,D2]},qf={findFiberByHostInstance:Cl,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},KJ={bundleType:qf.bundleType,version:qf.version,rendererPackageName:qf.rendererPackageName,rendererConfig:qf.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ko.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Q8(t),t===null?null:t.stateNode},findFiberByHostInstance:qf.findFiberByHostInstance||VJ,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};
40if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Mv=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Mv.isDisabled&&Mv.supportsFiber)try{vx=Mv.inject(KJ),ps=Mv}catch{}}Di.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=qJ;Di.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!U2(e))throw Error(we(200));return WJ(t,e,null,n)};Di.createRoot=function(t,e){if(!U2(t))throw Error(we(299));var n=!1,r="",i=AL;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=$2(t,1,!1,null,null,n,!1,r,i),t[fo]=e.current,um(t.nodeType===8?t.parentNode:t),new B2(e)};Di.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(we(188)):(t=Object.keys(t).join(","),Error(we(268,t)));return t=Q8(e),t=t===null?null:t.stateNode,t};Di.flushSync=function(t){return Xl(t)};Di.hydrate=function(t,e,n){if(!Nx(e))throw Error(we(200));return Ax(null,t,e,!0,n)};Di.hydrateRoot=function(t,e,n){if(!U2(t))throw Error(we(405));var r=n!=null&&n.hydratedSources||null,i=!1,a="",s=AL;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),e=NL(e,null,t,1,n??null,i,!1,a,s),t[fo]=e.current,um(t),r)for(t=0;t<r.length;t++)n=r[t],i=n._getVersion,i=i(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,i]:e.mutableSourceEagerHydrationData.push(n,i);return new Px(e)};Di.render=function(t,e,n){if(!Nx(e))throw Error(we(200));return Ax(null,t,e,!1,n)};Di.unmountComponentAtNode=function(t){if(!Nx(t))throw Error(we(40));return t._reactRootContainer?(Xl(function(){Ax(null,null,t,!1,function(){t._reactRootContainer=null,t[fo]=null})}),!0):!1};Di.unstable_batchedUpdates=D2;Di.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!Nx(n))throw Error(we(200));if(t==null||t._reactInternals===void 0)throw Error(we(38));return Ax(t,e,n,!1,r)};Di.version="18.3.1-next-f1338f8080-20240426";function OL(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(OL)}catch(t){console.error(t)}}OL(),O8.exports=Di;var Fc=O8.exports;const RL=Lt(Fc);var DL,vO=Fc;DL=vO.createRoot,vO.hydrateRoot;const GJ=1,YJ=1e6;let oS=0;function JJ(){return oS=(oS+1)%Number.MAX_SAFE_INTEGER,oS.toString()}const cS=new Map,yO=t=>{if(cS.has(t))return;const e=setTimeout(()=>{cS.delete(t),Lp({type:"REMOVE_TOAST",toastId:t})},YJ);cS.set(t,e)},XJ=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,GJ)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?yO(n):t.toasts.forEach(r=>{yO(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},Dy=[];let My={toasts:[]};function Lp(t){My=XJ(My,t),Dy.forEach(e=>{e(My)})}function Ea({...t}){const e=JJ(),n=i=>Lp({type:"UPDATE_TOAST",toast:{...i,id:e}}),r=()=>Lp({type:"DISMISS_TOAST",toastId:e});return Lp({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:i=>{i||r()}}}),{id:e,dismiss:r,update:n}}function ML(){const[t,e]=b.useState(My);return b.useEffect(()=>(Dy.push(e),()=>{const n=Dy.indexOf(e);n>-1&&Dy.splice(n,1)}),[t]),{...t,toast:Ea,dismiss:n=>Lp({type:"DISMISS_TOAST",toastId:n})}}function Ie(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function bO(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function IL(...t){return e=>{let n=!1;const r=t.map(i=>{const a=bO(i,e);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<r.length;i++){const a=r[i];typeof a=="function"?a():bO(t[i],null)}}}}function bt(...t){return b.useCallback(IL(...t),t)}function ZJ(t,e){const n=b.createContext(e),r=a=>{const{children:s,...o}=a,c=b.useMemo(()=>o,Object.values(o));return l.jsx(n.Provider,{value:c,children:s})};r.displayName=t+"Provider";function i(a){const s=b.useContext(n);if(s)return s;if(e!==void 0)return e;throw new Error(`\`${a}\` must be used within \`${t}\``)}return[r,i]}function Yr(t,e=[]){let n=[];function r(a,s){const o=b.createContext(s),c=n.length;n=[...n,s];const u=h=>{var x;const{scope:f,children:p,...g}=h,m=((x=f==null?void 0:f[t])==null?void 0:x[c])||o,v=b.useMemo(()=>g,Object.values(g));return l.jsx(m.Provider,{value:v,children:p})};u.displayName=a+"Provider";function d(h,f){var m;const p=((m=f==null?void 0:f[t])==null?void 0:m[c])||o,g=b.useContext(p);if(g)return g;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${a}\``)}return[u,d]}const i=()=>{const a=n.map(s=>b.createContext(s));return function(o){const c=(o==null?void 0:o[t])||a;return b.useMemo(()=>({[`__scope${t}`]:{...o,[t]:c}}),[o,c])}};return i.scopeName=t,[r,QJ(i,...e)]}function QJ(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const s=r.reduce((o,{useScope:c,scopeName:u})=>{const h=c(a)[`__scope${u}`];return{...o,...h}},{});return b.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])}};return n.scopeName=e.scopeName,n}function Zl(t){const e=tX(t),n=b.forwardRef((r,i)=>{const{children:a,...s}=r,o=b.Children.toArray(a),c=o.find(nX);if(c){const u=c.props.children,d=o.map(h=>h===c?b.Children.count(u)>1?b.Children.only(null):b.isValidElement(u)?u.props.children:null:h);return l.jsx(e,{...s,ref:i,children:b.isValidElement(u)?b.cloneElement(u,void 0,d):null})}return l.jsx(e,{...s,ref:i,children:a})});return n.displayName=`${t}.Slot`,n}var eX=Zl("Slot");function tX(t){const e=b.forwardRef((n,r)=>{const{children:i,...a}=n;if(b.isValidElement(i)){const s=iX(i),o=rX(a,i.props);return i.type!==b.Fragment&&(o.ref=r?IL(r,s):s),b.cloneElement(i,o)}return b.Children.count(i)>1?b.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var LL=Symbol("radix.slottable");function $L(t){const e=({children:n})=>l.jsx(l.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=LL,e}function nX(t){return b.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===LL}function rX(t,e){const n={...e};for(const r in e){const i=t[r],a=e[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...o)=>{const c=a(...o);return i(...o),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}
vendor: 6,968 bytes, line 40
40:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...t,...n}}function iX(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function z2(t){const e=t+"CollectionProvider",[n,r]=Yr(e),[i,a]=n(e,{collectionRef:{current:null},itemMap:new Map}),s=m=>{const{scope:v,children:x}=m,w=D.useRef(null),y=D.useRef(new Map).current;return l.jsx(i,{scope:v,itemMap:y,collectionRef:w,children:x})};s.displayName=e;const o=t+"CollectionSlot",c=Zl(o),u=D.forwardRef((m,v)=>{const{scope:x,children:w}=m,y=a(o,x),k=bt(v,y.collectionRef);return l.jsx(c,{ref:k,children:w})});u.displayName=o;const d=t+"CollectionItemSlot",h="data-radix-collection-item",f=Zl(d),p=D.forwardRef((m,v)=>{const{scope:x,children:w,...y}=m,k=D.useRef(null),S=bt(v,k),_=a(d,x);return D.useEffect(()=>(_.itemMap.set(k,{ref:k,...y}),()=>void _.itemMap.delete(k))),l.jsx(f,{[h]:"",ref:S,children:w})});p.displayName=d;function g(m){const v=a(t+"CollectionConsumer",m);return D.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const y=Array.from(w.querySelectorAll(`[${h}]`));return Array.from(v.itemMap.values()).sort((_,C)=>y.indexOf(_.ref.current)-y.indexOf(C.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:u,ItemSlot:p},g,r]}var aX=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ke=aX.reduce((t,e)=>{const n=Zl(`Primitive.${e}`),r=b.forwardRef((i,a)=>{const{asChild:s,...o}=i,c=s?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...o,ref:a})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function FL(t,e){t&&Fc.flushSync(()=>t.dispatchEvent(e))}function Wn(t){const e=b.useRef(t);return b.useEffect(()=>{e.current=t}),b.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function sX(t,e=globalThis==null?void 0:globalThis.document){const n=Wn(t);b.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var oX="DismissableLayer",B_="dismissableLayer.update",cX="dismissableLayer.pointerDownOutside",lX="dismissableLayer.focusOutside",xO,BL=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),uf=b.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:s,onDismiss:o,...c}=t,u=b.useContext(BL),[d,h]=b.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=b.useState({}),g=bt(e,C=>h(C)),m=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=m.indexOf(v),w=d?m.indexOf(d):-1,y=u.layersWithOutsidePointerEventsDisabled.size>0,k=w>=x,S=dX(C=>{const T=C.target,E=[...u.branches].some(j=>j.contains(T));!k||E||(i==null||i(C),s==null||s(C),C.defaultPrevented||o==null||o())},f),_=hX(C=>{const T=C.target;[...u.branches].some(j=>j.contains(T))||(a==null||a(C),s==null||s(C),C.defaultPrevented||o==null||o())},f);return sX(C=>{w===u.layers.size-1&&(r==null||r(C),!C.defaultPrevented&&o&&(C.preventDefault(),o()))},f),b.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(xO=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),wO(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=xO)}},[d,f,n,u]),b.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),wO())},[d,u]),b.useEffect(()=>{const C=()=>p({});return document.addEventListener(B_,C),()=>document.removeEventListener(B_,C)},[]),l.jsx(Ke.div,{...c,ref:g,style:{pointerEvents:y?k?"auto":"none":void 0,...t.style},onFocusCapture:Ie(t.onFocusCapture,_.onFocusCapture),onBlurCapture:Ie(t.onBlurCapture,_.onBlurCapture),onPointerDownCapture:Ie(t.onPointerDownCapture,S.onPointerDownCapture)})});uf.displayName=oX;var uX="DismissableLayerBranch",UL=b.forwardRef((t,e)=>{const n=b.useContext(BL),r=b.useRef(null),i=bt(e,r);return b.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),l.jsx(Ke.div,{...t,ref:i})});UL.displayName=uX;function dX(t,e=globalThis==null?void 0:globalThis.document){const n=Wn(t),r=b.useRef(!1),i=b.useRef(()=>{});return b.useEffect(()=>{const a=o=>{if(o.target&&!r.current){let c=function(){zL(cX,n,u,{discrete:!0})};const u={originalEvent:o};o.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=c,e.addEventListener("click",i.current,{once:!0})):c()}else e.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{e.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(s),e.removeEventListener("pointerdown",a),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function hX(t,e=globalThis==null?void 0:globalThis.document){const n=Wn(t),r=b.useRef(!1);return b.useEffect(()=>{const i=a=>{a.target&&!r.current&&zL(lX,n,{originalEvent:a},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function wO(){const t=new CustomEvent(B_);document.dispatchEvent(t)}function zL(t,e,n,{discrete:r}){const i=n.originalEvent.target,a=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?FL(i,a):i.dispatchEvent(a)}var fX=uf,pX=UL,Ln=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{},mX="Portal",Bg=b.forwardRef((t,e)=>{var o;const{container:n,...r}=t,[i,a]=b.useState(!1);Ln(()=>a(!0),[]);const s=n||i&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return s?RL.createPortal(l.jsx(Ke.div,{...r,ref:e}),s):null});Bg.displayName=mX;function gX(t,e){return b.useReducer((n,r)=>e[n][r]??n,t)}var ui=t=>{const{present:e,children:n}=t,r=vX(e),i=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),a=bt(r.ref,yX(i));return typeof n=="function"||r.isPresent?b.cloneElement(i,{ref:a}):null};ui.displayName="Presence";function vX(t){const[e,n]=b.useState(),r=b.useRef(null),i=b.useRef(t),a=b.useRef("none"),s=t?"mounted":"unmounted",[o,c]=gX(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const u=Iv(r.current);a.current=o==="mounted"?u:"none"},[o]),Ln(()=>{const u=r.current,d=i.current;if(d!==t){const f=a.current,p=Iv(u);t?c("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&f!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,c]),Ln(()=>
40{if(e){let u;const d=e.ownerDocument.defaultView??window,h=p=>{const m=Iv(r.current).includes(p.animationName);if(p.target===e&&m&&(c("ANIMATION_END"),!i.current)){const v=e.style.animationFillMode;e.style.animationFillMode="forwards",u=d.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=v)})}},f=p=>{p.target===e&&(a.current=Iv(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{d.clearTimeout(u),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:b.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Iv(t){return(t==null?void 0:t.animationName)||"none"}function yX(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var bX=XE[" useInsertionEffect ".trim().toString()]||Ln;function ks({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[i,a,s]=xX({defaultProp:e,onChange:n}),o=t!==void 0,c=o?t:i;{const d=b.useRef(t!==void 0);b.useEffect(()=>{const h=d.current;h!==o&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${o?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=o},[o,r])}const u=b.useCallback(d=>{var h;if(o){const f=wX(d)?d(t):d;f!==t&&((h=s.current)==null||h.call(s,f))}else a(d)},[o,t,a,s]);return[c,u]}function xX({defaultProp:t,onChange:e}){const[n,r]=b.useState(t),i=b.useRef(n),a=b.useRef(e);return bX(()=>{a.current=e},[e]),b.useEffect(()=>{var s;i.current!==n&&((s=a.current)==null||s.call(a,n),i.current=n)},[n,i]),[n,r,a]}function wX(t){return typeof t=="function"}var WL=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),SX="VisuallyHidden",Ox=b.forwardRef((t,e)=>l.jsx(Ke.span,{...t,ref:e,style:{...WL,...t.style}}));Ox.displayName=SX;var kX=Ox,W2="ToastProvider",[V2,_X,CX]=z2("Toast"),[VL,eBe]=Yr("Toast",[CX]),[TX,Rx]=VL(W2),HL=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:a=50,children:s}=t,[o,c]=b.useState(null),[u,d]=b.useState(0),h=b.useRef(!1),f=b.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${W2}\`. Expected non-empty \`string\`.`),l.jsx(V2.Provider,{scope:e,children:l.jsx(TX,{scope:e,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:u,viewport:o,onViewportChange:c,onToastAdd:b.useCallback(()=>d(p=>p+1),[]),onToastRemove:b.useCallback(()=>d(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:f,children:s})})};HL.displayName=W2;var qL="ToastViewport",EX=["F8"],U_="toast.viewportPause",z_="toast.viewportResume",KL=b.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=EX,label:i="Notifications ({hotkey})",...a}=t,s=Rx(qL,n),o=_X(n),c=b.useRef(null),u=b.useRef(null),d=b.useRef(null),h=b.useRef(null),f=bt(e,h,s.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),g=s.toastCount>0;b.useEffect(()=>{const v=x=>{var y;r.length!==0&&r.every(k=>x[k]||x.code===k)&&((y=h.current)==null||y.focus())};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[r]),b.useEffect(()=>{const v=c.current,x=h.current;if(g&&v&&x){const w=()=>{if(!s.isClosePausedRef.current){const _=new CustomEvent(U_);x.dispatchEvent(_),s.isClosePausedRef.current=!0}},y=()=>{if(s.isClosePausedRef.current){const _=new CustomEvent(z_);x.dispatchEvent(_),s.isClosePausedRef.current=!1}},k=_=>{!v.contains(_.relatedTarget)&&y()},S=()=>{v.contains(document.activeElement)||y()};return v.addEventListener("focusin",w),v.addEventListener("focusout",k),v.addEventListener("pointermove",w),v.addEventListener("pointerleave",S),window.addEventListener("blur",w),window.addEventListener("focus",y),()=>{v.removeEventListener("focusin",w),v.removeEventListener("focusout",k),v.removeEventListener("pointermove",w),v.removeEventListener("pointerleave",S),window.removeEventListener("blur",w),window.removeEventListener("focus",y)}}},[g,s.isClosePausedRef]);const m=b.useCallback(({tabbingDirection:v})=>{const w=o().map(y=>{const k=y.ref.current,S=[k,...BX(k)];return v==="forwards"?S:S.reverse()});return(v==="forwards"?w.reverse():w).flat()},[o]);return b.useEffect(()=>{const v=h.current;if(v){const x=w=>{var S,_,C;const y=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!y){const T=document.activeElement,E=w.shiftKey;if(w.target===v&&E){(S=u.current)==null||S.focus();return}const M=m({tabbingDirection:E?"backwards":"forwards"}),U=M.findIndex(N=>N===T);lS(M.slice(U+1))?w.preventDefault():E?(_=u.current)==null||_.focus():(C=d.current)==null||C.focus()}};return v.addEventListener("keydown",x),()=>v.removeEventListener("keydown",x)}},[o,m]),l.jsxs(pX,{ref:c,role:"region","aria-label":i.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&l.jsx(W_,{ref:u,onFocusFromOutsideViewport:()=>{const v=m({tabbingDirection:"forwards"});lS(v)}}),l.jsx(V2.Slot,{scope:n,children:l.jsx(Ke.ol,{tabIndex:-1,...a,ref:f})}),g&&l.jsx(W_,{ref:d,onFocusFromOutsideViewport:()=>{const v=m({tabbingDirection:"backwards"});lS(v)}})]})});KL.displayName=qL;var GL="ToastFocusProxy",W_=b.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=t,a=Rx(GL,n);return l.jsx(Ox,{"aria-hidden":!0,tabIndex:0,...i,ref:e,style:{position:"fixed"},onFocus:s=>{var u;const o=s.relatedTarget;!((u=a.viewport)!=null&&u.contains(o))&&r()}})});W_.displayName=GL;var Ug="Toast",jX="toast.swipeStart",PX="toast.swipeMove",NX="toast.swipeCancel",AX="toast.swipeEnd",YL=b.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...s}=t,[o,c]=ks({prop:r,defaultProp:i??!0,onChange:a,caller:Ug});return l.jsx(ui,{present:n||o,children:l.jsx(DX,{open:o,...s,ref:e,onClose:()=>c(!1),onPause:Wn(t.onPause),onResume:Wn(t.onResume),onSwipeStart:Ie(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ie(t.onSwipeMove,u=>{const{x:d,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:Ie(t.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Ie(t.onSwipeEnd,u=>{const{x:d,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),c(!1)})})})});YL.displayName=Ug;var[OX,RX]=VL(Ug,{onClose(){}}),DX=b.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:i,open:a,onClose:s,onEscapeKeyDown:o,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:h,onSwipeCancel:f,onSwipeEnd:p,...g}=t,m=Rx(Ug,n),[v,x]=b.useState(null),w=bt(e,N=>x(N)),y=b.useRef(null),k=b.useRef(null),S=i||m.duration,_=b.useRef(0),C=b.useRef(S),T=b.useRef(0),{onToastAdd:E,onToastRemove:j}=m,P=Wn(()=>{var B;(v==null?void 0:v.contains(document.activeElement))&&((B=m.viewport)==null||B.focus()),s()}),M=b.useCallback(N=>
40{!N||N===1/0||(window.clearTimeout(T.current),_.current=new Date().getTime(),T.current=window.setTimeout(P,N))},[P]);b.useEffect(()=>{const N=m.viewport;if(N){const B=()=>{M(C.current),u==null||u()},$=()=>{const I=new Date().getTime()-_.current;C.current=C.current-I,window.clearTimeout(T.current),c==null||c()};return N.addEventListener(U_,$),N.addEventListener(z_,B),()=>{N.removeEventListener(U_,$),N.removeEventListener(z_,B)}}},[m.viewport,S,c,u,M]),b.useEffect(()=>{a&&!m.isClosePausedRef.current&&M(S)},[a,S,m.isClosePausedRef,M]),b.useEffect(()=>(E(),()=>j()),[E,j]);const U=b.useMemo(()=>v?n$(v):null,[v]);return m.viewport?l.jsxs(l.Fragment,{children:[U&&l.jsx(MX,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:U}),l.jsx(OX,{scope:n,onClose:P,children:Fc.createPortal(l.jsx(V2.ItemSlot,{scope:n,children:l.jsx(fX,{asChild:!0,onEscapeKeyDown:Ie(o,()=>{m.isFocusedToastEscapeKeyDownRef.current||P(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:l.jsx(Ke.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":m.swipeDirection,...g,ref:w,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:Ie(t.onKeyDown,N=>{N.key==="Escape"&&(o==null||o(N.nativeEvent),N.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,P()))}),onPointerDown:Ie(t.onPointerDown,N=>{N.button===0&&(y.current={x:N.clientX,y:N.clientY})}),onPointerMove:Ie(t.onPointerMove,N=>{if(!y.current)return;const B=N.clientX-y.current.x,$=N.clientY-y.current.y,I=!!k.current,R=["left","right"].includes(m.swipeDirection),z=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,O=R?z(0,B):0,A=R?0:z(0,$),L=N.pointerType==="touch"?10:2,V={x:O,y:A},Y={originalEvent:N,delta:V};I?(k.current=V,Lv(PX,h,Y,{discrete:!1})):SO(V,m.swipeDirection,L)?(k.current=V,Lv(jX,d,Y,{discrete:!1}),N.target.setPointerCapture(N.pointerId)):(Math.abs(B)>L||Math.abs($)>L)&&(y.current=null)}),onPointerUp:Ie(t.onPointerUp,N=>{const B=k.current,$=N.target;if($.hasPointerCapture(N.pointerId)&&$.releasePointerCapture(N.pointerId),k.current=null,y.current=null,B){const I=N.currentTarget,R={originalEvent:N,delta:B};SO(B,m.swipeDirection,m.swipeThreshold)?Lv(AX,p,R,{discrete:!0}):Lv(NX,f,R,{discrete:!0}),I.addEventListener("click",z=>z.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),MX=t=>{const{__scopeToast:e,children:n,...r}=t,i=Rx(Ug,e),[a,s]=b.useState(!1),[o,c]=b.useState(!1);return $X(()=>s(!0)),b.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),o?null:l.jsx(Bg,{asChild:!0,children:l.jsx(Ox,{...r,children:a&&l.jsxs(l.Fragment,{children:[i.label," ",n]})})})},IX="ToastTitle",JL=b.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return l.jsx(Ke.div,{...r,ref:e})});JL.displayName=IX;var LX="ToastDescription",XL=b.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return l.jsx(Ke.div,{...r,ref:e})});XL.displayName=LX;var ZL="ToastAction",QL=b.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?l.jsx(t$,{altText:n,asChild:!0,children:l.jsx(H2,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${ZL}\`. Expected non-empty \`string\`.`),null)});QL.displayName=ZL;var e$="ToastClose",H2=b.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,i=RX(e$,n);return l.jsx(t$,{asChild:!0,children:l.jsx(Ke.button,{type:"button",...r,ref:e,onClick:Ie(t.onClick,i.onClose)})})});H2.displayName=e$;var t$=b.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...i}=t;return l.jsx(Ke.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:e})});function n$(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),FX(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",a=r.dataset.radixToastAnnounceExclude==="";if(!i)if(a){const s=r.dataset.radixToastAnnounceAlt;s&&e.push(s)}else e.push(...n$(r))}}),e}function Lv(t,e,n,{discrete:r}){const i=n.originalEvent.currentTarget,a=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?FL(i,a):i.dispatchEvent(a)}var SO=(t,e,n=0)=>{const r=Math.abs(t.x),i=Math.abs(t.y),a=r>i;return e==="left"||e==="right"?a&&r>n:!a&&i>n};function $X(t=()=>{}){const e=Wn(t);Ln(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function FX(t){return t.nodeType===t.ELEMENT_NODE}function BX(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function lS(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var UX=HL,r$=KL,i$=YL,a$=JL,s$=XL,o$=QL,c$=H2;function l$(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=l$(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function pt(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=l$(t))&&(r&&(r+=" "),r+=e);return r}const kO=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,_O=pt,zg=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return _O(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:a}=e,s=Object.keys(i).map(u=>{const d=n==null?void 0:n[u],h=a==null?void 0:a[u];if(d===null)return null;const f=kO(d)||kO(h);return i[u][f]}),o=n&&Object.entries(n).reduce((u,d)=>{let[h,f]=d;return f===void 0||(u[h]=f),u},{}),c=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:h,className:f,...p}=d;return Object.entries(p).every(g=>{let[m,v]=g;return Array.isArray(v)?v.includes({...a,...o}[m]):{...a,...o}[m]===v})?[...u,h,f]:u},[]);return _O(t,s,c,n==null?void 0:n.class,n==null?void 0:n.className)};/** 41 * @license lucide-react v0.462.0 - ISC 42 * 43 * This source code is licensed under the ISC license. 44 * See the LICENSE file in the root directory of this source tree. 45 */const zX=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),u$=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/** 46 * @license lucide-react v0.462.0 - ISC 47 * 48 * This source code is licensed under the ISC license. 49 * See the LICENSE file in the root directory of this source tree. 50 */var WX={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"};/** 51 * @license lucide-react v0.462.0 - ISC 52 * 53 * This source code is licensed under the ISC license. 54 * See the LICENSE file in the root directory of this source tree. 55 */const VX=b.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:s,...o},c)=>b.createElement("svg",{ref:c,...WX,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:u$("lucide",i),...o},[...s.map(([u,d])=>b.createElement(u,d)),...Array.isArray(a)?a:[a]]));/** 56 * @license lucide-react v0.462.0 - ISC 57 * 58 * This source code is licensed under the ISC license. 59 * See the LICENSE file in the root directory of this source tree. 60 */const Se=(t,e)=>{const n=b.forwardRef(({className:r,...i},a)=>b.createElement(VX,{ref:a,iconNode:e,className:u$(`lucide-${zX(t)}`,r),...i}));return n.displayName=`${t}`,n};/** 61 * @license lucide-react v0.462.0 - ISC 62 * 63 * This source code is licensed under the ISC license. 64 * See the LICENSE file in the root directory of this source tree. 65 */const $p=Se("Activity",[["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
65-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** 66 * @license lucide-react v0.462.0 - ISC 67 * 68 * This source code is licensed under the ISC license. 69 * See the LICENSE file in the root directory of this source tree. 70 */const ci=Se("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** 71 * @license lucide-react v0.462.0 - ISC 72 * 73 * This source code is licensed under the ISC license. 74 * See the LICENSE file in the root directory of this source tree. 75 */const HX=Se("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** 76 * @license lucide-react v0.462.0 - ISC 77 * 78 * This source code is licensed under the ISC license. 79 * See the LICENSE file in the root directory of this source tree. 80 */const CO=Se("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/** 81 * @license lucide-react v0.462.0 - ISC 82 * 83 * This source code is licensed under the ISC license. 84 * See the LICENSE file in the root directory of this source tree. 85 */const TO=Se("BellOff",[["path",{d:"M8.7 3A6 6 0 0 1 18 8a21.3 21.3 0 0 0 .6 5",key:"o7mx20"}],["path",{d:"M17 17H3s3-2 3-9a4.67 4.67 0 0 1 .3-1.7",key:"16f1lm"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** 86 * @license lucide-react v0.462.0 - ISC 87 * 88 * This source code is licensed under the ISC license. 89 * See the LICENSE file in the root directory of this source tree. 90 */const vc=Se("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/** 91 * @license lucide-react v0.462.0 - ISC 92 * 93 * This source code is licensed under the ISC license. 94 * See the LICENSE file in the root directory of this source tree. 95 */const qX=Se("Bike",[["circle",{cx:"18.5",cy:"17.5",r:"3.5",key:"15x4ox"}],["circle",{cx:"5.5",cy:"17.5",r:"3.5",key:"1noe27"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["path",{d:"M12 17.5V14l-3-3 4-3 2 3h2",key:"1npguv"}]]);/** 96 * @license lucide-react v0.462.0 - ISC 97 * 98 * This source code is licensed under the ISC license. 99 * See the LICENSE file in the root directory of this source tree. 100 */const KX=Se("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** 101 * @license lucide-react v0.462.0 - ISC 102 * 103 * This source code is licensed under the ISC license. 104 * See the LICENSE file in the root directory of this source tree. 105 */const GX=Se("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/** 106 * @license lucide-react v0.462.0 - ISC 107 * 108 * This source code is licensed under the ISC license. 109 * See the LICENSE file in the root directory of this source tree. 110 */const d$=Se("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);/** 111 * @license lucide-react v0.462.0 - ISC 112 * 113 * This source code is licensed under the ISC license. 114 * See the LICENSE file in the root directory of this source tree. 115 */const yc=Se("Calendar",[["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"}]]);/** 116 * @license lucide-react v0.462.0 - ISC 117 * 118 * This source code is licensed under the ISC license. 119 * See the LICENSE file in the root directory of this source tree. 120 */const YX=Se("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/** 121 * @license lucide-react v0.462.0 - ISC 122 * 123 * This source code is licensed under the ISC license. 124 * See the LICENSE file in the root directory of this source tree. 125 */const JX=Se("Car",[["path",{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",key:"5owen"}],["circle",{cx:"7",cy:"17",r:"2",key:"u2ysq9"}],["path",{d:"M9 17h6",key:"r8uit2"}],["circle",{cx:"17",cy:"17",r:"2",key:"axvx0g"}]]);/** 126 * @license lucide-react v0.462.0 - ISC 127 * 128 * This source code is licensed under the ISC license. 129 * See the LICENSE file in the root directory of this source tree. 130 */const h$=Se("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** 131 * @license lucide-react v0.462.0 - ISC 132 * 133 * This source code is licensed under the ISC license. 134 * See the LICENSE file in the root directory of this source tree. 135 */const XX=Se("ChartPie",[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",ke
135y:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]]);/** 136 * @license lucide-react v0.462.0 - ISC 137 * 138 * This source code is licensed under the ISC license. 139 * See the LICENSE file in the root directory of this source tree. 140 */const ZX=Se("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]);/** 141 * @license lucide-react v0.462.0 - ISC 142 * 143 * This source code is licensed under the ISC license. 144 * See the LICENSE file in the root directory of this source tree. 145 */const _s=Se("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 146 * @license lucide-react v0.462.0 - ISC 147 * 148 * This source code is licensed under the ISC license. 149 * See the LICENSE file in the root directory of this source tree. 150 */const T0=Se("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** 151 * @license lucide-react v0.462.0 - ISC 152 * 153 * This source code is licensed under the ISC license. 154 * See the LICENSE file in the root directory of this source tree. 155 */const ch=Se("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** 156 * @license lucide-react v0.462.0 - ISC 157 * 158 * This source code is licensed under the ISC license. 159 * See the LICENSE file in the root directory of this source tree. 160 */const lh=Se("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** 161 * @license lucide-react v0.462.0 - ISC 162 * 163 * This source code is licensed under the ISC license. 164 * See the LICENSE file in the root directory of this source tree. 165 */const V_=Se("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** 166 * @license lucide-react v0.462.0 - ISC 167 * 168 * This source code is licensed under the ISC license. 169 * See the LICENSE file in the root directory of this source tree. 170 */const QX=Se("Church",[["path",{d:"M10 9h4",key:"u4k05v"}],["path",{d:"M12 7v5",key:"ma6bk"}],["path",{d:"M14 22v-4a2 2 0 0 0-4 0v4",key:"1pdhuj"}],["path",{d:"M18 22V5.618a1 1 0 0 0-.553-.894l-4.553-2.277a2 2 0 0 0-1.788 0L6.553 4.724A1 1 0 0 0 6 5.618V22",key:"1rkokr"}],["path",{d:"m18 7 3.447 1.724a1 1 0 0 1 .553.894V20a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9.618a1 1 0 0 1 .553-.894L6 7",key:"1w6esw"}]]);/** 171 * @license lucide-react v0.462.0 - ISC 172 * 173 * This source code is licensed under the ISC license. 174 * See the LICENSE file in the root directory of this source tree. 175 */const f$=Se("CircleAlert",[["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"}]]);/** 176 * @license lucide-react v0.462.0 - ISC 177 * 178 * This source code is licensed under the ISC license. 179 * See the LICENSE file in the root directory of this source tree. 180 */const EO=Se("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** 181 * @license lucide-react v0.462.0 - ISC 182 * 183 * This source code is licensed under the ISC license. 184 * See the LICENSE file in the root directory of this source tree. 185 */const p$=Se("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 186 * @license lucide-react v0.462.0 - ISC 187 * 188 * This source code is licensed under the ISC license. 189 * See the LICENSE file in the root directory of this source tree. 190 */const eZ=Se("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** 191 * @license lucide-react v0.462.0 - ISC 192 * 193 * This source code is licensed under the ISC license. 194 * See the LICENSE file in the root directory of this source tree. 195 */const Dx=Se("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** 196 * @license lucide-react v0.462.0 - ISC 197 * 198 * This source code is licensed under the ISC license. 199 * See the LICENSE file in the root directory of this source tree. 200 */const tZ=Se("Coffee",[["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M14 2v2",key:"6buw04"}],["path",{d:"M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1",key:"pwadti"}],["path",{d:"M6 2v2",key:"colzsn"}]]);/** 201 * @license lucide-react v0.462.0 - ISC 202 * 203 * This source code is licensed under the ISC license. 204 * See the LICENSE file in the root directory of this source tree. 205 */const nZ=Se("Cookie",[["path",{d:"M12 2a10 10 0 1 0 10 10 4 4 0 0 1-5-5 4 4 0 0 1-5-5",key:"laymnq"}],["path",{d:"M8.5 8.5v.01",key:"ue8clq"}],["path",{d:"M16 15.5v.01",key:"14dtrp"}],["path",{d:"M12 12v.01",key:"u5ubse"}],["path",{d:"M11 17v.01",key:"1hyl5a"}],["path",{d:"M7 14v.01",key:"uct60s"}]]);/** 206 * @license lucide-react v0.462.0 - ISC 207 * 208 * This source code is licensed under the ISC license. 209 * See the LICENSE file in the root directory of this source tree.
210 */const Pd=Se("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** 211 * @license lucide-react v0.462.0 - ISC 212 * 213 * This source code is licensed under the ISC license. 214 * See the LICENSE file in the root directory of this source tree. 215 */const H_=Se("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** 216 * @license lucide-react v0.462.0 - ISC 217 * 218 * This source code is licensed under the ISC license. 219 * See the LICENSE file in the root directory of this source tree. 220 */const rZ=Se("Droplets",[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]]);/** 221 * @license lucide-react v0.462.0 - ISC 222 * 223 * This source code is licensed under the ISC license. 224 * See the LICENSE file in the root directory of this source tree. 225 */const iZ=Se("Dumbbell",[["path",{d:"M14.4 14.4 9.6 9.6",key:"ic80wn"}],["path",{d:"M18.657 21.485a2 2 0 1 1-2.829-2.828l-1.767 1.768a2 2 0 1 1-2.829-2.829l6.364-6.364a2 2 0 1 1 2.829 2.829l-1.768 1.767a2 2 0 1 1 2.828 2.829z",key:"nnl7wr"}],["path",{d:"m21.5 21.5-1.4-1.4",key:"1f1ice"}],["path",{d:"M3.9 3.9 2.5 2.5",key:"1evmna"}],["path",{d:"M6.404 12.768a2 2 0 1 1-2.829-2.829l1.768-1.767a2 2 0 1 1-2.828-2.829l2.828-2.828a2 2 0 1 1 2.829 2.828l1.767-1.768a2 2 0 1 1 2.829 2.829z",key:"yhosts"}]]);/** 226 * @license lucide-react v0.462.0 - ISC 227 * 228 * This source code is licensed under the ISC license. 229 * See the LICENSE file in the root directory of this source tree. 230 */const jO=Se("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** 231 * @license lucide-react v0.462.0 - ISC 232 * 233 * This source code is licensed under the ISC license. 234 * See the LICENSE file in the root directory of this source tree. 235 */const uh=Se("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** 236 * @license lucide-react v0.462.0 - ISC 237 * 238 * This source code is licensed under the ISC license. 239 * See the LICENSE file in the root directory of this source tree. 240 */const go=Se("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** 241 * @license lucide-react v0.462.0 - ISC 242 * 243 * This source code is licensed under the ISC license. 244 * See the LICENSE file in the root directory of this source tree. 245 */const Wg=Se("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** 246 * @license lucide-react v0.462.0 - ISC 247 * 248 * This source code is licensed under the ISC license. 249 * See the LICENSE file in the root directory of this source tree. 250 */const aZ=Se("Gift",[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]]);/** 251 * @license lucide-react v0.462.0 - ISC 252 * 253 * This source code is licensed under the ISC license. 254 * See the LICENSE file in the root directory of this source tree. 255 */const sZ=Se("GraduationCap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]);/** 256 * @license lucide-react v0.462.0 - ISC 257 * 258 * This source code is licensed under the ISC license. 259 * See the LICENSE file in the root directory of this source tree. 260 */const q_=Se("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/** 261 * @license lucide-react v0.462.0 - ISC 262 * 263 * This source code is licensed under the ISC license. 264 * See the LICENSE file in the root directory of this source tree. 265 */const m$=Se("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** 266 * @license lucide-react v0.462.0 - ISC 267 * 268 * This source code is licensed under the ISC license. 269 * See the LICENSE file in the root directory of this source tree. 270 */const oZ=Se("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** 271 * @license lucide-react v0.462.0 - ISC 272 * 273 * This source code is licensed under the ISC license. 274 * See the LICENSE file in the root directory of this source tree. 275 */const E0=Se("Key",[["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"}]]);/** 276 * @license lucide-react v0.462.0 - ISC 277 * 278 * This source code is licensed under the ISC license. 279 * See the LICENSE file in the root directory of this source tree.
280 */const bm=Se("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/** 281 * @license lucide-react v0.462.0 - ISC 282 * 283 * This source code is licensed under the ISC license. 284 * See the LICENSE file in the root directory of this source tree. 285 */const cZ=Se("Linkedin",[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]]);/** 286 * @license lucide-react v0.462.0 - ISC 287 * 288 * This source code is licensed under the ISC license. 289 * See the LICENSE file in the root directory of this source tree. 290 */const Er=Se("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 291 * @license lucide-react v0.462.0 - ISC 292 * 293 * This source code is licensed under the ISC license. 294 * See the LICENSE file in the root directory of this source tree. 295 */const K_=Se("LockOpen",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]);/** 296 * @license lucide-react v0.462.0 - ISC 297 * 298 * This source code is licensed under the ISC license. 299 * See the LICENSE file in the root directory of this source tree. 300 */const xm=Se("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** 301 * @license lucide-react v0.462.0 - ISC 302 * 303 * This source code is licensed under the ISC license. 304 * See the LICENSE file in the root directory of this source tree. 305 */const lZ=Se("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** 306 * @license lucide-react v0.462.0 - ISC 307 * 308 * This source code is licensed under the ISC license. 309 * See the LICENSE file in the root directory of this source tree. 310 */const uZ=Se("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/** 311 * @license lucide-react v0.462.0 - ISC 312 * 313 * This source code is licensed under the ISC license. 314 * See the LICENSE file in the root directory of this source tree. 315 */const df=Se("MapPin",[["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"}]]);/** 316 * @license lucide-react v0.462.0 - ISC 317 * 318 * This source code is licensed under the ISC license. 319 * See the LICENSE file in the root directory of this source tree. 320 */const G_=Se("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/** 321 * @license lucide-react v0.462.0 - ISC 322 * 323 * This source code is licensed under the ISC license. 324 * See the LICENSE file in the root directory of this source tree. 325 */const dZ=Se("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);/** 326 * @license lucide-react v0.462.0 - ISC 327 * 328 * This source code is licensed under the ISC license. 329 * See the LICENSE file in the root directory of this source tree. 330 */const g$=Se("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/** 331 * @license lucide-react v0.462.0 - ISC 332 * 333 * This source code is licensed under the ISC license. 334 * See the LICENSE file in the root directory of this source tree. 335 */const hZ=Se("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/** 336 * @license lucide-react v0.462.0 - ISC 337 * 338 * This source code is licensed under the ISC license. 339 * See the LICENSE file in the root directory of this source tree. 340 */const fZ=Se("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/** 341 * @license lucide-react v0.462.0 - ISC 342 * 343 * This source code is licensed under the ISC license. 344 * See the LICENSE file in the root directory of this source tree. 345 */const pZ=Se("PartyPopper",[["path",{d:"M5.8 11.3 2 22l10.7-3.79",key:"gwxi1d"}],["path",{d:"M4 3h.01",key:"1vcuye"}],["path",{d:"M22 8h.01",key:"1mrtc2"}],["path",{d:"M15 2h.01",key:"1cjtqr"}],["path",{d:"M22 20h.01",key:"1mrys2"}],["path",{d:"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10",key:"hbicv8"}],["path",{d:"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17",key:"1i94pl"}],["path",{d:"m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7",key:"1cofks"}],["path",{d:"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z",key:"4kbmks"}]]);/** 346 * @license lucide-react v0.462.0 - ISC 347 * 348 * This source code is licensed under the ISC license. 349 * See the LICENSE file in the root directory of this source tree. 350 */const Mx=Se("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/** 351 * @license lucide-react v0.462.0 - ISC 352 * 353 * This source code is licensed under the ISC license. 354 * See the LICENSE file in the root directory of this source tree. 355 */const mZ=Se("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** 356 * @license lucide-react v0.462.0 - ISC 357 * 358 * This source code is licensed under the ISC license. 359 * See the LICENSE file in the root directory of this source tree. 360 */const gZ=Se("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/** 361 * @license lucide-react v0.462.0 - ISC 362 * 363 * This source code is licensed under the ISC license. 364 * See the LICENSE file in the root directory of this source tree. 365 */const v$=Se("Pill",[["path",{d:"m10.5 20.5 10-10a4.95 4.95 0 1 0-7-7l-10 10a4.95 4.95 0 1 0 7 7Z",key:"wa1lgi"}],["path",{d:"m8.5 8.5 7 7",key:"rvfmvr"}]]);/** 366 * @license lucide-react v0.462.0 - ISC 367 * 368 * This source code is licensed under the ISC license. 369 * See the LICENSE file in the root directory of this source tree. 370 */const vZ=Se("Plane",[["path",{d:"M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.
3701-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z",key:"1v9wt8"}]]);/** 371 * @license lucide-react v0.462.0 - ISC 372 * 373 * This source code is licensed under the ISC license. 374 * See the LICENSE file in the root directory of this source tree. 375 */const pl=Se("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** 376 * @license lucide-react v0.462.0 - ISC 377 * 378 * This source code is licensed under the ISC license. 379 * See the LICENSE file in the root directory of this source tree. 380 */const dh=Se("RefreshCw",[["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"}]]);/** 381 * @license lucide-react v0.462.0 - ISC 382 * 383 * This source code is licensed under the ISC license. 384 * See the LICENSE file in the root directory of this source tree. 385 */const y$=Se("Repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]);/** 386 * @license lucide-react v0.462.0 - ISC 387 * 388 * This source code is licensed under the ISC license. 389 * See the LICENSE file in the root directory of this source tree. 390 */const yZ=Se("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/** 391 * @license lucide-react v0.462.0 - ISC 392 * 393 * This source code is licensed under the ISC license. 394 * See the LICENSE file in the root directory of this source tree. 395 */const bZ=Se("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** 396 * @license lucide-react v0.462.0 - ISC 397 * 398 * This source code is licensed under the ISC license. 399 * See the LICENSE file in the root directory of this source tree. 400 */const xZ=Se("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** 401 * @license lucide-react v0.462.0 - ISC 402 * 403 * This source code is licensed under the ISC license. 404 * See the LICENSE file in the root directory of this source tree. 405 */const wZ=Se("Scissors",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]);/** 406 * @license lucide-react v0.462.0 - ISC 407 * 408 * This source code is licensed under the ISC license. 409 * See the LICENSE file in the root directory of this source tree. 410 */const SZ=Se("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** 411 * @license lucide-react v0.462.0 - ISC 412 * 413 * This source code is licensed under the ISC license. 414 * See the LICENSE file in the root directory of this source tree. 415 */const PO=Se("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/** 416 * @license lucide-react v0.462.0 - ISC 417 * 418 * This source code is licensed under the ISC license. 419 * See the LICENSE file in the root directory of this source tree. 420 */const kZ=Se("ShieldCheck",[["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",ke
420y:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 421 * @license lucide-react v0.462.0 - ISC 422 * 423 * This source code is licensed under the ISC license. 424 * See the LICENSE file in the root directory of this source tree. 425 */const wm=Se("Shield",[["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"}]]);/** 426 * @license lucide-react v0.462.0 - ISC 427 * 428 * This source code is licensed under the ISC license. 429 * See the LICENSE file in the root directory of this source tree. 430 */const _Z=Se("ShoppingCart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]);/** 431 * @license lucide-react v0.462.0 - ISC 432 * 433 * This source code is licensed under the ISC license. 434 * See the LICENSE file in the root directory of this source tree. 435 */const ta=Se("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** 436 * @license lucide-react v0.462.0 - ISC 437 * 438 * This source code is licensed under the ISC license. 439 * See the LICENSE file in the root directory of this source tree. 440 */const b$=Se("Speech",[["path",{d:"M8.8 20v-4.1l1.9.2a2.3 2.3 0 0 0 2.164-2.1V8.3A5.37 5.37 0 0 0 2 8.25c0 2.8.656 3.054 1 4.55a5.77 5.77 0 0 1 .029 2.758L2 20",key:"11atix"}],["path",{d:"M19.8 17.8a7.5 7.5 0 0 0 .003-10.603",key:"yol142"}],["path",{d:"M17 15a3.5 3.5 0 0 0-.025-4.975",key:"ssbmkc"}]]);/** 441 * @license lucide-react v0.462.0 - ISC 442 * 443 * This source code is licensed under the ISC license. 444 * See the LICENSE file in the root directory of this source tree. 445 */const j0=Se("Stethoscope",[["path",{d:"M11 2v2",key:"1539x4"}],["path",{d:"M5 2v2",key:"1yf1q8"}],["path",{d:"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1",key:"rb5t3r"}],["path",{d:"M8 15a6 6 0 0 0 12 0v-3",key:"x18d4x"}],["circle",{cx:"20",cy:"10",r:"2",key:"ts1r5v"}]]);/** 446 * @license lucide-react v0.462.0 - ISC 447 * 448 * This source code is licensed under the ISC license. 449 * See the LICENSE file in the root directory of this source tree. 450 */const q2=Se("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** 451 * @license lucide-react v0.462.0 - ISC 452 * 453 * This source code is licensed under the ISC license. 454 * See the LICENSE file in the root directory of this source tree. 455 */const CZ=Se("TreePine",[["path",{d:"m17 14 3 3.3a1 1 0 0 1-.7 1.7H4.7a1 1 0 0 1-.7-1.7L7 14h-.3a1 1 0 0 1-.7-1.7L9 9h-.2A1 1 0 0 1 8 7.3L12 3l4 4.3a1 1 0 0 1-.8 1.7H15l3 3.3a1 1 0 0 1-.7 1.7H17Z",key:"cpyugq"}],["path",{d:"M12 22v-3",key:"kmzjlo"}]]);/** 456 * @license lucide-react v0.462.0 - ISC 457 * 458 * This source code is licensed under the ISC license. 459 * See the LICENSE file in the root directory of this source tree. 460 */const x$=Se("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** 461 * @license lucide-react v0.462.0 - ISC 462 * 463 * This source code is licensed under the ISC license. 464 * See the LICENSE file in the root directory of this source tree. 465 */const bc=Se("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 466 * @license lucide-react v0.462.0 - ISC 467 * 468 * This source code is licensed under the ISC license. 469 * See the LICENSE file in the root directory of this source tree. 470 */const TZ=Se("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/** 471 * @license lucide-react v0.462.0 - ISC 472 * 473 * This source code is licensed under the ISC license. 474 * See the LICENSE file in the root directory of this source tree. 475 */const NO=Se("UserX",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]);/** 476 * @license lucide-react v0.462.0 - ISC 477 * 478 * This source code is licensed under the ISC license. 479 * See the LICENSE file in the root directory of this source tree. 480 */const Ql=Se("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** 481 * @license lucide-react v0.462.0 - ISC 482 * 483 * This source code is licensed under the ISC license. 484 * See the LICENSE file in the root directory of this source tree. 485 */const K2=Se("Utensils",[["path",{d:"M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2",key:"cjf0a3"}],["path",{d:"M7 2v20",key:"1473qp"}
vendor: 9,919 bytes, lines 485-515
485],["path",{d:"M21 15V2a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3Zm0 0v7",key:"j28e5"}]]);/** 486 * @license lucide-react v0.462.0 - ISC 487 * 488 * This source code is licensed under the ISC license. 489 * See the LICENSE file in the root directory of this source tree. 490 */const EZ=Se("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/** 491 * @license lucide-react v0.462.0 - ISC 492 * 493 * This source code is licensed under the ISC license. 494 * See the LICENSE file in the root directory of this source tree. 495 */const AO=Se("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/** 496 * @license lucide-react v0.462.0 - ISC 497 * 498 * This source code is licensed under the ISC license. 499 * See the LICENSE file in the root directory of this source tree. 500 */const jZ=Se("VolumeX",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/** 501 * @license lucide-react v0.462.0 - ISC 502 * 503 * This source code is licensed under the ISC license. 504 * See the LICENSE file in the root directory of this source tree. 505 */const w$=Se("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** 506 * @license lucide-react v0.462.0 - ISC 507 * 508 * This source code is licensed under the ISC license. 509 * See the LICENSE file in the root directory of this source tree. 510 */const vo=Se("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** 511 * @license lucide-react v0.462.0 - ISC 512 * 513 * This source code is licensed under the ISC license. 514 * See the LICENSE file in the root directory of this source tree. 515 */const OO=Se("Zap",[["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"}]]),G2="-",PZ=t=>{const e=AZ(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:s=>{const o=s.split(G2);return o[0]===""&&o.length!==1&&o.shift(),S$(o,e)||NZ(s)},getConflictingClassGroupIds:(s,o)=>{const c=n[s]||[];return o&&r[s]?[...c,...r[s]]:c}}},S$=(t,e)=>{var s;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),i=r?S$(t.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const a=t.join(G2);return(s=e.validators.find(({validator:o})=>o(a)))==null?void 0:s.classGroupId},RO=/^\[(.+)\]$/,NZ=t=>{if(RO.test(t)){const e=RO.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},AZ=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return RZ(Object.entries(t.classGroups),n).forEach(([a,s])=>{Y_(s,r,a,e)}),r},Y_=(t,e,n,r)=>{t.forEach(i=>{if(typeof i=="string"){const a=i===""?e:DO(e,i);a.classGroupId=n;return}if(typeof i=="function"){if(OZ(i)){Y_(i(r),e,n,r);return}e.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([a,s])=>{Y_(s,DO(e,a),n,r)})})},DO=(t,e)=>{let n=t;return e.split(G2).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},OZ=t=>t.isThemeGetter,RZ=(t,e)=>e?t.map(([n,r])=>{const i=r.map(a=>typeof a=="string"?e+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([s,o])=>[e+s,o])):a);return[n,i]}):t,DZ=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const i=(a,s)=>{n.set(a,s),e++,e>t&&(e=0,r=n,n=new Map)};return{get(a){let s=n.get(a);if(s!==void 0)return s;if((s=r.get(a))!==void 0)return i(a,s),s},set(a,s){n.has(a)?n.set(a,s):i(a,s)}}},k$="!",MZ=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,i=e[0],a=e.length,s=o=>{const c=[];let u=0,d=0,h;for(let v=0;v<o.length;v++){let x=o[v];if(u===0){if(x===i&&(r||o.slice(v,v+a)===e)){c.push(o.slice(d,v)),d=v+a;continue}if(x==="/"){h=v;continue}}x==="["?u++:x==="]"&&u--}const f=c.length===0?o:o.substring(d),p=f.startsWith(k$),g=p?f.substring(1):f,m=h&&h>d?h-d:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:m}};return n?o=>n({className:o,parseClassName:s}):s},IZ=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},LZ=t=>({cache:DZ(t.cacheSize),parseClassName:MZ(t),...PZ(t)}),$Z=/\s+/,FZ=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=e,a=[],s=t.trim().split($Z);let o="";for(let c=s.length-1;c>=0;c-=1){const u=s[c],{modifiers:d,hasImportantModifier:h,baseClassName:f,maybePostfixModifierPosition:p}=n(u);let g=!!p,m=r(g?f.substring(0,p):f);if(!m){if(!g){o=u+(o.length>0?" "+o:o);continue}if(m=r(f),!m){o=u+(o.length>0?" "+o:o);continue}g=!1}const v=IZ(d).join(":"),x=h?v+k$:v,w=x+m;if(a.includes(w))continue;a.push(w);const y=i(m,g);for(let k=0;k<y.length;++k){const S=y[k];a.push(x+S)}o=u+(o.length>0?" "+o:o)}return o};function BZ(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=_$(e))&&(r&&(r+=" "),r+=n);return r}const _$=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=_$(t[r]))&&(n&&(n+=" "),n+=e);return n};function UZ(t,...e){let n,r,i,a=s;function s(c){const u=e.reduce((d,h)=>h(d),t());return n=LZ(u),r=n.cache.get,i=n.cache.set,a=o,o(c)}function o(c){const u=r(c);if(u)return u;const d=FZ(c,n);return i(c,d),d}return function(){return a(BZ.apply(null,arguments))}}const sn=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},C$=/^\[(?:([a-z-]+):)?(.+)\]$/i,zZ=/^\d+\/\d+$/,WZ=new Set(["px","full","screen"]),VZ=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,HZ=/\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$/,qZ=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,KZ=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,GZ=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Is=t=>Nd(t)||WZ.has(t)||zZ.test(t),No=t=>hf(t,"length",nQ),Nd=t=>!!t&&!Number.isNaN(Number(t)),uS=t=>hf(t,"number",Nd),Kf=t=>!!t&&Number.isInteger(Number(t)),YZ=t=>t.endsWith("%")&&Nd(t.slice(0,-1)),vt=t=>C$.test(t),Ao=t=>VZ.test(t),JZ=new Set(["length","size","percentage"]),XZ=t=>hf(t,JZ,T$),ZZ=t=>hf(t,"position",T$),QZ=new Set(["image","url"]),eQ=t=>hf(t,QZ,iQ),tQ=t=>hf(t,"",rQ),Gf=()=>!0,hf=(t,e,n)=>{const r=C$.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},nQ=t=>HZ.test(t)&&!qZ.test(t),T$=()=>!1,rQ=t=>KZ.test(t),iQ=t=>GZ.test(t),aQ=()=>{const t=sn("colors"),e=sn("spacing"),n=sn("blur"),r=sn("brightness"),i=sn("borderColor"),a=sn("borderRadius"),s=sn("borderSpacing"),o=sn("borderWidth"),c=sn("contrast"),u=sn("grayscale"),d=sn("hueRotate"),h=sn("invert"),f=sn("gap"),p=sn("gradientColorStops"),g=sn("gradientColorStopPositions"),m=sn("inset"),v=sn("margin"),x=sn("opacity"),w=sn("padding"),y=sn("saturate"),k=sn("scale"),S=sn("sepia"),_=sn("skew"),C=sn("space"),T=sn("translate"),E=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",vt,e],M=()=>[vt,e],U=()=>["",Is,No],N=()=>["auto",Nd,vt],B=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],$=()=>["solid","dashed","dotted","double","none"],I=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],R=()=>["start","end","center","between","around","evenly","stretch"],z=()=>["","0",vt],O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>[Nd,vt];return{cacheSize:500,separator:":",theme:{colors:[Gf],spacing:[Is,No],blur:["none","",Ao,vt],brightness:A(),borderColor:[t],borderRadius:["none","","full",Ao,vt],borderSpacing:M(),borderWidth:U(),contrast:A(),grayscale:z(),hueRotate:A(),invert:z(),gap:M(),gradientColorStops:[t],gradientColorStopPositions:[YZ,No],inset:P(),margin:P(),opacity:A(),padding:M(),saturate:A(),scale:A(),sepia:z(),skew:A(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",vt]}],container:["container"],columns:[{columns:[Ao]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"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:[...B(),vt]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}
vendor: 9,947 bytes, line 515
515],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Kf,vt]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",vt]}],grow:[{grow:z()}],shrink:[{shrink:z()}],order:[{order:["first","last","none",Kf,vt]}],"grid-cols":[{"grid-cols":[Gf]}],"col-start-end":[{col:["auto",{span:["full",Kf,vt]},vt]}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":[Gf]}],"row-start-end":[{row:["auto",{span:[Kf,vt]},vt]}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",vt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",vt]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...R()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...R(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...R(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",vt,e]}],"min-w":[{"min-w":[vt,e,"min","max","fit"]}],"max-w":[{"max-w":[vt,e,"none","full","min","max","fit","prose",{screen:[Ao]},Ao]}],h:[{h:[vt,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[vt,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[vt,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[vt,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Ao,No]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",uS]}],"font-family":[{font:[Gf]}],"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",vt]}],"line-clamp":[{"line-clamp":["none",Nd,uS]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Is,vt]}],"list-image":[{"list-image":["none",vt]}],"list-style-type":[{list:["none","disc","decimal",vt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Is,No]}],"underline-offset":[{"underline-offset":["auto",Is,vt]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",vt]}],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",vt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...B(),ZZ]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",XZ]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},eQ]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...$(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:$()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...$()]}],"outline-offset":[{"outline-offset":[Is,vt]}],"outline-w":[{outline:[Is,No]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[Is,No]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Ao,tQ]}],"shadow-color":[{shadow:[Gf]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...I(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":I()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Ao,vt]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[h]}],saturate:[{saturate:[y]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"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",vt]}],duration:[{duration:A()}],ease:[{ease:["linear","in","out","in-out",vt]}],delay:[{delay:A()}],animate:[{animate:["none","spin","ping","pulse","bounce",vt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[Kf,vt]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[_]}],"skew-y":[{"skew-y":[_]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",vt]}],accent:[{accent:["auto",t]}],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",vt]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"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"]}
vendor: 4,647 bytes, line 515
515],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",vt]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Is,No,uS]}],stroke:[{stroke:[t,"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"]}}},sQ=UZ(aQ);function ce(...t){return sQ(pt(t))}const oQ=UX,E$=b.forwardRef(({className:t,...e},n)=>l.jsx(r$,{ref:n,className:ce("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));E$.displayName=r$.displayName;const cQ=zg("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),j$=b.forwardRef(({className:t,variant:e,...n},r)=>l.jsx(i$,{ref:r,className:ce(cQ({variant:e}),t),...n}));j$.displayName=i$.displayName;const lQ=b.forwardRef(({className:t,...e},n)=>l.jsx(o$,{ref:n,className:ce("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",t),...e}));lQ.displayName=o$.displayName;const P$=b.forwardRef(({className:t,...e},n)=>l.jsx(c$,{ref:n,className:ce("absolute right-2 top-2 rounded-md p-1 text-foreground
515/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...e,children:l.jsx(vo,{className:"h-4 w-4"})}));P$.displayName=c$.displayName;const N$=b.forwardRef(({className:t,...e},n)=>l.jsx(a$,{ref:n,className:ce("text-sm font-semibold",t),...e}));N$.displayName=a$.displayName;const A$=b.forwardRef(({className:t,...e},n)=>l.jsx(s$,{ref:n,className:ce("text-sm opacity-90",t),...e}));A$.displayName=s$.displayName;function uQ(){const{toasts:t}=ML();return l.jsxs(oQ,{children:[t.map(function({id:e,title:n,description:r,action:i,...a}){return l.jsxs(j$,{...a,children:[l.jsxs("div",{className:"grid gap-1",children:[n&&l.jsx(N$,{children:n}),r&&l.jsx(A$,{children:r})]}),i,l.jsx(P$,{})]},e)}),l.jsx(E$,{})]})}var MO=["light","dark"],dQ="(prefers-color-scheme: dark)",hQ=b.createContext(void 0),fQ={setTheme:t=>{},themes:[]},pQ=()=>{var t;return(t=b.useContext(hQ))!=null?t:fQ};b.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:s,attrs:o,nonce:c})=>{let u=a==="system",d=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${o.map(g=>`'${g}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,h=i?MO.includes(a)&&a?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${a}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",f=(g,m=!1,v=!0)=>{let x=s?s[g]:g,w=m?g+"|| ''":`'${x}'`,y="";return i&&v&&!m&&MO.includes(g)&&(y+=`d.style.colorScheme = '${g}';`),n==="class"?m||x?y+=`c.add(${w})`:y+="null":x&&(y+=`d[s](n,${w})`),y},p=t?`!function(){${d}${f(t)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${u})){var t='${dQ}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f("dark")}}else{${f("light")}}}else if(e){${s?`var x=${JSON.stringify(s)};`:""}${f(s?"x[e]":"e",!0)}}${u?"":"else{"+f(a,!1,!1)+"}"}${h}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${e}');if(e){${s?`var x=${JSON.stringify(s)};`:""}${f(s?"x[e]":"e",!0)}}else{${f(a,!1,!1)};}${h}}catch(t){}}();`;return b.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:p}})});var mQ=t=>{switch(t){case"success":return yQ;case"info":return xQ;case"warning":return bQ;case"error":return wQ;default:return null}},gQ=Array(12).fill(0),vQ=({visible:t,className:e})=>D.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},D.createElement("div",{className:"sonner-spinner"},gQ.map((n,r)=>D.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),yQ=D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},D.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),bQ=D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},D.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),xQ=D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},D.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),wQ=D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},D.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),SQ=D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},D.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),D.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),kQ=()=>
515{let[t,e]=D.useState(document.hidden);return D.useEffect(()=>{let n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t},J_=1,_Q=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:n,...r}=t,i=typeof(t==null?void 0:t.id)=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:J_++,a=this.toasts.find(o=>o.id===i),s=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),a?this.toasts=this.toasts.map(o=>o.id===i?(this.publish({...o,...t,id:i,title:n}),{...o,...t,id:i,dismissible:s,title:n}):o):this.addToast({title:n,...r,dismissible:s,id:i}),i},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(e=>{this.subscribers.forEach(n=>n({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let n;e.loading!==void 0&&(n=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let r=t instanceof Promise?t:t(),i=n!==void 0,a,s=r.then(async c=>{if(a=["resolve",c],D.isValidElement(c))i=!1,this.create({id:n,type:"default",message:c});else if(TQ(c)&&!c.ok){i=!1;let u=typeof e.error=="function"?await e.error(`HTTP error! status: ${c.status}`):e.error,d=typeof e.description=="function"?await e.description(`HTTP error! status: ${c.status}`):e.description;this.create({id:n,type:"error",message:u,description:d})}else if(e.success!==void 0){i=!1;let u=typeof e.success=="function"?await e.success(c):e.success,d=typeof e.description=="function"?await e.description(c):e.description;this.create({id:n,type:"success",message:u,description:d})}}).catch(async c=>{if(a=["reject",c],e.error!==void 0){i=!1;let u=typeof e.error=="function"?await e.error(c):e.error,d=typeof e.description=="function"?await e.description(c):e.description;this.create({id:n,type:"error",message:u,description:d})}}).finally(()=>{var c;i&&(this.dismiss(n),n=void 0),(c=e.finally)==null||c.call(e)}),o=()=>new Promise((c,u)=>s.then(()=>a[0]==="reject"?u(a[1]):c(a[1])).catch(u));return typeof n!="string"&&typeof n!="number"?{unwrap:o}:Object.assign(n,{unwrap:o})},this.custom=(t,e)=>{let n=(e==null?void 0:e.id)||J_++;return this.create({jsx:t(n),id:n,...e}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Xr=new _Q,CQ=(t,e)=>{let n=(e==null?void 0:e.id)||J_++;return Xr.addToast({title:t,...e,id:n}),n},TQ=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",EQ=CQ,jQ=()=>Xr.toasts,PQ=()=>Xr.getActiveToasts(),Dn=Object.assign(EQ,{success:Xr.success,info:Xr.info,warning:Xr.warning,error:Xr.error,custom:Xr.custom,message:Xr.message,promise:Xr.promise,dismiss:Xr.dismiss,loading:Xr.loading},{getHistory:jQ,getToasts:PQ});function NQ(t,{insertAt:e}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}NQ(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
515left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
515:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);
515--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} 516`);function $v(t){return t.label!==void 0}var AQ=3,OQ="32px",RQ="16px",IO=4e3,DQ=356,MQ=14,IQ=20,LQ=200;function ma(...t){return t.filter(Boolean).join(" ")}function $Q(t){let[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}var FQ=t=>{var e,n,r,i,a,s,o,c,u,d,h;let{invert:f,toast:p,unstyled:g,interacting:m,setHeights:v,visibleToasts:x,heights:w,index:y,toasts:k,expanded:S,removeToast:_,defaultRichColors:C,closeButton:T,style:E,cancelButtonStyle:j,actionButtonStyle:P,className:M="",descriptionClassName:U="",duration:N,position:B,gap:$,loadingIcon:I,expandByDefault:R,classNames:z,icons:O,closeButtonAriaLabel:A="Close toast",pauseWhenPageIsHidden:L}
516=t,[V,Y]=D.useState(null),[Q,re]=D.useState(null),[J,ne]=D.useState(!1),[G,Z]=D.useState(!1),[ee,K]=D.useState(!1),[oe,W]=D.useState(!1),[H,q]=D.useState(!1),[te,he]=D.useState(0),[xe,De]=D.useState(0),ge=D.useRef(p.duration||N||IO),Re=D.useRef(null),Oe=D.useRef(null),ye=y===0,Ct=y+1<=x,le=p.type,Te=p.dismissible!==!1,Pe=p.className||"",st=p.descriptionClassName||"",Mt=D.useMemo(()=>w.findIndex(ie=>ie.toastId===p.id)||0,[w,p.id]),yn=D.useMemo(()=>{var ie;return(ie=p.closeButton)!=null?ie:T},[p.closeButton,T]),Kn=D.useMemo(()=>p.duration||N||IO,[p.duration,N]),an=D.useRef(0),He=D.useRef(0),hi=D.useRef(0),fi=D.useRef(null),[yr,Lf]=B.split("-"),ju=D.useMemo(()=>w.reduce((ie,je,Qe)=>Qe>=Mt?ie:ie+je.height,0),[w,Mt]),Pu=kQ(),Nu=p.invert||f,Qc=le==="loading";He.current=D.useMemo(()=>Mt*$+ju,[Mt,ju]),D.useEffect(()=>{ge.current=Kn},[Kn]),D.useEffect(()=>{ne(!0)},[]),D.useEffect(()=>{let ie=Oe.current;if(ie){let je=ie.getBoundingClientRect().height;return De(je),v(Qe=>[{toastId:p.id,height:je,position:p.position},...Qe]),()=>v(Qe=>Qe.filter(tt=>tt.toastId!==p.id))}},[v,p.id]),D.useLayoutEffect(()=>{if(!J)return;let ie=Oe.current,je=ie.style.height;ie.style.height="auto";let Qe=ie.getBoundingClientRect().height;ie.style.height=je,De(Qe),v(tt=>tt.find(se=>se.toastId===p.id)?tt.map(se=>se.toastId===p.id?{...se,height:Qe}:se):[{toastId:p.id,height:Qe,position:p.position},...tt])},[J,p.title,p.description,v,p.id]);let Li=D.useCallback(()=>{Z(!0),he(He.current),v(ie=>ie.filter(je=>je.toastId!==p.id)),setTimeout(()=>{_(p)},LQ)},[p,_,v,He]);D.useEffect(()=>{if(p.promise&&le==="loading"||p.duration===1/0||p.type==="loading")return;let ie;return S||m||L&&Pu?(()=>{if(hi.current<an.current){let je=new Date().getTime()-an.current;ge.current=ge.current-je}hi.current=new Date().getTime()})():ge.current!==1/0&&(an.current=new Date().getTime(),ie=setTimeout(()=>{var je;(je=p.onAutoClose)==null||je.call(p,p),Li()},ge.current)),()=>clearTimeout(ie)},[S,m,p,le,L,Pu,Li]),D.useEffect(()=>{p.delete&&Li()},[Li,p.delete]);function Au(){var ie,je,Qe;return O!=null&&O.loading?D.createElement("div",{className:ma(z==null?void 0:z.loader,(ie=p==null?void 0:p.classNames)==null?void 0:ie.loader,"sonner-loader"),"data-visible":le==="loading"},O.loading):I?D.createElement("div",{className:ma(z==null?void 0:z.loader,(je=p==null?void 0:p.classNames)==null?void 0:je.loader,"sonner-loader"),"data-visible":le==="loading"},I):D.createElement(vQ,{className:ma(z==null?void 0:z.loader,(Qe=p==null?void 0:p.classNames)==null?void 0:Qe.loader),visible:le==="loading"})}return D.createElement("li",{tabIndex:0,ref:Oe,className:ma(M,Pe,z==null?void 0:z.toast,(e=p==null?void 0:p.classNames)==null?void 0:e.toast,z==null?void 0:z.default,z==null?void 0:z[le],(n=p==null?void 0:p.classNames)==null?void 0:n[le]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:C,"data-styled":!(p.jsx||p.unstyled||g),"data-mounted":J,"data-promise":!!p.promise,"data-swiped":H,"data-removed":G,"data-visible":Ct,"data-y-position":yr,"data-x-position":Lf,"data-index":y,"data-front":ye,"data-swiping":ee,"data-dismissible":Te,"data-type":le,"data-invert":Nu,"data-swipe-out":oe,"data-swipe-direction":Q,"data-expanded":!!(S||R&&J),style:{"--index":y,"--toasts-before":y,"--z-index":k.length-y,"--offset":`${G?te:He.current}px`,"--initial-height":R?"auto":`${xe}px`,...E,...p.style},onDragEnd:()=>{K(!1),Y(null),fi.current=null},onPointerDown:ie=>{Qc||!Te||(Re.current=new Date,he(He.current),ie.target.setPointerCapture(ie.pointerId),ie.target.tagName!=="BUTTON"&&(K(!0),fi.current={x:ie.clientX,y:ie.clientY}))},onPointerUp:()=>{var ie,je,Qe,tt;if(oe||!Te)return;fi.current=null;let se=Number(((ie=Oe.current)==null?void 0:ie.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ne=Number(((je=Oe.current)==null?void 0:je.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ae=new Date().getTime()-((Qe=Re.current)==null?void 0:Qe.getTime()),Be=V==="x"?se:Ne,gt=Math.abs(Be)/Ae;if(Math.abs(Be)>=IQ||gt>.11){he(He.current),(tt=p.onDismiss)==null||tt.call(p,p),re(V==="x"?se>0?"right":"left":Ne>0?"down":"up"),Li(),W(!0),q(!1);return}K(!1),Y(null)},onPointerMove:ie=>{var je,Qe,tt,se;if(!fi.current||!Te||((je=window.getSelection())==null?void 0:je.toString().length)>0)return;let Ne=ie.clientY-fi.current.y,Ae=ie.clientX-fi.current.x,Be=(Qe=t.swipeDirections)!=null?Qe:$Q(B);!V&&(Math.abs(Ae)>1||Math.abs(Ne)>1)&&Y(Math.abs(Ae)>Math.abs(Ne)?"x":"y");let gt={x:0,y:0};V==="y"?(Be.includes("top")||Be.includes("bottom"))&&(Be.includes("top")&&Ne<0||Be.includes("bottom")&&Ne>0)&&(gt.y=Ne):V==="x"&&(Be.includes("left")||Be.includes("right"))&&(Be.includes("left")&&Ae<0||Be.includes("right")&&Ae>0)&&(gt.x=Ae),(Math.abs(gt.x)>0||Math.abs(gt.y)>0)&&q(!0),(tt=Oe.current)==null||tt.style.setProperty("--swipe-amount-x",`${gt.x}px`),(se=Oe.current)==null||se.style.setProperty("--swipe-amount-y",`${gt.y}px`)}},yn&&!p.jsx?D.createElement("button",{"aria-label":A,"data-disabled":Qc,"data-close-button":!0,onClick:Qc||!Te?()=>{}:()=>{var ie;Li(),(ie=p.onDismiss)==null||ie.call(p,p)},className:ma(z==null?void 0:z.closeButton,(i=p==null?void 0:p.classNames)==null?void 0:i.closeButton)},(a=O==null?void 0:O.close)!=null?a:SQ):null,p.jsx||b.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:D.createElement(D.Fragment,null,le||p.icon||p.promise?D.createElement("div",{"data-icon":"",className:ma(z==null?void 0:z.icon,(s=p==null?void 0:p.classNames)==null?void 0:s.icon)}
vendor: 5,970 bytes, line 516
516,p.promise||p.type==="loading"&&!p.icon?p.icon||Au():null,p.type!=="loading"?p.icon||(O==null?void 0:O[le])||mQ(le):null):null,D.createElement("div",{"data-content":"",className:ma(z==null?void 0:z.content,(o=p==null?void 0:p.classNames)==null?void 0:o.content)},D.createElement("div",{"data-title":"",className:ma(z==null?void 0:z.title,(c=p==null?void 0:p.classNames)==null?void 0:c.title)},typeof p.title=="function"?p.title():p.title),p.description?D.createElement("div",{"data-description":"",className:ma(U,st,z==null?void 0:z.description,(u=p==null?void 0:p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),b.isValidElement(p.cancel)?p.cancel:p.cancel&&$v(p.cancel)?D.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||j,onClick:ie=>{var je,Qe;$v(p.cancel)&&Te&&((Qe=(je=p.cancel).onClick)==null||Qe.call(je,ie),Li())},className:ma(z==null?void 0:z.cancelButton,(d=p==null?void 0:p.classNames)==null?void 0:d.cancelButton)},p.cancel.label):null,b.isValidElement(p.action)?p.action:p.action&&$v(p.action)?D.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||P,onClick:ie=>{var je,Qe;$v(p.action)&&((Qe=(je=p.action).onClick)==null||Qe.call(je,ie),!ie.defaultPrevented&&Li())},className:ma(z==null?void 0:z.actionButton,(h=p==null?void 0:p.classNames)==null?void 0:h.actionButton)},p.action.label):null))};function LO(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function BQ(t,e){let n={};return[t,e].forEach((r,i)=>{let a=i===1,s=a?"--mobile-offset":"--offset",o=a?RQ:OQ;function c(u){["top","right","bottom","left"].forEach(d=>{n[`${s}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${s}-${u}`]=o:n[`${s}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):c(o)}),n}var UQ=b.forwardRef(function(t,e){let{invert:n,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:s,className:o,offset:c,mobileOffset:u,theme:d="light",richColors:h,duration:f,style:p,visibleToasts:g=AQ,toastOptions:m,dir:v=LO(),gap:x=MQ,loadingIcon:w,icons:y,containerAriaLabel:k="Notifications",pauseWhenPageIsHidden:S}=t,[_,C]=D.useState([]),T=D.useMemo(()=>Array.from(new Set([r].concat(_.filter(L=>L.position).map(L=>L.position)))),[_,r]),[E,j]=D.useState([]),[P,M]=D.useState(!1),[U,N]=D.useState(!1),[B,$]=D.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),I=D.useRef(null),R=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),z=D.useRef(null),O=D.useRef(!1),A=D.useCallback(L=>{C(V=>{var Y;return(Y=V.find(Q=>Q.id===L.id))!=null&&Y.delete||Xr.dismiss(L.id),V.filter(({id:Q})=>Q!==L.id)})},[]);return D.useEffect(()=>Xr.subscribe(L=>{if(L.dismiss){C(V=>V.map(Y=>Y.id===L.id?{...Y,delete:!0}:Y));return}setTimeout(()=>{RL.flushSync(()=>{C(V=>{let Y=V.findIndex(Q=>Q.id===L.id);return Y!==-1?[...V.slice(0,Y),{...V[Y],...L},...V.slice(Y+1)]:[L,...V]})})})}),[]),D.useEffect(()=>{if(d!=="system"){$(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?$("dark"):$("light")),typeof window>"u")return;let L=window.matchMedia("(prefers-color-scheme: dark)");try{L.addEventListener("change",({matches:V})=>{$(V?"dark":"light")})}catch{L.addListener(({matches:Y})=>{try{$(Y?"dark":"light")}catch(Q){console.error(Q)}})}},[d]),D.useEffect(()=>{_.length<=1&&M(!1)},[_]),D.useEffect(()=>{let L=V=>{var Y,Q;i.every(re=>V[re]||V.code===re)&&(M(!0),(Y=I.current)==null||Y.focus()),V.code==="Escape"&&(document.activeElement===I.current||(Q=I.current)!=null&&Q.contains(document.activeElement))&&M(!1)};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[i]),D.useEffect(()=>{if(I.current)return()=>{z.current&&(z.current.focus({preventScroll:!0}),z.current=null,O.current=!1)}},[I.current]),D.createElement("section",{ref:e,"aria-label":`${k} ${R}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},T.map((L,V)=>{var Y;let[Q,re]=L.split("-");return _.length?D.createElement("ol",{key:L,dir:v==="auto"?LO():v,tabIndex:-1,ref:I,className:o,"data-sonner-toaster":!0,"data-theme":B,"data-y-position":Q,"data-lifted":P&&_.length>1&&!a,"data-x-position":re,style:{"--front-toast-height":`${((Y=E[0])==null?void 0:Y.height)||0}px`,"--width":`${DQ}px`,"--gap":`${x}px`,...p,...BQ(c,u)},onBlur:J=>{O.current&&!J.currentTarget.contains(J.relatedTarget)&&(O.current=!1,z.current&&(z.current.focus({preventScroll:!0}),z.current=null))},onFocus:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||O.current||(O.current=!0,z.current=J.relatedTarget)},onMouseEnter:()=>M(!0),onMouseMove:()=>M(!0),onMouseLeave:()=>{U||M(!1)},onDragEnd:()=>M(!1),onPointerDown:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||N(!0)},onPointerUp:()=>N(!1)},_.filter(J=>!J.position&&V===0||J.position===L).map((J,ne)=>{var G,Z;return D.createElement(FQ,{key:J.id,icons:y,index:ne,toast:J,defaultRichColors:h,duration:(G=m==null?void 0:m.duration)!=null?G:f,className:m==null?void 0:m.className,descriptionClassName:m==null?void 0:m.descriptionClassName,invert:n,visibleToasts:g,closeButton:(Z=m==null?void 0:m.closeButton)!=null?Z:s,interacting:U,position:L,style:m==null?void 0:m.style,unstyled:m==null?void 0:m.unstyled,classNames:m==null?void 0:m.classNames,cancelButtonStyle:m==null?void 0:m.cancelButtonStyle,actionButtonStyle:m==null?void 0:m.actionButtonStyle,removeToast:A,toasts:_.filter(ee=>ee.position==J.position),heights:E.filter(ee=>ee.position==J.position),setHeights:j,expandByDefault:a,gap:x,loadingIcon:w,exp
vendor: 5,166 bytes, line 516
516anded:P,pauseWhenPageIsHidden:S,swipeDirections:t.swipeDirections})})):null}))});const zQ=({...t})=>{const{theme:e="system"}=pQ();return l.jsx(UQ,{theme:e,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t})};var WQ=XE[" useId ".trim().toString()]||(()=>{}),VQ=0;function gs(t){const[e,n]=b.useState(WQ());return Ln(()=>{t||n(r=>r??String(VQ++))},[t]),t||(e?`radix-${e}`:"")}const HQ=["top","right","bottom","left"],Pc=Math.min,xi=Math.max,P0=Math.round,Fv=Math.floor,vs=t=>({x:t,y:t}),qQ={left:"right",right:"left",bottom:"top",top:"bottom"},KQ={start:"end",end:"start"};function X_(t,e,n){return xi(t,Pc(e,n))}function yo(t,e){return typeof t=="function"?t(e):t}function bo(t){return t.split("-")[0]}function ff(t){return t.split("-")[1]}function Y2(t){return t==="x"?"y":"x"}function J2(t){return t==="y"?"height":"width"}const GQ=new Set(["top","bottom"]);function hs(t){return GQ.has(bo(t))?"y":"x"}function X2(t){return Y2(hs(t))}function YQ(t,e,n){n===void 0&&(n=!1);const r=ff(t),i=X2(t),a=J2(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(s=N0(s)),[s,N0(s)]}function JQ(t){const e=N0(t);return[Z_(t),e,Z_(e)]}function Z_(t){return t.replace(/start|end/g,e=>KQ[e])}const $O=["left","right"],FO=["right","left"],XQ=["top","bottom"],ZQ=["bottom","top"];function QQ(t,e,n){switch(t){case"top":case"bottom":return n?e?FO:$O:e?$O:FO;case"left":case"right":return e?XQ:ZQ;default:return[]}}function eee(t,e,n,r){const i=ff(t);let a=QQ(bo(t),n==="start",r);return i&&(a=a.map(s=>s+"-"+i),e&&(a=a.concat(a.map(Z_)))),a}function N0(t){return t.replace(/left|right|bottom|top/g,e=>qQ[e])}function tee(t){return{top:0,right:0,bottom:0,left:0,...t}}function O$(t){return typeof t!="number"?tee(t):{top:t,right:t,bottom:t,left:t}}function A0(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function BO(t,e,n){let{reference:r,floating:i}=t;const a=hs(e),s=X2(e),o=J2(s),c=bo(e),u=a==="y",d=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,f=r[o]/2-i[o]/2;let p;switch(c){case"top":p={x:d,y:r.y-i.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:h};break;case"left":p={x:r.x-i.width,y:h};break;default:p={x:r.x,y:r.y}}switch(ff(e)){case"start":p[s]-=f*(n&&u?-1:1);break;case"end":p[s]+=f*(n&&u?-1:1);break}return p}const nee=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:s}=n,o=a.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(e));let u=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:h}=BO(u,r,c),f=r,p={},g=0;for(let m=0;m<o.length;m++){const{name:v,fn:x}=o[m],{x:w,y,data:k,reset:S}=await x({x:d,y:h,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:u,platform:s,elements:{reference:t,floating:e}});d=w??d,h=y??h,p={...p,[v]:{...p[v],...k}},S&&g<=50&&(g++,typeof S=="object"&&(S.placement&&(f=S.placement),S.rects&&(u=S.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):S.rects),{x:d,y:h}=BO(u,f,c)),m=-1)}return{x:d,y:h,placement:f,strategy:i,middlewareData:p}};async function Sm(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:a,rects:s,elements:o,strategy:c}=t,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:f=!1,padding:p=0}=yo(e,t),g=O$(p),v=o[f?h==="floating"?"reference":"floating":h],x=A0(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(v)))==null||n?v:v.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(o.floating)),boundary:u,rootBoundary:d,strategy:c})),w=h==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,y=await(a.getOffsetParent==null?void 0:a.getOffsetParent(o.floating)),k=await(a.isElement==null?void 0:a.isElement(y))?await(a.getScale==null?void 0:a.getScale(y))||{x:1,y:1}:{x:1,y:1},S=A0(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:w,offsetParent:y,strategy:c}):w);return{top:(x.top-S.top+g.top)/k.y,bottom:(S.bottom-x.bottom+g.bottom)/k.y,left:(x.left-S.left+g.left)/k.x,right:(S.right-x.right+g.right)/k.x}}const ree=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:a,platform:s,elements:o,middlewareData:c}=e,{element:u,padding:d=0}=yo(t,e)||{};if(u==null)return{};const h=O$(d),f={x:n,y:r},p=X2(i),g=J2(p),m=await s.getDimensions(u),v=p==="y",x=v?"top":"left",w=v?"bottom":"right",y=v?"clientHeight":"clientWidth",k=a.reference[g]+a.reference[p]-f[p]-a.floating[g],S=f[p]-a.reference[p],_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let C=_?_[y]:0;(!C||!await(s.isElement==null?void 0:s.isElement(_)))&&(C=o.floating[y]||a.floating[g]);
vendor: 19,656 bytes, line 516
516const T=k/2-S/2,E=C/2-m[g]/2-1,j=Pc(h[x],E),P=Pc(h[w],E),M=j,U=C-m[g]-P,N=C/2-m[g]/2+T,B=X_(M,N,U),$=!c.arrow&&ff(i)!=null&&N!==B&&a.reference[g]/2-(N<M?j:P)-m[g]/2<0,I=$?N<M?N-M:N-U:0;return{[p]:f[p]+I,data:{[p]:B,centerOffset:N-B-I,...$&&{alignmentOffset:I}},reset:$}}}),iee=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:a,rects:s,initialPlacement:o,platform:c,elements:u}=e,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...v}=yo(t,e);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const x=bo(i),w=hs(o),y=bo(o)===o,k=await(c.isRTL==null?void 0:c.isRTL(u.floating)),S=f||(y||!m?[N0(o)]:JQ(o)),_=g!=="none";!f&&_&&S.push(...eee(o,m,g,k));const C=[o,...S],T=await Sm(e,v),E=[];let j=((r=a.flip)==null?void 0:r.overflows)||[];if(d&&E.push(T[x]),h){const N=YQ(i,s,k);E.push(T[N[0]],T[N[1]])}if(j=[...j,{placement:i,overflows:E}],!E.every(N=>N<=0)){var P,M;const N=(((P=a.flip)==null?void 0:P.index)||0)+1,B=C[N];if(B&&(!(h==="alignment"?w!==hs(B):!1)||j.every(R=>R.overflows[0]>0&&hs(R.placement)===w)))return{data:{index:N,overflows:j},reset:{placement:B}};let $=(M=j.filter(I=>I.overflows[0]<=0).sort((I,R)=>I.overflows[1]-R.overflows[1])[0])==null?void 0:M.placement;if(!$)switch(p){case"bestFit":{var U;const I=(U=j.filter(R=>{if(_){const z=hs(R.placement);return z===w||z==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(z=>z>0).reduce((z,O)=>z+O,0)]).sort((R,z)=>R[1]-z[1])[0])==null?void 0:U[0];I&&($=I);break}case"initialPlacement":$=o;break}if(i!==$)return{reset:{placement:$}}}return{}}}};function UO(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function zO(t){return HQ.some(e=>t[e]>=0)}const aee=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=yo(t,e);switch(r){case"referenceHidden":{const a=await Sm(e,{...i,elementContext:"reference"}),s=UO(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:zO(s)}}}case"escaped":{const a=await Sm(e,{...i,altBoundary:!0}),s=UO(a,n.floating);return{data:{escapedOffsets:s,escaped:zO(s)}}}default:return{}}}}},R$=new Set(["left","top"]);async function see(t,e){const{placement:n,platform:r,elements:i}=t,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=bo(n),o=ff(n),c=hs(n)==="y",u=R$.has(s)?-1:1,d=a&&c?-1:1,h=yo(e,t);let{mainAxis:f,crossAxis:p,alignmentAxis:g}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return o&&typeof g=="number"&&(p=o==="end"?g*-1:g),c?{x:p*d,y:f*u}:{x:f*u,y:p*d}}const oee=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:a,placement:s,middlewareData:o}=e,c=await see(e,t);return s===((n=o.offset)==null?void 0:n.placement)&&(r=o.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:a+c.y,data:{...c,placement:s}}}}},cee=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:a=!0,crossAxis:s=!1,limiter:o={fn:v=>{let{x,y:w}=v;return{x,y:w}}},...c}=yo(t,e),u={x:n,y:r},d=await Sm(e,c),h=hs(bo(i)),f=Y2(h);let p=u[f],g=u[h];if(a){const v=f==="y"?"top":"left",x=f==="y"?"bottom":"right",w=p+d[v],y=p-d[x];p=X_(w,p,y)}if(s){const v=h==="y"?"top":"left",x=h==="y"?"bottom":"right",w=g+d[v],y=g-d[x];g=X_(w,g,y)}const m=o.fn({...e,[f]:p,[h]:g});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[f]:a,[h]:s}}}}}},lee=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:a,middlewareData:s}=e,{offset:o=0,mainAxis:c=!0,crossAxis:u=!0}=yo(t,e),d={x:n,y:r},h=hs(i),f=Y2(h);let p=d[f],g=d[h];const m=yo(o,e),v=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const y=f==="y"?"height":"width",k=a.reference[f]-a.floating[y]+v.mainAxis,S=a.reference[f]+a.reference[y]-v.mainAxis;p<k?p=k:p>S&&(p=S)}if(u){var x,w;const y=f==="y"?"width":"height",k=R$.has(bo(i)),S=a.reference[h]-a.floating[y]+(k&&((x=s.offset)==null?void 0:x[h])||0)+(k?0:v.crossAxis),_=a.reference[h]+a.reference[y]+(k?0:((w=s.offset)==null?void 0:w[h])||0)-(k?v.crossAxis:0);g<S?g=S:g>_&&(g=_)}return{[f]:p,[h]:g}}}},uee=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:a,platform:s,elements:o}=e,{apply:c=()=>{},...u}=yo(t,e),d=await Sm(e,u),h=bo(i),f=ff(i),p=hs(i)==="y",{width:g,height:m}=a.floating;let v,x;h==="top"||h==="bottom"?(v=h,x=f===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(x=h,v=f==="end"?"top":"bottom");const w=m-d.top-d.bottom,y=g-d.left-d.right,k=Pc(m-d[v],w),S=Pc(g-d[x],y),_=!e.middlewareData.shift;let C=k,T=S;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(T=y),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(C=w),_&&!f){const j=xi(d.left,0),P=xi(d.right,0),M=xi(d.top,0),U=xi(d.bottom,0);p?T=g-2*(j!==0||P!==0?j+P:xi(d.left,d.right)):C=m-2*(M!==0||U!==0?M+U:xi(d.top,d.bottom))}await c({...e,availableWidth:T,availableHeight:C});const E=await s.getDimensions(o.floating);return g!==E.width||m!==E.height?{reset:{rects:!0}}:{}}}};function Ix(){return typeof window<"u"}function pf(t){return D$(t)?(t.nodeName||"").toLowerCase():"#document"}function ji(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Os(t){var e;return(e=(D$(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function D$(t){return Ix()?t instanceof Node||t instanceof ji(t).Node:!1}function Ja(t){return Ix()?t instanceof Element||t instanceof ji(t).Element:!1}function Cs(t){return Ix()?t instanceof HTMLElement||t instanceof ji(t).HTMLElement:!1}function WO(t){return!Ix()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ji(t).ShadowRoot}const dee=new Set(["inline","contents"]);function Vg(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Xa(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!dee.has(i)}const hee=new Set(["table","td","th"]);function fee(t){return hee.has(pf(t))}const pee=[":popover-open",":modal"];function Lx(t){return pee.some(e=>{try{return t.matches(e)}catch{return!1}})}const mee=["transform","translate","scale","rotate","perspective"],gee=["transform","translate","scale","rotate","perspective","filter"],vee=["paint","layout","strict","content"];function Z2(t){const e=Q2(),n=Ja(t)?Xa(t):t;return mee.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||gee.some(r=>(n.willChange||"").includes(r))||vee.some(r=>(n.contain||"").includes(r))}function yee(t){let e=Nc(t);for(;Cs(e)&&!hh(e);){if(Z2(e))return e;if(Lx(e))return null;e=Nc(e)}return null}function Q2(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const bee=new Set(["html","body","#document"]);function hh(t){return bee.has(pf(t))}function Xa(t){return ji(t).getComputedStyle(t)}function $x(t){return Ja(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Nc(t){if(pf(t)==="html")return t;const e=t.assignedSlot||t.parentNode||WO(t)&&t.host||Os(t);return WO(e)?e.host:e}function M$(t){const e=Nc(t);return hh(e)?t.ownerDocument?t.ownerDocument.body:t.body:Cs(e)&&Vg(e)?e:M$(e)}function km(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=M$(t),a=i===((r=t.ownerDocument)==null?void 0:r.body),s=ji(i);if(a){const o=Q_(s);return e.concat(s,s.visualViewport||[],Vg(i)?i:[],o&&n?km(o):[])}return e.concat(i,km(i,[],n))}function Q_(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function I$(t){const e=Xa(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Cs(t),a=i?t.offsetWidth:n,s=i?t.offsetHeight:r,o=P0(n)!==a||P0(r)!==s;return o&&(n=a,r=s),{width:n,height:r,$:o}}function ej(t){return Ja(t)?t:t.contextElement}function Ad(t){const e=ej(t);if(!Cs(e))return vs(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:a}=I$(e);let s=(a?P0(n.width):n.width)/r,o=(a?P0(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!o||!Number.isFinite(o))&&(o=1),{x:s,y:o}}const xee=vs(0);function L$(t){const e=ji(t);return!Q2()||!e.visualViewport?xee:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function wee(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==ji(t)?!1:e}function eu(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),a=ej(t);let s=vs(1);e&&(r?Ja(r)&&(s=Ad(r)):s=Ad(t));const o=wee(a,n,r)?L$(a):vs(0);let c=(i.left+o.x)/s.x,u=(i.top+o.y)/s.y,d=i.width/s.x,h=i.height/s.y;if(a){const f=ji(a),p=r&&Ja(r)?ji(r):r;let g=f,m=Q_(g);for(;m&&r&&p!==g;){const v=Ad(m),x=m.getBoundingClientRect(),w=Xa(m),y=x.left+(m.clientLeft+parseFloat(w.paddingLeft))*v.x,k=x.top+(m.clientTop+parseFloat(w.paddingTop))*v.y;c*=v.x,u*=v.y,d*=v.x,h*=v.y,c+=y,u+=k,g=ji(m),m=Q_(g)}}return A0({width:d,height:h,x:c,y:u})}function tj(t,e){const n=$x(t).scrollLeft;return e?e.left+n:eu(Os(t)).left+n}function $$(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=r.left+e.scrollLeft-(n?0:tj(t,r)),a=r.top+e.scrollTop;return{x:i,y:a}}function See(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const a=i==="fixed",s=Os(r),o=e?Lx(e.floating):!1;if(r===s||o&&a)return n;let c={scrollLeft:0,scrollTop:0},u=vs(1);const d=vs(0),h=Cs(r);if((h||!h&&!a)&&((pf(r)!=="body"||Vg(s))&&(c=$x(r)),Cs(r))){const p=eu(r);u=Ad(r),d.x=p.x+r.clientLeft,d.y=p.y+r.clientTop}const f=s&&!h&&!a?$$(s,c,!0):vs(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+f.x,y:n.y*u.y-c.scrollTop*u.y+d.y+f.y}}function kee(t){return Array.from(t.getClientRects())}function _ee(t){const e=Os(t),n=$x(t),r=t.ownerDocument.body,i=xi(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),a=xi(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+tj(t);const o=-n.scrollTop;return Xa(r).direction==="rtl"&&(s+=xi(e.clientWidth,r.clientWidth)-i),{width:i,height:a,x:s,y:o}}function Cee(t,e){const n=ji(t),r=Os(t),i=n.visualViewport;let a=r.clientWidth,s=r.clientHeight,o=0,c=0;if(i){a=i.width,s=i.height;const u=Q2();(!u||u&&e==="fixed")&&(o=i.offsetLeft,c=i.offsetTop)}return{width:a,height:s,x:o,y:c}}const Tee=new Set(["absolute","fixed"]);function Eee(t,e){const n=eu(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,a=Cs(t)?Ad(t):vs(1),s=t.clientWidth*a.x,o=t.clientHeight*a.y,c=i*a.x,u=r*a.y;return{width:s,height:o,x:c,y:u}}function VO(t,e,n){let r;if(e==="viewport")r=Cee(t,n);else if(e==="document")r=_ee(Os(t));else if(Ja(e))r=Eee(e,n);else{const i=L$(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return A0(r)}function F$(t,e){const n=Nc(t);return n===e||!Ja(n)||hh(n)?!1:Xa(n).position==="fixed"||F$(n,e)}function jee(t,e){const n=e.get(t);if(n)return n;let r=km(t,[],!1).filter(o=>Ja(o)&&pf(o)!=="body"),i=null;const a=Xa(t).position==="fixed";let s=a?Nc(t):t;for(;Ja(s)&&!hh(s);){const o=Xa(s),c=Z2(s);!c&&o.position==="fixed"&&(i=null),(a?!c&&!i:!c&&o.position==="static"&&!!i&&Tee.has(i.position)||Vg(s)&&!c&&F$(t,s))?r=r.filter(d=>d!==s):i=o,s=Nc(s)}return e.set(t,r),r}function Pee(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?Lx(e)?[]:jee(e,this._c):[].concat(n),r],o=s[0],c=s.reduce((u,d)=>{const h=VO(e,d,i);return u.top=xi(h.top,u.top),u.right=Pc(h.right,u.right),u.bottom=Pc(h.bottom,u.bottom),u.left=xi(h.left,u.left),u},VO(e,o,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Nee(t){const{width:e,height:n}=I$(t);return{width:e,height:n}}function Aee(t,e,n){const r=Cs(e),i=Os(e),a=n==="fixed",s=eu(t,!0,a,e);let o={scrollLeft:0,scrollTop:0};const c=vs(0);function u(){c.x=tj(i)}if(r||!r&&!a)if((pf(e)!=="body"||Vg(i))&&(o=$x(e)),r){const p=eu(e,!0,a,e);c.x=p.x+e.clientLeft,c.y=p.y+e.clientTop}else i&&u();a&&!r&&i&&u();const d=i&&!r&&!a?$$(i,o):vs(0),h=s.left+o.scrollLeft-c.x-d.x,f=s.top+o.scrollTop-c.y-d.y;return{x:h,y:f,width:s.width,height:s.height}}function dS(t){return Xa(t).position==="static"}function HO(t,e){if(!Cs(t)||Xa(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Os(t)===n&&(n=n.ownerDocument.body),n}function B$(t,e){const n=ji(t);if(Lx(t))return n;if(!Cs(t)){let i=Nc(t);for(;i&&!hh(i);){if(Ja(i)&&!dS(i))return i;i=Nc(i)}return n}let r=HO(t,e);for(;r&&fee(r)&&dS(r);)r=HO(r,e);return r&&hh(r)&&dS(r)&&!Z2(r)?n:r||yee(t)||n}const Oee=async function(t){const e=this.getOffsetParent||B$,n=this.getDimensions,r=await n(t.floating);return{reference:Aee(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ree(t){return Xa(t).direction==="rtl"}const Dee={convertOffsetParentRelativeRectToViewportRelativeRect:See,getDocumentElement:Os,getClippingRect:Pee,getOffsetParent:B$,getElementRects:Oee,getClientRects:kee,getDimensions:Nee,getScale:Ad,isElement:Ja,isRTL:Ree};function U$(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Mee(t,e){let n=null,r;const i=Os(t);function a(){var o;clearTimeout(r),(o=n)==null||o.disconnect(),n=null}function s(o,c){o===void 0&&(o=!1),c===void 0&&(c=1),a();const u=t.getBoundingClientRect(),{left:d,top:h,width:f,height:p}=u;if(o||e(),!f||!p)return;const g=Fv(h),m=Fv(i.clientWidth-(d+f)),v=Fv(i.clientHeight-(h+p)),x=Fv(d),y={rootMargin:-g+"px "+-m+"px "+-v+"px "+-x+"px",threshold:xi(0,Pc(1,c))||1};let k=!0;function S(_){const C=_[0].intersectionRatio;if(C!==c){if(!k)return s();C?s(!1,C):r=setTimeout(()=>{s(!1,1e-7)},1e3)}C===1&&!U$(u,t.getBoundingClientRect())&&s(),k=!1}try{n=new IntersectionObserver(S,{...y,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,y)}n.observe(t)}return s(!0),a}function Iee(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=ej(t),d=i||a?[...u?km(u):[],...km(e)]:[];d.forEach(x=>{i&&x.addEventListener("scroll",n,{passive:!0}),a&&x.addEventListener("resize",n)});const h=u&&o?Mee(u,n):null;let f=-1,p=null;s&&(p=new ResizeObserver(x=>{let[w]=x;w&&w.target===u&&p&&(p.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var y;(y=p)==null||y.observe(e)})),n()}),u&&!c&&p.observe(u),p.observe(e));let g,m=c?eu(t):null;c&&v();function v(){const x=eu(t);m&&!U$(m,x)&&n(),m=x,g=requestAnimationFrame(v)}return n(),()=>{var x;d.forEach(w=>{i&&w.removeEventListener("scroll",n),a&&w.removeEventListener("resize",n)}),h==null||h(),(x=p)==null||x.disconnect(),p=null,c&&cancelAnimationFrame(g)}}const Lee=oee,$ee=cee,Fee=iee,Bee=uee,Uee=aee,qO=ree,zee=lee,Wee=(t,e,n)=>{const r=new Map,i={platform:Dee,...n},a={...i.platform,_c:r};return nee(t,e,{...i,platform:a})};var Vee=typeof document<"u",Hee=function(){},Iy=Vee?b.useLayoutEffect:Hee;function O0(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!O0(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const a=i[r];if(!(a==="_owner"&&t.$$typeof)&&!O0(t[a],e[a]))return!1}return!0}return t!==t&&e!==e}function z$(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function KO(t,e){const n=z$(t);return Math.round(e*n)/n}function hS(t){const e=b.useRef(t);return Iy(()=>{e.current=t}),e}function qee(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:s}={},transform:o=!0,whileElementsMounted:c,open:u}=t,[d,h]=b.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,p]=b.useState(r);O0(f,r)||p(r);const[g,m]=b.useState(null),[v,x]=b.useState(null),w=b.useCallback(R=>{R!==_.current&&(_.current=R,m(R))},[]),y=b.useCallback(R=>{R!==C.current&&(C.current=R,x(R))},[]),k=a||g,S=s||v,_=b.useRef(null),C=b.useRef(null),T=b.useRef(d),E=c!=null,j=hS(c),P=hS(i),M=hS(u),U=b.useCallback(()=>{if(!_.current||!C.current)return;const R={placement:e,strategy:n,middleware:f};P.current&&(R.platform=P.current),Wee(_.current,C.current,R).then(z=>{const O={...z,isPositioned:M.current!==!1};N.current&&!O0(T.current,O)&&(T.current=O,Fc.flushSync(()=>{h(O)}))})},[f,e,n,P,M]);Iy(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,h(R=>({...R,isPositioned:!1})))},[u]);const N=b.useRef(!1);Iy(()=>(N.current=!0,()=>{N.current=!1}),[]),Iy(()=>{if(k&&(_.current=k),S&&(C.current=S),k&&S){if(j.current)return j.current(k,S,U);U()}},[k,S,U,j,E]);const B=b.useMemo(()=>({reference:_,floating:C,setReference:w,setFloating:y}),[w,y]),$=b.useMemo(()=>({reference:k,floating:S}),[k,S]),I=b.useMemo(()=>{const R={position:n,left:0,top:0};if(!$.floating)return R;const z=KO($.floating,d.x),O=KO($.floating,d.y);return o?{...R,transform:"translate("+z+"px, "+O+"px)",...z$($.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:z,top:O}},[n,o,$.floating,d.x,d.y]);return b.useMemo(()=>({...d,update:U,refs:B,elements:$,floatingStyles:I}),[d,U,B,$,I])}const Kee=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?qO({element:r.current,padding:i}).fn(n):{}:r?qO({element:r,padding:i}).fn(n):{}}}},Gee=(t,e)=>({...Lee(t),options:[t,e]}),Yee=(t,e)=>({...$ee(t),options:[t,e]}),Jee=(t,e)=>({...zee(t),options:[t,e]}),Xee=(t,e)=>({...Fee(t),options:[t,e]}),Zee=(t,e)=>({...Bee(t),options:[t,e]}),Qee=(t,e)=>({...Uee(t),options:[t,e]}),ete=(t,e)=>({...Kee(t),options:[t,e]});var tte="Arrow",W$=b.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...a}=t;return l.jsx(Ke.svg,{...a,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});W$.displayName=tte;var nte=W$;function nj(t){const[e,n]=b.useState(void 0);return Ln(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const a=i[0];let s,o;if("borderBoxSize"in a){const c=a.borderBoxSize,u=Array.isArray(c)?c[0]:c;s=u.inlineSize,o=u.blockSize}else s=t.offsetWidth,o=t.offsetHeight;n({width:s,height:o})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var rj="Popper",[V$,mf]=Yr(rj),[rte,H$]=V$(rj),q$=t=>{const{__scopePopper:e,children:n}=t,[r,i]=b.useState(null);return l.jsx(rte,{scope:e,anchor:r,onAnchorChange:i,children:n})};q$.displayName=rj;var K$="PopperAnchor",G$=b.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,a=H$(K$,n),s=b.useRef(null),o=bt(e,s);return b.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:l.jsx(Ke.div,{...i,ref:o})});G$.displayName=K$;var ij="PopperContent",[ite,ate]=V$(ij),Y$=b.forwardRef((t,e)=>{var J,ne,G,Z,ee,K;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:a="center",alignOffset:s=0,arrowPadding:o=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:g,...m}=t,v=H$(ij,n),[x,w]=b.useState(null),y=bt(e,oe=>w(oe)),[k,S]=b.useState(null),_=nj(k),C=(_==null?void 0:_.width)??0,T=(_==null?void 0:_.he
vendor: 6,733 bytes, line 516
516ight)??0,E=r+(a!=="center"?"-"+a:""),j=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},P=Array.isArray(u)?u:[u],M=P.length>0,U={padding:j,boundary:P.filter(ote),altBoundary:M},{refs:N,floatingStyles:B,placement:$,isPositioned:I,middlewareData:R}=qee({strategy:"fixed",placement:E,whileElementsMounted:(...oe)=>Iee(...oe,{animationFrame:p==="always"}),elements:{reference:v.anchor},middleware:[Gee({mainAxis:i+T,alignmentAxis:s}),c&&Yee({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Jee():void 0,...U}),c&&Xee({...U}),Zee({...U,apply:({elements:oe,rects:W,availableWidth:H,availableHeight:q})=>{const{width:te,height:he}=W.reference,xe=oe.floating.style;xe.setProperty("--radix-popper-available-width",`${H}px`),xe.setProperty("--radix-popper-available-height",`${q}px`),xe.setProperty("--radix-popper-anchor-width",`${te}px`),xe.setProperty("--radix-popper-anchor-height",`${he}px`)}}),k&&ete({element:k,padding:o}),cte({arrowWidth:C,arrowHeight:T}),f&&Qee({strategy:"referenceHidden",...U})]}),[z,O]=Z$($),A=Wn(g);Ln(()=>{I&&(A==null||A())},[I,A]);const L=(J=R.arrow)==null?void 0:J.x,V=(ne=R.arrow)==null?void 0:ne.y,Y=((G=R.arrow)==null?void 0:G.centerOffset)!==0,[Q,re]=b.useState();return Ln(()=>{x&&re(window.getComputedStyle(x).zIndex)},[x]),l.jsx("div",{ref:N.setFloating,"data-radix-popper-content-wrapper":"",style:{...B,transform:I?B.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[(Z=R.transformOrigin)==null?void 0:Z.x,(ee=R.transformOrigin)==null?void 0:ee.y].join(" "),...((K=R.hide)==null?void 0:K.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:l.jsx(ite,{scope:n,placedSide:z,onArrowChange:S,arrowX:L,arrowY:V,shouldHideArrow:Y,children:l.jsx(Ke.div,{"data-side":z,"data-align":O,...m,ref:y,style:{...m.style,animation:I?void 0:"none"}})})})});Y$.displayName=ij;var J$="PopperArrow",ste={top:"bottom",right:"left",bottom:"top",left:"right"},X$=b.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,a=ate(J$,r),s=ste[a.placedSide];return l.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:l.jsx(nte,{...i,ref:n,style:{...i.style,display:"block"}})})});X$.displayName=J$;function ote(t){return t!==null}var cte=t=>({name:"transformOrigin",options:t,fn(e){var v,x,w;const{placement:n,rects:r,middlewareData:i}=e,s=((v=i.arrow)==null?void 0:v.centerOffset)!==0,o=s?0:t.arrowWidth,c=s?0:t.arrowHeight,[u,d]=Z$(n),h={start:"0%",center:"50%",end:"100%"}[d],f=(((x=i.arrow)==null?void 0:x.x)??0)+o/2,p=(((w=i.arrow)==null?void 0:w.y)??0)+c/2;let g="",m="";return u==="bottom"?(g=s?h:`${f}px`,m=`${-c}px`):u==="top"?(g=s?h:`${f}px`,m=`${r.floating.height+c}px`):u==="right"?(g=`${-c}px`,m=s?h:`${p}px`):u==="left"&&(g=`${r.floating.width+c}px`,m=s?h:`${p}px`),{data:{x:g,y:m}}}});function Z$(t){const[e,n="center"]=t.split("-");return[e,n]}var aj=q$,Fx=G$,sj=Y$,oj=X$,[Bx,tBe]=Yr("Tooltip",[mf]),Ux=mf(),Q$="TooltipProvider",lte=700,eC="tooltip.open",[ute,cj]=Bx(Q$),e9=t=>{const{__scopeTooltip:e,delayDuration:n=lte,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=t,s=b.useRef(!0),o=b.useRef(!1),c=b.useRef(0);return b.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),l.jsx(ute,{scope:e,isOpenDelayedRef:s,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(c.current),s.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:o,onPointerInTransitChange:b.useCallback(u=>{o.current=u},[]),disableHoverableContent:i,children:a})};e9.displayName=Q$;var _m="Tooltip",[dte,zx]=Bx(_m),t9=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:s,delayDuration:o}=t,c=cj(_m,t.__scopeTooltip),u=Ux(e),[d,h]=b.useState(null),f=gs(),p=b.useRef(0),g=s??c.disableHoverableContent,m=o??c.delayDuration,v=b.useRef(!1),[x,w]=ks({prop:r,defaultProp:i??!1,onChange:C=>{C?(c.onOpen(),document.dispatchEvent(new CustomEvent(eC))):c.onClose(),a==null||a(C)},caller:_m}),y=b.useMemo(()=>x?v.current?"delayed-open":"instant-open":"closed",[x]),k=b.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v.current=!1,w(!0)},[w]),S=b.useCallback(()=>{window.clearTimeout(p.current),p.current=0,w(!1)},[w]),_=b.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{v.current=!0,w(!0),p.current=0},m)},[m,w]);return b.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),l.jsx(aj,{...u,children:l.jsx(dte,{scope:e,contentId:f,open:x,stateAttribute:y,trigger:d,onTriggerChange:h,onTriggerEnter:b.useCallback(()=>{c.isOpenDelayedRef.current?_():k()},[c.isOpenDelayedRef,_,k]),onTriggerLeave:b.useCallback(()=>{g?S():(window.clearTimeout(p.current),p.current=0)},[S,g]),onOpen:k,onClose:S,disableHoverableContent:g,children:n})})};t9.displayName=_m;var tC="TooltipTrigger",n9=b.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=zx(tC,n),a=cj(tC,n),s=Ux(n),o=b.useRef(null),c=bt(e,o,i.onTriggerChange),u=b.useRef(!1),d=b.useRef(!1),h=b.useCallback(()=>u.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),l.jsx(Fx,{asChild:!0,...s,children:l.jsx(Ke.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:c,onPointerMove:Ie(t.onPointerMove,f=>{f.pointerType!=="touch"&&!d.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:Ie(t.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:Ie(t.onPointerDown,()=>{i.open&&i.onClose(),u.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Ie(t.onFocus,()=>{u.current||i.onOpen()}),onBlur:Ie(t.onBlur,i.onClose),onClick:Ie(t.onClick,i.onClose)})})});n9.displayName=tC;var hte="TooltipPortal",[nBe,fte]=Bx(hte,{forceMount:void 0}),fh="TooltipContent",r9=b.forwardRef((t,e)=>{const n=fte(fh,t.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...a}=t,s=zx(fh,t.__scopeTooltip);return l.jsx(ui,{present:r||s.open,children:s.disableHoverableContent?l.jsx(i9,{side:i,...a,ref:e}):l.jsx(pte,{side:i,...a,ref:e})})}),pte=b.forwardRef((t,e)=>{const n=zx(fh,t.__scopeTooltip),r=cj(fh,t.__scopeTooltip),i=b.useRef(null),a=bt(e,i),[s,o]=b.useState(null),{trigger:c,onClose:u}=n,d=i.current,{onPointerInTransitChange:h}=r,f=b.useCallback(()=>{o(null),h(!1)}
vendor: 4,207 bytes, line 516
516,[h]),p=b.useCallback((g,m)=>{const v=g.currentTarget,x={x:g.clientX,y:g.clientY},w=bte(x,v.getBoundingClientRect()),y=xte(x,w),k=wte(m.getBoundingClientRect()),S=kte([...y,...k]);o(S),h(!0)},[h]);return b.useEffect(()=>()=>f(),[f]),b.useEffect(()=>{if(c&&d){const g=v=>p(v,d),m=v=>p(v,c);return c.addEventListener("pointerleave",g),d.addEventListener("pointerleave",m),()=>{c.removeEventListener("pointerleave",g),d.removeEventListener("pointerleave",m)}}},[c,d,p,f]),b.useEffect(()=>{if(s){const g=m=>{const v=m.target,x={x:m.clientX,y:m.clientY},w=(c==null?void 0:c.contains(v))||(d==null?void 0:d.contains(v)),y=!Ste(x,s);w?f():y&&(f(),u())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[c,d,s,u,f]),l.jsx(i9,{...t,ref:a})}),[mte,gte]=Bx(_m,{isInside:!1}),vte=$L("TooltipContent"),i9=b.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:s,...o}=t,c=zx(fh,n),u=Ux(n),{onClose:d}=c;return b.useEffect(()=>(document.addEventListener(eC,d),()=>document.removeEventListener(eC,d)),[d]),b.useEffect(()=>{if(c.trigger){const h=f=>{const p=f.target;p!=null&&p.contains(c.trigger)&&d()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[c.trigger,d]),l.jsx(uf,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:h=>h.preventDefault(),onDismiss:d,children:l.jsxs(sj,{"data-state":c.stateAttribute,...u,...o,ref:e,style:{...o.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(vte,{children:r}),l.jsx(mte,{scope:n,isInside:!0,children:l.jsx(kX,{id:c.contentId,role:"tooltip",children:i||r})})]})})});r9.displayName=fh;var a9="TooltipArrow",yte=b.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=Ux(n);return gte(a9,n).isInside?null:l.jsx(oj,{...i,...r,ref:e})});yte.displayName=a9;function bte(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),a=Math.abs(e.left-t.x);switch(Math.min(n,r,i,a)){case a:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function xte(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function wte(t){const{top:e,right:n,bottom:r,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:r},{x:i,y:r}]}function Ste(t,e){const{x:n,y:r}=t;let i=!1;for(let a=0,s=e.length-1;a<e.length;s=a++){const o=e[a],c=e[s],u=o.x,d=o.y,h=c.x,f=c.y;d>r!=f>r&&n<(h-u)*(r-d)/(f-d)+u&&(i=!i)}return i}function kte(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),_te(e)}function _te(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const i=t[r];for(;e.length>=2;){const a=e[e.length-1],s=e[e.length-2];if((a.x-s.x)*(i.y-s.y)>=(a.y-s.y)*(i.x-s.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const i=t[r];for(;n.length>=2;){const a=n[n.length-1],s=n[n.length-2];if((a.x-s.x)*(i.y-s.y)>=(a.y-s.y)*(i.x-s.x))n.pop();else break}n.push(i)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var Cte=e9,Tte=t9,Ete=n9,s9=r9;const xp=Cte,Bv=Tte,Uv=Ete,wp=b.forwardRef(({className:t,sideOffset:e=4,...n},r)=>l.jsx(s9,{ref:r,sideOffset:e,className:ce("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
516de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n}));wp.displayName=s9.displayName;var Wx=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Vx=typeof window>"u"||"Deno"in globalThis;function Sa(){}function jte(t,e){return typeof t=="function"?t(e):t}function Pte(t){return typeof t=="number"&&t>=0&&t!==1/0}function Nte(t,e){return Math.max(t+(e||0)-Date.now(),0)}function nC(t,e){return typeof t=="function"?t(e):t}function Ate(t,e){return typeof t=="function"?t(e):t}function GO(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:s,stale:o}=t;if(s){if(r){if(e.queryHash!==lj(s,e.options))return!1}else if(!Tm(e.queryKey,s))return!1}if(n!=="all"){const c=e.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof o=="boolean"&&e.isStale()!==o||i&&i!==e.state.fetchStatus||a&&!a(e))}function YO(t,e){const{exact:n,status:r,predicate:i,mutationKey:a}=t;if(a){if(!e.options.mutationKey)return!1;if(n){if(Cm(e.options.mutationKey)!==Cm(a))return!1}else if(!Tm(e.options.mutationKey,a))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function lj(t,e){return((e==null?void 0:e.queryKeyHashFn)||Cm)(t)}function Cm(t){return JSON.stringify(t,(e,n)=>rC(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Tm(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>Tm(t[n],e[n])):!1}function o9(t,e){if(t===e)return t;const n=JO(t)&&JO(e);if(n||rC(t)&&rC(e)){const r=n?t:Object.keys(t),i=r.length,a=n?e:Object.keys(e),s=a.length,o=n?[]:{},c=new Set(r);let u=0;for(let d=0;d<s;d++){const h=n?d:a[d];(!n&&c.has(h)||n)&&t[h]===void 0&&e[h]===void 0?(o[h]=void 0,u++):(o[h]=o9(t[h],e[h]),o[h]===t[h]&&t[h]!==void 0&&u++)}return i===s&&u===i?t:o}return e}function JO(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function rC(t){if(!XO(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!XO(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function XO(t){return Object.prototype.toString.call(t)==="[object Object]"}function Ote(t){return new Promise(e=>{setTimeout(e,t)})}function Rte(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?o9(t,e):e}function Dte(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function Mte(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var uj=Symbol();function c9(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===uj?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var Dl,Jo,Kd,h8,Ite=(h8=class extends Wx{constructor(){super();Nt(this,Dl);Nt(this,Jo);Nt(this,Kd);dt(this,Kd,e=>{if(!Vx&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){ue(this,Jo)||this.setEventListener(ue(this,Kd))}onUnsubscribe(){var e;this.hasListeners()||((e=ue(this,Jo))==null||e.call(this),dt(this,Jo,void 0))}setEventListener(e){var n;dt(this,Kd,e),(n=ue(this,Jo))==null||n.call(this),dt(this,Jo,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){ue(this,Dl)!==e&&(dt(this,Dl,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof ue(this,Dl)=="boolean"?ue(this,Dl):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Dl=new WeakMap,Jo=new WeakMap,Kd=new WeakMap,h8),l9=new Ite,Gd,Xo,Yd,f8,Lte=(f8=class extends Wx{constructor(){super();Nt(this,Gd,!0);Nt(this,Xo);Nt(this,Yd);dt(this,Yd,e=>{if(!Vx&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){ue(this,Xo)||this.setEventListener(ue(this,Yd))}onUnsubscribe(){var e;this.hasListeners()||((e=ue(this,Xo))==null||e.call(this),dt(this,Xo,void 0))}setEventListener(e){var n;dt(this,Yd,e),(n=ue(this,Xo))==null||n.call(this),dt(this,Xo,e(this.setOnline.bind(this)))}setOnline(e){ue(this,Gd)!==e&&(dt(this,Gd,e),this.listeners.forEac
vendor: 13,761 bytes, line 516
516h(r=>{r(e)}))}isOnline(){return ue(this,Gd)}},Gd=new WeakMap,Xo=new WeakMap,Yd=new WeakMap,f8),R0=new Lte;function $te(){let t,e;const n=new Promise((i,a)=>{t=i,e=a});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),t(i)},n.reject=i=>{r({status:"rejected",reason:i}),e(i)},n}function Fte(t){return Math.min(1e3*2**t,3e4)}function u9(t){return(t??"online")==="online"?R0.isOnline():!0}var d9=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function fS(t){return t instanceof d9}function h9(t){let e=!1,n=0,r=!1,i;const a=$te(),s=m=>{var v;r||(f(new d9(m)),(v=t.abort)==null||v.call(t))},o=()=>{e=!0},c=()=>{e=!1},u=()=>l9.isFocused()&&(t.networkMode==="always"||R0.isOnline())&&t.canRun(),d=()=>u9(t.networkMode)&&t.canRun(),h=m=>{var v;r||(r=!0,(v=t.onSuccess)==null||v.call(t,m),i==null||i(),a.resolve(m))},f=m=>{var v;r||(r=!0,(v=t.onError)==null||v.call(t,m),i==null||i(),a.reject(m))},p=()=>new Promise(m=>{var v;i=x=>{(r||u())&&m(x)},(v=t.onPause)==null||v.call(t)}).then(()=>{var m;i=void 0,r||(m=t.onContinue)==null||m.call(t)}),g=()=>{if(r)return;let m;const v=n===0?t.initialPromise:void 0;try{m=v??t.fn()}catch(x){m=Promise.reject(x)}Promise.resolve(m).then(h).catch(x=>{var _;if(r)return;const w=t.retry??(Vx?0:3),y=t.retryDelay??Fte,k=typeof y=="function"?y(n,x):y,S=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,x);if(e||!S){f(x);return}n++,(_=t.onFail)==null||_.call(t,n,x),Ote(k).then(()=>u()?void 0:p()).then(()=>{e?f(x):g()})})};return{promise:a,cancel:s,continue:()=>(i==null||i(),a),cancelRetry:o,continueRetry:c,canStart:d,start:()=>(d()?g():p().then(g),a)}}var Bte=t=>setTimeout(t,0);function Ute(){let t=[],e=0,n=o=>{o()},r=o=>{o()},i=Bte;const a=o=>{e?t.push(o):i(()=>{n(o)})},s=()=>{const o=t;t=[],o.length&&i(()=>{r(()=>{o.forEach(c=>{n(c)})})})};return{batch:o=>{let c;e++;try{c=o()}finally{e--,e||s()}return c},batchCalls:o=>(...c)=>{a(()=>{o(...c)})},schedule:a,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{i=o}}}var Lr=Ute(),Ml,p8,f9=(p8=class{constructor(){Nt(this,Ml)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Pte(this.gcTime)&&dt(this,Ml,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Vx?1/0:5*60*1e3))}clearGcTimeout(){ue(this,Ml)&&(clearTimeout(ue(this,Ml)),dt(this,Ml,void 0))}},Ml=new WeakMap,p8),Jd,Il,Vi,Ll,kr,Rg,$l,_a,zs,m8,zte=(m8=class extends f9{constructor(e){super();Nt(this,_a);Nt(this,Jd);Nt(this,Il);Nt(this,Vi);Nt(this,Ll);Nt(this,kr);Nt(this,Rg);Nt(this,$l);dt(this,$l,!1),dt(this,Rg,e.defaultOptions),this.setOptions(e.options),this.observers=[],dt(this,Ll,e.client),dt(this,Vi,ue(this,Ll).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,dt(this,Jd,Vte(this.options)),this.state=e.state??ue(this,Jd),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=ue(this,kr))==null?void 0:e.promise}setOptions(e){this.options={...ue(this,Rg),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ue(this,Vi).remove(this)}setData(e,n){const r=Rte(this.state.data,e,this.options);return br(this,_a,zs).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){br(this,_a,zs).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=ue(this,kr))==null?void 0:r.promise;return(i=ue(this,kr))==null||i.cancel(e),n?n.then(Sa).catch(Sa):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ue(this,Jd))}isActive(){return this.observers.some(e=>Ate(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===uj||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>nC(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Nte(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=ue(this,kr))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=ue(this,kr))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),ue(this,Vi).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(ue(this,kr)&&(ue(this,$l)?ue(this,kr).cancel({revert:!0}):ue(this,kr).cancelRetry()),this.scheduleGc()),ue(this,Vi).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||br(this,_a,zs).call(this,{type:"invalidate"})}fetch(e,n){var u,d,h;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(ue(this,kr))return ue(this,kr).continueRetry(),ue(this,kr).promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(p=>p.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,i=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(dt(this,$l,!0),r.signal)})},a=()=>{const f=c9(this.options,n),g=(()=>{const m={client:ue(this,Ll),queryKey:this.queryKey,meta:this.meta};return i(m),m})();return dt(this,$l,!1),this.options.persister?this.options.persister(f,g,this):f(g)},o=(()=>{const f={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:ue(this,Ll),state:this.state,fetchFn:a};return i(f),f})();(u=this.options.behavior)==null||u.onFetch(o,this),dt(this,Il,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&br(this,_a,zs).call(this,{type:"fetch",meta:(h=o.fetchOptions)==null?void 0:h.meta});const c=f=>{var p,g,m,v;fS(f)&&f.silent||br(this,_a,zs).call(this,{type:"error",error:f}),fS(f)||((g=(p=ue(this,Vi).config).onError)==null||g.call(p,f,this),(v=(m=ue(this,Vi).config).onSettled)==null||v.call(m,this.state.data,f,this)),this.scheduleGc()};return dt(this,kr,h9({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var p,g,m,v;if(f===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(x){c(x);return}(g=(p=ue(this,Vi).config).onSuccess)==null||g.call(p,f,this),(v=(m=ue(this,Vi).config).onSettled)==null||v.call(m,f,this.state.error,this),this.scheduleGc()},onError:c,onFail:(f,p)=>{br(this,_a,zs).call(this,{type:"failed",failureCount:f,error:p})},onPause:()=>{br(this,_a,zs).call(this,{type:"pause"})},onContinue:()=>{br(this,_a,zs).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),ue(this,kr).start()}},Jd=new WeakMap,Il=new WeakMap,Vi=new WeakMap,Ll=new WeakMap,kr=new WeakMap,Rg=new WeakMap,$l=new WeakMap,_a=new WeakSet,zs=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Wte(r.data,this.options),fetchMeta:e.meta??null};case"success":return dt(this,Il,void 0),{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return fS(i)&&i.revert&&ue(this,Il)?{...ue(this,Il),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),Lr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),ue(this,Vi).notify({query:this,type:"updated",action:e})})},m8);function Wte(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:u9(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function Vte(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var cs,g8,Hte=(g8=class extends Wx{constructor(e={}){super();Nt(this,cs);this.config=e,dt(this,cs,new Map)}build(e,n,r){const i=n.queryKey,a=n.queryHash??lj(i,n);let s=this.get(a);return s||(s=new zte({client:e,queryKey:i,queryHash:a,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(s)),s}add(e){ue(this,cs).has(e.queryHash)||(ue(this,cs).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=ue(this,cs).get(e.queryHash);n&&(e.destroy(),n===e&&ue(this,cs).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Lr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return ue(this,cs).get(e)}getAll(){return[...ue(this,cs).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>GO(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>GO(e,r)):n}notify(e){Lr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Lr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Lr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},cs=new WeakMap,g8),ls,Dr,Fl,us,Lo,v8,qte=(v8=class extends f9{constructor(e){super();Nt(this,us);Nt(this,ls);Nt(this,Dr);Nt(this,Fl);this.mutationId=e.mutationId,dt(this,Dr,e.mutationCache),dt(this,ls,[]),this.state=e.state||Kte(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){ue(this,ls).includes(e)||(ue(this,ls).push(e),this.clearGcTimeout(),ue(this,Dr).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){dt(this,ls,ue(this,ls).filter(n=>n!==e)),this.scheduleGc(),ue(this,Dr).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){ue(this,ls).length||(this.state.status==="pending"?this.scheduleGc():ue(this,Dr).remove(this))}continue(){var e;return((e=ue(this,Fl))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var a,s,o,c,u,d,h,f,p,g,m,v,x,w,y,k,S,_,C,T;const n=()=>{br(this,us,Lo).call(this,{type:"continue"})};dt(this,Fl,h9({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(E,j)=>{br(this,us,Lo).call(this,{type:"failed",failureCount:E,error:j})},onPause:()=>{br(this,us,Lo).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ue(this,Dr).canRun(this)}));const r=this.state.status==="pending",i=!ue(this,Fl).canStart();try{if(r)n();else{br(this,us,Lo).call(this,{type:"pending",variables:e,isPaused:i}),await((s=(a=ue(this,Dr).config).onMutate)==null?void 0:s.call(a,e,this));const j=await((c=(o=this.options).onMutate)==null?void 0:c.call(o,e));j!==this.state.context&&br(this,us,Lo).call(this,{type:"pending",context:j,variables:e,isPaused:i})}const E=await ue(this,Fl).start();return await((d=(u=ue(this,Dr).config).onSuccess)==null?void 0:d.call(u,E,e,this.state.context,this)),await((f=(h=this.options).onSuccess)==null?void 0:f.call(h,E,e,this.state.context)),await((g=(p=ue(this,Dr).config).onSettled)==null?void 0:g.call(p,E,null,this.state.variables,this.state.context,this)),await((v=(m=this.options).onSettled)==null?void 0:v.call(m,E,null,e,this.state.context)),br(this,us,Lo).call(this,{type:"success",data:E}),E}catch(E){try{throw await((w=(x=ue(this,Dr).config).onError)==null?void 0:w.call(x,E,e,this.state.context,this)),await((k=(y=this.options).onError)==null?void 0:k.call(y,E,e,this.state.context)),await((_=(S=ue(this,Dr).config).onSettled)==null?void 0:_.call(S,void 0,E,this.state.variables,this.state.context,this)),await((T=(C=this.options).onSettled)==null?void 0:T.call(C,void 0,E,e,this.state.context)),E}finally{br(this,us,Lo).call(this,{type:"error",error:E})}}finally{ue(this,Dr).runNext(this)}}},ls=new WeakMap,Dr=new WeakMap,Fl=new WeakMap,us=new WeakSet,Lo=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Lr.batch(()=>
516{ue(this,ls).forEach(r=>{r.onMutationUpdate(e)}),ue(this,Dr).notify({mutation:this,type:"updated",action:e})})},v8);function Kte(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Js,Ca,Dg,y8,Gte=(y8=class extends Wx{constructor(e={}){super();Nt(this,Js);Nt(this,Ca);Nt(this,Dg);this.config=e,dt(this,Js,new Set),dt(this,Ca,new Map),dt(this,Dg,0)}build(e,n,r){const i=new qte({mutationCache:this,mutationId:++vv(this,Dg)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){ue(this,Js).add(e);const n=zv(e);if(typeof n=="string"){const r=ue(this,Ca).get(n);r?r.push(e):ue(this,Ca).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(ue(this,Js).delete(e)){const n=zv(e);if(typeof n=="string"){const r=ue(this,Ca).get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&ue(this,Ca).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=zv(e);if(typeof n=="string"){const r=ue(this,Ca).get(n),i=r==null?void 0:r.find(a=>a.state.status==="pending");return!i||i===e}else return!0}runNext(e){var r;const n=zv(e);if(typeof n=="string"){const i=(r=ue(this,Ca).get(n))==null?void 0:r.find(a=>a!==e&&a.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Lr.batch(()=>{ue(this,Js).forEach(e=>{this.notify({type:"removed",mutation:e})}),ue(this,Js).clear(),ue(this,Ca).clear()})}getAll(){return Array.from(ue(this,Js))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>YO(n,r))}findAll(e={}){return this.getAll().filter(n=>YO(e,n))}notify(e){Lr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Lr.batch(()=>Promise.all(e.map(n=>n.continue().catch(Sa))))}},Js=new WeakMap,Ca=new WeakMap,Dg=new WeakMap,y8);function zv(t){var e;return(e=t.options.scope)==null?void 0:e.id}function ZO(t){return{onFetch:(e,n)=>{var d,h,f,p,g;const r=e.options,i=(f=(h=(d=e.fetchOptions)==null?void 0:d.meta)==null?void 0:h.fetchMore)==null?void 0:f.direction,a=((p=e.state.data)==null?void 0:p.pages)||[],s=((g=e.state.data)==null?void 0:g.pageParams)||[];let o={pages:[],pageParams:[]},c=0;const u=async()=>{let m=!1;const v=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(e.signal.aborted?m=!0:e.signal.addEventListener("abort",()=>{m=!0}),e.signal)})},x=c9(e.options,e.fetchOptions),w=async(y,k,S)=>{if(m)return Promise.reject();if(k==null&&y.pages.length)return Promise.resolve(y);const C=(()=>{const P={client:e.client,queryKey:e.queryKey,pageParam:k,direction:S?"backward":"forward",meta:e.options.meta};return v(P),P})(),T=await x(C),{maxPages:E}=e.options,j=S?Mte:Dte;return{pages:j(y.pages,T,E),pageParams:j(y.pageParams,k,E)}};if(i&&a.length){const y=i==="backward",k=y?Yte:QO,S={pages:a,pageParams:s},_=k(r,S);o=await w(S,_,y)}else{const y=t??a.length;do{const k=c===0?s[0]??r.initialPageParam:QO(r,o);if(c>0&&k==null)break;o=await w(o,k),c++}while(c<y)}return o};e.options.persister?e.fetchFn=()=>{var m,v;return(v=(m=e.options).persister)==null?void 0:v.call(m,u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=u}}}function QO(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function Yte(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var Cn,Zo,Qo,Xd,Zd,ec,Qd,eh,b8,Jte=(b8=class{constructor(t={}){Nt(this,Cn);Nt(this,Zo);Nt(this,Qo);Nt(this,Xd);Nt(this,Zd);Nt(this,ec);Nt(this,Qd);Nt(this,eh);dt(this,Cn,t.queryCache||new Hte),dt(this,Zo,t.mutationCache||new Gte),dt(this,Qo,t.defaultOptions||{}),dt(this,Xd,new Map),dt(this,Zd,new Map),dt(this,ec,0)}mount(){vv(this,ec)._++,ue(this,ec)===1&&(dt(this,Qd,l9.subscribe(async t=>{t&&(await this.resumePausedMutations(),ue(this,Cn).onFocus())})),dt(this,eh,R0.subscribe(async t=>{t&&(await this.resumePausedMutations(),ue(this,Cn).onOnline())})))}unmount(){var t,e;
516vv(this,ec)._--,ue(this,ec)===0&&((t=ue(this,Qd))==null||t.call(this),dt(this,Qd,void 0),(e=ue(this,eh))==null||e.call(this),dt(this,eh,void 0))}isFetching(t){return ue(this,Cn).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return ue(this,Zo).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=ue(this,Cn).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=ue(this,Cn).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(nC(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return ue(this,Cn).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),i=ue(this,Cn).get(r.queryHash),a=i==null?void 0:i.state.data,s=jte(e,a);if(s!==void 0)return ue(this,Cn).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(t,e,n){return Lr.batch(()=>ue(this,Cn).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=ue(this,Cn).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=ue(this,Cn);Lr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=ue(this,Cn);return Lr.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=Lr.batch(()=>ue(this,Cn).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(Sa).catch(Sa)}invalidateQueries(t,e={}){return Lr.batch(()=>(ue(this,Cn).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=Lr.batch(()=>ue(this,Cn).findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,n);return n.throwOnError||(a=a.catch(Sa)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(Sa)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=ue(this,Cn).build(this,e);return n.isStaleByTime(nC(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Sa).catch(Sa)}fetchInfiniteQuery(t){return t.behavior=ZO(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Sa).catch(Sa)}ensureInfiniteQueryData(t){return t.behavior=ZO(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return R0.isOnline()?ue(this,Zo).resumePausedMutations():Promise.resolve()}getQueryCache(){return ue(this,Cn)}getMutationCache(){return ue(this,Zo)}getDefaultOptions(){return ue(this,Qo)}setDefaultOptions(t){dt(this,Qo,t)}setQueryDefaults(t,e){ue(this,Xd).set(Cm(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...ue(this,Xd).values()],n={};return e.forEach(r=>{Tm(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){ue(this,Zd).set(Cm(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...ue(this,Zd).values()],n={};return e.forEach(r=>{Tm(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...ue(this,Qo).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=lj(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===uj&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...ue(this,Qo).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){ue(this,Cn).clear(),ue(this,Zo).clear()}},Cn=new WeakMap,Zo=new WeakMap,Qo=new WeakMap,Xd=new WeakMap,Zd=new WeakMap,ec=new WeakMap,Qd=new WeakMap,eh=new WeakMap,b8),Xte=b.createContext(void 0),Zte=({client:t,children:e})=>(b.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),l.jsx(Xte.Provider,{value:t,children:e}));/** 517 * @remix-run/router v1.23.0 518 * 519 * Copyright (c) Remix Software Inc. 520 * 521 * This source code is licensed under the MIT license found in the 522 * LICENSE.md file in the root directory of this source tree. 523 * 524 * @license MIT 525 */function Em(){return Em=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Em.apply(this,arguments)}var rc;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(rc||(rc={}));const eR="popstate";function Qte(t){t===void 0&&(t={});function e(r,i){let{pathname:a,search:s,hash:o}=r.location;return iC("",{pathname:a,search:s,hash:o},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:D0(i)}return tne(e,n,null,t)}function Hn(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function p9(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function ene(){return Math.random().toString(36).substr(2,8)}function tR(t,e){return{usr:t.state,key:t.key,idx:e}}function iC(t,e,n,r){return n===void 0&&(n=null),Em({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?gf(e):e,{state:n,key:e&&e.key||r||ene()})}function D0(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function gf(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function tne(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,s=i.history,o=rc.Pop,c=null,u=d();u==null&&(u=0,s.replaceState(Em({},s.state,{idx:u}),""));function d(){return(s.state||{idx:null}).idx}function h(){o=rc.Pop;let v=d(),x=v==null?null:v-u;u=v,c&&c({action:o,location:m.location,delta:x})}function f(v,x){o=rc.Push;let w=iC(m.location,v,x);u=d()+1;let y=tR(w,u),k=m.createHref(w);try{s.pushState(y,"",k)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;i.location.assign(k)}a&&c&&c({action:o,location:m.location,delta:1})}function p(v,x){o=rc.Replace;let w=iC(m.location,v,x);u=d();let y=tR(w,u),k=m.createHref(w);s.replaceState(y,"",k),a&&c&&c({action:o,location:m.location,delta:0})}function g(v){let x=i.location.origin!=="null"?i.location.origin:i.location.href,w=typeof v=="string"?v:D0(v);return w=w.replace(/ $/,"%20"),Hn(x,"No window.location.(origin|href) available to create URL for href: "+w),new URL(w,x)}let m={get action(){return o},get location(){return t(i,s)},listen(v){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(eR,h),c=v,()=>{i.removeEventListener(eR,h),c=null}},createHref(v){return e(i,v)},createURL:g,encodeLocation(v){let x=g(v);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:f,replace:p,go(v){return s.go(v)}};return m}var nR;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(nR||(nR={}));function nne(t,e,n){return n===void 0&&(n="/"),rne(t,e,n,!1)}function rne(t,e,n,r){let i=typeof e=="string"?gf(e):e,a=dj(i.pathname||"/",n);if(a==null)return null;let s=m9(t);ine(s);let o=null;for(let c=0;o==null&&c<s.length;++c){let u=mne(a);o=fne(s[c],u,r)}return o}function m9(t,e,n,r){e===void 0&&(e=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(a,s,o)=>{let c={relativePath:o===void 0?a.path||"":o,caseSensitive:a.caseSensitive===!0,childrenIndex:s,route:a};c.relativePath.startsWith("/")&&(Hn(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not val
525id. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=xc([r,c.relativePath]),d=n.concat(c);a.children&&a.children.length>0&&(Hn(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),m9(a.children,e,d,u)),!(a.path==null&&!a.index)&&e.push({path:u,score:dne(u,a.index),routesMeta:d})};return t.forEach((a,s)=>{var o;if(a.path===""||!((o=a.path)!=null&&o.includes("?")))i(a,s);else for(let c of g9(a.path))i(a,s,c)}),e}function g9(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return i?[a,""]:[a];let s=g9(r.join("/")),o=[];return o.push(...s.map(c=>c===""?a:[a,c].join("/"))),i&&o.push(...s),o.map(c=>t.startsWith("/")&&c===""?"/":c)}function ine(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:hne(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const ane=/^:[\w-]+$/,sne=3,one=2,cne=1,lne=10,une=-2,rR=t=>t==="*";function dne(t,e){let n=t.split("/"),r=n.length;return n.some(rR)&&(r+=une),e&&(r+=one),n.filter(i=>!rR(i)).reduce((i,a)=>i+(ane.test(a)?sne:a===""?cne:lne),r)}function hne(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function fne(t,e,n){let{routesMeta:r}=t,i={},a="/",s=[];for(let o=0;o<r.length;++o){let c=r[o],u=o===r.length-1,d=a==="/"?e:e.slice(a.length)||"/",h=iR({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),f=c.route;if(!h&&u&&n&&!r[r.length-1].route.index&&(h=iR({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!h)return null;
vendor: 9,301 bytes, lines 525-534
525Object.assign(i,h.params),s.push({params:i,pathname:xc([a,h.pathname]),pathnameBase:bne(xc([a,h.pathnameBase])),route:f}),h.pathnameBase!=="/"&&(a=xc([a,h.pathnameBase]))}return s}function iR(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=pne(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let a=i[0],s=a.replace(/(.)\/+$/,"$1"),o=i.slice(1);return{params:r.reduce((u,d,h)=>{let{paramName:f,isOptional:p}=d;if(f==="*"){let m=o[h]||"";s=a.slice(0,a.length-m.length).replace(/(.)\/+$/,"$1")}const g=o[h];return p&&!g?u[f]=void 0:u[f]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:s,pattern:t}}function pne(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),p9(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,o,c)=>(r.push({paramName:o,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function mne(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return p9(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function dj(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function gne(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?gf(t):t;return{pathname:n?n.startsWith("/")?n:vne(n,e):e,search:xne(r),hash:wne(i)}}function vne(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function pS(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function yne(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function v9(t,e){let n=yne(t);return e?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function y9(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=gf(t):(i=Em({},t),Hn(!i.pathname||!i.pathname.includes("?"),pS("?","pathname","search",i)),Hn(!i.pathname||!i.pathname.includes("#"),pS("#","pathname","hash",i)),Hn(!i.search||!i.search.includes("#"),pS("#","search","hash",i)));let a=t===""||i.pathname==="",s=a?"/":i.pathname,o;if(s==null)o=n;else{let h=e.length-1;if(!r&&s.startsWith("..")){let f=s.split("/");for(;f[0]==="..";)f.shift(),h-=1;i.pathname=f.join("/")}o=h>=0?e[h]:"/"}let c=gne(i,o),u=s&&s!=="/"&&s.endsWith("/"),d=(a||s===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const xc=t=>t.join("/").replace(/\/\/+/g,"/"),bne=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),xne=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,wne=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function Sne(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const b9=["post","put","patch","delete"];new Set(b9);const kne=["get",...b9];new Set(kne);/** 526 * React Router v6.30.1 527 * 528 * Copyright (c) Remix Software Inc. 529 * 530 * This source code is licensed under the MIT license found in the 531 * LICENSE.md file in the root directory of this source tree. 532 * 533 * @license MIT 534 */function jm(){return jm=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},jm.apply(this,arguments)}const hj=b.createContext(null),_ne=b.createContext(null),xu=b.createContext(null),Hx=b.createContext(null),Bc=b.createContext({outlet:null,matches:[],isDataRoute:!1}),x9=b.createContext(null);function Cne(t,e){let{relative:n}=e===void 0?{}:e;Hg()||Hn(!1);let{basename:r,navigator:i}=b.useContext(xu),{hash:a,pathname:s,search:o}=S9(t,{relative:n}),c=s;return r!=="/"&&(c=s==="/"?r:xc([r,s])),i.createHref({pathname:c,search:o,hash:a})}function Hg(){return b.useContext(Hx)!=null}function qg(){return Hg()||Hn(!1),b.useContext(Hx).location}function w9(t){b.useContext(xu).static||b.useLayoutEffect(t)}function rr(){let{isDataRoute:t}=b.useContext(Bc);return t?$ne():Tne()}function Tne(){Hg()||Hn(!1);let t=b.useContext(hj),{basename:e,future:n,navigator:r}=b.useContext(xu),{matches:i}=b.useContext(Bc),{pathname:a}=qg(),s=JSON.stringify(v9(i,n.v7_relativeSplatPath)),o=b.useRef(!1);return w9(()=>{o.current=!0}),b.useCallback(function(u,d){if(d===void 0&&(d={}),!o.current)return;if(typeof u=="number"){r.go(u);return}let h=y9(u,JSON.parse(s),a,d.relative==="path");t==null&&e!=="/"&&(h.pathname=h.pathname==="/"?e:xc([e,h.pathname])),(d.replace?r.replace:r.push)(h,d.state,d)},[e,r,s,a,t])}function Kg(){let{matches:t}=b.useContext(Bc),e=t[t.length-1];return e?e.params:{}}function S9(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=b.useContext(xu),{matches:i}=b.useContext(Bc),{pathname:a}=qg(),s=JSON.stringify(v9(i,r.v7_relativeSplatPath));return b.useMemo(()=>y9(t,JSON.parse(s),a,n==="path"),[t,s,a,n])}function Ene(t,e){return jne(t,e)}function jne(t,e,n,r){Hg()||Hn(!1);let{navigator:i}=b.useContext(xu),{matches:a}=b.useContext(Bc),s=a[a.length-1],o=s?s.params:{};s&&s.pathname;let c=s?s.pathnameBase:"/";s&&s.route;let u=qg(),d;if(e){var h;let v=typeof e=="string"?gf(e):e;c==="/"||(h=v.pathname)!=null&&h.startsWith(c)||Hn(!1),d=v}else d=u;let f=d.pathname||"/",p=f;if(c!=="/"){let v=c.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(v.length).join("/")}let g=nne(t,{pathname:p}),m=Rne(g&&g.map(v=>Object.assign({},v,{params:Object.assign({},o,v.params),pathname:xc([c,i.encodeLocation?i.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?c:xc([c,i.encodeLocation?i.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),a,n,r);return e&&m?b.createElement(Hx.Provider,{value:{location:jm({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:rc.Pop}},m):m}function Pne(){let t=Lne(),e=Sne(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},e),n?b.createElement("pre",{style:i},n):null,null)}const Nne=b.createElement(Pne,null);class Ane extends b.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?b.createElement(Bc.Provider,{value:this.props.routeContext},b.createElement(x9.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function One(t){let{routeContext:e,match:n,children:r}=t,i=b.useContext(hj);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),b.createElement(Bc.Provider,{value:e},r)}function Rne(t,e,n,r){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var a;if(!n)return null;if(n.errors)t=n.matches;else if((a=r)!=null&&a.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let s=t,o=(i=n)==null?void 0:i.errors;if(o!=null){let d=s.findIndex(h=>h.route.id&&(o==null?void 0:o[h.route.id])!==void 0);d>=0||Hn(!1),s=s.slice(0,Math.min(s.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<s.length;d++){let h=s[d];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(u=d),h.route.id){let{loaderData:f,errors:p}=n,g=h.route.loader&&f[h.route.id]===void 0&&(!p||p[h.route.id]===void 0);if(h.route.lazy||g){c=!0,u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((d,h,f)=>{let p,g=!1,m=null,v=null;n&&(p=o&&h.route.id?o[h.route.id]:void 0,m=h.route.errorElement||Nne,c&&(u<0&&f===0?(g=!0,v=null):u===f&&(g=!0,v=h.route.hydrateFallbackElement||null)));let x=e.concat(s.slice(0,f+1)),w=()=>{let y;return p?y=m:g?y=v:h.route.Component?y=b.createElement(h.route.Component,null):h.route.element?y=h.route.element:y=d,b.createElement(One,{match:h,routeC
534ontext:{outlet:d,matches:x,isDataRoute:n!=null},children:y})};return n&&(h.route.ErrorBoundary||h.route.errorElement||f===0)?b.createElement(Ane,{location:n.location,revalidation:n.revalidation,component:m,error:p,children:w(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):w()},null)}var k9=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(k9||{}),M0=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(M0||{});function Dne(t){let e=b.useContext(hj);return e||Hn(!1),e}function Mne(t){let e=b.useContext(_ne);return e||Hn(!1),e}function Ine(t){let e=b.useContext(Bc);return e||Hn(!1),e}function _9(t){let e=Ine(),n=e.matches[e.matches.length-1];return n.route.id||Hn(!1),n.route.id}function Lne(){var t;let e=b.useContext(x9),n=Mne(M0.UseRouteError),r=_9(M0.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function $ne(){let{router:t}=Dne(k9.UseNavigateStable),e=_9(M0.UseNavigateStable),n=b.useRef(!1);return w9(()=>{n.current=!0}),b.useCallback(function(i,a){a===void 0&&(a={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,jm({fromRouteId:e},a)))},[t,e])}function Fne(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function $n(t){Hn(!1)}function Bne(t){let{basename:e="/",children:n=null,location:r,navigationType:i=rc.Pop,navigator:a,static:s=!1,future:o}=t;Hg()&&Hn(!1);let c=e.replace(/^\/*/,"/"),u=b.useMemo(()=>({basename:c,navigator:a,static:s,future:jm({v7_relativeSplatPath:!1},o)}),[c,o,a,s]);typeof r=="string"&&(r=gf(r));let{pathname:d="/",search:h="",hash:f="",state:p=null,key:g="default"}=r,m=b.useMemo(()=>{let v=dj(d,c);return v==null?null:{location:{pathname:v,search:h,hash:f,state:p,key:g},navigationType:i}},[c,d,h,f,p,g,i]);return m==null?null:b.createElement(xu.Provider,{value:u},b.createElement(Hx.Provider,{children:n,value:m}))}function Une(t){let{children:e,location:n}=t;return Ene(aC(e),n)}new Promise(()=>{});function aC(t,e){e===void 0&&(e=[]);let n=[];return b.Children.forEach(t,(r,i)=>{if(!b.isValidElement(r))return;let a=[...e,i];if(r.type===b.Fragment){n.push.apply(n,aC(r.props.children,a));return}r.type!==$n&&Hn(!1),!r.props.index||!r.props.children||Hn(!1);let s={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=aC(r.props.children,a)),n.push(s)}),n}/** 535 * React Router DOM v6.30.1 536 * 537 * Copyright (c) Remix Software Inc. 538 * 539 * This source code is licensed under the MIT license found in the 540 * LICENSE.md file in the root directory of this source tree. 541 * 542 * @license MIT 543 */function sC(){return sC=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},sC.apply(this,arguments)}function zne(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function Wne(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function Vne(t,e){return t.button===0&&(!e||e==="_self")&&!Wne(t)}const Hne=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],qne="6";try{window.__reactRouterVersion=qne}catch{}const Kne="startTransition",aR=XE[Kne];function Gne(t){let{basename:e,children:n,future:r,window:i}=t,a=b.useRef();a.current==null&&(a.current=Qte({window:i,v5Compat:!0}));let s=a.current,[o,c]=b.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},d=b.useCallback(h=>{u&&aR?aR(()=>c(h)):c(h)},[c,u]);return b.useLayoutEffect(()=>s.listen(d),[s,d]),b.useEffect(()=>Fne(r),[r]),b.createElement(Bne,{basename:e,children:n,location:o.location,navigationType:o.action,navigator:s,future:r})}const Yne=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Jne=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Xne=b.forwardRef(function(e,n){let{onClick:r,relative:i,reloadDocument:a,replace:s,state:o,target:c,to:u,preventScrollReset:d,viewTransition:h}=e,f=zne(e,Hne),{basename:p}=b.useContext(xu),g,m=!1;if(typeof u=="string"&&Jne.test(u)&&(g=u,Yne))try{let y=new URL(window.location.href),k=u.startsWith("//")?new URL(y.protocol+u):new URL(u),S=dj(k.pathname,p);k.origin===y.origin&&S!=null?u=S+k.search+k.hash:m=!0}catch{}let v=Cne(u,{relative:i}),x=Zne(u,{replace:s,state:o,target:c,preventScrollReset:d,relative:i,viewTransition:h});function w(y){r&&r(y),y.defaultPrevented||x(y)}return b.createElement("a",sC({},f,{href:g||v,onClick:m||a?r:w,ref:n,target:c}))});var sR;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(sR||(sR={}));var oR;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(oR||(oR={}));function Zne(t,e){let{target:n,replace:r,state:i,preventScrollReset:a,relative:s,viewTransition:o}=e===void 0?{}:e,c=rr(),u=qg(),d=S9(t,{relative:s});return b.useCallback(h=>{if(Vne(h,n)){h.preventDefault();let f=r!==void 0?r:D0(u)===D0(d);c(t,{replace:f,state:i,preventScrollReset:a,relative:s,viewTransition:o})}},[u,c,d,r,i,n,t,a,s,o])}
vendor: 5,500 bytes, line 543
543var oC=function(t,e){return oC=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},oC(t,e)};function C9(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");oC(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var Gi=function(){return Gi=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},Gi.apply(this,arguments)};function Uc(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function T9(t,e,n,r){var i=arguments.length,a=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,n,r);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(i<3?s(a):i>3?s(e,n,a):s(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a}function E9(t,e){return function(n,r){e(n,r,t)}}function j9(t,e,n,r,i,a){function s(x){if(x!==void 0&&typeof x!="function")throw new TypeError("Function expected");return x}for(var o=r.kind,c=o==="getter"?"get":o==="setter"?"set":"value",u=!e&&t?r.static?t:t.prototype:null,d=e||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),h,f=!1,p=n.length-1;p>=0;p--){var g={};for(var m in r)g[m]=m==="access"?{}:r[m];for(var m in r.access)g.access[m]=r.access[m];g.addInitializer=function(x){if(f)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(x||null))};var v=(0,n[p])(o==="accessor"?{get:d.get,set:d.set}:d[c],g);if(o==="accessor"){if(v===void 0)continue;if(v===null||typeof v!="object")throw new TypeError("Object expected");(h=s(v.get))&&(d.get=h),(h=s(v.set))&&(d.set=h),(h=s(v.init))&&i.unshift(h)}else(h=s(v))&&(o==="field"?i.unshift(h):d[c]=h)}u&&Object.defineProperty(u,r.name,d),f=!0}function P9(t,e,n){for(var r=arguments.length>2,i=0;i<e.length;i++)n=r?e[i].call(t,n):e[i].call(t);return r?n:void 0}function N9(t){return typeof t=="symbol"?t:"".concat(t)}function A9(t,e,n){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:n?"".concat(n," ",e):e})}function O9(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function We(t,e,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function o(d){try{u(r.next(d))}catch(h){s(h)}}function c(d){try{u(r.throw(d))}catch(h){s(h)}}function u(d){d.done?a(d.value):i(d.value).then(o,c)}u((r=r.apply(t,e||[])).next())})}function R9(t,e){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=o(0),s.throw=o(1),s.return=o(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){n.label=u[1];break}if(u[0]===6&&n.label<a[1]){n.label=a[1],a=u;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(u);break}a[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(d){u=[6,d],i=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var qx=Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]};function D9(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&qx(e,t,n)}function I0(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function fj(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return a}function M9(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(fj(arguments[e]));return t}function I9(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var r=Array(t),i=0,e=0;e<n;e++)for(var a=arguments[e],s=0,o=a.length;s<o;s++,i++)r[i]=a[s];return r}function pj(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,a;r<i;
vendor: 4,199 bytes, line 543
543r++)(a||!(r in e))&&(a||(a=Array.prototype.slice.call(e,0,r)),a[r]=e[r]);return t.concat(a||Array.prototype.slice.call(e))}function ph(t){return this instanceof ph?(this.v=t,this):new ph(t)}function L9(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,a=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(p){return function(g){return Promise.resolve(g).then(p,h)}}function o(p,g){r[p]&&(i[p]=function(m){return new Promise(function(v,x){a.push([p,m,v,x])>1||c(p,m)})},g&&(i[p]=g(i[p])))}function c(p,g){try{u(r[p](g))}catch(m){f(a[0][3],m)}}function u(p){p.value instanceof ph?Promise.resolve(p.value.v).then(d,h):f(a[0][2],p)}function d(p){c("next",p)}function h(p){c("throw",p)}function f(p,g){p(g),a.shift(),a.length&&c(a[0][0],a[0][1])}}function $9(t){var e,n;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,a){e[i]=t[i]?function(s){return(n=!n)?{value:ph(t[i](s)),done:!1}:a?a(s):s}:a}}function F9(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof I0=="function"?I0(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(a){n[a]=t[a]&&function(s){return new Promise(function(o,c){s=t[a](s),i(o,c,s.done,s.value)})}}function i(a,s,o,c){Promise.resolve(c).then(function(u){a({value:u,done:o})},s)}}function B9(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var Qne=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e},cC=function(t){return cC=Object.getOwnPropertyNames||function(e){var n=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[n.length]=r);return n},cC(t)};function U9(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n=cC(t),r=0;r<n.length;r++)n[r]!=="default"&&qx(e,t,n[r]);return Qne(e,t),e}function z9(t){return t&&t.__esModule?t:{default:t}}function W9(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)}function V9(t,e,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(t,n):i?i.value=n:e.set(t,n),n}function H9(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function q9(t,e,n){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var r,i;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[Symbol.dispose],n&&(i=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");i&&(r=function(){try{i.call(this)}catch(a){return Promise.reject(a)}}),t.stack.push({value:e,dispose:r,async:n})}else n&&t.stack.push({async:!0});return e}var ere=typeof SuppressedError=="function"?SuppressedError:function(t,e,n){var r=new Error(n);return r.name="SuppressedError",r.error=t,r.suppressed=e,r};function K9(t){function e(a){t.error=t.hasError?new ere(a,t.error,"An error was suppressed during disposal."):a,t.hasError=!0}var n,r=0;function i(){for(;n=t.stack.pop();)try{if(!n.async&&r===1)return r=0,t.stack.push(n),Promise.resolve().then(i);if(n.dispose){var a=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(a).then(i,function(s){return e(s),i()})}else r|=1}catch(s){e(s)}
543if(r===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return i()}function G9(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,r,i,a,s){return r?e?".jsx":".js":i&&(!a||!s)?n:i+a+"."+s.toLowerCase()+"js"}):t}const tre={__extends:C9,__assign:Gi,__rest:Uc,__decorate:T9,__param:E9,__esDecorate:j9,__runInitializers:P9,__propKey:N9,__setFunctionName:A9,__metadata:O9,__awaiter:We,__generator:R9,__createBinding:qx,__exportStar:D9,__values:I0,__read:fj,__spread:M9,__spreadArrays:I9,__spreadArray:pj,__await:ph,__asyncGenerator:L9,__asyncDelegator:$9,__asyncValues:F9,__makeTemplateObject:B9,__importStar:U9,__importDefault:z9,__classPrivateFieldGet:W9,__classPrivateFieldSet:V9,__classPrivateFieldIn:H9,__addDisposableResource:q9,__disposeResources:K9,__rewriteRelativeImportExtension:G9},nre=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:q9,get __assign(){return Gi},__asyncDelegator:$9,__asyncGenerator:L9,__asyncValues:F9,__await:ph,__awaiter:We,__classPrivateFieldGet:W9,__classPrivateFieldIn:H9,__classPrivateFieldSet:V9,__createBinding:qx,__decorate:T9,__disposeResources:K9,__esDecorate:j9,__exportStar:D9,__extends:C9,__generator:R9,__importDefault:z9,__importStar:U9,__makeTemplateOb
543ject:B9,__metadata:O9,__param:E9,__propKey:N9,__read:fj,__rest:Uc,__rewriteRelativeImportExtension:G9,__runInitializers:P9,__setFunctionName:A9,__spread:M9,__spreadArray:pj,__spreadArrays:I9,__values:I0,default:tre},Symbol.toStringTag,{value:"Module"})),rre=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);class mj extends Error{constructor(e,n="FunctionsError",r){super(e),this.name=n,this.context=r}}class ire extends mj{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class cR extends mj{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class lR extends mj{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var lC;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(lC||(lC={}));class are{constructor(e,{headers:n={},customFetch:r,region:i=lC.Any}={}){this.url=e,this.headers=n,this.region=i,this.fetch=rre(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return We(this,arguments,void 0,function*(n,r={}){var i;let a,s;try{const{headers:o,method:c,body:u,signal:d,timeout:h}=r;let f={},{region:p}=r;p||(p=this.region);const g=new URL(`${this.url}/${n}`);p&&p!=="any"&&(f["x-region"]=p,g.searchParams.set("forceFunctionRegion",p));let m;u&&(o&&!Object.prototype.hasOwnProperty.call(o,"Content-Type")||!o)?typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(f["Content-Type"]="application/octet-stream",m=u):typeof u=="string"?(f["Content-Type"]="text/plain",m=u):typeof FormData<"u"&&u instanceof FormData?m=u:(f["Content-Type"]="application/json",m=JSON.stringify(u)):m=u;let v=d;h&&(s=new AbortController,a=setTimeout(()=>s.abort(),h),d?(v=s.signal,d.addEventListener("abort",()=>s.abort())):v=s.signal);const x=yield this.fetch(g.toString(),{method:c||"POST",headers:Object.assign(Object.assign(Object.assign({},f),this.headers),o),body:m,signal:v}).catch(S=>{throw new ire(S)}),w=x.headers.get("x-relay-error");if(w&&w==="true")throw new cR(x);if(!x.ok)throw new lR(x);let y=((i=x.headers.get("Content-Type"))!==null&&i!==void 0?i:"text/plain").split(";")[0].trim(),k;return y==="application/json"?k=yield x.json():y==="application/octet-stream"||y==="application/pdf"?k=yield x.blob():y==="text/event-stream"?k=x:y==="multipart/form-data"?k=yield x.formData():k=yield x.text(),{data:k,error:null,response:x}}catch(o){return{data:null,error:o,response:o instanceof lR||o instanceof cR?o.context:void 0}}finally{a&&clearTimeout(a)}})}}var $r={};const vf=SG(nre);var Wv={},Vv={},Hv={},qv={},Kv={},Gv={},uR;function Y9(){if(uR)return Gv;uR=1,Object.defineProperty(Gv,"__esModule",{value:!0});class t extends Error{constructor(n){super(n.message),this.name="PostgrestError",this.details=n.details,this.hint=n.hint,this.co
543de=n.code}}return Gv.default=t,Gv}var dR;function J9(){if(dR)return Kv;dR=1,Object.defineProperty(Kv,"__esModule",{value:!0});const e=vf.__importDefault(Y9());class n{constructor(i){var a,s;this.shouldThrowOnError=!1,this.method=i.method,this.url=i.url,this.headers=new Headers(i.headers),this.schema=i.schema,this.body=i.body,this.shouldThrowOnError=(a=i.shouldThrowOnError)!==null&&a!==void 0?a:!1,this.signal=i.signal,this.isMaybeSingle=(s=i.isMaybeSingle)!==null&&s!==void 0?s:!1,i.fetch?this.fetch=i.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(i,a){return this.headers=new Headers(this.headers),this.headers.set(i,a),this}then(i,a){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");const s=this.fetch;let o=s(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async c=>{var u,d,h,f;let p=null,g=null,m=null,v=c.status,x=c.statusText;if(c.ok){if(this.method!=="HEAD"){const S=await c.text();S===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&(!((u=this.headers.get("Accept"))===null||u===void 0)&&u.includes("application/vnd.pgrst.plan+text"))?g=S:g=JSON.parse(S))}const y=(d=this.headers.get("Prefer"))===null||d===void 0?void 0:d.match(/count=(exact|planned|estimated)/),k=(h=c.headers.get("content-range"))===null||h===void 0?void 0:h.split("/");y&&k&&k.length>1&&(m=parseInt(k[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(g)&&(g.length>1?(p={code:"PGRST116",details:`Results contain ${g.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},g=null,m=null,v=406,x="Not Acceptable"):g.length===1?g=g[0]:g=null)}else{const y=await c.text();try{p=JSON.parse(y),Array.isArray(p)&&c.status===404&&(g=[],p=null,v=200,x="OK")}catch{c.status===404&&y===""?(v=204,x="No Content"):p={message:y}}if(p&&this.isMaybeSingle&&(!((f=p==null?void 0:p.details)===null||f===void 0)&&f.includes("0 rows"))&&(p=null,v=200,x="OK"),p&&this.shouldThrowOnError)throw new e.default(p)}return{error:p,data:g,count:m,status:v,statusText:x}});return this.shouldThrowOnError||(o=o.catch(c=>{var u,d,h,f,p,g;let m="";const v=c==null?void 0:c.cause;if(v){const x=(u=v==null?void 0:v.message)!==null&&u!==void 0?u:"",w=(d=v==null?void 0:v.code)!==null&&d!==void 0?d:"";m=`${(h=c==null?void 0:c.name)!==null&&h!==void 0?h:"FetchError"}: ${c==null?void 0:c.message}`,m+=` 544 545Caused by: ${(f=v==null?void 0:v.name)!==null&&f!==void 0?f:"Error"}: ${x}`,w&&(m+=` (${w})`),v!=null&&v.stack&&(m+=` 546${v.stack}`)}else m=(p=c==null?void 0:c.stack)!==null&&p!==void 0?p:"";return{error:{message:`${(g=c==null?void 0:c.name)!==null&&g!==void 0?g:"FetchError"}: ${c==null?void 0:c.message}`,details:m,hint:"",code:""},data:null,count:null,status:0,statusText:""}})),o.then(i,a)}returns(){return this}overrideTypes(){return this}}return Kv.default=n,Kv}var hR;function X9(){if(hR)return qv;hR=1,Object.defineProperty(qv,"__esModule",{value:!0});const e=vf.__importDefault(J9());class n extends e.default{select(i){let a=!1;const s=(i??"*").split("").map(o=>/\s/.test(o)&&!a?"":(o==='"'&&(a=!a),o)).join("");return this.url.searchParams.set("select",s),this.headers.append("Prefer","return=representation"),this}order(i,{ascending:a=!0,nullsFirst:s,foreignTable:o,referencedTable:c=o}={}){const u=c?`${c}.order`:"order",d=this.url.searchParams.get(u);return this.url.searchParams.set(u,`${d?`${d},`:""}${i}.${a?"asc":"desc"}${s===void 0?"":s?".nullsfirst":".nullslast"}`),this}limit(i,{foreignTable:a,referencedTable:s=a}={}){const o=typeof s>"u"?"limit":`${s}.limit`;return this.url.searchParams.set(o,`${i}`),this}range(i,a,{foreignTable:s,referencedTable:o=s}={}){const c=typeof o>"u"?"offset":`${o}.offset`,u=typeof o>"u"?"limit":`${o}.limit`;return this.url.searchParams.set(c,`${i}`),this.url.searchParams.set(u,`${a-i+1}`),this}abortSignal(i){return this.signal=i,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}
546explain({analyze:i=!1,verbose:a=!1,settings:s=!1,buffers:o=!1,wal:c=!1,format:u="text"}={}){var d;const h=[i?"analyze":null,a?"verbose":null,s?"settings":null,o?"buffers":null,c?"wal":null].filter(Boolean).join("|"),f=(d=this.headers.get("Accept"))!==null&&d!==void 0?d:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${u}; for="${f}"; options=${h};`),u==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(i){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${i}`),this}}return qv.default=n,qv}var fR;function gj(){if(fR)return Hv;fR=1,Object.defineProperty(Hv,"__esModule",{value:!0});const e=vf.__importDefault(X9()),n=new RegExp("[,()]");class r extends e.default{eq(a,s){return this.url.searchParams.append(a,`eq.${s}`),this}neq(a,s){return this.url.searchParams.append(a,`neq.${s}`),this}gt(a,s){return this.url.searchParams.append(a,`gt.${s}`),this}gte(a,s){return this.url.searchParams.append(a,`gte.${s}`),this}lt(a,s){return this.url.searchParams.append(a,`lt.${s}`),this}lte(a,s){return this.url.searchParams.append(a,`lte.${s}`),this}like(a,s){return this.url.searchParams.append(a,`like.${s}`),this}likeAllOf(a,s){return this.url.searchParams.append(a,`like(all).{${s.join(",")}}`),this}likeAnyOf(a,s){return this.url.searchParams.append(a,`like(any).{${s.join(",")}}`),this}ilike(a,s){return this.url.searchParams.append(a,`ilike.${s}`),this}ilikeAllOf(a,s){return this.url.searchParams.append(a,`ilike(all).{${s.join(",")}}`),this}ilikeAnyOf(a,s){return this.url.searchParams.append(a,`ilike(any).{${s.join(",")}}`),this}regexMatch(a,s){return this.url.searchParams.append(a,`match.${s}`),this}regexIMatch(a,s){return this.url.searchParams.append(a,`imatch.${s}`),this}is(a,s){return this.url.searchParams.append(a,`is.${s}`),this}isDistinct(a,s){return this.url.searchParams.append(a,`isdistinct.${s}`),this}in(a,s){const o=Array.from(new Set(s)).map(c=>typeof c=="string"&&n.test(c)?`"${c}"`:`${c}`).join(",");return this.url.searchParams.append(a,`in.(${o})`),this}contains(a,s){return typeof s=="string"?this.url.searchParams.append(a,`cs.${s}`):Array.isArray(s)?this.url.searchParams.append(a,`cs.{${s.join(",")}}`):this.url.searchParams.append(a,`cs.${JSON.stringify(s)}`),this}containedBy(a,s){return typeof s=="string"?this.url.searchParams.append(a,`cd.${s}`):Array.isArray(s)?this.url.searchParams.append(a,`cd.{${s.join(",")}}`):this.url.searchParams.append(a,`cd.${JSON.stringify(s)}`),this}rangeGt(a,s){return this.url.searchParams.append(a,`sr.${s}`),this}rangeGte(a,s){return this.url.searchParams.append(a,`nxl.${s}`),this}rangeLt(a,s){return this.url.searchParams.append(a,`sl.${s}`),this}rangeLte(a,s){return this.url.searchParams.append(a,`nxr.${s}`),this}rangeAdjacent(a,s){return this.url.searchParams.append(a,`adj.${s}`),this}overlaps(a,s){return typeof s=="string"?this.url.searchParams.append(a,`ov.${s}`):this.url.searchParams.append(a,`ov.{${s.join(",")}}`),this}textSearch(a,s,{config:o,type:c}={}){let u="";c==="plain"?u="pl":c==="phrase"?u="ph":c==="websearch"&&(u="w");const d=o===void 0?"":`(${o})`;return this.url.searchParams.append(a,`${u}fts${d}.${s}`),this}match(a){return Object.entries(a).forEach(([s,o])=>{this.url.searchParams.append(s,`eq.${o}`)}),this}not(a,s,o){return this.url.searchParams.append(a,`not.${s}.${o}`),this}or(a,{foreignTable:s,referencedTable:o=s}={}){const c=o?`${o}.or`:"or";return this.url.searchParams.append(c,`(${a})`),this}filter(a,s,o){return this.url.searchParams.append(a,`${s}.${o}`),this}}return Hv.default=r,Hv}var pR;function Z9(){if(pR)return Vv;pR=1,Object.defineProperty(Vv,"__esModule",{value:!0});const e=vf.__importDefault(gj());
546class n{constructor(i,{headers:a={},schema:s,fetch:o}){this.url=i,this.headers=new Headers(a),this.schema=s,this.fetch=o}select(i,a){const{head:s=!1,count:o}=a??{},c=s?"HEAD":"GET";let u=!1;const d=(i??"*").split("").map(h=>/\s/.test(h)&&!u?"":(h==='"'&&(u=!u),h)).join("");return this.url.searchParams.set("select",d),o&&this.headers.append("Prefer",`count=${o}`),new e.default({method:c,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(i,{count:a,defaultToNull:s=!0}={}){var o;const c="POST";if(a&&this.headers.append("Prefer",`count=${a}`),s||this.headers.append("Prefer","missing=default"),Array.isArray(i)){const u=i.reduce((d,h)=>d.concat(Object.keys(h)),[]);if(u.length>0){const d=[...new Set(u)].map(h=>`"${h}"`);this.url.searchParams.set("columns",d.join(","))}}return new e.default({method:c,url:this.url,headers:this.headers,schema:this.schema,body:i,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}upsert(i,{onConflict:a,ignoreDuplicates:s=!1,count:o,defaultToNull:c=!0}={}){var u;const d="POST";if(this.headers.append("Prefer",`resolution=${s?"ignore":"merge"}-duplicates`),a!==void 0&&this.url.searchParams.set("on_conflict",a),o&&this.headers.append("Prefer",`count=${o}`),c||this.headers.append("Prefer","missing=default"),Array.isArray(i)){const h=i.reduce((f,p)=>f.concat(Object.keys(p)),[]);if(h.length>0){const f=[...new Set(h)].map(p=>`"${p}"`);this.url.searchParams.set("columns",f.join(","))}}return new e.default({method:d,url:this.url,headers:this.headers,schema:this.schema,body:i,fetch:(u=this.fetch)!==null&&u!==void 0?u:fetch})}update(i,{count:a}={}){var s;const o="PATCH";return a&&this.headers.append("Prefer",`count=${a}`),new e.default({method:o,url:this.url,headers:this.headers,schema:this.schema,body:i,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch})}delete({count:i}={}){var a;const s="DELETE";return i&&this.headers.append("Prefer",`count=${i}`),new e.default({method:s,url:this.url,headers:this.headers,schema:this.schema,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}}return Vv.default=n,Vv}var mR;function sre(){if(mR)return Wv;mR=1,Object.defineProperty(Wv,"__esModule",{value:!0});const t=vf,e=t.__importDefault(Z9()),n=t.__importDefault(gj());class r{constructor(a,{headers:s={},schema:o,fetch:c}={}){this.url=a,this.headers=new Headers(s),this.schemaName=o,this.fetch=c}from(a){if(!a||typeof a!="string"||a.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");const s=new URL(`${this.url}/${a}`);return new e.default(s,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(a){return new r(this.url,{headers:this.headers,schema:a,fetch:this.fetch})}rpc(a,s={},{head:o=!1,get:c=!1,count:u}={}){var d;let h;const f=new URL(`${this.url}/rpc/${a}`);let p;o||c?(h=o?"HEAD":"GET",Object.entries(s).filter(([m,v])=>v!==void 0).map(([m,v])=>[m,Array.isArray(v)?`{${v.join(",")}}`:`${v}`]).forEach(([m,v])=>{f.searchParams.append(m,v)})):(h="POST",p=s);const g=new Headers(this.headers);return u&&g.set("Prefer",`count=${u}`),new n.default({method:h,url:f,headers:g,schema:this.schemaName,body:p,fetch:(d=this.fetch)!==null&&d!==void 0?d:fetch})}}return Wv.default=r,Wv}Object.defineProperty($r,"__esModule",{value:!0});var Q9=$r.PostgrestError=lF=$r.PostgrestBuilder=oF=$r.PostgrestTransformBuilder=aF=$r.PostgrestFilterBuilder=rF=$r.PostgrestQueryBuilder=tF=$r.PostgrestClient=void 0;const yf=vf,eF=yf.__importDefault(sre());var tF=$r.PostgrestClient=eF.default;const nF=yf.__importDefault(Z9());var rF=$r.PostgrestQueryBuilder=nF.default;const iF=yf.__importDefault(gj());var aF=$r.PostgrestFilterBuilder=iF.default;const sF=yf.__importDefault(X9());var oF=$r.PostgrestTransformBuilder=sF.default;const cF=yf.__importDefault(J9());var lF=$r.PostgrestBuilder=cF.default;const uF=yf.__importDefault(Y9());Q9=$r.PostgrestError=uF.default;var dF=$r.default={PostgrestClient:eF.default,PostgrestQueryBuilder:nF.default,PostgrestFilterBuilder:iF.default,PostgrestTransformBuilder:sF.default,PostgrestBuilder:cF.default,PostgrestError:uF.default};const ore=x8({__proto__:null,get PostgrestBuilder(){return lF},get PostgrestClient(){return tF},get PostgrestError(){return Q9},get PostgrestFilterBuilder(){return aF},get PostgrestQueryBuilder(){return rF},get PostgrestTransformBuilder(){return oF},default:dF},[$r]),{PostgrestClient:cre,PostgrestQueryBuilder:rBe,PostgrestFilterBuilder:iBe,PostgrestTransformBuilder:
546aBe,PostgrestBuilder:sBe,PostgrestError:oBe}=dF||ore;class lre{constructor(){}static detectEnvironment(){var e;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"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.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."};if(typeof process<"u"){const n=process.versions;if(n&&n.node){const r=n.node,i=parseInt(r.replace(/^v/,"").split(".")[0]);return i>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${i} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${i} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option: 547import ws from "ws" 548new 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(){const e=this.detectEnvironment();if(e.constructor)return e.constructor;let n=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(n+=` 549 550Suggested solution: ${e.workaround}`),new Error(n)}static createWebSocket(e,n){const r=this.getWebSocketConstructor();return new r(e,n)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const ure="2.84.0",dre=`realtime-js/${ure}`,hF="1.0.0",hre="2.0.0",gR=hF,uC=1e4,fre=1e3,pre=100;var ml;(function(t){t[t.connecting=0]="connecting",t[t.open=1]="open",t[t.closing=2]="closing",t[t.closed=3]="closed"})(ml||(ml={}));var Jn;(function(t){t.closed="closed",t.errored="errored",t.joined="joined",t.joining="joining",t.leaving="leaving"})(Jn||(Jn={}));var ja;(function(t){t.close="phx_close",t.error="phx_error",t.join="phx_join",t.reply="phx_reply",t.leave="phx_leave",t.access_token="access_token"})(ja||(ja={}));var dC;(function(t){t.websocket="websocket"})(dC||(dC={}));var gl;(function(t){t.Connecting="connecting",t.Open="open",t.Closing="closing",t.Closed="closed"})(gl||(gl={}));class mre{constructor(){this.HEADER_LENGTH=1,this.META_LENGTH=4,this.USER_BROADCAST_PUSH_META_LENGTH=5,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast"}encode(e,n){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event=="string")return n(this._binaryEncodeUserBroadcastPush(e));let r=[e.join_ref,e.ref,e.topic,e.event,e.payload];return n(JSON.stringify(r))}_binaryEncodeUserBroadcastPush(e){var n;return this._isArrayBuffer((n=e.payload)===null||n===void 0?void 0:n.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var n,r,i,a;const s=e.topic,o=(n=e.ref)!==null&&n!==void 0?n:"",c=(r=e.join_ref)!==null&&r!==void 0?r:"",u=e.payload.event,d=(a=(i=e.payload)===null||i===void 0?void 0:i.payload)!==null&&a!==void 0?a:new ArrayBuffer(0),h=this.USER_BROADCAST_PUSH_META_LENGTH+c.length+o.length+s.length+u.length,f=new ArrayBuffer(this.HEADER_LENGTH+h);let p=new DataView(f),g=0;p.setUint8(g++,this.KINDS.userBroadcastPush),p.setUint8(g++,c.length),p.setUint8(g++,o.length),p.setUint8(g++,s.length),p.setUint8(g++,u.length),p.setUint8(g++,this.BINARY_ENCODING),Array.from(c,v=>p.setUint8(g++,v.charCodeAt(0))),Array.from(o,v=>p.setUint8(g++,v.charCodeAt(0))),Array.from(s,v=>p.setUint8(g++,v.charCodeAt(0))),Array.from(u,v=>p.setUint8(g++,v.charCodeAt(0)));var m=new Uint8Array(f.byteLength+d.byteLength);return m.set(new Uint8Array(f),0),m.set(new Uint8Array(d),f.byteLength),m.buffer}_encodeJsonUserBroadcastPush(e){var n,r,i,a;const s=e.topic,o=(n=e.ref)!==null&&n!==void 0?n:"",c=(r=e.join_ref)!==null&&r!==void 0?r:"",u=e.payload.event,d=(a=(i=e.payload)===null||i===void 0?void 0:i.payload)!==null&&a!==void 0?a:{},f=new TextEncoder().encode(JSON.stringify(d)).buffer,p=this.USER_BROADCAST_PUSH_META_LENGTH+c.length+o.length+s.length+u.length,g=new ArrayBuffer(this.HEADER_LENGTH+p);let m=new DataView(g),v=0;m.setUint8(v++,this.KINDS.userBroadcastPush),m.setUint8(v++,c.length),m.setUint8(v++,o.length),m.setUint8(v++,s.length),m.setUint8(v++,u.length),m.setUint8(v++,this.JSON_ENCODING),Array.from(c,w=>
550m.setUint8(v++,w.charCodeAt(0))),Array.from(o,w=>m.setUint8(v++,w.charCodeAt(0))),Array.from(s,w=>m.setUint8(v++,w.charCodeAt(0))),Array.from(u,w=>m.setUint8(v++,w.charCodeAt(0)));var x=new Uint8Array(g.byteLength+f.byteLength);return x.set(new Uint8Array(g),0),x.set(new Uint8Array(f),g.byteLength),x.buffer}decode(e,n){if(this._isArrayBuffer(e)){let r=this._binaryDecode(e);return n(r)}if(typeof e=="string"){const r=JSON.parse(e),[i,a,s,o,c]=r;return n({join_ref:i,ref:a,topic:s,event:o,payload:c})}return n({})}_binaryDecode(e){const n=new DataView(e),r=n.getUint8(0),i=new TextDecoder;switch(r){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,n,i)}}_decodeUserBroadcast(e,n,r){const i=n.getUint8(1),a=n.getUint8(2),s=n.getUint8(3),o=n.getUint8(4);let c=this.HEADER_LENGTH+4;const u=r.decode(e.slice(c,c+i));c=c+i;const d=r.decode(e.slice(c,c+a));c=c+a;const h=r.decode(e.slice(c,c+s));c=c+s;const f=e.slice(c,e.byteLength),p=o===this.JSON_ENCODING?JSON.parse(r.decode(f)):f,g={type:this.BROADCAST_EVENT,event:d,payload:p};return s>0&&(g.meta=JSON.parse(h)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST_EVENT,payload:g}}_isArrayBuffer(e){var n;return e instanceof ArrayBuffer||((n=e==null?void 0:e.constructor)===null||n===void 0?void 0:n.name)==="ArrayBuffer"}}class fF{constructor(e,n){this.callback=e,this.timerCalc=n,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=n}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 Xt;(function(t){t.abstime="abstime",t.bool="bool",t.date="date",t.daterange="daterange",t.float4="float4",t.float8="float8",t.int2="int2",t.int4="int4",t.int4range="int4range",t.int8="int8",t.int8range="int8range",t.json="json",t.jsonb="jsonb",t.money="money",t.numeric="numeric",t.oid="oid",t.reltime="reltime",t.text="text",t.time="time",t.timestamp="timestamp",t.timestamptz="timestamptz",t.timetz="timetz",t.tsrange="tsrange",t.tstzrange="tstzrange"})(Xt||(Xt={}));const vR=(t,e,n={})=>{var r;const i=(r=n.skipTypes)!==null&&r!==void 0?r:[];return e?Object.keys(e).reduce((a,s)=>(a[s]=gre(s,t,e,i),a),{}):{}},gre=(t,e,n,r)=>{const i=e.find(o=>o.name===t),a=i==null?void 0:i.type,s=n[t];return a&&!r.includes(a)?pF(a,s):hC(s)},pF=(t,e)=>{if(t.charAt(0)==="_"){const n=t.slice(1,t.length);return xre(e,n)}switch(t){case Xt.bool:return vre(e);case Xt.float4:case Xt.float8:case Xt.int2:case Xt.int4:case Xt.int8:case Xt.numeric:case Xt.oid:return yre(e);case Xt.json:case Xt.jsonb:return bre(e);case Xt.timestamp:return wre(e);case Xt.abstime:case Xt.date:case Xt.daterange:case Xt.int4range:case Xt.int8range:case Xt.money:case Xt.reltime:case Xt.text:case Xt.time:case Xt.timestamptz:case Xt.timetz:case Xt.tsrange:case Xt.tstzrange:return hC(e);default:return hC(e)}},hC=t=>t,vre=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},yre=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},bre=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch(e){return console.log(`JSON parse error: ${e}`),t}return t},xre=(t,e)=>{if(typeof t!="string")return t;const n=t.length-1,r=t[n];if(t[0]==="{"&&r==="}"){let a;const s=t.slice(1,n);try{a=JSON.parse("["+s+"]")}catch{a=s?s.split(","):[]}return a.map(o=>pF(e,o))}return t},wre=t=>typeof t=="string"?t.replace(" ","T"):t,mF=t=>{const e=new URL(t);return e.protocol=e.protocol.replace(/^ws/i,"http"),e.pathname=e.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),e.pathname===""||e.pathname==="/"?e.pathname="/api/broadcast":e.pathname=e.pathname+"/api/broadcast",e.href};class mS{constructor(e,n,r={},i=uC){this.channel=e,this.event=n,this.payload=r,this.timeout=i,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(e){this.timeout=e,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,j
550oin_ref:this.channel._joinRef()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,n){var r;return this._hasReceived(e)&&n((r=this.receivedResp)===null||r===void 0?void 0:r.response),this.recHooks.push({status:e,callback:n}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const e=n=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=n,this._matchReceive(n)};this.channel._on(this.refEvent,{},e),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,n){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:n})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:n}){this.recHooks.filter(r=>r.status===e).forEach(r=>r.callback(n))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}var yR;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(yR||(yR={}));class Fp{constructor(e,n){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const r=(n==null?void 0:n.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},i=>{const{onJoin:a,onLeave:s,onSync:o}=this.caller;this.joinRef=this.channel._joinRef(),this.state=Fp.syncState(this.state,i,a,s),this.pendingDiffs.forEach(c=>{this.state=Fp.syncDiff(this.state,c,a,s)}),this.pendingDiffs=[],o()}),this.channel._on(r.diff,{},i=>{const{onJoin:a,onLeave:s,onSync:o}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(i):(this.state=Fp.syncDiff(this.state,i,a,s),o())}),this.onJoin((i,a,s)=>{this.channel._trigger("presence",{event:"join",key:i,currentPresences:a,newPresences:s})}),this.onLeave((i,a,s)=>{this.channel._trigger("presence",{event:"leave",key:i,currentPresences:a,leftPresences:s})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,n,r,i){const a=this.cloneDeep(e),s=this.transformState(n),o={},c={};return this.map(a,(u,d)=>{s[u]||(c[u]=d)}),this.map(s,(u,d)=>{const h=a[u];if(h){const f=d.map(v=>v.presence_ref),p=h.map(v=>v.presence_ref),g=d.filter(v=>p.indexOf(v.presence_ref)<0),m=h.filter(v=>f.indexOf(v.presence_ref)<0);g.length>0&&(o[u]=g),m.length>0&&(c[u]=m)}else o[u]=d}),this.syncDiff(a,{joins:o,leaves:c},r,i)}static syncDiff(e,n,r,i){const{joins:a,leaves:s}={joins:this.transformState(n.joins),leaves:this.transformState(n.leaves)};return r||(r=()=>{}),i||(i=()=>{}),this.map(a,(o,c)=>{var u;const d=(u=e[o])!==null&&u!==void 0?u:[];if(e[o]=this.cloneDeep(c),d.length>0){const h=e[o].map(p=>p.presence_ref),f=d.filter(p=>h.indexOf(p.presence_ref)<0);e[o].unshift(...f)}r(o,d,c)}),this.map(s,(o,c)=>{let u=e[o];if(!u)return;const d=c.map(h=>h.presence_ref);u=u.filter(h=>d.indexOf(h.presence_ref)<0),e[o]=u,i(o,u,c),u.length===0&&delete e[o]}),e}static map(e,n){return Object.getOwnPropertyNames(e).map(r=>n(r,e[r]))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce((n,r)=>{const i=e[r];return"metas"in i?n[r]=i.metas.map(a=>(a.presence_ref=a.phx_ref,delete a.phx_ref,delete a.phx_ref_prev,a)):n[r]=i,n},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var bR;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(bR||(bR={}));var Bp;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(Bp||(Bp={}));var Hs;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(Hs||(Hs={}));class vj{constructor(e,n={config:{}},r){var i,a;if(this.topic=e,this.params=n,this.socket=r,this.bindings={},this.state=Jn.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},n.config),this.timeout=this.socket.timeout,this.joinPush=new mS(this,ja.join,this.params,this.timeout),this.rejoinTimer=new fF(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Jn.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=Jn.closed,this.socket._remove(this)}),this._onError(s=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,s),this.state=Jn.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Jn.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",s=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,s),this.state=Jn.errored,this.rejoinTimer.scheduleTimeout())}),this._on(ja.reply,{},(s,o)=>{this._trigger(this._replyEventName(o),s)}),this.presence=new Fp(this),this.broadcastEndpointURL=mF(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((a=(i=this.params.config)===null||i===void 0?void 0:i.broadcast)===null||a===void 0)&&a.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(e,n=this.timeout){var r,i,a;if(this.socket.isConnected()||this.socket.connect(),this.state==Jn.closed){const{config:{broadcast:s,presence:o,private:c}}=this.params,u=(i=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(p=>p.filter))!==null&&i!==void 0?i:[],d=!!this.bindings[Bp.PRESENCE]&&this.bindings[Bp.PRESENCE].length>0||((a=this.params.config.presence)===null||a===void 0?void 0:a.enabled)===!0,h={},f={broadcast:s,presence:Object.assign(Object.assign({},o),{enabled:d}),postgres_changes:u,private:c};this.socket.accessTokenValue&&(h.access_token=this.socket.accessTokenValue),this._onError(p=>e==null?void 0:e(Hs.CHANNEL_ERROR,p)),this._onClose(()=>e==null?void 0:e(Hs.CLOSED)),this.updateJoinPayload(Object.assign({config:f},h)),this.joinedOnce=!0,this._rejoin(n),this.joinPush.receive("ok",async({postgres_changes:p})=>{var g;if(this.socket.setAuth(),p===void 0){e==null||e(Hs.SUBSCRIBED);return}else{const m=this.bindings.postgres_changes,v=(g=m==null?void 0:m.length)!==null&&g!==void 0?g:0,x=[];for(let w=0;w<v;
550w++){const y=m[w],{filter:{event:k,schema:S,table:_,filter:C}}=y,T=p&&p[w];if(T&&T.event===k&&T.schema===S&&T.table===_&&T.filter===C)x.push(Object.assign(Object.assign({},y),{id:T.id}));else{this.unsubscribe(),this.state=Jn.errored,e==null||e(Hs.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=x,e&&e(Hs.SUBSCRIBED);return}}).receive("error",p=>{this.state=Jn.errored,e==null||e(Hs.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(p).join(", ")||"error")))}).receive("timeout",()=>{e==null||e(Hs.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(e,n={}){return await this.send({type:"presence",event:"track",payload:e},n.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,n,r){return this.state===Jn.joined&&e===Bp.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(()=>this.subscribe())),this._on(e,n,r)}async httpSend(e,n,r={}){var i;const a=this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"";if(n==null)return Promise.reject("Payload is required for httpSend()");const s={method:"POST",headers:{Authorization:a,apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:n,private:this.private}]})},o=await this._fetchWithTimeout(this.broadcastEndpointURL,s,(i=r.timeout)!==null&&i!==void 0?i:this.timeout);if(o.status===202)return{success:!0};let c=o.statusText;try{const u=await o.json();c=u.error||u.message||c}catch{}return Promise.reject(new Error(c))}async send(e,n={}){var r,i;if(!this._canPush()&&e.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated
550in the future. Please use httpSend() explicitly for REST delivery.");const{event:a,payload:s}=e,c={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:a,payload:s,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((i=u.body)===null||i===void 0?void 0:i.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(a=>{var s,o,c;const u=this._push(e.type,e,n.timeout||this.timeout);e.type==="broadcast"&&!(!((c=(o=(s=this.params)===null||s===void 0?void 0:s.config)===null||o===void 0?void 0:o.broadcast)===null||c===void 0)&&c.ack)&&a("ok"),u.receive("ok",()=>a("ok")),u.receive("error",()=>a("error")),u.receive("timeout",()=>a("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=Jn.leaving;const n=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(ja.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(i=>{r=new mS(this,ja.leave,{},e),r.receive("ok",()=>{n(),i("ok")}).receive("timeout",()=>{n(),i("timed out")}).receive("error",()=>{i("error")}),r.send(),this._canPush()||r.trigger("ok",{})}).finally(()=>{r==null||r.destroy()})}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Jn.closed,this.bindings={}}async _fetchWithTimeout(e,n,r){const i=new AbortController,a=setTimeout(()=>i.abort(),r),s=await this.socket.fetch(e,Object.assign(Object.assign({},n),{signal:i.signal}));return clearTimeout(a),s}_push(e,n,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let i=new mS(this,e,n,r);return this._canPush()?i.send():this._addToPushBuffer(i),i}_addToPushBuffer(e){if(e.startTimeout(),this.pushBuffer.push(e),this.pushBuffer.length>pre){const n=this.pushBuffer.shift();n&&(n.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${n.event}`,n.payload))}}_onMessage(e,n,r){return n}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,n,r){var i,a;const s=e.toLocaleLowerCase(),{close:o,error:c,leave:u,join:d}=ja;if(r&&[o,c,u,d].indexOf(s)>=0&&r!==this._joinRef())return;let f=this._onMessage(s,n,r);if(n&&!f)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(s)?(i=this.bindings.postgres_changes)===null||i===void 0||i.filter(p=>{var g,m,v;return((g=p.filter)===null||g===void 0?void 0:g.event)==="*"||((v=(m=p.filter)===null||m===void 0?void 0:m.event)===null||v===void 0?void 0:v.toLocaleLowerCase())===s}).map(p=>p.callback(f,r)):(a=this.bindings[s])===null||a===void 0||a.filter(p=>{var g,m,v,x,w,y;if(["broadcast","presence","postgres_changes"].includes(s))if("id"in p){const k=p.id,S=(g=p.filter)===null||g===void 0?void 0:g.event;return k&&((m=n.ids)===null||m===void 0?void 0:m.includes(k))&&(S==="*"||(S==null?void 0:S.toLocaleLowerCase())===((v=n.data)===null||v===void 0?void 0:v.type.toLocaleLowerCase()))}else{const k=(w=(x=p==null?void 0:p.filter)===null||x===void 0?void 0:x.event)===null||w===void 0?void 0:w.toLocaleLowerCase();return k==="*"||k===((y=n==null?void 0:n.event)===null||y===void 0?void 0:y.toLocaleLowerCase())}else return p.type.toLocaleLowerCase()===s}).map(p=>{if(typeof f=="object"&&"ids"in f){const g=f.data,{schema:m,table:v,commit_timestamp:x,type:w,errors:y}=g;f=Object.assign(Object.assign({},{schema:m,table:v,commit_timestamp:x,eventType:w,new:{},old:{},errors:y}),this._getPayloadRecords(g))}p.callback(f,r)})}_isClosed(){return this.state===Jn.closed}_isJoined(){return this.state===Jn.joined}_isJoining(){return this.state===Jn.joining}_isLeaving(){return this.state===Jn.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,n,r){const i=e.toLocaleLowerCase(),a={type:i,filter:n,callback:r};return this.bindings[i]?this.bindings[i].push(a):this.bindings[i]=[a],this}_off(e,n){const r=e.toLocaleLowerCase();return this.bindings[r]&&(this.bindings[r]=this.bindings[r].filter(i=>{var a;return!(((a=i.type)===null||a===void 0?void 0:a.toLocaleLowerCase())===r&&vj.isEqual(i.filter,n))})),this}static isEqual(e,n){if(Object.keys(e).length!==Object.keys(n).length)return!1;for(const r in e)if(e[r]!==n[r])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(ja.close,{},e)}_onError(e){this._on(ja.error,{},n=>e(n))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Jn.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const n={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(n.new=vR(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(n.old=vR(e.columns,e.old_record)),n}}const gS=()=>{},Yv={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},Sre=[1e3,2e3,5e3,1e4],kre=1e4,_re=` 551 addEventListener("message", (e) => { 552 if (e.data.event === "start") { 553 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 554 } 555 });`;class Cre{constructor(e,n){var r;if(this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=uC,this.transport=null,this.heartbeatIntervalMs=Yv.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=gS,this.ref=0,this.reconnectTimer=null,this.vsn=gR,this.logger=gS,this.conn=null,this.sendBuffer=[],this.serializer
555=new mre,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._resolveFetch=i=>i?(...a)=>i(...a):(...a)=>fetch(...a),!(!((r=n==null?void 0:n.params)===null||r===void 0)&&r.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=n.params.apikey,this.endPoint=`${e}/${dC.websocket}`,this.httpEndpoint=mF(e),this._initializeOptions(n),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(n==null?void 0:n.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=lre.createWebSocket(this.endpointURL())}catch(e){this._setConnectionState("disconnected");const n=e.message;throw n.includes("Node.js")?new Error(`${n} 556 557To use Realtime in Node.js, you need to provide a WebSocket implementation: 558 559Option 1: Use Node.js 22+ which has native WebSocket support 560Option 2: Install and provide the "ws" package: 561 562 npm install ws 563 564 import ws from "ws" 565 const client = new RealtimeClient(url, { 566 ...options, 567 transport: ws 568 })`):new Error(`WebSocket not available: ${n}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(e,n){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const r=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(r),this._setConnectionState("disconnected")},typeof this.conn.close=="function"&&(e?this.conn.close(e,n??""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(e){const n=await e.unsubscribe();return this.channels.length===0&&this.disconnect(),n}async removeAllChannels(){const e=await Promise.all(this.channels.map(n=>n.unsubscribe()));return this.channels=[],this.disconnect(),e}log(e,n,r){this.logger(e,n,r)}connectionState(){switch(this.conn&&this.conn.readyState){case ml.connecting:return gl.Connecting;case ml.open:return gl.Open;case ml.closing:return gl.Closing;default:return gl.Closed}}isConnected(){return this.connectionState()===gl.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(e,n={config:{}}){const r=`realtime:${e}`,i=this.getChannels().find(a=>a.topic===r);if(i)return i;{const a=new vj(`realtime:${e}`,n,this);return this.channels.push(a),a}}push(e){const{topic:n,event:r,payload:i,ref:a}=e,s=()=>{this.encode(e,o=>{var c;(c=this.conn)===null||c===void 0||c.send(o)})};this.log("push",`${n} ${r} (${a})`,i),this.isConnected()?s():this.sendBuffer.push(s)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}async sendHeartbeat(){var e;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(n){this.log("error","error in heartbeat callback",n)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(n){this.log("error","error in heartbeat callback",n)}this._wasManualDisconnect=!1,(e=this.conn)===null||e===void 0||e.close(fre,"heartbeat timeout"),setTimeout(()=>{var n;this.isConnected()||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout()},Yv.HEARTBEAT_TIMEOUT_FALLBACK);return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(n){this.log("error","error in heartbeat callback",n)}this._setAuthSafely("heartbeat")}onHeartbeat(e){this.heartbeatCallback=e}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>
5680&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let n=this.channels.find(r=>r.topic===e&&(r._isJoined()||r._isJoining()));n&&(this.log("transport",`leaving duplicate topic "${e}"`),n.unsubscribe())}_remove(e){this.channels=this.channels.filter(n=>n.topic!==e.topic)}_onConnMessage(e){this.decode(e.data,n=>{if(n.topic==="phoenix"&&n.event==="phx_reply")try{this.heartbeatCallback(n.payload.status==="ok"?"ok":"error")}catch(u){this.log("error","error in heartbeat callback",u)}n.ref&&n.ref===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null);const{topic:r,event:i,payload:a,ref:s}=n,o=s?`(${s})`:"",c=a.status||"";this.log("receive",`${c} ${r} ${i} ${o}`.trim(),a),this.channels.filter(u=>u._isMember(r)).forEach(u=>u._trigger(i,a,s)),this._triggerStateCallbacks("message",n)})}_clearTimer(e){var n;e==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):e==="reconnect"&&((n=this.reconnectTimer)===null||n===void 0||n.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=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e))}_teardownConnection(){if(this.conn){if(this.conn.readyState===ml.open||this.conn.readyState===ml.connecting)try{this.conn.close()}catch(e){this.log("error","Error closing connection",e)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this.channels.forEach(e=>e.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(n=>{this.log("error","error waiting for auth on connect",n),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");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=n=>{this.log("worker","worker error",n.message),this.workerRef.terminate()},this.workerRef.onmessage=n=>{n.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_onConnClose(e){var n;this._setConnectionState("disconnected"),this.log("transport","close",e),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout(),this._triggerStateCallbacks("close",e)}_onConnError(e){this._setConnectionState("disconnected"),this.log("transport",`${e}`),this._triggerChanError(),this._triggerStateCallbacks("error",e)}_triggerChanError(){this.channels.forEach(e=>e._trigger(ja.error))}_appendParams(e,n){if(Object.keys(n).length===0)return e;const r=e.match(/\?/)?"&":"?",i=new URLSearchParams(n);return`${e}${r}${i}`}_workerObjectUrl(e){let n;if(e)n=e;else{const r=new Blob([_re],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}_setConnectionState(e,n=!1){this._connectionState=e,e==="connecting"?this._wasManualDisconnect=!1:e==="disconnecting"&&(this._wasManualDisconnect=n)}async _performAuth(e=null){let n;e?n=e:this.accessToken?n=await this.accessToken():n=this.accessTokenValue,this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(r=>{const i={access_token:n,version:dre};n&&r.updateJoinPayload(i),r.joinedOnce&&r._isJoined()&&r._push(ja.access_token,{access_token:n})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this.setAuth().catch(n=>{this.log("error",`error setting auth in ${e}`,n)})}_triggerStateCallbacks(e,n){try{this.stateChangeCallbacks[e].forEach(r=>{try{r(n)}catch(i){this.log("error",`error in ${e} callback`,i)}})}catch(r){this.log("error",`error triggering ${e} callbacks`,r)}}_setupReconnectionTimer(){this.reconnectTimer=new fF(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},Yv.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(e){var n,r,i,a,s,o,c,u,d,h,f,p;switch(this.transport=(n=e==null?void 0:e.transport)!==null&&n!==void 0?n:null,this.timeout=(r=e==null?void 0:e.timeout)!==null&&r!==void 0?r:uC,this.heartbeatIntervalMs=(i=e==null?void 0:e.heartbeatIntervalMs)!==null&&i!==void 0?i:Yv.HEARTBEAT_INTERVAL,this.worker=(a=e==null?void 0:e.worker)!==null&&a!==void 0?a:!1,this.accessToken=(s=e==null?void 0:e.accessToken)!==null&&s!==void 0?s:null,this.heartbeatCallback=(o=e==null?void 0:e.heartbeatCallback)!==null&&o!==void 0?o:gS,this.vsn=(c=e==null?void 0:e.vsn)!==null&&c!==void 0?c:gR,e!=null&&e.params&&(this.params=e.params),e!=null&&e.logger&&(this.logger=e.logger),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(u=e==null?void 0:e.reconnectAfterMs)!==null&&u!==void 0?u:g=>Sre[g-1]||kre,this.vsn){case hF:this.encode=(d=e==null?void 0:e.encode)!==null&&d!==void 0?d:(g,m)=>m(JSON.stringify(g)),this.decode=(h=e==null?void 0:e.decode)!==null&&h!==void 0?h:(g,m)=>m(JSON.parse(g));break;case hre:this.encode=(f=e==null?void 0:e.encode)!==null&&f!==void 0?f:this.serializer.encode.bind(this.serializer),this.decode=(p=e==null?void 0:e.decode)!==null&&p!==void 0?p:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl}}}
568class yj extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function xn(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}class Tre extends yj{constructor(e,n,r){super(e),this.name="StorageApiError",this.status=n,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class fC extends yj{constructor(e,n){super(e),this.name="StorageUnknownError",this.originalError=n}}const bj=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),Ere=()=>Response,pC=t=>{if(Array.isArray(t))return t.map(n=>pC(n));if(typeof t=="function"||t!==Object(t))return t;const e={};return Object.entries(t).forEach(([n,r])=>{const i=n.replace(/([-_][a-z])/gi,a=>a.toUpperCase().replace(/[-_]/g,""));e[i]=pC(r)}),e},jre=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},vS=t=>{var e;return t.msg||t.message||t.error_description||(typeof t.error=="string"?t.error:(e=t.error)===null||e===void 0?void 0:e.message)||JSON.stringify(t)},Pre=(t,e,n)=>We(void 0,void 0,void 0,function*(){const r=yield Ere();t instanceof r&&!(n!=null&&n.noResolveJson)?t.json().then(i=>{const a=t.status||500,s=(i==null?void 0:i.statusCode)||a+"";e(new Tre(vS(i),a,s))}).catch(i=>{e(new fC(vS(i),i))}):e(new fC(vS(t),t))}),Nre=(t,e,n,r)=>{const i={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"||!r?i:(jre(r)?(i.headers=Object.assign({"Content-Type":"application/json"},e==null?void 0:e.headers),i.body=JSON.stringify(r)):i.body=r,e!=null&&e.duplex&&(i.duplex=e.duplex),Object.assign(Object.assign({},i),n))};function Gg(t,e,n,r,i,a){return We(this,void 0,void 0,function*(){return new Promise((s,o)=>{t(n,Nre(e,r,i,a)).then(c=>{if(!c.ok)throw c;return r!=null&&r.noResolveJson?c:c.json()}).then(c=>s(c)).catch(c=>Pre(c,o,r))})})}function Pm(t,e,n,r){return We(this,void 0,void 0,function*(){return Gg(t,"GET",e,n,r)})}function ka(t,e,n,r,i){return We(this,void 0,void 0,function*(){return Gg(t,"POST",e,r,i,n)})}function mC(t,e,n,r,i){return We(this,void 0,void 0,function*(){return Gg(t,"PUT",e,r,i,n)})}function Are(t,e,n,r){return We(this,void 0,void 0,function*(){return Gg(t,"HEAD",e,Object.assign(Object.assign({},n),{noResolveJson:!0}),r)})}function xj(t,e,n,r,i){return We(this,void 0,void 0,function*(){return Gg(t,"DELETE",e,r,i,n)})}class Ore{constructor(e,n){this.downloadFn=e,this.shouldThrowOnError=n}then(e,n){return this.execute().then(e,n)}execute(){return We(this,void 0,void 0,function*(){try{return{data:(yield this.downloadFn()).body,error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(xn(e))return{data:null,error:e};throw e}})}}var gF;class Rre{constructor(e,n){this.downloadFn=e,this.shouldThrowOnError=n,this[gF]="BlobDownloadBuilder",this.promise=null}asStream(){return new Ore(this.downloadFn,this.shouldThrowOnError)}then(e,n){return this.getPromise().then(e,n)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}execute(){return We(this,void 0,void 0,function*(){try{return{data:yield(yield this.downloadFn()).blob(),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(xn(e))return{data:null,error:e};throw e}})}}gF=Symbol.toStringTag;const Dre={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},xR={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class Mre{constructor(e,n={},r,i){this.shouldThrowOnError=!1,this.url=e,this.headers=n,this.bucketId=r,this.fetch=bj(i)}throwOnError(){return this.shouldThrowOnError=!0,this}uploadOrUpdate(e,n,r,i){return We(this,void 0,void 0,function*(){try{let a;const s=Object.assign(Object.assign({},xR),i);let o=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(s.upsert)});const c=s.metadata;typeof Blob<"u"&&r instanceof Blob?(a=new FormData,a.append("cacheControl",s.cacheControl),c&&a.append("metadata",this.encodeMetadata(c)),a.append("",r)):typeof FormData<"u"&&r instanceof FormData?(a=r,a.has("cacheControl")||a.append("cacheControl",s.cacheControl),c&&!a.has("metadata")&&a.append("metadata",this.encodeMetadata(c))):(a=r,o["cache-control"]=`max-age=${s.cacheControl}`,o["content-type"]=s.contentType,c&&(o["x-metadata"]=this.toBase64(this.encodeMetadata(c))),(typeof ReadableStream<"u"&&a
568instanceof ReadableStream||a&&typeof a=="object"&&"pipe"in a&&typeof a.pipe=="function")&&!s.duplex&&(s.duplex="half")),i!=null&&i.headers&&(o=Object.assign(Object.assign({},o),i.headers));const u=this._removeEmptyFolders(n),d=this._getFinalPath(u),h=yield(e=="PUT"?mC:ka)(this.fetch,`${this.url}/object/${d}`,a,Object.assign({headers:o},s!=null&&s.duplex?{duplex:s.duplex}:{}));return{data:{path:u,id:h.Id,fullPath:h.Key},error:null}}catch(a){if(this.shouldThrowOnError)throw a;if(xn(a))return{data:null,error:a};throw a}})}upload(e,n,r){return We(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,n,r)})}uploadToSignedUrl(e,n,r,i){return We(this,void 0,void 0,function*(){const a=this._removeEmptyFolders(e),s=this._getFinalPath(a),o=new URL(this.url+`/object/upload/sign/${s}`);o.searchParams.set("token",n);try{let c;const u=Object.assign({upsert:xR.upsert},i),d=Object.assign(Object.assign({},this.headers),{"x-upsert":String(u.upsert)});typeof Blob<"u"&&r instanceof Blob?(c=new FormData,c.append("cacheControl",u.cacheControl),c.append("",r)):typeof FormData<"u"&&r instanceof FormData?(c=r,c.append("cacheControl",u.cacheControl)):(c=r,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType);const h=yield mC(this.fetch,o.toString(),c,{headers:d});return{data:{path:a,fullPath:h.Key},error:null}}catch(c){if(this.shouldThrowOnError)throw c;if(xn(c))return{data:null,error:c};throw c}})}createSignedUploadUrl(e,n){return We(this,void 0,void 0,function*(){try{let r=this._getFinalPath(e);const i=Object.assign({},this.headers);n!=null&&n.upsert&&(i["x-upsert"]="true");const a=yield ka(this.fetch,`${this.url}/object/upload/sign/${r}`,{},{headers:i}),s=new URL(this.url+a.url),o=s.searchParams.get("token");if(!o)throw new yj("No token returned by API");return{data:{signedUrl:s.toString(),path:e,token:o},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(xn(r))return{data:null,error:r};throw r}})}update(e,n,r){return We(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,n,r)})}move(e,n,r){return We(this,void 0,void 0,function*(){try{return{data:yield ka(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:n,destinationBucket:r==null?void 0:r.destinationBucket},{headers:this.headers}),error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(xn(i))return{data:null,error:i};throw i}})}copy(e,n,r){return We(this,void 0,void 0,function*(){try{return{data:{path:(yield ka(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:n,destinationBucket:r==null?void 0:r.destinationBucket},{headers:this.headers})).Key},error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(xn(i))return{data:null,error:i};throw i}})}createSignedUrl(e,n,r){return We(this,void 0,void 0,function*(){try{let i=this._getFinalPath(e),a=yield ka(this.fetch,`${this.url}/object/sign/${i}`,Object.assign({expiresIn:n},r!=null&&r.transform?{transform:r.transform}:{}),{headers:this.headers});const s=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return a={signedUrl:encodeURI(`${this.url}${a.signedURL}${s}`)},{data:a,error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(xn(i))return{data:null,error:i};throw i}})}createSignedUrls(e,n,r){return We(this,void 0,void 0,function*(){try{const i=yield ka(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:n,paths:e},{headers:this.headers}),a=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return{data:i.map(s=>Object.assign(Object.assign({},s),{signedUrl:s.signedURL?encodeURI(`${this.url}${s.signedURL}${a}`):null})),error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(xn(i))return{data:null,error:i};throw i}})}download(e,n){const i=typeof(n==null?void 0:n.transform)<"u"?"render/image/authenticated":"object",a=this.transformOptsToQueryString((n==null?void 0:n.transform)||{}),s=a?`?${a}`:"",o=this._getFinalPath(e),c=()=>Pm(this.fetch,`${this.url}/${i}/${o}${s}`,{headers:this.headers,noResolveJson:!0});return new Rre(c,this.shouldThrowOnError)}info(e){return We(this,void 0,void 0,function*(){const n=this._getFinalPath(e);try{const r=yield Pm(this.fetch,`${this.url}/object/info/${n}`,{headers:this.headers});return{data:pC(r),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(xn(r))return{data:null,error:r};throw r}})}exists(e){return We(this,void 0,void 0,function*(){const n=this._getFinalPath(e);try{return yield Are(this.fetch,`${this.url}/object/${n}`,{headers:this.headers}),{data:!0,error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(xn(r)&&r instanceof fC){const i=r.originalError;if([400,404].includes(i==null?void 0:i.status))return{data:!1,error:r}}throw r}})}getPublicUrl(e,n){const r=this._getFinalPath(e),i=[],a=n!=null&&n.download?`download=${n.download===!0?"":n.download}`:"";a!==""&&i.push(a);const o=typeof(n==null?void 0:n.transform)<"u"?"render/image":"object",c=this.transformOptsToQueryString((n==null?void 0:n.transform)||{});c!==""&&i.push(c);let u=i.join("&");return u!==""&&(u=`?${u}`),{data:{publicUrl:encodeURI(`${this.url}/${o}/public/${r}${u}`)}}}remove(e){return We(this,void 0,void 0,function*(){try{return{data:yield xj(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(xn(n))return{data:null,error:n};throw n}})}list(e,n,r){return We(this,void 0,void 0,function*(){try{const i=Object.assign(Object.assign(Object.assign({},Dre),n),{prefix:e||""});return{data:yield ka(this.fetch,`${this.url}/object/list/${this.bucketId}`,i,{headers:this.headers},r),error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(xn(i))return{data:null,error:i};throw i}})}listV2(e,n){return We(this,void 0,void 0,function*(){try{const r=Object.assign({},e);return{data:yield ka(this.fetch,`${this.url}/object/list-v2/${this.bucketId}`,r,{headers:this.headers},n),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(xn(r))return{data:null,error:r};throw r}})}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){const n=[];return e.width&&n.push(`width=${e.width}`),e.height&&n.push(`height=${e.height}`),e.resize&&n.push(`resize=${e.resize}`),e.format&&n.push(`format=${e.format}`),e.quality&&n.push(`quality=${e.quality}`),n.join("&")}}const vF="2.84.0",yF={"X-Client-Info":`storage-js/${vF}`};class Ire{constructor(e,n={},r,i){this.shouldThrowOnError=!1;const a=new URL(e);i!=null&&i.useNewHostname&&/supabase\.(co|in|red)$/.test(a.hostname)&&!a.hostname.includes("storage.supabase.")&&(a.hostname=a.hostname.replace("supabase.","storage.supabase.")),this.url=a.href.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},yF),n),this.fetch=bj(r)}throwOnError(){return this.shouldThrowOnError=!0,this}listBuckets(e){return We(this,void 0,void 0,function*(){try{const n=this.listBucketOptionsToQueryString(e);return{data:yield Pm(this.fetch,`${this.url}/bucket${n}`,{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(xn(n))return{data:null,error:n};throw n}})}getBucket(e){return We(this,void 0,void 0,function*(){try{return{data:yield Pm(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(xn(n))return{data:null,error:n};throw n}})}createBucket(e){return We(this,arguments,void 0,function*(n,r={public:!1}){try{return{data:yield ka(this.fetch,`${this.url}/bucket`,{id:n,name:n,type:r.type,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(xn(i))return{data:null,error:i};throw i}})}updateBucket(e,n){return We(this,void 0,void 0,function*(){try{return{data:yield mC(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(xn(r))return{data:null,error:r};throw r}})}emptyBucket(e){return We(this,void 0,void 0,function*(){try{return{data:yield ka(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(xn(n))return{data:null,error:n};throw n}})}deleteBucket(e){return We(this,void 0,void 0,function*(){try{return{data:yield xj(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(xn(n))return{data:null,error:n};throw n}})}listBucketOptionsToQueryString(e){const n={};return e&&("limit"in e&&(n.limit=String(e.limit)),"offset"in e&&(n.offset=String(e.offset)),e.search&&(n.search=e.search),e.sortColumn&&(n.sortColumn=e.sortColumn),e.sortOrder&&(n.sortOrder=e.sortOrder)),Object.keys(n).length>0?"?"+new URLSearchParams(n).toString():""}}class Lre{constructor(e,n={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},yF),n),this.fetch=bj(r)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(e){return We(this,void 0,void 0,function*(){try{return{data:yield ka(this.fetch,`${this.url}/bucket`,{name:e},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(xn(n))return{data:null,error:n};throw n}})}listBuckets(e){return We(this,void 0,void 0,function*(){try{const n=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&n.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&n.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&n.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&n.set("sortOrder",e.sortOrder),e!=null&&e.search&&n.set("search",e.search);const r=n.toString(),i=r?`${this.url}/bucket?${r}`:`${this.url}/bucket`;return{data:yield Pm(this.fetch,i,{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(xn(n))return{data:null,error:n};throw n}})}deleteBucket(e){return We(this,void 0,void 0,function*(){try{return{data:yield xj(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(xn(n))return{data:null,error:n};throw n}})}}const wj={"X-Client-Info":`storage-js/${vF}`,"Content-Type":"application/json"};
568class bF extends Error{constructor(e){super(e),this.__isStorageVectorsError=!0,this.name="StorageVectorsError"}}function Si(t){return typeof t=="object"&&t!==null&&"__isStorageVectorsError"in t}class yS extends bF{constructor(e,n,r){super(e),this.name="StorageVectorsApiError",this.status=n,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class $re extends bF{constructor(e,n){super(e),this.name="StorageVectorsUnknownError",this.originalError=n}}var wR;(function(t){t.InternalError="InternalError",t.S3VectorConflictException="S3VectorConflictException",t.S3VectorNotFoundException="S3VectorNotFoundException",t.S3VectorBucketNotEmpty="S3VectorBucketNotEmpty",t.S3VectorMaxBucketsExceeded="S3VectorMaxBucketsExceeded",t.S3VectorMaxIndexesExceeded="S3VectorMaxIndexesExceeded"})(wR||(wR={}));const Sj=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),Fre=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},SR=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),Bre=(t,e,n)=>We(void 0,void 0,void 0,function*(){if(t&&typeof t=="object"&&"status"in t&&"ok"in t&&typeof t.status=="number"&&!(n!=null&&n.noResolveJson)){const i=t.status||500,a=t;if(typeof a.json=="function")a.json().then(s=>{const o=(s==null?void 0:s.statusCode)||(s==null?void 0:s.code)||i+"";e(new yS(SR(s),i,o))}).catch(()=>{const s=i+"",o=a.statusText||`HTTP ${i} error`;e(new yS(o,i,s))});else{const s=i+"",o=a.statusText||`HTTP ${i} error`;e(new yS(o,i,s))}}else e(new $re(SR(t),t))}),Ure=(t,e,n,r)=>{const i={method:t,headers:(e==null?void 0:e.headers)||{}};return r?(Fre(r)?(i.headers=Object.assign({"Content-Type":"application/json"},e==null?void 0:e.headers),i.body=JSON.stringify(r)):i.body=r,Object.assign(Object.assign({},i),n)):i};function zre(t,e,n,r,i,a){return We(this,void 0,void 0,function*(){return new Promise((s,o)=>{t(n,Ure(e,r,i,a)).then(c=>{if(!c.ok)throw c;if(r!=null&&r.noResolveJson)return c;const u=c.headers.get("content-type");return!u||!u.includes("application/json")?{}:c.json()}).then(c=>s(c)).catch(c=>Bre(c,o,r))})})}function ki(t,e,n,r,i){return We(this,void 0,void 0,function*(){return zre(t,"POST",e,r,i,n)})}class Wre{constructor(e,n={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},wj),n),this.fetch=Sj(r)}throwOnError(){return this.shouldThrowOnError=!0,this}createIndex(e){return We(this,void 0,void 0,function*(){try{return{data:(yield ki(this.fetch,`${this.url}/CreateIndex`,e,{headers:this.headers}))||{},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Si(n))return{data:null,error:n};throw n}})}getIndex(e,n){return We(this,void 0,void 0,function*(){try{return{data:yield ki(this.fetch,`${this.url}/GetIndex`,{vectorBucketName:e,indexName:n},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Si(r))return{data:null,error:r};throw r}})}listIndexes(e){return We(this,void 0,void 0,function*(){try{return{data:yield ki(this.fetch,`${this.url}/ListIndexes`,e,{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Si(n))return{data:null,error:n};throw n}})}deleteIndex(e,n){return We(this,void 0,void 0,function*(){try{return{data:(yield ki(this.fetch,`${this.url}/DeleteIndex`,{vectorBucketName:e,indexName:n},{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Si(r))return{data:null,error:r};throw r}})}}class Vre{constructor(e,n={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},wj),n),this.fetch=Sj(r)}throwOnError(){return this.shouldThrowOnError=!0,this}putVectors(e){return We(this,void 0,void 0,function*(){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:(yield ki(this.fetch,`${this.url}/PutVectors`,e,{headers:this.headers}))||{},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Si(n))return{data:null,error:n};throw n}})}getVectors(e){return We(this,void 0,void 0,function*(){try{return{data:yield ki(this.fetch,`${this.url}/GetVectors`,e,{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Si(n))return{data:null,error:n};throw n}})}listVectors(e){return We(this,void 0,void 0,function*(){try{if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");
568if(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:yield ki(this.fetch,`${this.url}/ListVectors`,e,{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Si(n))return{data:null,error:n};throw n}})}queryVectors(e){return We(this,void 0,void 0,function*(){try{return{data:yield ki(this.fetch,`${this.url}/QueryVectors`,e,{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Si(n))return{data:null,error:n};throw n}})}deleteVectors(e){return We(this,void 0,void 0,function*(){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:(yield ki(this.fetch,`${this.url}/DeleteVectors`,e,{headers:this.headers}))||{},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Si(n))return{data:null,error:n};throw n}})}}class Hre{constructor(e,n={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},wj),n),this.fetch=Sj(r)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(e){return We(this,void 0,void 0,function*(){try{return{data:(yield ki(this.fetch,`${this.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:this.headers}))||{},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Si(n))return{data:null,error:n};throw n}})}getBucket(e){return We(this,void 0,void 0,function*(){try{return{data:yield ki(this.fetch,`${this.url}/GetVectorBucket`,{vectorBucketName:e},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Si(n))return{data:null,error:n};throw n}})}listBuckets(){return We(this,arguments,void 0,function*(e={}){try{return{data:yield ki(this.fetch,`${this.url}/ListVectorBuckets`,e,{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Si(n))return{data:null,error:n};throw n}})}deleteBucket(e){return We(this,void 0,void 0,function*(){try{return{data:(yield ki(this.fetch,`${this.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:this.headers}))||{},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Si(n))return{data:null,error:n};throw n}})}}class qre extends Hre{constructor(e,n={}){super(e,n.headers||{},n.fetch)}from(e){return new Kre(this.url,this.headers,e,this.fetch)}}class Kre extends Wre{constructor(e,n,r,i){super(e,n,i),this.vectorBucketName=r}createIndex(e){const n=Object.create(null,{createIndex:{get:()=>super.createIndex}});return We(this,void 0,void 0,function*(){return n.createIndex.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName}))})}listIndexes(){const e=Object.create(null,{listIndexes:{get:()=>super.listIndexes}});return We(this,arguments,void 0,function*(n={}){return e.listIndexes.call(this,Object.assign(Object.assign({},n),{vectorBucketName:this.vectorBucketName}))})}getIndex(e){const n=Object.create(null,{getIndex:{get:()=>super.getIndex}});return We(this,void 0,void 0,function*(){return n.getIndex.call(this,this.vectorBucketName,e)})}deleteIndex(e){const n=Object.create(null,{deleteIndex:{get:()=>super.deleteIndex}});return We(this,void 0,void 0,function*(){return n.deleteIndex.call(this,this.vectorBucketName,e)})}index(e){return new Gre(this.url,this.headers,this.vectorBucketName,e,this.fetch)}}class Gre extends Vre{constructor(e,n,r,i,a){super(e,n,a),this.vectorBucketName=r,this.indexName=i}putVectors(e){const n=Object.create(null,{putVectors:{get:()=>super.putVectors}});return We(this,void 0,void 0,function*(){return n.putVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}getVectors(e){const n=Object.create(null,{getVectors:{get:()=>super.getVectors}});return We(this,void 0,void 0,function*(){return n.getVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}listVectors(){const e=Object.create(null,{listVectors:{get:()=>super.listVectors}});return We(this,arguments,void 0,function*(n={}){return e.listVectors.call(this,Object.assign(Object.assign({},n),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}queryVectors(e){const n=Object.create(null,{queryVectors:{get:()=>super.queryVectors}});return We(this,void 0,void 0,function*(){return n.queryVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}deleteVectors(e){const n=Object.create(null,{deleteVectors:{get:()=>super.deleteVectors}});return We(this,void 0,void 0,function*(){return n.deleteVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}}class Yre extends Ire{constructor(e,n={},r,i){super(e,n,r,i)}from(e){return new Mre(this.url,this.headers,e,this.fetch)}get vectors(){return new qre(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new Lre(this.url+"/iceberg",this.headers,this.fetch)}}const Jre="2.84.0";let Sp="";typeof Deno<"u"?Sp="deno":typeof document<"u"?Sp="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Sp="react-native":Sp="node";const Xre={"X-Client-Info":`supabase-js-${Sp}/${Jre}`},Zre={headers:Xre},Qre={schema:"public"},eie={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},tie={},nie=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),rie=()=>Headers,iie=(t,e,n)=>{const r=nie(n),i=rie();return async(a,s)=>{var o;const c=(o=await e())!==null&&o!==void 0?o:t;let u=new i(s==null?void 0:s.headers);return u.has("apikey")||u.set("apikey",t),u.has("Authorization")||u.set("Authorization",`Bearer ${c}`),r(a,Object.assign(Object.assign({},s),{headers:u}))}};function aie(t){return t.endsWith("/")?t:t+"/"}function sie(t,e){var n,r;const{db:i,auth:a,realtime:s,global:o}=t,{db:c,auth:u,realtime:d,global:h}=e,f={db:Object.assign(Object.assign({},c),i),auth:Object.assign(Object.assign({},u),a),realtime:Object.assign(Object.assign({},d),s),storage:{},global:Object.assign(Object.assign(Object.assign({},h),o),{headers:Object.assign(Object.assign({},(n=h==null?void 0:h.headers)!==null&&n!==void 0?n:{}),(r=o==null?void 0:o.headers)!==null&&r!==void 0?r:{})}),accessToken:async()=>""};return t.accessToken?f.accessToken=t.accessToken:delete f.accessToken,f}function oie(t){const e=t==null?void 0:t.trim();if(!e)throw new Error("supabaseUrl is required.");
568if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(aie(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}const xF="2.84.0",Qu=30*1e3,gC=3,bS=gC*Qu,cie="http://localhost:9999",lie="supabase.auth.token",uie={"X-Client-Info":`gotrue-js/${xF}`},vC="X-Supabase-Api-Version",wF={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},die=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,hie=10*60*1e3;class Nm extends Error{constructor(e,n,r){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}}function Ve(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class fie extends Nm{constructor(e,n,r){super(e,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function pie(t){return Ve(t)&&t.name==="AuthApiError"}class vl extends Nm{constructor(e,n){super(e),this.name="AuthUnknownError",this.originalError=n}}class zc extends Nm{constructor(e,n,r,i){super(e,r,i),this.name=n,this.status=r}}class mi extends zc{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function mie(t){return Ve(t)&&t.name==="AuthSessionMissingError"}class Mu extends zc{constructor(){super("Auth session or user missing","AuthInvalidToken
568ResponseError",500,void 0)}}class Jv extends zc{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class Xv extends zc{constructor(e,n=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function gie(t){return Ve(t)&&t.name==="AuthImplicitGrantRedirectError"}class kR extends zc{constructor(e,n=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class yC extends zc{constructor(e,n){super(e,"AuthRetryableFetchError",n,void 0)}}function xS(t){return Ve(t)&&t.name==="AuthRetryableFetchError"}class _R extends zc{constructor(e,n,r){super(e,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}}class bC extends zc{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const L0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),CR=` 569\r=`.split(""),vie=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<CR.length;e+=1)t[CR[e].charCodeAt(0)]=-2;for(let e=0;e<L0.length;e+=1)t[L0[e].charCodeAt(0)]=e;return t})();function TR(t,e,n){if(t!==null)for(e.queue=e.queue<<8|t,e.queuedBits+=8;e.queuedBits>=6;){const r=e.queue>>e.queuedBits-6&63;n(L0[r]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){const r=e.queue>>e.queuedBits-6&63;n(L0[r]),e.queuedBits-=6}}function SF(t,e,n){const r=vie[t];if(r>-1)for(e.queue=e.queue<<6|r,e.queuedBits+=6;e.queuedBits>=8;)n(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(t)}"`)}}function ER(t){const e=[],n=s=>{e.push(String.fromCodePoint(s))},r={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},a=s=>{xie(s,r,n)};for(let s=0;s<t.length;s+=1)SF(t.charCodeAt(s),i,a);return e.join("")}function yie(t,e){if(t<=127){e(t);return}else if(t<=2047){e(192|t>>6),e(128|t&63);return}else if(t<=65535){e(224|t>>12),e(128|t>>6&63),e(128|t&63);return}else if(t<=1114111){e(240|t>>18),e(128|t>>12&63),e(128|t>>6&63),e(128|t&63);return}throw new Error(`Unrecognized Unicode codepoint: ${t.toString(16)}`)}function bie(t,e){for(let n=0;n<t.length;n+=1){let r=t.charCodeAt(n);if(r>55295&&r<=56319){const i=(r-55296)*1024&65535;r=(t.charCodeAt(n+1)-56320&65535|i)+65536,n+=1}yie(r,e)}}function xie(t,e,n){if(e.utf8seq===0){if(t<=127){n(t);return}for(let r=1;r<6;r+=1)if(!(t>>7-r&1)){e.utf8seq=r;break}if(e.utf8seq===2)e.codepoint=t&31;else if(e.utf8seq===3)e.codepoint=t&15;else if(e.utf8seq===4)e.codepoint=t&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(t<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|t&63,e.utf8seq-=1,e.utf8seq===0&&n(e.codepoint)}}function Od(t){const e=[],n={queue:0,queuedBits:0},r=i=>{e.push(i)};for(let i=0;i<t.length;i+=1)SF(t.charCodeAt(i),n,r);return new Uint8Array(e)}function wie(t){const e=[];return bie(t,n=>e.push(n)),new Uint8Array(e)}function jl(t){const e=[],n={queue:0,queuedBits:0},r=i=>{e.push(i)};return t.forEach(i=>TR(i,n,r)),TR(null,n,r),e.join("")}function Sie(t){return Math.round(Date.now()/1e3)+t}function kie(){return Symbol("auth-callback")}const hr=()=>typeof window<"u"&&typeof document<"u",el={tested:!1,writable:!1},kF=()=>
569{if(!hr())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(el.tested)return el.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),el.tested=!0,el.writable=!0}catch{el.tested=!0,el.writable=!1}return el.writable};function _ie(t){const e={},n=new URL(t);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((i,a)=>{e[a]=i})}catch{}return n.searchParams.forEach((r,i)=>{e[i]=r}),e}const _F=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),Cie=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",ed=async(t,e,n)=>{await t.setItem(e,JSON.stringify(n))},tl=async(t,e)=>{const n=await t.getItem(e);if(!n)return null;try{return JSON.parse(n)}catch{return n}},Oo=async(t,e)=>{await t.removeItem(e)};class Kx{constructor(){this.promise=new Kx.promiseConstructor((e,n)=>{this.resolve=e,this.reject=n})}}Kx.promiseConstructor=Promise;function wS(t){const e=t.split(".");if(e.length!==3)throw new bC("Invalid JWT structure");for(let r=0;r<e.length;r++)if(!die.test(e[r]))throw new bC("JWT not in base64url format");return{header:JSON.parse(ER(e[0])),payload:JSON.parse(ER(e[1])),signature:Od(e[2]),raw:{header:e[0],payload:e[1]}}}async function Tie(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function Eie(t,e){return new Promise((r,i)=>{(async()=>{for(let a=0;a<1/0;a++)try{const s=await t(a);if(!e(a,null,s)){r(s);return}}catch(s){if(!e(a,s)){i(s);return}}})()})}function jie(t){return("0"+t.toString(16)).substr(-2)}function Pie(){const e=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let i="";for(let a=0;a<56;a++)i+=n.charAt(Math.floor(Math.random()*r));return i}return crypto.getRandomValues(e),Array.from(e,jie).join("")}async function Nie(t){const n=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-256",n),i=new Uint8Array(r);return Array.from(i).map(a=>String.fromCharCode(a)).join("")}async function Aie(t){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."),t;const n=await Nie(t);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Iu(t,e,n=!1){const r=Pie();let i=r;n&&(i+="/PASSWORD_RECOVERY"),await ed(t,`${e}-code-verifier`,i);const a=await Aie(r);return[a,r===a?"plain":"s256"]}const Oie=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function Rie(t){const e=t.headers.get(vC);if(!e||!e.match(Oie))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function Die(t){if(!t)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(t<=e)throw new Error("JWT has expired")}function Mie(t){switch(t){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")}}const Iie=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Lu(t){if(!Iie.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function SS(){const t={};return new Proxy(t,{get:(e,n)=>{if(n==="__isUserNotAvailableProxy")return!0;if(typeof n=="symbol"){const r=n.toString();if(r==="Symbol(Symbol.toPrimitive)"||r==="Symbol(Symbol.toStringTag)"||r==="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 "${n}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function Lie(t,e){return new Proxy(t,{get:(n,r,i)=>{if(r==="__isInsecureUserWarningProxy")return!0;
569if(typeof r=="symbol"){const a=r.toString();if(a==="Symbol(Symbol.toPrimitive)"||a==="Symbol(Symbol.toStringTag)"||a==="Symbol(util.inspect.custom)"||a==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(n,r,i)}return!e.value&&typeof r=="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."),e.value=!0),Reflect.get(n,r,i)}})}function jR(t){return JSON.parse(JSON.stringify(t))}const ol=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),$ie=[502,503,504];async function PR(t){var e;if(!Cie(t))throw new yC(ol(t),0);if($ie.includes(t.status))throw new yC(ol(t),t.status);let n;try{n=await t.json()}catch(a){throw new vl(ol(a),a)}let r;const i=Rie(t);if(i&&i.getTime()>=wF["2024-01-01"].timestamp&&typeof n=="object"&&n&&typeof n.code=="string"?r=n.code:typeof n=="object"&&n&&typeof n.error_code=="string"&&(r=n.error_code),r){if(r==="weak_password")throw new _R(ol(n),t.status,((e=n.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(r==="session_not_found")throw new mi}else if(typeof n=="object"&&n&&typeof n.weak_password=="object"&&n.weak_password&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.reasons.reduce((a,s)=>a&&typeof s=="string",!0))throw new _R(ol(n),t.status,n.weak_password.reasons);throw new fie(ol(n),t.status||500,r)}const Fie=(t,e,n,r)=>{const i={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),i.body=JSON.stringify(r),Object.assign(Object.assign({},i),n))};async function Ze(t,e,n,r){var i;const a=Object.assign({},r==null?void 0:r.headers);a[vC]||(a[vC]=wF["2024-01-01"].name),r!=null&&r.jwt&&(a.Authorization=`Bearer ${r.jwt}`);const s=(i=r==null?void 0:r.query)!==null&&i!==void 0?i:{};r!=null&&r.redirectTo&&(s.redirect_to=r.redirectTo);const o=Object.keys(s).length?"?"+new URLSearchParams(s).toString():"",c=await Bie(t,e,n+o,{headers:a,noResolveJson:r==null?void 0:r.noResolveJson},{},r==null?void 0:r.body);return r!=null&&r.xform?r==null?void 0:r.xform(c):{data:Object.assign({},c),error:null}}async function Bie(t,e,n,r,i,a){const s=Fie(e,r,i,a);let o;try{o=await t(n,Object.assign({},s))}catch(c){throw console.error(c),new yC(ol(c),0)}if(o.ok||await PR(o),r!=null&&r.noResolveJson)return o;try{return await o.json()}catch(c){await PR(c)}}function ya(t){var e;let n=null;Wie(t)&&(n=Object.assign({},t),t.expires_at||(n.expires_at=Sie(t.expires_in)));const r=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:n,user:r},error:null}}function NR(t){const e=ya(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((n,r)=>n&&typeof r=="string",!0)&&(e.data.weak_password=t.weak_password),e}function Ho(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function Uie(t){return{data:t,error:null}}function zie(t){const{action_link:e,email_otp:n,hashed_token:r,redirect_to:i,verification_type:a}=t,s=Uc(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),o={action_link:e,email_otp:n,hashed_token:r,redirect_to:i,verification_type:a},c=Object.assign({},s);return{data:{properties:o,user:c},error:null}}function AR(t){return t}function Wie(t){return t.access_token&&t.refresh_token&&t.expires_in}const kS=["global","local","others"];class Vie{constructor({url:e="",headers:n={},fetch:r}){this.url=e,this.headers=n,this.fetch=_F(r),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(e,n=kS[0]){if(kS.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${kS.join(", ")}`);try{return await Ze(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Ve(r))return{data:null,error:r};throw r}}async inviteUserByEmail(e,n={}){try{return await Ze(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:Ho})}catch(r){if(Ve(r))return{data:{user:null},error:r};throw r}}async generateLink(e){try{const{options:n}=e,r=Uc(e,["options"]),i=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(i.new_email=r==null?void 0:r.newEmail,delete i.newEmail),await Ze(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:zie,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(Ve(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(e){try{return await Ze(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:Ho})}catch(n){if(Ve(n))return{data:{user:null},error:n};throw n}}async listUsers(e){var n,r,i,a,s,o,c;try{const u={nextPage:null,lastPage:0,total:0},d=await Ze(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=e==null?void 0:e.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(a=(i=e==null?void 0:e.perPage)===null||i===void 0?void 0:i.toString())!==null&&a!==void 0?a:""},xform:AR});if(d.error)throw d.error;const h=await d.json(),f=(s=d.headers.get("x-total-count"))!==null&&s!==void 0?s:0,p=(c=(o=d.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&c!==void 0?c:[];return p.length>
5690&&(p.forEach(g=>{const m=parseInt(g.split(";")[0].split("=")[1].substring(0,1)),v=JSON.parse(g.split(";")[1].split("=")[1]);u[`${v}Page`]=m}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},h),u),error:null}}catch(u){if(Ve(u))return{data:{users:[]},error:u};throw u}}async getUserById(e){Lu(e);try{return await Ze(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:Ho})}catch(n){if(Ve(n))return{data:{user:null},error:n};throw n}}async updateUserById(e,n){Lu(e);try{return await Ze(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:n,headers:this.headers,xform:Ho})}catch(r){if(Ve(r))return{data:{user:null},error:r};throw r}}async deleteUser(e,n=!1){Lu(e);try{return await Ze(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:n},xform:Ho})}catch(r){if(Ve(r))return{data:{user:null},error:r};throw r}}async _listFactors(e){Lu(e.userId);try{const{data:n,error:r}=await Ze(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:n,error:r}}catch(n){if(Ve(n))return{data:null,error:n};throw n}}async _deleteFactor(e){Lu(e.userId),Lu(e.id);try{return{data:await Ze(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(n){if(Ve(n))return{data:null,error:n};throw n}}async _listOAuthClients(e){var n,r,i,a,s,o,c;try{const u={nextPage:null,lastPage:0,total:0},d=await Ze(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=e==null?void 0:e.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(a=(i=e==null?void 0:e.perPage)===null||i===void 0?void 0:i.toString())!==null&&a!==void 0?a:""},xform:AR});if(d.error)throw d.error;const h=await d.json(),f=(s=d.headers.get("x-total-count"))!==null&&s!==void 0?s:0,p=(c=(o=d.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&c!==void 0?c:[];return p.length>0&&(p.forEach(g=>{const m=parseInt(g.split(";")[0].split("=")[1].substring(0,1)),v=JSON.parse(g.split(";")[1].split("=")[1]);u[`${v}Page`]=m}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},h),u),error:null}}catch(u){if(Ve(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(e){try{return await Ze(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Ve(n))return{data:null,error:n};throw n}}async _getOAuthClient(e){try{return await Ze(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Ve(n))return{data:null,error:n};throw n}}async _updateOAuthClient(e,n){try{return await Ze(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Ve(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(e){try{return await Ze(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(Ve(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(e){try{return await Ze(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Ve(n))return{data:null,error:n};throw n}}}function OR(t={}){return{getItem:e=>t[e]||null,setItem:(e,n)=>{t[e]=n},removeItem:e=>{delete t[e]}}}const $u={debug:!!(globalThis&&kF()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class CF extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class Hie extends CF{}async function qie(t,e,n){$u.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const r=new globalThis.AbortController;return e>0&&setTimeout(()=>{r.abort(),$u.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal}
569,async i=>{if(i){$u.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,i.name);try{return await n()}finally{$u.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,i.name)}}else{if(e===0)throw $u.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new Hie(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if($u.debug)try{const a=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(a,null," "))}catch(a){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",a)}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 n()}}))}function Kie(){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 TF(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}" is invalid.`);return t.toLowerCase()}function Gie(t){return parseInt(t,16)}function Yie(t){const e=new TextEncoder().encode(t);return"0x"+Array.from(e,r=>r.toString(16).padStart(2,"0")).join("")}function Jie(t){var e;const{chainId:n,domain:r,expirationTime:i,issuedAt:a=new Date,nonce:s,notBefore:o,requestId:c,resources:u,scheme:d,uri:h,version:f}=t;{if(!Number.isInteger(n))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${n}`);if(!r)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(!h)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(!((e=t.statement)===null||e===void 0)&&e.includes(` 570`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${t.statement}`)}const p=TF(t.address),g=d?`${d}://${r}`:r,m=t.statement?`${t.statement} 571`:"",v=`${g} wants you to sign in with your Ethereum account: 572${p} 573 574${m}`;let x=`URI: ${h} 575Version: ${f} 576Chain ID: ${n}${s?` 577Nonce: ${s}`:""} 578Issued At: ${a.toISOString()}`;if(i&&(x+=` 579Expiration Time: ${i.toISOString()}`),o&&(x+=` 580Not Before: ${o.toISOString()}`),c&&(x+=` 581Request ID: ${c}`),u){let w=` 582Resources:`;for(const 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}`);w+=` 583- ${y}`}x+=w}return`${v} 584${x}`}class Bn extends Error{constructor({message:e,code:n,cause:r,name:i}){var a;super(e,{cause:r}),this.__isWebAuthnError=!0,this.name=(a=i??(r instanceof Error?r.name:void 0))!==null&&a!==void 0?a:"Unknown Error",this.code=n}}class $0 extends Bn{constructor(e,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:e}),this.name="WebAuthnUnknownError",this.originalError=n}}function Xie({error:t,options:e}){var n,r,i;const{publicKey:a}=e;if(!a)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new Bn({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(((n=a.authenticatorSelection)===null||n===void 0?void 0:n.requireResidentKey)===!0)return new Bn({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(e.mediation==="conditional"&&((r=a.authenticatorSelection)===null||r===void 0?void 0:r.userVerification)==="required")return new Bn({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(((i=a.authenticatorSelection)===null||i===void 0?void 0:i.userVerification)==="required")return new Bn({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:t})}else{if(t.name==="InvalidStateError")return new Bn({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new Bn({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return a.pubKeyCredParams.filter(o=>o.type==="public-key").length===0?new Bn({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new Bn({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:t});if(t.name==="SecurityError"){const s=window.location.hostname;if(EF(s)){if(a.rp.id!==s)return new Bn({message:`The RP ID "${a.rp.id}
584" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Bn({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(a.user.id.byteLength<1||a.user.id.byteLength>64)return new Bn({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:t})}else if(t.name==="UnknownError")return new Bn({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new Bn({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function Zie({error:t,options:e}){const{publicKey:n}=e;if(!n)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new Bn({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new Bn({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const r=window.location.hostname;if(EF(r)){if(n.rpId!==r)return new Bn({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Bn({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new Bn({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new Bn({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}class Qie{createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}const e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){const e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}}const eae=new Qie;function tae(t){if(!t)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(t);const{challenge:e,user:n,excludeCredentials:r}=t,i=Uc(t,["challenge","user","excludeCredentials"]),a=Od(e).buffer,s=Object.assign(Object.assign({},n),{id:Od(n.id).buffer}),o=Object.assign(Object.assign({},i),{challenge:a,user:s});if(r&&r.length>0){o.excludeCredentials=new Array(r.length);for(let c=0;c<r.length;c++){const u=r[c];o.excludeCredentials[c]=Object.assign(Object.assign({},u),{id:Od(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return o}function nae(t){if(!t)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(t);const{challenge:e,allowCredentials:n}=t,r=Uc(t,["challenge","allowCredentials"]),i=Od(e).buffer,a=Object.assign(Object.assign({},r),{challenge:i});if(n&&n.length>0){a.allowCredentials=new Array(n.length);for(let s=0;s<n.length;s++){const o=n[s];a.allowCredentials[s]=Object.assign(Object.assign({},o),{id:Od(o.id).buffer,type:o.type||"public-key",transports:o.transports})}}return a}function rae(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const n=t;return{id:t.id,rawId:t.id,response:{attestationObject:jl(new Uint8Array(t.response.attestationObject)),clientDataJSON:jl(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=n.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function iae(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const n=t,r=t.getClientExtensionResults(),i=t.response;return{id:t.id,rawId:t.id,response:{authenticatorData:jl(new Uint8Array(i.authenticatorData)),clientDataJSON:jl(new Uint8Array(i.clientDataJSON)),signature:jl(new Uint8Array(i.signature)),userHandle:i.userHandle?jl(new Uint8Array(i.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(e=n.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function EF(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function RR(){var t,e;return!!(hr()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.create)=="function"&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.get)=="function")}async function aae(t){try{const e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new $0("Browser returned unexpected credential type",e)}:{data:null,error:new $0("Empty credential response",e)}}catch(e){return{data:null,error:Xie({error:e,options:t})}}}async function sae(t){try{const e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new $0("Browser returned unexpected credential type",e)}:{data:null,error:new $0("Empty credential response",e)}}catch(e){return{data:null,error:Zie({error:e,options:t})}}}const oae={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},cae={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function F0(...t){const e=i=>i!==null&&typeof i=="object"&&!Array.isArray(i),n=i=>i instanceof ArrayBuffer||ArrayBuffer.isView(i),r={};for(const i of t)if(i)for(const a in i){const s=i[a];if(s!==void 0)if(Array.isArray(s))r[a]=s;else if(n(s))r[a]=s;else if(e(s)){const o=r[a];e(o)?r[a]=F0(o,s):r[a]=F0(s)}else r[a]=s}return r}function lae(t,e){return F0(oae,t,e||{})}function uae(t,e){return F0(cae,t,e||{})}class dae{constructor(e){this.client=e,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(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:n,friendlyName:r,signal:i},a){try{const{data:s,error:o}=await this.client.mfa.challenge({factorId:e,webauthn:n});if(!s)return{data:null,error:o};const c=i??eae.createNewAbortSignal();if(s.webauthn.type==="create"){const{user:u}=s.webauthn.credential_options.publicKey;u.name||(u.name=`${u.id}:${r}`),u.displayName||(u.displayName=u.name)}
584switch(s.webauthn.type){case"create":{const u=lae(s.webauthn.credential_options.publicKey,a==null?void 0:a.create),{data:d,error:h}=await aae({publicKey:u,signal:c});return d?{data:{factorId:e,challengeId:s.id,webauthn:{type:s.webauthn.type,credential_response:d}},error:null}:{data:null,error:h}}case"request":{const u=uae(s.webauthn.credential_options.publicKey,a==null?void 0:a.request),{data:d,error:h}=await sae(Object.assign(Object.assign({},s.webauthn.credential_options),{publicKey:u,signal:c}));return d?{data:{factorId:e,challengeId:s.id,webauthn:{type:s.webauthn.type,credential_response:d}},error:null}:{data:null,error:h}}}}catch(s){return Ve(s)?{data:null,error:s}:{data:null,error:new vl("Unexpected error in challenge",s)}}}async _verify({challengeId:e,factorId:n,webauthn:r}){return this.client.mfa.verify({factorId:n,challengeId:e,webauthn:r})}async _authenticate({factorId:e,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},a){if(!n)return{data:null,error:new Nm("rpId is required for WebAuthn authentication")};try{if(!RR())return{data:null,error:new vl("Browser does not support WebAuthn",null)};const{data:s,error:o}=await this.challenge({factorId:e,webauthn:{rpId:n,rpOrigins:r},signal:i},{request:a});if(!s)return{data:null,error:o};const{webauthn:c}=s;return this._verify({factorId:e,challengeId:s.challengeId,webauthn:{type:c.type,rpId:n,rpOrigins:r,credential_response:c.credential_response}})}catch(s){return Ve(s)?{data:null,error:s}:{data:null,error:new vl("Unexpected error in authenticate",s)}}}async _register({friendlyName:e,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},a){if(!n)return{data:null,error:new Nm("rpId is required for WebAuthn registration")};try{if(!RR())return{data:null,error:new vl("Browser does not support WebAuthn",null)};const{data:s,error:o}=await this._enroll({friendlyName:e});if(!s)return await this.client.mfa.listFactors().then(d=>{var h;return(h=d.data)===null||h===void 0?void 0:h.all.find(f=>f.factor_type==="webauthn"&&f.friendly_name===e&&f.status!=="unverified")}).then(d=>d?this.client.mfa.unenroll({factorId:d==null?void 0:d.id}):void 0),{data:null,error:o};const{data:c,error:u}=await this._challenge({factorId:s.id,friendlyName:s.friendly_name,webauthn:{rpId:n,rpOrigins:r},signal:i},{create:a});return c?this._verify({factorId:s.id,challengeId:c.challengeId,webauthn:{rpId:n,rpOrigins:r,type:c.webauthn.type,credential_response:c.webauthn.credential_response}}):{data:null,error:u}}catch(s){return Ve(s)?{data:null,error:s}:{data:null,error:new vl("Unexpected error in register",s)}}}}Kie();const hae={url:cie,storageKey:lie,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:uie,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1};async function DR(t,e,n){return await n()}const Fu={};class Am{get jwks(){var e,n;return(n=(e=Fu[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(e){Fu[this.storageKey]=Object.assign(Object.assign({},Fu[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,n;return(n=(e=Fu[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){Fu[this.storageKey]=Object.assign(Object.assign({},Fu[this.storageKey]),{cachedAt:e})}constructor(e){var n,r,i;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=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;const a=Object.assign(Object.assign({},hae),e);if(this.storageKey=a.storageKey,this.instanceID=(n=Am.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,Am.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!a.debug,typeof a.debug=="function"&&(this.logger=a.debug),this.instanceID>0&&hr()){const 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=a.persistSession,this.autoRefreshToken=a.autoRefreshToken,this.admin=new Vie({url:a.url,headers:a.headers,fetch:a.fetch}),this.url=a.url,this.headers=a.headers,this.fetch=_F(a.fetch),this.lock=a.lock||DR,this.detectSessionInUrl=a.detectSessionInUrl,this.flowType=a.flowType,this.hasCustomAuthorizationHeader=a.hasCustomAuthorizationHeader,this.throwOnError=a.throwOnError,a.lock?this.lock=a.lock:hr()&&(!((r=globalThis==null?void 0:globalThis.navigator)===null||r===void 0)&&r.locks)?this.lock=qie:this.lock=DR,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 dae(this)}
584,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?(a.storage?this.storage=a.storage:kF()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=OR(this.memoryStorage)),a.userStorage&&(this.userStorage=a.userStorage)):(this.memoryStorage={},this.storage=OR(this.memoryStorage)),hr()&&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)}(i=this.broadcastChannel)===null||i===void 0||i.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(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${xF}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{let n={},r="none";if(hr()&&(n=_ie(window.location.href),this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce")),hr()&&this.detectSessionInUrl&&r!=="none"){const{data:i,error:a}=await this._getSessionFromURL(n,r);if(a){if(this._debug("#_initialize()","error detecting session from URL",a),gie(a)){const c=(e=a.details)===null||e===void 0?void 0:e.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:a}}return await this._removeSession(),{error:a}}const{session:s,redirectType:o}=i;return this._debug("#_initialize()","detected session in URL",s,"redirect type",o),await this._saveSession(s),setTimeout(async()=>{o==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",s):await this._notifyAllSubscribers("SIGNED_IN",s)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return Ve(n)?this._returnResult({error:n}):this._returnResult({error:new vl("Unexpected error during initialization",n)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var n,r,i;try{const a=await Ze(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(n=e==null?void 0:e.options)===null||n===void 0?void 0:n.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(i=e==null?void 0:e.options)===null||i===void 0?void 0:i.captchaToken}},xform:ya}),{data:s,error:o}=a;if(o||!s)return this._returnResult({data:{user:null,session:null},error:o});const c=s.session,u=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(a){if(Ve(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signUp(e){var n,r,i;try{let a;if("email"in e){const{email:d,password:h,options:f}=e;let p=null,g=null;this.flowType==="pkce"&&([p,g]=await Iu(this.storage,this.storageKey)),a=await Ze(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:f==null?void 0:f.emailRedirectTo,body:{email:d,password:h,data:(n=f==null?void 0:f.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken},code_challenge:p,code_challenge_method:g},xform:ya})}else if("phone"in e){const{phone:d,password:h,options:f}=e;a=await Ze(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:h,data:(r=f==null?void 0:f.data)!==null&&r!==void 0?r:{},channel:(i=f==null?void 0:f.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken}},xform:ya})}else throw new Jv("You must provide either an email or phone number and a password");const{data:s,error:o}=a;if(o||!s)return this._returnResult({data:{user:null,session:null},error:o});const c=s.session,u=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(a){if(Ve(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signInWithPassword(e){try{let n;if("email"in e){const{email:a,password:s,options:o}=e;n=await Ze(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:a,password:s,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:NR})}else if("phone"in e){const{phone:a,password:s,options:o}=e;n=await Ze(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:a,password:s,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:NR})}else throw new Jv("You must provide either an email or phone number and a password");const{data:r,error:i}=n;if(i)return this._returnResult({data:{user:null,session:null},error:i});if(!r||!r.session||!r.user){const a=new Mu;return this._returnResult({data:{user:null,session:null},error:a})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:i})}catch(n){if(Ve(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOAuth(e){var n,r,i,a;return await this._handleProviderSignIn(e.provider,{redirectTo:(n=e.options)===null||n===void 0?void 0:n.redirectTo,scopes:(r=e.options)===null||r===void 0?void 0:r.scopes,queryParams:(i=e.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(a=e.options)===null||a===void 0?void 0:a.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){const{chain:n}=e;switch(n){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}}async signInWithEthereum(e){var n,r,i,a,s,o,c,u,d,h,f;let p,g;if("message"in e)p=e.message,g=e.signature;else{const{chain:m,wallet:v,statement:x,options:w}=e;let y;if(hr())if(typeof v=="object")y=v;else{const E=window;if("ethereum"in E&&typeof E.ethereum=="object"&&"request"in E.ethereum&&typeof E.ethereum.request=="function")y=E.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 v!="object"||!(w!=null&&w.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");y=v}const k=new URL((n=w==null?void 0:w.url)!==null&&n!==void 0?n:window.location.href),S=await y.request({method:"eth_requestAccounts"}).then(E=>E).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!S||S.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const _=TF(S[0]);let C=(r=w==null?void 0:w.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!C){const E=await y.request({method:"eth_chainId"});C=Gie(E)}const T={domain:k.host,address:_,statement:x,uri:k.href,version:"1",chainId:C,nonce:(i=w==null?void 0:w.signInWithEthereum)===null||i===void 0?void 0:i.nonce,issuedAt:(s=(a=w==null?void 0:w.signInWithEthereum)===null||a===void 0?void 0:a.issuedAt)!==null&&s!==void 0?s:new Date,expirationTime:(o=w==null?void 0:w.signInWithEthereum)===null||o===void 0?void 0:o.expirationTime,notBefore:(c=w==null?void 0:w.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(u=w==null?void 0:w.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(d=w==null?void 0:w.signInWithEthereum)===null||d===void 0?void 0:d.resources};p=Jie(T),g=await y.request({method:"personal_sign",params:[Yie(p),_]})}try{const{data:m,error:v}=await Ze(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:p,signature:g}
584,!((h=e.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(f=e.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:ya});if(v)throw v;if(!m||!m.session||!m.user){const x=new Mu;return this._returnResult({data:{user:null,session:null},error:x})}return m.session&&(await this._saveSession(m.session),await this._notifyAllSubscribers("SIGNED_IN",m.session)),this._returnResult({data:Object.assign({},m),error:v})}catch(m){if(Ve(m))return this._returnResult({data:{user:null,session:null},error:m});throw m}}async signInWithSolana(e){var n,r,i,a,s,o,c,u,d,h,f,p;let g,m;if("message"in e)g=e.message,m=e.signature;else{const{chain:v,wallet:x,statement:w,options:y}=e;let k;if(hr())if(typeof x=="object")k=x;else{const _=window;if("solana"in _&&typeof _.solana=="object"&&("signIn"in _.solana&&typeof _.solana.signIn=="function"||"signMessage"in _.solana&&typeof _.solana.signMessage=="function"))k=_.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof x!="object"||!(y!=null&&y.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");k=x}const S=new URL((n=y==null?void 0:y.url)!==null&&n!==void 0?n:window.location.href);
584if("signIn"in k&&k.signIn){const _=await k.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},y==null?void 0:y.signInWithSolana),{version:"1",domain:S.host,uri:S.href}),w?{statement:w}:null));let C;if(Array.isArray(_)&&_[0]&&typeof _[0]=="object")C=_[0];else if(_&&typeof _=="object"&&"signedMessage"in _&&"signature"in _)C=_;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in C&&"signature"in C&&(typeof C.signedMessage=="string"||C.signedMessage instanceof Uint8Array)&&C.signature instanceof Uint8Array)g=typeof C.signedMessage=="string"?C.signedMessage:new TextDecoder().decode(C.signedMessage),m=C.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in k)||typeof k.signMessage!="function"||!("publicKey"in k)||typeof k!="object"||!k.publicKey||!("toBase58"in k.publicKey)||typeof k.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");g=[`${S.host} wants you to sign in with your Solana account:`,k.publicKey.toBase58(),...w?["",w,""]:[""],"Version: 1",`URI: ${S.href}`,`Issued At: ${(i=(r=y==null?void 0:y.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&i!==void 0?i:new Date().toISOString()}`,...!((a=y==null?void 0:y.signInWithSolana)===null||a===void 0)&&a.notBefore?[`Not Before: ${y.signInWithSolana.notBefore}`]:[],...!((s=y==null?void 0:y.signInWithSolana)===null||s===void 0)&&s.expirationTime?[`Expiration Time: ${y.signInWithSolana.expirationTime}`]:[],...!((o=y==null?void 0:y.signInWithSolana)===null||o===void 0)&&o.chainId?[`Chain ID: ${y.signInWithSolana.chainId}`]:[],...!((c=y==null?void 0:y.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${y.signInWithSolana.nonce}`]:[],...!((u=y==null?void 0:y.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${y.signInWithSolana.requestId}`]:[],...!((h=(d=y==null?void 0:y.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||h===void 0)&&h.length?["Resources",...y.signInWithSolana.resources.map(C=>`- ${C}`)]:[]].join(` 585`);const _=await k.signMessage(new TextEncoder().encode(g),"utf8");if(!_||!(_ instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");m=_}}try{const{data:v,error:x}=await Ze(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:g,signature:jl(m)},!((f=e.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(p=e.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:ya});if(x)throw x;if(!v||!v.session||!v.user){const w=new Mu;return this._returnResult({data:{user:null,session:null},error:w})}return v.session&&(await this._saveSession(v.session),await this._notifyAllSubscribers("SIGNED_IN",v.session)),this._returnResult({data:Object.assign({},v),error:x})}catch(v){if(Ve(v))return this._returnResult({data:{user:null,session:null},error:v});throw v}}async _exchangeCodeForSession(e){const n=await tl(this.storage,`${this.storageKey}-code-verifier`),[r,i]=(n??"").split("/");try{const{data:a,error:s}=await Ze(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:r},xform:ya});if(await Oo(this.storage,`${this.storageKey}-code-verifier`),s)throw s;if(!a||!a.session||!a.user){const o=new Mu;return this._returnResult({data:{user:null,session:null,redirectType:null},error:o})}return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),this._returnResult({data:Object.assign(Object.assign({},a),{redirectType:i??null}),error:s})}catch(a){if(Ve(a))return this._returnResult({data:{user:null,session:null,redirectType:null},error:a});throw a}}async signInWithIdToken(e){try{const{options:n,provider:r,token:i,access_token:a,nonce:s}=e,o=await Ze(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:i,access_token:a,nonce:s,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:ya}),{data:c,error:u}=o;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!c||!c.session||!c.user){const d=new Mu;return this._returnResult({data:{user:null,session:null},error:d})}return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),this._returnResult({data:c,error:u})}catch(n){if(Ve(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOtp(e){var n,r,i,a,s;try{if("email"in e){const{email:o,options:c}=e;let u=null,d=null;this.flowType==="pkce"&&([u,d]=await Iu(this.storage,this.storageKey));const{error:h}=await Ze(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:o,data:(n=c==null?void 0:c.data)!==null&&n!==void 0?n:{},create_user:(r=c==null?void 0:c.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},code_challenge:u,code_challenge_method:d},redirectTo:c==null?void 0:c.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:h})}if("phone"in e){const{phone:o,options:c}=e,{data:u,error:d}=await Ze(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:o,data:(i=c==null?void 0:c.data)!==null&&i!==void 0?i:{},create_user:(a=c==null?void 0:c.shouldCreateUser)!==null&&a!==void 0?a:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(s=c==null?void 0:c.channel)!==null&&s!==void 0?s:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:d})}throw new Jv("You must provide either an email or phone number.")}catch(o){if(Ve(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async verifyOtp(e){var n,r;try{let i,a;"options"in e&&(i=(n=e.options)===null||n===void 0?void 0:n.redirectTo,a=(r=e.options)===null||r===void 0?void 0:r.captchaToken);const{data:s,error:o}=await Ze(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:a}}),redirectTo:i,xform:ya});if(o)throw o;if(!s)throw new Error("An error occurred on token verification.");const c=s.session,u=s.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(i){if(Ve(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithSSO(e){var n,r,i,a,s;try{let o=null,c=null;this.flowType==="pkce"&&([o,c]=await Iu(this.storage,this.storageKey));const u=await Ze(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(r=(n=e.options)===null||n===void 0?void 0:n.redirectTo)!==null&&r!==void 0?r:void 0}),!((i=e==null?void 0:e.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}
585:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:c}),headers:this.headers,xform:Uie});return!((a=u.data)===null||a===void 0)&&a.url&&hr()&&!(!((s=e.options)===null||s===void 0)&&s.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(o){if(Ve(o))return this._returnResult({data:null,error:o});throw o}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:n},error:r}=e;if(r)throw r;if(!n)throw new mi;const{error:i}=await Ze(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return this._returnResult({data:{user:null,session:null},error:i})})}catch(e){if(Ve(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{const n=`${this.url}/resend`;if("email"in e){const{email:r,type:i,options:a}=e,{error:s}=await Ze(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:i,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},redirectTo:a==null?void 0:a.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:s})}else if("phone"in e){const{phone:r,type:i,options:a}=e,{data:s,error:o}=await Ze(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:i,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:s==null?void 0:s.message_id},error:o})}throw new Jv("You must provide either an email or phone number and a type")}catch(n){if(Ve(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async n=>n))}async _acquireLock(e,n){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const r=n();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){const i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await r}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const n=await this.__loadSession();return await e(n)}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 e=null;const n=await tl(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?e=n:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const r=e.expires_at?e.expires_at*1e3-Date.now()<bS:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",e.expires_at),!r){if(this.userStorage){const s=await tl(this.userStorage,this.storageKey+"-user");s!=null&&s.user?e.user=s.user:e.user=SS()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const s={value:this.suppressGetSessionWarning};e.user=Lie(e.user,s),s.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}const{data:i,error:a}=await this._callRefreshToken(e.refresh_token);return a?this._returnResult({data:{session:null},error:a}):this._returnResult({data:{session:i},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await Ze(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:Ho}):await this._useSession(async n=>{var r,i,a;const{data:s,error:o}=n;
585if(o)throw o;return!(!((r=s.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new mi}:await Ze(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(a=(i=s.session)===null||i===void 0?void 0:i.access_token)!==null&&a!==void 0?a:void 0,xform:Ho})})}catch(n){if(Ve(n))return mie(n)&&(await this._removeSession(),await Oo(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:n});throw n}}async updateUser(e,n={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,n))}async _updateUser(e,n={}){try{return await this._useSession(async r=>{const{data:i,error:a}=r;if(a)throw a;if(!i.session)throw new mi;const s=i.session;let o=null,c=null;this.flowType==="pkce"&&e.email!=null&&([o,c]=await Iu(this.storage,this.storageKey));const{data:u,error:d}=await Ze(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n==null?void 0:n.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:o,code_challenge_method:c}),jwt:s.access_token,xform:Ho});if(d)throw d;return s.user=u.user,await this._saveSession(s),await this._notifyAllSubscribers("USER_UPDATED",s),this._returnResult({data:{user:s.user},error:null})})}catch(r){if(Ve(r))return this._returnResult({data:{user:null},error:r});throw r}}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new mi;const n=Date.now()/1e3;let r=n,i=!0,a=null;const{payload:s}=wS(e.access_token);if(s.exp&&(r=s.exp,i=r<=n),i){const{data:o,error:c}=await this._callRefreshToken(e.refresh_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!o)return{data:{user:null,session:null},error:null};a=o}else{const{data:o,error:c}=await this._getUser(e.access_token);if(c)throw c;a={access_token:e.access_token,refresh_token:e.refresh_token,user:o.user,token_type:"bearer",expires_in:r-n,expires_at:r},await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)}return this._returnResult({data:{user:a.user,session:a},error:null})}catch(n){if(Ve(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async n=>{var r;if(!e){const{data:s,error:o}=n;if(o)throw o;e=(r=s.session)!==null&&r!==void 0?r:void 0}if(!(e!=null&&e.refresh_token))throw new mi;const{data:i,error:a}=await this._callRefreshToken(e.refresh_token);return a?this._returnResult({data:{user:null,session:null},error:a}):i?this._returnResult({data:{user:i.user,session:i},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(n){if(Ve(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async _getSessionFromURL(e,n){try{if(!hr())throw new Xv("No browser detected.");if(e.error||e.error_description||e.error_code)throw new Xv(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new kR("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Xv("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new kR("No code detected.");const{data:w,error:y}=await this._exchangeCodeForSession(e.code);if(y)throw y;const k=new URL(window.location.href);return k.searchParams.delete("code"),window.history.replaceState(window.history.state,"",k.toString()),{data:{session:w.session,redirectType:null},error:null}}const{provider_token:r,provider_refresh_token:i,access_token:a,refresh_token:s,expires_in:o,expires_at:c,token_type:u}=e;if(!a||!o||!s||!u)throw new Xv("No session defined in URL");const d=Math.round(Date.now()/1e3),h=parseInt(o);let f=d+h;c&&(f=parseInt(c));const p=f-d;
585p*1e3<=Qu&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${p}s, should have been closer to ${h}s`);const g=f-h;d-g>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",g,f,d):d-g<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",g,f,d);const{data:m,error:v}=await this._getUser(a);if(v)throw v;const x={provider_token:r,provider_refresh_token:i,access_token:a,expires_in:h,expires_at:f,refresh_token:s,token_type:u,user:m.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:x,redirectType:e.type},error:null})}catch(r){if(Ve(r))return this._returnResult({data:{session:null,redirectType:null},error:r});throw r}}_isImplicitGrantCallback(e){return!!(e.access_token||e.error_description)}async _isPKCECallback(e){const n=await tl(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&n)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async n=>{var r;const{data:i,error:a}=n;if(a)return this._returnResult({error:a});const s=(r=i.session)===null||r===void 0?void 0:r.access_token;if(s){const{error:o}=await this.admin.signOut(s,e);if(o&&!(pie(o)&&(o.status===404||o.status===401||o.status===403)))return this._returnResult({error:o})}return e!=="others"&&(await this._removeSession(),await Oo(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const n=kie(),r={id:n,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",n),this.stateChangeEmitters.delete(n)}};return this._debug("#onAuthStateChange()","registered callback with id",n),this.stateChangeEmitters.set(n,r),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:r}}}async _emitInitialSession(e){return await this._useSession(async n=>{var r,i;try{const{data:{session:a},error:s}=n;if(s)throw s;await((r=this.stateChangeEmitters.get(e))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",a)),this._debug("INITIAL_SESSION","callback id",e,"session",a)}catch(a){await((i=this.stateChangeEmitters.get(e))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",a),console.error(a)}})}async resetPasswordForEmail(e,n={}){let r=null,i=null;this.flowType==="pkce"&&([r,i]=await Iu(this.storage,this.storageKey,!0));try{return await Ze(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:r,code_challenge_method:i,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(a){if(Ve(a))return this._returnResult({data:null,error:a});throw a}}async getUserIdentities(){var e;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:(e=n.user.identities)!==null&&e!==void 0?e:[]},error:null})}catch(n){if(Ve(n))return this._returnResult({data:null,error:n});throw n}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var n;try{const{data:r,error:i}=await this._useSession(async a=>{var s,o,c,u,d;const{data:h,error:f}=a;if(f)throw f;const p=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(s=e.options)===null||s===void 0?void 0:s.redirectTo,scopes:(o=e.options)===null||o===void 0?void 0:o.scopes,queryParams:(c=e.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await Ze(this.fetch,"GET",p,{headers:this.headers,jwt:(d=(u=h.session)===null||u===void 0?void 0:u.access_token)!==null&&d!==void 0?d:void 0})});if(i)throw i;return hr()&&!(!((n=e.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),this._returnResult({data:{provider:e.provider,url:r==null?void 0:r.url},error:null})}catch(r){if(Ve(r))return this._returnResult({data:{provider:e.provider,url:null},error:r});throw r}}async linkIdentityIdToken(e){return await this._useSession(async n=>{var r;try{const{error:i,data:{session:a}}=n;if(i)throw i;const{options:s,provider:o,token:c,access_token:u,nonce:d}=e,h=await Ze(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(r=a==null?void 0:a.access_token)!==null&&r!==void 0?r:void 0,body:{provider:o,id_token:c,access_token:u,nonce:d,link_identity:!0,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}},xform:ya}),{data:f,error:p}=h;return p?this._returnResult({data:{user:null,session:null},error:p}):!f||!f.session||!f.user?this._returnResult({data:{user:null,session:null},error:new Mu}):(f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("USER_UPDATED",f.session)),this._returnResult({data:f,error:p}))}catch(i){if(Ve(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}})}async unlinkIdentity(e){try{return await this._useSession(async n=>{var r,i;const{data:a,error:s}=n;if(s)throw s;
585return await Ze(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(i=(r=a.session)===null||r===void 0?void 0:r.access_token)!==null&&i!==void 0?i:void 0})})}catch(n){if(Ve(n))return this._returnResult({data:null,error:n});throw n}}async _refreshAccessToken(e){const n=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(n,"begin");try{const r=Date.now();return await Eie(async i=>(i>0&&await Tie(200*Math.pow(2,i-1)),this._debug(n,"refreshing attempt",i),await Ze(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:ya})),(i,a)=>{const s=200*Math.pow(2,i);return a&&xS(a)&&Date.now()+s-r<Qu})}catch(r){if(this._debug(n,"error",r),Ve(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}finally{this._debug(n,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,n){const r=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",n,"url",r),hr()&&!n.skipBrowserRedirect&&window.location.assign(r),{data:{provider:e,url:r},error:null}}async _recoverAndRefresh(){var e,n;const r="#_recoverAndRefresh()";this._debug(r,"begin");try{const i=await tl(this.storage,this.storageKey);if(i&&this.userStorage){let s=await tl(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!s&&(s={user:i.user},await ed(this.userStorage,this.storageKey+"-user",s)),i.user=(e=s==null?void 0:s.user)!==null&&e!==void 0?e:SS()}else if(i&&!i.user&&!i.user){const s=await tl(this.storage,this.storageKey+"-user");s&&(s!=null&&s.user)?(i.user=s.user,await Oo(this.storage,this.storageKey+"-user"),await ed(this.storage,this.storageKey,i)):i.user=SS()}if(this._debug(r,"session from storage",i),!this._isValidSession(i)){this._debug(r,"session is not valid"),i!==null&&await this._removeSession();return}const a=((n=i.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<bS;if(this._debug(r,`session has${a?"":" not"} expired with margin of ${bS}s`),a){if(this.autoRefreshToken&&i.refresh_token){const{error:s}=await this._callRefreshToken(i.refresh_token);s&&(console.error(s),xS(s)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",s),await this._removeSession()))}}else if(i.user&&i.user.__isUserNotAvailableProxy===!0)try{const{data:s,error:o}=await this._getUser(i.access_token);!o&&(s!=null&&s.user)?(i.user=s.user,await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(s){console.error("Error getting user data:",s),this._debug(r,"error getting user data, skipping SIGNED_IN notification",s)}else await this._notifyAllSubscribers("SIGNED_IN",i)}catch(i){this._debug(r,"error",i),console.error(i);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var n,r;if(!e)throw new mi;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const i=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new Kx;const{data:a,error:s}=await this._refreshAccessToken(e);if(s)throw s;if(!a.session)throw new mi;await this._saveSession(a.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",a.session);const o={data:a.session,error:null};return this.refreshingDeferred.resolve(o),o}catch(a){if(this._debug(i,"error",a),Ve(a)){const s={data:null,error:a};return xS(a)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(s),s}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(a),a}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(e,n,r=!0){const i=`#_notifyAllSubscribers(${e})`;this._debug(i,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:e,session:n});const a=[],s=Array.from(this.stateChangeEmitters.values()).map(async o=>{try{await o.callback(e,n)}catch(c){a.push(c)}});if(await Promise.all(s),a.length>0){for(let o=0;o<a.length;o+=1)console.error(a[o]);throw a[0]}}finally{this._debug(i,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0;const n=Object.assign({},e),r=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&n.user&&await ed(this.userStorage,this.storageKey+"-user",{user:n.user});const i=Object.assign({},n);delete i.user;const a=jR(i);await ed(this.storage,this.storageKey,a)}else{const i=jR(n);await ed(this.storage,this.storageKey,i)}}async _removeSession(){this._debug("#_removeSession()"),await Oo(this.storage,this.storageKey),await Oo(this.storage,this.storageKey+"-code-verifier"),await Oo(this.storage,this.storageKey+"-user"),this.userStorage&&await Oo(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&hr()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}
585catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),Qu);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}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{const e=Date.now();try{return await this._useSession(async n=>{const{data:{session:r}}=n;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const i=Math.floor((r.expires_at*1e3-e)/Qu);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${Qu}ms, refresh threshold is ${gC} ticks`),i<=gC&&await this._callRefreshToken(r.refresh_token)})}catch(n){console.error("Auto refresh tick failed with error. This is likely a transient error.",n)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof CF)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!hr()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const n=`#_onVisibilityChanged(${e})`;this._debug(n,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(n,"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(e,n,r){const i=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&i.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&i.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[a,s]=await Iu(this.storage,this.storageKey),o=new URLSearchParams({code_challenge:`${encodeURIComponent(a)}`,code_challenge_method:`${encodeURIComponent(s)}`});i.push(o.toString())}if(r!=null&&r.queryParams){const a=new URLSearchParams(r.queryParams);i.push(a.toString())}return r!=null&&r.skipBrowserRedirect&&i.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${e}?${i.join("&")}`}async _unenroll(e){try{return await this._useSession(async n=>{var r;const{data:i,error:a}=n;return a?this._returnResult({data:null,error:a}):await Ze(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(Ve(n))return this._returnResult({data:null,error:n});throw n}}async _enroll(e){try{return await this._useSession(async n=>{var r,i;const{data:a,error:s}=n;if(s)return this._returnResult({data:null,error:s});const o=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:e.factorType==="totp"?{issuer:e.issuer}:{}),{data:c,error:u}=await Ze(this.fetch,"POST",`${this.url}/factors`,{body:o,headers:this.headers,jwt:(r=a==null?void 0:a.session)===null||r===void 0?void 0:r.access_token});return u?this._returnResult({data:null,error:u}):(e.factorType==="totp"&&c.type==="totp"&&(!((i=c==null?void 0:c.totp)===null||i===void 0)&&i.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),this._returnResult({data:c,error:null}))})}catch(n){if(Ve(n))return this._returnResult({data:null,error:n});throw n}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async n=>{var r;const{data:i,error:a}=n;
585if(a)return this._returnResult({data:null,error:a});const s=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?rae(e.webauthn.credential_response):iae(e.webauthn.credential_response)})}:{code:e.code}),{data:o,error:c}=await Ze(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:s,headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token});return c?this._returnResult({data:null,error:c}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),this._returnResult({data:o,error:c}))})}catch(n){if(Ve(n))return this._returnResult({data:null,error:n});throw n}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async n=>{var r;const{data:i,error:a}=n;if(a)return this._returnResult({data:null,error:a});const s=await Ze(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token});if(s.error)return s;const{data:o}=s;if(o.type!=="webauthn")return{data:o,error:null};switch(o.webauthn.type){case"create":return{data:Object.assign(Object.assign({},o),{webauthn:Object.assign(Object.assign({},o.webauthn),{credential_options:Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:tae(o.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},o),{webauthn:Object.assign(Object.assign({},o.webauthn),{credential_options:Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:nae(o.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(Ve(n))return this._returnResult({data:null,error:n});throw n}})}async _challengeAndVerify(e){const{data:n,error:r}=await this._challenge({factorId:e.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:e.factorId,challengeId:n.id,code:e.code})}async _listFactors(){var e;const{data:{user:n},error:r}=await this.getUser();if(r)return{data:null,error:r};const i={all:[],phone:[],totp:[],webauthn:[]};for(const a of(e=n==null?void 0:n.factors)!==null&&e!==void 0?e:[])i.all.push(a),a.status==="verified"&&i[a.factor_type].push(a);return{data:i,error:null}}async _getAuthenticatorAssuranceLevel(){var e,n;const{data:{session:r},error:i}
585=await this.getSession();if(i)return this._returnResult({data:null,error:i});if(!r)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:a}=wS(r.access_token);let s=null;a.aal&&(s=a.aal);let o=s;((n=(e=r.user.factors)===null||e===void 0?void 0:e.filter(d=>d.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(o="aal2");const u=a.amr||[];return{data:{currentLevel:s,nextLevel:o,currentAuthenticationMethods:u},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async n=>{const{data:{session:r},error:i}=n;return i?this._returnResult({data:null,error:i}):r?await Ze(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:r.access_token,xform:a=>({data:a,error:null})}):this._returnResult({data:null,error:new mi})})}catch(n){if(Ve(n))return this._returnResult({data:null,error:n});throw n}}async _approveAuthorization(e,n){try{return await this._useSession(async r=>{const{data:{session:i},error:a}=r;if(a)return this._returnResult({data:null,error:a});if(!i)return this._returnResult({data:null,error:new mi});const s=await Ze(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"approve"},xform:o=>({data:o,error:null})});return s.data&&s.data.redirect_url&&hr()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(s.data.redirect_url),s})}catch(r){if(Ve(r))return this._returnResult({data:null,error:r});throw r}}async _denyAuthorization(e,n){try{return await this._useSession(async r=>{const{data:{session:i},error:a}=r;if(a)return this._returnResult({data:null,error:a});if(!i)return this._returnResult({data:null,error:new mi});const s=await Ze(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"deny"},xform:o=>({data:o,error:null})});return s.data&&s.data.redirect_url&&hr()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(s.data.redirect_url),s})}catch(r){if(Ve(r))return this._returnResult({data:null,error:r});throw r}}async _listOAuthGrants(){try{return await this._useSession(async e=>{const{data:{session:n},error:r}=e;return r?this._returnResult({data:null,error:r}):n?await Ze(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new mi})})}catch(e){if(Ve(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async n=>{const{data:{session:r},error:i}=n;return i?this._returnResult({data:null,error:i}):r?await Ze(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:e.clientId},xform:()=>({data:{},error:null})}):this._returnResult({data:null,error:new mi})})}catch(n){if(Ve(n))return this._returnResult({data:null,error:n});throw n}}async fetchJwk(e,n={keys:[]}){let r=n.keys.find(o=>o.kid===e);if(r)return r;const i=Date.now();if(r=this.jwks.keys.find(o=>o.kid===e),r&&this.jwks_cached_at+hie>i)return r;const{data:a,error:s}=await Ze(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(s)throw s;return!a.keys||a.keys.length===0||(this.jwks=a,this.jwks_cached_at=i,r=a.keys.find(o=>o.kid===e),!r)?null:r}async getClaims(e,n={}){try{let r=e;if(!r){const{data:p,error:g}
585=await this.getSession();if(g||!p.session)return this._returnResult({data:null,error:g});r=p.session.access_token}const{header:i,payload:a,signature:s,raw:{header:o,payload:c}}=wS(r);n!=null&&n.allowExpired||Die(a.exp);const u=!i.alg||i.alg.startsWith("HS")||!i.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(i.kid,n!=null&&n.keys?{keys:n.keys}:n==null?void 0:n.jwks);if(!u){const{error:p}=await this.getUser(r);if(p)throw p;return{data:{claims:a,header:i,signature:s},error:null}}const d=Mie(i.alg),h=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,h,s,wie(`${o}.${c}`)))throw new bC("Invalid JWT signature");return{data:{claims:a,header:i,signature:s},error:null}}catch(r){if(Ve(r))return this._returnResult({data:null,error:r});throw r}}}Am.nextInstanceID={};const fae=Am;class pae extends fae{constructor(e){super(e)}}class mae{constructor(e,n,r){var i,a,s;this.supabaseUrl=e,this.supabaseKey=n;const o=oie(e);if(!n)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",o),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",o),this.storageUrl=new URL("storage/v1",o),this.functionsUrl=new URL("functions/v1",o);const c=`sb-${o.hostname.split(".")[0]}-auth-token`,u={db:Qre,realtime:tie,auth:Object.assign(Object.assign({},eie),{storageKey:c}),global:Zre},d=sie(r??{},u);this.storageKey=(i=d.auth.storageKey)!==null&&i!==void 0?i:"",this.headers=(a=d.global.headers)!==null&&a!==void 0?a:{},d.accessToken?(this.accessToken=d.accessToken,this.auth=new Proxy({},{get:(h,f)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(f)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((s=d.auth)!==null&&s!==void 0?s:{},this.headers,d.global.fetch),this.fetch=iie(n,this._getAccessToken.bind(this),d.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},d.realtime)),this.accessToken&&this.accessToken().then(h=>this.realtime.setAuth(h)).catch(h=>console.warn("Failed to set initial Realtime auth token:",h)),this.rest=new cre(new URL("rest/v1",o).href,{headers:this.headers,schema:d.db.schema,fetch:this.fetch}),this.storage=new Yre(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),d.accessToken||this._listenForAuthEvents()}get functions(){return new are(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,n={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,n,r)}channel(e,n={config:{}}){return this.realtime.channel(e,n)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e,n;if(this.accessToken)return await this.accessToken();const{data:r}=await this.auth.getSession();return(n=(e=r.session)===null||e===void 0?void 0:e.access_token)!==null&&n!==void 0?n:this.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:n,detectSessionInUrl:r,storage:i,userStorage:a,storageKey:s,flowType:o,lock:c,debug:u,throwOnError:d},h,f){const p={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new pae({url:this.authUrl.href,headers:Object.assign(Object.assign({},p),h),storageKey:s,autoRefreshToken:e,persistSession:n,detectSessionInUrl:r,storage:i,userStorage:a,flowType:o,lock:c,debug:u,throwOnError:d,fetch:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(g=>g.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new Cre(this.realtimeUrl.href,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((n,r)=>{this._handleTokenChanged(n,"CLIENT",r==null?void 0:r.access_token)})}_handleTokenChanged(e,n,r){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),n=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const gae=(t,e,n)=>new mae(t,e,n);function vae(){if(typeof window<"u"||typeof process>"u")return!1;const t=process.version;if(t==null)return!1;const e=t.match(/^v(\d+)\./);return e?parseInt(e[1],10)<=18:!1}vae()&&console.warn("â ï¸ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to N
585ode.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const yae="https://brmeiebxvvelfkihfbxb.supabase.co",bae="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJybWVpZWJ4dnZlbGZraWhmYnhiIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjM5MDY0NzYsImV4cCI6MjA3OTQ4MjQ3Nn0.xexgaMCMIMNob6PK-1V-J-P0Dnu32BzaoG9HtWnyU2g",me=gae(yae,bae,{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}}),jF=b.createContext(void 0);function xae({children:t}){const[e,n]=b.useState(null),[r,i]=b.useState(null),[a,s]=b.useState(!0),[o,c]=b.useState(!1),u=rr();b.useEffect(()=>{const{data:{subscription:m}}=me.auth.onAuthStateChange((x,w)=>{var y;console.log("Auth state changed:",x,(y=w==null?void 0:w.user)==null?void 0:y.email),i(w),n((w==null?void 0:w.user)??null),s(!1)});me.auth.getSession().then(({data:{session:x}})=>{var w;console.log("Initial session check:",(w=x==null?void 0:x.user)==null?void 0:w.email),i(x),n((x==null?void 0:x.user)??null),s(!1)});const v=async()=>{if(document.visibilityState==="visible"){console.log("Tab became visible, refreshing session..."),c(!0);const{data:{session:x},error:w}=await me.auth.getSession();w?(console.error("Error refreshing session on visibility change:",w),c(!1)):(x&&await me.auth.refreshSession(),c(!1))}};return document.addEventListener("visibilitychange",v),()=>{m.unsubscribe(),document.removeEventListener("visibilitychange",v)}},[]);const d=async(m,v,x)=>{const{error:w}=await me.auth.signUp({email:m,password:v,options:{emailRedirectTo:`${window.location.origin}/dashboard`,data:{full_name:x}}});return{error:w}},h=async(m,v)=>{const{error:x}=await me.auth.signInWithPassword({email:m,password:v});return{error:x}},f=async()=>{localStorage.removeItem("admin_status_cache"),await me.auth.signOut(),u("/auth")},p=async m=>{const{error:v}=await me.auth.resetPasswordForEmail(m,{redirectTo:`${window.location.origin}/reset-password`});return{error:v}},g=async m=>{const{error:v}=await me.auth.updateUser({password:m});return{error:v}};return l.jsx(jF.Provider,{value:{user:e,session:r,loading:a,refreshing:o,signUp:d,signIn:h,signOut:f,resetPassword:p,updatePassword:g},children:t})}function sa(){const t=b.useContext(jF);if(t===void 0)throw new Error("useAuth must be used within an AuthProvider");return t}const PF=b.createContext(void 0);function wae({children:t}){const[e,n]=b.useState(()=>localStorage.getItem("event-color-palette")||"romantic"),r=i=>{n(i),localStorage.setItem("event-color-palette",i)};return l.jsx(PF.Provider,{value:{palette:e,setPalette:r},children:t})}function bf(){const t=b.useContext(PF);if(!t)throw new Error("useColorPalette must be used within ColorPaletteProvider");return t}const NF=b.createContext(void 0),AF="simplifiedViewEnabled",Sae=()=>localStorage.getItem(AF)==="true",MR=t=>{localStorage.setItem(AF,String(t))};function kae({children:t}){const[e,n]=b.useState(Sae),r=b.useCallback(()=>{n(a=>{const s=!a;return MR(s),s})},[]),i=b.useCallback(a=>{n(a),MR(a)},[]);return l.jsx(NF.Provider,{value:{isSimplified:e,toggleSimplified:r,setSimplified:i},children:t})}function OF(){const t=b.useContext(NF);return t===void 0?{isSimplified:!1,toggleSimplified:()=>{},setSimplified:()=>{}}:t}const Om=zg("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),de=b.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...i},a)=>{const s=r?eX:"button";return l.jsx(s,{className:ce(Om({variant:e,size:n,className:t})),ref:a,...i})});de.displayName="Button";const rt=b.forwardRef(({className:t,...e},n)=>l.jsx("div",{ref:n,className:ce("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));
585rt.displayName="Card";const ht=b.forwardRef(({className:t,...e},n)=>l.jsx("div",{ref:n,className:ce("flex flex-col space-y-1.5 p-6",t),...e}));ht.displayName="CardHeader";const mt=b.forwardRef(({className:t,...e},n)=>l.jsx("h3",{ref:n,className:ce("text-2xl font-semibold leading-none tracking-tight",t),...e}));mt.displayName="CardTitle";const tn=b.forwardRef(({className:t,...e},n)=>l.jsx("p",{ref:n,className:ce("text-sm text-muted-foreground",t),...e}));tn.displayName="CardDescription";const ot=b.forwardRef(({className:t,...e},n)=>l.jsx("div",{ref:n,className:ce("p-6 pt-0",t),...e}));ot.displayName="CardContent";const _ae=b.forwardRef(({className:t,...e},n)=>l.jsx("div",{ref:n,className:ce("flex items-center p-6 pt-0",t),...e}));_ae.displayName="CardFooter";const IR="cookie-consent";function Cae(){const[t,e]=b.useState(!1),[n,r]=b.useState(!1);b.useEffect(()=>{localStorage.getItem(IR)||setTimeout(()=>e(!0),1e3)},[]),b.useEffect(()=>(t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset"}),[t]);const i=()=>{localStorage.setItem(IR,"acknowledged"),e(!1)};return t?l.jsxs("div",{className:"fixed inset-0 z-50 flex items-end justify-center p-4 pointer-events-none",children:[l.jsx("style",{children:` 586 .custom-scrollbar::-webkit-scrollbar {
587 width: 8px; 588 } 589 .custom-scrollbar::-webkit-scrollbar-track { 590 background: transparent; 591 } 592 .custom-scrollbar::-webkit-scrollbar-thumb { 593 background: hsl(var(--primary) / 0.2); 594 border-radius: 4px; 595 } 596 .custom-scrollbar::-webkit-scrollbar-thumb:hover { 597 background: hsl(var(--primary) / 0.4); 598 } 599 `}),l.jsx(rt,{className:"max-w-2xl w-full max-h-[90vh] p-6 shadow-2xl pointer-events-auto bg-background/95 backdrop-blur-lg border-border",children:l.jsxs("div",{className:"flex items-start gap-4",children:[l.jsx("div",{className:"flex-shrink-0",children:l.jsx(nZ,{className:"w-6 h-6 text-primary"})}),l.jsx("div",{className:"flex-1 overflow-y-auto pr-2 scroll-smooth custom-scrollbar",style:{maxHeight:"calc(90vh - 3rem)"},children:l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Essential Storage Notice"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"This app requires browser storage (localStorage) to function properly. We use it to keep you signed in, remember your preferences, and provide core features. We do not use tracking cookies or third-party analytics. This storage is essential and cannot be disabled."})]}),n&&l.jsxs("div",{className:"space-y-3 text-sm border-t border-border pt-4",children:[l.jsxs("div",{children:[l.jsx("h4",{className:"font-semibold mb-2",children:"Essential Storage (Always Active)"}),l.jsxs("ul",{className:"list-disc pl-5 space-y-1 text-muted-foreground",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Authentication tokens:"})," Stored in localStorage to keep you logged in"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Session management:"})," Maintains your active session and auto-refresh"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"User preferences:"})," Stores your theme, color palette, and app settings"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Cookie consent:"})," Remembers your consent choice"]})]})]}),l.jsxs("div",{children:[l.jsx("h4",{className:"font-semibold mb-2",children:"Security & Performance"}),l.jsxs("ul",{className:"list-disc pl-5 space-y-1 text-muted-foreground",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Rate limiting data:"})," Temporary storage to prevent abuse (cleared within 24 hours)"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Security monitoring:"})," IP-based tracking for brute-force prevention"]})]})]}),l.jsxs("p",{className:"text-xs text-muted-foreground pt-2",children:["For more details, read our"," ",l.jsx(Xne,{to:"/privacy",className:"text-primary hover:underline",children:"Privacy Policy"}),"."]})]}),l.jsxs("div",{className:"flex flex-wrap gap-3 pt-2",children:[l.jsx(de,{onClick:i,className:"flex-1 sm:flex-none",children:"I Understand"}),l.jsx(de,{onClick:()=>r(!n),variant:"ghost",size:"sm",className:"flex-1 sm:flex-none",children:n?"Hide Details":"Show Details"})]})]})}),l.jsx("button",{onClick:i,className:"flex-shrink-0 p-1 rounded-md hover:bg-muted transition-colors","aria-label":"Close",children:l.jsx(vo,{className:"w-5 h-5"})})]})})]}):null}const Tae=zg("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Rn({className:t,variant:e,...n}){return l.jsx("div",{className:ce(Tae({variant:e}),t),...n})}const Eae=[{title:"Schedule care in seconds",description:"Speak or type naturally â no forms, no fuss.",radius:"42% 58% 70% 30% / 45% 55% 45% 55%",hoverRadius:"58% 42% 30% 70% / 55% 45% 55% 45%"},{title:"Family access, no signups",description:"Share a link and the whole care team can see the schedule.",radiu
599s:"60% 40% 35% 65% / 50% 60% 40% 50%",hoverRadius:"40% 60% 65% 35% / 60% 40% 60% 40%"},{title:"Everyone stays in the loop",description:"Update once and every caregiver sees it immediately.",radius:"35% 65% 55% 45% / 65% 35% 60% 40%",hoverRadius:"65% 35% 45% 55% / 35% 65% 40% 60%"},{title:"All care details in one place",description:"Locations, notes, medications â everything in one view.",radius:"55% 45% 40% 60% / 38% 62% 55% 45%",hoverRadius:"45% 55% 60% 40% / 62% 38% 45% 55%"},{title:"Safe and in your control",description:"You decide who can view and who can edit.",radius:"48% 52% 62% 38% / 42% 58% 48% 52%",hoverRadius:"52% 48% 38% 62% / 58% 42% 52% 48%"},{title:"Calm, clear, accessible",description:"Simple enough for every family member to use.",radius:"65% 35% 45% 55% / 55% 45% 35% 65%",hoverRadius:"35% 65% 55% 45% / 45% 55% 65% 35%"}];function jae(){return l.jsx("section",{className:"relative z-10 container mx-auto px-6 md:px-8 py-16 md:py-24 lg:py-32",children:l.jsxs("div",{className:"max-w-6xl mx-auto",children:[l.jsxs("div",{className:"text-center mb-12 md:mb-16",children:[l.jsx("h2",{className:"text-2xl md:text-3xl font-display mb-3",children:"Everything your care team needs"}),l.jsx("p",{className:"text-lg text-muted-foreground",children:"Simple tools that bring peace to family care planning"})]}),l.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-8 md:gap-10",children:Eae.map((t,e)=>l.jsxs("div",{className:"relative flex items-center justify-center w-56 h-56 md:w-64 md:h-64 mx-auto",children:[l.jsx("div",{className:"absolute inset-0 backdrop-blur-sm bg-background/40 border border-border/30",style:{animation:`stone-${e} ${6+e*1.3}s ease-in-out infinite`}}),l.jsxs("div",{className:"relative z-10 flex flex-col items-center justify-center text-center px-8",children:[l.jsx("h3",{className:"text-lg md:text-xl font-semibold mb-2 leading-tight",children:t.title}),l.jsx("p",{className:"text-sm text-muted-foreground leading-snug",children:t.description})]}),l.jsx("style",{children:` 600 @keyframes stone-${e} { 601 0%, 100% { border-radius: ${t.radius}; transform: scale(1) rotate(0deg); } 602 50% { border-radius: ${t.hoverRadius}; transform: scale(1.04) rotate(${e%2===0?3:-3}deg); } 603 } 604 `})]},e))})]})})}var RF={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},LR=D.createContext&&D.createContext(RF),Pae=["attr","size","title"];function Nae(t,e){if(t==null)return{};var n,r,i=Aae(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Aae(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function B0(){return B0=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},B0.apply(null,arguments)}function $R(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function U0(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?$R(Object(n),!0).forEach(function(r){Oae(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$R(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Oae(t,e,n){return(e=Rae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Rae(t){var e=Dae(t,"string");return typeof e=="symbol"?e:e+""}function Dae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function DF(t){return t&&t.map((e,n)=>D.createElement(e.tag,U0({key:n},e.attr),DF(e.child)))}function jt(t){return e=>D.createElement(Mae,B0({attr:U0({},t.attr)},e),DF(t.child))}function Mae(t){var e=n=>{var{attr:r,size:i,title:a}=t,s=Nae(t,Pae),o=i||n.size||"1em",c;return n.className&&(c=n.className),t.className&&(c=(c?c+" ":"")+t.className),D.createElement("svg",B0({stroke:"currentColor",fill:"
604currentColor",strokeWidth:"0"},n.attr,r,s,{className:c,style:U0(U0({color:t.color||n.color},n.style),t.style),height:o,width:o,xmlns:"http://www.w3.org/2000/svg"}),a&&D.createElement("title",null,a),t.children)};return LR!==void 0?D.createElement(LR.Consumer,null,n=>e(n)):e(RF)}function Iae(t){return jt({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M72,144H32a8,8,0,0,1,0-16H67.72l13.62-20.44a8,8,0,0,1,13.32,0l25.34,38,9.34-14A8,8,0,0,1,136,128h24a8,8,0,0,1,0,16H140.28l-13.62,20.44a8,8,0,0,1-13.32,0L88,126.42l-9.34,14A8,8,0,0,1,72,144ZM178,40c-20.65,0-38.73,8.88-50,23.89C116.73,48.88,98.65,40,78,40a62.07,62.07,0,0,0-62,62c0,.75,0,1.5,0,2.25a8,8,0,1,0,16-.5c0-.58,0-1.17,0-1.75A46.06,46.06,0,0,1,78,56c19.45,0,35.78,10.36,42.6,27a8,8,0,0,0,14.8,0c6.82-16.67,23.15-27,42.6-27a46.06,46.06,0,0,1,46,46c0,53.61-77.76,102.15-96,112.8-10.83-6.31-42.63-26-66.68-52.21a8,8,0,1,0-11.8,10.82c31.17,34,72.93,56.68,74.69,57.63a8,8,0,0,0,7.58,0C136.21,228.66,240,172,240,102A62.07,62.07,0,0,0,178,40Z"},child:[]}]})(t)}function Lae(t){return jt({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,88H168V40a16,16,0,0,0-16-16H104A16,16,0,0,0,88,40V88H40a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16H88v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V168h48a16,16,0,0,0,16-16V104A16,16,0,0,0,216,88Zm0,64H160a8,8,0,0,0-8,8v56H104V160a8,8,0,0,0-8-8H40V104H96a8,8,0,0,0,8-8V40h48V96a8,8,0,0,0,8,8h56Z"},child:[]}]})(t)}function $ae(t){return jt({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M247.31,124.76c-.35-.79-8.82-19.58-27.65-38.41C194.57,61.26,162.88,48,128,48S61.43,61.26,36.34,86.35C17.51,105.18,9,124,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208s66.57-13.26,91.66-38.34c18.83-18.83,27.3-37.61,27.65-38.4A8,8,0,0,0,247.31,124.76ZM128,192c-30.78,0-57.67-11.19-79.93-33.25A133.47,133.47,0,0,1,25,128,133.33,133.33,0,0,1,48.07,97.25C70.33,75.19,97.22,64,128,64s57.67,11.19,79.93,33.25A133.46,133.46,0,0,1,231.05,128C223.84,141.46,192.43,192,128,192Zm0-112a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Z"},child:[]}]})(t)}function Fae(t){return jt({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M235.5,216.81c-22.56-11-35.5-34.58-35.5-64.8V134.73a15.94,15.94,0,0,0-10.09-14.87L165,110a8,8,0,0,1-4.48-10.34l21.32-53a28,28,0,0,0-16.1-37,28.14,28.14,0,0,0-35.82,16,.61.61,0,0,0,0,.12L108.9,79a8,8,0,0,1-10.37,4.49L73.11,73.14A15.89,15.89,0,0,0,55.74,76.8C34.68,98.45,24,123.75,24,152a111.45,111.45,0,0,0,31.18,77.53A8,8,0,0,0,61,232H232a8,8,0,0,0,3.5-15.19ZM67.14,88l25.41,10.3a24,24,0,0,0,31.23-13.45l21-53c2.56-6.11,9.47-9.27,15.43-7a12,12,0,0,1,6.88,15.92L145.69,93.76a24,24,0,0,0,13.43,31.14L184,134.73V152c0,.33,0,.66,0,1L55.77,101.71A108.84,108.84,0,0,1,67.14,88Zm48,128a87.53,87.53,0,0,1-24.34-42,8,8,0,0,0-15.49,4,105.16,105.16,0,0,0,18.36,38H64.44A95.54,95.54,0,0,1,40,152a85.9,85.9,0,0,1,7.73-36.29l137.8,55.12c3,18,10.56,33.48,21.89,45.16Z"},child:[]}]})(t)}function Bae(t){return jt({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M248,124a56.11,56.11,0,0,0-32-50.61V72a48,48,0,0,0-88-26.49A48,48,0,0,0,40,72v1.39a56,56,0,0,0,0,101.2V176a48,48,0,0,0,88,26.49A48,48,0,0,0,216,176v-1.41A56.09,56.09,0,0,0,248,124ZM88,208a32,32,0,0,1-31.81-28.56A55.87,55.87,0,0,0,64,180h8a8,8,0,0,0,0-16H64A40,40,0,0,1,50.67,86.27,8,8,0,0,0,56,78.73V72a32,32,0,0,1,64,0v68.26A47.8,47.8,0,0,0,88,128a8,8,0,0,0,0,16,32,32,0,0,1,0,64Zm104-44h-8a8,8,0,0,0,0,16h8a55.87,55.87,0,0,0,7.81-.56A32,32,0,1,1,168,144a8,8,0,0,0,0-16,47.8,47.8,0,0,0-32,12.26V72a32,32,0,0,1,64,0v6.73a8,8,0,0,0,5.33,7.54A40,40,0,0,1,192,164Zm16-52a8,8,0,0,1-8,8h-4a36,36,0,0,1-36-36V80a8,8,0,0,1,16,0v4a20,20,0,0,0,20,20h4A8,8,0,0,1,208,112ZM60,120H56a8,8,0,0,1,0-16h4A20,20,0,0,0,80,84V80a8,8,0,0,1,16,0v4A36,36,0,0,1,60,120Z"},child:[]}]})(t)}const Uae={focusable:"false",preserveAspectRatio:"xMidYMid meet"};function zae({width:t,height:e,viewBox:n=`0 0 ${t} ${e}`,...r}={}){const{tabindex:i,...a}=r,s={...Uae,...a,width:t,height:e,viewBox:n};return s["aria-label"]||s["aria-labelledby"]?(s.role="img",i!=null&&(s.focusable="true",s.tabindex=i)):s["aria-hidden"]=!0,s}var MF={exports:{}},Wae="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Vae=Wae,Hae=Vae;function IF(){}function LF(){}LF.resetWarningCache=IF;var qae=function(){function t(r,i,a,s,o,c){if(c!==Hae){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:LF,resetWarningCache:IF};return n.PropTypes=n,n};MF.exports=qae();var Kae=MF.exports;const et=Lt(Kae),Ii=b.forwardRef(function({className:e,children:n,tabIndex:r,xmlns:i="http://www.w3.org/2000/svg",preserveAspectRatio:a="xMidYMid meet",...s},o){const{tabindex:c,...u}=zae({...s,tabindex:r}),d=u;return e&&(d.className=e),c!=null&&(typeof c=="number"?d.tabIndex=c:d.tabIndex=Number(r)),o&&(
604d.ref=o),i&&(d.xmlns=i),a&&(d.preserveAspectRatio=a),D.createElement("svg",d,n)});Ii.displayName="Icon";Ii.propTypes={"aria-hidden":et.oneOfType([et.bool,et.oneOf(["true","false"])]),"aria-label":et.string,"aria-labelledby":et.string,children:et.node,className:et.string,height:et.oneOfType([et.number,et.string]),preserveAspectRatio:et.string,tabIndex:et.oneOfType([et.number,et.string]),viewBox:et.string,width:et.oneOfType([et.number,et.string]),xmlns:et.string};const Gae=D.forwardRef(function({children:e,size:n=16,...r},i){return D.createElement(Ii,{width:n,height:n,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...r},l.jsx("path",{d:"M29.55,26.11,26.5,27.63,23.66,21H15a2,2,0,0,1-2-2V13a2,2,0,0,1,4,0v4h7V15H19V13a4,4,0,0,0-8,0v1a9,9,0,1,0,8.77,11H17.71A7,7,0,1,1,11,16v3a4,4,0,0,0,4,4h7.34l3.16,7.37,4.95-2.48Z"}),l.jsx("path",{d:"M15.5,8A3.5,3.5,0,1,1,19,4.5,3.5,3.5,0,0,1,15.5,8Zm0-5A1.5,1.5,0,1,0,17,4.5,1.5,1.5,0,0,0,15.5,3Z"}),e)}),Yae=D.forwardRef(function({children:e,size:n=16,...r},i){return D.createElement(Ii,{width:n,height:n,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...r},l.jsx("path",{d:"M20 20H22V30H20z"}),l.jsx("path",{d:"M4 23H6V30H4z"}),l.jsx("path",{d:"M16,30H14V26a1.0011,1.0011,0,0,0-1-1H11v5H9V23h4a3.0033,3.0033,0,0,1,3,3Z"}),l.jsx("path",{d:"M7.5,22A3.5041,3.5041,0,0,1,4,18.5V17H2V15H6v3.5a1.5,1.5,0,0,0,3,0V15h4v2H11v1.5A3.5041,3.5041,0,0,1,7.5,22Z"}),l.jsx("path",{d:"M27,10H21.354a2.9861,2.9861,0,0,0-2.7856,1.8857l-1.4419,3.6055-3.6079,4.51,1.562,1.249,3.7-4.625,1.645-3.9961A.9949.9949,0,0,1,21.354,12H27a1.0009,1.0009,0,0,1,1,1v7H25V30h2V22h1a2.0023,2.0023,0,0,0,2-2V13A3.0033,3.0033,0,0,0,27,10Z"}),l.jsx("path",{d:"M24,9a4,4,0,1,1,4-4A4.0045,4.0045,0,0,1,24,9Zm0-6a2,2,0,1,0,2,2A2.0021,2.0021,0,0,0,24,3Z"}),e)}),Jae=D.forwardRef(function({children:e,size:n=16,...r},i){return D.createElement(Ii,{width:n,height:n,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...r},l.jsx("path",{d:"M18,30V28A10.0114,10.0114,0,0,0,28,18h2A12.0134,12.0134,0,0,1,18,30Z"}),l.jsx("path",{d:"M18,26V24a6.0066,6.0066,0,0,0,6-6h2A8.0092,8.0092,0,0,1,18,26Z"}),l.jsx("path",{d:"M18,22V20a2.0023,2.0023,0,0,0,2-2h2A4.0042,4.0042,0,0,1,18,22Z"}),l.jsx("path",{d:"M10,2a9.01,9.01,0,0,0-9,9H3a7,7,0,0,1,14,0,7.09,7.09,0,0,1-3.501,6.1348L13,17.4229v3.0732a2.9354,2.9354,0,0,1-.9009,2.1514,4.1824,4.1824,0,0,1-4.6318,1.03A4.0918,4.0918,0,0,1,5,20H3a6.1156,6.1156,0,0,0,3.6694,5.5117,5.7822,5.7822,0,0,0,2.3145.4863A6.5854,6.5854,0,0,0,13.4624,24.11,4.94,4.94,0,0,0,15,20.4961V18.5537A9.1077,9.1077,0,0,0,19,11,9.01,9.01,0,0,0,10,2Z"}),l.jsx("path",{d:"M9.28,8.0825A3.0061,3.0061,0,0,1,13,11h2a4.9786,4.9786,0,0,0-1.8843-3.9111A5.0414,5.0414,0,0,0,8.835,6.1323,4.95,4.95,0,0,0,5.1323,9.835,5.0318,5.0318,0,0,0,7.436,15.2935,3.0777,3.0777,0,0,1,9,17.9229V20h2V17.9229a5.0608,5.0608,0,0,0-2.5371-4.3458A3.0016,3.0016,0,0,1,9.28,8.0825Z"}),e)}),Xae=D.forwardRef(function({children:e,size:n=16,...r},i){return D.createElement(Ii,{width:n,height:n,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...r},l.jsx("path",{d:"M21 10 17 10 17 6 15 6 15 10 11 10 11 12 15 12 15 16 17 16 17 12 21 12 21 10z"}),l.jsx("path",{d:"M28,10H26V4a2.0023,2.0023,0,0,0-2-2H8A2.0023,2.0023,0,0,0,6,4v6H4a2.0023,2.0023,0,0,0-2,2V30H30V12A2.0023,2.0023,0,0,0,28,10ZM14,28V22h4v6Zm6,0V21a1,1,0,0,0-1-1H13a1,1,0,0,0-1,1v7H4V12H8V4H24v8h4V28Z"}),e)}),Zae=D.forwardRef(function({children:e,size:n=16,...r},i){return D.createElement(Ii,{width:n,height:n,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...r},l.jsx("path",{d:"M25,16H17a2.0023,2.0023,0,0,0-2,2v6H4V14H2V30H4V26H28v4h2V21A5.0059,5.0059,0,0,0,25,16Zm3,8H17V18h8a3.0033,3.0033,0,0,1,3,3Z"}),l.jsx("path",{d:"M9.5,17A1.5,1.5,0,1,1,8,18.5,1.5017,1.5017,0,0,1,9.5,17m0-2A3.5,3.5,0,1,0,13,18.5,3.5,3.5,0,0,0,9.5,15Z"}),l.jsx("path",{d:"M21 6 17 6 17 2 15 2 15 6 11 6 11 8 15 8 15 12 17 12 17 8 21 8 21 6z"}),e)}),Qae=D.forwardRef(function({children:e,size:n=16,...r},i){return D.createElement(Ii,{width:n,height:n,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"
604currentColor",...r},l.jsx("path",{d:"M26,6V26H6V6H26m0-2H6A2,2,0,0,0,4,6V26a2,2,0,0,0,2,2H26a2,2,0,0,0,2-2V6a2,2,0,0,0-2-2Z"}),l.jsx("path",{d:"M22 16 22 14 17 14 17 12 20 12 20 10 17 10 17 8 15 8 15 10 12 10 12 12 15 12 15 14 10 14 10 16 15 16 15 18 10 18 10 20 15 20 15 22 12 22 12 24 20 24 20 22 17 22 17 20 22 20 22 18 17 18 17 16 22 16z"}),e)}),ese=D.forwardRef(function({children:e,size:n=16,...r},i){return D.createElement(Ii,{width:n,height:n,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...r},l.jsx("path",{d:"M24,2H8A2,2,0,0,0,6,4V8a2,2,0,0,0,2,2V28a2,2,0,0,0,2,2H22a2,2,0,0,0,2-2V10a2,2,0,0,0,2-2V4A2,2,0,0,0,24,2ZM10,14h3V24H10ZM22,28H10V26h5V12H10V10H22ZM8,8V4H24V8Z"}),e)}),tse=D.forwardRef(function({children:e,size:n=16,...r},i){return D.createElement(Ii,{width:n,height:n,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...r},l.jsx("path",{d:"M20,2H4A2,2,0,0,0,2,4V8a2,2,0,0,0,2,2V28a2,2,0,0,0,2,2H18a2,2,0,0,0,2-2V10a2,2,0,0,0,2-2V4A2,2,0,0,0,20,2ZM6,14H9V24H6ZM18,28H6V26h5V12H6V10H18ZM4,8V4H20V8Z"}),l.jsx("circle",{cx:"26",cy:"16",r:"4"}),e)}),nse=D.forwardRef(function({children:e,size:n=16,...r},i){return D.createElement(Ii,{width:n,height:n,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...r},l.jsx("path",{d:"M22,14a7.94,7.94,0,0,0-4,1.0825V9A7,7,0,0,0,4,9V23a6.999,6.999,0,0,0,12.2855,4.5878A7.9969,7.9969,0,1,0,22,14Zm0,2a6.0046,6.0046,0,0,1,5.91,5H16.09A6.0046,6.0046,0,0,1,22,16ZM6,9A5,5,0,0,1,16,9v6H6Zm5,19a5.0059,5.0059,0,0,1-5-5V17h9.765a7.9566,7.9566,0,0,0-.7242,8.9315A4.9885,4.9885,0,0,1,11,28Zm11,0a6.0046,6.0046,0,0,1-5.91-5H27.91A6.0046,6.0046,0,0,1,22,28Z"}),e)}),rse=D.forwardRef(function({children:e,size:n=16,...r},i){return D.createElement(Ii,{width:n,height:n,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...r},l.jsx("path",{d:"M27,12v2h1v4a3,3,0,0,1-6,0V14h1V12H20v6a5.0083,5.0083,0,0,0,4,4.8989V24a4,4,0,0,1-8,0V21.8157a3,3,0,1,0-2,0V24a6,6,0,0,0,12,0V22.8989A5.0083,5.0083,0,0,0,30,18V12ZM15,18a1,1,0,1,1-1,1A1.0009,1.0009,0,0,1,15,18Z"}),l.jsx("path",{d:"M26,4H22V2H20V4H12V2H10V4H6A2,2,0,0,0,4,6V26a2,2,0,0,0,2,2l4,0V26L6,26V6h4V8h2V6h8V8h2V6h4v4h2V6A2,2,0,0,0,26,4Z"}),e)}),ise=D.forwardRef(function({children:e,size:n=16,...r},i){return D.createElement(Ii,{width:n,height:n,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...r},l.jsx("path",{d:"M24,2V4h2v6a4,4,0,0,1-8,0V4h2V2H16v8a6.0051,6.0051,0,0,0,5,5.91V22A6,6,0,0,1,9,22V15.8579a4,4,0,1,0-2,0V22a8,8,0,0,0,16,0V15.91A6.0051,6.0051,0,0,0,28,10V2ZM6,12a2,2,0,1,1,2,2A2.0023,2.0023,0,0,1,6,12Z"}),e)}),ase=D.createContext({});var sse=Object.defineProperty,FR=Object.getOwnPropertySymbols,ose=Object.prototype.hasOwnProperty,cse=Object.prototype.propertyIsEnumerable,BR=(t,e,n)=>e in t?sse(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,_S=(t,e)=>{for(var n in e||(e={}))ose.call(e,n)&&BR(t,n,e[n]);if(FR)for(var n of FR(e))cse.call(e,n)&&BR(t,n,e[n]);return t};const lse=(t,e)=>{const n=b.useContext(ase),r=_S(_S({},n),t);return b.createElement("svg",_S({width:"1.5em",height:"1.5em",strokeWidth:1.5,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:"currentColor",ref:e},r),b.createElement("path",{d:"M18 20L21.8243 16.1757C21.9368 16.0632 22 15.9106 22 15.7515V10.5C22 9.67157 21.3284 9 20.5 9V9C19.6716 9 19 9.67157 19 10.5V15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),b.createElement("path",{d:"M18 16L18.8581 15.1419C18.949 15.051 19 14.9278 19 14.7994V14.7994C19 14.6159 18.8963 14.4482 18.7322 14.3661L18.2893 14.1447C17.5194 13.7597 16.5894 13.9106 15.9807 14.5193L15.0858 15.4142C14.7107 15.7893 14.5 16.298 14.5 16.8284V20",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),b.createElement("path",{d:"M6 20L2.17574 16.1757C2.06321 16.0632 2 15.9106 2 15.7515V10.5C2 9.67157 2.67157 9 3.5 9V9C4.32843 9 5 9.67157 5 10.5V15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),b.createElement("path",{d:"M6 16L5.14187 15.1419C5.05103 15.051 5 14.9278 5 14.7994V14.7994C5 14.6159 5.10366 14.4482 5.26776 14.3661L5.71067 14.1447C6.48064 13.7597 7.41059 13.9106 8.01931 14.5193L8.91421 15.4142C9.28929 15.7893 9.5 16.298 9.5 16.8284V20",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),b.createElement("path",{d:"M13.6667 12H10.3333V9.66667H8V6.33333H10.3333V4H13.6667V6.33333H16V9.66667H13.6667V12Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}))},use=b.forwardRef(lse);var dse=use;function hse(t){return jt({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 4m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},child:[]},{tag:"path",attr:{d:"M4 20h4l1.5 -3"},child:[]},{tag:"path",attr:{d:"M17 20l-1 -5h-5l1 -7"},child:[]},{tag:"path",attr:{d:"M4 10l4 -1l4 -1l4 1.5l4 1.5"},child:[]}]})(t)}function fse(t){return jt({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M17 3l4 4"},child:[]},{tag:"path",attr:{d:"M19 5l-4.5 4.5"},child:[]},{tag:"path",attr:{d:"M11.5 6.5l6 6"},child:[]},{tag:"path",attr:{d:"M16.5 11.5l-6.5 6.5h-4v-4l6.5 -6.5"},child:[]},{tag:"path",attr:{d:"M7.5 12.5l1.5 1.5"},child:[]},{tag:"path",attr:{d:"M10.5 9.5l1.5 1.5"},child:[]},{tag:"path",attr:{d:"M3 21l3 -3"},child:[]}]})(t)}function pse(t){return jt({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M16 9m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},child:[]},{tag:"path",attr:{d:"M6 11l4 -2l3.5 3l-1.5 2"},child:[]},{tag:"path",attr:{d:"M3 16.75a2.4 2.4 0 0 0 1 .25a2.4 2.4 0 0 0 2 -1a2.4 2.4 0 0 1 2 -1a2.4 2.4 0 0 1 2 1a2.4 2.4 0 0 0 2 1a2.4 2.4 0 0 0 2 -1a2.4 2.4 0 0 1 2 -1a2.4 2.4 0 0 1 2 1a2.4 2.4 0 0 0 2 1a2.4 2.4 0 0 0 1 -.25"},child:[]}]})(t)}function mse(t){return jt({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M16 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},child:[]},{tag:"path",attr:{d:"M5 20l5 -.5l1 -2"},child:[]},{tag:"path",attr:{d:"M18 20v-5h-5.5l2.5 -6.5l-5.5 1l1.5 2"}
604,child:[]}]})(t)}function gse(t){return jt({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M13 4m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},child:[]},{tag:"path",attr:{d:"M4 17l5 1l.75 -1.5"},child:[]},{tag:"path",attr:{d:"M15 21l0 -4l-4 -3l1 -6"},child:[]},{tag:"path",attr:{d:"M7 12l0 -3l5 -1l3 3l3 1"},child:[]}]})(t)}function vse(t){return jt({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M3 5m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z"},child:[]},{tag:"path",attr:{d:"M9 19v-6"},child:[]},{tag:"path",attr:{d:"M8 5v8h2v-8"},child:[]},{tag:"path",attr:{d:"M15 19v-6"},child:[]},{tag:"path",attr:{d:"M14 5v8h2v-8"},child:[]}]})(t)}function yse(t){return jt({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 5c2.941 0 6.685 1.537 9 3l-2 11h-14l-2 -11c2.394 -1.513 6.168 -3.005 9 -3"},child:[]},{tag:"path",attr:{d:"M10 12h4"},child:[]},{tag:"path",attr:{d:"M12 10v4"},child:[]}]})(t)}function bse(t){return jt({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"},child:[]},{tag:"path",attr:{d:"M9 10l.01 0"},child:[]},{tag:"path",attr:{d:"M15 10l.01 0"},child:[]},{tag:"path",attr:{d:"M9.5 15a3.5 3.5 0 0 0 5 0"},child:[]},{tag:"path",attr:{d:"M12 3a2 2 0 0 0 0 4"},child:[]}]})(t)}function xse(t){return jt({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M4 17m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},child:[]},{tag:"path",attr:{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},child:[]},{tag:"path",attr:{d:"M4 22l4 -2v-3h12"},child:[]},{tag:"path",attr:{d:"M11 20h9"},child:[]},{tag:"path",attr:{d:"M8 14l3 -2l1 -4c3 1 3 4 3 6"},child:[]}]})(t)}function wse(t){return jt({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M9 6h7.459a3 3 0 0 1 2.959 2.507l.577 3.464l.81 4.865a1 1 0 0 1 -.985 1.164h-16.82a7 7 0 0 1 7 -7h9.8"},child:[]}]})(t)}function Sse(t){return jt({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M3.5 17.5c5.667 4.667 11.333 4.667 17 0"},child:[]},{tag:"path",attr:{d:"M19 18.5l-2 -8.5l1 -2l2 1l1.5 -1.5l-2.5 -4.5c-5.052 .218 -5.99 3.133 -7 6h-6a3 3 0 0 0 -3 3"},child:[]},{tag:"path",attr:{d:"M5 18.5l2 -9.5"},child:[]},{tag:"path",attr:{d:"M8 20l2 -5h4l2 5"},child:[]}]})(t)}function kse(t){return jt({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M17.5 17.5m-2.5 0a2.5 2.5 0 1 0 5 0a2.5 2.5 0 1 0 -5 0"},child:[]},{tag:"path",attr:{d:"M6 8v11a1 1 0 0 0 1.806 .591l3.694 -5.091v.055"},child:[]},{tag:"path",attr:{d:"M6 8h15l-3.5 7l-7.1 -.747a4 4 0 0 1 -3.296 -2.493l-2.853 -7.13a1 1 0 0 0 -.928 -.63h-1.323"},child:[]}]})(t)}function _se(t){return jt({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 5.5c-1.074 -.586 -2.583 -1.5 -4 -1.5c-2.1 0 -4 1.247 -4 5c0 4.899 1.056 8.41 2.671 10.537c.573 .756 1.97 .521 2.567 -.236c.398 -.505 .819 -1.439 1.262 -2.801c.292 -.771 .892 -1.504 1.5 -1.5c.602 0 1.21 .737 1.5 1.5c.443 1.362 .864 2.295 1.262 2.8c.597 .759 2 .993 2.567 .237c1.615 -2.127 2.671 -5.637 2.671 -10.537c0 -3.74 -1.908 -5 -4 -5c-1.423 0 -2.92 .911 -4 1.5z"},child:[]},{tag:"path",attr:{d:"M12 5.5l3 1.5"},child:[]}]})(t)}function Cse(t){return jt({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 3c1.918 0 3.52 1.35 3.91 3.151a4 4 0 0 1 2.09 7.723l0 7.126h-12v-7.126a4 4 0 1 1 2.092 -7.723a4 4 0 0 1 3.908 -3.151z"},child:[]},{tag:"path",attr:{d:"M6.161 17.009l11.839 -.009"},child:[]}]})(t)}function Tse(t){return jt({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M2 12h1"},child:[]},{tag:"path",attr:{d:"M6 8h-2a1 1 0 0 0 -1 1v6a1 1 0 0 0 1 1h2"},child:[]},{tag:"path",attr:{d:"M6 7v10a1 1 0 0 0 1 1h1a1 1 0 0 0 1 -1v-10a1 1 0 0 0 -1 -1h-1a1 1 0 0 0 -1 1z"},child:[]},{tag:"path",attr:{d:"M9 12h6"},child:[]},{tag:"path",attr:{d:"M15 7v10a1 1 0 0 0 1 1h1a1 1 0 0 0 1 -1v-10a1 1 0 0 0 -1 -1h-1a1 1 0 0 0 -1 1z"},child:[]},{tag:"path",attr:{d:"M18 8h2a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-2"},child:[]},{tag:"path",attr:{d:"M22 12h-1"},child:[]}]})(t)}function Ese(t){return jt({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M14 12l0 .01"},child:[]},{tag:"path",attr:{d:"M10 12l0 .01"},child:[]},{tag:"path",attr:{d:"M12 10l0 .01"},child:[]},{tag:"path",attr:{d:"M12 14l0 .01"},child:[]},{tag:"path",attr:{d:"M4.5 12.5l8 -8a4.94 4.94 0 0 1 7 7l-8 8a4.94 4.94 0 0 1 -7 -7"},child:[]}]})(t)}function jse(t){return jt({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"},child:[]},{tag:"path",attr:{d:"M6 5.3a9 9 0 0 1 0 13.4"},child:[]},{tag:"path",attr:{d:"M18 5.3a9 9 0 0 0 0 13.4"},child:[]}]})(t)}function Pse(t){return jt({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"},child:[]},{tag:"path",attr:{d:"M12 7l4.76 3.45l-1.76 5.55h-6l-1.76 -5.55z"},child:[]},{tag:"path",attr:{d:"M12 7v-4m3 13l2.5 3m-.74 -8.55l3.74 -1.45m-11.44 7.05l-2.56 2.95m.74 -8.55l-3.74 -1.45"},child:[]}]})(t)}function Nse(t){return jt({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"},child:[]},{tag:"path",attr:{d:"M5.65 5.65l12.7 12.7"},child:[]},{tag:"path",attr:{d:"M5.65 18.35l12.7 -12.7"},child:[]},{tag:"path",attr:{d:"M12 3a9 9 0 0 0 9 9"},child:[]},{tag:"path",attr:{d:"M3 12a9 9 0 0 1 9 9"},child:[]}]})(t)}function Ase(t){return jt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M14 8v2h-3L8.31 8.82 7 12.75V22H3V12l1.58-4.63A2.003 2.003 0 0 1 7.3 6.18l4.15 1.83L14 8zM8 1c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm1 18h12v-2H9v2zm10.5-3c.83 0 1.5-.67 1.5-1.5s-.67-1.5-1.5-1.5-1.5.67-1.5 1.5.67 1.5 1.5 1.5zM13 12c0-.55-.45-1-1-1H9v2h2v1c0 1.1.9 2 2 2h2c1.1 0 2-.9 2-2v-3h-2v2h-2v-1z"},child:[]}]})(t)}function Ose(t){return jt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"m19.8 2-8.2 6.7-1.21-1.04 3.6-2.08L9.41 1 8 2.41l2.74 2.74L5 8.46l-1.19 4.29L6.27 17 8 16l-2.03-3.52.35-1.3L9.5 13l.5 9h2l.5-10L21 3.4z"}
604,child:[]},{tag:"circle",attr:{cx:"5",cy:"5",r:"2"},child:[]}]})(t)}function Rse(t){return jt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M13.5 5.5c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm6.5 7V23h-1V12.5c0-.28-.22-.5-.5-.5s-.5.22-.5.5v1h-1v-.69a6.02 6.02 0 0 1-3.51-2.52c-.31.87-.49 1.78-.49 2.71 0 .23.02.46.03.69L15 16.5V23h-2v-5l-1.78-2.54L11 19l-3 4-1.6-1.2L9 18.33V13c0-1.15.18-2.29.5-3.39l-1.5.85V14H6V9.3l5.4-3.07v.01a2 2 0 0 1 1.94.03c.36.21.63.51.8.85l.79 1.67A3.987 3.987 0 0 0 18.5 11c.83 0 1.5.67 1.5 1.5z"},child:[]}]})(t)}function Dse(t){return jt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M16 13c3.09-2.81 6-5.44 6-7.7C22 3.45 20.55 2 18.7 2c-1.04 0-2.05.49-2.7 1.25C15.34 2.49 14.34 2 13.3 2 11.45 2 10 3.45 10 5.3c0 2.26 2.91 4.89 6 7.7zm-2.7-9c.44 0 .89.21 1.18.55L16 6.34l1.52-1.79c.29-.34.74-.55 1.18-.55.74 0 1.3.56 1.3 1.3 0 1.12-2.04 3.17-4 4.99-1.96-1.82-4-3.88-4-4.99 0-.74.56-1.3 1.3-1.3zM19 16h-2c0-1.2-.75-2.28-1.87-2.7L8.97 11H1v11h6v-1.44l7 1.94 8-2.5v-1c0-1.66-1.34-3-3-3zM3 20v-7h2v7H3zm10.97.41L7 18.48V13h1.61l5.82 2.17c.34.13.57.46.57.83 0 0-1.99-.05-2.3-.15l-2.38-.79-.63 1.9 2.38.79c.51.17 1.04.26 1.58.26H19c.39 0 .74.23.9.56l-5.93 1.84z"},child:[]}]})(t)}function Mse(t){return jt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M20 4c-1.66 0-3 1.34-3 3v.29L12 3 7 7.29V7c0-1.66-1.34-3-3-3S1 5.34 1 7v14h10v-5c0-.55.45-1 1-1s1 .45 1 1v5h10V7c0-1.66-1.34-3-3-3zm0 2c.55 0 1 .45 1 1v1h-2V7c0-.55.45-1 1-1zM4 6c.55 0 1 .45 1 1v1H3V7c0-.55.45-1 1-1zM3 19v-9h2v9H3zm14 0h-2v-3c0-1.65-1.35-3-3-3s-3 1.35-3 3v3H7V9.92l5-4.29 5 4.29V19zm2 0v-9h2v9h-2z"},child:[]},{tag:"circle",attr:{cx:"12",cy:"10",r:"1.5"},child:[]}]})(t)}function Ise(t){return jt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M24 7c0-1.1-2-3-2-3s-2 1.9-2 3c0 .74.4 1.38 1 1.72V13h-2v-2c0-.95-.66-1.74-1.55-1.94.34-.58.55-1.25.55-1.97 0-1.31-.65-2.53-1.74-3.25L12 1 7.74 3.84A3.887 3.887 0 0 0 6 7.09c0 .72.21 1.39.55 1.96C5.66 9.26 5 10.05 5 11v2H3V8.72c.6-.34 1-.98 1-1.72 0-1.1-2-3-2-3S0 5.9 0 7c0 .74.4 1.38 1 1.72V21h10v-4c0-.55.45-1 1-1s1 .45 1 1v4h10V8.72c.6-.34 1-.98 1-1.72zM8.85 5.5 12 3.4l3.15 2.1c.53.36.85.95.85 1.59C16 8.14 15.14 9 14.09 9H9.91C8.86 9 8 8.14 8 7.09c0-.64.32-1.23.85-1.59zM21 19h-6v-2c0-1.65-1.35-3-3-3s-3 1.35-3 3v2H3v-4h4v-4h10v4h4v4z"},child:[]}]})(t)}function Lse(t){return jt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M21 5h-2.64l1.14-3.14L17.15 1l-1.46 4H3v2l2 6-2 6v2h18v-2l-2-6 2-6V5zm-3.9 8.63L18.89 19H5.11l1.79-5.37.21-.63-.21-.63L5.11 7h13.78l-1.79 5.37-.21.63.21.63zM13 9h-2v3H8v2h3v3h2v-3h3v-2h-3z"},child:[]}]})(t)}function $se(t){return jt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M13.5 5.5c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zM9.8 8.9 7 23h2.1l1.8-8 2.1 2v6h2v-7.5l-2.1-2 .6-3C14.8 12 16.8 13 19 13v-2c-1.9 0-3.5-1-4.3-2.4l-1-1.6a2.145 2.145 0 0 0-2.65-.84L6 8.3V13h2V9.6l1.8-.7"},child:[]}]})(t)}function Fse(t){return jt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"circle",attr:{cx:"4.5",cy:"9.5",r:"2.5"},child:[]},{tag:"circle",attr:{cx:"9",cy:"5.5",r:"2.5"},child:[]},{tag:"circle",attr:{cx:"15",cy:"5.5",r:"2.5"},child:[]},{tag:"circle",attr:{cx:"19.5",cy:"9.5",r:"2.5"},child:[]},{tag:"path",attr:{d:"M17.34 14.86c-.87-1.02-1.6-1.89-2.48-2.91-.46-.54-1.05-1.08-1.75-1.32-.11-.04-.22-.07-.33-.09-.25-.04-.52-.04-.78-.04s-.53 0-.79.05c-.11.02-.22.05-.33.09-.7.24-1.28.78-1.75 1.32-.87 1.02-1.6 1.89-2.48 2.91-1.31 1.31-2.92 2.76-2.62 4.79.29 1.02 1.02 2.03 2.33 2.32.73.15 3.06-.44 5.54-.44h.18c2.48 0 4.81.58 5.54.44 1.31-.29 2.04-1.31 2.33-2.32.31-2.04-1.3-3.49-2.61-4.8z"},child:[]}]})(t)}const at=({children:t,className:e})=>l.jsx("span",{className:`inline-flex items-center justify-center w-[18px] h-[18px] ${e??""}`,children:D.Children.map(t,n=>D.isValidElement(n)?D.cloneElement(n,{size:void 0,className:"w-full h-full"}):n)}),Bse=[{keywords:["hospital","emergency","er visit","urgent care","ambulance"],icon:l.jsx(at,{children:l.jsx(Xae,{size:18})}),priority:100},{keywords:["hospital bed","admitted","inpatient","overnight stay"],icon:l.jsx(at,{children:l.jsx(Zae,{size:18})}),priority:101},{keywords:["vaccine","vaccination","immunization","shot","booster","flu shot"],icon:l.jsx(at,{children:l.jsx(fse,{size:18})}),priority:99}
604,{keywords:["bandage","wound","dressing","wound care"],icon:l.jsx(at,{children:l.jsx(Ese,{size:18})}),priority:98},{keywords:["dentist","dental","teeth","orthodont","braces"],icon:l.jsx(at,{children:l.jsx(_se,{size:18})}),priority:97},{keywords:["eye","optometrist","ophthalmolog","vision","glasses","optician"],icon:l.jsx(at,{children:l.jsx($ae,{size:18})}),priority:96},{keywords:["hearing","audiolog","ear","hearing aid"],icon:l.jsx(at,{children:l.jsx(Jae,{size:18})}),priority:95},{keywords:["mental health","psycholog","psychiatr","counselor","counselling","counseling","therapist","cognitive"],icon:l.jsx(at,{children:l.jsx(Bae,{size:18})}),priority:94},{keywords:["first aid","cpr"],icon:l.jsx(at,{children:l.jsx(Lae,{size:18})}),priority:93},{keywords:["heartbeat","cardio","cardiolog","ecg","ekg","heart monitor","blood pressure","bp check"],icon:l.jsx(at,{children:l.jsx(Iae,{size:18})}),priority:92},{keywords:["wheelchair","mobility","accessible"],icon:l.jsx(at,{children:l.jsx(Gae,{size:18})}),priority:91},{keywords:["elderly","senior","aging","geriatr"],icon:l.jsx(at,{children:l.jsx(Rse,{size:18})}),priority:90},{keywords:["scan","x-ray","xray","mri","ct scan","ultrasound","mammogram","imaging","radiolog","echo"],icon:l.jsx(at,{children:l.jsx(Qae,{size:18})}),priority:87},{keywords:["nurse","home visit","home care","visiting nurse","district nurse","thuisverpleging"],icon:l.jsx(at,{children:l.jsx(yse,{size:18})}),priority:86},{keywords:["doctor","medical","checkup","check-up","clinic","health","specialist","oncolog","blood test","lab work"],icon:l.jsx(at,{children:l.jsx(ise,{size:18})}),priority:85},{keywords:["pharmacy","prescription","refill"],icon:l.jsx(at,{children:l.jsx(Lse,{size:18})}),priority:84},{keywords:["medication","medicine","tablet","dosage","supplement","vitamin"],icon:l.jsx(at,{children:l.jsx(ese,{size:18})}),priority:83},{keywords:["pill","pills"],icon:l.jsx(at,{children:l.jsx(nse,{size:18})}),priority:83},{keywords:["medication reminder","medicine reminder","pill reminder"],icon:l.jsx(at,{children:l.jsx(tse,{size:18})}),priority:89},{keywords:["medical reminder","health reminder","medical appointment"],icon:l.jsx(at,{children:l.jsx(rse,{size:18})}),priority:86},{keywords:["speech therapy","speech patholog","speech session","slp ","language therapy","logoped"],icon:l.jsx(b$,{size:18,strokeWidth:2}),priority:88},{keywords:["therapy","physical therapy","physio","physiotherapy","pt session","rehab","rehabilitation","occupational therapy","kinesitherapy"],icon:l.jsx(at,{children:l.jsx(mse,{size:18})}),priority:82},{keywords:["caregiv","caring","care visit","home care","respite","hospice","care"],icon:l.jsx(dse,{width:18,height:18}),priority:80},{keywords:["volunteer","charity","donate","fundrais"],icon:l.jsx(at,{children:l.jsx(Dse,{size:18})}),priority:79},{keywords:["yoga","meditation","mindfulness","breathe","stretch"],icon:l.jsx(at,{children:l.jsx(hse,{size:18})}),priority:75},{keywords:["swim","pool","aqua"],icon:l.jsx(at,{children:l.jsx(pse,{size:18})}),priority:74},{keywords:["run ","running","jog","marathon","sprint","5k","10k"],icon:l.jsx(at,{children:l.jsx(gse,{size:18})}),priority:73},{keywords:["soccer","football"],icon:l.jsx(at,{children:l.jsx(Pse,{size:18})}),priority:72},{keywords:["basketball","hoops"],icon:l.jsx(at,{children:l.jsx(Nse,{size:18})}),priority:71},{keywords:["tennis","badminton","racquet","squash","padel"],icon:l.jsx(at,{children:l.jsx(jse,{size:18})}),priority:70},{keywords:["martial art","karate","judo","taekwondo","boxing","kickbox","mma"],icon:l.jsx(at,{children:l.jsx(Ose,{size:18})}),priority:69},{keywords:["bike","cycling","bicycle","spin class"],icon:l.jsx(qX,{size:18,strokeWidth:2}),priority:68},{keywords:["weight","barbell","deadlift","squat","bench press","lifting"],icon:l.jsx(at,{children:l.jsx(Tse,{size:18})}),priority:67},{keywords:["gym","workout","exercise","fitness","pilates","crossfit","training","bootcamp"],icon:l.jsx(iZ,{size:18,strokeWidth:2}),priority:65},{keywords:["walk","walking","stroll"],icon:l.jsx(at,{children:l.jsx($se,{size:18})}),priority:64},{keywords:["zoom","teams","video call","webinar","google meet","skype","facetime"],icon:l.jsx(EZ,{size:18,strokeWidth:2}),priority:60}
604,{keywords:["meeting","standup","stand-up","sync","review","sprint","retro","1:1","one-on-one","interview","presentation","conference","workshop","brainstorm"],icon:l.jsx(GX,{size:18,strokeWidth:2}),priority:58},{keywords:["school","class","lesson","lecture","exam","test","study","homework","tutor","graduation","semester","college","university"],icon:l.jsx(sZ,{size:18,strokeWidth:2}),priority:55},{keywords:["read","book","library"],icon:l.jsx(KX,{size:18,strokeWidth:2}),priority:54},{keywords:["baby","newborn","infant","diaper"],icon:l.jsx(at,{children:l.jsx(Ase,{size:18})}),priority:52},{keywords:["daycare","nursery","nanny","pediatr","toddler","preschool","playdate","playground"],icon:l.jsx(at,{children:l.jsx(bse,{size:18})}),priority:51},{keywords:["toy","playtime","playroom"],icon:l.jsx(at,{children:l.jsx(Sse,{size:18})}),priority:50},{keywords:["sister","brother","family","daughter","son","parent","mom","dad","grandma","grandpa","uncle","aunt","cousin","relative","in-law"],icon:l.jsx(q_,{size:18,strokeWidth:2}),priority:48},{keywords:["practice","game","match","hockey","team","league","tournament","scrimmage"],icon:l.jsx(Ql,{size:18,strokeWidth:2}),priority:47},{keywords:["dog walk","walk the dog","walking the dog","dog walking"],icon:l.jsx(at,{children:l.jsx(Yae,{size:18})}),priority:77},{keywords:["dog","cat","pet","vet","veterinar","grooming","kennel","puppy","kitten"],icon:l.jsx(at,{children:l.jsx(Fse,{size:18})}),priority:76},{keywords:["coffee","tea","drinks","happy hour","cocktail"],icon:l.jsx(tZ,{size:18,strokeWidth:2}),priority:42},{keywords:["cook","recipe","bake","baking","kitchen"],icon:l.jsx(at,{children:l.jsx(Cse,{size:18})}),priority:41},{keywords:["meal","breakfast","lunch","dinner","food","restaurant","eat","supper","brunch","snack","dining"],icon:l.jsx(K2,{size:18,strokeWidth:2}),priority:40},{keywords:["laundry","wash","ironing"],icon:l.jsx(at,{children:l.jsx(wse,{size:18})}),priority:38},{keywords:["clean","housekeeping","tidy","chore","vacuum","mop","dust","cleaning service","cleaning lady"],icon:l.jsx(at,{children:l.jsx(Fae,{size:18})}),priority:37},{keywords:["garden","plant","mow","yard","weed","landscap"],icon:l.jsx(at,{children:l.jsx(kse,{size:18})}),priority:36},{keywords:["repair","fix","plumber","electrician","maintenance","handyman","install"],icon:l.jsx(w$,{size:18,strokeWidth:2}),priority:35},{keywords:["shower","bath","personal care"],icon:l.jsx(m$,{size:18,strokeWidth:2}),priority:34},{keywords:["massage","spa"],icon:l.jsx(at,{children:l.jsx(xse,{size:18})}),priority:83},{keywords:["haircut","salon","barber","nail","beauty","manicure","pedicure","facial","wax"],icon:l.jsx(wZ,{size:18,strokeWidth:2}),priority:32},{keywords:["shopping","grocery","errand","store","market","buy","pickup","order","delivery"],icon:l.jsx(_Z,{size:18,strokeWidth:2}),priority:30},{keywords:["flight","airport","travel","trip","vacation","holiday","cruise","passport"],icon:l.jsx(vZ,{size:18,strokeWidth:2}),priority:28},{keywords:["transport","drive","carpool","uber","taxi","commute","car","gas station","mechanic"],icon:l.jsx(JX,{size:18,strokeWidth:2}),priority:27},{keywords:["hike","park","outdoor","camp","nature","trail","mountain","beach","lake","forest"],icon:l.jsx(CZ,{size:18,strokeWidth:2}),priority:25},{keywords:["piano","guitar","violin","cello","drums","flute"],icon:l.jsx(at,{children:l.jsx(vse,{size:18})}),priority:23},{keywords:["music","concert","band","recital","choir","sing","opera","symphony","gig"],icon:l.jsx(dZ,{size:18,strokeWidth:2}),priority:22},{keywords:["art","paint","draw","craft","creative","pottery","design","sculpture","knit","crochet","sew"],icon:l.jsx(g$,{size:18,strokeWidth:2}),priority:20},{keywords:["mosque","islamic","friday prayer","jummah"],icon:l.jsx(at,{children:l.jsx(Ise,{size:18})}),priority:18},{keywords:["synagogue","shabbat","torah"],icon:l.jsx(at,{children:l.jsx(Mse,{size:18})}),priority:17},{keywords:["church","worship","prayer","temple","service","mass","bible","sermon"],icon:l.jsx(QX,{size:18,strokeWidth:2}),priority:16},{keywords:["party","birthday","celebrate","anniversary","wedding","engagement","reunion","farewell","prom"],icon:l.jsx(pZ,{size:18,strokeWidth:2}),priority:14},{keywords:["gift","present","surprise"],icon:l.jsx(aZ,{size:18,strokeWidth:2}),priority:13},{keywords:["photo","picture","portrait","headshot"],icon:l.jsx(YX,{size:18,strokeWidth:2}),priority:12},{keywords:["call","phone","ring","dial"],icon:l.jsx(gZ,{size:18,strokeWidth:2}),priority:10},{keywords:["visit"],icon:l.jsx(q_,{size:18,strokeWidth:2}),priority:5},{keywords:["appointment"],icon:l.jsx(Dx,{size:18,strokeWidth:2}),priority:3}],$F=t=>t.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,""),Use=[{pattern:/(poets\s*hulp|poetsen|poetvrouw|schoonmaak|huishoudhulp|kuisvrouw|kuisen)/u,add:"clean housekeeping chore"},{pattern:/(ziekenhuis|spoedgeval|spoeddienst|noodgeval)/u,add:"hospital emergency urgent care"},{pattern:/(huisarts|dokter|specialist|arts(?:en)?bezoek)/u,add:"doctor medical checkup clinic specialist"}
604,{pattern:/(tandarts|tandartsafspraak|beugel)/u,add:"dentist dental braces"},{pattern:/(oogarts|opticien|brilcontrole|zichttest)/u,add:"eye optometrist vision glasses"},{pattern:/(logoped|spraaktherapie|taaltherapie)/u,add:"speech therapy speech patholog language therapy"},{pattern:/(fysiotherapie|kinesitherapie|revalidatie)/u,add:"physical therapy rehab rehabilitation"},{pattern:/(apotheek|voorschrift|medicatie|geneesmiddel)/u,add:"pharmacy prescription medication medicine pill"},{pattern:/(boodschap|winkel|markt|afhalen)/u,add:"shopping grocery store market pickup"},{pattern:/(wandel)/u,add:"walk walking stroll"},{pattern:/(fiets|wielren)/u,add:"bike cycling bicycle"},{pattern:/(hardloop|hardlopen|joggen)/u,add:"running run jog"},{pattern:/(zwem|zwembad)/u,add:"swim pool aqua"},{pattern:/(voetbal)/u,add:"football soccer"},{pattern:/(sportschool|fitness)/u,add:"gym workout exercise fitness training"},{pattern:/(vergadering|overleg|afstemming|presentatie)/u,add:"meeting sync review presentation workshop"},{pattern:/(videogesprek|beeldbellen)/u,add:"video call zoom teams google meet"},{pattern:/(school|lesuur|huiswerk|toets|examen)/u,add:"school class lesson homework test exam"},{pattern:/(familie|ouders|kinderen|zoon|dochter|oma|opa)/u,add:"family parent daughter son grandma grandpa"},{pattern:/(hond\s*uitlaten|hond\s*wandelen|hondje\s*uit)/u,add:"dog walk dog walking walking the dog"},{pattern:/(hond|kat|huisdier|dierenarts)/u,add:"dog cat pet vet"},{pattern:/(koken|recept|bakken)/u,add:"cook recipe bake kitchen"},{pattern:/(ontbijt|lunch|avondeten|diner|restaurant|eten)/u,add:"breakfast lunch dinner food restaurant meal eat"}
604,{pattern:/(wassen|strijken|wasgoed)/u,add:"laundry wash ironing"},{pattern:/(tuin|grasmaaien|onkruid)/u,add:"garden yard mow weed"},{pattern:/(reparatie|herstel|onderhoud|klusjesman)/u,add:"repair fix maintenance handyman"},{pattern:/(kapper|salon|nagels|manicure|pedicure)/u,add:"haircut salon nail manicure pedicure beauty"},{pattern:/(reis|vakantie|vlucht|luchthaven)/u,add:"travel trip vacation flight airport"},{pattern:/(auto|carpool|taxi|woon-werk)/u,add:"car commute taxi transport"},{pattern:/(kerk|moskee|synagoge|gebed)/u,add:"church mosque synagogue prayer mass"},{pattern:/(feest|verjaardag|jubileum|bruiloft)/u,add:"party birthday anniversary wedding celebrate"},{pattern:/(foto|fotoshoot|portret)/u,add:"photo picture portrait headshot"},{pattern:/(bellen|telefoon|oproep)/u,add:"call phone dial ring"}],zse=t=>{const e=$F(t);let n=` ${e} `;for(const r of Use)r.pattern.test(e)&&(n+=` ${r.add} `);return n},Wse=[...Bse].sort((t,e)=>e.priority-t.priority).map(t=>({...t,normalizedKeywords:t.keywords.map($F)})),FF=t=>{const e=zse(t);for(const n of Wse)for(const r of n.normalizedKeywords)if(e.includes(r))return n.icon;return null},Vse=(t,e)=>{if(D.isValidElement(t)){if("strokeWidth"in t.props)return D.cloneElement(t,{className:[t.props.className,e].filter(
604Boolean).join(" ")});if(t.type===at){const n=t.props.children;if(D.isValidElement(n))return l.jsx(at,{className:e,children:D.cloneElement(n,{size:void 0,className:"w-full h-full"})})}}return t};function Hse(t){return FF(t)??l.jsx(yc,{size:18,strokeWidth:2})}function qse(t,e="w-10 h-10 md:w-12 md:h-12"){const n=FF(t)??l.jsx(yc,{size:18,strokeWidth:2});return Vse(n,e)}const CS=[{input:"Nurse visit Tuesday 2pm for medication check",output:{title:"Nurse visit",startTime:"2:00 PM",endTime:"2:30 PM",duration:"30m",location:"",color:"#DCCEE4",textColor:"#111827",iconColor:"#9B85B3"}},{input:"Physical therapy Monday 10am at the rehab center",output:{title:"Physical therapy",startTime:"10:00 AM",endTime:"11:00 AM",duration:"1h",location:"Rehab Center",color:"#D4E4F7",textColor:"#111827",iconColor:"#7BA3CC"}},{input:"Morning medication and blood pressure check 8am",output:{title:"Morning medication",startTime:"8:00 AM",endTime:"8:30 AM",duration:"30m",location:"",color:"#E4E8DE",textColor:"#111827",iconColor:"#9CA896"}}];function Kse(){const[t,e]=b.useState(0),[n,r]=b.useState(""),[i,a]=b.useState(!1),[s,o]=b.useState(!0),c=b.useRef(null),u=b.useRef(null),[d,h]=b.useState(0),f=CS[t];b.useEffect(()=>{if(c.current&&u.current&&i){const g=c.current.getBoundingClientRect(),v=u.current.getBoundingClientRect().bottom-g.top;h(v)}},[i,t]),b.useEffect(()=>{r(""),a(!1),o(!0),h(0);let g=0,m,v,x;const w=setTimeout(()=>{m=setInterval(()=>{g<f.input.length?(r(f.input.slice(0,g+1)),g++):(clearInterval(m),o(!1),v=setTimeout(()=>{a(!0),x=setTimeout(()=>{e(y=>(y+1)%CS.length)},3e3)},500))},50)},100);return()=>{clearTimeout(w),clearInterval(m),clearTimeout(v),clearTimeout(x)}},[t]);const p=g=>qse(g,"w-10 h-10 md:w-12 md:h-12");return l.jsxs("div",{className:"relative w-full max-w-[360px] mx-auto",children:[l.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-calendar-coral/5 via-calendar-peach/5 to-calendar-blue/5 rounded-3xl blur-3xl"}),l.jsxs("div",{className:"relative space-y-6",children:[l.jsxs("div",{className:"text-center space-y-4",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"Just speak to create an event"}),l.jsx("div",{className:"w-14 h-14 rounded-full bg-gradient-to-br from-calendar-coral via-calendar-peach to-calendar-blue flex items-center justify-center mx-auto animate-pulse",children:l.jsx(G_,{className:"w-7 h-7 text-white"})}),l.jsxs("p",{className:"text-xl md:text-2xl font-semibold min-h-[64px] leading-snug",children:['"',n,s&&l.jsx("span",{className:"inline-block w-0.5 h-6 bg-primary ml-1 animate-pulse"}),'"']})]}),l.jsx("div",{className:"h-[72px] flex items-center justify-center",children:l.jsxs("div",{className:`flex flex-col items-center gap-2 ${i?"opacity-100 transition-opacity duration-500":"opacity-0"}`,children:[l.jsx("div",{className:"w-8 h-8 rounded-full bg-gradient-to-br from-calendar-peach to-calendar-blue flex items-center justify-center animate-bounce",children:l.jsx(ta,{className:"w-4 h-4 text-white"})}),l.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"AI Magic â¨"})]})}),l.jsx("div",{className:"min-h-[240px]",children:i&&l.jsxs("div",{className:"rounded-3xl p-5 md:p-6 shadow-lg animate-fade-in",style:{backgroundColor:f.output.color},children:[l.jsx("h3",{className:"text-xl md:text-2xl font-bold leading-tight mb-4 md:mb-5",style:{color:f.output.textColor},children:f.output.title}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("div",{className:"flex items-start",style:{gap:"8px"},children:l.jsxs("div",{className:"flex flex-col gap-1 relative",children:[l.jsxs("div",{children:[l.jsx("p",{ref:c,className:"text-xl md:text-2xl font-bold leading-tight",style:{color:f.output.textColor},children:f.output.startTime}),l.jsx("p",{className:"text-[10px] leading-tight",style:{color:"#6B7280"},children:"Start"})]}),l.jsxs("div",{children:[l.jsx("p",{ref:u,className:"text-xl md:text-2xl font-bold leading-tight",style:{color:f.output.textColor},children:f.output.endTime}),l.jsx("p",{className:"text-[10px] leading-tight",style:{color:"#6B7280"},children:"End"})]}),d>0&&l.jsx("div",{className:"absolute w-[0.5px]",style:{backgroundImage:"repeating-linear-gradient(to bottom, #9CA3AF 0, #9CA3AF 2px, transparent 2px, transparent 5px)",left:"calc(100% + 8px)",top:0,height:`${d}px`},children:l.jsx("div",{className:"absolute whitespace-nowrap",style:{left:"10px",top:"50%",transform:"translateY(-50%)"},children:l.jsx("p",{className:"text-xs font-semibold",style:{color:f.output.textColor},children:f.output.duration})})})]})}),l.jsx("div",{className:"w-16 h-16 md:w-20 md:h-20 rounded-full flex items-center justify-center flex-shrink-0 bg-white/80 shadow-sm",children:l.jsx("div",{style:{color:f.output.iconColor},children:p(f.output.title)})})]}),f.output.location&&l.jsxs("div",{className:"flex items-center gap-2 mt-4 pt-4 border-t",style:{borderColor:"rgba(0,0,0,0.1)"},children:[l.jsx(df,{className:"w-4 h-4",style:{color:f.output.iconColor}}),l.jsx("p",{className:"text-sm font-medium",style:{color:f.output.textColor},children:f.output.location})]})]},t)}),l.jsx("div",{className:"flex justify-center gap-2 pt-4",children:CS.map((g,m)=>l.jsx("button",{onClick:()=>e(m),className:`h-2 rounded-full transition-all duration-300 hover:scale-125 ${m===t?"w-8 bg-primary animate-pulse":"w-2 bg-border hover:bg-primary/50 animate-bounce"}`,style:{animationDuration:m===t?"2s":"3s",animationDelay:`${m*.2}s`},"aria-label":`Go to demo ${m+1}`},m))})]})]})}const TS=[{title:"Editor Links",subtitle:"Can add & edit events",userType:"Team Member",linkType:"editor",icon:Mx,bgColor:"#F9E5D5",iconColor:"#D4A78E",buttonColor:"#E5C4A8",link:"caréable.app/cal/abc123-editor"},{title:"Viewer Links",subtitle:"View-only access",userType:"Family Member",linkType:"viewer",icon:go,bgColor:"#C8D9E8",iconColor:"#7A9BB8",buttonColor:"#8AACC8",link:"caréable.app/cal/xyz789-view"}];function Gse(){const[t,e]=b.useState(0),[n,r]=b.useState(!1),[i,a]=b.useState(!1),s=TS[t],o=s.icon;b.useEffect(()=>{r(!1),a(!1);let u,d;return u=setTimeout(()=>{r(!0),d=setTimeout(()=>{e(h=>(h+1)%TS.length)},4e3)},800),()=>{clearTimeout(u),clearTimeout(d)}},[t]);const c=()=>{a(!0),setTimeout(()=>a(!1),2e3)};return l.jsxs("div",{className:"relative w-full max-w-[360px] mx-auto",children:[l.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-calendar-coral/5 via-calendar-peach/5 to-calendar-mint/5 rounded-3xl blur-3xl"}),l.jsxs("div",{className:"relative space-y-6",children:[l.jsx("div",{className:"space-y-3 animate-fade-in",children:l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center flex-shrink-0",style:{backgroundColor:s.bgColor},children:l.jsx(o,{className:"w-6 h-6",style:{color:s.iconColor}})}),l.jsxs("div",{children:[l.jsx("h4",{className:"text-base font-semibold text-foreground",children:s.title}),l.jsx("p",{className:"text-sm text-muted-foreground",children:s.subtitle})]})]}),l.jsxs(de,{className:"min-h-[44px] px-4 md:px-5 text-xs md:text-sm font-medium touch-manipulation text-white shadow-sm hover:opacity-90 transition-opacity duration-500",style:{backgroundColor:s.buttonColor,opacity:n?.15:1},children:[l.jsx(pl,{className:"w-4 h-4 md:mr-1.5"}),l.jsx("span",{className:"hidden md:inline",children:"Generate"})]})]})}),l.jsx("div",{className:`flex justify-center transition-all duration-500 ${n?"opacity-100 translate-y-0":"opacity-0 -translate-y-4"}`,children:l.jsxs("div",{className:"flex flex-col items-center gap-2",children:[l.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center animate-bounce",style:{backgroundColor:s.buttonColor},children:l.jsx(bm,{className:"w-4 h-4 text-white"})}),l.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Link Generated"})]})}),l.jsx("div",{className:`rounded-lg border border-border bg-card overflow-hidden shadow-sm transition-all duration-500 ${n?"opacity-100 translate-y-0":"opacity-0 translate-y-4"}`,children:l.jsxs("div",{className:"p-3 md:p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(bm,{className:"w-4 h-4 text-muted-foreground mt-0.5 flex-shrink-0"}),l.jsx("code",{className:"text-[11px] md:text-xs text-foreground break-all leading-relaxed font-mono",children:s.link})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(de,{onClick:c,className:`min-h-[44px] flex-1 text-xs md:text-sm font-medium touch-manipulation transition-all ${i?"bg-green-600 hover:bg-green-700 text-white":"bg-primary hover:bg-primary/90 text-primary-foreground"}`,children:i?l.jsxs(l.Fragment,{children:[l.jsx(_s,{className:"w-4 h-4 mr-1.5"}),"Copied!"]}):l.jsxs(l.Fragment,{children:[l.jsx(Pd,{className:"w-4 h-4 mr-1.5"}),"Copy Link"]})}),l.jsx(de,{variant:"outline",className:"min-h-[44px] px-4 md:px-6 text-xs md:text-sm touch-manipulation",children:"Revoke"})]})]})}),l.jsx("div",{className:"flex justify-center gap-2 pt-4",children:TS.map((u,d)=>l.jsx("button",{onClick:()=>e(d),className:`h-2 rounded-full transition-all duration-300 hover:scale-125 ${d===t?"w-8 bg-primary animate-pulse":"w-2 bg-border hover:bg-primary/50 animate-bounce"}`,style:{animationDuration:d===t?"2s":"3s",animationDelay:`${d*.2}s`},"aria-label":`Go to demo ${d+1}`},d))})]})]})}const Bu={title:"Caréable - The Care-able way to plan as one",description:"Family care scheduling made simple â with people and AI. Built for families coordinating care for loved one
604s with aphasia, disability, or recovery.",image:"/careable-icon.png",url:"https://careable.co"};function es({title:t,description:e=Bu.description,canonical:n,type:r="website",image:i=Bu.image}){const a=t?`${t} | Caréable`:Bu.title,s=i.startsWith("http")?i:`${Bu.url}${i}`,o=n??(typeof window<"u"?`${Bu.url}${window.location.pathname}`:Bu.url);return b.useEffect(()=>{document.title=a;const c=(d,h)=>{const f=document.querySelector(d);f&&f.setAttribute("content",h)};c('meta[name="description"]',e),c('meta[name="title"]',a),c('meta[property="og:title"]',a),c('meta[property="og:description"]',e),c('meta[property="og:type"]',r),c('meta[property="og:image"]',s),c('meta[property="og:url"]',o);const u=document.querySelector('link[rel="canonical"]');u&&u.setAttribute("href",o),c('meta[name="twitter:title"]',a),c('meta[name="twitter:description"]',e),c('meta[name="twitter:image"]',s),c('meta[name="twitter:url"]',o)},[a,e,o,r,s]),null}function Yse(){return l.jsxs("div",{className:"fixed inset-0 overflow-hidden pointer-events-none z-0",children:[l.jsx("div",{className:"absolute rounded-full animate-[peach-drop_2s_ease-out_forwards]",style:{width:"120vw",height:"80vw",maxWidth:"900px",maxHeight:"500px",background:"radial-gradient(ellipse, hsl(330 70% 65%) 0%, hsl(330 70% 65% / 0.4) 35%, transparent 65%)",filter:"blur(40px)",top:"-10%",left:"-10%"}}),l.jsx("div",{className:"absolute rounded-full opacity-20 md:opacity-15 animate-fluid-1",style:{width:"90vw",height:"90vw",maxWidth:"800px",maxHeight:"800px",background:"radial-gradient(circle, #e88a74 0%, rgba(255,196,168,0.3) 40%, transparent 75%)",filter:"blur(50px)",top:"-20%",left:"-10%"}}),l.jsx("div",{className:"absolute rounded-full opacity-35 md:opacity-25 animate-fluid-2",style:{width:"85vw",height:"85vw",maxWidth:"750px",maxHeight:"750px",background:"radial-gradient(circle, #48e6d9 0%, rgba(72,125,230,0.2) 50%, transparent 75%)",filter:"blur(50px)",top:"25%",right:"-25%"}}),l.jsx("div",{className:"absolute rounded-full opacity-40 md:opacity-30 animate-fluid-1",style:{width:"75vw",height:"75vw",maxWidth:"650px",maxHeight:"650px",background:"radial-gradient(circle, #f5c842 0%, rgba(245,200,66,0.25) 45%, transparent 75%)",filter:"blur(55px)",top:"5%",left:"10%"}})]})}function Jse({onComplete:t}){const e=b.useCallback(t,[]);return b.useEffect(()=>{e()},[e]),null}function Xse(){const t=rr(),{user:e,loading:n}=sa(),r=b.useRef(null),i=b.useRef(null),[a,s]=b.useState(!1),[o,c]=b.useState(0),[u,d]=b.useState(!1);b.useEffect(()=>{if(!n){if(e)t("/dashboard");else if(window.matchMedia("(display-mode: standalone)").matches||window.navigator.standalone===!0){const p=localStorage.getItem("careable_shared_calendar_url")||h("careable_shared_calendar_url");p&&t(p)}}},[e,n,t]);function h(f){const p=document.cookie.match(new RegExp("(?:^|; )"+f+"=([^;]*)"));return p?decodeURIComponent(p[1]):null}return b.useEffect(()=>{const p=setTimeout(()=>{if(r.current&&window.innerWidth<1200){const g=r.current,m=g.scrollWidth/3;g.scrollLeft=m}},100);return()=>clearTimeout(p)},[]),b.useEffect(()=>{const f=new IntersectionObserver(([p])=>{p.isIntersecting&&s(!0)},{threshold:.2});return i.current&&f.observe(i.current),()=>f.disconnect()},[]),b.useEffect(()=>{const f=()=>{c(window.scrollY)};return window.addEventListener("scroll",f,{passive:!0}),()=>window.removeEventListener("scroll",f)},[]),l.jsxs("div",{className:"min-h-screen bg-background relative z-0 z-0 z-0 z-0 z-0",children:[l.jsx(es,{canonical:"https://careable.co/"}),l.jsx(Yse,{}),l.jsx("nav",{className:"border-b border-border/40 backdrop-blur-sm sticky top-0 z-50 relativebg-b relativeackg relativeroun relatived/80",children:l.jsx("div",{className:"container mx-auto px-6 md:px-8",children:l.jsxs("div",{className:"flex justify-between items-center h-16 md:h-20",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("img",{src:"/careable-icon.png?v=10",alt:"Caréable",width:"32",height:"32",fetchPriority:"high",className:"w-8 h-8 rounded-full"}),l.jsx("h1",{className:"text-xl md:text-2xl font-bold",children:"Caréable"}),l.jsx(Rn,{variant:"secondary",className:"text-[9px] px-1.5 py-0 font-normal opacity-60",children:"Beta"})]}),l.jsx(de,{onClick:()=>t("/auth"),variant:"ghost",className:"min-h-[44px]",children:"Sign in / Sign up"})]})})}),l.jsxs("main",{children:[l.jsxs("div",{className:"relative z-10",children:[l.jsxs("section",{className:"relative container mx-auto px-6 md:px-8 text-center py-[200px]",children:[l.jsx(Jse,{onComplete:()=>d(!0)}),l.jsxs("div",{className:"relative z-10 max-w-3xl mx-auto transition-all duration-1000 ease-out",style:{opacity:u?1:0,transform:u?"translateY(0)":"translateY(20px)"},children:[l.jsxs("h2",{className:"text-3xl md:text-5xl font-display font-medium mb-5 text-foreground leading-none md:leading-tight tracking-tight",children:["A Care Calendar.",l.jsx("br",{})," For Caring Together."]}),l.jsx("p",{className:"text-base md:text-lg text-muted-foreground max-w-xl mx-auto leading-relaxed",children:"When families need to coordinate care."})]}),l.jsxs("div",{className:"relative z-10 mt-8 flex items-center justify-center gap-6",children:[l.jsx("button",{onClick:()=>t("/auth"),className:"text-base text-foreground no-underline cursor-pointer bg-transparent border-none p-0",children:"Get Started â"}),l.jsx("button",{onClick:()=>
604t("/demo"),className:"text-base text-foreground/80 hover:text-foreground no-underline cursor-pointer bg-transparent border-none p-0",children:"Try Demo"})]})]}),l.jsx("section",{className:"relative container mx-auto px-6 md:px-8 pt-8 md:pt-12 pb-16 md:pb-24",children:l.jsxs("div",{className:"relative z-10",children:[l.jsx("div",{className:"text-center mb-8 md:mb-12 animate-fade-in",style:{animationDelay:"0.1s",animationFillMode:"backwards"},children:l.jsx("h2",{className:"text-2xl md:text-3xl font-display mb-3 text-foreground",children:"Simple for everyone."})}),l.jsx("div",{className:"h-[540px] flex items-start justify-center",style:{animationDelay:"0.2s",animationFillMode:"backwards"},children:l.jsx(Kse,{})})]})})]}),l.jsx("section",{className:"relative z-10 w-full md:py-24 overflow-hidden py-[120px]",children:l.jsxs("div",{className:"relative z-10 container mx-auto px-6 md:px-8",children:[l.jsxs("div",{className:"text-center mb-8 md:mb-12 animate-fade-in",style:{animationDelay:"0.1s",animationFillMode:"backwards"},children:[l.jsx("h2",{className:"text-2xl md:text-3xl font-display mb-3",children:"Only the organizer needs an account."}),l.jsx("p",{className:"text-muted-foreground",children:"Send a link. Everyone else can view instantly â no sign-up required."})]}),l.jsx("div",{className:"animate-fade-in",style:{animationDelay:"0.2s",animationFillMode:"backwards"},children:l.jsx(Gse,{})})]})}),l.jsx(jae,{})]}),l.jsx("footer",{className:"relative z-10 border-t border-border/40 py-12 md:py-16",children:l.jsx("div",{className:"container mx-auto px-6 md:px-8",children:l.jsx("div",{className:"flex flex-col items-center gap-4",children:l.jsxs("div",{className:"flex flex-col items-center gap-4",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row items-center gap-4",children:[l.jsx(de,{variant:"ghost",size:"sm",onClick:()=>t("/about"),className:"text-sm text-muted-foreground hover:text-foreground",children:"About Us"}),l.jsx(de,{variant:"ghost",size:"sm",onClick:()=>t("/terms"),className:"text-sm text-muted-foreground hover:text-foreground",children:"Terms of Service"}),l.jsx(de,{variant:"ghost",size:"sm",onClick:()=>t("/privacy"),className:"text-sm text-muted-foreground hover:text-foreground",children:"Privacy Policy"}),l.jsx(de,{variant:"ghost",size:"sm",onClick:()=>{localStorage.removeItem("cookie-consent"),window.location.reload()},className:"text-sm text-muted-foreground hover:text-foreground",children:"Privacy Settings"}),l.jsx(de,{variant:"ghost",size:"sm",onClick:()=>t("/updates"),className:"text-sm text-muted-foreground hover:text-foreground",children:"Updates"})]}),l.jsx("a",{href:"https://www.producthunt.com/products/careable?embed=true&utm_source=badge-featured&utm_medium=badge&utm_campaign=badge-careable",target:"_blank",rel:"noopener noreferrer",children:l.jsx("img",{alt:"Caréable - A Care Calendar. For Caring Together. | Product Hunt",width:"250",height:"54",src:"https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=1101808&theme=light&t=1773951406778"})}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"© 2025 Caréable. Care coordination, simplified."})]})})})})]})}const qt=b.forwardRef(({className:t,type:e,...n},r)=>l.jsx("input",{type:e,className:ce("block h-10 w-full min-w-0 max-w-full rounded-md border border-input bg-background px-3 py-2 text-base text-left file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-primary/50 focus-visible:shadow-[0_0_0_3px_hsl(var(--primary)/0.1)] transition-colors disabled:cursor-not-allowed disabled:opacity-50 md:text-sm [&.border-0]:focus-visible:border-0 [&.border-0]:focus-visible:shadow-none [&.border-none]:focus-visible:border-none [&.border-none]:focus-visible:shadow-none",t),ref:r,...n}));qt.displayName="Input";var Zse="Label",BF=b.forwardRef((t,e)=>l.jsx(Ke.label,{...t,ref:e,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=t.onMouseDown)==null||i.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));BF.displayName=Zse;var UF=BF;const Qse=zg("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),yt=b.forwardRef(({className:t,...e},n)=>l.jsx(UF,{ref:n,className:ce(Qse(),t),...e}));yt.displayName=UF.displayName;var ES="focusScope.autoFocusOnMount",jS="focusScope.autoFocusOnUnmount",UR={bubbles:!1,cancelable:!0},eoe="FocusScope",Gx=b.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...s}=t,[o,c]=b.useState(null),u=Wn(i),d=Wn(a),h=b.useRef(null),f=bt(e,m=>c(m)),p=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let m=function(y){if(p.paused||!o)return;const k=y.target;o.contains(k)?h.current=k:$o(h.current,{select:!0})},v=function(y){if(p.paused||!o)return;const k=y.relatedTarget;k!==null&&(o.contains(k)||$o(h.current,{select:!0}))},x=function(y){if(document.activeElement===document.body)for(const S of y)S.removedNodes.length>0&&$o(o)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const w=new MutationObserver(x);return o&&w.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),w.disconnect()}}},[r,o,p.paused]),b.useEffect(()=>{if(o){WR.add(p);
vendor: 3,375 bytes, line 604
604const m=document.activeElement;if(!o.contains(m)){const x=new CustomEvent(ES,UR);o.addEventListener(ES,u),o.dispatchEvent(x),x.defaultPrevented||(toe(soe(zF(o)),{select:!0}),document.activeElement===m&&$o(o))}return()=>{o.removeEventListener(ES,u),setTimeout(()=>{const x=new CustomEvent(jS,UR);o.addEventListener(jS,d),o.dispatchEvent(x),x.defaultPrevented||$o(m??document.body,{select:!0}),o.removeEventListener(jS,d),WR.remove(p)},0)}}},[o,u,d,p]);const g=b.useCallback(m=>{if(!n&&!r||p.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,x=document.activeElement;if(v&&x){const w=m.currentTarget,[y,k]=noe(w);y&&k?!m.shiftKey&&x===k?(m.preventDefault(),n&&$o(y,{select:!0})):m.shiftKey&&x===y&&(m.preventDefault(),n&&$o(k,{select:!0})):x===w&&m.preventDefault()}},[n,r,p.paused]);return l.jsx(Ke.div,{tabIndex:-1,...s,ref:f,onKeyDown:g})});Gx.displayName=eoe;function toe(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if($o(r,{select:e}),document.activeElement!==n)return}function noe(t){const e=zF(t),n=zR(e,t),r=zR(e.reverse(),t);return[n,r]}function zF(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function zR(t,e){for(const n of t)if(!roe(n,{upTo:e}))return n}function roe(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function ioe(t){return t instanceof HTMLInputElement&&"select"in t}function $o(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&ioe(t)&&e&&t.select()}}var WR=aoe();function aoe(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=VR(t,e),t.unshift(e)},remove(e){var n;t=VR(t,e),(n=t[0])==null||n.resume()}}}function VR(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function soe(t){return t.filter(e=>e.tagName!=="A")}var PS=0;function kj(){b.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??HR()),document.body.insertAdjacentElement("beforeend",t[1]??HR()),PS++,()=>{PS===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),PS--}},[])}function HR(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Ly="right-scroll-bar-position",$y="width-before-scroll-bar",ooe="with-scroll-bars-hidden",coe="--removed-body-scroll-bar-size";function NS(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function loe(t,e){var n=b.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=e,n.facade}var uoe=typeof window<"u"?b.useLayoutEffect:b.useEffect,qR=new WeakMap;function doe(t,e){var n=loe(null,function(r){return t.forEach(function(i){return NS(i,r)})});return uoe(function(){var r=qR.get(n);if(r){var i=new Set(r),a=new Set(t),s=n.current;
vendor: 4,224 bytes, lines 604-619
604i.forEach(function(o){a.has(o)||NS(o,null)}),a.forEach(function(o){i.has(o)||NS(o,s)})}qR.set(n,t)},[t]),n}function hoe(t){return t}function foe(t,e){e===void 0&&(e=hoe);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(a){var s=e(a,r);return n.push(s),function(){n=n.filter(function(o){return o!==s})}},assignSyncMedium:function(a){for(r=!0;n.length;){var s=n;n=[],s.forEach(a)}n={push:function(o){return a(o)},filter:function(){return n}}},assignMedium:function(a){r=!0;var s=[];if(n.length){var o=n;n=[],o.forEach(a),s=n}var c=function(){var d=s;s=[],d.forEach(a)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){s.push(d),u()},filter:function(d){return s=s.filter(d),n}}}};return i}function poe(t){t===void 0&&(t={});var e=foe(null);return e.options=Gi({async:!0,ssr:!1},t),e}var WF=function(t){var e=t.sideCar,n=Uc(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return b.createElement(r,Gi({},n))};WF.isSideCarExport=!0;function moe(t,e){return t.useMedium(e),WF}var VF=poe(),AS=function(){},Yx=b.forwardRef(function(t,e){var n=b.useRef(null),r=b.useState({onScrollCapture:AS,onWheelCapture:AS,onTouchMoveCapture:AS}),i=r[0],a=r[1],s=t.forwardProps,o=t.children,c=t.className,u=t.removeScrollBar,d=t.enabled,h=t.shards,f=t.sideCar,p=t.noRelative,g=t.noIsolation,m=t.inert,v=t.allowPinchZoom,x=t.as,w=x===void 0?"div":x,y=t.gapMode,k=Uc(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=f,_=doe([n,e]),C=Gi(Gi({},k),i);return b.createElement(b.Fragment,null,d&&b.createElement(S,{sideCar:VF,removeScrollBar:u,shards:h,noRelative:p,noIsolation:g,inert:m,setCallbacks:a,allowPinchZoom:!!v,lockRef:n,gapMode:y}),s?b.cloneElement(b.Children.only(o),Gi(Gi({},C),{ref:_})):b.createElement(w,Gi({},C,{className:c,ref:_}),o))});Yx.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Yx.classNames={fullWidth:$y,zeroRight:Ly};var goe=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function voe(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=goe();return e&&t.setAttribute("nonce",e),t}function yoe(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function boe(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var xoe=function(){var t=0,e=null;return{add:function(n){t==0&&(e=voe())&&(yoe(e,n),boe(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},woe=function(){var t=xoe();return function(e,n){b.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},HF=function(){var t=woe(),e=function(n){var r=n.styles,i=n.dynamic;return t(r,i),null};return e},Soe={left:0,top:0,right:0,gap:0},OS=function(t){return parseInt(t||"",10)||0},koe=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[OS(n),OS(r),OS(i)]},_oe=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Soe;var e=koe(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},Coe=HF(),Rd="data-scroll-locked",Toe=function(t,e,n,r){var i=t.left,a=t.top,s=t.right,o=t.gap;return n===void 0&&(n="margin"),` 605 .`.concat(ooe,` { 606 overflow: hidden `).concat(r,`; 607 padding-right: `).concat(o,"px ").concat(r,`; 608 } 609 body[`).concat(Rd,`] { 610 overflow: hidden `).concat(r,`; 611 overscroll-behavior: contain; 612 `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&` 613 padding-left: `.concat(i,`px; 614 padding-top: `).concat(a,`px; 615 padding-right: `).concat(s,`px; 616 margin-left:0; 617 margin-top:0; 618 margin-right: `).concat(o,"px ").concat(r,`; 619 `),n==="padding"&&"padding-right: ".concat(o,"px ").concat(r,";
619")].filter(Boolean).join(""),` 620 } 621 622 .`).concat(Ly,` { 623 right: `).concat(o,"px ").concat(r,`; 624 } 625 626 .`).concat($y,` { 627 margin-right: `).concat(o,"px ").concat(r,`; 628 } 629 630 .`).concat(Ly," .").concat(Ly,` { 631 right: 0 `).concat(r,`; 632 } 633 634 .`).concat($y," .").concat($y,` { 635 margin-right: 0 `).concat(r,`; 636 } 637 638 body[`).concat(Rd,`] { 639 `).concat(coe,": ").concat(o,`px; 640 } 641`)},KR=function(){var t=parseInt(document.body.getAttribute(Rd)||"0",10);return isFinite(t)?t:0},Eoe=function(){b.useEffect(function(){return document.body.setAttribute(Rd,(KR()+1).toString()),function(){var t=KR()-1;t<=0?document.body.removeAttribute(Rd):document.body.setAttribute(Rd,t.toString())}},[])},joe=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;Eoe();var a=b.useMemo(function(){return _oe(i)},[i]);return b.createElement(Coe,{styles:Toe(a,!e,i,n?"":"!important")})},xC=!1;if(typeof window<"u")try{var Zv=Object.defineProperty({},"passive",{get:function(){return xC=!0,!0}});window.addEventListener("test",Zv,Zv),window.removeEventListener("test",Zv,Zv)}catch{xC=!1}var Uu=xC?{passive:!1}:!1,Poe=function(t){return t.tagName==="TEXTAREA"},qF=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!Poe(t)&&n[e]==="visible")},Noe=function(t){return qF(t,"overflowY")},Aoe=function(t){return qF(t,"overflowX")},GR=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=KF(t,r);if(i){var a=GF(t,r),s=a[1],o=a[2];if(s>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ooe=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},Roe=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},KF=function(t,e){return t==="v"?Noe(e):Aoe(e)},GF=function(t,e){return t==="v"?Ooe(e):Roe(e)},Doe=function(t,e){return t==="h"&&e==="rtl"?-1:1},Moe=function(t,e,n,r,i){var a=Doe(t,window.getComputedStyle(e).direction),s=a*r,o=n.target,c=e.contains(o),u=!1,d=s>0,h=0,f=0;do{if(!o)break;var p=GF(t,o),g=p[0],m=p[1],v=p[2],x=m-v-a*g;(g||x)&&KF(t,o)&&(h+=x,f+=g);var w=o.parentNode;o=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!c&&o!==document.body||c&&(e.contains(o)||e===o));return(d&&(Math.abs(h)<1||!i)||!d&&(Math.abs(f)<1||!i))&&(u=!0),u},Qv=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},YR=function(t){return[t.deltaX,t.deltaY]},JR=function(t){return t&&"current"in t?t.current:t},Ioe=function(t,e){return t[0]===e[0]&&t[1]===e[1]},Loe=function(t){return` 642 .block-interactivity-`.concat(t,` {pointer-events: none;} 643 .allow-interactivity-`).concat(t,` {pointer-events: all;} 644`)},$oe=0,zu=[];function Foe(t){var e=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),i=b.useState($oe++)[0],a=b.useState(HF)[0],s=b.useRef(t);b.useEffect(function(){s.current=t},[t]),b.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var m=pj([t.lockRef.current],(t.shards||[]).map(JR),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var o=b.useCallback(function(m,v){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var x=Qv(m),w=n.current,y="deltaX"in m?m.deltaX:w[0]-x[0],k="deltaY"in m?m.deltaY:w[1]-x[1],S,_=m.target,C=Math.abs(y)>Math.abs(k)?"h":"v";if("touches"in m&&C==="h"&&_.type==="range")return!1;var T=GR(C,_);if(!T)return!0;if(T?S=C:(S=C==="v"?"h":"v",T=GR(C,_)),!T)return!1;if(!r.current&&"changedTouches"in m&&(y||k)&&(r.current=S),!S)return!0;var E=r.current||S;return Moe(E,v,m,E==="h"?y:k,!0)},[]),c=b.useCallback(function(m){var v=m;if(!(!zu.length||zu[zu.length-1]!==a)){var x="deltaY"in v?YR(v):Qv(v),w=e.current.filter(function(S){return S.name===v.type&&(S.target===v.target||v.target===S.shadowParent)&&Ioe(S.delta,x)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}
vendor: 8,971 bytes, lines 644-648
644if(!w){var y=(s.current.shards||[]).map(JR).filter(Boolean).filter(function(S){return S.contains(v.target)}),k=y.length>0?o(v,y[0]):!s.current.noIsolation;k&&v.cancelable&&v.preventDefault()}}},[]),u=b.useCallback(function(m,v,x,w){var y={name:m,delta:v,target:x,should:w,shadowParent:Boe(x)};e.current.push(y),setTimeout(function(){e.current=e.current.filter(function(k){return k!==y})},1)},[]),d=b.useCallback(function(m){n.current=Qv(m),r.current=void 0},[]),h=b.useCallback(function(m){u(m.type,YR(m),m.target,o(m,t.lockRef.current))},[]),f=b.useCallback(function(m){u(m.type,Qv(m),m.target,o(m,t.lockRef.current))},[]);b.useEffect(function(){return zu.push(a),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",c,Uu),document.addEventListener("touchmove",c,Uu),document.addEventListener("touchstart",d,Uu),function(){zu=zu.filter(function(m){return m!==a}),document.removeEventListener("wheel",c,Uu),document.removeEventListener("touchmove",c,Uu),document.removeEventListener("touchstart",d,Uu)}},[]);var p=t.removeScrollBar,g=t.inert;return b.createElement(b.Fragment,null,g?b.createElement(a,{styles:Loe(i)}):null,p?b.createElement(joe,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function Boe(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const Uoe=moe(VF,Foe);var Jx=b.forwardRef(function(t,e){return b.createElement(Yx,Gi({},t,{ref:e,sideCar:Uoe}))});Jx.classNames=Yx.classNames;var zoe=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Wu=new WeakMap,ey=new WeakMap,ty={},RS=0,YF=function(t){return t&&(t.host||YF(t.parentNode))},Woe=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=YF(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},Voe=function(t,e,n,r){var i=Woe(e,Array.isArray(t)?t:[t]);ty[n]||(ty[n]=new WeakMap);var a=ty[n],s=[],o=new Set,c=new Set(i),u=function(h){!h||o.has(h)||(o.add(h),u(h.parentNode))};i.forEach(u);var d=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(f){if(o.has(f))d(f);else try{var p=f.getAttribute(r),g=p!==null&&p!=="false",m=(Wu.get(f)||0)+1,v=(a.get(f)||0)+1;Wu.set(f,m),a.set(f,v),s.push(f),m===1&&g&&ey.set(f,!0),v===1&&f.setAttribute(n,"true"),g||f.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",f,x)}})};return d(e),o.clear(),RS++,function(){s.forEach(function(h){var f=Wu.get(h)-1,p=a.get(h)-1;Wu.set(h,f),a.set(h,p),f||(ey.has(h)||h.removeAttribute(r),ey.delete(h)),p||h.removeAttribute(n)}),RS--,RS||(Wu=new WeakMap,Wu=new WeakMap,ey=new WeakMap,ty={})}},_j=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=zoe(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),Voe(r,i,n,"aria-hidden")):function(){return null}},Xx="Dialog",[JF,XF]=Yr(Xx),[Hoe,ts]=JF(Xx),ZF=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:s=!0}=t,o=b.useRef(null),c=b.useRef(null),[u,d]=ks({prop:r,defaultProp:i??!1,onChange:a,caller:Xx});return l.jsx(Hoe,{scope:e,triggerRef:o,contentRef:c,contentId:gs(),titleId:gs(),descriptionId:gs(),open:u,onOpenChange:d,onOpenToggle:b.useCallback(()=>d(h=>!h),[d]),modal:s,children:n})};ZF.displayName=Xx;var QF="DialogTrigger",eB=b.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=ts(QF,n),a=bt(e,i.triggerRef);return l.jsx(Ke.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Ej(i.open),...r,ref:a,onClick:Ie(t.onClick,i.onOpenToggle)})});eB.displayName=QF;var Cj="DialogPortal",[qoe,tB]=JF(Cj,{forceMount:void 0}),nB=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:i}=t,a=ts(Cj,e);return l.jsx(qoe,{scope:e,forceMount:n,children:b.Children.map(r,s=>l.jsx(ui,{present:n||a.open,children:l.jsx(Bg,{asChild:!0,container:i,children:s})}))})};nB.displayName=Cj;var z0="DialogOverlay",rB=b.forwardRef((t,e)=>{const n=tB(z0,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,a=ts(z0,t.__scopeDialog);return a.modal?l.jsx(ui,{present:r||a.open,children:l.jsx(Goe,{...i,ref:e})}):null});rB.displayName=z0;var Koe=Zl("DialogOverlay.RemoveScroll"),Goe=b.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=ts(z0,n);return l.jsx(Jx,{as:Koe,allowPinchZoom:!0,shards:[i.contentRef],children:l.jsx(Ke.div,{"data-state":Ej(i.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),tu="DialogContent",iB=b.forwardRef((t,e)=>{const n=tB(tu,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,a=ts(tu,t.__scopeDialog);return l.jsx(ui,{present:r||a.open,children:a.modal?l.jsx(Yoe,{...i,ref:e}):l.jsx(Joe,{...i,ref:e})})});iB.displayName=tu;var Yoe=b.forwardRef((t,e)=>{const n=ts(tu,t.__scopeDialog),r=b.useRef(null),i=bt(e,n.contentRef,r);return b.useEffect(()=>{const a=r.current;if(a)return _j(a)},[]),l.jsx(aB,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ie(t.onCloseAutoFocus,a=>{var s;a.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:Ie(t.onPointerDownOutside,a=>{const s=a.detail.originalEvent,o=s.button===0&&s.ctrlKey===!0;(s.button===2||o)&&a.preventDefault()}),onFocusOutside:Ie(t.onFocusOutside,a=>a.preventDefault())})}),Joe=b.forwardRef((t,e)=>{const n=ts(tu,t.__scopeDialog),r=b.useRef(!1),i=b.useRef(!1);return l.jsx(aB,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var s,o;(s=t.onCloseAutoFocus)==null||s.call(t,a),a.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),a.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:a=>{var c,u;(c=t.onInteractOutside)==null||c.call(t,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=a.target;((u=n.triggerRef.current)==null?void 0:u.contains(s))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),aB=b.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...s}=t,o=ts(tu,n),c=b.useRef(null),u=bt(e,c);return kj(),l.jsxs(l.Fragment,{children:[l.jsx(Gx,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:l.jsx(uf,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":Ej(o.open),...s,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(Zoe,{titleId:o.titleId}),l.jsx(ece,{contentRef:c,descriptionId:o.descriptionId})]})]})}),Tj="DialogTitle",sB=b.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=ts(Tj,n);return l.jsx(Ke.h2,{id:i.titleId,...r,ref:e})});sB.displayName=Tj;var oB="DialogDescription",cB=b.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=ts(oB,n);return l.jsx(Ke.p,{id:i.descriptionId,...r,ref:e})});cB.displayName=oB;var lB="DialogClose",uB=b.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=ts(lB,n);return l.jsx(Ke.button,{type:"button",...r,ref:e,onClick:Ie(t.onClick,()=>i.onOpenChange(!1))})});uB.displayName=lB;function Ej(t){return t?"open":"closed"}var dB="DialogTitleWarning",[Xoe,hB]=ZJ(dB,{contentName:tu,titleName:Tj,docsSlug:"dialog"}),Zoe=({titleId:t})=>{const e=hB(dB),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. 645 646If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component. 647 648For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return b.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},Qoe="DialogDescriptionWarning",ece=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${hB(Qoe).contentName}}.`;return b.useEffect(()=>{var a;const i=(a=t.current)==null?void 0:a.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},fB=ZF,pB=eB,mB=nB,jj=rB,Yg=iB,Pj=sB,Nj=cB,Aj=uB;const Za=fB,Oj=pB,Rj=mB,Dj=b.forwardRef(({className:t,...e},n)=>l.jsx(jj,{ref:n,className:ce("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 duration-200",t),...e}));Dj.displayName=jj.displayName;const Ts=b.forwardRef(({className:t,children:e,...n},r)=>l.jsxs(Rj,{children:[l.jsx(Dj,{}),l.jsxs(Yg,{ref:r,className:ce("fixed left-1/2 top-1/2 z-50 grid w-[calc(100vw-2rem)] max-w-[calc(100vw-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=open]:zoom-in-[0.98] data-[state=closed]:zoom-out-[0.98] sm:max-w-lg sm:rounded-lg",t),...n,children:[e,l.jsxs(Aj,{className:"absolute right-4 top-4 roun
648ded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[l.jsx(vo,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ts.displayName=Yg.displayName;const na=({className:t,...e})=>l.jsx("div",{className:ce("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});na.displayName="DialogHeader";const Zx=({className:t,...e})=>l.jsx("div",{className:ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});Zx.displayName="DialogFooter";const ra=b.forwardRef(({className:t,...e},n)=>l.jsx(Pj,{ref:n,className:ce("text-lg font-semibold leading-none tracking-tight",t),...e}));ra.displayName=Pj.displayName;const Es=b.forwardRef(({className:t,...e},n)=>l.jsx(Nj,{ref:n,className:ce("text-sm text-muted-foreground",t),...e}));Es.displayName=Nj.displayName;var tce=b.createContext(void 0);function Jg(t){const e=b.useContext(tce);return t||e||"ltr"}var DS="rovingFocusGroup.onEntryFocus",nce={bubbles:!1,cancelable:!0},Xg="RovingFocusGroup",[wC,gB,rce]=z2(Xg),[ice,Qx]=Yr(Xg,[rce]),[ace,sce]=ice(Xg),vB=b.forwardRef((t,e)=>l.jsx(wC.Provider,{scope:t.__scopeRovingFocusGroup,children:l.jsx(wC.Slot,{scope:t.__scopeRovingFocusGroup,children:l.jsx(oce,{...t,ref:e})})}));vB.displayName=Xg;var oce=b.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...h}=t,f=b.useRef(null),p=bt(e,f),g=Jg(a),[m,v]=ks({prop:s,defaultProp:o??null,onChange:c,caller:Xg}),[x,w]=b.useState(!1),y=Wn(u),k=gB(n),S=b.useRef(!1),[_,C]=b.useState(0);return b.useEffect(()=>{const T=f.current;if(T)return T.addEventListener(DS,y),()=>T.removeEventListener(DS,y)},[y]),l.jsx(ace,{scope:n,orientation:r,dir:g,loop:i,currentTabStopId:m,onItemFocus:b.useCallback(T=>v(T),[v]),onItemShiftTab:b.useCallback(()=>w(!0),[]),onFocusableItemAdd:b.useCallback(()=>C(T=>T+1),[]),onFocusableItemRemove:b.useCallback(()=>C(T=>T-1),[]),children:l.jsx(Ke.div,{tabIndex:x||_===0?-1:0,"data-orientation":r,...h,ref:p,style:{outline:"none",...t.style},onMouseDown:Ie(t.onMouseDown,()=>{S.current=!0}),onFocus:Ie(t.onFocus,T=>{const E=!S.current;if(T.target===T.currentTarget&&E&&!x){const j=new CustomEvent(DS,nce);if(T.currentTarget.dispatchEvent(j),!j.defaultPrevented){const P=k().filter($=>$.focusable),M=P.find($=>$.active),U=P.find($=>$.id===m),B=[M,U,...P].filter(Boolean).map($=>$.ref.current);xB(B,d)}}S.current=!1}),onBlur:Ie(t.onBlur,()=>w(!1))})})}),yB="RovingFocusGroupItem",bB=b.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:s,...o}=t,c=gs(),u=a||c,d=sce(yB,n),h=d.currentTabStopId===u,f=gB(n),{onFocusableItemAdd:p,onFocusableItemRemove:g,currentTabStopId:m}=d;return b.useEffect(()=>{if(r)return p(),()=>g()}
vendor: 5,419 bytes, line 648
648,[r,p,g]),l.jsx(wC.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:l.jsx(Ke.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...o,ref:e,onMouseDown:Ie(t.onMouseDown,v=>{r?d.onItemFocus(u):v.preventDefault()}),onFocus:Ie(t.onFocus,()=>d.onItemFocus(u)),onKeyDown:Ie(t.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){d.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const x=uce(v,d.orientation,d.dir);if(x!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let y=f().filter(k=>k.focusable).map(k=>k.ref.current);if(x==="last")y.reverse();else if(x==="prev"||x==="next"){x==="prev"&&y.reverse();const k=y.indexOf(v.currentTarget);y=d.loop?dce(y,k+1):y.slice(k+1)}setTimeout(()=>xB(y))}}),children:typeof s=="function"?s({isCurrentTabStop:h,hasTabStop:m!=null}):s})})});bB.displayName=yB;var cce={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function lce(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function uce(t,e,n){const r=lce(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return cce[r]}function xB(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function dce(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var wB=vB,SB=bB,ew="Tabs",[hce,cBe]=Yr(ew,[Qx]),kB=Qx(),[fce,Mj]=hce(ew),_B=b.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:s="horizontal",dir:o,activationMode:c="automatic",...u}=t,d=Jg(o),[h,f]=ks({prop:r,onChange:i,defaultProp:a??"",caller:ew});return l.jsx(fce,{scope:n,baseId:gs(),value:h,onValueChange:f,orientation:s,dir:d,activationMode:c,children:l.jsx(Ke.div,{dir:d,"data-orientation":s,...u,ref:e})})});_B.displayName=ew;var CB="TabsList",TB=b.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...i}=t,a=Mj(CB,n),s=kB(n);return l.jsx(wB,{asChild:!0,...s,orientation:a.orientation,dir:a.dir,loop:r,children:l.jsx(Ke.div,{role:"tablist","aria-orientation":a.orientation,...i,ref:e})})});TB.displayName=CB;var EB="TabsTrigger",jB=b.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...a}=t,s=Mj(EB,n),o=kB(n),c=AB(s.baseId,r),u=OB(s.baseId,r),d=r===s.value;return l.jsx(SB,{asChild:!0,...o,focusable:!i,active:d,children:l.jsx(Ke.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c,...a,ref:e,onMouseDown:Ie(t.onMouseDown,h=>{!i&&h.button===0&&h.ctrlKey===!1?s.onValueChange(r):h.preventDefault()}),onKeyDown:Ie(t.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&s.onValueChange(r)}),onFocus:Ie(t.onFocus,()=>{const h=s.activationMode!=="manual";!d&&!i&&h&&s.onValueChange(r)})})})});jB.displayName=EB;var PB="TabsContent",NB=b.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:i,children:a,...s}=t,o=Mj(PB,n),c=AB(o.baseId,r),u=OB(o.baseId,r),d=r===o.value,h=b.useRef(d);return b.useEffect(()=>{const f=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(f)},[]),l.jsx(ui,{present:i||d,children:({present:f})=>l.jsx(Ke.div,{"data-state":d?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":c,hidden:!f,id:u,tabIndex:0,...s,ref:e,style:{...t.style,animationDuration:h.current?"0s":void 0},children:f&&a})})});NB.displayName=PB;function AB(t,e){return`${t}-trigger-${e}`}function OB(t,e){return`${t}-content-${e}`}var pce=_B,RB=TB,DB=jB,MB=NB;const IB=pce,Ij=b.forwardRef(({className:t,...e},n)=>l.jsx(RB,{ref:n,className:ce("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",t),...e}));Ij.displayName=RB.displayName;const qo=b.forwardRef(({className:t,...e},n)=>l.jsx(DB,{ref:n,className:ce("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",t),...e}));qo.displayName=DB.displayName;const Ko=b.forwardRef(({className:t,...e},n)=>l.jsx(MB,{ref:n,className:ce("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...e}));Ko.displayName=MB.displayName;var Zg={};(function t(e,n,r,i){var a=!!(e.Worker&&e.Blob&&e.Promise&&e.OffscreenCanvas&&e.OffscreenCanvasRenderingContext2D&&e.HTMLCanvasElement&&e.HTMLCanvasElement.prototype.transferControlToOffscreen&&e.URL&&e.URL.createObjectURL),s=typeof Path2D=="function"&&typeof DOMMatrix=="function",o=function(){if(!e.OffscreenCanvas)return!1;try{var O=new OffscreenCanvas(1,1),A=O.getContext("2d");A.fillRect(0,0,1,1);var L=O.transferToImageBitmap();A.createPattern(L,"no-repeat")}catch{return!1}return!0}();function c(){}function u(O){var A=n.exports.Promise,L=A!==void 0?A:e.Promise;return typeof L=="function"?new L(O):(O(c,c),null)}var d=function(O,A){return{transform:function(L){if(O)return L;if(A.has(L))return A.get(L);var V=new OffscreenCanvas(L.width,L.height),Y=V.getContext("2d");return Y.drawImage(L,0,0),A.set(L,V),V},clear:function(){A.clear()}}}
vendor: 5,002 bytes, lines 648-649
648(o,new Map),h=function(){var O=Math.floor(16.666666666666668),A,L,V={},Y=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(A=function(Q){var re=Math.random();return V[re]=requestAnimationFrame(function J(ne){Y===ne||Y+O-1<ne?(Y=ne,delete V[re],Q()):V[re]=requestAnimationFrame(J)}),re},L=function(Q){V[Q]&&cancelAnimationFrame(V[Q])}):(A=function(Q){return setTimeout(Q,O)},L=function(Q){return clearTimeout(Q)}),{frame:A,cancel:L}}(),f=function(){var O,A,L={};function V(Y){function Q(re,J){Y.postMessage({options:re||{},callback:J})}Y.init=function(J){var ne=J.transferControlToOffscreen();Y.postMessage({canvas:ne},[ne])},Y.fire=function(J,ne,G){if(A)return Q(J,null),A;var Z=Math.random().toString(36).slice(2);return A=u(function(ee){function K(oe){oe.data.callback===Z&&(delete L[Z],Y.removeEventListener("message",K),A=null,d.clear(),G(),ee())}Y.addEventListener("message",K),Q(J,Z),L[Z]=K.bind(null,{data:{callback:Z}})}),A},Y.reset=function(){Y.postMessage({reset:!0});for(var J in L)L[J](),delete L[J]}}return function(){if(O)return O;if(!r&&a){var Y=["var CONFETTI, SIZE = {}, module = {};","("+t.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join(` 649`);try{O=new Worker(URL.createObjectURL(new Blob([Y])))}catch(Q){return typeof console<"u"&&typeof console.warn=="function"&&console.warn("ð Could not load worker",Q),null}V(O)}return O}}(),p={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function g(O,A){return A?A(O):O}function m(O){return O!=null}function v(O,A,L){return g(O&&m(O[A])?O[A]:p[A],L)}function x(O){return O<0?0:Math.floor(O)}function w(O,A){return Math.floor(Math.random()*(A-O))+O}function y(O){return parseInt(O,16)}function k(O){return O.map(S)}function S(O){var A=String(O).replace(/[^0-9a-f]/gi,"");return A.length<6&&(A=A[0]+A[0]+A[1]+A[1]+A[2]+A[2]),{r:y(A.substring(0,2)),g:y(A.substring(2,4)),b:y(A.substring(4,6))}}function _(O){var A=v(O,"origin",Object);return A.x=v(A,"x",Number),A.y=v(A,"y",Number),A}function C(O){O.width=document.documentElement.clientWidth,O.height=document.documentElement.clientHeight}function T(O){var A=O.getBoundingClientRect();O.width=A.width,O.height=A.height}function E(O){var A=document.createElement("canvas");return A.style.position="fixed",A.style.top="0px",A.style.left="0px",A.style.pointerEvents="none",A.style.zIndex=O,A}function j(O,A,L,V,Y,Q,re,J,ne){O.save(),O.translate(A,L),O.rotate(Q),O.scale(V,Y),O.arc(0,0,1,re,J,ne),O.restore()}function P(O){var A=O.angle*(Math.PI/180),L=O.spread*(Math.PI/180);return{x:O.x,y:O.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:O.startVelocity*.5+Math.random()*O.startVelocity,angle2D:-A+(.5*L-Math.random()*L),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:O.color,shape:O.shape,tick:0,totalTicks:O.ticks,decay:O.decay,drift:O.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:O.gravity*3,ovalScalar:.6,scalar:O.scalar,flat:O.flat}}function M(O,A){A.x+=Math.cos(A.angle2D)*A.velocity+A.drift,A.y+=Math.sin(A.angle2D)*A.velocity+A.gravity,A.velocity*=A.decay,A.flat?(A.wobble=0,A.wobbleX=A.x+10*A.scalar,A.wobbleY=A.y+10*A.scalar,A.tiltSin=0,A.tiltCos=0,A.random=1):(A.wobble+=A.wobbleSpeed,A.wobbleX=A.x+10*A.scalar*Math.cos(A.wobble),A.wobbleY=A.y+10*A.scalar*Math.sin(A.wobble),A.tiltAngle+=.1,A.tiltSin=Math.sin(A.tiltAngle),A.tiltCos=Math.cos(A.tiltAngle),A.random=Math.random()+2);var L=A.tick++/A.totalTicks,V=A.x+A.random*A.tiltCos,Y=A.y+A.random*A.tiltSin,Q=A.wobbleX+A.random*A.tiltCos,re=A.wobbleY+A.random*A.tiltSin;if(O.fillStyle="rgba("+A.color.r+", "+A.color.g+", "+A.color.b+", "+(1-L)+")",O.beginPath(),s&&A.shape.type==="path"&&typeof A.shape.path=="string"&&Array.isArray(A.shape.matrix))O.fill(I(A.shape.path,A.shape.matrix,A.x,A.y,Math.abs(Q-V)*.1,Math.abs(re-Y)*.1,Math.PI/10*A.wobble));else if(A.shape.type==="bitmap"){var J=Math.PI/10*A.wobble,ne=Math.abs(Q-V)*.1,G=Math.abs(re-Y)*.1,Z=A.shape.bitmap.width*A.scalar,ee=A.shape.bitmap.height*A.scalar,K=new DOMMatrix([Math.cos(J)*ne,Math.sin(J)*ne,-Math.sin(J)*G,Math.cos(J)*G,A.x,A.y]);K.multiplySelf(new DOMMatrix(A.shape.matrix));var oe=O.createPattern(d.transform(A.shape.bitmap),"no-repeat");
vendor: 6,681 bytes, line 649
649oe.setTransform(K),O.globalAlpha=1-L,O.fillStyle=oe,O.fillRect(A.x-Z/2,A.y-ee/2,Z,ee),O.globalAlpha=1}else if(A.shape==="circle")O.ellipse?O.ellipse(A.x,A.y,Math.abs(Q-V)*A.ovalScalar,Math.abs(re-Y)*A.ovalScalar,Math.PI/10*A.wobble,0,2*Math.PI):j(O,A.x,A.y,Math.abs(Q-V)*A.ovalScalar,Math.abs(re-Y)*A.ovalScalar,Math.PI/10*A.wobble,0,2*Math.PI);else if(A.shape==="star")for(var W=Math.PI/2*3,H=4*A.scalar,q=8*A.scalar,te=A.x,he=A.y,xe=5,De=Math.PI/xe;xe--;)te=A.x+Math.cos(W)*q,he=A.y+Math.sin(W)*q,O.lineTo(te,he),W+=De,te=A.x+Math.cos(W)*H,he=A.y+Math.sin(W)*H,O.lineTo(te,he),W+=De;else O.moveTo(Math.floor(A.x),Math.floor(A.y)),O.lineTo(Math.floor(A.wobbleX),Math.floor(Y)),O.lineTo(Math.floor(Q),Math.floor(re)),O.lineTo(Math.floor(V),Math.floor(A.wobbleY));return O.closePath(),O.fill(),A.tick<A.totalTicks}function U(O,A,L,V,Y){var Q=A.slice(),re=O.getContext("2d"),J,ne,G=u(function(Z){function ee(){J=ne=null,re.clearRect(0,0,V.width,V.height),d.clear(),Y(),Z()}function K(){r&&!(V.width===i.width&&V.height===i.height)&&(V.width=O.width=i.width,V.height=O.height=i.height),!V.width&&!V.height&&(L(O),V.width=O.width,V.height=O.height),re.clearRect(0,0,V.width,V.height),Q=Q.filter(function(oe){return M(re,oe)}),Q.length?J=h.frame(K):ee()}J=h.frame(K),ne=ee});return{addFettis:function(Z){return Q=Q.concat(Z),G},canvas:O,promise:G,reset:function(){J&&h.cancel(J),ne&&ne()}}}function N(O,A){var L=!O,V=!!v(A||{},"resize"),Y=!1,Q=v(A,"disableForReducedMotion",Boolean),re=a&&!!v(A||{},"useWorker"),J=re?f():null,ne=L?C:T,G=O&&J?!!O.__confetti_initialized:!1,Z=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,ee;function K(W,H,q){for(var te=v(W,"particleCount",x),he=v(W,"angle",Number),xe=v(W,"spread",Number),De=v(W,"startVelocity",Number),ge=v(W,"decay",Number),Re=v(W,"gravity",Number),Oe=v(W,"drift",Number),ye=v(W,"colors",k),Ct=v(W,"ticks",Number),le=v(W,"shapes"),Te=v(W,"scalar"),Pe=!!v(W,"flat"),st=_(W),Mt=te,yn=[],Kn=O.width*st.x,an=O.height*st.y;Mt--;)yn.push(P({x:Kn,y:an,angle:he,spread:xe,startVelocity:De,color:ye[Mt%ye.length],shape:le[w(0,le.length)],ticks:Ct,decay:ge,gravity:Re,drift:Oe,scalar:Te,flat:Pe}));return ee?ee.addFettis(yn):(ee=U(O,yn,ne,H,q),ee.promise)}function oe(W){var H=Q||v(W,"disableForReducedMotion",Boolean),q=v(W,"zIndex",Number);if(H&&Z)return u(function(De){De()});L&&ee?O=ee.canvas:L&&!O&&(O=E(q),document.body.appendChild(O)),V&&!G&&ne(O);var te={width:O.width,height:O.height};J&&!G&&J.init(O),G=!0,J&&(O.__confetti_initialized=!0);function he(){if(J){var De={getBoundingClientRect:function(){if(!L)return O.getBoundingClientRect()}};ne(De),J.postMessage({resize:{width:De.width,height:De.height}});return}te.width=te.height=null}function xe(){ee=null,V&&(Y=!1,e.removeEventListener("resize",he)),L&&O&&(document.body.contains(O)&&document.body.removeChild(O),O=null,G=!1)}return V&&!Y&&(Y=!0,e.addEventListener("resize",he,!1)),J?J.fire(W,te,xe):K(W,te,xe)}return oe.reset=function(){J&&J.reset(),ee&&ee.reset()},oe}var B;function $(){return B||(B=N(null,{useWorker:!0,resize:!0})),B}function I(O,A,L,V,Y,Q,re){var J=new Path2D(O),ne=new Path2D;ne.addPath(J,new DOMMatrix(A));var G=new Path2D;return G.addPath(ne,new DOMMatrix([Math.cos(re)*Y,Math.sin(re)*Y,-Math.sin(re)*Q,Math.cos(re)*Q,L,V])),G}function R(O){if(!s)throw new Error("path confetti are not supported in this browser");var A,L;typeof O=="string"?A=O:(A=O.path,L=O.matrix);var V=new Path2D(A),Y=document.createElement("canvas"),Q=Y.getContext("2d");if(!L){for(var re=1e3,J=re,ne=re,G=0,Z=0,ee,K,oe=0;oe<re;oe+=2)for(var W=0;W<re;W+=2)Q.isPointInPath(V,oe,W,"nonzero")&&(J=Math.min(J,oe),ne=Math.min(ne,W),G=Math.max(G,oe),Z=Math.max(Z,W));ee=G-J,K=Z-ne;var H=10,q=Math.min(H/ee,H/K);L=[q,0,0,q,-Math.round(ee/2+J)*q,-Math.round(K/2+ne)*q]}return{type:"path",path:A,matrix:L}}function z(O){var A,L=1,V="#000000",Y='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';typeof O=="string"?A=O:(A=O.text,L="scalar"in O?O.scalar:L,Y="fontFamily"in O?O.fontFamily:Y,V="color"in O?O.color:V);var Q=10*L,re=""+Q+"px "+Y,J=new OffscreenCanvas(Q,Q),ne=J.getContext("2d");ne.font=re;var G=ne.measureText(A),Z=Math.ceil(G.actualBoundingBoxRight+G.actualBoundingBoxLeft),ee=Math.ceil(G.actualBoundingBoxAscent+G.actualBoundingBoxDescent),K=2,oe=G.actualBoundingBoxLeft+K,W=G.actualBoundingBoxAscent+K;Z+=K+K,ee+=K+K,J=new OffscreenCanvas(Z,ee),ne=J.getContext("2d"),ne.font=re,ne.fillStyle=V,ne.fillText(A,oe,W);var H=1/L;return{type:"bitmap",bitmap:J.transferToImageBitmap(),matrix:[H,0,0,H,-Z*H/2,-ee*H/2]}}n.exports=function(){return $().apply(this,arguments)},n.exports.reset=function(){$().reset()},n.exports.create=N,n.exports.shapeFromPath=R,n.exports.shapeFromText=z})(function(){return typeof window<"u"?window:typeof self<"u"?self:this||{}}(),Zg,!1);const XR=Zg.exports;Zg.exports.create;var Ot;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const a={};for(const s of i)a[s]=s;return a},t.getValidEnumValues=i=>{const a=t.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),s={};for(const o of a)s[o]=i[o];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&a.push(s);return a},t.find=(i,a)=>{for(const s of i)if(a(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,a=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(a)}t.joinValues=r,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(Ot||(Ot={}));var ZR;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(ZR||(ZR={}));const Ue=Ot.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Uo=t=>{switch(typeof t){case"undefined":return Ue.undefined;case"string":return Ue.string;case"number":return Number.isNaN(t)?Ue.nan:Ue.number;case"boolean":return Ue.boolean;case"function":return Ue.function;case"bigint":return Ue.bigint;case"symbol":return Ue.symbol;case"object":return Array.isArray(t)?Ue.array:t===null?Ue.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Ue.promise:typeof Map<"u"&&t instanceof Map?Ue.map:typeof Set<"u"&&t instanceof Set?Ue.set:typeof Date<"u"&&t instanceof Date?Ue.date:Ue.object;default:return Ue.unknown}}
vendor: 4,379 bytes, line 649
649,_e=Ot.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Oi extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(a){return a.message},r={_errors:[]},i=a=>{for(const s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let o=r,c=0;for(;c<s.path.length;){const u=s.path[c];c===s.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(n(s))):o[u]=o[u]||{_errors:[]},o=o[u],c++}}};return i(this),r}static assert(e){if(!(e instanceof Oi))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ot.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)if(i.path.length>0){const a=i.path[0];n[a]=n[a]||[],n[a].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Oi.create=t=>new Oi(t);const SC=(t,e)=>{let n;switch(t.code){case _e.invalid_type:t.received===Ue.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case _e.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Ot.jsonStringifyReplacer)}`;break;case _e.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ot.joinValues(t.keys,", ")}`;break;case _e.invalid_union:n="Invalid input";break;case _e.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ot.joinValues(t.options)}`;break;case _e.invalid_enum_value:n=`Invalid enum value. Expected ${Ot.joinValues(t.options)}, received '${t.received}'`;break;case _e.invalid_arguments:n="Invalid function arguments";break;case _e.invalid_return_type:n="Invalid function return type";break;case _e.invalid_date:n="Invalid date";break;case _e.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Ot.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case _e.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case _e.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case _e.custom:n="Invalid input";break;
vendor: 5,283 bytes, line 649
649case _e.invalid_intersection_types:n="Intersection results could not be merged";break;case _e.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case _e.not_finite:n="Number must be finite";break;default:n=e.defaultError,Ot.assertNever(t)}return{message:n}};let mce=SC;function gce(){return mce}const vce=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,a=[...n,...i.path||[]],s={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let o="";const c=r.filter(u=>!!u).slice().reverse();for(const u of c)o=u(s,{data:e,defaultError:o}).message;return{...i,path:a,message:o}};function Me(t,e){const n=gce(),r=vce({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===SC?void 0:SC].filter(i=>!!i)});t.common.issues.push(r)}class Ri{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return ct;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n){const a=await i.key,s=await i.value;r.push({key:a,value:s})}return Ri.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:a,value:s}=i;if(a.status==="aborted"||s.status==="aborted")return ct;a.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[a.value]=s.value)}return{status:e.value,value:r}}}const ct=Object.freeze({status:"aborted"}),kp=t=>({status:"dirty",value:t}),oa=t=>({status:"valid",value:t}),QR=t=>t.status==="aborted",eD=t=>t.status==="dirty",mh=t=>t.status==="valid",W0=t=>typeof Promise<"u"&&t instanceof Promise;var ze;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ze||(ze={}));class Ac{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const tD=(t,e)=>{if(mh(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Oi(t.common.issues);return this._error=n,this._error}}};function wt(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,o)=>{const{message:c}=t;return s.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:c??r??o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:c??n??o.defaultError}},description:i}}class Pt{get description(){return this._def.description}_getType(e){return Uo(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Uo(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ri,ctx:{common:e.parent.common,data:e.data,parsedType:Uo(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(W0(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Uo(e)},i=this._parseSync({data:e,path:r.path,parent:r});return tD(r,i)}"~validate"(e){var r,i;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Uo(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:n});return mh(a)?{value:a.value}:{issues:n.common.issues}}catch(a){(i=(r=a==null?void 0:a.message)==null?void 0:r.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(a=>mh(a)?{value:a.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Uo(e)},i=this._parse({data:e,path:r.path,parent:r}),a=await(W0(i)?i:Promise.resolve(i));return tD(r,a)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,a)=>{const s=e(i),o=()=>a.addIssue({code:_e.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(o(),!1)):s?!0:(o(),!1)})}refinement(e,n){return this._refinement((r,i)=>
vendor: 5,978 bytes, line 649
649e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new vh({schema:this,typeName:lt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return wc.create(this,this._def)}nullable(){return yh.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ys.create(this)}promise(){return K0.create(this,this._def)}or(e){return H0.create([this,e],this._def)}and(e){return q0.create(this,e,this._def)}transform(e){return new vh({...wt(this._def),schema:this,typeName:lt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new _C({...wt(this._def),innerType:this,defaultValue:n,typeName:lt.ZodDefault})}brand(){return new Bce({typeName:lt.ZodBranded,type:this,...wt(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new CC({...wt(this._def),innerType:this,catchValue:n,typeName:lt.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Lj.create(this,e)}readonly(){return TC.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const yce=/^c[^\s-]{8,}$/i,bce=/^[0-9a-z]+$/,xce=/^[0-9A-HJKMNP-TV-Z]{26}$/i,wce=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Sce=/^[a-z0-9_-]{21}$/i,kce=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,_ce=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Cce=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Tce="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let MS;const Ece=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,jce=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Pce=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Nce=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ace=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Oce=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,LB="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Rce=new RegExp(`^${LB}$`);function $B(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function Dce(t){return new RegExp(`^${$B(t)}$`)}function Mce(t){let e=`${LB}T${$B(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function Ice(t,e){return!!((e==="v4"||!e)&&Ece.test(t)||(e==="v6"||!e)&&Pce.test(t))}function Lce(t,e){if(!kce.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function $ce(t,e){return!!((e==="v4"||!e)&&jce.test(t)||(e==="v6"||!e)&&Nce.test(t))}class ic extends Pt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Ue.string){const a=this._getOrReturnCtx(e);
vendor: 17,372 bytes, line 649
649return Me(a,{code:_e.invalid_type,expected:Ue.string,received:a.parsedType}),ct}const r=new Ri;let i;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(i=this._getOrReturnCtx(e,i),Me(i,{code:_e.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")e.data.length>a.value&&(i=this._getOrReturnCtx(e,i),Me(i,{code:_e.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const s=e.data.length>a.value,o=e.data.length<a.value;(s||o)&&(i=this._getOrReturnCtx(e,i),s?Me(i,{code:_e.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&Me(i,{code:_e.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")Cce.test(e.data)||(i=this._getOrReturnCtx(e,i),Me(i,{validation:"email",code:_e.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")MS||(MS=new RegExp(Tce,"u")),MS.test(e.data)||(i=this._getOrReturnCtx(e,i),Me(i,{validation:"emoji",code:_e.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")wce.test(e.data)||(i=this._getOrReturnCtx(e,i),Me(i,{validation:"uuid",code:_e.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")Sce.test(e.data)||(i=this._getOrReturnCtx(e,i),Me(i,{validation:"nanoid",code:_e.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")yce.test(e.data)||(i=this._getOrReturnCtx(e,i),Me(i,{validation:"cuid",code:_e.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")bce.test(e.data)||(i=this._getOrReturnCtx(e,i),Me(i,{validation:"cuid2",code:_e.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")xce.test(e.data)||(i=this._getOrReturnCtx(e,i),Me(i,{validation:"ulid",code:_e.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Me(i,{validation:"url",code:_e.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Me(i,{validation:"regex",code:_e.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(e,i),Me(i,{code:_e.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(i=this._getOrReturnCtx(e,i),Me(i,{code:_e.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(i=this._getOrReturnCtx(e,i),Me(i,{code:_e.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?Mce(a).test(e.data)||(i=this._getOrReturnCtx(e,i),Me(i,{code:_e.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?Rce.test(e.data)||(i=this._getOrReturnCtx(e,i),Me(i,{code:_e.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?Dce(a).test(e.data)||(i=this._getOrReturnCtx(e,i),Me(i,{code:_e.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?_ce.test(e.data)||(i=this._getOrReturnCtx(e,i),Me(i,{validation:"duration",code:_e.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?Ice(e.data,a.version)||(i=this._getOrReturnCtx(e,i),Me(i,{validation:"ip",code:_e.invalid_string,message:a.message}),r.dirty()):a.kind==="jwt"?Lce(e.data,a.alg)||(i=this._getOrReturnCtx(e,i),Me(i,{validation:"jwt",code:_e.invalid_string,message:a.message}),r.dirty()):a.kind==="cidr"?$ce(e.data,a.version)||(i=this._getOrReturnCtx(e,i),Me(i,{validation:"cidr",code:_e.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?Ace.test(e.data)||(i=this._getOrReturnCtx(e,i),Me(i,{validation:"base64",code:_e.invalid_string,message:a.message}),r.dirty()):a.kind==="base64url"?Oce.test(e.data)||(i=this._getOrReturnCtx(e,i),Me(i,{validation:"base64url",code:_e.invalid_string,message:a.message}),r.dirty()):Ot.assertNever(a);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:_e.invalid_string,...ze.errToObj(r)})}_addCheck(e){return new ic({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ze.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ze.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ze.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ze.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ze.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ze.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ze.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ze.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ze.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...ze.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...ze.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ze.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...ze.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...ze.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...ze.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...ze.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...ze.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...ze.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...ze.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...ze.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...ze.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...ze.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...ze.errToObj(n)})}nonempty(e){return this.min(1,ze.errToObj(e))}trim(){return new ic({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ic({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ic({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}ic.create=t=>new ic({checks:[],typeName:lt.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...wt(t)});function Fce(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,a=Number.parseInt(t.toFixed(i).replace(".","")),s=Number.parseInt(e.toFixed(i).replace(".",""));return a%s/10**i}class Rm extends Pt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Ue.number){const a=this._getOrReturnCtx(e);return Me(a,{code:_e.invalid_type,expected:Ue.number,received:a.parsedType}),ct}let r;const i=new Ri;for(const a of this._def.checks)a.kind==="int"?Ot.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Me(r,{code:_e.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),Me(r,{code:_e.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),Me(r,{code:_e.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?Fce(e.data,a.value)!==0&&(r=this._getOrReturnCtx(e,r),Me(r,{code:_e.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Me(r,{code:_e.not_finite,message:a.message}),i.dirty()):Ot.assertNever(a);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ze.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ze.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ze.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ze.toString(n))}setLimit(e,n,r,i){return new Rm({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:ze.toString(i)}]})}_addCheck(e){return new Rm({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ze.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ze.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ze.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ze.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ze.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ze.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:ze.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ze.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ze.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Ot.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Rm.create=t=>new Rm({checks:[],typeName:lt.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...wt(t)});class Dm extends Pt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Ue.bigint)return this._getInvalidInput(e);let r;const i=new Ri;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),Me(r,{code:_e.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),Me(r,{code:_e.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),Me(r,{code:_e.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):Ot.assertNever(a);return{status:i.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return Me(n,{code:_e.invalid_type,expected:Ue.bigint,received:n.parsedType}),ct}gte(e,n){return this.setLimit("min",e,!0,ze.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ze.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ze.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ze.toString(n))}setLimit(e,n,r,i){return new Dm({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:ze.toString(i)}]})}_addCheck(e){return new Dm({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ze.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ze.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ze.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ze.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ze.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Dm.create=t=>new Dm({checks:[],typeName:lt.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...wt(t)});class nD extends Pt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Ue.boolean){const r=this._getOrReturnCtx(e);return Me(r,{code:_e.invalid_type,expected:Ue.boolean,received:r.parsedType}),ct}return oa(e.data)}}nD.create=t=>new nD({typeName:lt.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...wt(t)});class V0 extends Pt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Ue.date){const a=this._getOrReturnCtx(e);return Me(a,{code:_e.invalid_type,expected:Ue.date,received:a.parsedType}),ct}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return Me(a,{code:_e.invalid_date}),ct}const r=new Ri;let i;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(i=this._getOrReturnCtx(e,i),Me(i,{code:_e.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(i=this._getOrReturnCtx(e,i),Me(i,{code:_e.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):Ot.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new V0({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:ze.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:ze.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}V0.create=t=>new V0({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:lt.ZodDate,...wt(t)});class rD extends Pt{_parse(e){if(this._getType(e)!==Ue.symbol){const r=this._getOrReturnCtx(e);return Me(r,{code:_e.invalid_type,expected:Ue.symbol,received:r.parsedType}),ct}return oa(e.data)}}rD.create=t=>new rD({typeName:lt.ZodSymbol,...wt(t)});class iD extends Pt{_parse(e){if(this._getType(e)!==Ue.undefined){const r=this._getOrReturnCtx(e);return Me(r,{code:_e.invalid_type,expected:Ue.undefined,received:r.parsedType}),ct}return oa(e.data)}}iD.create=t=>new iD({typeName:lt.ZodUndefined,...wt(t)});class aD extends Pt{_parse(e){if(this._getType(e)!==Ue.null){const r=this._getOrReturnCtx(e);return Me(r,{code:_e.invalid_type,expected:Ue.null,received:r.parsedType}),ct}return oa(e.data)}}aD.create=t=>new aD({typeName:lt.ZodNull,...wt(t)});class sD extends Pt{constructor(){super(...arguments),this._any=!0}_parse(e){return oa(e.data)}}sD.create=t=>new sD({typeName:lt.ZodAny,...wt(t)});class oD extends Pt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return oa(e.data)}}oD.create=t=>new oD({typeName:lt.ZodUnknown,...wt(t)});class Oc extends Pt{_parse(e){const n=this._getOrReturnCtx(e);return Me(n,{code:_e.invalid_type,expected:Ue.never,received:n.parsedType}),ct}}Oc.create=t=>new Oc({typeName:lt.ZodNever,...wt(t)});class cD extends Pt{_parse(e){if(this._getType(e)!==Ue.undefined){const r=this._getOrReturnCtx(e);return Me(r,{code:_e.invalid_type,expected:Ue.void,received:r.parsedType}),ct}return oa(e.data)}}cD.create=t=>new cD({typeName:lt.ZodVoid,...wt(t)});class ys extends Pt{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;
vendor: 5,494 bytes, line 649
649if(n.parsedType!==Ue.array)return Me(n,{code:_e.invalid_type,expected:Ue.array,received:n.parsedType}),ct;if(i.exactLength!==null){const s=n.data.length>i.exactLength.value,o=n.data.length<i.exactLength.value;(s||o)&&(Me(n,{code:s?_e.too_big:_e.too_small,minimum:o?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Me(n,{code:_e.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Me(n,{code:_e.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,o)=>i.type._parseAsync(new Ac(n,s,n.path,o)))).then(s=>Ri.mergeArray(r,s));const a=[...n.data].map((s,o)=>i.type._parseSync(new Ac(n,s,n.path,o)));return Ri.mergeArray(r,a)}get element(){return this._def.type}min(e,n){return new ys({...this._def,minLength:{value:e,message:ze.toString(n)}})}max(e,n){return new ys({...this._def,maxLength:{value:e,message:ze.toString(n)}})}length(e,n){return new ys({...this._def,exactLength:{value:e,message:ze.toString(n)}})}nonempty(e){return this.min(1,e)}}ys.create=(t,e)=>new ys({type:t,minLength:null,maxLength:null,exactLength:null,typeName:lt.ZodArray,...wt(e)});function td(t){if(t instanceof Tn){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=wc.create(td(r))}return new Tn({...t._def,shape:()=>e})}else return t instanceof ys?new ys({...t._def,type:td(t.element)}):t instanceof wc?wc.create(td(t.unwrap())):t instanceof yh?yh.create(td(t.unwrap())):t instanceof nu?nu.create(t.items.map(e=>td(e))):t}class Tn extends Pt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Ot.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==Ue.object){const u=this._getOrReturnCtx(e);return Me(u,{code:_e.invalid_type,expected:Ue.object,received:u.parsedType}),ct}const{status:r,ctx:i}=this._processInputParams(e),{shape:a,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof Oc&&this._def.unknownKeys==="strip"))for(const u in i.data)s.includes(u)||o.push(u);const c=[];for(const u of s){const d=a[u],h=i.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new Ac(i,h,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Oc){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of o)c.push({key:{status:"valid",value:d},value:{status:"valid",value:i.data[d]}});else if(u==="strict")o.length>0&&(Me(i,{code:_e.unrecognized_keys,keys:o}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of o){const h=i.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new Ac(i,h,i.path,d)),alwaysSet:d in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const h=await d.key,f=await d.value;u.push({key:h,value:f,alwaysSet:d.alwaysSet})}return u}).then(u=>Ri.mergeObjectSync(r,u)):Ri.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return ze.errToObj,new Tn({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var a,s;const i=((s=(a=this._def).errorMap)==null?void 0:s.call(a,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:ze.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new Tn({...this._def,unknownKeys:"strip"})}passthrough(){return new Tn({...this._def,unknownKeys:"passthrough"})}extend(e){return new Tn({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Tn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:lt.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Tn({...this._def,catchall:e})}pick(e){const n={};for(const r of Ot.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Tn({...this._def,shape:()=>n})}omit(e){const n={};for(const r of Ot.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new Tn({...this._def,shape:()=>n})}deepPartial(){return td(this)}partial(e){const n={};for(const r of Ot.objectKeys(this.shape)){const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}return new Tn({...this._def,shape:()=>n})}required(e){const n={};for(const r of Ot.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof wc;)a=a._def.innerType;n[r]=a}return new Tn({...this._def,shape:()=>n})}keyof(){return FB(Ot.objectKeys(this.shape))}}Tn.create=(t,e)=>new Tn({shape:()=>t,unknownKeys:"strip",catchall:Oc.create(),typeName:lt.ZodObject,...wt(e)});Tn.strictCreate=(t,e)=>new Tn({shape:()=>t,unknownKeys:"strict",catchall:Oc.create(),typeName:lt.ZodObject,...wt(e)});Tn.lazycreate=(t,e)=>new Tn({shape:t,unknownKeys:"strip",catchall:Oc.create(),typeName:lt.ZodObject,...wt(e)});class H0 extends Pt{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return n.common.issues.push(...o.ctx.common.issues),o.result;const s=a.map(o=>new Oi(o.ctx.common.issues));
vendor: 4,118 bytes, line 649
649return Me(n,{code:_e.invalid_union,unionErrors:s}),ct}if(n.common.async)return Promise.all(r.map(async a=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let a;const s=[];for(const c of r){const u={...n,common:{...n.common,issues:[]},parent:null},d=c._parseSync({data:n.data,path:n.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!a&&(a={result:d,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(c=>new Oi(c));return Me(n,{code:_e.invalid_union,unionErrors:o}),ct}}get options(){return this._def.options}}H0.create=(t,e)=>new H0({options:t,typeName:lt.ZodUnion,...wt(e)});function kC(t,e){const n=Uo(t),r=Uo(e);if(t===e)return{valid:!0,data:t};if(n===Ue.object&&r===Ue.object){const i=Ot.objectKeys(e),a=Ot.objectKeys(t).filter(o=>i.indexOf(o)!==-1),s={...t,...e};for(const o of a){const c=kC(t[o],e[o]);if(!c.valid)return{valid:!1};s[o]=c.data}return{valid:!0,data:s}}else if(n===Ue.array&&r===Ue.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let a=0;a<t.length;a++){const s=t[a],o=e[a],c=kC(s,o);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return n===Ue.date&&r===Ue.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class q0 extends Pt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(a,s)=>{if(QR(a)||QR(s))return ct;const o=kC(a.value,s.value);return o.valid?((eD(a)||eD(s))&&n.dirty(),{status:n.value,value:o.data}):(Me(r,{code:_e.invalid_intersection_types}),ct)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,s])=>i(a,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}q0.create=(t,e,n)=>new q0({left:t,right:e,typeName:lt.ZodIntersection,...wt(n)});class nu extends Pt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ue.array)return Me(r,{code:_e.invalid_type,expected:Ue.array,received:r.parsedType}),ct;if(r.data.length<this._def.items.length)return Me(r,{code:_e.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ct;!this._def.rest&&r.data.length>this._def.items.length&&(Me(r,{code:_e.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...r.data].map((s,o)=>{const c=this._def.items[o]||this._def.rest;return c?c._parse(new Ac(r,s,r.path,o)):null}).filter(s=>!!s);return r.common.async?Promise.all(a).then(s=>Ri.mergeArray(n,s)):Ri.mergeArray(n,a)}get items(){return this._def.items}rest(e){return new nu({...this._def,rest:e})}}nu.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new nu({items:t,typeName:lt.ZodTuple,rest:null,...wt(e)})};class lD extends Pt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ue.map)return Me(r,{code:_e.invalid_type,expected:Ue.map,received:r.parsedType}),ct;const i=this._def.keyType,a=this._def.valueType,s=[...r.data.entries()].map(([o,c],u)=>({key:i._parse(new Ac(r,o,r.path,[u,"key"])),value:a._parse(new Ac(r,c,r.path,[u,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const c of s){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return ct;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),o.set(u.value,d.value)}return{status:n.value,value:o}})}else{const o=new Map;for(const c of s){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return ct;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),o.set(u.value,d.value)}return{status:n.value,value:o}}}}lD.create=(t,e,n)=>new lD({valueType:e,keyType:t,typeName:lt.ZodMap,...wt(n)});class Mm extends Pt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);
vendor: 6,899 bytes, line 649
649if(r.parsedType!==Ue.set)return Me(r,{code:_e.invalid_type,expected:Ue.set,received:r.parsedType}),ct;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Me(r,{code:_e.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Me(r,{code:_e.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const a=this._def.valueType;function s(c){const u=new Set;for(const d of c){if(d.status==="aborted")return ct;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}const o=[...r.data.values()].map((c,u)=>a._parse(new Ac(r,c,r.path,u)));return r.common.async?Promise.all(o).then(c=>s(c)):s(o)}min(e,n){return new Mm({...this._def,minSize:{value:e,message:ze.toString(n)}})}max(e,n){return new Mm({...this._def,maxSize:{value:e,message:ze.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Mm.create=(t,e)=>new Mm({valueType:t,minSize:null,maxSize:null,typeName:lt.ZodSet,...wt(e)});class uD extends Pt{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}uD.create=(t,e)=>new uD({getter:t,typeName:lt.ZodLazy,...wt(e)});class dD extends Pt{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return Me(n,{received:n.data,code:_e.invalid_literal,expected:this._def.value}),ct}return{status:"valid",value:e.data}}get value(){return this._def.value}}dD.create=(t,e)=>new dD({value:t,typeName:lt.ZodLiteral,...wt(e)});function FB(t,e){return new gh({values:t,typeName:lt.ZodEnum,...wt(e)})}class gh extends Pt{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return Me(n,{expected:Ot.joinValues(r),received:n.parsedType,code:_e.invalid_type}),ct}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return Me(n,{received:n.data,code:_e.invalid_enum_value,options:r}),ct}return oa(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return gh.create(e,{...this._def,...n})}exclude(e,n=this._def){return gh.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}gh.create=FB;class hD extends Pt{_parse(e){const n=Ot.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Ue.string&&r.parsedType!==Ue.number){const i=Ot.objectValues(n);return Me(r,{expected:Ot.joinValues(i),received:r.parsedType,code:_e.invalid_type}),ct}if(this._cache||(this._cache=new Set(Ot.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=Ot.objectValues(n);return Me(r,{received:r.data,code:_e.invalid_enum_value,options:i}),ct}return oa(e.data)}get enum(){return this._def.values}}hD.create=(t,e)=>new hD({values:t,typeName:lt.ZodNativeEnum,...wt(e)});class K0 extends Pt{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Ue.promise&&n.common.async===!1)return Me(n,{code:_e.invalid_type,expected:Ue.promise,received:n.parsedType}),ct;const r=n.parsedType===Ue.promise?n.data:Promise.resolve(n.data);return oa(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}K0.create=(t,e)=>new K0({type:t,typeName:lt.ZodPromise,...wt(e)});class vh extends Pt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===lt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,a={addIssue:s=>{Me(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){const s=i.transform(r.data,a);if(r.common.async)return Promise.resolve(s).then(async o=>{if(n.value==="aborted")return ct;const c=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return c.status==="aborted"?ct:c.status==="dirty"||n.value==="dirty"?kp(c.value):c});{if(n.value==="aborted")return ct;const o=this._def.schema._parseSync({data:s,path:r.path,parent:r});return o.status==="aborted"?ct:o.status==="dirty"||n.value==="dirty"?kp(o.value):o}}if(i.type==="refinement"){const s=o=>{const c=i.refinement(o,a);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?ct:(o.status==="dirty"&&n.dirty(),s(o.value),{status:n.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?ct:(o.status==="dirty"&&n.dirty(),s(o.value).then(()=>({status:n.value,value:o.value}))))}if(i.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!mh(s))return ct;const o=i.transform(s.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>mh(s)?Promise.resolve(i.transform(s.value,a)).then(o=>({status:n.value,value:o})):ct);Ot.assertNever(i)}}vh.create=(t,e,n)=>new vh({schema:t,typeName:lt.ZodEffects,effect:e,...wt(n)});vh.createWithPreprocess=(t,e,n)=>new vh({schema:e,effect:{type:"preprocess",transform:t},typeName:lt.ZodEffects,...wt(n)});class wc extends Pt{_parse(e){return this._getType(e)===Ue.undefined?oa(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}wc.create=(t,e)=>new wc({innerType:t,typeName:lt.ZodOptional,...wt(e)});class yh extends Pt{_parse(e){return this._getType(e)===Ue.null?oa(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}yh.create=(t,e)=>new yh({innerType:t,typeName:lt.ZodNullable,...wt(e)});class _C extends Pt{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===Ue.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}_C.create=(t,e)=>new _C({innerType:t,typeName:lt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...wt(e)});class CC extends Pt{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return W0(i)?i.then(a=>
649({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Oi(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Oi(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}CC.create=(t,e)=>new CC({innerType:t,typeName:lt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...wt(e)});class fD extends Pt{_parse(e){if(this._getType(e)!==Ue.nan){const r=this._getOrReturnCtx(e);return Me(r,{code:_e.invalid_type,expected:Ue.nan,received:r.parsedType}),ct}return{status:"valid",value:e.data}}}fD.create=t=>new fD({typeName:lt.ZodNaN,...wt(t)});class Bce extends Pt{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Lj extends Pt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?ct:a.status==="dirty"?(n.dirty(),kp(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?ct:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new Lj({in:e,out:n,typeName:lt.ZodPipeline})}}class TC extends Pt{_parse(e){const n=this._def.innerType._parse(e),r=i=>(mh(i)&&(i.value=Object.freeze(i.value)),i);return W0(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}TC.create=(t,e)=>new TC({innerType:t,typeName:lt.ZodReadonly,...wt(e)});Tn.lazycreate;var lt;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(lt||(lt={}));const Ka=ic.create;Oc.create;ys.create;const tw=Tn.create;Tn.strictCreate;H0.create;q0.create;nu.create;gh.create;K0.create;wc.create;yh.create;const Uce=tw({email:Ka().trim().email({message:"Invalid email address"}).max(255,{message:"Email too long"}),password:Ka().min(6,{message:"Password must be at least 6 characters"})}),zce=tw({email:Ka().trim().email({message:"Invalid email address"}).max(255,{message:"Email too long"}),password:Ka().min(6,{message:"Password must be at least 6 characters"}).max(72,{message:"Password too long"}),fullName:Ka().trim().max(100,{message:"Name too long"}).optional()});function Wce(){const[t,e]=b.useState(""),[n,r]=b.useState(""),[i,a]=b.useState(""),[s,o]=b.useState(!1),[c,u]=b.useState(""),[d,h]=b.useState(!1),[f,p]=b.useState(!1),{user:g,loading:m,signIn:v,signUp:x,resetPassword:w}=sa(),y=rr();if(b.useEffect(()=>{!m&&g&&y(-1)},[g,m,y]),b.useEffect(()=>{window.scrollTo(0,0)},[]),m)return l.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-background via-background to-muted/20",children:l.jsx("div",{className:"animate-pulse text-muted-foreground",children:"Loading..."})});const k=async C=>{var T;C.preventDefault(),o(!0);try{const E=Uce.parse({email:t,password:n}),{error:j}=await v(E.email,E.password);if(j){console.error("Sign in error:",j);const P=/invalid login credentials/i.test(j.message)?"Incorrect email or password.":j.message||"Sign in failed. Please try again.";Dn.error(P)}else y("/dashboard")}catch(E){E instanceof Oi?(console.error("Validation error:",E),Dn.error(((T=E.errors[0])==null?void 0:T.message)??"Please check your input.")):(console.error("Unexpected sign in error:",E),Dn.error("Something went wrong. Please try again."))}o(!1)},S=async C=>{var T;C.preventDefault(),o(!0);try{const E=zce.parse({email:t,password:n,fullName:i}),{error:j}=await x(E.email,E.password,E.fullName);if(j){console.error("Sign up error:",j);const P=/already registered|already exists|user already/i.test(j.message)?"This email is already registered. Try signing in instead.":j.message||"Sign up failed. Please try again.";Dn.error(P)}else{const M=Date.now()+3e3,U={startVelocity:30,spread:360,ticks:60,zIndex:9999},N=($,I)=>Math.random()*(I-$)+$,B=setInterval(()=>{const $=M-Date.now();if($<=0)return clearInterval(B);const I=50*($/3e3);XR({...U,particleCount:I,origin:{x:N(.1,.3),y:Math.random()-.2},colors:["#8B5CF6","#EC4899","#F97316"]}),XR({...U,particleCount:I,origin:{x:N(.7,.9),y:Math.random()-.2},colors:["#8B5CF6","#EC4899","#F97316"]})},250);setTimeout(()=>{y("/dashboard")},1e3)}}catch(E){E instanceof Oi?(console.error("Validation error:",E),Dn.error(((T=E.errors[0])==null?void 0:T.message)??"Please check your input.")):(console.error("Unexpected sign up error:",E),Dn.error("Something went wrong. Please try again."))}o(!1)},_=async C=>{C.preventDefault(),p(!0);try{const T=Ka().trim().email().parse(c),{error:E}=await w(T);E?Dn.error("Failed to send reset email. Please try again."):(Dn.success("Password reset link sent! Check your email."),h(!1),u(""))}catch{Dn.error("Please enter a valid email address.")}p(!1)};return l.jsxs("div",{className:"relative bg-gradient-to-br from-background via-background to-muted/20",children:[l.jsx(es,{title:"Sign in or sign up",description:"Sign in to Caréable or create a free account to coordinate care schedules with family and caregivers.",canonical:"https://careable.co/auth"}),l.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[l.jsx("div",{className:"absolute top-20 left-10 w-72 h-72 bg-calendar-blue/10 rounded-full blur-3xl animate-pulse"}),l.jsx("div",{className:"absolute bottom-20 right-10 w-96 h-96 bg-calendar-coral/10 rounded-full blur-3xl animate-pulse delay-1000"}),l.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[600px] h-[600px] bg-calendar-peach/5 rounded-full blur-3xl"})]}),l.jsx("div",{className:"p-6 pb-16 md:pb-24",children:l.jsxs("div",{className:"w-full max-w-6xl mx-auto flex flex-col-reverse md:grid md:grid-cols-2 gap-6 md:gap-6 lg:gap-8 items-start relative z-10 md:px-8 pt-8 md:pt-12",children:[l.jsxs("div",{className:"flex flex-col space-y-6 md:space-y-5 lg:space-y-6 p-6 md:p-6 lg:p-8",children:[l.jsxs("div",{className:"space-y-4 md:space-y-3 lg:space-y-4",children:[l.jsxs("h2",{className:"text-2xl md:text-2xl lg:text-4xl font-bold leading-tight text-foreground",children:["Care coordination",l.jsx("br",{}),"made simple"]}),l.jsx("p",{className:"text-lg md:hidden lg:block text-muted-foreground",children:"Plan care schedules with AI, share with family, stay in sync."})]}),l.jsxs("div",{className:"space-y-6 md:space-y-4 lg:space-y-6",children:[l.jsxs("div",{className:"flex items-start gap-4 md:gap-3 lg:gap-4",children:[l.jsx("div",{className:"w-12 h-11 md:w-11 md:h-10 lg:w-12 lg:h-11 flex items-center justify-center flex-shrink-0 backdrop-blur-sm bg-calendar-blue/15 border border-calendar-blue/25",style:{borderRadius:"42% 58% 55% 45% / 50% 42% 58% 50%"},children:l.jsx(ta,{className:"w-5 h-5 text-calendar-blue"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"font-semibold mb-1 text-base",children:"AI-Powered Scheduling"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Speak or type naturally â AI creates care events for you"})]})]}),l.jsxs("div",{className:"flex items-start gap-4 md:gap-3 lg:gap-4",children:[l.jsx("div",{className:"w-12 h-11 md:w-11 md:h-10 lg:w-12 lg:h-11 flex items-center justify-center flex-shrink-0 backdrop-blur-sm bg-calendar-coral/15 border border-calendar-coral/25",style:{borderRadius:"55% 45% 48% 52% / 45% 55% 45% 55%"},children:l.jsx(Ql,{className:"w-5 h-5 text-calendar-coral"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"font-semibold mb-1 text-base",children:"Share With Family Instantly"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Only you need an account â caregivers and family view with a simple link"})]})]}),l.jsxs("div",{className:"flex items-start gap-4 md:gap-3 lg:gap-4",children:[l.jsx("div",{className:"w-12 h-11 md:w-11 md:h-10 lg:w-12 lg:h-11 flex items-center justify-center flex-shrink-0 backdrop-blur-sm bg-calendar-peach/15 border border-calendar-peach/25",style:{borderRadius:"48% 52% 42% 58% / 55% 48% 52% 45%"},children:l.jsx(wm,{className:"w-5 h-5 text-calendar-peach"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"font-semibold mb-1 text-base",children:"Private & Protected"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Sensitive care details stay safe with password-protected links"})]})]})]})]}),l.jsxs(rt,{className:"w-full max-w-md mx-auto md:mr-0 shadow-2xl border-border/50 backdrop-blur-sm bg-card/95",children:[l.jsxs(ht,{className:"space-y-4",children:[l.jsxs(de,{variant:"ghost",onClick:()=>y("/"),className:"w-fit -ml-2 text-muted-foreground hover:text-foreground",children:[l.jsx(ci,{className:"w-4 h-4 mr-2"}),"Back to Home"]}),l.jsxs("div",{children:[l.jsx(mt,{className:"text-3xl mb-2",children:"Caréable"}),l.jsx(tn,{className:"text-base",children:"Sign in or create your free account"})]})]}),l.jsx(ot,{children:l.jsxs(IB,{defaultValue:"signin",className:"space-y-4",children:[l.jsxs(Ij,{className:"grid w-full grid-cols-2 p-1 h-auto",children:[l.jsx(qo,{value:"signin",className:"text-base py-2.5",children:"Sign In"}),l.jsx(qo,{value:"signup",className:"text-base py-2.5",children:"Sign Up"})]}
649),l.jsx(Ko,{value:"signin",className:"space-y-4 mt-6 data-[state=active]:animate-fade-in",children:l.jsxs("form",{onSubmit:k,className:"space-y-5",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(yt,{htmlFor:"signin-email",className:"text-base",children:"Email"}),l.jsx(qt,{id:"signin-email",type:"email",placeholder:"[email protected]",value:t,onChange:C=>e(C.target.value),required:!0,className:"h-11 text-base transition-all duration-200 focus:scale-[1.01]"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(yt,{htmlFor:"signin-password",className:"text-base",children:"Password"}),l.jsx(qt,{id:"signin-password",type:"password",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",value:n,onChange:C=>r(C.target.value),required:!0,className:"h-11 text-base transition-all duration-200 focus:scale-[1.01]"})]}),l.jsx(de,{type:"submit",className:"w-full h-11 text-base text-white border-0 transition-transform hover:scale-[1.02] active:scale-[0.98] hover:opacity-90",style:{background:"linear-gradient(135deg, hsl(210,45%,58%) 0%, hsl(25,55%,68%) 40%, hsl(10,50%,70%) 65%, hsl(210,40%,60%) 100%)"},disabled:s,children:s?"Signing in...":"Sign In"}),l.jsxs(Za,{open:d,onOpenChange:h,children:[l.jsx(Oj,{asChild:!0,children:l.jsx(de,{type:"button",variant:"link",className:"w-full text-sm text-muted-foreground hover:text-foreground",children:"Forgot password?"})}),l.jsxs(Ts,{children:[l.jsxs(na,{children:[l.jsx(ra,{children:"Reset Password"}),l.jsx(Es,{children:"Enter your email address and we'll send you a link to reset your password."})]}),l.jsxs("form",{onSubmit:_,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(yt,{htmlFor:"reset-email",children:"Email"}),l.jsx(qt,{id:"reset-email",type:"email",placeholder:"[email protected]",value:c,onChange:C=>u(C.target.value),required:!0,className:"h-11"})]}),l.jsx(de,{type:"submit",className:"w-full",disabled:f,children:f?"Sending...":"Send Reset Link"})]})]})]})]})}),l.jsx(Ko,{value:"signup",className:"space-y-4 mt-6 data-[state=active]:animate-fade-in",children:l.jsxs("form",{onSubmit:S,className:"space-y-5",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(yt,{htmlFor:"signup-name",className:"text-base",children:"Full Name"}),l.jsx(qt,{id:"signup-name",type:"text",placeholder:"John Doe",value:i,onChange:C=>a(C.target.value),className:"h-11 text-base transition-all duration-200 focus:scale-[1.01]"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(yt,{htmlFor:"signup-email",className:"text-base",children:"Email"}),l.jsx(qt,{id:"signup-email",type:"email",placeholder:"[email protected]",value:t,onChange:C=>e(C.target.value),required:!0,className:"h-11 text-base transition-all duration-200 focus:scale-[1.01]"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(yt,{htmlFor:"signup-password",className:"text-base",children:"Password"}),l.jsx(qt,{id:"signup-password",type:"password",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",value:n,onChange:C=>r(C.target.value),required:!0,minLength:6,className:"h-11 text-base transition-all duration-200 focus:scale-[1.01]"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Minimum 6 characters"})]}),l.jsx(de,{type:"submit",className:"w-full h-11 text-base bg-gradient-to-r from-calendar-blue via-calendar-coral to-calendar-peach hover:opacity-90 text-white border-0 transition-transform hover:scale-[1.02] active:scale-[0.98]",disabled:s,children:s?"Creating account...":"Create Account"})]})})]})})]})]})})]})}const Vce=Ka().min(6,{message:"Password must be at least 6 characters"}).max(72,{message:"Password too long"});function Hce(){const[t,e]=b.useState(""),[n,r]=b.useState(""),[i,a]=b.useState(!1),{updatePassword:s}=sa(),o=rr(),c=async u=>{if(u.preventDefault(),t!==n){Dn.error("Passwords do not match");return}a(!0);try{const d=Vce.parse(t),{error:h}=await s(d);h?Dn.error("Failed to update password. Please try again."):(Dn.success("Password updated successfully!"),setTimeout(()=>{o("/dashboard")},1e3))}catch(d){d instanceof Oi?Dn.error(d.errors[0].message):Dn.error("An error occurred. Please try again.")}a(!1)};return l.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-background via-background to-muted/20 p-6",children:l.jsxs(rt,{className:"w-full max-w-md
649shadow-2xl border-border/50 backdrop-blur-sm bg-card/95",children:[l.jsxs(ht,{className:"space-y-4",children:[l.jsxs(de,{variant:"ghost",onClick:()=>o("/auth"),className:"w-fit -ml-2 text-muted-foreground hover:text-foreground",children:[l.jsx(ci,{className:"w-4 h-4 mr-2"}),"Back to Sign In"]}),l.jsxs("div",{children:[l.jsx(mt,{className:"text-3xl mb-2",children:"Reset Password"}),l.jsx(tn,{className:"text-base",children:"Enter your new password below"})]})]}),l.jsx(ot,{children:l.jsxs("form",{onSubmit:c,className:"space-y-5",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(yt,{htmlFor:"new-password",className:"text-base",children:"New Password"}),l.jsx(qt,{id:"new-password",type:"password",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",value:t,onChange:u=>e(u.target.value),required:!0,minLength:6,className:"h-11 text-base transition-all duration-200 focus:scale-[1.01]"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Minimum 6 characters"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(yt,{htmlFor:"confirm-password",className:"text-base",children:"Confirm Password"}),l.jsx(qt,{id:"confirm-password",type:"password",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",value:n,onChange:u=>r(u.target.value),required:!0,minLength:6,className:"h-11 text-base transition-all duration-200 focus:scale-[1.01]"})]}),l.jsx(de,{type:"submit",className:"w-full h-11 text-base bg-gradient-to-r from-calendar-blue via-calendar-coral to-calendar-peach hover:opacity-90 text-white border-0 transition-transform hover:scale-[1.02] active:scale-[0.98]",disabled:i,children:i?"Updating...":"Update Password"})]})})]})})}const qce="modulepreload",Kce=function(t){return"/"+t},pD={},Gce=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),o=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));i=Promise.allSettled(n.map(c=>{if(c=Kce(c),c in pD)return;pD[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":qce,u||(h.as="script"),h.crossOrigin="",h.href=c,o&&h.setAttribute("nonce",o),document.head.appendChild(h),u)return new Promise((f,p)=>{h.addEventListener("load",f),h.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function a(s){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s}return i.then(s=>{for(const o of s||[])o.status==="rejected"&&a(o.reason);return e().catch(a)})},Yf="admin_status_cache",Yce=5*60*1e3;function $j(){const{user:t}=sa(),[e,n]=b.useState(!1),[r,i]=b.useState(!0);return b.useEffect(()=>{async function a(){if(!t){n(!1),i(!1),localStorage.removeItem(Yf);return}const o=localStorage.getItem(Yf);if(o)try{const c=JSON.parse(o),u=Date.now();if(c.userId===t.id&&u-c.timestamp<Yce){n(c.isAdmin),i(!1);return}}catch{localStorage.removeItem(Yf)}try{const{data:c,error:u}=await me.from("user_roles").select("role").eq("user_id",t.id).eq("role","admin").single(),d=!u&&!!c;n(d);const h={isAdmin:d,timestamp:Date.now(),userId:t.id};localStorage.setItem(Yf,JSON.stringify(h))}catch{n(!1)}finally{i(!1)}}if(a(),!t)return;const s=me.channel("user-role-changes").on("postgres_changes",{event:"*",schema:"public",table:"user_roles",filter:`user_id=eq.${t.id}`},o=>{console.log("Role change detected:",o),localStorage.removeItem(Yf),a()}).subscribe();return()=>{me.removeChannel(s)}},[t]),{isAdmin:e,loading:r}}function Jce(){const{user:t,signOut:e}=sa(),n=rr(),[r,i]=b.useState("active"),[a,s]=b.useState(!0);b.useEffect(()=>{if(!t){s(!1);return}o();const u=me.channel("user-status-changes").on("postgres_changes",{event:"UPDATE",schema:"public",table:"profiles",filter:`id=eq.${t.id}`},d=>{const h=d.new.user_status;h!=="active"&&c(h),i(h)}).subscribe();return()=>{me.removeChannel(u)}},[t]);const o=async()=>{if(t)try{const{data:u,error:d}=await me.from("profiles").select("user_status, suspension_reason").eq("id",t.id).single();if(d){console.error("Error checking user status:",d),i("active"),s(!1);return}i(u.user_status),u.user_status!=="active"&&c(u.user_status,u.suspension_reason)}catch(u){console.error("Error checking user status:",u),i("active")}finally{s(!1)}},c=async(u,d)=>{console.log("User suspended:",u,d),await e(),n("/auth")};return{userStatus:r,checking:a,isActive:r==="active"}}
649const mD=({url:t,title:e,text:n="Here's the schedule",className:r="",variant:i="outline",size:a="default",showLabel:s=!0,borderColor:o,textColor:c})=>{const[u,d]=b.useState(!1),[h,f]=b.useState(!1),p=typeof navigator<"u"&&navigator.share,g=async()=>{if(p)try{await navigator.share({title:e,text:n,url:t})}catch(x){if(x.name==="AbortError")return;console.error("Share failed:",x),Ea({title:"Unable to share",description:"Please try copying the link instead.",variant:"destructive"})}else d(!0)},m=async()=>{try{await navigator.clipboard.writeText(t),f(!0),Ea({title:"Link copied",description:"You can paste it anywhere."}),setTimeout(()=>{f(!1),d(!1)},1500)}catch(x){console.error("Copy failed:",x),Ea({title:"Copy failed",description:"Please select and copy the link manually.",variant:"destructive"})}},v=o&&c?{borderColor:o,color:c}:void 0;return l.jsxs(l.Fragment,{children:[l.jsxs(de,{onClick:g,variant:i,size:a,className:`min-h-[44px] touch-manipulation ${r}`,style:v,children:[l.jsx(PO,{className:`w-4 h-4 ${s?"mr-1.5":""}`}),s&&"Share"]}),l.jsx(Za,{open:u,onOpenChange:d,children:l.jsxs(Ts,{className:"max-w-md",children:[l.jsxs(na,{children:[l.jsxs(ra,{className:"flex items-center gap-2",children:[l.jsx(PO,{className:"w-5 h-5"}),"Share Link"]}),l.jsx(Es,{children:"Copy this link to share with others"})]}),l.jsxs("div",{className:"space-y-4 py-4",children:[l.jsxs("div",{className:"flex gap-2",children:[l.jsx(qt,{value:t,readOnly:!0,className:"flex-1 text-sm font-mono bg-muted",onClick:x=>x.target.select()}),l.jsx(de,{onClick:m,className:`min-h-[44px] px-4 transition-all ${h?"bg-green-500 hover:bg-green-600 text-white":""}`,children:h?l.jsxs(l.Fragment,{children:[l.jsx(_s,{className:"w-4 h-4 mr-1.5"}),"Copied!"]}):l.jsxs(l.Fragment,{children:[l.jsx(Pd,{className:"w-4 h-4 mr-1.5"}),"Copy"]})})]}),l.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Paste this link in any app to share"})]})]})})]})};var BB="AlertDialog",[Xce,lBe]=Yr(BB,[XF]),_o=XF(),UB=t=>{const{__scopeAlertDialog:e,...n}=t,r=_o(e);return l.jsx(fB,{...r,...n,modal:!0})};UB.displayName=BB;var Zce="AlertDialogTrigger",zB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=_o(n);return l.jsx(pB,{...i,...r,ref:e})});zB.displayName=Zce;var Qce="AlertDialogPortal",WB=t=>{const{__scopeAlertDialog:e,...n}=t,r=_o(e);return l.jsx(mB,{...r,...n})};WB.displayName=Qce;var ele="AlertDialogOverlay",VB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=_o(n);return l.jsx(jj,{...i,...r,ref:e})});VB.displayName=ele;var Dd="AlertDialogContent",[tle,nle]=Xce(Dd),rle=$L("AlertDialogContent"),HB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,children:r,...i}=t,a=_o(n),s=b.useRef(null),o=bt(e,s),c=b.useRef(null);return l.jsx(Xoe,{contentName:Dd,titleName:qB,docsSlug:"alert-dialog",children:l.jsx(tle,{scope:n,cancelRef:c,children:l.jsxs(Yg,{role:"alertdialog",...a,...i,ref:o,onOpenAutoFocus:Ie(i.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=c.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[l.jsx(rle,{children:r}),l.jsx(ale,{contentRef:s})]})})})});HB.displayName=Dd;var qB="AlertDialogTitle",KB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=_o(n);return l.jsx(Pj,{...i,...r,ref:e})});KB.displayName=qB;var GB="AlertDialogDescription",YB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=_o(n);return l.jsx(Nj,{...i,...r,ref:e})});YB.displayName=GB;var ile="AlertDialogAction",JB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=_o(n);return l.jsx(Aj,{...i,...r,ref:e})});JB.displayName=ile;var XB="AlertDialogCancel",ZB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,{cancelRef:i}=nle(XB,n),a=_o(n),s=bt(e,i);return l.jsx(Aj,{...a,...r,ref:s})});ZB.displayName=XB;var ale=({contentRef:t})=>{const e=`\`${Dd}\` requires a description for the component to be accessible for screen reader users. 650 651You can add a description to the \`${Dd}\` by passing a \`${GB}\` component as a child, which also benefits sighted users by adding visible context to the dialog. 652 653Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Dd}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. 654 655For more information, see https://radix-ui.com/primitives/docs/components/
655alert-dialog`;return b.useEffect(()=>{var r;document.getElementById((r=t.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(e)},[e,t]),null},sle=UB,ole=zB,cle=WB,QB=VB,e7=HB,t7=JB,n7=ZB,r7=KB,i7=YB;const Fj=sle,lle=ole,ule=cle,a7=b.forwardRef(({className:t,...e},n)=>l.jsx(QB,{className:ce("fixed inset-0 z-[150] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:n}));a7.displayName=QB.displayName;const nw=b.forwardRef(({className:t,...e},n)=>l.jsxs(ule,{children:[l.jsx(a7,{}),l.jsx(e7,{ref:n,className:ce("fixed left-[50%] top-[50%] z-[200] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...e})]}));nw.displayName=e7.displayName;const rw=({className:t,...e})=>l.jsx("div",{className:ce("flex flex-col space-y-2 text-center sm:text-left",t),...e});rw.displayName="AlertDialogHeader";const iw=({className:t,...e})=>l.jsx("div",{className:ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});iw.displayName="AlertDialogFooter";const aw=b.forwardRef(({className:t,...e},n)=>l.jsx(r7,{ref:n,className:ce("text-lg font-semibold",t),...e}));aw.displayName=r7.displayName;const sw=b.forwardRef(({className:t,...e},n)=>l.jsx(i7,{ref:n,className:ce("text-sm text-muted-foreground",t),...e}));sw.displayName=i7.displayName;const ow=b.forwardRef(({className:t,...e},n)=>l.jsx(t7,{ref:n,className:ce(Om(),t),...e}));ow.displayName=t7.displayName;const cw=b.forwardRef(({className:t,...e},n)=>l.jsx(n7,{ref:n,className:ce(Om({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));cw.displayName=n7.displayName;function EC(t,[e,n]){return Math.min(n,Math.max(e,t))}function Bj(t){const e=b.useRef({value:t,previous:t});return b.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var dle=[" ","Enter","ArrowUp","ArrowDown"],hle=[" ","Enter"],ru="Select",[lw,uw,fle]=z2(ru),[xf,uBe]=Yr(ru,[fle,mf]),dw=mf(),[ple,Wc]=xf(ru),[mle,gle]=xf(ru),s7=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:i,onOpenChange:a,value:s,defaultValue:o,onValueChange:c,dir:u,name:d,autoComplete:h,disabled:f,required:p,form:g}=t,m=dw(e),[v,x]=b.useState(null),[w,y]=b.useState(null),[k,S]=b.useState(!1),_=Jg(u),[C,T]=ks({prop:r,defaultProp:i??!1,onChange:a,caller:ru}),[E,j]=ks({prop:s,defaultProp:o,onChange:c,caller:ru}),P=b.useRef(null),M=v?g||!!v.closest("form"):!0,[U,N]=b.useState(new Set),B=Array.from(U).map($=>$.props.value).join(";");return l.jsx(aj,{...m,children:l.jsxs(ple,{required:p,scope:e,trigger:v,onTriggerChange:x,valueNode:w,onValueNodeChange:y,valueNodeHasChildren:k,onValueNodeHasChildrenChange:S,contentId:gs(),value:E,onValueChange:j,open:C,onOpenChange:T,dir:_,triggerPointerDownPosRef:P,disabled:f,children:[l.jsx(lw.Provider,{scope:e,children:l.jsx(mle,{scope:t.__scopeSelect,onNativeOptionAdd:b.useCallback($=>{N(I=>new Set(I).add($))},[]),onNativeOptionRemove:b.useCallback($=>{N(I=>{const R=new Set(I);return R.delete($),R})},[]),children:n})}),M?l.jsxs(N7,{"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:h,value:E,onChange:$=>j($.target.value),disabled:f,form:g,children:[E===void 0?l.jsx("option",{value:""}):null,Array.from(U)]},B):null]})})};s7.displayName=ru;var o7="SelectTrigger",c7=b.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...i}=t,a=dw(n),s=Wc(o7,n),o=s.disabled||r,c=bt(e,s.onTriggerChange),u=uw(n),d=b.useRef("touch"),[h,f,p]=O7(m=>{const v=u().filter(y=>!y.disabled),x=v.find(y=>y.value===s.value),w=R7(v,m,x);w!==void 0&&s.onValueChange(w.value)}),g=m=>{o||(s.onOpenChange(!0),p()),m&&(s.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return l.jsx(Fx,{asChild:!0,...a,children:l.jsx(Ke.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:o,"data-disabled":o?"":void 0,"data-placeholder":A7(s.value)?"":void 0,...i,ref:c,onClick:Ie(i.onClick,m=>
vendor: 16,032 bytes, line 655
655{m.currentTarget.focus(),d.current!=="mouse"&&g(m)}),onPointerDown:Ie(i.onPointerDown,m=>{d.current=m.pointerType;const v=m.target;v.hasPointerCapture(m.pointerId)&&v.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(g(m),m.preventDefault())}),onKeyDown:Ie(i.onKeyDown,m=>{const v=h.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&f(m.key),!(v&&m.key===" ")&&dle.includes(m.key)&&(g(),m.preventDefault())})})})});c7.displayName=o7;var l7="SelectValue",u7=b.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,children:a,placeholder:s="",...o}=t,c=Wc(l7,n),{onValueNodeHasChildrenChange:u}=c,d=a!==void 0,h=bt(e,c.onValueNodeChange);return Ln(()=>{u(d)},[u,d]),l.jsx(Ke.span,{...o,ref:h,style:{pointerEvents:"none"},children:A7(c.value)?l.jsx(l.Fragment,{children:s}):a})});u7.displayName=l7;var vle="SelectIcon",d7=b.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...i}=t;return l.jsx(Ke.span,{"aria-hidden":!0,...i,ref:e,children:r||"â¼"})});d7.displayName=vle;var yle="SelectPortal",h7=t=>l.jsx(Bg,{asChild:!0,...t});h7.displayName=yle;var iu="SelectContent",f7=b.forwardRef((t,e)=>{const n=Wc(iu,t.__scopeSelect),[r,i]=b.useState();if(Ln(()=>{i(new DocumentFragment)},[]),!n.open){const a=r;return a?Fc.createPortal(l.jsx(p7,{scope:t.__scopeSelect,children:l.jsx(lw.Slot,{scope:t.__scopeSelect,children:l.jsx("div",{children:t.children})})}),a):null}return l.jsx(m7,{...t,ref:e})});f7.displayName=iu;var ba=10,[p7,Vc]=xf(iu),ble="SelectContentImpl",xle=Zl("SelectContent.RemoveScroll"),m7=b.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:s,side:o,sideOffset:c,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:f,collisionPadding:p,sticky:g,hideWhenDetached:m,avoidCollisions:v,...x}=t,w=Wc(iu,n),[y,k]=b.useState(null),[S,_]=b.useState(null),C=bt(e,J=>k(J)),[T,E]=b.useState(null),[j,P]=b.useState(null),M=uw(n),[U,N]=b.useState(!1),B=b.useRef(!1);b.useEffect(()=>{if(y)return _j(y)},[y]),kj();const $=b.useCallback(J=>{const[ne,...G]=M().map(K=>K.ref.current),[Z]=G.slice(-1),ee=document.activeElement;for(const K of J)if(K===ee||(K==null||K.scrollIntoView({block:"nearest"}),K===ne&&S&&(S.scrollTop=0),K===Z&&S&&(S.scrollTop=S.scrollHeight),K==null||K.focus(),document.activeElement!==ee))return},[M,S]),I=b.useCallback(()=>$([T,y]),[$,T,y]);b.useEffect(()=>{U&&I()},[U,I]);const{onOpenChange:R,triggerPointerDownPosRef:z}=w;b.useEffect(()=>{if(y){let J={x:0,y:0};const ne=Z=>{var ee,K;J={x:Math.abs(Math.round(Z.pageX)-(((ee=z.current)==null?void 0:ee.x)??0)),y:Math.abs(Math.round(Z.pageY)-(((K=z.current)==null?void 0:K.y)??0))}},G=Z=>{J.x<=10&&J.y<=10?Z.preventDefault():y.contains(Z.target)||R(!1),document.removeEventListener("pointermove",ne),z.current=null};return z.current!==null&&(document.addEventListener("pointermove",ne),document.addEventListener("pointerup",G,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ne),document.removeEventListener("pointerup",G,{capture:!0})}}},[y,R,z]),b.useEffect(()=>{const J=()=>R(!1);return window.addEventListener("blur",J),window.addEventListener("resize",J),()=>{window.removeEventListener("blur",J),window.removeEventListener("resize",J)}},[R]);const[O,A]=O7(J=>{const ne=M().filter(ee=>!ee.disabled),G=ne.find(ee=>ee.ref.current===document.activeElement),Z=R7(ne,J,G);Z&&setTimeout(()=>Z.ref.current.focus())}),L=b.useCallback((J,ne,G)=>{const Z=!B.current&&!G;(w.value!==void 0&&w.value===ne||Z)&&(E(J),Z&&(B.current=!0))},[w.value]),V=b.useCallback(()=>y==null?void 0:y.focus(),[y]),Y=b.useCallback((J,ne,G)=>{const Z=!B.current&&!G;(w.value!==void 0&&w.value===ne||Z)&&P(J)},[w.value]),Q=r==="popper"?jC:g7,re=Q===jC?{side:o,sideOffset:c,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:f,collisionPadding:p,sticky:g,hideWhenDetached:m,avoidCollisions:v}:{};return l.jsx(p7,{scope:n,content:y,viewport:S,onViewportChange:_,itemRefCallback:L,selectedItem:T,onItemLeave:V,itemTextRefCallback:Y,focusSelectedItem:I,selectedItemText:j,position:r,isPositioned:U,searchRef:O,children:l.jsx(Jx,{as:xle,allowPinchZoom:!0,children:l.jsx(Gx,{asChild:!0,trapped:w.open,onMountAutoFocus:J=>{J.preventDefault()},onUnmountAutoFocus:Ie(i,J=>{var ne;(ne=w.trigger)==null||ne.focus({preventScroll:!0}),J.preventDefault()}),children:l.jsx(uf,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:J=>J.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:l.jsx(Q,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:J=>J.preventDefault(),...x,...re,onPlaced:()=>N(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:Ie(x.onKeyDown,J=>{const ne=J.ctrlKey||J.altKey||J.metaKey;if(J.key==="Tab"&&J.preventDefault(),!ne&&J.key.length===1&&A(J.key),["ArrowUp","ArrowDown","Home","End"].includes(J.key)){let Z=M().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);if(["ArrowUp","End"].includes(J.key)&&(Z=Z.slice().reverse()),["ArrowUp","ArrowDown"].includes(J.key)){const ee=J.target,K=Z.indexOf(ee);Z=Z.slice(K+1)}setTimeout(()=>$(Z)),J.preventDefault()}})})})})})})});m7.displayName=ble;var wle="SelectItemAlignedPosition",g7=b.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...i}=t,a=Wc(iu,n),s=Vc(iu,n),[o,c]=b.useState(null),[u,d]=b.useState(null),h=bt(e,C=>d(C)),f=uw(n),p=b.useRef(!1),g=b.useRef(!0),{viewport:m,selectedItem:v,selectedItemText:x,focusSelectedItem:w}=s,y=b.useCallback(()=>{if(a.trigger&&a.valueNode&&o&&u&&m&&v&&x){const C=a.trigger.getBoundingClientRect(),T=u.getBoundingClientRect(),E=a.valueNode.getBoundingClientRect(),j=x.getBoundingClientRect();if(a.dir!=="rtl"){const ee=j.left-T.left,K=E.left-ee,oe=C.left-K,W=C.width+oe,H=Math.max(W,T.width),q=window.innerWidth-ba,te=EC(K,[ba,Math.max(ba,q-H)]);o.style.minWidth=W+"px",o.style.left=te+"px"}else{const ee=T.right-j.right,K=window.innerWidth-E.right-ee,oe=window.innerWidth-C.right-K,W=C.width+oe,H=Math.max(W,T.width),q=window.innerWidth-ba,te=EC(K,[ba,Math.max(ba,q-H)]);o.style.minWidth=W+"px",o.style.right=te+"px"}const P=f(),M=window.innerHeight-ba*2,U=m.scrollHeight,N=window.getComputedStyle(u),B=parseInt(N.borderTopWidth,10),$=parseInt(N.paddingTop,10),I=parseInt(N.borderBottomWidth,10),R=parseInt(N.paddingBottom,10),z=B+$+U+R+I,O=Math.min(v.offsetHeight*5,z),A=window.getComputedStyle(m),L=parseInt(A.paddingTop,10),V=parseInt(A.paddingBottom,10),Y=C.top+C.height/2-ba,Q=M-Y,re=v.offsetHeight/2,J=v.offsetTop+re,ne=B+$+J,G=z-ne;if(ne<=Y){const ee=P.length>0&&v===P[P.length-1].ref.current;o.style.bottom="0px";const K=u.clientHeight-m.offsetTop-m.offsetHeight,oe=Math.max(Q,re+(ee?V:0)+K+I),W=ne+oe;o.style.height=W+"px"}else{const ee=P.length>0&&v===P[0].ref.current;o.style.top="0px";const oe=Math.max(Y,B+m.offsetTop+(ee?L:0)+re)+G;o.style.height=oe+"px",m.scrollTop=ne-Y+m.offsetTop}o.style.margin=`${ba}px 0`,o.style.minHeight=O+"px",o.style.maxHeight=M+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,o,u,m,v,x,a.dir,r]);Ln(()=>y(),[y]);const[k,S]=b.useState();Ln(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);const _=b.useCallback(C=>{C&&g.current===!0&&(y(),w==null||w(),g.current=!1)},[y,w]);return l.jsx(kle,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:p,onScrollButtonChange:_,children:l.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:l.jsx(Ke.div,{...i,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});g7.displayName=wle;var Sle="SelectPopperPosition",jC=b.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=ba,...a}=t,s=dw(n);return l.jsx(sj,{...s,...a,ref:e,align:r,collisionPadding:i,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});jC.displayName=Sle;var[kle,Uj]=xf(iu,{}),PC="SelectViewport",v7=b.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...i}=t,a=Vc(PC,n),s=Uj(PC,n),o=bt(e,a.onViewportChange),c=b.useRef(0);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),l.jsx(lw.Slot,{scope:n,children:l.jsx(Ke.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Ie(i.onScroll,u=>{const d=u.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:f}=s;if(f!=null&&f.current&&h){const p=Math.abs(c.current-d.scrollTop);if(p>0){const g=window.innerHeight-ba*2,m=parseFloat(h.style.minHeight),v=parseFloat(h.style.height),x=Math.max(m,v);if(x<g){const w=x+p,y=Math.min(g,w),k=w-y;h.style.height=y+"px",h.style.bottom==="0px"&&(d.scrollTop=k>0?k:0,h.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});v7.displayName=PC;var y7="SelectGroup",[_le,Cle]=xf(y7),Tle=b.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=gs();return l.jsx(_le,{scope:n,id:i,children:l.jsx(Ke.div,{role:"group","aria-labelledby":i,...r,ref:e})})});Tle.displayName=y7;var b7="SelectLabel",x7=b.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=Cle(b7,n);return l.jsx(Ke.div,{id:i.id,...r,ref:e})});x7.displayName=b7;var G0="SelectItem",[Ele,w7]=xf(G0),S7=b.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...s}=t,o=Wc(G0,n),c=Vc(G0,n),u=o.value===r,[d,h]=b.useState(a??""),[f,p]=b.useState(!1),g=bt(e,w=>{var y;return(y=c.itemRefCallback)==null?void 0:y.call(c,w,r,i)}),m=gs(),v=b.useRef("touch"),x=()=>{i||(o.onValueChange(r),o.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return l.jsx(Ele,{scope:n,value:r,disabled:i,textId:m,isSelected:u,onItemTextChange:b.useCallback(w=>{h(y=>y||((w==null?void 0:w.textContent)??"").trim())},[]),children:l.jsx(lw.ItemSlot,{scope:n,value:r,disabled:i,textValue:d,children:l.jsx(Ke.div,{role:"option","aria-labelledby":m,"data-highlighted":f?"":void 0,"aria-selected":u&&f,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:g,onFocus:Ie(s.onFocus,()=>p(!0)),onBlur:Ie(s.onBlur,()=>p(!1)),onClick:Ie(s.onClick,()=>{v.current!=="mouse"&&x()}),onPointerUp:Ie(s.onPointerUp,()=>{v.current==="mouse"&&x()}),onPointerDown:Ie(s.onPointerDown,w=>{v.current=w.pointerType}),onPointerMove:Ie(s.onPointerMove,w=>{var y;v.current=w.pointerType,i?(y=c.onItemLeave)==null||y.call(c):v.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ie(s.onPointerLeave,w=>{var y;w.currentTarget===document.activeElement&&((y=c.onItemLeave)==null||y.call(c))}),onKeyDown:Ie(s.onKeyDown,w=>{var k;((k=c.searchRef)==null?void 0:k.current)!==""&&w.key===" "||(hle.includes(w.key)&&x(),w.key===" "&&w.preventDefault())})})})})});S7.displayName=G0;var _p="SelectItemText",k7=b.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,...a}=t,s=Wc(_p,n),o=Vc(_p,n),c=w7(_p,n),u=gle(_p,n),[d,h]=b.useState(null),f=bt(e,x=>h(x),c.onItemTextChange,x=>{var w;return(w=o.itemTextRefCallback)==null?void 0:w.call(o,x,c.value,c.disabled)}),p=d==null?void 0:d.textContent,g=b.useMemo(()=>l.jsx("option",{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:m,onNativeOptionRemove:v}=u;return Ln(()=>(m(g),()=>v(g)),[m,v,g]),l.jsxs(l.Fragment,{children:[l.jsx(Ke.span,{id:c.textId,...a,ref:f}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Fc.createPortal(a.children,s.valueNode):null]})});k7.displayName=_p;var _7="SelectItemIndicator",C7=b.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return w7(_7,n).isSelected?l.jsx(Ke.span,{"aria-hidden":!0,...r,ref:e}):null});C7.displayName=_7;var NC="SelectScrollUpButton",T7=b.forwardRef((t,e)=>{const n=Vc(NC,t.__scopeSelect),r=Uj(NC,t.__scopeSelect),[i,a]=b.useState(!1),s=bt(e,r.onScrollButtonChange);return Ln(()=>{if(n.viewport&&n.isPositioned){let o=function(){const u=c.scrollTop>0;a(u)};const c=n.viewport;return o(),c.addEventListener("scroll",o),()=>c.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),i?l.jsx(j7,{...t,ref:s,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=n;o&&c&&(o.scrollTop=o.scrollTop-c.offsetHeight)}}):null});T7.displayName=NC;var AC="SelectScrollDownButton",E7=b.forwardRef((t,e)=>{const n=Vc(AC,t.__scopeSelect),r=Uj(AC,t.__scopeSelect),[i,a]=b.useState(!1),s=bt(e,r.onScrollButtonChange);return Ln(()=>{if(n.viewport&&n.isPositioned){let o=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;a(d)};const c=n.viewport;return o(),c.addEventListener("scroll",o),()=>c.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),i?l.jsx(j7,{...t,ref:s,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=n;o&&c&&(o.scrollTop=o.scrollTop+c.offsetHeight)}}):null});E7.displayName=AC;var j7=b.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=t,a=Vc("SelectScrollButton",n),s=b.useRef(null),o=uw(n),c=b.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return b.useEffect(()=>()=>c(),[c]),Ln(()=>{var d;const u=o().find(h=>h.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[o]),l.jsx(Ke.div,{"aria-hidden":!0,...i,ref:e,style:{flexShrink:0,...i.style},onPointerDown:Ie(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Ie(i.onPointerMove,()=>{var u;(u=a.onItemLeave)==null||u.call(a),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Ie(i.onPointerLeave,()=>{c()})})}),jle="SelectSeparator",P7=b.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return l.jsx(Ke.div,{"aria-hidden":!0,...r,ref:e})});P7.displayName=jle;var OC="SelectArrow",Ple=b.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=dw(n),a=Wc(OC,n),s=Vc(OC,n);return a.open&&s.position==="popper"?l.jsx(oj,{...i,...r,ref:e}):null});Ple.displayName=OC;var Nle="SelectBubbleInput",N7=b.forwardRef(({__scopeSelect:t,value:e,...n},r)=>{const i=b.useRef(null),a=bt(r,i),s=Bj(e);return b.useEffect(()=>{const o=i.current;if(!o)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(s!==e&&d){const h=new Event("change",{bubbles:!0});d.call(o,e),o.dispatchEvent(h)}},[s,e]),l.jsx(Ke.select,{...n,style:{...WL,...n.style},ref:a,defaultValue:e})});N7.displayName=Nle;function A7(t){return t===""||t===void 0}function O7(t){const e=Wn(t),n=b.useRef(""),r=b.useRef(0),i=b.useCallback(s=>{const o=n.current+s;e(o),function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(o)},[e]),a=b.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function R7(t,e,n){const i=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,a=n?t.indexOf(n):-1;let s=Ale(t,Math.max(a,0));i.length===1&&(s=s.filter(u=>u!==n));const c=s.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return c!==n?c:void 0}function Ale(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var Ole=s7,D7=c7,Rle=u7,Dle=d7,Mle=h7,M7=f7,Ile=v7,I7=x7,L7=S7,Lle=k7,$le=C7,$7=T7,F7=E7,B7=P7;const bh=Ole,xh=Rle,au=b.forwardRef(({className:t,children:e,...n},r)=>l.jsxs(D7,{ref:r,className:ce("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
655ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...n,children:[e,l.jsx(Dle,{asChild:!0,children:l.jsx(T0,{className:"h-4 w-4 opacity-50"})})]}));au.displayName=D7.displayName;const U7=b.forwardRef(({className:t,...e},n)=>l.jsx($7,{ref:n,className:ce("flex cursor-default items-center justify-center py-1",t),...e,children:l.jsx(V_,{className:"h-4 w-4"})}));U7.displayName=$7.displayName;const z7=b.forwardRef(({className:t,...e},n)=>l.jsx(F7,{ref:n,className:ce("flex cursor-default items-center justify-center py-1",t),...e,children:l.jsx(T0,{className:"h-4 w-4"})}));z7.displayName=F7.displayName;const su=b.forwardRef(({className:t,children:e,position:n="popper",...r},i)=>l.jsx(Mle,{children:l.jsxs(M7,{ref:i,className:ce("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...r,children:[l.jsx(U7,{}),l.jsx(Ile,{className:ce("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),l.jsx(z7,{})]})}));su.displayName=M7.displayName;const Fle=b.forwardRef(({className:t,...e},n)=>l.jsx(I7,{ref:n,className:ce("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));Fle.displayName=I7.displayName;const Bt=b.forwardRef(({className:t,children:e,...n},r)=>l.jsxs(L7,{ref:r,className:ce("relative flex w-full cursor-pointer select-none items-center rounded-sm py-2.5 pl-8 pr-2 text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx($le,{children:l.jsx(_s,{className:"h-4 w-4"})})}),l.jsx(Lle,{children:e})]}));Bt.displayName=L7.displayName;const Ble=b.forwardRef(({className:t,...e},n)=>l.jsx(B7,{ref:n,className:ce("-mx-1 my-1 h-px bg-muted",t),...e}));Ble.displayName=B7.displayName;var zj="Radio",[Ule,W7]=Yr(zj),[zle,Wle]=Ule(zj),V7=b.forwardRef((t,e)=>{const{__scopeRadio:n,name:r,checked:i=!1,required:a,disabled:s,value:o="on",onCheck:c,form:u,...d}=t,[h,f]=b.useState(null),p=bt(e,v=>f(v)),g=b.useRef(!1),m=h?u||!!h.closest("form"):!0;return l.jsxs(zle,{scope:n,checked:i,disabled:s,children:[l.jsx(Ke.button,{type:"button",role:"radio","aria-checked":i,"data-state":G7(i),"data-disabled":s?"":void 0,disabled:s,value:o,...d,ref:p,onClick:Ie(t.onClick,v=>{i||c==null||c(),m&&(g.current=v.isPropagationStopped(),g.current||v.stopPropagation())})}),m&&l.jsx(K7,{control:h,bubbles:!g.current,name:r,value:o,checked:i,required:a,disabled:s,form:u,style:{transform:"translateX(-100%)"}})]})});V7.displayName=zj;var H7="RadioIndicator",q7=b.forwardRef((t,e)=>{const{__scopeRadio:n,forceMount:r,...i}=t,a=Wle(H7,n);return l.jsx(ui,{present:r||a.checked,children:l.jsx(Ke.span,{"data-state":G7(a.checked),"data-disabled":a.disabled?"":void 0,...i,ref:e})})});q7.displayName=H7;var Vle="RadioBubbleInput",K7=b.forwardRef(({__scopeRadio:t,control:e,checked:n,bubbles:r=!0,...i},a)=>{const s=b.useRef(null),o=bt(s,a),c=Bj(n),u=nj(e);return b.useEffect(()=>{const d=s.current;if(!d)return;const h=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(h,"checked").set;if(c!==n&&p){const g=new Event("click",{bubbles:r});p.call(d,n),d.dispatchEvent(g)}},[c,n,r]),l.jsx(Ke.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:o,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});K7.displayName=Vle;function G7(t){return t?"checked":"unchecked"}var Hle=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],hw="RadioGroup",[qle,dBe]=Yr(hw,[Qx,W7]),Y7=Qx(),J7=W7(),[Kle,Gle]=qle(hw),X7=b.forwardRef((t,e)=>{const{__scopeRadioGroup:n,name:r,defaultValue:i,value:a,required:s=!1,disabled:o=!1,orientation:c,dir:u,loop:d=!0,onValueChange:h,...f}=t,p=Y7(n),g=Jg(u),[m,v]=ks({prop:a,defaultProp:i??null,onChange:h,caller:hw});return l.jsx(Kle,{scope:n,name:r,required:s,disabled:o,value:m,onValueChange:v,children:l.jsx(wB,{asChild:!0,...p,orientation:c,dir:g,loop:d,children:l.jsx(Ke.div,{role:"radiogroup","aria-required":s,"aria-orientation":c,"data-disabled":o?"":void 0,dir:g,...f,ref:e})})})});X7.displayName=hw;var Z7="RadioGroupItem",Q7=b.forwardRef((t,e)=>{const{__scopeRadioGroup:n,disabled:r,...i}=t,a=Gle(Z7,n),s=a.disabled||r,o=Y7(n),c=J7(n),u=b.useRef(null),d=bt(e,u),h=a.value===i.value,f=b.useRef(!1);return b.useEffect(()=>{const p=m=>
655{Hle.includes(m.key)&&(f.current=!0)},g=()=>f.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",g),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",g)}},[]),l.jsx(SB,{asChild:!0,...o,focusable:!s,active:h,children:l.jsx(V7,{disabled:s,required:a.required,checked:h,...c,...i,name:a.name,ref:d,onCheck:()=>a.onValueChange(i.value),onKeyDown:Ie(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:Ie(i.onFocus,()=>{var p;f.current&&((p=u.current)==null||p.click())})})})});Q7.displayName=Z7;var Yle="RadioGroupIndicator",eU=b.forwardRef((t,e)=>{const{__scopeRadioGroup:n,...r}=t,i=J7(n);return l.jsx(q7,{...i,...r,ref:e})});eU.displayName=Yle;var tU=X7,nU=Q7,Jle=eU;const Wj=b.forwardRef(({className:t,...e},n)=>l.jsx(tU,{className:ce("grid gap-2",t),...e,ref:n}));Wj.displayName=tU.displayName;const Y0=b.forwardRef(({className:t,...e},n)=>l.jsx(nU,{ref:n,className:ce("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:l.jsx(Jle,{className:"flex items-center justify-center",children:l.jsx(eZ,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Y0.displayName=nU.displayName;const gD=8;function rU(t){const e=[],n={minLength:t.length>=gD,hasUppercase:/[A-Z]/.test(t),hasLowercase:/[a-z]/.test(t),hasNumber:/[0-9]/.test(t),hasSpecialChar:/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/.test(t)};n.minLength||e.push(`At least ${gD} characters`),n.hasUppercase||e.push("One uppercase letter (A-Z)"),n.hasLowercase||e.push("One lowercase letter (a-z)"),n.hasNumber||e.push("One number (0-9)"),n.hasSpecialChar||e.push("One special character (!@#$%^&*)");let r=0;n.minLength&&r++,n.hasUppercase&&n.hasLowercase&&r++,n.hasNumber&&r++,n.hasSpecialChar&&r++,t.length>=12&&r++;const i=Math.min(Math.max(r,0),4);return{isValid:n.minLength&&n.hasUppercase&&n.hasLowercase&&n.hasNumber&&n.hasSpecialChar,score:i,feedback:e,requirements:n}}function Xle(t){switch(t){case 0:return"Very Weak";case 1:return"Weak";case 2:return"Fair";case 3:return"Good";case 4:return"Strong"}}function Zle(t){switch(t){case 0:case 1:return"text-destructive";case 2:return"text-orange-500";case 3:return"text-yellow-500";case 4:return"text-green-500"}}function Qle(t){switch(t){case 0:case 1:return"bg-destructive";case 2:return"bg-orange-500";case 3:return"bg-yellow-500";case 4:return"bg-green-500"}}function iU({strength:t,password:e}){if(!e)return null;const n=Xle(t.score),r=Zle(t.score),i=Qle(t.score),a=`${t.score/4*100}%`;return l.jsxs("div",{className:"space-y-3 animate-fade-in",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex items-center justify-between text-xs",children:[l.jsx("span",{className:"text-muted-foreground",children:"Password Strength"}),l.jsx("span",{className:`font-medium ${r}`,children:n})]}),l.jsx("div",{className:"h-2 w-full bg-muted rounded-full overflow-hidden",children:l.jsx("div",{className:`h-full ${i} transition-all duration-300 ease-out`,style:{width:a}})})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Requirements:"}),l.jsx(Jf,{met:t.requirements.minLength,text:"At least 8 characters"}),l.jsx(Jf,{met:t.requirements.hasUppercase,text:"One uppercase letter (A-Z)"}),l.jsx(Jf,{met:t.requirements.hasLowercase,text:"One lowercase letter (a-z)"}),l.jsx(Jf,{met:t.requirements.hasNumber,text:"One number (0-9)"}),l.jsx(Jf,{met:t.requirements.hasSpecialChar,text:"One special character (!@#$%^&*)"})]})]})}function Jf({met:t,text:e}){return l.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[t?l.jsx(_s,{className:"w-3.5 h-3.5 text-green-500 shrink-0"}):l.jsx(vo,{className:"w-3.5 h-3.5 text-muted-foreground shrink-0"}),l.jsx("span",{className:t?"text-foreground":"text-muted-foreground",children:e})]})}const eue=zg("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Sc=b.forwardRef(({className:t,variant:e,...n},r)=>l.jsx("div",{ref:r,role:"alert",className:ce(eue({variant:e}),t),...n}));Sc.displayName="Alert";const tue=b.forwardRef(({className:t,...e},n)=>l.jsx("h5",{ref:n,className:ce("mb-1 font-medium leading-none tracking-tight",t),...e}));tue.displayName="AlertTitle";const no=b.forwardRef(({className:t,...e},n)=>l.jsx("div",{ref:n,className:ce("text-sm [&_p]:leading-relaxed",t),...e}));no.displayName="AlertDescription";const nue=({open:t,onOpenChange:e,linkType:n,onGenerate:r,isGenerating:i=!1})=>{const[a,s]=b.useState("none"),[o,c]=b.useState(""),[u,d]=b.useState(""),[h,f]=b.useState(!1),[p,g]=b.useState(!1),[m,v]=b.useState(""),x=rU(o),w=()=>
655{if(v(""),a==="password"){if(!x.isValid){v("Password does not meet security requirements");return}if(o!==u){v("Passwords do not match");return}r(o)}else r();s("none"),c(""),d("")},y=()=>{s("none"),c(""),d(""),f(!1),g(!1),v(""),e(!1)};return l.jsx(Za,{open:t,onOpenChange:y,children:l.jsxs(Ts,{className:"max-w-md max-h-[90vh] overflow-y-auto",children:[l.jsxs(na,{children:[l.jsxs(ra,{className:"text-xl",children:["Generate ",n==="viewer"?"Viewer":"Editor"," Link"]}),l.jsx(Es,{children:"Choose whether to protect this link with a password"})]}),l.jsxs("div",{className:"space-y-6 py-4",children:[l.jsxs(Wj,{value:a,onValueChange:k=>s(k),children:[l.jsxs("div",{className:"flex items-start space-x-3 p-4 rounded-lg border-2 border-border hover:border-primary/50 transition-colors cursor-pointer",children:[l.jsx(Y0,{value:"none",id:"none",className:"mt-1"}),l.jsxs(yt,{htmlFor:"none",className:"flex-1 cursor-pointer",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx(K_,{className:"w-4 h-4 text-muted-foreground"}),l.jsx("span",{className:"font-semibold",children:"No Password"})]}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Anyone with the link can access the calendar"})]})]}),l.jsxs("div",{className:"flex items-start space-x-3 p-4 rounded-lg border-2 border-border hover:border-primary/50 transition-colors cursor-pointer",children:[l.jsx(Y0,{value:"password",id:"password",className:"mt-1"}),l.jsxs(yt,{htmlFor:"password",className:"flex-1 cursor-pointer",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx(xm,{className:"w-4 h-4 text-muted-foreground"}),l.jsx("span",{className:"font-semibold",children:"Password Protected"})]}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Require a strong password to access this calendar"})]})]})]}),a==="password"&&l.jsxs("div",{className:"space-y-4 animate-fade-in",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(yt,{htmlFor:"password-input",children:"Password"}),l.jsxs("div",{className:"relative",children:[l.jsx(qt,{id:"password-input",type:h?"text":"password",value:o,onChange:k=>{c(k.target.value),m&&v("")},placeholder:"Enter a strong password",className:"min-h-[44px] pr-10",autoComplete:"new-password"}),l.jsx(de,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 hover:bg-transparent",onClick:()=>f(!h),tabIndex:-1,children:h?l.jsx(uh,{className:"h-4 w-4 text-muted-foreground"}):l.jsx(go,{className:"h-4 w-4 text-muted-foreground"})})]})]}),o&&l.jsx(iU,{strength:x,password:o}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(yt,{htmlFor:"confirm-password",children:"Confirm Password"}),l.jsxs("div",{className:"relative",children:[l.jsx(qt,{id:"confirm-password",type:p?"text":"password",value:u,onChange:k=>{d(k.target.value),m&&v("")},placeholder:"Confirm password",className:"min-h-[44px] pr-10",autoComplete:"new-password"}),l.jsx(de,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 hover:bg-transparent",onClick:()=>g(!p),tabIndex:-1,children:p?l.jsx(uh,{className:"h-4 w-4 text-muted-foreground"}):l.jsx(go,{className:"h-4 w-4 text-muted-foreground"})})]})]}),o&&u&&o!==u&&l.jsx(Sc,{variant:"destructive",className:"py-2",children:l.jsx(no,{className:"text-sm",children:"Passwords do not match"})}),m&&l.jsx(Sc,{variant:"destructive",className:"py-2",children:l.jsx(no,{className:"text-sm",children:m})})]})]}),l.jsxs("div",{className:"flex gap-2 justify-end",children:[l.jsx(de,{variant:"outline",onClick:y,disabled:i,className:"min-h-[44px]",children:"Cancel"}),l.jsx(de,{onClick:w,disabled:i||a==="password"&&(!x.isValid||o!==u),className:"min-h-[44px]",children:i?"Generating...":"Generate Link"})]})]})})},rue={};var RC=null;function iue(t){try{return crypto.getRandomValues(new Uint8Array(t))}catch{}try{return rue.randomBytes(t)}catch{}if(!RC)throw Error("Neither WebCryptoAPI nor a crypto module is available. Use bcrypt.setRandomFallback to set an alternative");return RC(t)}function aU(t){RC=t}function fw(t,e){if(t=t||Kj,typeof t!="number")throw Error("Illegal arguments: "+typeof t+", "+typeof e);t<4?t=4:t>31&&(t=31);var n=[];return n.push("$2b$"),t<10&&n.push("0"),n.push(t.toString()),n.push("$"),n.push(J0(iue(Im),Im)),n.join("")}function Vj(t,e,n){if(typeof e=="function"&&(n=e,e=void 0),typeof t=="function"&&(n=t,t=void 0),typeof t>"u")t=Kj;else if(typeof t!="number")throw Error("illegal arguments: "+typeof t);function r(i){Ua(function(){try{i(null,fw(t))}catch(a){i(a)}})}if(n){if(typeof n!="function")throw Error("Illegal callback: "+typeof n);r(n)}else return new Promise(function(i,a){r(function(s,o){if(s){a(s);return}i(o)})})}function Hj(t,e){if(typeof e>"u"&&(e=Kj),typeof e=="number"&&(e=fw(e)),typeof t!="string"||typeof e!="string")throw Error("Illegal arguments: "+typeof t+", "+typeof e);return DC(t,e)}function qj(t,e,n,r){function i(a){typeof t=="string"&&typeof e=="number"?Vj(e,function(s,o){DC(t,o,a,r)}):typeof t=="string"&&typeof e=="string"?DC(t,e,a,r):Ua(a.bind(this,Error("Illegal arguments: "+typeof t+", "+typeof e)))}if(n){if(typeof n!="function")throw Error("Illegal callback: "+typeof n);i(n)}
655else return new Promise(function(a,s){i(function(o,c){if(o){s(o);return}a(c)})})}function sU(t,e){for(var n=t.length^e.length,r=0;r<t.length;++r)n|=t.charCodeAt(r)^e.charCodeAt(r);return n===0}function oU(t,e){if(typeof t!="string"||typeof e!="string")throw Error("Illegal arguments: "+typeof t+", "+typeof e);return e.length!==60?!1:sU(Hj(t,e.substring(0,e.length-31)),e)}function cU(t,e,n,r){function i(a){if(typeof t!="string"||typeof e!="string"){Ua(a.bind(this,Error("Illegal arguments: "+typeof t+", "+typeof e)));return}if(e.length!==60){Ua(a.bind(this,null,!1));return}qj(t,e.substring(0,29),function(s,o){s?a(s):a(null,sU(o,e))},r)}if(n){if(typeof n!="function")throw Error("Illegal callback: "+typeof n);i(n)}else return new Promise(function(a,s){i(function(o,c){if(o){s(o);return}a(c)})})}function lU(t){if(typeof t!="string")throw Error("Illegal arguments: "+typeof t);return parseInt(t.split("$")[2],10)}function uU(t){if(typeof t!="string")throw Error("Illegal arguments: "+typeof t);if(t.length!==60)throw Error("Illegal hash length: "+t.length+" != 60");return t.substring(0,29)}function dU(t){if(typeof t!="string")throw Error("Illegal arguments: "+typeof t);return hU(t)>72}var Ua=typeof setImmediate=="function"?setImmediate:typeof scheduler
655=="object"&&typeof scheduler.postTask=="function"?scheduler.postTask.bind(scheduler):setTimeout;function hU(t){for(var e=0,n=0,r=0;r<t.length;++r)n=t.charCodeAt(r),n<128?e+=1:n<2048?e+=2:(n&64512)===55296&&(t.charCodeAt(r+1)&64512)===56320?(++r,e+=4):e+=3;return e}function aue(t){for(var e=0,n,r,i=new Array(hU(t)),a=0,s=t.length;a<s;++a)n=t.charCodeAt(a),n<128?i[e++]=n:n<2048?(i[e++]=n>>6|192,i[e++]=n&63|128):(n&64512)===55296&&((r=t.charCodeAt(a+1))&64512)===56320?(n=65536+((n&1023)<<10)+(r&1023),++a,i[e++]=n>>18|240,i[e++]=n>>12&63|128,i[e++]=n>>6&63|128,i[e++]=n&63|128):(i[e++]=n>>12|224,i[e++]=n>>6&63|128,i[e++]=n&63|128);return i}var Vu="./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),Ro=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,54,55,56,57,58,59,60,61,62,63,-1,-1,-1,-1,-1,-1,-1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,-1,-1,-1,-1,-1,-1,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,-1,-1,-1,-1,-1];function J0(t,e){var n=0,r=[],i,a;if(e<=0||e>t.length)throw Error("Illegal len: "+e);for(;n<e;){if(i=t[n++]&255,r.push(Vu[i>>2&63]),i=(i&3)<<4,n>=e){r.push(Vu[i&63]);break}if(a=t[n++]&255,i|=a>>4&15,r.push(Vu[i&63]),i=(a&15)<<2,n>=e){r.push(Vu[i&63]);break}a=t[n++]&255,i|=a>>6&3,r.push(Vu[i&63]),r.push(Vu[a&63])}return r.join("")}function fU(t,e){var n=0,r=t.length,i=0,a=[],s,o,c,u,d,h;if(e<=0)throw Error("Illegal len: "+e);for(;n<r-1&&i<e&&(h=t.charCodeAt(n++),s=h<Ro.length?Ro[h]:-1,h=t.charCodeAt(n++),o=h<Ro.length?Ro[h]:-1,!(s==-1||o==-1||(d=s<<2>>>0,d|=(o&48)>>4,a.push(String.fromCharCode(d)),++i>=e||n>=r)||(h=t.charCodeAt(n++),c=h<Ro.length?Ro[h]:-1,c==-1)||(d=(o&15)<<4>>>0,d|=(c&60)>>2,a.push(String.fromCharCode(d)),++i>=e||n>=r)));)h=t.charCodeAt(n++),u=h<Ro.length?Ro[h]:-1,d=(c&3)<<6>>>0,d|=u,a.push(String.fromCharCode(d)),++i;var f=[];for(n=0;n<i;n++)f.push(a[n].charCodeAt(0));return f}var Im=16,Kj=10,sue=16,oue=100,vD=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],yD=[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850
655592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946,1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055,3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,
6551797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504,976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462],pU=[1332899944,1700884034,1701343084,1684370003,1668446532,1869963892];function Lm(t,e,n,r){var i,a=t[e],s=t[e+1];return a^=n[0],i=r[a>>>24],i+=r[256|a>>16&255],i^=r[512|a>>8&255],i+=r[768|a&255],s^=i^n[1],i=r[s>>>24],i+=r[256|s>>16&255],i^=r[512|s>>8&255],i+=r[768|s&255],a^=i^n[2],i=r[a>>>24],i+=r[256|a>>16&255],i^=r[512|a>>8&255],i+=r[768|a&255],s^=i^n[3],i=r[s>>>24],i+=r[256|s>>16&255],i^=r[512|s>>8&255],i+=r[768|s&255],a^=i^n[4],i=r[a>>>24],i+=r[256|a>>16&255],i^=r[512|a>>8&255],i+=r[768|a&255],s^=i^n[5],i=r[s>>>24],i+=r[256|s>>16&255],i^=r[512|s>>8&255],i+=r[768|s&255],a^=i^n[6],i=r[a>>>24],i+=r[256|a>>16&255],i^=r[512|a>>8&255],i+=r[768|a&255],s^=i^n[7],i=r[s>>>24],i+=r[256|s>>16&255],i^=r[512|s>>8&255],i+=r[768|s&255],a^=i^n[8],i=r[a>>>24],i+=r[256|a>>16&255],i^=r[512|a>>8&255],i+=r[768|a&255],s^=i^n[9],i=r[s>>>24],i+=r[256|s>>16&255],i^=r[512|s>>8&255],i+=r[768|s&255],a^=i^n[10],i=r[a>>>24],i+=r[256|a>>16&255],i^=r[512|a>>8&255],i+=r[768|a&255],s^=i^n[11],i=r[s>>>24],i+=r[256|s>>16&255],i^=r[512|s>>8&255],i+=r[768|s&255],a^=i^n[12],i=r[a>>>24],i+=r[256|a>>16&255],i^=r[512|a>>8&255],i+=r[768|a&255],s^=i^n[13],i=r[s>>>24],i+=r[256|s>>16&255],i^=r[512|s>>8&255],i+=r[768|s&255],a^=i^n[14],i=r[a>>>24],i+=r[256|a>>16&255],i^=r[512|a>>8&255],i+=r[768|a&255],s^=i^n[15],i=r[s>>>24],i+=r[256|s>>16&255],i^=r[512|s>>8&255],i+=r[768|s&255],a^=i^n[16],t[e]=s^n[sue+1],t[e+1]=a,t}
655function nd(t,e){for(var n=0,r=0;n<4;++n)r=r<<8|t[e]&255,e=(e+1)%t.length;return{key:r,offp:e}}function bD(t,e,n){for(var r=0,i=[0,0],a=e.length,s=n.length,o,c=0;c<a;c++)o=nd(t,r),r=o.offp,e[c]=e[c]^o.key;for(c=0;c<a;c+=2)i=Lm(i,0,e,n),e[c]=i[0],e[c+1]=i[1];for(c=0;c<s;c+=2)i=Lm(i,0,e,n),n[c]=i[0],n[c+1]=i[1]}function cue(t,e,n,r){for(var i=0,a=[0,0],s=n.length,o=r.length,c,u=0;u<s;u++)c=nd(e,i),i=c.offp,n[u]=n[u]^c.key;for(i=0,u=0;u<s;u+=2)c=nd(t,i),i=c.offp,a[0]^=c.key,c=nd(t,i),i=c.offp,a[1]^=c.key,a=Lm(a,0,n,r),n[u]=a[0],n[u+1]=a[1];for(u=0;u<o;u+=2)c=nd(t,i),i=c.offp,a[0]^=c.key,c=nd(t,i),i=c.offp,a[1]^=c.key,a=Lm(a,0,n,r),r[u]=a[0],r[u+1]=a[1]}function xD(t,e,n,r,i){var a=pU.slice(),s=a.length,o;if(n<4||n>31)if(o=Error("Illegal number of rounds (4-31): "+n),r){Ua(r.bind(this,o));return}else throw o;if(e.length!==Im)if(o=Error("Illegal salt length: "+e.length+" != "+Im),r){Ua(r.bind(this,o));return}else throw o;n=1<<n>>>0;var c,u,d=0,h;typeof Int32Array=="function"?(c=new Int32Array(vD),u=new Int32Array(yD)):(c=vD.slice(),u=yD.slice()),cue(e,t,c,u);function f(){if(i&&i(d/n),d<n)for(var g=Date.now();d<n&&(d=d+1,bD(t,c,u),bD(e,c,u),!(Date.now()-g>oue)););else{for(d=0;d<64;d++)for(h=0;h<s>>1;h++)Lm(a,h<<1,c,u);var m=[];for(d=0;d<s;d++)m.push((a[d]>>24&255)>>>0),m.push((a[d]>>16&255)>>>0),m.push((a[d]>>8&255)>>>0),m.push((a[d]&255)>>>0);if(r){r(null,m);return}else return m}r&&Ua(f)}if(typeof r<"u")f();else for(var p;;)if(typeof(p=f())<"u")return p||[]}function DC(t,e,n,r){var i;if(typeof t!="string"||typeof e!="string")if(i=Error("Invalid string / salt: Not a string"),n){Ua(n.bind(this,i));return}else throw i;var a,s;if(e.charAt(0)!=="$"||e.charAt(1)!=="2")if(i=Error("Invalid salt version: "+e.substring(0,2)),n){Ua(n.bind(this,i));return}else throw i;if(e.charAt(2)==="$")a="\0",s=3;else{if(a=e.charAt(2),a!=="a"&&a!=="b"&&a!=="y"||e.charAt(3)!=="$")if(i=Error("Invalid salt revision: "+e.substring(2,4)),n){Ua(n.bind(this,i));return}else throw i;s=4}if(e.charAt(s+2)>"$")if(i=Error("Missing salt rounds"),n){Ua(n.bind(this,i));return}else throw i;var o=parseInt(e.substring(s,s+1),10)*10,c=parseInt(e.substring(s+1,s+2),10),u=o+c,d=e.substring(s+3,s+25);t+=a>="a"?"\0":"";var h=aue(t),f=fU(d,Im);function p(g){var m=[];return m.push("$2"),a>="a"&&m.push(a),m.push("$"),u<10&&m.push("0"),m.push(u.toString()),m.push("$"),m.push(J0(f,f.length)),m.push(J0(g,pU.length*4-1)),m.join("")}if(typeof n>"u")return p(xD(h,f,u));xD(h,f,u,function(g,m){g?n(g,null):n(null,p(m))},r)}function mU(t,e){return J0(t,e)}function gU(t,e){return fU(t,e)}const MC={setRandomFallback:aU,genSaltSync:fw,genSalt:Vj,hashSync:Hj,hash:qj,compareSync:oU,compare:cU,getRounds:lU,getSalt:uU,truncates:dU,encodeBase64:mU,decodeBase64:gU},lue=Object.freeze(Object.defineProperty({__proto__:null,compare:cU,compareSync:oU,decodeBase64:gU,default:MC,encodeBase64:mU,genSalt:Vj,genSaltSync:fw,getRounds:lU,getSalt:uU,hash:qj,hashSync:Hj,setRandomFallback:aU,truncates:dU},Symbol.toStringTag,{value:"Module"}));function uue({open:t,onOpenChange:e,linkId:n,hasPassword:r,onSuccess:i}){const[a,s]=b.useState(""),[o,c]=b.useState(""),[u,d]=b.useState(!1),[h,f]=b.useState(!1),[p,g]=b.useState(!1),[m,v]=b.useState(""),x=rU(a),w=async()=>{g(!0);try{const{error:_}=await me.from("calendar_links").update({password_hash:null}).eq("id",n);if(_)throw _;i(),e(!1),k()}catch(_){v("Failed to remove password. Please try again."),console.error("Failed to remove password:",_)}finally{g(!1)}},y=async()=>{if(v(""),!x.isValid){v("Password does not meet security requirements");return}if(a!==o){v("Passwords do not match");return}g(!0);try{const _=await MC.genSalt(10),C=await MC.hash(a,_),{error:T}=await me.from("calendar_links").update({password_hash:C}).eq("id",n);if(T)throw T;i(),e(!1),k()}catch(_){v("Failed to update password. Please try again."),console.error("Failed to update password:",_)}finally{g(!1)}},k=()=>{s(""),c(""),d(!1),f(!1),v("")},S=()=>{k(),e(!1)};return l.jsx(Za,{open:t,onOpenChange:S,children:l.jsxs(Ts,{className:"sm:max-w-[500px] md:max-w-[540px] max-h-[90vh] overflow-y-auto",children:[l.jsx(na,{className:"space-y-3",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"w-10 h-10 rounded-full bg-primary/10 flex items-center justify-center",children:l.jsx(E0,{className:"w-5 h-5 text-primary"})}),l.jsxs("div",{className:"flex-1",children:[l.jsx(ra,{className:"text-xl",children:"Manage Link Password"}),l.jsx(Es,{className:"text-sm",children:r?"Update or remove password protection":"Add password protection to secure this link"})]})]})}),l.jsx(Sc,{className:r?"border-primary/20 bg-primary/5":"border-muted",children:l.jsx("div",{className:"flex items-center gap-2",children:r?l.jsxs(l.Fragment,{children:[l.jsx(xm,{className:"h-4 w-4 text-primary"}),l.jsx(no,{className:"text-sm font-medium",children:"This link is currently password-protected"})]}):l.jsxs(l.Fragment,{children:[l.jsx(K_,{className:"h-4 w-4 text-muted-foreground"}),l.jsx(no,{className:"text-sm text-muted-foreground",children:"This link has no password protection"})]})})}),l.jsxs("div",{className:"space-y-4 py-2",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(yt,{htmlFor:"new-password",className:"text-sm font-medium",children:"New Password"}),l.jsxs("div",{className:"relative",children:[l.jsx(qt,{id:"new-password",type:u?"text":"password",placeholder:"Enter a strong password",value:a,onChange:_=>{s(_.target.value),m&&v("")},disabled:p,className:"pr-10"}),l.jsx(de,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>d(!u),disabled:p,children:u?l.jsx(uh,{className:"h-4 w-4 text-muted-foreground"}):l.jsx(go,{className:"h-4 w-4 text-muted-foreground"})})]})]}),a&&l.jsx(iU,{strength:x,password:a}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(yt,{htmlFor:"confirm-password",className:"text-sm font-medium",children:"Confirm Password"}),l.jsxs("div",{className:"relative",children:[l.jsx(qt,{id:"confirm-password",type:h?"text":"password",placeholder:"Confirm new password",value:o,onChange:_=>{c(_.target.value),m&&v("")},disabled:p,className:"pr-10"}),l.jsx(de,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>f(!h),disabled:p,children:h?l.jsx(uh,{className:"h-4 w-4 text-muted-foreground"}):l.jsx(go,{className:"h-4 w-4 text-muted-foreground"})})]})]}),a&&o&&a!==o&&l.jsx(Sc,{variant:"destructive",className:"py-2",children:l.jsx(no,{className:"text-xs",children:"Passwords do not match"})}),m&&l.jsx(Sc,{variant:"destructive",className:"py-2",children:l.jsx(no,{className:"text-xs",children:m})})]}),l.jsxs(Zx,{className:"flex-col gap-2 sm:flex-col md:flex-row md:items-center",children:[r&&l.jsx(de,{variant:"destructive",onClick:w,disabled:p,className:"w-full md:w-auto md:mr-auto",children:p?l.jsxs(l.Fragment,{children:[l.jsx(Er,{className:"mr-2 h-4 w-4 animate-spin"}),"Removing..."]}):l.jsxs(l.Fragment,{children:[l.jsx(K_,{className:"mr-2 h-4 w-4"}),"Remove Password"]})}),l.jsxs("div",{className:"flex gap-2 w-full md:w-auto",children:[l.jsx(de,{variant:"outline",onClick:S,disabled:p,className:"flex-1 md:flex-initial md:min-w-[100px]",children:"Cancel"}),l.jsx(de,{onClick:y,disabled:p||!x.isValid||a!==o,className:"flex-1 md:flex-initial md:min-w-[140px] transition-all",children:p?l.jsxs(l.Fragment,{children:[l.jsx(Er,{className:"mr-2 h-4 w-4 animate-spin"}),r?"Updating...":"Adding..."]}):l.jsxs(l.Fragment,{children:[l.jsx(kZ,{className:"mr-2 h-4 w-4"}),r?"Change Password":"Add Password"]})})]})]})]})})}function Wt({className:t,...e}){return l.jsx("div",{className:ce("animate-pulse rounded-md bg-muted",t),...e})}function due(){return l.jsx("div",{className:"min-h-screen bg-background p-4 md:p-8 pb-24 md:pb-8",children:l.jsxs("div",{className:"max-w-6xl mx-auto",children:[l.jsxs("div",{className:"flex flex-col gap-6 mb-8 md:gap-8 md:mb-12",children:[l.jsxs("div",{className:"flex justify-between items-center gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Wt,{className:"w-8 h-8 rounded-lg"}),l.jsx(Wt,{className:"h-7 w-28 md:h-10 md:w-36"})]}),l.jsx(Wt,{className:"h-11 w-11 md:w-24 rounded-md"})]}),l.jsx(Wt,{className:"rounded-xl h-[140px] md:h-[180px] w-full bg-gradient-to-br from-muted via-muted/80 to-muted/60"}),l.jsx(Wt,{className:"h-6 w-32 md:h-8 md:w-40 mt-2"})]}),l.jsx("div",{className:"grid gap-6 md:gap-8 lg:grid-cols-2",children:[1,2].map(t=>l.jsx(rt,{className:"overflow-hidden",children:l.jsx(ht,{className:"p-5 md:p-10",children:l.jsxs("div",{className:"space-y-5 md:space-y-6",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(Wt,{className:"w-1.5 h-8 rounded-full"}),l.jsx(Wt,{className:"h-6 w-40 md:h-7 md:w-52"})]}),l.jsx(Wt,{className:"h-4 w-64 ml-[22px]"})]}),l.jsx("div",{className:"flex flex-col gap-3",children:l.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[l.jsx(Wt,{className:"h-12 rounded-md"}),l.jsx(Wt,{className:"h-12 rounded-md"})]})}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(Wt,{className:"h-4 w-24"}),l.jsx(Wt,{className:"h-10 w-full rounded-md"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(Wt,{className:"h-4 w-24"}),l.jsx(Wt,{className:"h-10 w-full rounded-md"})]})]})]})})},t))})]})})}const hue=tw({name:Ka().trim().min(1,{message:"Calendar name is required"}).max(100,{message:"Name must be less than 100 characters"}),description:Ka().trim().max(500,{message:"Description must be less than 500 characters"}).optional()});function fue(){var Ct;const[t,e]=b.useState([]),[n,r]=b.useState({}),[i,a]=b.useState(!0),[s,o]=b.useState(!1),[c,u]=b.useState(""),[d,h]=b.useState(""),[f,p]=b.useState(Intl.DateTimeFormat().resolvedOptions().timeZone),[g,m]=b.useState(!1),[v,x]=b.useState(!1),[w,y]=b.useState(null),[k,S]=b.useState(""),[_,C]=b.useState(""),[T,E]=b.useState(!1),[j,P]=b.useState(null),[M,U]=b.useState({open:!1,calendarId:null,linkType:null}),[N,B]=b.useState({open:!1,linkId:null,hasPassword:!1,calendarId:null}),[$,I]=b.useState(!1),[R,z]=b.useState({open:!1,calendar:null}),[O,A]=b.useState(!1),[L,V]=b.useState(null),[Y,Q]=b.useState(!1),{user:re,loading:J,refreshing:ne,signOut:G}=sa(),{isAdmin:Z}=$j();Jce();const ee=rr(),K=b.useRef(null);b.useEffect(()=>{if(!(J||ne)){if(!re){ee("/auth");return}oe()}},[re,J,ne,ee]),b.useEffect(()=>{const le=new IntersectionObserver(([Pe])=>{console.log("Create button visible:",Pe.isIntersecting),console.log("Should show FAB:",!Pe.isIntersecting),E(!Pe.isIntersecting)},{threshold:0,rootMargin:"0px"}),Te=K.current;return console.log("Create button ref:",Te),Te&&le.observe(Te),()=>{Te&&le.unobserve(Te)}},[t]);const oe=async()=>{const{data:le,error:Te}=await me.from("calendars").select("*").order("created_at",{ascending:!1});Te?console.error("Error fetching calendars:",Te):(e(le||[]),le==null||le.forEach(Pe=>W(Pe.id))),a(!1)},W=async le=>{const{data:Te,error:Pe}=await me.from("calendar_links").select("id, link_type, access_code, is_active, created_at, calendar_id").eq("calendar_id",le);if(!Pe&&Te){const st=await Promise.all(Te.map(async Mt=>{var Kn;const{data:yn}=await me.rpc("check_calendar_link_public",{_access_code:Mt.access_code});return{...Mt,has_password:((Kn=yn==null?void 0:yn[0])==null?void 0:Kn.requires_password)??!1}}));r(Mt=>({...Mt,[le]:st}))}},H=async()=>{try{const le=hue.parse({name:c,description:d||void 0});m(!0),S(""),C("");const{data:Te,error:Pe}=await me.from("calendars").insert([{name:le.name,description:le.description||null,user_id:re.id}]).select().single();m(!1),Pe?console.error("Error creating calendar:",Pe):(e([Te,...t]),y(Te.id),x(!0),setTimeout(()=>{u(""),h(""),S(""),C("")},300))}catch(le){if(le instanceof Oi){const Te=le.errors[0];Te.path.includes("name")?S(Te.message):Te.path.includes("description")&&C(Te.message)}m(!1)}},q=()=>{o(!1),x(!1),y(null),u(""),h(""),S(""),C("")},te=le=>{w&&(q(),le==="open"?ee(`/calendar/owner/${w}`):le==="event"?ee(`/calendar/owner/${w}`):le==="share"&&he(w,"viewer"))}
655,he=async(le,Te,Pe)=>{I(!0);const st=`${Te}_${Math.random().toString(36).substring(2,15)}${Math.random().toString(36).substring(2,15)}`,Mt=await Gce(()=>Promise.resolve().then(()=>lue),void 0),yn=Pe?await Mt.hash(Pe,10):null,{data:Kn,error:an}=await me.from("calendar_links").insert([{calendar_id:le,link_type:Te,access_code:st,password_hash:yn}]).select().single();I(!1),U({open:!1,calendarId:null,linkType:null}),an?console.error("Error generating link:",an):W(le)},xe=le=>{const Te=`${window.location.origin}/calendar/${le}`;navigator.clipboard.writeText(Te),P(le),setTimeout(()=>P(null),2e3)},De=async(le,Te)=>{const{error:Pe}=await me.from("calendar_links").update({is_active:!1}).eq("id",le);Pe?console.error("Error revoking link:",Pe):W(Te)},ge=async le=>{A(!0),z({open:!1,calendar:null}),V(le),await new Promise(Pe=>setTimeout(Pe,300));const{error:Te}=await me.from("calendars").delete().eq("id",le);A(!1),Te?(console.error("Error deleting calendar:",Te),V(null)):(e(t.filter(Pe=>Pe.id!==le)),r(Pe=>{const st={...Pe};return delete st[le],st}),V(null),Q(!0),setTimeout(()=>Q(!1),1500))},[Re,Oe]=b.useState(!1);return b.useEffect(()=>{const le=setTimeout(()=>{Oe(!0)},5e3);return()=>clearTimeout(le)},[]),J&&!ne&&!Re?l.jsx(due,{}):l.jsxs("div",{className:"min-h-screen bg-background p-4 md:p-8 pb-24 md:pb-8 relative overflow-x-hidden",children:[Y&&l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center pointer-events-none",children:l.jsxs("div",{className:"bg-foreground text-background px-6 py-4 rounded-2xl shadow-2xl flex items-center gap-3 animate-scale-in",children:[l.jsx(p$,{className:"w-6 h-6 text-green-400"}),l.jsx("span",{className:"text-lg font-medium",children:"Deleted!"})]})}),l.jsx(es,{canonical:"https://careable.co/dashboard",title:"Dashboard",description:"Manage your calendars, create events with AI, and share with family and caregivers."}),l.jsxs("div",{className:"max-w-6xl mx-auto",children:[l.jsxs("div",{className:"flex flex-col gap-6 mb-8 md:gap-8 md:mb-12",children:[l.jsxs("div",{className:"flex justify-between items-center gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("div",{className:"relative",children:[l.jsx("img",{src:"/careable-icon.png?v=11",alt:"Caréable",className:"w-8 h-8 rounded-full transition-all duration-300"}),ne&&l.jsx("div",{className:"absolute -top-1 -right-1 w-4 h-4 rounded-full bg-calendar-blue flex items-center justify-center animate-pulse",children:l.jsx(dh,{className:"w-2.5 h-2.5 text-white animate-spin"})})]}),l.jsx("h1",{className:"text-xl font-bold md:text-4xl",children:"Caréable"}),ne&&l.jsx("span",{className:"text-xs text-muted-foreground animate-pulse hidden sm:inline",children:"Syncing..."})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[Z&&l.jsxs(de,{variant:"outline",onClick:()=>ee("/admin"),className:"min-h-[44px] px-3 border-primary/20 hover:bg-primary/5",children:[l.jsx(wm,{className:"w-4 h-4 md:mr-2 text-primary"}),l.jsx("span",{className:"hidden md:inline text-sm",children:"Admin"})]}),l.jsxs(de,{variant:"ghost",onClick:()=>ee("/settings"),className:"text-muted-foreground hover:text-foreground min-h-[44px] px-3",children:[l.jsx(SZ,{className:"w-4 h-4 md:mr-2"}),l.jsx("span",{className:"hidden md:inline text-sm",children:"Settings"})]}),l.jsxs(de,{variant:"ghost",onClick:G,className:"text-muted-foreground hover:text-foreground min-h-[44px] px-3",children:[l.jsx(lZ,{className:"w-4 h-4 md:mr-2"}),l.jsx("span",{className:"hidden md:inline text-sm",children:"Sign Out"})]})]})]}),l.jsx("div",{ref:K,children:l.jsxs(Za,{open:s,onOpenChange:o,children:[l.jsx(Oj,{asChild:!0,children:l.jsxs("div",{className:"p-6 md:p-12 cursor-pointer transition-all hover:scale-[1.02] active:scale-[0.98] min-h-[140px] flex flex-col items-center justify-center text-center space-y-2 md:space-y-3 group touch-manipulation",children:[l.jsx("div",{className:"bg-gradient-to-br from-calendar-oatmeal via-calendar-peach to-calendar-blue-light rounded-full p-3 md:p-4 group-hover:opacity-90 transition-opacity",children:l.jsx(ta,{className:"w-7 h-7 md:w-10 md:h-10 text-white animate-pulse"})}),l.jsxs("div",{className:"space-y-0.5 md:space-y-1",children:[l.jsx("h3",{className:"text-lg md:text-2xl font-semibold text-foreground",children:"Create New Calendar"}),l.jsx("p",{className:"text-xs md:text-base text-muted-foreground px-2",children:"start a care-able schedule"})]})]})}),l.jsxs(Ts,{className:"bg-background border-none max-w-full sm:max-w-lg w-full h-full sm:h-auto sm:max-h-[90vh] p-6 sm:p-8 flex flex-col [&>button[class*='absolute'][class*='ring-offset-background']]:hidden overflow-y-auto",children:[l.jsx("button",{onClick:q,className:"absolute top-4 right-4 w-10 h-10 rounded-full bg-muted hover:bg-muted-foreground
655/20 flex items-center justify-center transition-all duration-200 hover:rotate-90 z-50 touch-manipulation","aria-label":"Close dialog",children:l.jsx(vo,{className:"w-5 h-5 text-foreground",strokeWidth:2.5})}),v?l.jsxs("div",{className:"flex flex-col items-center justify-center space-y-5 sm:space-y-6 animate-scale-in flex-1",children:[l.jsx("span",{className:"text-5xl sm:text-6xl animate-bounce",children:"ð"}),l.jsxs("div",{className:"text-center space-y-1.5 sm:space-y-2 px-4",children:[l.jsx("h3",{className:"text-xl sm:text-2xl md:text-3xl font-bold text-foreground",children:"Calendar Created!"}),l.jsx("p",{className:"text-sm sm:text-base text-foreground/80",children:"Your calendar is ready to use"})]}),l.jsxs("div",{className:"w-full space-y-2.5 sm:space-y-3 px-4 sm:px-0",children:[l.jsxs(de,{onClick:()=>te("open"),className:"w-full min-h-[52px] bg-white text-primary hover:bg-white/90 text-base font-semibold touch-manipulation",children:[l.jsx(jO,{className:"w-4 h-4 mr-2"}),"Open Calendar"]}),l.jsxs("div",{className:"grid grid-cols-2 gap-2.5 sm:gap-3",children:[l.jsxs(de,{onClick:()=>te("event"),variant:"outline",className:"min-h-[48px] bg-white/10 text-foreground border-white/30 hover:bg-white/20 hover:text-foreground text-sm touch-manipulation",children:[l.jsx(pl,{className:"w-4 h-4 mr-1.5"}),"Add Event"]}),l.jsxs(de,{onClick:()=>te("share"),variant:"outline",className:"min-h-[48px] bg-white/10 text-foreground border-white/30 hover:bg-white/20 hover:text-foreground text-sm touch-manipulation",children:[l.jsx(Pd,{className:"w-4 h-4 mr-1.5"}),"Share Link"]})]})]})]}):l.jsxs(l.Fragment,{children:[l.jsx(na,{className:"space-y-3",children:l.jsx(ra,{className:"text-foreground text-xl sm:text-2xl md:text-3xl",children:"Create New Calendar"})}),l.jsxs("div",{className:"space-y-5 py-6 flex-1 overflow-y-auto overflow-x-visible px-1",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex justify-between items-center mb-1",children:[l.jsx("label",{htmlFor:"name",className:"text-xs sm:text-sm font-medium text-foreground",children:"Calendar Name *"}),l.jsxs("span",{className:"text-[10px] sm:text-xs text-foreground/60",children:[c.length,"/50"]})]}),l.jsx("input",{id:"name",value:c,onChange:le=>{u(le.target.value),k&&S("")},onKeyDown:le=>{le.key==="Enter"&&!le.shiftKey&&(le.preventDefault(),H())},placeholder:"Family Care Calendar",maxLength:50,autoFocus:!0,className:`w-full px-3 sm:px-4 py-3 sm:py-3.5 border-2 ${k?"border-destructive bg-destructive/5":"border-input bg-background"} rounded-md min-h-[52px] placeholder:text-muted-foreground focus:outline-none focus:ring-4 focus:ring-primary/10 focus:border-primary/40 transition-all text-base touch-manipulation`,autoComplete:"off"}),k&&l.jsx("p",{className:"text-[10px] sm:text-xs text-destructive bg-destructive/10 px-2.5 sm:px-3 py-1.5 rounded animate-fade-in",children:k})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex justify-between items-center mb-1",children:[l.jsx("label",{htmlFor:"description",className:"text-xs sm:text-sm font-medium text-foreground",children:"Description (Optional)"}),l.jsxs("span",{className:"text-[10px] sm:text-xs text-foreground/60",children:[d.length,"/200"]})]}),l.jsx("textarea",{id:"description",value:d,onChange:le=>{h(le.target.value),_&&C("")},placeholder:"Track medication schedules and appointments",maxLength:200,className:`w-full px-3 sm:px-4 py-3 border-2 ${_?"border-destructive bg-destructive/5":"border-input bg-background"} rounded-md min-h-[100px] resize-none placeholder:text-muted-foreground focus:outline-none focus:ring-4 focus:ring-primary/10 focus:border-primary/40 transition-all text-base touch-manipulation`,rows:3,autoComplete:"off"}),_&&l.jsx("p",{className:"text-[10px] sm:text-xs text-destructive bg-destructive/10 px-2.5 sm:px-3 py-1.5 rounded animate-fade-in",children:_})]}),l.jsxs("div",{className:"space-y-2 -mx-1",children:[l.jsx("label",{htmlFor:"timezone",className:"text-xs sm:text-sm font-medium text-foreground block mb-1 px-1",children:"Timezone"}),l.jsx("div",{className:"px-1",children:l.jsxs(bh,{value:f,onValueChange:p,children:[l.jsx(au,{className:"w-full min-h-[52px] border-2 border-input bg-background rounded-md text-sm sm:text-base focus:ring-4 focus:ring-primary/10 focus:border-primary/40",children:l.jsx(xh,{placeholder:"Select timezone"})}),l.jsxs(su,{className:"bg-background border border-border max-h-[300px]",children:[l.jsxs(Bt,{value:Intl.DateTimeFormat().resolvedOptions().timeZone,children:[Intl.DateTimeFormat().resolvedOptions().timeZone," (Your timezone)"]}
655),l.jsx(Bt,{value:"America/New_York",children:"America/New_York (EST/EDT)"}),l.jsx(Bt,{value:"America/Chicago",children:"America/Chicago (CST/CDT)"}),l.jsx(Bt,{value:"America/Denver",children:"America/Denver (MST/MDT)"}),l.jsx(Bt,{value:"America/Los_Angeles",children:"America/Los_Angeles (PST/PDT)"}),l.jsx(Bt,{value:"Europe/London",children:"Europe/London (GMT/BST)"}),l.jsx(Bt,{value:"Europe/Paris",children:"Europe/Paris (CET/CEST)"}),l.jsx(Bt,{value:"Asia/Tokyo",children:"Asia/Tokyo (JST)"}),l.jsx(Bt,{value:"Australia/Sydney",children:"Australia/Sydney (AEST/AEDT)"})]})]})}),l.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground px-1",children:"Events will be displayed in this timezone"})]}),l.jsxs("div",{className:"bg-muted rounded-md p-3 sm:p-4 space-y-1.5 sm:space-y-2",children:[l.jsx("p",{className:"text-[10px] sm:text-xs text-foreground/90 font-medium",children:"ð¡ Tip:"}),l.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground leading-relaxed",children:"After creating your calendar, you can generate share links to collaborate with others. Viewer links allow read-only access, while editor links let others add and modify events."})]})]}),l.jsx(Zx,{className:"pt-4 sm:pt-6",children:l.jsx(de,{onClick:H,disabled:!c.trim()||g,className:"min-h-[52px] bg-white text-primary hover:bg-white/90 w-full text-base font-semibold touch-manipulation",children:g?l.jsxs(l.Fragment,{children:[l.jsx(dh,{className:"w-4 h-4 mr-2 animate-spin"}),"Creating..."]}):l.jsxs(l.Fragment,{children:[l.jsx(pl,{className:"w-4 h-4 mr-2"}),"Create Calendar"]})})})]})]})]})}),l.jsx("h2",{className:"text-lg font-semibold md:text-2xl mt-2",children:"My Calendars"})]}),l.jsx("div",{className:"grid gap-6 md:gap-8 lg:grid-cols-2",children:t.length===0?l.jsx(rt,{children:l.jsx(ot,{className:"pt-4 text-center text-muted-foreground text-sm md:pt-6 md:text-base",children:"No calendars yet. Create one to get started!"})}):t.map((le,Te)=>{var Mt,yn,Kn,an;const Pe=["hsl(var(--calendar-blue))","hsl(var(--calendar-coral))","hsl(var(--calendar-peach))","hsl(var(--calendar-mint))"],st=Pe[Te%Pe.length];return l.jsxs(rt,{className:`relative overflow-hidden transition-all duration-300 hover:shadow-lg group ${L===le.id?"animate-fade-out opacity-0 scale-95":"animate-fade-in"}`,style:{animationDelay:L===le.id?"0ms":`${Te*100}ms`},children:[l.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-calendar-blue/0 via-calendar-coral/0 via-calendar-peach/0 to-calendar-mint/0 group-hover:from-calendar-blue/5 group-hover:via-calendar-coral/5 group-hover:via-calendar-peach/5 group-hover:to-calendar-mint/5 transition-all duration-300 pointer-events-none"}),l.jsx(ht,{className:"p-5 md:p-10 relative z-10",children:l.jsxs("div",{className:"space-y-5 md:space-y-6",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"w-1.5 h-8 rounded-full flex-shrink-0",style:{backgroundColor:st}}),l.jsx(mt,{className:"text-xl md:text-2xl font-bold tracking-tight",children:le.name})]}),l.jsx(de,{variant:"ghost",size:"icon",onClick:()=>z({open:!0,calendar:le}),className:"h-9 w-9 flex-shrink-0 text-muted-foreground hover:text-destructive hover:bg-destructive/10 touch-manipulation",children:l.jsx(q2,{className:"w-4 h-4"})})]}),le.description&&l.jsx(tn,{className:"text-sm md:text-base mt-2 ml-[22px]",children:le.description})]}),l.jsx("div",{className:"flex flex-col gap-3",children:l.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[l.jsxs(de,{onClick:()=>ee(`/calendar/owner/${le.id}`),className:"min-h-[48px] text-sm touch-manipulation",children:[l.jsx(jO,{className:"w-4 h-4 mr-2"}),"Open"]}),l.jsxs(de,{variant:"outline",onClick:()=>ee(`/analytics/${le.id}`),className:"min-h-[48px] text-sm touch-manipulation",children:[l.jsx(h$,{className:"w-4 h-4 mr-2"}),"Analytics"]})]})})]})}),l.jsxs(ot,{className:"space-y-8 p-5 md:p-10 relative z-10 pt-0 md:pt-0",children:[l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0",style:{backgroundColor:"#C8D9E8"},children:l.jsx(go,{className:"w-4 h-4",style:{color:"#7A9BB8"}})}),l.jsxs("div",{children:[l.jsx("h4",{className:"text-sm font-semibold text-foreground",children:"Viewer Links"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"View-only access"})]})]}),!((Mt=n[le.id])!=null&&Mt.find(He=>He.link_type==="viewer"&&He.is_active))&&l.jsxs(de,{onClick:()=>U({open:!0,calendarId:le.id,linkType:"viewer"}),variant:"outline",className:"min-h-[44px] px-4 md:px-5 text-xs md:text-sm font-medium touch-manipulation border-2",style:{borderColor:"#8AACC8",color:"#7A9BB8"},children:[l.jsx(pl,{className:"w-4 h-4 md:mr-1.5"}),l.jsx("span",{className:"hidden md:inline",children:"Generate"})]})]}),(yn=n[le.id])==null?void 0:yn.filter(He=>He.link_type==="viewer"&&He.is_active).map(He=>l.jsx("div",{className:"rounded-lg border border-border bg-card overflow-hidden shadow-sm animate-fade-in",children:l.jsxs("div",{className:"p-3 md:p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[l.jsx(bm,{className:"w-4 h-4 text-muted-foreground mt-0.5"}),He.has_password&&l.jsx(xp,{children:l.jsxs(Bv,{children:[l.jsx(Uv,{asChild:!0,children:l.jsx(xm,{className:"w-3.5 h-3.5 text-primary"})}),l.jsx(wp,{children:l.jsx("p",{children:"Password protected"})})]})})]}),l.jsxs("code",{className:"text-[11px] md:text-xs text-foreground break-all leading-relaxed font-mono flex-1",children:[window.location.origin,"/calendar/",He.access_code]}),l.jsx(xp,{children:l.jsxs(Bv,{children:[l.jsx(Uv,{asChild:!0,children:l.jsx(de,{onClick:()=>B({open:!0,linkId:He.id,hasPassword:He.has_password,calendarId:le.id}),variant:"outline",size:"icon",className:"h-8 w-8 rounded-full border-2 border-[#8AACC8] text-[#7A9BB8] hover:bg-[#8AACC8]/10 flex-shrink-0",children:l.jsx(E0,{className:"w-4 h-4"})})}),l.jsx(wp,{children:l.jsx("p",{children:"Manage password"})})]})})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(mD,{url:`${window.location.origin}/calendar/${He.access_code}`,title:le.name,text:`Here's the schedule for ${le.name}`,className:"flex-1 md:flex-none md:w-auto md:px-5 text-xs md:text-sm font-medium border-2 border-[#8AACC8] text-[#7A9BB8] hover:bg-[#8AACC8]/5"}),l.jsx(de,{onClick:()=>xe(He.access_code),variant:"outline",className:`min-h-[44px] flex-1 md:flex-none md:w-auto md:px-5 text-xs md:text-sm font-medium touch-manipulation transition-all border-2 ${j===He.access_code?"border-green-500 text-green-600 bg-green-50":"border-[#8AACC8] text-[#7A9BB8] hover:bg-[#8AACC8]/5"}`,children:j===He.access_code?l.jsxs(l.Fragment,{children:[l.jsx(_s,{className:"w-4 h-4 mr-1.5"}),"Copied!"]}):l.jsxs(l.Fragment,{children:[l.jsx(Pd,{className:"w-4 h-4 mr-1.5"}),"Copy"]})}),l.jsx(de,{variant:"outline",onClick:()=>De(He.id,le.id),className:"min-h-[44px] px-4 text-xs md:text-sm touch-manipulation border-destructive/30 text-destructive hover:bg-destructive hover:text-destructive-foreground",children:"Revoke"})]})]})},He.id))]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0",style:{backgroundColor:"#F9E5D5"},children:l.jsx(Mx,{className:"w-4 h-4",style:{color:"#D4A78E"}})}),l.jsxs("div",{children:[l.jsx("h4",{className:"text-sm font-semibold text-foreground",children:"Editor Links"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Can add & edit events"})]})]}),!((Kn=n[le.id])!=null&&Kn.find(He=>He.link_type==="editor"&&He.is_active))&&l.jsxs(de,{onClick:()=>U({open:!0,calendarId:le.id,linkType:"editor"}),variant:"outline",className:"min-h-[44px] px-4 md:px-5 text-xs md:text-sm font-medium touch-manipulation border-2",style:{borderColor:"#E5C4A8",color:"#D4A78E"},children:[l.jsx(pl,{className:"w-4 h-4 md:mr-1.5"}),l.jsx("span",{className:"hidden md:inline",children:"Generate"})]})]}),(an=n[le.id])==null?void 0:an.filter(He=>He.link_type==="editor"&&He.is_active).map(He=>l.jsx("div",{className:"rounded-lg border border-border bg-card overflow-hidden shadow-sm animate-fade-in",children:l.jsxs("div",{className:"p-3 md:p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[l.jsx(bm,{className:"w-4 h-4 text-muted-foreground mt-0.5"}),He.has_password&&l.jsx(xp,{children:l.jsxs(Bv,{children:[l.jsx(Uv,{asChild:!0,children:l.jsx(xm,{className:"w-3.5 h-3.5 text-primary"})}),l.jsx(wp,{children:l.jsx("p",{children:"Password protected"})})]})})]}),l.jsxs("code",{className:"text-[11px] md:text-xs text-foreground break-all leading-relaxed font-mono flex-1",children:[window.location.origin,"/calendar/",He.access_code]}),l.jsx(xp,{children:l.jsxs(Bv,{children:[l.jsx(Uv,{asChild:!0,children:l.jsx(de,{onClick:()=>B({open:!0,linkId:He.id,hasPassword:He.has_password,calendarId:le.id}),variant:"outline",size:"icon",className:"h-8 w-8 rounded-full border-2 border-[#
655E5C4A8] text-[#D4A78E] hover:bg-[#E5C4A8]/10 flex-shrink-0",children:l.jsx(E0,{className:"w-4 h-4"})})}),l.jsx(wp,{children:l.jsx("p",{children:"Manage password"})})]})})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(mD,{url:`${window.location.origin}/calendar/${He.access_code}`,title:le.name,text:`Here's the schedule for ${le.name}`,className:"flex-1 md:flex-none md:w-auto md:px-5 text-xs md:text-sm font-medium border-2 border-[#E5C4A8] text-[#D4A78E] hover:bg-[#E5C4A8]/5"}),l.jsx(de,{onClick:()=>xe(He.access_code),variant:"outline",className:`min-h-[44px] flex-1 md:flex-none md:w-auto md:px-5 text-xs md:text-sm font-medium touch-manipulation transition-all border-2 ${j===He.access_code?"border-green-500 text-green-600 bg-green-50":"border-[#E5C4A8] text-[#D4A78E] hover:bg-[#E5C4A8]/5"}`,children:j===He.access_code?l.jsxs(l.Fragment,{children:[l.jsx(_s,{className:"w-4 h-4 mr-1.5"}),"Copied!"]}):l.jsxs(l.Fragment,{children:[l.jsx(Pd,{className:"w-4 h-4 mr-1.5"}),"Copy"]})}),l.jsx(de,{variant:"outline",onClick:()=>De(He.id,le.id),className:"min-h-[44px] px-4 text-xs md:text-sm touch-manipulation border-destructive/30 text-destructive hover:bg-destructive hover:text-destructive-foreground",children:"Revoke"})]})]})},He.id))]})]})]},le.id)})})]}),l.jsx("div",{className:"md:hidden",children:l.jsx("button",{onClick:()=>o(!0),className:`fixed bottom-6 right-6 w-16 h-16 bg-gradient-to-br from-calendar-blue via-calendar-coral to-calendar-peach rounded-full shadow-2xl flex items-center justify-center z-50 hover:scale-110 active:scale-95 touch-manipulation transition-all duration-300 ${T?"animate-bounce-in opacity-100 translate-y-0":"opacity-0 translate-y-20 pointer-events-none"}`,"aria-label":"Create new calendar",children:l.jsx(pl,{className:"w-7 h-7 text-white",strokeWidth:2.5})})}),M.calendarId&&M.linkType&&l.jsx(nue,{open:M.open,onOpenChange:le=>U({open:le,calendarId:null,linkType:null}),linkType:M.linkType,onGenerate:le=>he(M.calendarId,M.linkType,le),isGenerating:$}),N.linkId&&l.jsx(uue,{open:N.open,onOpenChange:le=>B({open:le,linkId:null,hasPassword:!1,calendarId:null}),linkId:N.linkId,hasPassword:N.hasPassword,onSuccess:()=>{N.calendarId&&W(N.calendarId)}}),l.jsx(Fj,{open:R.open,onOpenChange:le=>z({open:le,calendar:null}),children:l.jsxs(nw,{children:[l.jsxs(rw,{children:[l.jsx(aw,{children:"Delete Calendar"}),l.jsxs(sw,{children:['Are you sure you want to delete "',(Ct=R.calendar)==null?void 0:Ct.name,'"? This will permanently delete the calendar, all its events, and all shared links. This action cannot be undone.']})]}),l.jsxs(iw,{children:[l.jsx(cw,{disabled:O,children:"Cancel"}),l.jsx(ow,{onClick:()=>R.calendar&&ge(R.calendar.id),disabled:O,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:O?"Deleting...":"Delete"})]})]})})]})}const vU={romantic:{id:"romantic",name:"Romantic Pastels",description:"Soft, warm pastel tones",colors:{"nurse visit":"#E4D9EF",nurse:"#E4D9EF",nursing:"#E4D9EF",caregiver:"#E4D9EF","care aide":"#E4D9EF","nursing aide":"#E4D9EF","social worker":"#E4D9EF",helper:"#E4D9EF","support worker":"#E4D9EF","family care":"#E4D9EF","home care":"#E4D9EF","home health":"#E4D9EF","care visit":"#E4D9EF","support visit":"#E4D9EF","doctor visit":"#C8D9E8","doctor appointment":"#DCCEE4","hospital visit":"#C8D9E8",doctor:"#DCCEE4",dr:"#DCCEE4",physician:"#DCCEE4",hospital:"#C8D9E8",clinic:"#DCCEE4","medical appointment":"#DCCEE4","health check":"#DCCEE4",checkup:"#DCCEE4","check-up":"#DCCEE4","follow-up":"#DCCEE4",followup:"#DCCEE4",consultation:"#DCCEE4",revalidation:"#DCCEE4",rehabilitation:"#DCCEE4",rehab:"#DCCEE4","ms center training":"#DCCEE4","ms center":"#DCCEE4",ms:"#DCCEE4",training:"#DCCEE4",neurologist:"#C9B7D7",specialist:"#C9B7D7",cardiologist:"#C9B7D7",urologist:"#C9B7D7",ophthalmologist:"#C9B7D7",dermatologist:"#C9B7D7",psychiatrist:"#C9B7D7",psychologist:"#C9B7D7",therapist:"#C9B7D7",counselor:"#C9B7D7",physiotherapy:"#E4E8DE",physio:"#E4E8DE","physical therapy":"#E4E8DE","occupational therapy":"#E4E8DE","speech therapy":"#E4E8DE",wellness:"#E4E8DE",massage:"#E4E8DE",acupuncture:"#E4E8DE","cleaning lady":"#F9E5D5",cleaning:"#F9E5D5",housekeeping:"#F9E5D5",housekeeper:"#F9E5D5",familyhulp:"#F5D1C8","home support":"#F5D1C8","home help":"#F5D1C8","meal delivery":"#F5D1C8","meals on wheels":"#F5D1C8","elderly support":"#EFE8DB",elderly:"#EFE8DB","senior care":"#EFE8DB","dinner with friends":"#FFB5C5","lunch with friends":"#FFB5C5",friends:"#FFB5C5","family visit":"#F4DADF",family:"#F4DADF",visit:"#F4DADF",gathering:"#F4DADF",birthday:"#F4DADF",celebration:"#F4DADF","lunch with family":"#F5D7C6",lunch:"#F
6555D7C6",dinner:"#F5D7C6",breakfast:"#F5D7C6",meal:"#F5D7C6",coffee:"#F5D7C6",tea:"#F5D7C6","personal errand":"#F7E6E3",errand:"#F7E6E3",shopping:"#F7E6E3",groceries:"#F7E6E3","pharmacy pickup":"#F7E6E3","quality time":"#F4DADF",drive:"#DCDCCD",driving:"#DCDCCD","car transport":"#DCDCCD",transport:"#DCDCCD",transportation:"#DCDCCD",car:"#DCDCCD","car trip":"#DCDCCD",ride:"#DCDCCD",taxi:"#DCDCCD",uber:"#DCDCCD",lift:"#DCDCCD",pickup:"#D5D3C5","drop-off":"#D5D3C5","drop off":"#D5D3C5","mobility assistance":"#D5D3C5",mobility:"#D5D3C5","office tasks":"#B6A898",office:"#B6A898",admin:"#B6A898","desk work":"#B6A898",paperwork:"#C4A78D",administration:"#C4A78D",forms:"#C4A78D",billing:"#C4A78D",insurance:"#C4A78D",financial:"#C4A78D","general appointment":"#E7DFD7",appointment:"#E7DFD7",meeting:"#E7DFD7",meetings:"#E7DFD7",session:"#E7DFD7",meditation:"#E4E8DE",rest:"#EFE8DB",nap:"#EFE8DB",sleep:"#EFE8DB",walking:"#E4E8DE",exercise:"#E4E8DE",walk:"#E4E8DE",activity:"#E4E8DE","light activity":"#EFE8DB","home medical":"#E4D9EF","home medical visit":"#E4D9EF",medication:"#E4D9EF",prescription:"#E4D9EF","lab work":"#DCCEE4","blood test":"#DCCEE4","x-ray":"#DCCEE4",scan:"#DCCEE4",mri:"#DCCEE4","ct scan":"#DCCEE4"}},warm:{id:"warm",name:"Warm Tones",description:"Rich, earthy warm colors",colors:{"nurse visit":"#EAC5C5",nurse:"#EAC5C5",nursing:"#EAC5C5",caregiver:"#EAC5C5","care aide":"#EAC5C5","nursing aide":"#EAC5C5","social worker":"#E8C6D8",helper:"#EAC5C5","support worker":"#EAC5C5","family care":"#EAC5C5","home care":"#EAC5C5","home health":"#EAC5C5","care visit":"#EAC5C5","support visit":"#EAC5C5","doctor visit":"#A8B8C8","doctor appointment":"#C7BEDD","hospital visit":"#A8B8C8",doctor:"#C7BEDD",dr:"#C7BEDD",physician:"#C7BEDD",hospital:"#A8B8C8",clinic:"#C7BEDD","medical appointment":"#C7BEDD","health check":"#C7BEDD",checkup:"#C7BEDD","check-up":"#C7BEDD","follow-up":"#C7BEDD",followup:"#C7BEDD",consultation:"#C7BEDD",revalidation:"#C7BEDD",rehabilitation:"#C7BEDD",rehab:"#C7BEDD","ms center training":"#C7BEDD","ms center":"#C7BEDD",ms:"#C7BEDD",training:"#C7BEDD",neurologist:"#7F6E7E",specialist:"#7F6E7E",cardiologist:"#7F6E7E",urologist:"#7F6E7E",ophthalmologist:"#7F6E7E",dermatologist:"#7F6E7E",psychiatrist:"#7F6E7E",psychologist:"#7F6E7E",therapist:"#7F6E7E",counselor:"#7F6E7E",physiotherapy:"#D79890",physio:"#D79890","physical therapy":"#D79890","occupational therapy":"#D79890","speech therapy":"#D79890",wellness:"#D79890",massage:"#D79890",acupuncture:"#D79890","cleaning lady":"#EAD3A4",cleaning:"#EAD3A4",housekeeping:"#EAD3A4",housekeeper:"#EAD3A4",familyhulp:"#F1E8BC","home support":"#F1E8BC","home help":"#F1E8BC","meal delivery":"#F1E8BC","meals on wheels":"#F1E8BC","elderly support":"#DBCDB8",elderly:"#DBCDB8","senior care":"#DBCDB8","home medical":"#C4A78D","home medical visit":"#C4A78D","dinner with friends":"#E8A48F","lunch with friends":"#E8A48F",friends:"#E8A48F","family visit":"#EAC5C5",family:"#EAC5C5",visit:"#EAC5C5",gathering:"#EAC5C5",birthday:"#EAC5C5",celebration:"#EAC5C5","lunch with family":"#E9D5A8",lunch:"#E9D5A8",dinner:"#E9D5A8",breakfast:"#E9D5A8",meal:"#E9D5A8",coffee:"#E8A48F",tea:"#E8A48F","personal errand":"#EAC5C5",errand:"#EAC5C5",shopping:"#E9D5A8",groceries:"#E9D5A8","pharmacy pickup":"#E9D5A8","quality time":"#D79890",drive:"#DDE6A3",driving:"#DDE6A3","car transport":"#DDE6A3",transport:"#DDE6A3",transportation:"#DDE6A3",car:"#DDE6A3","car trip":"#DDE6A3",ride:"#DDE6A3",taxi:"#DDE6A3",uber:"#DDE6A3",lift:"#DDE6A3",pickup:"#B9BE96","drop-off":"#B9BE96","drop off":"#B9BE96","mobility assistance":"#E8C079",mobility:"#E8C079","office tasks":"#B6A898",office:"#B6A898",admin:"#B6A898","desk work":"#B6A898",paperwork:"#C4A78D",administration:"#C4A78D",forms:"#C4A78D",billing:"#C4A78D",insurance:"#C4A78D",financial:"#C4A78D","general appointment":"#C4A78D",appointment:"#C4A78D",meeting:"#6A5D55",meetings:"#6A5D55",session:"#C4A78D",meditation:"#B6A898",rest:"#B6A898",nap:"#DBCDB8",sleep:"#DBCDB8",walking:"#9E9C7A",exercise:"#9E9C7A",walk:"#9E9C7A",activity:"#9E9C7A","light activity":"#DBCDB8",medication:"#EAC5C5",prescription:"#EAC5C5","lab work":"#C7BEDD","blood test":"#C7BEDD","x-ray":"#C7BEDD",scan:"#C7BEDD",mri:"#C7BEDD","ct scan":"#C7BEDD"}},bold:{id:"bold",name:"Bold Colors",description:"Vibrant, saturated colors",colors:{"nurse visit":"#F5B8C8",nurse:"#F5B8C8",nursing:"#F5B8C8",caregiver:"#F5B8C8","care aide":"#F5B8C8","nursing aide":"#F5B8C8","social worker":"#E8B8D8",helper:"#F5B8C8","support worker":"#F5B8C8","fam
655ily care":"#F5B8C8","home care":"#F5B8C8","home health":"#F5B8C8","care visit":"#F5B8C8","support visit":"#F5B8C8","doctor visit":"#88B4D4","doctor appointment":"#D4A5E8","hospital visit":"#88B4D4",doctor:"#D4A5E8",dr:"#D4A5E8",physician:"#D4A5E8",hospital:"#88B4D4",clinic:"#D4A5E8","medical appointment":"#D4A5E8","health check":"#D4A5E8",checkup:"#D4A5E8","check-up":"#D4A5E8","follow-up":"#D4A5E8",followup:"#D4A5E8",consultation:"#D4A5E8",revalidation:"#D4A5E8",rehabilitation:"#D4A5E8",rehab:"#D4A5E8","ms center training":"#D4A5E8","ms center":"#D4A5E8",ms:"#D4A5E8",training:"#D4A5E8",neurologist:"#9B7AB8",specialist:"#9B7AB8",cardiologist:"#9B7AB8",urologist:"#9B7AB8",ophthalmologist:"#9B7AB8",dermatologist:"#9B7AB8",psychiatrist:"#9B7AB8",psychologist:"#9B7AB8",therapist:"#9B7AB8",counselor:"#9B7AB8",physiotherapy:"#A8D5A3",physio:"#A8D5A3","physical therapy":"#A8D5A3","occupational therapy":"#A8D5A3","speech therapy":"#A8D5A3",wellness:"#A8D5A3",massage:"#A8D5A3",acupuncture:"#A8D5A3","cleaning lady":"#FFD89B",cleaning:"#FFD89B",housekeeping:"#FFD89B",housekeeper:"#FFD89B",familyhulp:"#FFE4A3","home support":"#FFE4A3","home help":"#FFE4A3","meal delivery":"#FFE4A3","meals on wheels":"#FFE4A3","elderly support":"#E8D5B8",elderly:"#E8D5B8","senior care":"#E8D5B8","home medical":"#D4A78E","home medical visit":"#D4A78E","dinner with friends":"#FF9F7C","lunch with friends":"#FF9F7C",friends:"#FF9F7C","family visit":"#FFB5C5",family:"#FFB5C5",visit:"#FFB5C5",gathering:"#FFB5C5",birthday:"#FFB5C5",celebration:"#FFB5C5","lunch with family":"#FFC89B",lunch:"#FFC89B",dinner:"#FFC89B",breakfast:"#FFC89B",meal:"#FFC89B",coffee:"#FF9F7C",tea:"#FF9F7C","personal errand":"#FFB5C5",errand:"#FFB5C5",shopping:"#FFC89B",groceries:"#FFC89B","pharmacy pickup":"#FFC89B","quality time":"#FFB5C5",drive:"#E8E89B",driving:"#E8E89B","car transport":"#E8E89B",transport:"#E8E89B",transportation:"#E8E89B",car:"#E8E89B","car trip":"#E8E89B",ride:"#E8E89B",taxi:"#E8E89B",uber:"#E8E89B",lift:"#E8E89B",pickup:"#D3D88F","drop-off":"#D3D88F","drop off":"#D3D88F","mobility assistance":"#FFB86C",mobility:"#FFB86C","office tasks":"#C4B5A8",office:"#C4B5A8",admin:"#C4B5A8","desk work":"#C4B5A8",paperwork:"#D4A78E",administration:"#D4A78E",forms:"#D4A78E",billing:"#D4A78E",insurance:"#D4A78E",financial:"#D4A78E","general appointment":"#D4A78E",appointment:"#D4A78E",meeting:"#8B7A75",meetings:"#8B7A75",session:"#D4A78E",meditation:"#C4B5A8",rest:"#D4C5B8",nap:"#D4C5B8",sleep:"#D4C5B8",walking:"#B8C99B",exercise:"#B8C99B",walk:"#B8C99B",activity:"#B8C99B","light activity":"#D4C5B8",medication:"#F5B8C8",prescription:"#F5B8C8","lab work":"#D4A5E8","blood test":"#D4A5E8","x-ray":"#D4A5E8",scan:"#D4A5E8",mri:"#D4A5E8","ct scan":"#D4A5E8"}},natural:{id:"natural",name:"Natural Tones",description:"Muted, sophisticated earth tones",colors:{"nurse visit":"#B9B0C9",nurse:"#B9B0C9",nursing:"#B9B0C9",caregiver:"#B9B0C9","care aide":"#B9B0C9","nursing aide":"#B9B0C9","social worker":"#B7A9BB",helper:"#B9B0C9","support worker":"#B9B0C9","family care":"#B9B0C9","home care":"#B9B0C9","home health":"#B9B0C9","care visit":"#B9B0C9","support visit":"#B9B0C9","doctor visit":"#A8C5C5","doctor appointment":"#B7A9BB","hospital visit":"#A8C5C5",doctor:"#B7A9BB",dr:"#B7A9BB",physician:"#B7A9BB",hospital:"#A8C5C5",clinic:"#B7A9BB","medical appointment":"#B7A9BB","health check":"#B7A9BB",checkup:"#B7A9BB","check-up":"#B7A9BB","follow-up":"#B7A9BB",followup:"#B7A9BB",consultation:"#B7A9BB",revalidation:"#B7A9BB",rehabilitation:"#B7A9BB",rehab:"#B7A9BB","ms center training":"#B7A9BB","ms center":"#B7A9BB",ms:"#B7A9BB",training:"#B7A9BB",neurologist:"#B9B0C9",specialist:"#B9B0C9",cardiologist:"#B9B0C9",urologist:"#B9B0C9",ophthalmologist:"#B9B0C9",dermatologist:"#B9B0C9",psychiatrist:"#B9B0C9",psychologist:"#B9B0C9",therapist:"#B9B0C9",counselor:"#B9B0C9",physiotherapy:"#A8C5C5",physio:"#A8C5C5","physical therapy":"#A8C5C5","occupational therapy":"#A8C5C5","speech therapy":"#A8C5C5",wellness:"#A8C5C5",massage:"#A8C5C5",acupuncture:"#A8C5C5","cleaning lady":"#D8C08F",cleaning:"#D8C08F",housekeeping:"#D8C08F",housekeeper:"#D8C08F",familyhulp:"#E3DFD6","home support":"#E3DFD6","home help":"#E3DFD6","meal delivery":"#E3DFD6","meals on wheels":"#E3DFD6","elderly support":"#EEEAE3",elderly:"#EEEAE3","senior care":"#EEEAE3","home medical":"#D8B8AA","home medical visit":"#D8B8AA","dinner with friends":"#C79C9A","lunch with friends":"#C79C9A",friends:"#C79C9A","family visit":"#D8B8AA",family:"#D8B8AA",visit:"#D8B8AA",gathering:"#D8B8AA",birthday:"#D8B8AA",celebration:"#D8B8AA","lunch with family":"#D8C08F",lunch:"#D8C08F",dinner:"#D8C08F",breakfast:"#D8C08F",meal:"#D8C08F",coffee:"#C79C9A",tea:"#C79C9A","personal errand":"#D8B8AA",errand:"#D8B8AA",shopping:"#D8C08F",groceries:"#D8C08F","pharmacy pickup":"#D8C08F","quality time":"#C79C9A",drive:"#D2CEC8",driving:"#D2CEC8","car transport":"#D2CEC8",transport:"#D2CEC8",transportation:"#D2CEC8",car:"#D2CEC8","car trip":"#D2CEC8",ride:"#D2CEC8",taxi:"#D2CEC8",uber:"#D2CEC8",lift:"#D2CEC8",pickup:"#E3DFD6","drop-off":"#E3DFD6","drop off":"#E3DFD6","mobility assistance":"#D8C08F",mobility:"#D8C08F","office tasks":"#C4C8C7",office:"#C4C8C7",admin:"#C4C8C7","de
655sk work":"#C4C8C7",paperwork:"#D2CEC8",administration:"#D2CEC8",forms:"#D2CEC8",billing:"#D2CEC8",insurance:"#D2CEC8",financial:"#D2CEC8","general appointment":"#EEEAE3",appointment:"#EEEAE3",meeting:"#C4C8C7",meetings:"#C4C8C7",session:"#EEEAE3",meditation:"#A8C5C5",rest:"#EEEAE3",nap:"#EEEAE3",sleep:"#EEEAE3",walking:"#A8C5C5",exercise:"#A8C5C5",walk:"#A8C5C5",activity:"#A8C5C5","light activity":"#EEEAE3",medication:"#B9B0C9",prescription:"#B9B0C9","lab work":"#B7A9BB","blood test":"#B7A9BB","x-ray":"#B7A9BB",scan:"#B7A9BB",mri:"#B7A9BB","ct scan":"#B7A9BB"}}};function wD(){const{palette:t,setPalette:e}=bf(),[n,r]=b.useState(!1),[i,a]=b.useState(t),s=o=>{a(o),r(!1),setTimeout(()=>{e(o)},300)};return l.jsxs(Za,{open:n,onOpenChange:r,children:[l.jsx(Oj,{asChild:!0,children:l.jsx(de,{variant:"outline",size:"icon",children:l.jsx(g$,{className:"h-4 w-4"})})}),l.jsxs(Ts,{className:"sm:max-w-[425px] max-h-[90vh] overflow-y-auto",children:[l.jsxs(na,{children:[l.jsx(ra,{children:"Color Palette"}),l.jsx(Es,{children:"Choose a color palette for your event cards"})]}),l.jsx(Wj,{value:i,onValueChange:s,children:Object.values(vU).map(o=>l.jsxs("div",{className:"relative flex items-start space-x-3 space-y-0 rounded-md border p-3 transition-all duration-200 hover:bg-accent active:scale-[0.98] cursor-pointer touch-manipulation",onClick:()=>s(o.id),children:[l.jsx(Y0,{value:o.id,id:o.id,className:"touch-manipulation"}),l.jsxs("div",{className:"flex-1 space-y-1",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(yt,{htmlFor:o.id,className:"font-medium cursor-pointer text-sm",children:o.name}),i===o.id&&l.jsx("span",{className:"text-xs font-medium text-green-600 px-2 py-0.5 bg-green-100 rounded-full",children:"Active"})]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:o.description}),l.jsx("div",{className:"flex gap-1.5 mt-2",children:Object.values(new Set(Object.values(o.colors))).slice(0,8).map((c,u)=>l.jsx("div",{className:"w-6 h-6 rounded-full border-2 border-border shadow-sm",style:{backgroundColor:c}},u))})]})]},o.id))})]})]})}const IC="/sw.js";function wf(){return typeof window>"u"?{supported:!1,reason:"no-window"}:"serviceWorker"in navigator?"PushManager"in window?"Notification"in window?{supported:!0}:{supported:!1,reason:"no-notifications"}:{supported:!1,reason:"no-push"}:{supported:!1,reason:"no-sw"}}function md(t){if(!t)return null;try{return new URL(t).host}catch{return null}}async function Gj(){if(typeof window>"u"||!("serviceWorker"in navigator))return null;const e=(await navigator.serviceWorker.getRegistrations()).find(n=>{var i,a,s;return[(i=n.active)==null?void 0:i.scriptURL,(a=n.waiting)==null?void 0:a.scriptURL,(s=n.installing)==null?void 0:s.scriptURL].filter(Boolean).some(o=>{try{return new URL(o).pathname===IC}catch{return o.endsWith(IC)}})});return e||(navigator.serviceWorker.getRegistration("/")??null)}async function Fy(){const t=await Gj();return t||navigator.serviceWorker.register(IC,{scope:"/"})}function pue(t){const e="=".repeat((4-t.length%4)%4),n=(t+e).replace(/-/g,"+").replace(/_/g,"/"),r=atob(n),i=new Uint8Array(r.length);for(let a=0;a<r.length;a++)i[a]=r.charCodeAt(a);return i}function SD(t){if(!t)return"";const e=new Uint8Array(t);let n="";for(let r=0;r<e.length;r++)n+=String.fromCharCode(e[r]);return btoa(n)}async function mue(){const{data:t,error:e}=await me.functions.invoke("get-vapid-public-key");if(e||!(t!=null&&t.publicKey))throw new Error("Could not load VAPID public key");return t.publicKey}async function gue(){if(!wf().supported)return null;const e=await Gj();return(e==null?void 0:e.pushManager.getSubscription())??null}async function yU(){const t=await Fy();await navigator.serviceWorker.ready;let e=await t.pushManager.getSubscription();if(!e){const n=await mue();e=await t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:pue(n).buffer})}return e}async function bU(t,e){var u,d;const n=e.toJSON(),r=e.endpoint,i=((u=n.keys)==null?void 0:u.p256dh)??SD(e.getKey("p256dh")),a=((d=n.keys)==null?void 0:d.auth)??SD(e.getKey("auth")),s=typeof navigator<"u"?navigator.userAgent:null;if(t.accessCode){const{data:h,error:f}=await me.rpc("subscribe_to_calendar_via_link",{_access_code:t.accessCode,_endpoint:r,_p256dh_ke
655y:i,_auth_key:a,_device_label:t.deviceLabel??null,_user_agent:s});if(f)throw f;return{id:h??null,endpointHost:md(r)}}const{data:o,error:c}=await me.rpc("subscribe_to_calendar_as_owner",{_calendar_id:t.calendarId,_endpoint:r,_p256dh_key:i,_auth_key:a,_device_label:t.deviceLabel??null,_user_agent:s});if(c)throw c;return{id:o??null,endpointHost:md(r)}}async function vue(t){if(!wf().supported)throw new Error("Push notifications are not supported on this device");if(await Notification.requestPermission()!=="granted")return!1;const r=await yU();return await bU(t,r),!0}async function LC(t){if(!wf().supported)return;const n=await Gj(),r=await(n==null?void 0:n.pushManager.getSubscription());if(r){t.accessCode?await me.rpc("unsubscribe_from_calendar_via_link",{_access_code:t.accessCode,_endpoint:r.endpoint}):await me.rpc("unsubscribe_from_calendar_as_owner",{_calendar_id:t.calendarId,_endpoint:r.endpoint});try{await r.unsubscribe()}catch{}}}async function yue(t){if(!wf().supported||Notification.permission!=="granted")return!1;const n=await gue();if(!n)return!1;const{data:r}=await me.rpc("is_subscribed_to_calendar",{_calendar_id:t,_endpoint:n.endpoint});return r===!0}const IS=20,bue=200;function Yj(t){return`careable:notif-read:${t}`}function LS(t){if(typeof window>"u")return{lastReadAt:null,readIds:[]};try{const e=window.localStorage.getItem(Yj(t));if(!e)return{lastReadAt:null,readIds:[]};const n=JSON.parse(e);return{lastReadAt:n.lastReadAt??null,readIds:Array.isArray(n.readIds)?n.readIds:[]}}catch{return{lastReadAt:null,readIds:[]}}}function $S(t,e){if(typeof window>"u")return;const n={lastReadAt:e.lastReadAt,readIds:e.readIds.slice(-bue)};window.localStorage.setItem(Yj(t),JSON.stringify(n))}function xue(t){const e=new Date(t),n=Date.now()-e.getTime(),r=Math.floor(n/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;const i=Math.floor(r/60);if(i<24)return`${i}h ago`;const a=Math.floor(i/24);return a<7?`${a}d ago`:e.toLocaleDateString()}function wue(t){return new Date(t).toLocaleString(void 0,{weekday:"short",day:"numeric",month:"short",hour:"numeric",minute:"2-digit"})}function kD({calendarId:t,accessCode:e}){const[n,r]=b.useState(!0),[i,a]=b.useState(!1),[s,o]=b.useState(!1),[c,u]=b.useState(!1),[d,h]=b.useState(null),[f,p]=b.useState(null),[g,m]=b.useState([]),[v,x]=b.useState(!1),[w,y]=b.useState(()=>LS(t));b.useEffect(()=>{y(LS(t));const I=R=>{R.key===Yj(t)&&y(LS(t))};return window.addEventListener("storage",I),()=>window.removeEventListener("storage",I)},[t]),b.useEffect(()=>{const I=wf();r(I.supported),I.supported&&yue(t).then(a).catch(()=>a(!1))},[t]);const k=b.useCallback(async()=>{x(!0);try{const{data:I,error:R}=await me.rpc("get_notification_history",{_calendar_id:t,_access_code:e??null});if(R)throw R;m(I??[])}catch{m([])}finally{x(!1)}},[t,e]);b.useEffect(()=>{i?k():m([])},[i,k]),b.useEffect(()=>{s&&i&&k()},[s,i,k]);const S=b.useCallback(I=>!(w.readIds.includes(I.id)||w.lastReadAt&&new Date(I.created_at)<=new Date(w.lastReadAt)),[w]),_=b.useMemo(()=>g.slice(0,IS),[g]),C=g.length>IS,T=b.useMemo(()=>_.filter(S),[_,S]),E=b.useMemo(()=>_.filter(I=>!S(I)),[_,S]),j=T.length,P=b.useCallback(I=>{y(R=>{if(R.readIds.includes(I))return R;const z={...R,readIds:[...R.readIds,I]};return $S(t,z),z})},[t]),M=b.useCallback(()=>{y(()=>{const I={lastReadAt:new Date().toISOString(),readIds:[]};return $S(t,I),I})},[t]);if(!n)return null;const U=async()=>{u(!0),h(null);try{await vue({calendarId:t,accessCode:e})?(a(!0),o(!1),p("You'll be notified when someone adds a new event.")):h("Permission was not granted. You can enable notifications in your browser settings.")}catch(I){const R=I instanceof Error?I.message:"Could not enable notifications";h(R)}finally{u(!1)}},N=async()=>{u(!0),h(null);try{await LC({calendarId:t,accessCode:e}),a(!1),m([]);const I={lastReadAt:new Date().toISOString(),readIds:[]};$S(t,I),y(I),o(!1),p("Notifications turned off for this device.")}catch(I){const R=I instanceof Error?I.message:"Could not turn off notifications";h(R)}finally{u(!1)}},B=I=>{P(I.id),o(!1),window.dispatchEvent(new CustomEvent("careable:open-event",{detail:{eventId:I.event_id,startTime:I.event_start_time}}))},$=(I,R)=>l.jsx("li",{className:"min-w-0",children:l.jsxs("button",{type:"button",onClick:()=>B(I),className:ce("w-full min-w-0 text-left flex items-start gap-2 p-2 border transition-colors rounded-md",R?"bg-primary/5 border-primary/20 hover:bg-primary/10":"bg-muted/30 border-border/30 hover:bg-muted/60 opacity-80"),children:[l.jsx("span",{className:ce("mt-1.5 h-2 w-2 rounded-full shrink-0",R?"bg-primary":"bg-transparent"),"aria-hidden":!0}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("p",{className:ce("text-sm truncate",R?"font-semibold text-foreground":"font-normal text-foreground
655/80"),children:I.event_title}),l.jsx("p",{className:"text-xs text-muted-foreground truncate",children:wue(I.event_start_time)})]}),l.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:xue(I.created_at)})]})},I.id);return l.jsxs(l.Fragment,{children:[l.jsxs(de,{type:"button",variant:"outline",size:"icon","aria-label":j>0?`${j} unread notifications`:i?"Manage notifications":"Enable notifications",onClick:()=>{h(null),o(!0)},className:"relative",children:[l.jsx(vc,{className:"h-4 w-4"}),j>0?l.jsx(Rn,{className:"absolute -top-1.5 -right-1.5 h-5 min-w-[1.25rem] px-1 rounded-full flex items-center justify-center text-[10px] font-semibold bg-primary text-primary-foreground border-2 border-background",children:j>9?"9+":j}):null]}),l.jsx(Za,{open:s,onOpenChange:o,children:l.jsxs(Ts,{className:"w-[calc(100vw-2rem)] max-w-sm max-h-[calc(100vh-2rem)] overflow-y-auto overflow-x-hidden [&>*]:min-w-0",children:[l.jsxs(na,{className:"min-w-0",children:[l.jsx(ra,{className:"pr-6 break-words",children:i?"Notifications are on":"Get notified about new events"}),l.jsx(Es,{className:"break-words",children:i?"You'll get a push notification on this device whenever someone adds a new event.":"Get a push notification when someone else adds a new event to this calendar. You can turn this off any time."})]}),d&&l.jsx("p",{className:"text-sm text-destructive bg-destructive/10 rounded-xl p-3",children:d}),i&&l.jsxs("div",{className:"pt-2",children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Recent notifications"}),j>0&&l.jsxs("button",{type:"button",onClick:M,className:"text-xs text-primary hover:underline flex items-center gap-1",children:[l.jsx(ZX,{className:"h-3 w-3"}),"Mark all read"]})]}),l.jsx("div",{className:"max-h-72 overflow-y-auto -mx-1 px-1",children:v?l.jsx("p",{className:"text-sm text-muted-foreground py-3",children:"Loadingâ¦"}):_.length===0?l.jsx("p",{className:"text-sm text-muted-foreground py-3",children:"No notifications yet."}):l.jsxs("div",{className:"flex flex-col gap-3",children:[T.length>0&&l.jsxs("div",{children:[E.length>0&&l.jsx("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1.5 px-1",children:"Unread"}),l.jsx("ul",{className:"flex flex-col gap-1.5",children:T.map(I=>$(I,!0))})]}),E.length>0&&l.jsxs("div",{children:[T.length>0&&l.jsx("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1.5 px-1",children:"Earlier"}),l.jsx("ul",{className:"flex flex-col gap-1.5",children:E.map(I=>$(I,!1))})]}),T.length===0&&E.length>0&&l.jsx("p",{className:"text-xs text-muted-foreground text-center py-1",children:"You're all caught up"}),C&&l.jsxs("p",{className:"text-[11px] text-muted-foreground text-center pt-1",children:["Showing latest ",IS]})]})})]}),!i&&l.jsx("div",{className:"pt-2",children:l.jsxs("div",{className:"rounded-xl border border-dashed border-border/60 bg-muted/30 p-4 text-center flex flex-col items-center gap-2",children:[l.jsx(TO,{className:"h-5 w-5 text-muted-foreground","aria-hidden":!0}),l.jsx("p",{className:"text-sm font-medium text-foreground",children:"Notification history is hidden"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Turn on notifications to start receiving alerts and see your history here."})]})}),l.jsx("div",{className:"flex flex-col gap-2 pt-2",children:i?l.jsxs(de,{variant:"outline",onClick:N,disabled:c,children:[l.jsx(TO,{className:"w-4 h-4 mr-2"}),"Turn off notifications"]}):l.jsxs(de,{onClick:U,disabled:c,children:[l.jsx(vc,{className:"w-4 h-4 mr-2"}),c?"Enablingâ¦":"Enable notifications"]})})]})}),l.jsx(Za,{open:!!f,onOpenChange:()=>p(null),children:l.jsxs(Ts,{className:"w-[calc(100vw-2rem)] max-w-sm text-center",children:[l.jsxs(na,{children:[l.jsxs(ra,{className:"flex items-center justify-center gap-2",children:[l.jsx(vc,{className:"w-5 h-5 text-primary"}),"All set"]}),l.jsx(Es,{children:f})]}),l.jsx(de,{onClick:()=>p(null),className:"mt-2",children:"Got it"})]})})]})}const Jj=({activeView:t,onViewChange:e,onAddClick:n,onBackClick:r,showBackButton:i,isViewingToday:a,onTodayClick:s,onThisMonthClick:o,isSidebarCollapsed:c,calendarId:u,accessCode:d})=>{const{refreshing:h}=sa(),f=()=>{t==="today"&&a||(t==="today"&&s?s():e("today"))},p=()=>{t==="calendar"&&o?o():e("calendar")};return l.jsxs("nav",{className:ce("flex flex-col gap-6 p-3 animate-fade-in w-full lg:max-w-none lg:mx-0 lg:gap-4 transition-all duration-300",c?"lg:pl-16":"lg:pl-72 xl:pl-80"),children:[l.jsxs("div",{className:"lg:hidden w-full",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2 w-full",children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-shrink",children:[i&&r&&l.jsx(de,{variant:"outline",size:"icon",className:"rounded-full w-10 h-10 min-w-[40px] min-h-[40px] bg-background border-2 hover:bg-muted transition-all duration-300 hover:scale-110 touch-manipulation flex-shrink-0",onClick:r,children:l.jsx(ci,{className:"h-4 w-4"})}),l.jsxs("div",{className:"flex items-center gap-0.5 p-1 rounded-full bg-muted/30 border border-border/50 flex-shrink-0",children:[l.jsx(de,{variant:t==="week"?"default":"ghost",className:ce("rounded-full px-3 py-1.5 text-xs sm:text-sm font-medium transition-all duration-300 touch-manipulation h-8 sm:h-9",t==="week"?"bg-primary text-primary-foreground shadow-sm":"hover:bg-background/60"),onClick:()=>e("week"),children:"Week"}),l.jsx(de,{variant:t==="month"?"default":"ghost",className:ce("rounded-full px-3 py-1.5 text-xs sm:text-sm font-medium transition-all duration-300 touch-manipulation h-8 sm:h-9",t==="month"?"bg-primary text-primary-foreground shadow-sm":"hover:bg-background/60"),onClick:()=>e("month"),children:"Month"})]})]}),l.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[h&&l.jsx(dh,{className:"h-4 w-4 text-muted-foreground animate-spin flex-shrink-0"}),u&&l.jsx(kD,{calendarId:u,accessCode:d}),l.jsx(wD,{}),n&&l.jsx(de,{variant:"default",size:"icon",className:"rounded-full w-10 h-10 min-w-[40px] min-h-[40px] bg-primary text-primary-foreground shadow-md hover:shadow-lg transition-all duration-300 hover:scale-105 touch-manipulation flex-shrink-0",onClick:g=>{const m=g.currentTarget.getBoundingClientRect();n(m)},children:l.jsx(ta,{className:"h-4 w-4"})})]})]}),l.jsxs("div",{className:"flex items-center justify-center gap-6 w-full border-b border-border/30 pb-2 mt-6",children:[l.jsxs("button",{onClick:f,className:ce("px-3 py-1 text-sm font-medium transition-all duration-300 touch-manipulation relative",t==="today"?"text-primary":"text-muted-foreground hover:text-foreground"),children:["Today",t==="today"&&l.jsx("span",{className:"absolute bottom-[-9px] left-0 right-0 h-0.5 bg-primary animate-scale-in"})]}),l.jsxs("button",{onClick:p,className:ce("px-3 py-1 text-sm font-medium transition-all duration-300 touch-manipulation relative",t==="calendar"?"text-primary":"text-muted-foreground hover:text-foreground"),children:["This month",t==="calendar"&&l.jsx("span",{className:"absolute bottom-[-9px] left-0 right-0 h-0.5 bg-primary animate-scale-in"})]})]})]}),l.jsxs("div",{className:"hidden lg:flex items-center justify-center gap-2 flex-wrap",children:[i&&r&&l.jsx(de,{variant:"outline",size:"icon",className:"rounded-full min-w-[40px] min-h-[40px] bg-background border-2 hover:bg-muted transition-all duration-300 hover:scale-110 touch-manipulation flex-shrink-0",onClick:r,children:l.jsx(ci,{className:"h-4 w-4"})}),l.jsxs("div",{className:"flex items-center gap-1 p-1 rounded-full bg-muted/30 border border-border/50",children:[l.jsx("button",{onClick:f,className:ce("px-3 py-1.5 text-sm font-medium rounded-full transition-all duration-300 touch-manipulation",t==="today"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground hover:bg-background/60"),children:"Today"}),l.jsx("button",{onClick:p,className:ce("px-3 py-1.5 text-sm font-medium rounded-full transition-all duration-300 touch-manipulation",t==="calendar"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground hover:bg-background/60"),children:"This month"})]}),l.jsxs("div",{className:"flex items-center gap-1 p-1 rounded-full bg-muted/30 border border-border/50",children:[l.jsx(de,{variant:t==="week"?"default":"ghost",className:ce("rounded-full px-3 py-1.5 text-sm font-medium transition-all duration-300 touch-manipulation min-h-[36px]",t==="week"?"bg-primary text-primary-foreground shadow-sm":"hover:bg-background/60"),onClick:()=>e("week"),children:"Week"}),l.jsx(de,{variant:t==="month"?"default":"ghost",className:ce("rounded-full px-3 py-1.5 text-sm font-medium transition-all duration-300 touch-manipulation min-h-[36px]",t==="month"?"bg-primary text-primary-foreground shadow-sm":"hover:bg-background/60"),onClick:()=>e("month"),children:"Month"})]}),h&&l.jsx(dh,{className:"h-4 w-4 text-muted-foreground animate-spin"}),u&&l.jsx(kD,{calendarId:u,accessCode:d}),l.jsx(wD,{}),n&&l.jsx(de,{variant:"default",size:"icon",className:"rounded-full min-w-[40px] min-h-[40px] bg-primary text-primary-foreground shadow-md hover:shadow-lg transition-all duration-300 hover:scale-110 hover:rotate-90 touch-manipulation flex-shrink-0",onClick:g=>{const m=g.currentTarget.getBoundingClientRect();n(m)},children:l.jsx(ta,{className:"h-4 w-4"})})]})]})};function Je(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function qr(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function jn(t,e){const n=Je(t);return isNaN(e)?qr(t,NaN):(e&&n.setDate(n.getDate()+e),n)}function Or(t,e){const n=Je(t);if(isNaN(e))return qr(t,NaN);if(!e)return n;const r=n.getDate(),i=qr(t,n.getTime());i.setMonth(n.getMonth()+e+1,0);const a=i.getDate();return r>=a?i:(n.setFullYear(i.getFullYear(),i.getMonth(),r),n)}function Sue(t,e){const n=+Je(t);return qr(t,n+e)}const Xj=6048e5,kue=864e5,xU=6e4,Zj=36e5,ny=43200,_D=1440;function FS(t,e){return Sue(t,e*Zj)}let _ue={};function Sf(){return _ue}function ia(t,e){var o,c,u,d;const n=Sf(),r=(e==null?void 0:e.weekStartsOn)??((c=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,i=Je(t),a=i.getDay(),s=(a<r?7:0)+a-r;return i.setDate(i.getDate()-s),i.setHours(0,0,0,0),i}function ou(t){return ia(t,{weekStartsOn:1}
655)}function wU(t){const e=Je(t),n=e.getFullYear(),r=qr(t,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=ou(r),a=qr(t,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);const s=ou(a);return e.getTime()>=i.getTime()?n+1:e.getTime()>=s.getTime()?n:n-1}function Qn(t){const e=Je(t);return e.setHours(0,0,0,0),e}function wh(t){const e=Je(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function za(t,e){const n=Qn(t),r=Qn(e),i=+n-wh(n),a=+r-wh(r);return Math.round((i-a)/kue)}function Cue(t){const e=wU(t),n=qr(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),ou(n)}function Sh(t,e){const n=e*7;return jn(t,n)}function Tue(t,e){return Or(t,e*12)}function Eue(t){let e;return t.forEach(function(n){const r=Je(n);(e===void 0||e<r||isNaN(Number(r)))&&(e=r)}),e||new Date(NaN)}function jue(t){let e;return t.forEach(n=>{const r=Je(n);(!e||e>r||isNaN(+r))&&(e=r)}),e||new Date(NaN)}function By(t,e){const n=Je(t),r=Je(e),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}function pw(t){return qr(t,Date.now())}function gn(t,e){const n=Qn(t),r=Qn(e);return+n==+r}function Qj(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function Pue(t){if(!Qj(t)&&typeof t!="number")return!1;const e=Je(t);return!isNaN(Number(e))}function kh(t,e){const n=Je(t),r=Je(e),i=n.getFullYear()-r.getFullYear(),a=n.getMonth()-r.getMonth();return i*12+a}function Nue(t,e,n){const r=ia(t,n),i=ia(e,n),a=+r-wh(r),s=+i-wh(i);return Math.round((a-s)/Xj)}function Aue(t,e){const n=Je(t),r=Je(e),i=CD(n,r),a=Math.abs(za(n,r));n.setDate(n.getDate()-i*a);const s=+(CD(n,r)===-i),o=i*(a-s);return o===0?0:o}function CD(t,e){const n=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return n<0?-1:n>0?1:n}function Oue(t){return e=>{const r=(t?Math[t]:Math.trunc)(e);return r===0?0:r}}function Rue(t,e){return+Je(t)-+Je(e)}function Rc(t){const e=Je(t);return e.setHours(23,59,59,999),e}function kf(t){const e=Je(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function Due(t){const e=Je(t);return+Rc(e)==+kf(e)}function Mue(t,e){const n=Je(t),r=Je(e),i=By(n,r),a=Math.abs(kh(n,r));let s;if(a<1)s=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*a);let o=By(n,r)===-i;Due(Je(t))&&a===1&&By(t,r)===1&&(o=!1),s=i*(a-Number(o))}return s===0?0:s}function Iue(t,e,n){const r=Rue(t,e)/1e3;return Oue(n==null?void 0:n.roundingMethod)(r)}function Pr(t){const e=Je(t);return e.setDate(1),e.setHours(0,0,0,0),e}function SU(t){const e=Je(t),n=qr(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Qg(t,e){var o,c,u,d;const n=Sf(),r=(e==null?void 0:e.weekStartsOn)??((c=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,i=Je(t),a=i.getDay(),s=(a<r?-7:0)+6-(a-r);return i.setDate(i.getDate()+s),i.setHours(23,59,59,999),i}function kU(t){return Qg(t,{weekStartsOn:1})}const Lue={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},$ue=(t,e,n)=>{let r;const i=Lue[t];return typeof i=="string"?r=i:e===1?r=i.one:r=i.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function BS(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const Fue={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Bue={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Uue={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},zue={date:BS({formats:Fue,defaultWidth:"full"}),time:BS({formats:Bue,defaultWidth:"full"}),dateTime:BS({formats:Uue,defaultWidth:"full"})},Wue={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Vue=(t,e,n,r)=>Wue[t];function Xf(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&t.formattingValues){const s=t.defaultFormattingWidth||t.defaultWidth,o=n!=null&&n.width?String(n.width):s;i=t.formattingValues[o]||t.formattingValues[s]}else{const s=t.defaultWidth,o=n!=null&&n.width?String(n.width):t.defaultWidth;i=t.values[o]||t.values[s]}const a=t.argumentCallback?t.argumentCallback(e):e;return i[a]}}const Hue={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},que={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Kue={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Gue={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
655ay","Saturday"]},Yue={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Jue={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Xue=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Zue={ordinalNumber:Xue,era:Xf({values:Hue,defaultWidth:"wide"}),quarter:Xf({values:que,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Xf({values:Kue,defaultWidth:"wide"}),day:Xf({values:Gue,defaultWidth:"wide"}),dayPeriod:Xf({values:Yue,defaultWidth:"wide",formattingValues:Jue,defaultFormattingWidth:"wide"})};function Zf(t){return(e,n={})=>{const r=n.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],a=e.match(i);if(!a)return null;const s=a[0],o=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(o)?ede(o,h=>h.test(s)):Que(o,h=>h.test(s));let u;u=t.valueCallback?t.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;const d=e.slice(s.length);return{value:u,rest:d}}}function Que(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function ede(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function tde(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const i=r[0],a=e.match(t.parsePattern);if(!a)return null;let s=t.valueCallback?t.valueCallback(a[0]):a[0];s=n.valueCallback?n.valueCallback(s):s;const o=e.slice(i.length);return{value:s,rest:o}}}const nde=/^(\d+)(th|st|nd|rd)?/i,rde=/\d+/i,ide={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ade={any:[/^b/i,/^(a|c)/i]},sde={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ode={any:[/1/i,/2/i,/3/i,/4/i]},cde={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},lde={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ude={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},dde={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},hde={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},fde={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},pde={ordinalNumber:tde({matchPattern:nde,parsePattern:rde,valueCallback:t=>parseInt(t,10)}),era:Zf({matchPatterns:ide,defaultMatchWidth:"wide",parsePatterns:ade,defaultParseWidth:"any"}),quarter:Zf({matchPatterns:sde,defaultMatchWidth:"wide",parsePatterns:ode,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Zf({matchPatterns:cde,defaultMatchWidth:"wide",parsePatterns:lde,defaultParseWidth:"any"}),day:Zf({matchPatterns:ude,defaultMatchWidth:"wide",parsePatterns:dde,defaultParseWidth:"any"}),dayPeriod:Zf({matchPatterns:hde,defaultMatchWidth:"any",parsePatterns:fde,defaultParseWidth:"any"})},eP={code:"en-US",formatDistance:$ue,formatLong:zue,formatRelative:Vue,localize:Zue,match:pde,options:{weekStartsOn:0,firstWeekContainsDate:1}};function mde(t){const e=Je(t);return za(e,SU(e))+1}function _U(t){const e=Je(t),n=+ou(e)-+Cue(e);return Math.round(n/Xj)+1}function CU(t,e){var d,h,f,p;const n=Je(t),r=n.getFullYear(),i=Sf(),a=(e==null?void 0:e.firstWeekContainsDate)??((h=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??i.firstWeekContainsDate??((p=(f=i.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,s=qr(t,0);s.setFullYear(r+1,0,a),s.setHours(0,0,0,0);const o=ia(s,e),c=qr(t,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);const u=ia(c,e);return n.getTime()>=o.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function gde(t,e){var o,c,u,d;const n=Sf(),r=(e==null?void 0:e.firstWeekContainsDate)??((c=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,i=CU(t,e),a=qr(t,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),ia(a,e)}function TU(t,e){const n=Je(t),r=+ia(n,e)-+gde(n,e);return Math.round(r/Xj)+1}function Ft(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const Do={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return Ft(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):Ft(n+1,2)},d(t,e){return Ft(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return Ft(t.getHours()%12||12,e.length)},H(t,e){return Ft(t.getHours(),e.length)},m(t,e){return Ft(t.getMinutes(),e.length)},s(t,e){return Ft(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Ft(i,e.length)}},Hu={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},TD={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Do.y(t,e)},Y:function(t,e,n,r){const i=CU(t,r),a=i>0?i:1-i;if(e==="YY"){const s=a%100;return Ft(s,2)}return e==="Yo"?n.ordinalNumber(a,{unit:"year"}):Ft(a,e.length)},R:function(t,e){const n=wU(t);return Ft(n,e.length)},u:function(t,e){const n=t.getFullYear();return Ft(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return Ft(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return Ft(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return Do.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return Ft(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const i=TU(t,r);return e==="wo"?n.ordinalNumber(i,{unit:"week"}):Ft(i,e.length)},I:function(t,e,n){const r=_U(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):Ft(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Do.d(t,e)},D:function(t,e,n){const r=mde(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Ft(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const i=t.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return Ft(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const i=t.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return Ft(a,e.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),i=r===0?7:r;switch(e){case"i":return String(i);case"ii":return Ft(i,e.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const i=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let i;switch(r===12?i=Hu.noon:r===0?i=Hu.midnight:i=r/12>
vendor: 4,717 bytes, line 655
655=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let i;switch(r>=17?i=Hu.evening:r>=12?i=Hu.afternoon:r>=4?i=Hu.morning:i=Hu.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Do.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Do.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Ft(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):Ft(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Do.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Do.s(t,e)},S:function(t,e){return Do.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return jD(r);case"XXXX":case"XX":return cl(r);case"XXXXX":case"XXX":default:return cl(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return jD(r);case"xxxx":case"xx":return cl(r);case"xxxxx":case"xxx":default:return cl(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+ED(r,":");case"OOOO":default:return"GMT"+cl(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+ED(r,":");case"zzzz":default:return"GMT"+cl(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return Ft(r,e.length)},T:function(t,e,n){const r=t.getTime();return Ft(r,e.length)}};function ED(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+e+Ft(a,2)}function jD(t,e){return t%60===0?(t>0?"-":"+")+Ft(Math.abs(t)/60,2):cl(t,e)}function cl(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),i=Ft(Math.trunc(r/60),2),a=Ft(r%60,2);return n+i+e+a}const PD=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},EU=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},vde=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return PD(t,e);let a;switch(r){case"P":a=e.dateTime({width:"short"});break;case"PP":a=e.dateTime({width:"medium"});break;case"PPP":a=e.dateTime({width:"long"});break;case"PPPP":default:a=e.dateTime({width:"full"});break}return a.replace("{{date}}",PD(r,e)).replace("{{time}}",EU(i,e))},yde={p:EU,P:vde},bde=/^D+$/,xde=/^Y+$/,wde=["D","DD","YY","YYYY"];function Sde(t){return bde.test(t)}function kde(t){return xde.test(t)}function _de(t,e,n){const r=Cde(t,e,n);if(console.warn(r),wde.includes(t))throw new RangeError(r)}function Cde(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Tde=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ede=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,jde=/^'([^]*?)'?$/,Pde=/''/g,Nde=/[a-zA-Z]/;function $e(t,e,n){var d,h,f,p,g,m,v,x;const r=Sf(),i=(n==null?void 0:n.locale)??r.locale??eP,a=(n==null?void 0:n.firstWeekContainsDate)??((h=(d=n==null?void 0:n.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(f=r.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,s=(n==null?void 0:n.weekStartsOn)??((m=(g=n==null?void 0:n.locale)==null?void 0:g.options)==null?void 0:m.weekStartsOn)??r.weekStartsOn??((x=(v=r.locale)==null?void 0:v.options)==null?void 0:x.weekStartsOn)??0,o=Je(t);if(!Pue(o))throw new RangeError("Invalid time value");let c=e.match(Ede).map(w=>{const y=w[0];if(y==="p"||y==="P"){const k=yde[y];return k(w,i.formatLong)}return w}).join("").match(Tde).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const y=w[0];if(y==="'")return{isToken:!1,value:Ade(w)};if(TD[y])return{isToken:!0,value:w};
655if(y.match(Nde))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");return{isToken:!1,value:w}});i.localize.preprocessor&&(c=i.localize.preprocessor(o,c));const u={firstWeekContainsDate:a,weekStartsOn:s,locale:i};return c.map(w=>{if(!w.isToken)return w.value;const y=w.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&kde(y)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&Sde(y))&&_de(y,e,String(t));const k=TD[y[0]];return k(o,y,i.localize,u)}).join("")}function Ade(t){const e=t.match(jde);return e?e[1].replace(Pde,"'"):t}function Ode(t,e,n){const r=Sf(),i=(n==null?void 0:n.locale)??r.locale??eP,a=2520,s=By(t,e);if(isNaN(s))throw new RangeError("Invalid time value");const o=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:s});let c,u;s>0?(c=Je(e),u=Je(t)):(c=Je(t),u=Je(e));const d=Iue(u,c),h=(wh(u)-wh(c))/1e3,f=Math.round((d-h)/60);let p;if(f<2)return n!=null&&n.includeSeconds?d<5?i.formatDistance("lessThanXSeconds",5,o):d<10?i.formatDistance("lessThanXSeconds",10,o):d<20?i.formatDistance("lessThanXSeconds",20,o):d<40?i.formatDistance("halfAMinute",0,o):d<60?i.formatDistance("lessThanXMinutes",1,o):i.formatDistance("xMinutes",1,o):f===0?i.formatDistance("lessThanXMinutes",1,o):i.formatDistance("xMinutes",f,o);if(f<45)return i.formatDistance("xMinutes",f,o);if(f<90)return i.formatDistance("aboutXHours",1,o);if(f<_D){const g=Math.round(f/60);return i.formatDistance("aboutXHours",g,o)}else{if(f<a)return i.formatDistance("xDays",1,o);if(f<ny){const g=Math.round(f/_D);return i.formatDistance("xDays",g,o)}else if(f<ny*2)return p=Math.round(f/ny),i.formatDistance("aboutXMonths",p,o)}if(p=Mue(u,c),p<12){const g=Math.round(f/ny);return i.formatDistance("xMonths",g,o)}else{const g=p%12,m=Math.trunc(p/12);return g<3?i.formatDistance("aboutXYears",m,o):g<9?i.formatDistance("overXYears",m,o):i.formatDistance("almostXYears",m+1,o)}}function Rde(t,e){return Ode(t,pw(t),e)}function Dde(t){return Je(t).getDay()}function Mde(t){const e=Je(t),n=e.getFullYear(),r=e.getMonth(),i=qr(t,0);return i.setFullYear(n,r+1,0),i.setHours(0,0,0,0),i.getDate()}function Ide(t){return Je(t).getHours()}function Lde(t){return Math.trunc(+Je(t)/1e3)}function $de(t){const e=Je(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(0,0,0,0),e}function Fde(t,e){return Nue($de(t),Pr(t),e)+1}function $m(t,e){const n=Je(t),r=Je(e);return n.getTime()>r.getTime()}function tP(t,e){const n=Je(t),r=Je(e);return+n<+r}function mw(t,e){const n=Je(t),r=Je(e);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function Bde(t,e){const n=Je(t),r=Je(e);return n.getFullYear()===r.getFullYear()}function $C(t){return gn(t,pw(t))}function Ude(t){return gn(t,jn(pw(t),1))}function Up(t,e){return jn(t,-e)}function zde(t){return gn(t,Up(pw(t),1))}function ND(t,e){const r=qde(t);let i;if(r.date){const c=Kde(r.date,2);i=Gde(c.restDateString,c.year)}if(!i||isNaN(i.getTime()))return new Date(NaN);const a=i.getTime();let s=0,o;if(r.time&&(s=Yde(r.time),isNaN(s)))return new Date(NaN);if(r.timezone){if(o=Jde(r.timezone),isNaN(o))return new Date(NaN)}else{const c=new Date(a+s),u=new Date(0);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return new Date(a+s+o)}const ry={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Wde=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Vde=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Hde=/^([+-])(\d{2})(?::?(\d{2}))?$/;function qde(t){const e={},n=t.split(ry.dateTimeDelimiter);let r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],ry.timeZoneDelimiter.test(e.date)&&(e.date=t.split(ry.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){const i=ry.timezone.exec(r);i?(e.time=r.replace(i[1],""),e.timezone=i[1]):e.time=r}return e}function Kde(t,e){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};const i=r[1]?parseInt(r[1]):null,a=r[2]?parseInt(r[2]):null;return{year:a===null?i:a*100,restDateString:t.slice((r[1]||r[2]).length)}}function Gde(t,e){if(e===null)return new Date(NaN);const n=t.match(Wde);if(!n)return new Date(NaN);const r=!!n[4],i=Qf(n[1]),a=Qf(n[2])-1,s=Qf(n[3]),o=Qf(n[4]),c=Qf(n[5])-1;if(r)return the(e,o,c)?Xde(e,o,c):new Date(NaN);{const u=new Date(0);return!Qde(e,a,s)||!ehe(e,i)?new Date(NaN):(u.setUTCFullYear(e,a,Math.max(i,s)),u)}}function Qf(t){return t?parseInt(t):1}function Yde(t){const e=t.match(Vde);if(!e)return NaN;const n=US(e[1]),r=US(e[2]),i=US(e[3]);return nhe(n,r,i)?n*Zj+r*xU+i*1e3:NaN}function US(t){return t&&parseFloat(t.replace(",","."))||0}function Jde(t){if(t==="Z")return 0;const e=t.match(Hde);
vendor: 4,731 bytes, lines 655-663
655if(!e)return 0;const n=e[1]==="+"?-1:1,r=parseInt(e[2]),i=e[3]&&parseInt(e[3])||0;return rhe(r,i)?n*(r*Zj+i*xU):NaN}function Xde(t,e,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const i=r.getUTCDay()||7,a=(e-1)*7+n+1-i;return r.setUTCDate(r.getUTCDate()+a),r}const Zde=[31,null,31,30,31,30,31,31,30,31,30,31];function jU(t){return t%400===0||t%4===0&&t%100!==0}function Qde(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(Zde[e]||(jU(t)?29:28))}function ehe(t,e){return e>=1&&e<=(jU(t)?366:365)}function the(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function nhe(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function rhe(t,e){return e>=0&&e<=59}function zS(t,e){const n=Je(t),r=n.getFullYear(),i=n.getDate(),a=qr(t,0);a.setFullYear(r,e,15),a.setHours(0,0,0,0);const s=Mde(a);return n.setMonth(e,Math.min(i,s)),n}function AD(t,e){const n=Je(t);return isNaN(+n)?qr(t,NaN):(n.setFullYear(e),n)}function FC(t,e){return Or(t,-e)}function OD(t,e){return Sh(t,-e)}var PU={exports:{}},NU={};/** 656 * @license React 657 * use-sync-external-store-shim.production.js 658 * 659 * Copyright (c) Meta Platforms, Inc. and affiliates. 660 * 661 * This source code is licensed under the MIT license found in the 662 * LICENSE file in the root directory of this source tree. 663 */var _h=b;function ihe(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var ahe=typeof Object.is=="function"?Object.is:ihe,she=_h.useState,ohe=_h.useEffect,che=_h.useLayoutEffect,lhe=_h.useDebugValue;function uhe(t,e){var n=e(),r=she({inst:{value:n,getSnapshot:e}}),i=r[0].inst,a=r[1];return che(function(){i.value=n,i.getSnapshot=e,WS(i)&&a({inst:i})},[t,n,e]),ohe(function(){return WS(i)&&a({inst:i}),t(function(){WS(i)&&a({inst:i})})},[t]),lhe(n),n}function WS(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!ahe(t,n)}catch{return!0}}function dhe(t,e){return e()}var hhe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?dhe:uhe;NU.useSyncExternalStore=_h.useSyncExternalStore!==void 0?_h.useSyncExternalStore:hhe;PU.exports=NU;var fhe=PU.exports;function phe(){return fhe.useSyncExternalStore(mhe,()=>!0,()=>!1)}function mhe(){return()=>{}}var nP="Avatar",[ghe,hBe]=Yr(nP),[vhe,AU]=ghe(nP),OU=b.forwardRef((t,e)=>{const{__scopeAvatar:n,...r}=t,[i,a]=b.useState("idle");return l.jsx(vhe,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:a,children:l.jsx(Ke.span,{...r,ref:e})})});OU.displayName=nP;var RU="AvatarImage",DU=b.forwardRef((t,e)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...a}=t,s=AU(RU,n),o=yhe(r,a),c=Wn(u=>{i(u),s.onImageLoadingStatusChange(u)});return Ln(()=>{o!=="idle"&&c(o)},[o,c]),o==="loaded"?l.jsx(Ke.img,{...a,ref:e,src:r}):null});DU.displayName=RU;var MU="AvatarFallback",IU=b.forwardRef((t,e)=>{const{__scopeAvatar:n,delayMs:r,...i}=t,a=AU(MU,n),[s,o]=b.useState(r===void 0);return b.useEffect(()=>{if(r!==void 0){const c=window.setTimeout(()=>o(!0),r);return()=>window.clearTimeout(c)}},[r]),s&&a.imageLoadingStatus!=="loaded"?l.jsx(Ke.span,{...i,ref:e}):null});IU.displayName=MU;function RD(t,e){return t?e?(t.src!==e&&(t.src=e),t.complete&&t.naturalWidth>0?"loaded":"loading"):"error":"idle"}function yhe(t,{referrerPolicy:e,crossOrigin:n}){const r=phe(),i=b.useRef(null),a=r?(i.current||(i.current=new window.Image),i.current):null,[s,o]=b.useState(()=>RD(a,t));return Ln(()=>{o(RD(a,t))},[a,t]),Ln(()=>{const c=h=>()=>{o(h)};if(!a)return;const u=c("loaded"),d=c("error");return a.addEventListener("load",u),a.addEventListener("error",d),e&&(a.referrerPolicy=e),typeof n=="string"&&(a.crossOrigin=n),()=>{a.removeEventListener("load",u),a.removeEventListener("error",d)}},[a,n,e]),s}var LU=OU,$U=DU,FU=IU;const BC=b.forwardRef(({className:t,...e},n)=>l.jsx(LU,{ref:n,className:ce("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...e}));BC.displayName=LU.displayName;const bhe=b.forwardRef(({className:t,...e},n)=>l.jsx($U,{ref:n,className:ce("aspect-square h-full w-full",t),...e}));bhe.displayName=$U.displayName;const UC=b.forwardRef(({className:t,...e},n)=>l.jsx(FU,{ref:n,className:ce("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...e}));UC.displayName=FU.displayName;const cu=b.forwardRef(({className:t,...e},n)=>l.jsx("textarea",{className:ce("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-primary/50 focus-visible:shadow-[0_0_0_3px_hsl(var(--primary)/0.1)] transition-all disabled:cursor-not-allowed disabled:opacity-50 [&.border-0]:focus-visible:border-0 [&.border-0]:focus-visible:shadow-none [&.border-none]:focus-visible:border-none [&.border-none]:focus-visible:shadow-none",t),ref:n,...e}));
663cu.displayName="Textarea";var gw="Switch",[xhe,fBe]=Yr(gw),[whe,She]=xhe(gw),BU=b.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:s,disabled:o,value:c="on",onCheckedChange:u,form:d,...h}=t,[f,p]=b.useState(null),g=bt(e,y=>p(y)),m=b.useRef(!1),v=f?d||!!f.closest("form"):!0,[x,w]=ks({prop:i,defaultProp:a??!1,onChange:u,caller:gw});return l.jsxs(whe,{scope:n,checked:x,disabled:o,children:[l.jsx(Ke.button,{type:"button",role:"switch","aria-checked":x,"aria-required":s,"data-state":VU(x),"data-disabled":o?"":void 0,disabled:o,value:c,...h,ref:g,onClick:Ie(t.onClick,y=>{w(k=>!k),v&&(m.current=y.isPropagationStopped(),m.current||y.stopPropagation())})}),v&&l.jsx(WU,{control:f,bubbles:!m.current,name:r,value:c,checked:x,required:s,disabled:o,form:d,style:{transform:"translateX(-100%)"}})]})});BU.displayName=gw;var UU="SwitchThumb",zU=b.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,i=She(UU,n);return l.jsx(Ke.span,{"data-state":VU(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:e})});zU.displayName=UU;var khe="SwitchBubbleInput",WU=b.forwardRef(({__scopeSwitch:t,control:e,checked:n,bubbles:r=!0,...i},a)=>{const s=b.useRef(null),o=bt(s,a),c=Bj(n),u=nj(e);return b.useEffect(()=>{const d=s.current;if(!d)return;const h=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(h,"checked").set;if(c!==n&&p){const g=new Event("click",{bubbles:r});p.call(d,n),d.dispatchEvent(g)}},[c,n,r]),l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:o,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});WU.displayName=khe;function VU(t){return t?"checked":"unchecked"}var HU=BU,_he=zU;const yl=b.forwardRef(({className:t,...e},n)=>l.jsx(HU,{className:ce("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",t),...e,ref:n,children:l.jsx(_he,{className:ce("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));yl.displayName=HU.displayName;const qU=b.createContext({accessCode:null,isSharedAccess:!1});function KU({children:t,accessCode:e}){const n=!!e;return console.log("[SharedCalendarContext] Provider value:",{accessCode:e,isSharedAccess:n}),l.jsx(qU.Provider,{value:{accessCode:e,isSharedAccess:n},children:t})}function GU(){return b.useContext(qU)}function wu(){const{accessCode:t,isSharedAccess:e}=GU();return console.log("[useCalendarEvents] Context values:",{accessCode:t,isSharedAccess:e}),{fetchEvents:async(s,o)=>{if(s==="demo"){const h=localStorage.getItem("demoEvents");if(h){let f=JSON.parse(h);return o!=null&&o.startDate&&(o!=null&&o.endDate)?f=f.filter(p=>new Date(p.start_time)<o.endDate&&new Date(p.end_time)>o.startDate):o!=null&&o.startDate?f=f.filter(p=>new Date(p.end_time)>o.startDate):o!=null&&o.endDate&&(f=f.filter(p=>new Date(p.start_time)<o.endDate)),o!=null&&o.limit&&(f=f.slice(0,o.limit)),{data:f,error:null}}return{data:[],error:null}}if(e&&t){console.log("[useCalendarEvents] Using RPC for shared access, accessCode:",t);const{data:h,error:f}=await me.rpc("get_events_by_access_code",{_access_code:t});if(f)return console.error("[useCalendarEvents] Error fetching events via access code:",f),{data:null,error:f};console.log("[useCalendarEvents] RPC returned events:",(h==null?void 0:h.length)||0);let p=h||[];return o!=null&&o.startDate&&(o!=null&&o.endDate)?p=p.filter(g=>new Date(g.start_time)<o.endDate&&new Date(g.end_time)>o.startDate):o!=null&&o.startDate?p=p.filter(g=>new Date(g.end_time)>o.startDate):o!=null&&o.endDate&&(p=p.filter(g=>new Date(g.start_time)<o.endDate)),o!=null&&o.limit&&(p=p.slice(0,o.limit)),console.log("[useCalendarEvents] Filtered events:",p.length),{data:p,error:null}}console.log("[useCalendarEvents] Using direct query (owner access), isSharedAccess:",e,"accessCode:",t);let c=me.from("events").select("*").eq("calendar_id",s);o!=null&&o.startDate&&(c=c.gt("end_time",o.startDate.toISOString())),o!=null&&o.endDate&&(c=c.lt("start_time",o.endDate.toISOString())),o!=null&&o.limit&&(c=c.limit(o.limit));const{data:u,error:d}=await c.order("start_time",{ascending:!0});return{data:u,error:d}},createEvent:async(s,o)=>
663{if(s==="demo"){const d=localStorage.getItem("demoEvents"),h=d?JSON.parse(d):[],f={id:crypto.randomUUID(),calendar_id:s,...o,created_at:new Date().toISOString(),updated_at:new Date().toISOString()};return h.push(f),localStorage.setItem("demoEvents",JSON.stringify(h)),{data:{id:f.id},error:null}}if(e&&t){const{data:d,error:h}=await me.rpc("insert_event_by_access_code",{_access_code:t,_title:o.title,_start_time:o.start_time,_end_time:o.end_time,_duration:o.duration||null,_color:o.color||"blue",_notes:o.notes||null,_location:o.location||null,_participants:o.participants||null,_is_recurring:o.is_recurring||!1,_recurrence_pattern:o.recurrence_pattern||null,_recurrence_end_date:o.recurrence_end_date||null,_recurrence_parent_id:o.recurrence_parent_id||null,_created_by:o.created_by||"editor",_created_timezone:o.created_timezone||null,_illustration_url:o.illustration_url||null,_language:o.language||"nld"});return h?(console.error("Error creating event via access code:",h),{data:null,error:h}):{data:{id:d},error:null}}const{data:c,error:u}=await me.from("events").insert({calendar_id:s,...o}).select("id").single();return{data:c,error:u}},updateEvent:async(s,o,c,u)=>{if(s==="demo"){const g=localStorage.getItem("demoEvents");if(g){const m=JSON.parse(g),v=m.findIndex(x=>x.id===o);if(v!==-1){if(u&&m[v].updated_at!==u)return{success:!1,error:null,conflict:!0};m[v]={...m[v],...c,updated_at:new Date().toISOString()},localStorage.setItem("demoEvents",JSON.stringify(m))}}return{success:!0,error:null}}if(e&&t){const{data:g,error:m}=await me.rpc("update_event_by_access_code",{_access_code:t,_event_id:o,_title:c.title??null,_start_time:c.start_time??null,_end_time:c.end_time??null,_duration:c.duration??null,_color:c.color??null,_notes:c.notes??null,_location:c.location??null,_participants:c.participants??null,_is_recurring:c.is_recurring??null,_recurrence_pattern:c.recurrence_pattern??null,_recurrence_end_date:c.recurrence_end_date??null,_illustration_url:c.illustration_url??null,_expected_updated_at:u??null});if(m)return console.error("Error updating event via access code:",m),{success:!1,error:m};const v=g;return v&&v.conflict?{success:!1,error:null,conflict:!0}:{success:!0,error:null}}let d=me.from("events").update(c).eq("id",o).eq("calendar_id",s);u&&(d=d.eq("updated_at",u));const{data:h,error:f,count:p}=await d.select("id").maybeSingle();return f?{success:!1,error:f}:u&&!h?{success:!1,error:null,conflict:!0}:{success:!0,error:null}},deleteEvent:async(s,o)=>{if(s==="demo"){const u=localStorage.getItem("demoEvents");if(u){const h=JSON.parse(u).filter(f=>f.id!==o);localStorage.setItem("demoEvents",JSON.stringify(h))}return{success:!0,error:null}}if(e&&t){const{data:u,error:d}=await me.rpc("delete_event_by_access_code",{_access_code:t,_event_id:o});return d?(console.error("Error deleting event via access code:",d),{success:!1,error:d}):{success:!0,error:null}}const{error:c}=await me.from("events").delete().eq("id",o).eq("calendar_id",s);return{success:!c,error:c}},isSharedAccess:e,accessCode:t}}const YU=[{id:"alloy",name:"Alloy",description:"Neutral and balanced"},{id:"echo",name:"Echo",description:"Warm and conversational"},{id:"fable",name:"Fable",description:"Expressive and dynamic"},{id:"onyx",name:"Onyx",description:"Deep and authoritative"}
663,{id:"nova",name:"Nova",description:"Friendly and upbeat"},{id:"shimmer",name:"Shimmer",description:"Clear and gentle"}],Che=()=>{const t=localStorage.getItem("eventTTS_autoPlay");return t===null?!0:t==="true"},The=t=>{localStorage.setItem("eventTTS_autoPlay",String(t))},Ehe=()=>{const t=localStorage.getItem("eventTTS_voice"),e=YU.map(n=>n.id);return t&&e.includes(t)?t:"alloy"},jhe=t=>{localStorage.setItem("eventTTS_voice",t)},Phe=()=>{const[t,e]=b.useState(!1),[n,r]=b.useState(!1),[i,a]=b.useState(Che),[s,o]=b.useState(Ehe),c=b.useRef(null),u=b.useRef(null),{accessCode:d,isSharedAccess:h}=GU();b.useEffect(()=>()=>{m()},[]);const f=b.useCallback(()=>{const x=!i;a(x),The(x)},[i]),p=b.useCallback(x=>{o(x),jhe(x)},[]),g=b.useCallback(x=>{const w=x.language||"nld",y={nld:{locale:"nl-BE",on:"op",at:"om",until:"tot",with_:"met",note:"Opmerking:",atLocation:"bij"},eng:{locale:"en-US",on:"on",at:"at",until:"until",with_:"with",note:"Note:",atLocation:"at"},fra:{locale:"fr-BE",on:"le",at:"Ã ",until:"jusqu'Ã ",with_:"avec",note:"Note :",atLocation:"Ã "},deu:{locale:"de-DE",on:"am",at:"um",until:"bis",with_:"mit",note:"Hinweis:",atLocation:"bei"}},k=y[w]||y.nld,S=[];if(S.push(x.title),x.rawStartTime){const _=new Date(x.rawStartTime),C=_.toLocaleDateString(k.locale,{weekday:"long",month:"long",day:"numeric"}),T=_.toLocaleTimeString(k.locale,{hour:"numeric",minute:"2-digit",hour12:w==="eng"});S.push(`${k.on} ${C} ${k.at} ${T}`)}if(x.rawEndTime&&x.rawStartTime){const _=new Date(x.rawStartTime),C=new Date(x.rawEndTime);if(C.getTime()!==_.getTime()){const T=C.toLocaleTimeString(k.locale,{hour:"numeric",minute:"2-digit",hour12:w==="eng"});S.push(`${k.until} ${T}`)}}if(x.location&&S.push(`${k.atLocation} ${x.location}`),x.participants&&x.participants.length>0){const _=x.participants.join(", ");S.push(`${k.with_} ${_}`)}return x.notes&&S.push(`. ${k.note} ${x.notes}`),S.join(" ")},[]),m=b.useCallback(()=>{c.current&&(c.current.pause(),c.current.src="",c.current=null),u.current&&(u.current.abort(),u.current=null),e(!1),r(!1)},[]),v=b.useCallback(async x=>{m();const w=g(x);if(!w.trim()){Dn.error("No event details to read");return}r(!0);try{u.current=new AbortController;const y={text:w,voice:s},k={"Content-Type":"application/json",apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJybWVpZWJ4dnZlbGZraWhmYnhiIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjM5MDY0NzYsImV4cCI6MjA3OTQ4MjQ3Nn0.xexgaMCMIMNob6PK-1V-J-P0Dnu32BzaoG9HtWnyU2g"};if(h&&d)y.accessCode=d,k.Authorization="Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJybWVpZWJ4dnZlbGZraWhmYnhiIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjM5MDY0NzYsImV4cCI6MjA3OTQ4MjQ3Nn0.xexgaMCMIMNob6PK-1V-J-P0Dnu32BzaoG9HtWnyU2g";else{const{data:{session:T},error:E}=await me.auth.getSession();if(E||!T){Dn.error("Please sign in to use text-to-speech"),r(!1);return}k.Authorization=`Bearer ${T.access_token}`}const S=await fetch("https://brmeiebxvvelfkihfbxb.supabase.co/functions/v1/text-to-speech",{method:"POST",headers:k,body:JSON.stringify(y),signal:u.current.signal});if(!S.ok){const T=await S.json().catch(()=>({}));throw S.status===429?new Error("Rate limit exceeded. Please try again later."):S.status===401?new Error(T.error||"Authentication failed"):new Error(T.error||"Failed to generate speech")}const _=await S.blob(),C=URL.createObjectURL(_);c.current=new Audio(C),c.current.onended=()=>{e(!1),URL.revokeObjectURL(C)},c.current.onerror=T=>{const E=c.current;E&&(E.error||E.readyState===0)&&(e(!1),Dn.error("Failed to play audio"),console.error("Audio playback error:",E.error)),URL.revokeObjectURL(C)},r(!1),e(!0),await c.current.play()}catch(y){if(y instanceof Error&&y.name==="AbortError")return;console.error("TTS error:",y),Dn.error(y instanceof Error?y.message:"Failed to read event aloud"),r(!1),e(!1)}},[g,m,h,d,s]);return{isPlaying:t,isLoading:n,autoPlayEnabled:i,selectedVoice:s,toggleAutoPlay:f,changeVoice:p,playEventAudio:v,stopAudio:m}},Nhe=[{short:"S",full:"Sunday",value:0},{short:"M",full:"Monday",value:1},{short:"T",full:"Tuesday",value:2},{short:"W",full:"Wednesday",value:3},{short:"T",full:"Thursday",value:4},{short:"F",full:"Friday",value:5},{short:"S",full:"Saturday",value:6}
663],vw=({event:t,open:e,onOpenChange:n,cardRect:r,calendarId:i,onEventUpdated:a,canEdit:s=!0})=>{var Au;const{updateEvent:o,deleteEvent:c,isSharedAccess:u}=wu(),{isPlaying:d,isLoading:h,autoPlayEnabled:f,selectedVoice:p,toggleAutoPlay:g,changeVoice:m,playEventAudio:v,stopAudio:x}=Phe(),[w,y]=b.useState({x:0,y:0}),[k,S]=b.useState({x:0,y:0}),[_,C]=b.useState(!1),[T,E]=b.useState(!1),[j,P]=b.useState(!1),[M,U]=b.useState(!1),[N,B]=b.useState(!1),[$,I]=b.useState(!1),[R,z]=b.useState("single"),[O,A]=b.useState("single"),[L,V]=b.useState(""),[Y,Q]=b.useState(""),[re,J]=b.useState(""),[ne,G]=b.useState(""),[Z,ee]=b.useState(""),[K,oe]=b.useState([]),[W,H]=b.useState(""),[q,te]=b.useState("none"),[he,xe]=b.useState([]),[De,ge]=b.useState(""),[Re,Oe]=b.useState(null),[ye,Ct]=b.useState(!1),[le,Te]=b.useState(!1),Pe=b.useRef(null);b.useEffect(()=>{const ie=()=>Ct(window.innerWidth>=1024);return ie(),window.addEventListener("resize",ie),()=>window.removeEventListener("resize",ie)},[]);const st=(t==null?void 0:t.isRecurring)||(t==null?void 0:t.recurrenceParentId),Mt=ie=>{if(!ie)return"";try{const je=new Date(ie);if(!isNaN(je.getTime())){const Qe=je.getFullYear(),tt=String(je.getMonth()+1).padStart(2,"0"),se=String(je.getDate()).padStart(2,"0"),Ne=String(je.getHours()).padStart(2,"0"),Ae=String(je.getMinutes()).padStart(2,"0");return`${Qe}-${tt}-${se}T${Ne}:${Ae}`}}catch(je){console.error("Error formatting datetime:",je)}return""};b.useLayoutEffect(()=>{e&&r?(E(!0),P(!0),U(!1)):e&&!r&&(E(!1),P(!0),U(!1)),e||(P(!1),E(!1))},[e,r]),b.useEffect(()=>{if(e&&r&&T){const ie=requestAnimationFrame(()=>{E(!1)});return()=>cancelAnimationFrame(ie)}},[e,r,T]),b.useEffect(()=>{if(e&&t){V(t.title);const ie=Mt(t.rawStartTime),je=Mt(t.rawEndTime);if(Q(ie),!t.duration||t.startTime===t.endTime){const tt=new Date(t.rawStartTime||"");isNaN(tt.getTime())?J(je):(tt.setHours(tt.getHours()+1),J(Mt(tt.toISOString())))}else J(je);if(G(t.location||""),ee(t.notes||""),oe(t.participants||[]),H(""),B(!1),te(t.recurrencePattern||"none"),ge(t.recurrenceEndDate||""),t.rawStartTime){const tt=new Date(t.rawStartTime).getDay();xe([tt])}if((async()=>{if(t.isRecurring||t.recurrenceParentId){const tt=t.recurrenceParentId||t.id,{data:se}=await me.from("events").select("recurrence_pattern, recurrence_end_date").eq("id",tt).maybeSingle();se&&(te(se.recurrence_pattern||"none"),ge(se.recurrence_end_date||""),Oe({pattern:se.recurrence_pattern||"none",endDate:se.recurrence_end_date||""}))}})(),setTimeout(()=>{const tt=document.querySelector("textarea");tt&&(tt.style.height="auto",tt.style.height=tt.scrollHeight+"px")},0),f&&!N&&i!=="demo"){const tt=setTimeout(()=>{v(t)},500);return()=>clearTimeout(tt)}}},[e,t]),b.useEffect(()=>{(!e||N)&&x()},[e,N,x]);const yn=ie=>{xe(je=>je.includes(ie)?je.filter(Qe=>Qe!==ie):[...je,ie].sort((Qe,tt)=>Qe-tt))},Kn=q==="weekly"||q==="biweekly";if(!t)return null;const an=()=>{if(t.colorSet)return"";switch(t.color){case"mint":return"bg-calendar-mint";case"blue":return"bg-calendar-blue";case"peach":return"bg-calendar-peach";case"gray":return"bg-calendar-gray";case"oatmeal":return"bg-calendar-oatmeal";case"coral":return"bg-calendar-coral";case"sea":return"bg-calendar-sea";case"chartreuse":return"bg-calendar-chartreuse";default:return"bg-background"}},He=()=>t.colorSet?{backgroundColor:t.colorSet.background}:{},hi=()=>r?{top:`${r.top}px`,left:`${r.left}px`,width:`${r.width}px`,height:`${r.height}px`,borderRadius:"24px"}:{},fi=()=>({top:"0px",left:"0px",width:"100vw",height:"100vh",borderRadius:"0px"}),yr=()=>{if(!r){n(!1);return}U(!0),setTimeout(()=>{n(!1),U(!1)},250)},Lf=ie=>{const je=ie.targetTouches[0];y({x:je.clientX,y:je.clientY}),S({x:je.clientX,y:je.clientY}),C(!1)},ju=ie=>{const je=ie.targetTouches[0];S({x:je.clientX,y:je.clientY});const Qe=Math.abs(je.clientY-w.y),tt=Math.abs(je.clientX-w.x);Qe>10&&Qe>tt&&C(!0)},Pu=()=>{const je=k.y-w.y>150,Qe=w.y<100;je&&Qe&&!_&&yr(),y({x:0,y:0}),S({x:0,y:0}),C(!1)},Nu=async()=>{if(!(!t||!i))try{const ie=Y?new Date(Y).toISOString():null,je=re?new Date(re).toISOString():null,Qe=K.length>0?K:null,tt=t.rawUpdatedAt||void 0;if(u){const se={title:L,location:ne||null,notes:Z||null,participants:Qe};(!st||O==="single")&&(se.start_time=ie,se.end_time=je),st&&O==="single"&&(se.is_recurring=!1,se.recurrence_pattern=null);const Ne=await o(i,t.id,se,tt);if(Ne.conflict){Dn.error("This event was modified by someone else. Please close and reopen to see the latest version.",{icon:l.jsx(bc,{className:"h-4 w-4"}),duration:6e3});return}if(Ne.error)throw Ne.error;B(!1),n(!1),a==null||a();return}if(st&&O==="single"){const{data:se,error:Ne}=await me.from("events").update({title:L,start_time:ie,end_time:je,location:ne||null,notes:Z||null,participants:Qe,is_recurring:!1,recurrence_pattern:null,recurrence_parent_id:null,recurrence_end_date:null}).eq("id",t.id).eq("updated_at",tt||"").select("id").maybeSingle();if(Ne)throw Ne;if(tt&&!se){Dn.error("This event was modified by someone else. Please close and reopen to see the latest version.",{icon:l.jsx(bc,{className:"h-4 w-4"}),duration:6e3});return}}else if(st&&O==="all"){const se=t.recurrenceParentId||t.id;if(q!==(Re==null?void 0:Re.pattern)||De!==(Re==null?void 0:Re.endDate)){const{error:Ae}=await me.from("events").update({title:L,location:ne||null,notes:Z||null,participants:Qe,recurrence_pattern:q==="none"?null:q,recurrence_end_date:De||null,is_recurring:q!=="none"}).eq("id",se);
663if(Ae)throw Ae;const{error:Be}=await me.from("events").update({title:L,location:ne||null,notes:Z||null,participants:Qe}).eq("recurrence_parent_id",se);if(Be)throw Be}else{const{error:Ae}=await me.from("events").update({title:L,location:ne||null,notes:Z||null,participants:Qe}).or(`id.eq.${se},recurrence_parent_id.eq.${se}`);if(Ae)throw Ae}}else{let se=me.from("events").update({title:L,start_time:ie,end_time:je,location:ne||null,notes:Z||null,participants:Qe}).eq("id",t.id);tt&&(se=se.eq("updated_at",tt));const{data:Ne,error:Ae}=await se.select("id").maybeSingle();if(Ae)throw Ae;if(tt&&!Ne){Dn.error("This event was modified by someone else. Please close and reopen to see the latest version.",{icon:l.jsx(bc,{className:"h-4 w-4"}),duration:6e3});return}}B(!1),n(!1),a==null||a()}catch(ie){console.error("Error updating event:",ie)}},Qc=()=>{I(!0)},Li=async()=>{if(!(!t||!i))try{if(u){const{error:ie}=await c(i,t.id);if(ie)throw ie;st&&R==="all"&&console.log("Series deletion for shared access - only current event deleted"),I(!1),n(!1),a==null||a();return}if(st&&R==="all"){const ie=t.recurrenceParentId||t.id,{error:je}=await me.from("events").delete().or(`id.eq.${ie},recurrence_parent_id.eq.${ie}`);if(je)throw je}else{const{error:ie}=await me.from("events").delete().eq("id",t.id);if(ie)throw ie}I(!1),n(!1),a==null||a()}catch(ie){console.error("Error deleting event:",ie)}};return l.jsxs(l.Fragment,{children:[l.jsx(Za,{open:e,onOpenChange:ie=>!ie&&yr(),children:l.jsxs(Rj,{children:[ye&&!T&&!M&&l.jsx("div",{className:"fixed inset-0 bg-black/50 z-[99]",onClick:yr}),l.jsxs(Yg,{ref:Pe,className:`border-none ${an()} lg:rounded-3xl lg:shadow-2xl data-[state=open]:animate-none data-[state=closed]:animate-none`,style:{position:"fixed",maxWidth:"none",zIndex:100,...He(),...ye?{}:(T||M)&&r?{...hi(),transition:"top 0.28s cubic-bezier(0.22, 1, 0.36, 1), left 0.28s cubic-bezier(0.22, 1, 0.36, 1), width 0.28s cubic-bezier(0.22, 1, 0.36, 1), height 0.28s cubic-bezier(0.22, 1, 0.36, 1), border-radius 0.2s ease-out"}:{...fi(),transition:"top 0.28s cubic-bezier(0.22, 1, 0.36, 1), left 0.28s cubic-bezier(0.22, 1, 0.36, 1), width 0.28s cubic-bezier(0.22, 1, 0.36, 1), height 0.28s cubic-bezier(0.22, 1, 0.36, 1), border-radius 0.2s ease-out"},...ye?(T||M)&&r?{top:`${r.top}px`,left:`${r.left}px`,width:`${r.width}px`,height:`${r.height}px`,borderRadius:"24px",transform:"none",opacity:M?.95:1,transition:"none"}:{top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"min(90vw, 600px)",height:"auto",maxHeight:"90vh",borderRadius:"24px",opacity:1,transition:"top 0.32s cubic-bezier(0.22, 1, 0.36, 1), left 0.32s cubic-bezier(0.22, 1, 0.36, 1), width 0.32s cubic-bezier(0.22, 1, 0.36, 1), height 0.32s cubic-bezier(0.22, 1, 0.36, 1), transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), border-radius 0.25s ease-out, opacity 0.15s ease-in"}:{}},onPointerDownOutside:ie=>{ie.preventDefault()},onInteractOutside:ie=>{ye?yr():ie.preventDefault()},onEscapeKeyDown:yr,children:[l.jsxs("button",{onClick:yr,className:"absolute right-4 top-4 lg:right-6 lg:top-6 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 z-10",style:{opacity:T||M?0:.7,transition:"opacity 0.2s"},children:[l.jsx(vo,{className:"h-4 w-4 lg:h-5 lg:w-5 text-foreground"}),l.jsx("span",{className:"sr-only",children:"Close"})]}),l.jsx("div",{className:"absolute top-0 left-0 right-0 h-16 flex items-center justify-center lg:hidden",onTouchStart:Lf,onTouchMove:ju,onTouchEnd:Pu,style:{touchAction:"none"}
663,children:l.jsx("div",{className:"w-12 h-1.5 bg-foreground/20 rounded-full animate-pulse",style:{opacity:T||M?0:1,transition:"opacity 0.2s"}})}),l.jsxs(Es,{className:"sr-only",children:["Event details for ",t.title]}),l.jsxs("div",{className:"overflow-y-auto p-6 md:p-8 lg:p-10 pt-16 pb-24 lg:pt-8 lg:pb-6",style:{opacity:T||M?0:1,transition:T?"none":"opacity 0.15s ease-in",transitionDelay:T||M?"0ms":"150ms",touchAction:"pan-y",WebkitOverflowScrolling:"touch",...ye?{position:"relative",maxHeight:"90vh"}:{position:"absolute",top:0,left:0,right:0,bottom:0},overscrollBehavior:"contain"},children:[l.jsx(na,{className:"text-left",children:l.jsx("div",{className:"flex items-start justify-between gap-2 w-full",children:l.jsx("div",{className:"flex-1 min-w-0 max-w-full overflow-hidden",children:N?l.jsx(cu,{value:L,onChange:ie=>V(ie.target.value),className:"text-2xl md:text-3xl font-bold text-foreground bg-transparent border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 focus-visible:shadow-none shadow-none px-0 resize-none overflow-hidden leading-tight w-full",placeholder:"Event title",rows:2,style:{minHeight:"60px",wordBreak:"break-word"},onInput:ie=>{ie.currentTarget.style.height="auto",ie.currentTarget.style.height=ie.currentTarget.scrollHeight+"px"}}):l.jsx(ra,{className:"text-xl md:text-2xl font-bold text-foreground leading-tight",style:{wordBreak:"break-word",overflowWrap:"break-word",hyphens:"auto"},children:t.title})})})}),!N&&l.jsxs("div",{className:"mt-2 mb-6 md:mb-8",children:[l.jsxs("button",{onClick:()=>Te(!le),className:`flex items-center gap-1.5 text-xs transition-colors ${d?"text-primary":"text-muted-foreground hover:text-foreground"}`,"aria-label":le?"Hide audio options":"Show audio options",children:[d?l.jsxs("div",{className:"flex items-center gap-[3px] h-3.5",children:[l.jsx("span",{className:"w-[3px] h-2 bg-primary rounded-full animate-[soundwave_0.6s_ease-in-out_infinite]"}),l.jsx("span",{className:"w-[3px] h-3 bg-primary rounded-full animate-[soundwave_0.6s_ease-in-out_infinite]",style:{animationDelay:"150ms"}}),l.jsx("span",{className:"w-[3px] h-2 bg-primary rounded-full animate-[soundwave_0.6s_ease-in-out_infinite]",style:{animationDelay:"300ms"}})]}):l.jsx(AO,{className:"h-3.5 w-3.5"}),l.jsx("span",{children:d?"Playing...":"Audio"}),l.jsx("svg",{className:`h-3 w-3 transition-transform ${le?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),le&&l.jsxs("div",{className:"flex items-center gap-2 py-2 px-3 rounded-lg bg-foreground
663/5 mt-2 animate-fade-in",children:[l.jsxs(de,{variant:"ghost",size:"sm",onClick:()=>d?x():v(t),disabled:h,className:"h-8 px-2 gap-1.5 text-sm shrink-0","aria-label":d?"Stop reading":"Read aloud",children:[h?l.jsx(Er,{className:"h-4 w-4 animate-spin"}):d?l.jsx(jZ,{className:"h-4 w-4"}):l.jsx(AO,{className:"h-4 w-4"}),l.jsx("span",{className:"hidden sm:inline",children:h?"...":d?"Stop":"Play"})]}),l.jsxs(bh,{value:p,onValueChange:m,children:[l.jsx(au,{className:"h-8 w-24 text-xs bg-background border-0 shadow-none",children:l.jsx(xh,{placeholder:"Voice"})}),l.jsx(su,{className:"bg-background z-[9999]",position:"popper",sideOffset:4,children:YU.map(ie=>l.jsx(Bt,{value:ie.id,className:"text-sm",children:ie.name},ie.id))})]}),l.jsxs("div",{className:"flex items-center gap-1.5 ml-auto",children:[l.jsx("span",{className:"text-xs text-muted-foreground hidden sm:inline",children:"Auto"}),l.jsx(yl,{id:"auto-play-toggle",checked:f,onCheckedChange:g,"aria-label":"Toggle auto-play",className:"scale-75"})]})]})]}),l.jsxs("div",{className:"space-y-4 md:space-y-6 pt-4 md:pt-6 border-t border-foreground
663/10",children:[(t.startTime||t.endTime||t.time)&&l.jsxs("div",{className:"space-y-2 md:space-y-3",children:[t.time&&!N&&l.jsx("div",{className:"flex items-center gap-2 md:gap-3",children:l.jsxs("div",{children:[l.jsx("p",{className:"text-xs md:text-sm text-foreground/70",children:"Date"}),l.jsx("p",{className:"text-base md:text-lg font-semibold text-foreground",children:t.rawStartTime?new Date(t.rawStartTime).toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric",year:"numeric"}):t.time})]})}),(t.startTime||N)&&l.jsxs("div",{className:"space-y-1 pb-4",children:[l.jsx("p",{className:"text-sm md:text-base text-foreground/70",children:"Start Time"}),N?l.jsxs("div",{className:"space-y-2",children:[l.jsx(qt,{type:"date",value:Y.split("T")[0],onChange:ie=>{const je=Y.split("T")[1]||"00:00";Q(`${ie.target.value}T${je}`)},className:"text-4xl md:text-5xl font-semibold text-foreground bg-transparent border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 focus-visible:shadow-none shadow-none px-0 w-full [text-align:left]",style:{WebkitAppearance:"none",MozAppearance:"textfield",textAlign:"left"}}),l.jsx(qt,{type:"time",value:Y.split("T")[1]||"",onChange:ie=>{const je=Y.split("T")[0]||new Date().toISOString().split("T")[0];Q(`${je}T${ie.target.value}`)},className:"text-4xl md:text-5xl font-semibold text-foreground bg-transparent border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 focus-visible:shadow-none shadow-none px-0 w-full [text-align:left]",style:{WebkitAppearance:"none",MozAppearance:"textfield",textAlign:"left"}})]}):l.jsx("p",{className:"text-base md:text-lg font-semibold text-foreground",children:t.startTime})]}),(t.endTime||N)&&l.jsxs("div",{className:"space-y-1 pb-4",children:[l.jsx("p",{className:"text-sm md:text-base text-foreground/70",children:"End Time"}),N?l.jsxs("div",{className:"space-y-2",children:[l.jsx(qt,{type:"date",value:re.split("T")[0],onChange:ie=>{const je=re.split("T")[1]||"00:00";J(`${ie.target.value}T${je}`)},className:"text-4xl md:text-5xl font-semibold text-foreground bg-transparent border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 focus-visible:shadow-none shadow-none px-0 w-full italic [text-align:left]",style:{WebkitAppearance:"none",MozAppearance:"textfield",textAlign:"left"}}),l.jsx(qt,{type:"time",value:re.split("T")[1]||"",onChange:ie=>{const je=re.split("T")[0]||new Date().toISOString().split("T")[0];J(`${je}T${ie.target.value}`)},className:"text-4xl md:text-5xl font-semibold text-foreground bg-transparent border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 focus-visible:shadow-none shadow-none px-0 w-full italic [text-align:left]",style:{WebkitAppearance:"none",MozAppearance:"textfield",textAlign:"left"}})]}):l.jsx("p",{className:`text-base md:text-lg ${!t.duration||t.startTime===t.endTime?"font-thin":"font-semibold"}`,style:{color:!t.duration||t.startTime===t.endTime?`hsl(${t.colorSet.icon})`:"hsl(var(--foreground))",opacity:!t.duration||t.startTime===t.endTime?.4:1},children:t.endTime})]}),t.duration&&!N&&l.jsxs("div",{className:"space-y-1 pb-4",children:[l.jsx("p",{className:"text-sm md:text-base text-foreground/70",children:"Duration"}),l.jsx("p",{className:"text-base md:text-lg font-semibold text-foreground",children:t.duration})]}),(t.location||N)&&l.jsxs("div",{className:"space-y-1 pb-4",children:[l.jsx("p",{className:"text-sm md:text-base text-foreground/70",children:"Location"}),N?l.jsx(qt,{type:"text",value:ne,onChange:ie=>G(ie.target.value),className:"text-base md:text-lg text-foreground bg-transparent border-0 focus-visible:ring-0 focus-visible:ring-offset-0 shadow-none px-0 w-full placeholder:font-extralight placeholder:text-muted-foreground/40",placeholder:"Add location..."}):t.location&&l.jsx("p",{className:"text-base md:text-lg font-semibold text-foreground",children:t.location})]}),(t.notes||N)&&l.jsxs("div",{className:"space-y-1 pb-4",children:[l.jsx("p",{className:"text-sm md:text-base text-foreground/70",children:"Notes"}),N?l.jsx(cu,{value:Z,onChange:ie=>ee(ie.target.value),className:"text-base md:text-lg text-foreground bg-transparent border-0 focus-visible:ring-0 focus-visible:ring-offset-0 shadow-none px-0 w-full resize-none placeholder:font-extralight placeholder:text-muted-foreground
663/40",placeholder:"Add notes...",rows:3,onInput:ie=>{ie.currentTarget.style.height="auto",ie.currentTarget.style.height=ie.currentTarget.scrollHeight+"px"}}):t.notes&&l.jsx("p",{className:"text-base md:text-lg text-foreground whitespace-pre-wrap",children:t.notes})]}),t.participants&&t.participants.length>0||N?l.jsxs("div",{className:"space-y-2 pb-4",children:[l.jsx("p",{className:"text-sm md:text-base text-foreground/70",children:"Participants"}),N?l.jsxs("div",{className:"space-y-3",children:[l.jsx("div",{className:"flex flex-wrap gap-2",children:K.map((ie,je)=>{const Qe=ie.split(" ").map(tt=>tt[0]).join("").toUpperCase().slice(0,2);return l.jsxs("div",{className:"flex items-center gap-2 bg-foreground/5 rounded-full pl-1 pr-2 py-1",children:[l.jsx(BC,{className:"h-6 w-6",children:l.jsx(UC,{className:"text-xs bg-foreground/10 text-foreground",children:Qe})}),l.jsx("span",{className:"text-sm text-foreground",children:ie}),l.jsx("button",{type:"button",onClick:()=>oe(tt=>tt.filter((se,Ne)=>Ne!==je)),className:"w-5 h-5 rounded-full bg-foreground
663/10 hover:bg-foreground/20 flex items-center justify-center transition-colors",children:l.jsx(vo,{className:"w-3 h-3 text-foreground/70"})})]},je)})}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(qt,{type:"text",value:W,onChange:ie=>H(ie.target.value),onKeyDown:ie=>{ie.key==="Enter"&&W.trim()&&(ie.preventDefault(),oe(je=>[...je,W.trim()]),H(""))},className:"flex-1 text-base text-foreground bg-transparent border-foreground/20 focus-visible:ring-foreground/30 placeholder:text-foreground/40",placeholder:"Add participant..."}),l.jsx(de,{type:"button",variant:"outline",size:"sm",onClick:()=>{W.trim()&&(oe(ie=>[...ie,W.trim()]),H(""))},disabled:!W.trim(),className:"border-foreground/20 text-foreground hover:bg-foreground/10",children:"Add"})]})]}):l.jsx("div",{className:"flex flex-wrap gap-2",children:(Au=t.participants)==null?void 0:Au.map((ie,je)=>{const Qe=ie.split(" ").map(tt=>tt[0]).join("").toUpperCase().slice(0,2);return l.jsxs("div",{className:"flex items-center gap-2 bg-foreground/5 rounded-full pl-1 pr-3 py-1",children:[l.jsx(BC,{className:"h-6 w-6",children:l.jsx(UC,{className:"text-xs bg-foreground
663/10 text-foreground",children:Qe})}),l.jsx("span",{className:"text-sm text-foreground",children:ie})]},je)})})]}):null]}),(st||t.createdTimezone)&&!N&&l.jsxs("div",{className:"mt-6 pt-4 border-t border-foreground/10 space-y-3",children:[st&&l.jsxs("div",{className:"flex items-center gap-2 text-sm text-foreground/70",children:[l.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),l.jsx("span",{children:"Recurring event"})]}),t.createdTimezone&&l.jsxs("div",{className:"flex items-center gap-2 text-sm text-foreground/70",children:[l.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),l.jsxs("span",{children:["Created in ",t.createdTimezone.replace(/_/g," ")]})]})]}),N&&O==="all"&&st&&l.jsxs("div",{className:"mt-6 pt-4 border-t border-foreground
663/10 space-y-4",children:[l.jsx("p",{className:"text-sm text-foreground/70",children:"Recurrence Settings"}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{className:"text-xs text-foreground/50",children:"Pattern"}),l.jsxs(bh,{value:q,onValueChange:te,children:[l.jsx(au,{className:"w-full bg-transparent border-foreground/20",children:l.jsx(xh,{placeholder:"Select pattern"})}),l.jsxs(su,{children:[l.jsx(Bt,{value:"none",children:"No recurrence"}),l.jsx(Bt,{value:"daily",children:"Daily"}),l.jsx(Bt,{value:"weekly",children:"Weekly"}),l.jsx(Bt,{value:"biweekly",children:"Bi-weekly"}),l.jsx(Bt,{value:"monthly",children:"Monthly"}),l.jsx(Bt,{value:"yearly",children:"Yearly"})]})]})]}),Kn&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{className:"text-xs text-foreground/50",children:"Repeat on"}),l.jsx("div",{className:"flex gap-1",children:Nhe.map(ie=>l.jsx("button",{type:"button",onClick:()=>yn(ie.value),className:`w-9 h-9 rounded-full text-sm font-medium transition-colors ${he.includes(ie.value)?"bg-foreground text-background":"bg-foreground
663/10 text-foreground hover:bg-foreground/20"}`,title:ie.full,children:ie.short},ie.value))})]}),q!=="none"&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{className:"text-xs text-foreground/50",children:"End date"}),l.jsx(qt,{type:"date",value:De,onChange:ie=>ge(ie.target.value),className:"bg-transparent border-foreground/20"})]})]}),i&&s&&l.jsx("div",{className:"mt-8",children:N?l.jsxs("div",{className:"space-y-4",children:[st&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{className:"text-sm text-foreground/70",children:"Apply changes to:"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(de,{onClick:()=>A("single"),variant:O==="single"?"default":"outline",className:"flex-1",size:"sm",children:"This event"}),l.jsx(de,{onClick:()=>A("all"),variant:O==="all"?"default":"outline",className:"flex-1",size:"sm",children:"All events"})]})]}),l.jsxs("div",{className:"flex gap-3",children:[l.jsx(de,{onClick:()=>{B(!1),A("single"),V(t.title),Q(Mt(t.rawStartTime)),J(Mt(t.rawEndTime)),G(t.location||""),ee(t.notes||""),te((Re==null?void 0:Re.pattern)||"none"),ge((Re==null?void 0:Re.endDate)||"")},variant:"outline",className:"flex-1",children:"Cancel"}),l.jsx(de,{onClick:Nu,variant:"outline",className:"flex-1",children:"Confirm"})]})]}):l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("button",{onClick:Qc,className:"text-sm text-red-600 hover:text-red-700 font-medium transition-colors",children:"Delete"}),l.jsxs("button",{onClick:()=>
663B(!0),className:"w-12 h-12 rounded-full bg-foreground/10 hover:bg-foreground/20 flex items-center justify-center transition-colors",children:[l.jsx(Mx,{className:"h-5 w-5 text-foreground"}),l.jsx("span",{className:"sr-only",children:"Edit"})]})]})})]})]})]})]})}),l.jsx(Fj,{open:$,onOpenChange:I,children:l.jsxs(nw,{children:[l.jsxs(rw,{children:[l.jsx(aw,{children:"Delete Event"}),l.jsx(sw,{children:st?l.jsxs("div",{className:"space-y-3",children:[l.jsx("p",{children:"This is a recurring event. What would you like to delete?"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(de,{onClick:()=>z("single"),variant:R==="single"?"default":"outline",size:"sm",className:"flex-1",children:"This event"}),l.jsx(de,{onClick:()=>z("all"),variant:R==="all"?"default":"outline",size:"sm",className:"flex-1",children:"All events"})]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:R==="single"?"Only this occurrence will be deleted.":"All occurrences in this series will be deleted."})]}):l.jsxs("p",{children:['Are you sure you want to delete "',t.title,'"? This action cannot be undone.']})})]}),l.jsxs(iw,{children:[l.jsx(cw,{onClick:()=>z("single"),children:"Cancel"}),l.jsx(ow,{onClick:Li,className:"bg-red-600 hover:bg-red-700",children:"Delete"})]})]})})]})},Ahe=()=>{const t=[{title:"Revalidation Session",startTime:"9:00 am",endTime:"10:30 am",duration:"1.5 hours",color:"mint",icon:$p},{title:"Nurse Visit",startTime:"2:00 pm",endTime:"2:45 pm",duration:"45 min",color:"blue",icon:j0},{title:"Family Doctor",startTime:"4:30 pm",endTime:"5:15 pm",duration:"45 min",color:"chartreuse",icon:Ql}];return l.jsxs("div",{className:"relative",children:[l.jsxs("div",{className:"text-center mb-6 space-y-1",children:[l.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"No events yet"}),l.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Here's how your events will look"})]}),l.jsx("div",{className:"relative h-[340px] flex items-center justify-center",children:t.map((e,n)=>{const r=e.icon,i=n===0?-6:n===1?0:6,a=1,s=30-n*10,o=n*-35,c=n*28;return l.jsxs("div",{className:`absolute w-full max-w-[260px] rounded-2xl p-4 border-2 border-dashed opacity-90 shadow-lg transition-all duration-700 ease-out ${e.color==="mint"?"bg-calendar-mint border-calendar-mint-dark/30":e.color==="blue"?"bg-calendar-blue border-calendar-blue-dark/30":"bg-calendar-chartreuse border-calendar-chartreuse-dark/30"}`,style:{transform:`rotate(${i}deg) scale(${a}) translateY(${o}px) translateX(${c}px)`,zIndex:s,animation:`spreadCards 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) ${n*.15}s both`},children:[l.jsx("div",{className:"flex items-start justify-between mb-3",children:l.jsx("h3",{className:"text-base font-bold leading-tight text-foreground",children:e.title})}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-start gap-1.5",children:[l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-base font-bold text-foreground leading-tight",children:e.startTime}),l.jsx("p",{className:"text-[9px] text-foreground/50",children:"Start"})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-base font-bold text-foreground leading-tight",children:e.endTime}),l.jsx("p",{className:"text-[9px] text-foreground/50",children:"End"})]})]}),l.jsxs("div",{className:"relative flex flex-col justify-center h-[48px] pt-[2px]",children:[l.jsx("div",{className:"w-[2px] h-full bg-foreground
663/20 rounded-full"}),l.jsx("div",{className:"absolute left-2.5 top-1/2 -translate-y-1/2",children:l.jsx("p",{className:"text-[10px] font-medium text-foreground/60 whitespace-nowrap",children:e.duration})})]})]}),l.jsx("div",{className:"flex-shrink-0",children:l.jsx("div",{className:`w-14 h-14 rounded-full flex items-center justify-center ${e.color==="mint"?"bg-calendar-mint-dark/20":e.color==="blue"?"bg-calendar-blue-dark/20":"bg-calendar-chartreuse-dark/20"}`,children:l.jsx("div",{className:"text-foreground/80",children:l.jsx(r,{className:"w-7 h-7",strokeWidth:2})})})})]})]},n)})}),l.jsx("p",{className:"text-xs text-center text-muted-foreground/50 mt-4",children:"Add your first event to get started"})]})},yw=({show:t,onHide:e})=>{const[n,r]=b.useState(!1);return b.useEffect(()=>{if(t){r(!0);const i=setTimeout(()=>{r(!1),setTimeout(e,300)},2e3);return()=>clearTimeout(i)}},[t,e]),!t&&!n?null:l.jsxs("div",{className:`fixed top-20 right-4 md:right-8 z-50 flex items-center gap-2 px-4 py-2 rounded-full bg-primary/90 backdrop-blur-sm shadow-lg transition-all duration-300 ${n?"opacity-100 translate-y-0":"opacity-0 -translate-y-2"}`,children:[l.jsx(p$,{className:"w-4 h-4 text-primary-foreground animate-scale-in"}),l.jsx("span",{className:"text-sm font-medium text-primary-foreground",children:"Calendar synced"}),l.jsx("div",{className:"absolute inset-0 rounded-full border-2 border-primary-foreground/30 animate-ping"})]})},VS=()=>l.jsxs("div",{className:"rounded-3xl p-5 md:p-6 bg-muted/50 animate-pulse",children:[l.jsx(Wt,{className:"h-7 w-3/4 mb-4"}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("div",{className:"flex items-start gap-2",children:l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsxs("div",{children:[l.jsx(Wt,{className:"h-6 w-20 mb-1"}),l.jsx(Wt,{className:"h-3 w-10"})]}),l.jsxs("div",{children:[l.jsx(Wt,{className:"h-6 w-20 mb-1"}),l.jsx(Wt,{className:"h-3 w-10"})]})]})}),l.jsx(Wt,{className:"h-12 w-12 rounded-full"})]})]}),Ohe=()=>l.jsxs("div",{className:"space-y-3",children:[l.jsx(VS,{}),l.jsx(VS,{}),l.jsx(VS,{})]});function bw(t){const e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:{r:0,g:0,b:0}}function rP(t,e,n){t/=255,e/=255,n/=255;const r=Math.max(t,e,n),i=Math.min(t,e,n);let a=0,s=0;const o=(r+i)/2;if(r!==i){const c=r-i;switch(s=o>.5?c/(2-r-i):c/(r+i),r){case t:a=((e-n)/c+(e<n?6:0))/6;break;case e:a=((n-t)/c+2)/6;break;case n:a=((t-e)/c+4)/6;break}}return{h:Math.round(a*360),s:Math.round(s*100),l:Math.round(o*100)}}function Rhe(t){const e=bw(t),n=rP(e.r,e.g,e.b);return`${n.h} ${n.s}% ${n.l}%`}function Dhe(t){const e=bw(t),n=rP(e.r,e.g,e.b),r=Math.min(n.l+12,95);return`${n.h} ${n.s}% ${r}%`}function Mhe(t){const e=bw(t),n=rP(e.r,e.g,e.b),r=Math.max(n.l-50,10);return`${n.h} ${n.s}% ${r}%`}function Ihe(t){const e=bw(t),[n,r,i]=[e.r,e.g,e.b].map(a=>(a/=255,a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4)));return .2126*n+.7152*r+.0722*i}function Lhe(t){return Ihe(t)>.45}const $he={romantic:["#E4D9EF","#C8D9E8","#F4DADF","#E4E8DE","#F9E5D5","#DCDCCD","#FFB5C5","#DCCEE4","#F5D7C6","#C9B7D7"],warm:["#EAC5C5","#A8B8C8","#E8A48F","#D79890","#EAD3A4","#DDE6A3","#C7BEDD","#E9D5A8","#B9BE96","#E8C079"],bold:["#F5B8C8","#88B4D4","#FF9F7C","#A8D5A3","#FFD89B","#E8E89B","#D4A5E8","#FFC89B","#9B7AB8","#FFB86C"],natural:["#B9B0C9","#A8B0B8","#C9B8A8","#A8C0A8","#C8C0B0","#B0C8C0","#B7A9BB","#C0B8A0","#A0B0C0","#B8A8B0"]};function Fhe(t){let e=0;for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return Math.abs(e)}function Bhe(t,e="romantic"){const n=t.toLowerCase(),r=vU[e].colors;for(const[i,a]of Object.entries(r))if(n.includes(i))return a;return null}function Uhe(t,e="romantic"){const n=$he[e],r=Fhe(t)%n.length;return n[r]}function ev(t,e="romantic"){const r=Bhe(t,e)||Uhe(t,e),i=Rhe(r),a=Lhe(r);return{background:r,backgroundHsl:i,iconCircle:Dhe(r),icon:Mhe(r),textClass:a?"text-gray-900":"text-white"}}function xw(t,e,n){const r=new Date(t.start_time),i=new Date(t.end_time),a=i;if(gn(r,a)){const u=$e(r,"yyyy-MM-dd");return[{raw:t,dateKey:u,date:r,displayStart:r,displayEnd:i,isContinuation:!1,continuesNext:!1,isMultiDay:!1}]}const s=[];let o=Qn($m(r,e)?r:e);const c=Qn(tP(a,n)?a:n);for(;!$m(o,c);){const u=gn(o,Qn(r)),d=gn(o,Qn(a));if(d&&!u&&i.getHours()===0&&i.getMinutes()===0)break;const h=u?r:Qn(o),f=d?i:Rc(o);s.push({raw:t,dateKey:$e(o,"yyyy-MM-dd"),date:o,displayStart:h,displayEnd:f,isContinuation:!u,continuesNext:!d,isMultiDay:!0}
663),o=jn(o,1)}return s}const Ch=({calendarId:t,canEdit:e,onTodayStatusChange:n,onResetToToday:r})=>{const[i,a]=b.useState([]),[s,o]=b.useState(null),[c,u]=b.useState(!1),[d,h]=b.useState(null),[f,p]=b.useState(!0),[g,m]=b.useState(new Date),[v,x]=b.useState(null),[w,y]=b.useState(null),[k,S]=b.useState(null),[_,C]=b.useState({}),[T,E]=b.useState(!1),j=b.useRef({}),{palette:P}=bf(),{fetchEvents:M,isSharedAccess:U}=wu(),{isSimplified:N}=OF();b.useEffect(()=>{const W={};i.forEach(H=>{const q=j.current[H.id];if(q!=null&&q.start&&(q!=null&&q.end)){const te=q.start.getBoundingClientRect(),he=q.end.getBoundingClientRect();W[H.id]=he.bottom-te.top}}),C(W)},[i]),b.useEffect(()=>{R()},[t,g,P]),b.useEffect(()=>{if(t==="demo"||f||U)return;const W=setTimeout(()=>{const H=me.channel("events-changes").on("postgres_changes",{event:"*",schema:"public",table:"events",filter:`calendar_id=eq.${t}`},q=>{console.log("Realtime event change detected:",q),E(!0),R()}).subscribe();return()=>{me.removeChannel(H)}},500);return()=>clearTimeout(W)},[t,g,P,f,U]),b.useEffect(()=>{const W=$C(g);n&&n(W)},[g,n]),b.useEffect(()=>(r&&(window.__resetToToday=()=>m(new Date)),window.__navigateToDate=W=>m(W),()=>{delete window.__navigateToDate}),[r]);const[B,$]=b.useState(null);b.useEffect(()=>{const W=H=>{const q=H.detail;q!=null&&q.eventId&&(q.startTime&&m(new Date(q.startTime)),$(q.eventId))};return window.addEventListener("careable:open-event",W),()=>window.removeEventListener("careable:open-event",W)},[]),b.useEffect(()=>{if(!B||i.length===0)return;const W=i.find(H=>H.id===B);W&&(o(W),h(null),u(!0),$(null))},[B,i]);const I=(W,H)=>{const q=Qn(H),te=Rc(H),he=[];return W.forEach(xe=>{const De=xw(xe,q,te),ge=$e(H,"yyyy-MM-dd");De.forEach(Re=>{if(Re.dateKey!==ge)return;const Oe=Re.displayStart,ye=Re.displayEnd,Ct=ye.getTime()-Oe.getTime(),le=Math.floor(Ct/(1e3*60*60)),Te=Math.floor(Ct%(1e3*60*60)/(1e3*60));let Pe="";Re.isMultiDay&&Re.isContinuation?Pe="All day":le>0&&Te>0?Pe=`${le}h ${Te}m`:le>0?Pe=`${le}h`:Te>0&&(Pe=`${Te}m`);const st=ev(xe.title,P);he.push({id:Re.isContinuation?`${xe.id}-${Re.dateKey}`:xe.id,title:xe.title,startTime:Re.isContinuation?"12:00 AM":$e(Oe,"h:mm a"),endTime:Re.continuesNext?"11:59 PM":$e(ye,"h:mm a"),duration:Pe,color:xe.color||"blue",participants:xe.participants||void 0,rawStartTime:xe.start_time,rawEndTime:xe.end_time,rawUpdatedAt:xe.updated_at,notes:xe.notes||void 0,location:xe.location||void 0,colorSet:st,isRecurring:xe.is_recurring||!1,recurrencePattern:xe.recurrence_pattern||void 0,recurrenceParentId:xe.recurrence_parent_id||void 0,createdTimezone:xe.created_timezone||void 0,language:xe.language||void 0,isContinuation:Re.isContinuation,continuesNext:Re.continuesNext,isMultiDay:Re.isMultiDay})})}),he},R=async()=>{p(!0);const{data:W,error:H}=await M(t,{startDate:Qn(g),endDate:Rc(g)});if(H){console.error("Error fetching events:",H),p(!1);return}const q=I(W||[],g).sort((te,he)=>{if(te.isContinuation&&!he.isContinuation)return-1;if(!te.isContinuation&&he.isContinuation)return 1;const xe=new Date(te.rawStartTime||"").getTime(),De=new Date(he.rawStartTime||"").getTime();return xe-De});a(q),p(!1)},z=()=>{m(W=>Up(W,1))},O=()=>{m(W=>jn(W,1))},A=$e(g,"EEEE"),L=$e(g,"dd"),V=$e(g,"MM");$C(g)?null:zde(g)?"Yesterday":Ude(g)?"Tomorrow":$e(g,"MMMM d, yyyy");const re=(()=>{const W=Qn(new Date),H=Qn(g),q=Aue(H,W);return q===0?"Today":q>0?`Today +${q}`:`Today ${q}`})(),J=W=>{if(!W)return null;try{const H=new Date,q={timeZone:W,timeZoneName:"short"},he=new Intl.DateTimeFormat("en-US",q).format(H).match(/\b([A-Z]{2,5})\b/);return he?he[1]:null}catch{return null}},ne=W=>Hse(W),G=(W,H)=>{const q=H.currentTarget.getBoundingClientRect();h(q),o(W),u(!0)},Z=50,ee=W=>{y(null),S(null),x({x:W.targetTouches[0].clientX,y:W.targetTouches[0].clientY})},K=W=>{const H={x:W.targetTouches[0].clientX,y:W.targetTouches[0].clientY};if(y(H),v){const q=v.x-H.x,te=Math.abs(v.y-H.y);Math.abs(q)>te*2&&Math.abs(q)>30?S(q>0?"left":"right"):S(null)}},oe=()=>{if(S(null),!v||!w)return;const W=v.x-w.x,H=Math.abs(v.y-w.y);if(!(Math.abs(W)>H*2))return;const te=W>Z,he=W<-Z;(te||he)&&navigator.vibrate&&navigator.vibrate(10),te?O():he&&z()};
vendor: 1,123 bytes, line 663
663return f?l.jsxs("div",{className:"max-w-md sm:max-w-2xl md:max-w-3xl lg:max-w-5xl mx-auto px-3 sm:px-4 md:px-6 lg:px-8 pb-8",children:[l.jsx("div",{className:"text-center mb-2 h-[28px]"}),l.jsx("div",{className:"mb-6 md:mb-8 lg:mb-10",children:l.jsxs("div",{className:"flex items-center justify-center gap-4 md:gap-6 lg:gap-8",children:[l.jsx("div",{className:"h-12 w-12 md:h-14 md:w-14 lg:h-16 lg:w-16"}),l.jsxs("div",{className:"text-center",children:[l.jsx(Wt,{className:"h-10 w-32 lg:h-12 lg:w-40 mb-2 mx-auto"}),l.jsx(Wt,{className:"h-14 w-24 lg:h-20 lg:w-32 mx-auto"})]}),l.jsx("div",{className:"h-12 w-12 md:h-14 md:w-14 lg:h-16 lg:w-16"})]})}),l.jsx("div",{className:"sm:grid sm:grid-cols-2 lg:grid-cols-3 sm:gap-4",children:l.jsx(Ohe,{})})]}):l.jsxs(l.Fragment,{children:[l.jsx(yw,{show:T,onHide:()=>E(!1)}),l.jsx(vw,{event:s,open:c,onOpenChange:u,cardRect:d,calendarId:t,onEventUpdated:R,canEdit:e}),k&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:`fixed top-1/2 -translate-y-1/2 z-50 transition-all duration-150 pointer-events-none ${k==="right"?"left-4 opacity-100 scale-100":"left-4 opacity-0 scale-75"}
663`,children:l.jsx("div",{className:"bg-foreground/10 backdrop-blur-sm rounded-full p-3 animate-pulse",children:l.jsx(ch,{className:"w-8 h-8 text-foreground/70 animate-[bounce-left_0.5s_ease-in-out_infinite]"})})}),l.jsx("div",{className:`fixed top-1/2 -translate-y-1/2 z-50 transition-all duration-150 pointer-events-none ${k==="left"?"right-4 opacity-100 scale-100":"right-4 opacity-0 scale-75"}`,children:l.jsx("div",{className:"bg-foreground/10 backdrop-blur-sm rounded-full p-3 animate-pulse",children:l.jsx(lh,{className:"w-8 h-8 text-foreground/70 animate-[bounce-right_0.5s_ease-in-out_infinite]"})})})]}),l.jsxs("div",{className:"max-w-md sm:max-w-2xl md:max-w-3xl lg:max-w-5xl mx-auto px-3 sm:px-4 md:px-6 lg:px-8 pb-8 animate-fade-in relative",onTouchStart:ee,onTouchMove:K,onTouchEnd:oe,children:[l.jsx("div",{className:"text-center mb-2 h-[28px] flex items-center justify-center",children:l.jsx("span",{className:"text-sm font-medium text-muted-foreground animate-fade-in",children:re},re)}),l.jsx("div",{className:"mb-6 md:mb-8 lg:mb-10 animate-scale-in",children:l.jsxs("div",{className:"flex items-center justify-center gap-4 md:gap-6 lg:gap-8",children:[l.jsx(de,{variant:"ghost",size:"icon",onClick:z,className:"h-12 w-12 md:h-14 md:w-14 lg:h-16 lg:w-16 rounded-full hover:bg-accent transition-colors",children:l.jsx(ch,{className:"h-8 w-8 md:h-10 md:w-10 lg:h-12 lg:w-12"})}),l.jsxs("div",{className:"text-center",children:[l.jsx("p",{className:ce("font-bold mb-1 md:mb-2",N?"text-5xl md:text-7xl lg:text-8xl":"text-3xl md:text-5xl lg:text-6xl"),children:A}),l.jsxs("h1",{className:ce("font-bold leading-none tracking-tight",N?"text-7xl md:text-9xl":"text-5xl md:text-7xl lg:text-8xl"),children:[L,".",V]})]}),l.jsx(de,{variant:"ghost",size:"icon",onClick:O,className:"h-12 w-12 md:h-14 md:w-14 lg:h-16 lg:w-16 rounded-full hover:bg-accent transition-colors",children:l.jsx(lh,{className:"h-8 w-8 md:h-10 md:w-10 lg:h-12 lg:w-12"})})]})}),l.jsx("div",{className:"mb-4",children:l.jsx("div",{className:"space-y-3 sm:grid sm:grid-cols-2 lg:grid-cols-3 sm:gap-4 sm:space-y-0",children:i.length===0?l.jsx("div",{className:"sm:col-span-2 lg:col-span-3",children:l.jsx(Ahe,{})}):i.map((W,H)=>l.jsxs("div",{onClick:q=>G(W,q),className:ce("rounded-3xl transition-all duration-300 hover:scale-[1.02] hover:shadow-lg cursor-pointer animate-fade-in-up touch-manipulation",N?"p-6 md:p-8 lg:p-7":"p-5 md:p-6 lg:p-5"),style:{animationDelay:`${.4+H*.1}s`,opacity:0,animationFillMode:"forwards",backgroundColor:W.colorSet.background,transition:"background-color 0.5s ease-in-out, color 0.5s ease-in-out, transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out"},children:[l.jsxs("h3",{className:ce("font-bold leading-tight flex items-center gap-2 flex-wrap",N?"text-3xl md:text-4xl lg:text-3xl mb-5 md:mb-6 lg:mb-5":"text-xl md:text-2xl lg:text-xl mb-4 md:mb-5 lg:mb-4"),style:{color:W.colorSet.textClass==="text-gray-900"?"#111827":"#ffffff",transition:"color 0.5s ease-in-out"},children:[l.jsx("span",{children:W.title}),(W.isRecurring||W.recurrenceParentId)&&l.jsx(y$,{className:ce("opacity-70 flex-shrink-0",N?"w-6 h-6 md:w-7 md:h-7":"w-4 h-4 md:w-5 md:h-5 lg:w-4 lg:h-4")}),!N&&W.createdTimezone&&J(W.createdTimezone)&&l.jsx("span",{className:"text-xs font-normal px-2 py-0.5 rounded-full opacity-60",style:{backgroundColor:W.colorSet.textClass==="text-gray-900"?"rgba(0,0,0,0.1)":"rgba(255,255,255,0.2)"},children:J(W.createdTimezone)})]}),l.jsxs("div",{className:"flex items-center justify-between gap-4",children:[l.jsx("div",{className:"flex items-start flex-shrink-0",style:{gap:"8px"},children:l.jsxs("div",{className:"flex flex-col gap-1 relative",children:[l.jsxs("div",{children:[l.jsx("p",{ref:q=>{j.current[W.id]||(j.current[W.id]={start:null,end:null}),j.current[W.id].start=q},className:ce("font-bold leading-tight whitespace-nowrap",N?"text-2xl md:text-3xl lg:text-2xl":"text-xl md:text-2xl lg:text-xl"),style:{color:W.colorSet.textClass==="text-gray-900"?"#111827":"#ffffff",transition:"color 0.5s ease-in-out"},children:W.startTime}),l.jsx("p",{className:ce("leading-tight",N?"text-sm":"text-[10px]"),style:{color:W.colorSet.textClass==="text-gray-900"?"#4B5563":"rgba(255,255,255,0.7)",transition:"color 0.5s ease-in-out"},children:"Start"})]}),l.jsxs("div",{children:[l.jsx("p",{ref:q=>{j.current[W.id]||(j.current[W.id]={start:null,end:null}),j.current[W.id].end=q},className:ce("leading-tight whitespace-nowrap",!W.duration||W.startTime===W.endTime?"font-thin":"font-bold",N?"text-2xl md:text-3xl lg:text-2xl":"text-xl md:text-2xl lg:text-xl"),style:{color:!W.duration||W.startTime===W.endTime?`hsl(${W.colorSet.icon})`:W.colorSet.textClass==="text-gray-900"?"#111827":"#ffffff",opacity:!W.duration||W.startTime===W.endTime?.4:1,transition:"color 0.5s ease-in-out, opacity 0.5s ease-in-out"},children:W.endTime}),l.jsx("p",{className:ce("leading-tight",N?"text-sm":"text-[10px]"),style:{color:W.colorSet.textClass==="text-gray-900"?"#4B5563":"rgba(255,255,255,0.7)",transition:"color 0.5s ease-in-out"},children:"End"})]}),_[W.id]&&l.jsx("div",{className:"absolute w-[0.5px]",style:{backgroundImage:`repeating-linear-gradient(to bottom, ${W.colorSet.textClass==="text-gray-900"?"#9CA3AF":"rgba(255,255,255,0.3)"} 0, ${W.colorSet.textClass==="text-gray-900"?"#9CA3AF":"rgba(255,255,255,0.3)"} 2px, transparent 2px, transparent 5px)`,left:"calc(100% + 8px)",top:0,height:`${_[W.id]}px`,transition:"background-image 0.5s ease-in-out"},children:l.jsx("div",{className:"absolute whitespace-nowrap",style:{left:"10px",top:"50%",transform:"translateY(-50%)"},children:l.jsx("p",{className:"text-xs font-light",style:{color:W.colorSet.textClass==="text-gray-900"?"#9CA3AF":"rgba(255,255,255,0.3)",transition:"color 0.5s ease-in-out"},children:W.duration})})})]})}),l.jsx("div",{className:"flex-shrink-0 ml-auto",children:l.jsx("div",{className:"rounded-full flex items-center justify-center",style:{backgroundColor:`hsl(${W.colorSet.iconCircle})`,transition:"background-color 0.5s ease-in-out",width:N?"clamp(5.5rem, 6vw, 8rem)":"clamp(4.5rem, 5vw, 6rem)",height:N?"clamp(5.5rem, 6vw, 8rem)":"clamp(4.5rem, 5vw, 6rem)"},children:l.jsx("div",{className:ce(N?"[&>svg]:w-14 [&>svg]:h-14 md:[&>svg]:w-16 md:[&>svg]:h-16 [&>span]:w-14 [&>span]:h-14 md:[&>span]:w-16 md:[&>span]:h-16":"[&>svg]:w-10 [&>svg]:h-10 md:[&>svg]:w-12 md:[&>svg]:h-12 lg:[&>svg]:w-9 lg:[&>svg]:h-9 [&>span]:w-10 [&>span]:h-10 md:[&>span]:w-12 md:[&>span]:h-12 lg:[&>span]:w-9 lg:[&>span]:h-9"),style:{color:`hsl(${W.colorSet.icon})`,transition:"color 0.5s ease-in-out"},children:ne(W.title)})})})]}),W.location&&l.jsxs("div",{className:ce("border-t flex items-center gap-2",N?"mt-5 pt-4":"mt-4 pt-3"),style:{borderColor:W.colorSet.textClass==="text-gray-900"?"rgba(0,0,0,0.1)":"rgba(255,255,255,0.2)"},children:[l.jsx(df,{className:ce("flex-shrink-0",N?"w-6 h-6":"w-4 h-4"),style:{color:W.colorSet.textClass==="text-gray-900"?"#6B7280":"rgba(255,255,255,0.7)"}}),l.jsx("span",{className:ce("font-medium truncate",N?"text-lg":"text-sm"),style:{color:W.colorSet.textClass==="text-gray-900"?"#374151":"rgba(255,255,255,0.9)"},children:W.location})]}),W.notes&&l.jsxs("div",{className:ce("flex items-start gap-2",W.location?N?"mt-3":"mt-2":N?"mt-5 pt-4 border-t":"mt-4 pt-3 border-t"),style:{borderColor:W.location?void 0:W.colorSet.textClass==="text-gray-900"?"rgba(0,0,0,0.1)":"rgba(255,255,255,0.2)"},children:[l.jsx(Wg,{className:ce("flex-shrink-0 mt-0.5",N?"w-6 h-6":"w-4 h-4"),style:{color:W.colorSet.textClass==="text-gray-900"?"#6B7280":"rgba(255,255,255,0.7)"}}),l.jsx("span",{className:ce("font-medium line-clamp-2",N?"text-lg":"text-sm"),style:{color:W.colorSet.textClass==="text-gray-900"?"#374151":"rgba(255,255,255,0.9)"},children:W.notes})]}),!N&&W.participants&&W.participants.length>0&&l.jsxs("div",{className:`flex items-center gap-2 ${W.location||W.notes?"mt-3":"mt-4 pt-3 border-t"}`,style:{borderColor:W.location||W.notes?void 0:W.colorSet.textClass==="text-gray-900"?"rgba(0,0,0,0.1)":"rgba(255,255,255,0.2)"}
vendor: 14,081 bytes, line 663
663,children:[l.jsxs("div",{className:"flex -space-x-2",children:[W.participants.slice(0,3).map((q,te)=>{const he=q.split(" ").map(xe=>xe[0]).join("").toUpperCase().slice(0,2);return l.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-[10px] font-semibold border-2",style:{backgroundColor:W.colorSet.textClass==="text-gray-900"?"rgba(0,0,0,0.15)":"rgba(255,255,255,0.25)",borderColor:W.colorSet.background,color:W.colorSet.textClass==="text-gray-900"?"#374151":"#ffffff",zIndex:3-te},children:he},te)}),W.participants.length>3&&l.jsxs("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-[10px] font-semibold border-2",style:{backgroundColor:W.colorSet.textClass==="text-gray-900"?"rgba(0,0,0,0.1)":"rgba(255,255,255,0.2)",borderColor:W.colorSet.background,color:W.colorSet.textClass==="text-gray-900"?"#6B7280":"rgba(255,255,255,0.8)"},children:["+",W.participants.length-3]})]}),l.jsx("span",{className:"text-xs",style:{color:W.colorSet.textClass==="text-gray-900"?"#6B7280":"rgba(255,255,255,0.7)"},children:W.participants.length===1?W.participants[0]:`${W.participants.length} participants`})]})]},W.id))})})]})]})};var DD={};function zhe(t,e){return e.forEach(function(n){n&&typeof n!="string"&&!Array.isArray(n)&&Object.keys(n).forEach(function(r){if(r!=="default"&&!(r in t)){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}})}),Object.freeze(t)}var Whe=Object.defineProperty,Vhe=(t,e,n)=>e in t?Whe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,MD=(t,e,n)=>Vhe(t,typeof e!="symbol"?e+"":e,n);let gr=class{constructor(){MD(this,"_locking"),MD(this,"_locks"),this._locking=Promise.resolve(),this._locks=0}isLocked(){return this._locks>0}lock(){this._locks+=1;let e;const n=new Promise(i=>e=()=>{this._locks-=1,i()}),r=this._locking.then(()=>e);return this._locking=this._locking.then(()=>n),r}};function Nn(t,e){if(!t)throw new Error(e)}const Hhe=34028234663852886e22,qhe=-34028234663852886e22,Khe=4294967295,Ghe=2147483647,Yhe=-2147483648;function Uy(t){if(typeof t!="number")throw new Error("invalid int 32: "+typeof t);if(!Number.isInteger(t)||t>Ghe||t<Yhe)throw new Error("invalid int 32: "+t)}function zC(t){if(typeof t!="number")throw new Error("invalid uint 32: "+typeof t);if(!Number.isInteger(t)||t>Khe||t<0)throw new Error("invalid uint 32: "+t)}function JU(t){if(typeof t!="number")throw new Error("invalid float 32: "+typeof t);if(Number.isFinite(t)&&(t>Hhe||t<qhe))throw new Error("invalid float 32: "+t)}const XU=Symbol("@bufbuild/protobuf/enum-type");function Jhe(t){const e=t[XU];return Nn(e,"missing enum type on enum object"),e}function ZU(t,e,n,r){t[XU]=QU(e,n.map(i=>({no:i.no,name:i.name,localName:t[i.no]})))}function QU(t,e,n){const r=Object.create(null),i=Object.create(null),a=[];for(const s of e){const o=ez(s);a.push(o),r[s.name]=o,i[s.no]=o}return{typeName:t,values:a,findName(s){return r[s]},findNumber(s){return i[s]}}}function Xhe(t,e,n){const r={};for(const i of e){const a=ez(i);r[a.localName]=a.no,r[a.no]=a.localName}return ZU(r,t,e),r}function ez(t){return"localName"in t?t:Object.assign(Object.assign({},t),{localName:t.name})}class iP{equals(e){return this.getType().runtime.util.equals(this.getType(),this,e)}clone(){return this.getType().runtime.util.clone(this)}fromBinary(e,n){const r=this.getType(),i=r.runtime.bin,a=i.makeReadOptions(n);return i.readMessage(this,a.readerFactory(e),e.byteLength,a),this}fromJson(e,n){const r=this.getType(),i=r.runtime.json,a=i.makeReadOptions(n);return i.readMessage(r,e,a,this),this}fromJsonString(e,n){let r;try{r=JSON.parse(e)}catch(i){throw new Error("cannot decode ".concat(this.getType().typeName," from JSON: ").concat(i instanceof Error?i.message:String(i)))}return this.fromJson(r,n)}toBinary(e){const n=this.getType(),r=n.runtime.bin,i=r.makeWriteOptions(e),a=i.writerFactory();return r.writeMessage(this,a,i),a.finish()}toJson(e){const n=this.getType(),r=n.runtime.json,i=r.makeWriteOptions(e);return r.writeMessage(this,i)}toJsonString(e){var n;const r=this.toJson(e);return JSON.stringify(r,null,(n=e==null?void 0:e.prettySpaces)!==null&&n!==void 0?n:0)}toJSON(){return this.toJson({emitDefaultValues:!0})}getType(){return Object.getPrototypeOf(this).constructor}}function Zhe(t,e,n,r){var i;const a=(i=r==null?void 0:r.localName)!==null&&i!==void 0?i:e.substring(e.lastIndexOf(".")+1),s={[a]:function(o){t.util.initFields(this),t.util.initPartial(o,this)}}[a];return Object.setPrototypeOf(s.prototype,new iP),Object.assign(s,{runtime:t,typeName:e,fields:t.util.newFieldList(n),fromBinary(o,c){return new s().fromBinary(o,c)},fromJson(o,c){return new s().fromJson(o,c)},fromJsonString(o,c){return new s().fromJsonString(o,c)},equals(o,c){return t.util.equals(s,o,c)}}),s}function Qhe(){let t=0,e=0;for(let r=0;r<28;r+=7){let i=this.buf[this.pos++];if(t|=(i&127)<<r,!(i&128))return this.assertBounds(),[t,e]}let n=this.buf[this.pos++];if(t|=(n&15)<<28,e=(n&112)>>4,!(n&128))return this.assertBounds(),[t,e];for(let r=3;r<=31;r+=7){let i=this.buf[this.pos++];if(e|=(i&127)<<r,!(i&128))return this.assertBounds(),[t,e]}throw new Error("invalid varint")}function HS(t,e,n){for(let a=0;a<28;a=a+7){const s=t>>>a,o=!(!(s>>>7)&&e==0),c=(o?s|128:s)&255;if(n.push(c),!o)return}const r=t>>>28&15|(e&7)<<4,i=!!(e>>3);if(n.push((i?r|128:r)&255),!!i){for(let a=3;a<31;a=a+7){const s=e>>>a,o=!!(s>>>7),c=(o?s|128:s)&255;if(n.push(c),!o)return}n.push(e>>>31&1)}}const zy=4294967296;function ID(t){const e=t[0]==="-";e&&(t=t.slice(1));const n=1e6;let r=0,i=0;function a(s,o){const c=Number(t.slice(s,o));i*=n,r=r*n+c,r>=zy&&(i=i+(r/zy|0),r=r%zy)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),e?nz(r,i):aP(r,i)}function efe(t,e){let n=aP(t,e);const r=n.hi&2147483648;r&&(n=nz(n.lo,n.hi));const i=tz(n.lo,n.hi);return r?"-"+i:i}function tz(t,e){if({lo:t,hi:e}=tfe(t,e),e<=2097151)return String(zy*e+t);const n=t&16777215,r=(t>>>24|e<<8)&16777215,i=e>>16&65535;let a=n+r*6777216+i*6710656,s=r+i*8147497,o=i*2;const c=1e7;return a>=c&&(s+=Math.floor(a/c),a%=c),s>=c&&(o+=Math.floor(s/c),s%=c),o.toString()+LD(s)+LD(a)}function tfe(t,e){return{lo:t>>>0,hi:e>>>0}}function aP(t,e){return{lo:t|0,hi:e|0}}function nz(t,e){return e=~e,t?t=~t+1:e+=1,aP(t,e)}const LD=t=>{const e=String(t);return"0000000".slice(e.length)+e};function $D(t,e){if(t>=0){for(;t>127;)e.push(t&127|128),t=t>>>7;e.push(t)}else{for(let n=0;n<9;n++)e.push(t&127|128),t=t>>7;e.push(1)}}function nfe(){let t=this.buf[this.pos++],e=t&127;if(!(t&128))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<7,!(t&128))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<14,!(t&128))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<21,!(t&128))return this.assertBounds(),e;t=this.buf[this.pos++],e|=(t&15)<<28;for(let n=5;t&128&&n<10;n++)t=this.buf[this.pos++];if(t&128)throw new Error("invalid varint");return this.assertBounds(),e>>>0}function rfe(){const t=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof t.getBigInt64=="function"&&typeof t.getBigUint64=="function"&&typeof t.setBigInt64=="function"&&typeof t.setBigUint64=="function"&&(typeof process!="object"||typeof DD!="object"||DD.BUF_BIGINT_DISABLE!=="1")){const i=BigInt("-9223372036854775808"),a=BigInt("9223372036854775807"),s=BigInt("0"),o=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(c){const u=typeof c=="bigint"?c:BigInt(c);if(u>a||u<i)throw new Error("int64 invalid: ".concat(c));return u},uParse(c){const u=typeof c=="bigint"?c:BigInt(c);if(u>o||u<s)throw new Error("uint64 invalid: ".concat(c));return u},enc(c){return t.setBigInt64(0,this.parse(c),!0),{lo:t.getInt32(0,!0),hi:t.getInt32(4,!0)}},uEnc(c){return t.setBigInt64(0,this.uParse(c),!0),{lo:t.getInt32(0,!0),hi:t.getInt32(4,!0)}},dec(c,u){return t.setInt32(0,c,!0),t.setInt32(4,u,!0),t.getBigInt64(0,!0)},uDec(c,u){return t.setInt32(0,c,!0),t.setInt32(4,u,!0),t.getBigUint64(0,!0)}}}const n=i=>Nn(/^-?[0-9]+$/.test(i),"int64 invalid: ".concat(i)),r=i=>Nn(/^[0-9]+$/.test(i),"uint64 invalid: ".concat(i));return{zero:"0",supported:!1,parse(i){return typeof i!="string"&&(i=i.toString()),n(i),i},uParse(i){return typeof i!="string"&&(i=i.toString()),r(i),i},enc(i){return typeof i!="string"&&(i=i.toString()),n(i),ID(i)},uEnc(i){return typeof i!="string"&&(i=i.toString()),r(i),ID(i)},dec(i,a){return efe(i,a)},uDec(i,a){return tz(i,a)}}}const mn=rfe();var pe;(function(t){t[t.DOUBLE=1]="DOUBLE",t[t.FLOAT=2]="FLOAT",t[t.INT64=3]="INT64",t[t.UINT64=4]="UINT64",t[t.INT32=5]="INT32",t[t.FIXED64=6]="FIXED64",t[t.FIXED32=7]="FIXED32",t[t.BOOL=8]="BOOL",t[t.STRING=9]="STRING",t[t.BYTES=12]="BYTES",t[t.UINT32=13]="UINT32",t[t.SFIXED32=15]="SFIXED32",t[t.SFIXED64=16]="SFIXED64",t[t.SINT32=17]="SINT32",t[t.SINT64=18]="SINT64"})(pe||(pe={}));var Dc;(function(t){t[t.BIGINT=0]="BIGINT",t[t.STRING=1]="STRING"})(Dc||(Dc={}));function Mo(t,e,n){if(e===n)return!0;if(t==pe.BYTES){if(!(e instanceof Uint8Array)||!(n instanceof Uint8Array)||e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==n[r])return!1;return!0}switch(t){case pe.UINT64:case pe.FIXED64:case pe.INT64:case pe.SFIXED64:case pe.SINT64:return e==n}return!1}function Th(t,e){switch(t){case pe.BOOL:return!1;case pe.UINT64:case pe.FIXED64:case pe.INT64:case pe.SFIXED64:case pe.SINT64:return e==0?mn.zero:"0";case pe.DOUBLE:case pe.FLOAT:return 0;case pe.BYTES:return new Uint8Array(0);case pe.STRING:return"";default:return 0}}function rz(t,e){switch(t){case pe.BOOL:return e===!1;case pe.STRING:return e==="";case pe.BYTES:return e instanceof Uint8Array&&!e.byteLength;default:return e==0}}var In;(function(t){t[t.Varint=0]="Varint",t[t.Bit64=1]="Bit64",t[t.LengthDelimited=2]="LengthDelimited",t[t.StartGroup=3]="StartGroup",t[t.EndGroup=4]="EndGroup",t[t.Bit32=5]="Bit32"})(In||(In={}));class ife{constructor(e){this.stack=[],this.textEncoder=e??new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let e=0;for(let i=0;i<this.chunks.length;i++)e+=this.chunks[i].length;let n=new Uint8Array(e),r=0;for(let i=0;i<this.chunks.length;i++)n.set(this.chunks[i],r),r+=this.chunks[i].length;return this.chunks=[],n}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),n=this.stack.pop();if(!n)throw new Error("invalid state, fork stack empty");return this.chunks=n.chunks,this.buf=n.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,n){return this.uint32((e<<3|n)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(zC(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return Uy(e),$D(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let n=this.textEncoder.encode(e);return this.uint32(n.byteLength),this.raw(n)}float(e){JU(e);let n=new Uint8Array(4);return new DataView(n.buffer).setFloat32(0,e,!0),this.raw(n)}double(e){let n=new Uint8Array(8);return new DataView(n.buffer).setFloat64(0,e,!0),this.raw(n)}fixed32(e){zC(e);let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,e,!0),this.raw(n)}sfixed32(e){Uy(e);let n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,e,!0),this.raw(n)}sint32(e){return Uy(e),e=(e<<1^e>>31)>>>0,$D(e,this.buf),this}sfixed64(e){let n=new Uint8Array(8),r=new DataView(n.buffer),i=mn.enc(e);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(n)}fixed64(e){let n=new Uint8Array(8),r=new DataView(n.buffer),i=mn.uEnc(e);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(n)}int64(e){let n=mn.enc(e);return HS(n.lo,n.hi,this.buf),this}sint64(e){let n=mn.enc(e),r=n.hi>>31,i=n.lo<<1^r,a=(n.hi<<1|n.lo>>>31)^r;return HS(i,a,this.buf),this}uint64(e){let n=mn.uEnc(e);return HS(n.lo,n.hi,this.buf),this}}class afe{constructor(e,n){this.varint64=Qhe,this.uint32=nfe,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.textDecoder=n??new TextDecoder}tag(){let e=this.uint32(),n=e>>>3,r=e&7;if(n<=0||r<0||r>5)throw new Error("illegal tag: field no "+n+" wire type "+r);return[n,r]}skip(e,n){let r=this.pos;switch(e){case In.Varint:for(;this.buf[this.pos++]&128;);break;case In.Bit64:this.pos+=4;case In.Bit32:this.pos+=4;break;case In.LengthDelimited:let i=this.uint32();this.pos+=i;break;case In.StartGroup:for(;;){const[a,s]=this.tag();if(s===In.EndGroup){if(n!==void 0&&a!==n)throw new Error("invalid end group tag");break}this.skip(s,a)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(r,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return mn.dec(...this.varint64())}uint64(){return mn.uDec(...this.varint64())}sint64(){let[e,n]=this.varint64(),r=-(e&1);return e=(e>>>1|(n&1)<<31)^r,n=n>>>1^r,mn.dec(e,n)}bool(){let[e,n]=this.varint64();return e!==0||n!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return mn.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return mn.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),n=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(n,n+e)}string(){return this.textDecoder.decode(this.bytes())}}function sfe(t,e,n,r){let i;return{typeName:e,extendee:n,get field(){if(!i){const a=typeof r=="function"?r():r;a.name=e.split(".").pop(),a.jsonName="[".concat(e,"]"),i=t.util.newFieldList([a]).list()[0]}return i},runtime:t}}function iz(t){const e=t.field.localName,n=Object.create(null);return n[e]=ofe(t),[n,()=>n[e]]}function ofe(t){const e=t.field;if(e.repeated)return[];if(e.default!==void 0)return e.default;switch(e.kind){case"enum":return e.T.values[0].no;
vendor: 5,648 bytes, lines 663-664
663case"scalar":return Th(e.T,e.L);case"message":const n=e.T,r=new n;return n.fieldWrapper?n.fieldWrapper.unwrapField(r):r;case"map":throw"map fields are not allowed to be extensions"}}function cfe(t,e){if(!e.repeated&&(e.kind=="enum"||e.kind=="scalar")){for(let n=t.length-1;n>=0;--n)if(t[n].no==e.no)return[t[n]];return[]}return t.filter(n=>n.no===e.no)}let Xs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),ww=[];for(let t=0;t<Xs.length;t++)ww[Xs[t].charCodeAt(0)]=t;ww[45]=Xs.indexOf("+");ww[95]=Xs.indexOf("/");const az={dec(t){let e=t.length*3/4;t[t.length-2]=="="?e-=2:t[t.length-1]=="="&&(e-=1);let n=new Uint8Array(e),r=0,i=0,a,s=0;for(let o=0;o<t.length;o++){if(a=ww[t.charCodeAt(o)],a===void 0)switch(t[o]){case"=":i=0;case` 664`:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string.")}switch(i){case 0:s=a,i=1;break;case 1:n[r++]=s<<2|(a&48)>>4,s=a,i=2;break;case 2:n[r++]=(s&15)<<4|(a&60)>>2,s=a,i=3;break;case 3:n[r++]=(s&3)<<6|a,i=0;break}}if(i==1)throw Error("invalid base64 string.");return n.subarray(0,r)},enc(t){let e="",n=0,r,i=0;for(let a=0;a<t.length;a++)switch(r=t[a],n){case 0:e+=Xs[r>>2],i=(r&3)<<4,n=1;break;case 1:e+=Xs[i|r>>4],i=(r&15)<<2,n=2;break;case 2:e+=Xs[i|r>>6],e+=Xs[r&63],n=0;break}return n&&(e+=Xs[i],e+="=",n==1&&(e+="=")),e}};function lfe(t,e,n){oz(e,t);const r=e.runtime.bin.makeReadOptions(n),i=cfe(t.getType().runtime.bin.listUnknownFields(t),e.field),[a,s]=iz(e);for(const o of i)e.runtime.bin.readField(a,r.readerFactory(o.data),e.field,o.wireType,r);return s()}function ufe(t,e,n,r){oz(e,t);const i=e.runtime.bin.makeReadOptions(r),a=e.runtime.bin.makeWriteOptions(r);if(sz(t,e)){const u=t.getType().runtime.bin.listUnknownFields(t).filter(d=>d.no!=e.field.no);t.getType().runtime.bin.discardUnknownFields(t);for(const d of u)t.getType().runtime.bin.onUnknownField(t,d.no,d.wireType,d.data)}const s=a.writerFactory();let o=e.field;!o.opt&&!o.repeated&&(o.kind=="enum"||o.kind=="scalar")&&(o=Object.assign(Object.assign({},e.field),{opt:!0})),e.runtime.bin.writeField(o,n,s,a);const c=i.readerFactory(s.finish());for(;c.pos<c.len;){const[u,d]=c.tag(),h=c.skip(d,u);t.getType().runtime.bin.onUnknownField(t,u,d,h)}}function sz(t,e){const n=t.getType();return e.extendee.typeName===n.typeName&&!!n.runtime.bin.listUnknownFields(t).find(r=>r.no==e.field.no)}function oz(t,e){Nn(t.extendee.typeName==e.getType().typeName,"extension ".concat(t.typeName," can only be applied to message ").concat(t.extendee.typeName))}function cz(t,e){const n=t.localName;if(t.repeated)return e[n].length>0;if(t.oneof)return e[t.oneof.localName].case===n;switch(t.kind){case"enum":case"scalar":return t.opt||t.req?e[n]!==void 0:t.kind=="enum"?e[n]!==t.T.values[0].no:!rz(t.T,e[n]);case"message":return e[n]!==void 0;case"map":return Object.keys(e[n]).length>0}}function FD(t,e){const n=t.localName,r=!t.opt&&!t.req;if(t.repeated)e[n]=[];else if(t.oneof)e[t.oneof.localName]={case:void 0};else switch(t.kind){case"map":e[n]={};break;case"enum":e[n]=r?t.T.values[0].no:void 0;break;case"scalar":e[n]=r?Th(t.T,t.L):void 0;break;case"message":e[n]=void 0;break}}function Zs(t,e){if(t===null||typeof t!="object"||!Object.getOwnPropertyNames(iP.prototype).every(r=>r in t&&typeof t[r]=="function"))return!1;const n=t.getType();return n===null||typeof n!="function"||!("typeName"in n)||typeof n.typeName!="string"?!1:e===void 0?!0:n.typeName==e.typeName}function lz(t,e){return Zs(e)||!t.fieldWrapper?e:t.fieldWrapper.wrapField(e)}pe.DOUBLE,pe.FLOAT,pe.INT64,pe.UINT64,pe.INT32,pe.UINT32,pe.BOOL,pe.STRING,pe.BYTES;const BD={ignoreUnknownFields:!1},UD={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0};function dfe(t){return t?Object.assign(Object.assign({},BD),t):BD}function hfe(t){return t?Object.assign(Object.assign({},UD),t):UD}const X0=Symbol(),Wy=Symbol();function ffe(){return{makeReadOptions:dfe,makeWriteOptions:hfe,readMessage(t,e,n,r){if(e==null||Array.isArray(e)||typeof e!="object")throw new Error("cannot decode message ".concat(t.typeName," from JSON: ").concat(os(e)));r=r??new t;const i=new Map,a=n.typeRegistry;for(const[s,o]of Object.entries(e)){const c=t.fields.findJsonName(s);if(c){if(c.oneof){if(o===null&&c.kind=="scalar")continue;const u=i.get(c.oneof);if(u!==void 0)throw new Error("cannot decode message ".concat(t.typeName,' from JSON: multiple keys for oneof "').concat(c.oneof.name,'" present: "').concat(u,'", "').concat(s,'"'));i.set(c.oneof,s)}zD(r,o,c,n,t)}else{let u=!1;if(a!=null&&a.findExtension&&s.startsWith("[")&&s.endsWith("]")){const d=a.findExtension(s.substring(1,s.length-1));if(d&&d.extendee.typeName==t.typeName){u=!0;const[h,f]=iz(d);zD(h,o,d.field,n,d),ufe(r,d,f(),n)}}if(!u&&!n.ignoreUnknownFields)throw new Error("cannot decode message ".concat(t.typeName,' from JSON: key "').concat(s,'" is unknown'))}}return r},writeMessage(t,e){const n=t.getType(),r={};let i;try{for(i of n.fields.byNumber()){if(!cz(i,t)){if(i.req)throw"required field not set";if(!e.emitDefaultValues||!mfe(i))continue}const s=i.oneof?t[i.oneof.localName].value:t[i.localName],o=WD(i,s,e);o!==void 0&&(r[e.useProtoFieldName?i.name:i.jsonName]=o)}const a=e.typeRegistry;if(a!=null&&a.findExtensionFor)for(const s of n.runtime.bin.listUnknownFields(t)){const o=a.findExtensionFor(n.typeName,s.no);if(o&&sz(t,o)){const c=lfe(t,o,e),u=WD(o.field,c,e);u!==void 0&&(r[o.field.jsonName]=u)}}}catch(a){const s=i?"cannot encode field ".concat(n.typeName,".").concat(i.name," to JSON"):"cannot encode message ".concat(n.typeName," to JSON"),o=a instanceof Error?a.message:String(a);throw new Error(s+(o.length>0?": ".concat(o):""))}return r}
vendor: 24,015 bytes, line 664
664,readScalar(t,e,n){return zp(t,e,n??Dc.BIGINT,!0)},writeScalar(t,e,n){if(e!==void 0&&(n||rz(t,e)))return Vy(t,e)},debug:os}}function os(t){if(t===null)return"null";switch(typeof t){case"object":return Array.isArray(t)?"array":"object";case"string":return t.length>100?"string":'"'.concat(t.split('"').join('\\"'),'"');default:return String(t)}}function zD(t,e,n,r,i){let a=n.localName;if(n.repeated){if(Nn(n.kind!="map"),e===null)return;if(!Array.isArray(e))throw new Error("cannot decode field ".concat(i.typeName,".").concat(n.name," from JSON: ").concat(os(e)));const s=t[a];for(const o of e){if(o===null)throw new Error("cannot decode field ".concat(i.typeName,".").concat(n.name," from JSON: ").concat(os(o)));switch(n.kind){case"message":s.push(n.T.fromJson(o,r));break;case"enum":const c=qS(n.T,o,r.ignoreUnknownFields,!0);c!==Wy&&s.push(c);break;case"scalar":try{s.push(zp(n.T,o,n.L,!0))}catch(u){let d="cannot decode field ".concat(i.typeName,".").concat(n.name," from JSON: ").concat(os(o));throw u instanceof Error&&u.message.length>0&&(d+=": ".concat(u.message)),new Error(d)}break}}}else if(n.kind=="map"){if(e===null)return;if(typeof e!="object"||Array.isArray(e))throw new Error("cannot decode field ".concat(i.typeName,".").concat(n.name," from JSON: ").concat(os(e)));const s=t[a];for(const[o,c]of Object.entries(e)){if(c===null)throw new Error("cannot decode field ".concat(i.typeName,".").concat(n.name," from JSON: map value null"));let u;try{u=pfe(n.K,o)}catch(d){let h="cannot decode map key for field ".concat(i.typeName,".").concat(n.name," from JSON: ").concat(os(e));throw d instanceof Error&&d.message.length>0&&(h+=": ".concat(d.message)),new Error(h)}switch(n.V.kind){case"message":s[u]=n.V.T.fromJson(c,r);break;case"enum":const d=qS(n.V.T,c,r.ignoreUnknownFields,!0);d!==Wy&&(s[u]=d);break;case"scalar":try{s[u]=zp(n.V.T,c,Dc.BIGINT,!0)}catch(h){let f="cannot decode map value for field ".concat(i.typeName,".").concat(n.name," from JSON: ").concat(os(e));throw h instanceof Error&&h.message.length>0&&(f+=": ".concat(h.message)),new Error(f)}break}}}else switch(n.oneof&&(t=t[n.oneof.localName]={case:a},a="value"),n.kind){case"message":const s=n.T;if(e===null&&s.typeName!="google.protobuf.Value")return;let o=t[a];Zs(o)?o.fromJson(e,r):(t[a]=o=s.fromJson(e,r),s.fieldWrapper&&!n.oneof&&(t[a]=s.fieldWrapper.unwrapField(o)));break;case"enum":const c=qS(n.T,e,r.ignoreUnknownFields,!1);switch(c){case X0:FD(n,t);break;case Wy:break;default:t[a]=c;break}break;case"scalar":try{const u=zp(n.T,e,n.L,!1);switch(u){case X0:FD(n,t);break;default:t[a]=u;break}}catch(u){let d="cannot decode field ".concat(i.typeName,".").concat(n.name," from JSON: ").concat(os(e));throw u instanceof Error&&u.message.length>0&&(d+=": ".concat(u.message)),new Error(d)}break}}function pfe(t,e){if(t===pe.BOOL)switch(e){case"true":e=!0;break;case"false":e=!1;break}return zp(t,e,Dc.BIGINT,!0).toString()}function zp(t,e,n,r){if(e===null)return r?Th(t,n):X0;switch(t){case pe.DOUBLE:case pe.FLOAT:if(e==="NaN")return Number.NaN;if(e==="Infinity")return Number.POSITIVE_INFINITY;if(e==="-Infinity")return Number.NEGATIVE_INFINITY;if(e===""||typeof e=="string"&&e.trim().length!==e.length||typeof e!="string"&&typeof e!="number")break;const i=Number(e);if(Number.isNaN(i)||!Number.isFinite(i))break;return t==pe.FLOAT&&JU(i),i;case pe.INT32:case pe.FIXED32:case pe.SFIXED32:case pe.SINT32:case pe.UINT32:let a;if(typeof e=="number"?a=e:typeof e=="string"&&e.length>0&&e.trim().length===e.length&&(a=Number(e)),a===void 0)break;return t==pe.UINT32||t==pe.FIXED32?zC(a):Uy(a),a;case pe.INT64:case pe.SFIXED64:case pe.SINT64:if(typeof e!="number"&&typeof e!="string")break;const s=mn.parse(e);return n?s.toString():s;case pe.FIXED64:case pe.UINT64:if(typeof e!="number"&&typeof e!="string")break;const o=mn.uParse(e);return n?o.toString():o;case pe.BOOL:if(typeof e!="boolean")break;return e;case pe.STRING:if(typeof e!="string")break;try{encodeURIComponent(e)}catch{throw new Error("invalid UTF8")}return e;case pe.BYTES:if(e==="")return new Uint8Array(0);if(typeof e!="string")break;return az.dec(e)}throw new Error}function qS(t,e,n,r){if(e===null)return t.typeName=="google.protobuf.NullValue"?0:r?t.values[0].no:X0;switch(typeof e){case"number":if(Number.isInteger(e))return e;break;case"string":const i=t.findName(e);if(i!==void 0)return i.no;if(n)return Wy;break}throw new Error("cannot decode enum ".concat(t.typeName," from JSON: ").concat(os(e)))}function mfe(t){return t.repeated||t.kind=="map"?!0:!(t.oneof||t.kind=="message"||t.opt||t.req)}function WD(t,e,n){if(t.kind=="map"){Nn(typeof e=="object"&&e!=null);const r={},i=Object.entries(e);switch(t.V.kind){case"scalar":for(const[s,o]of i)r[s.toString()]=Vy(t.V.T,o);break;case"message":for(const[s,o]of i)r[s.toString()]=o.toJson(n);break;case"enum":const a=t.V.T;for(const[s,o]of i)r[s.toString()]=KS(a,o,n.enumAsInteger);break}return n.emitDefaultValues||i.length>0?r:void 0}if(t.repeated){Nn(Array.isArray(e));const r=[];switch(t.kind){case"scalar":for(let i=0;i<e.length;i++)r.push(Vy(t.T,e[i]));break;case"enum":for(let i=0;i<e.length;i++)r.push(KS(t.T,e[i],n.enumAsInteger));break;case"message":for(let i=0;i<e.length;i++)r.push(e[i].toJson(n));break}return n.emitDefaultValues||r.length>0?r:void 0}switch(t.kind){case"scalar":return Vy(t.T,e);case"enum":return KS(t.T,e,n.enumAsInteger);case"message":return lz(t.T,e).toJson(n)}}function KS(t,e,n){var r;if(Nn(typeof e=="number"),t.typeName=="google.protobuf.NullValue")return null;if(n)return e;const i=t.findNumber(e);return(r=i==null?void 0:i.name)!==null&&r!==void 0?r:e}function Vy(t,e){switch(t){case pe.INT32:case pe.SFIXED32:case pe.SINT32:case pe.FIXED32:case pe.UINT32:return Nn(typeof e=="number"),e;case pe.FLOAT:case pe.DOUBLE:return Nn(typeof e=="number"),Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":e;case pe.STRING:return Nn(typeof e=="string"),e;case pe.BOOL:return Nn(typeof e=="boolean"),e;case pe.UINT64:case pe.FIXED64:case pe.INT64:case pe.SFIXED64:case pe.SINT64:return Nn(typeof e=="bigint"||typeof e=="string"||typeof e=="number"),e.toString();case pe.BYTES:return Nn(e instanceof Uint8Array),az.enc(e)}}const qu=Symbol("@bufbuild/protobuf/unknown-fields"),VD={readUnknownFields:!0,readerFactory:t=>new afe(t)},HD={writeUnknownFields:!0,writerFactory:()=>new ife};function gfe(t){return t?Object.assign(Object.assign({},VD),t):VD}function vfe(t){return t?Object.assign(Object.assign({},HD),t):HD}function yfe(){return{makeReadOptions:gfe,makeWriteOptions:vfe,listUnknownFields(t){var e;return(e=t[qu])!==null&&e!==void 0?e:[]},discardUnknownFields(t){delete t[qu]},writeUnknownFields(t,e){const r=t[qu];if(r)for(const i of r)e.tag(i.no,i.wireType).raw(i.data)},onUnknownField(t,e,n,r){const i=t;Array.isArray(i[qu])||(i[qu]=[]),i[qu].push({no:e,wireType:n,data:r})},readMessage(t,e,n,r,i){const a=t.getType(),s=i?e.len:e.pos+n;let o,c;for(;e.pos<s&&([o,c]=e.tag(),!(i===!0&&c==In.EndGroup));){const u=a.fields.find(o);if(!u){const d=e.skip(c,o);r.readUnknownFields&&this.onUnknownField(t,o,c,d);continue}qD(t,e,u,c,r)}if(i&&(c!=In.EndGroup||o!==n))throw new Error("invalid end group tag")},readField:qD,writeMessage(t,e,n){const r=t.getType();for(const i of r.fields.byNumber()){if(!cz(i,t)){if(i.req)throw new Error("cannot encode field ".concat(r.typeName,".").concat(i.name," to binary: required field not set"));continue}const a=i.oneof?t[i.oneof.localName].value:t[i.localName];KD(i,a,e,n)}return n.writeUnknownFields&&this.writeUnknownFields(t,e),e},writeField(t,e,n,r){e!==void 0&&KD(t,e,n,r)}}}function qD(t,e,n,r,i){let{repeated:a,localName:s}=n;switch(n.oneof&&(t=t[n.oneof.localName],t.case!=s&&delete t.value,t.case=s,s="value"),n.kind){case"scalar":case"enum":const o=n.kind=="enum"?pe.INT32:n.T;let c=Z0;if(n.kind=="scalar"&&n.L>0&&(c=xfe),a){let f=t[s];if(r==In.LengthDelimited&&o!=pe.STRING&&o!=pe.BYTES){let g=e.uint32()+e.pos;for(;e.pos<g;)f.push(c(e,o))}else f.push(c(e,o))}else t[s]=c(e,o);break;case"message":const u=n.T;a?t[s].push(Hy(e,new u,i,n)):Zs(t[s])?Hy(e,t[s],i,n):(t[s]=Hy(e,new u,i,n),u.fieldWrapper&&!n.oneof&&!n.repeated&&(t[s]=u.fieldWrapper.unwrapField(t[s])));break;case"map":let[d,h]=bfe(n,e,i);t[s][d]=h;break}}function Hy(t,e,n,r){const i=e.getType().runtime.bin,a=r==null?void 0:r.delimited;return i.readMessage(e,t,a?r.no:t.uint32(),n,a),e}function bfe(t,e,n){const r=e.uint32(),i=e.pos+r;let a,s;for(;e.pos<i;){const[o]=e.tag();switch(o){case 1:a=Z0(e,t.K);break;case 2:switch(t.V.kind){case"scalar":s=Z0(e,t.V.T);break;case"enum":s=e.int32();break;case"message":s=Hy(e,new t.V.T,n,void 0);break}break}}if(a===void 0&&(a=Th(t.K,Dc.BIGINT)),typeof a!="string"&&typeof a!="number"&&(a=a.toString()),s===void 0)switch(t.V.kind){case"scalar":s=Th(t.V.T,Dc.BIGINT);break;case"enum":s=t.V.T.values[0].no;break;case"message":s=new t.V.T;break}return[a,s]}function xfe(t,e){const n=Z0(t,e);return typeof n=="bigint"?n.toString():n}function Z0(t,e){switch(e){case pe.STRING:return t.string();case pe.BOOL:return t.bool();case pe.DOUBLE:return t.double();case pe.FLOAT:return t.float();case pe.INT32:return t.int32();case pe.INT64:return t.int64();case pe.UINT64:return t.uint64();case pe.FIXED64:return t.fixed64();case pe.BYTES:return t.bytes();case pe.FIXED32:return t.fixed32();case pe.SFIXED32:return t.sfixed32();case pe.SFIXED64:return t.sfixed64();case pe.SINT64:return t.sint64();case pe.UINT32:return t.uint32();case pe.SINT32:return t.sint32()}}function KD(t,e,n,r){Nn(e!==void 0);const i=t.repeated;switch(t.kind){case"scalar":case"enum":let a=t.kind=="enum"?pe.INT32:t.T;if(i)if(Nn(Array.isArray(e)),t.packed)Sfe(n,a,t.no,e);else for(const s of e)Wp(n,a,t.no,s);else Wp(n,a,t.no,e);break;case"message":if(i){Nn(Array.isArray(e));for(const s of e)GD(n,r,t,s)}else GD(n,r,t,e);break;case"map":Nn(typeof e=="object"&&e!=null);for(const[s,o]of Object.entries(e))wfe(n,r,t,s,o);break}}function wfe(t,e,n,r,i){t.tag(n.no,In.LengthDelimited),t.fork();let a=r;switch(n.K){case pe.INT32:case pe.FIXED32:case pe.UINT32:case pe.SFIXED32:case pe.SINT32:a=Number.parseInt(r);break;case pe.BOOL:Nn(r=="true"||r=="false"),a=r=="true";break}switch(Wp(t,n.K,1,a),n.V.kind){case"scalar":Wp(t,n.V.T,2,i);break;case"enum":Wp(t,pe.INT32,2,i);break;case"message":Nn(i!==void 0),t.tag(2,In.LengthDelimited).bytes(i.toBinary(e));break}t.join()}function GD(t,e,n,r){const i=lz(n.T,r);n.delimited?t.tag(n.no,In.StartGroup).raw(i.toBinary(e)).tag(n.no,In.EndGroup):t.tag(n.no,In.LengthDelimited).bytes(i.toBinary(e))}function Wp(t,e,n,r){Nn(r!==void 0);let[i,a]=uz(e);t.tag(n,i)[a](r)}function Sfe(t,e,n,r){if(!r.length)return;t.tag(n,In.LengthDelimited).fork();let[,i]=uz(e);for(let a=0;a<r.length;a++)t[i](r[a]);t.join()}function uz(t){let e=In.Varint;switch(t){case pe.BYTES:case pe.STRING:e=In.LengthDelimited;break;case pe.DOUBLE:case pe.FIXED64:case pe.SFIXED64:e=In.Bit64;break;case pe.FIXED32:case pe.SFIXED32:case pe.FLOAT:e=In.Bit32;break}const n=pe[t].toLowerCase();return[e,n]}function kfe(){return{setEnumType:ZU,initPartial(t,e){if(t===void 0)return;const n=e.getType();for(const r of n.fields.byMember()){const i=r.localName,a=e,s=t;if(s[i]!=null)switch(r.kind){case"oneof":const o=s[i].case;if(o===void 0)continue;const c=r.findField(o);let u=s[i].value;c&&c.kind=="message"&&!Zs(u,c.T)?u=new c.T(u):c&&c.kind==="scalar"&&c.T===pe.BYTES&&(u=ep(u)),a[i]={case:o,value:u};break;case"scalar":case"enum":let d=s[i];r.T===pe.BYTES&&(d=r.repeated?d.map(ep):ep(d)),a[i]=d;break;case"map":switch(r.V.kind){case"scalar":case"enum":if(r.V.T===pe.BYTES)for(const[p,g]of Object.entries(s[i]))a[i][p]=ep(g);else Object.assign(a[i],s[i]);break;case"message":const f=r.V.T;for(const p of Object.keys(s[i])){let g=s[i][p];f.fieldWrapper||(g=new f(g)),a[i][p]=g}break}break;case"message":const h=r.T;if(r.repeated)a[i]=s[i].map(f=>Zs(f,h)?f:new h(f));else{const f=s[i];h.fieldWrapper?h.typeName==="google.protobuf.BytesValue"?a[i]=ep(f):a[i]=f:a[i]=Zs(f,h)?f:new h(f)}break}}},equals(t,e,n){return e===n?!0:!e||!n?!1:t.fields.byMember().every(r=>{const i=e[r.localName],a=n[r.localName];if(r.repeated){if(i.length!==a.length)return!1;switch(r.kind){case"message":return i.every((s,o)=>r.T.equals(s,a[o]));case"scalar":return i.every((s,o)=>Mo(r.T,s,a[o]));case"enum":return i.every((s,o)=>Mo(pe.INT32,s,a[o]))}throw new Error("repeated cannot contain ".concat(r.kind))}switch(r.kind){case"message":let s=i,o=a;return r.T.fieldWrapper&&(s!==void 0&&!Zs(s)&&(s=r.T.fieldWrapper.wrapField(s)),o!==void 0&&!Zs(o)&&(o=r.T.fieldWrapper.wrapField(o))),r.T.equals(s,o);case"enum":return Mo(pe.INT32,i,a);case"scalar":return Mo(r.T,i,a);case"oneof":if(i.case!==a.case)return!1;const c=r.findField(i.case);if(c===void 0)return!0;switch(c.kind){case"message":return c.T.equals(i.value,a.value);case"enum":return Mo(pe.INT32,i.value,a.value);case"scalar":return Mo(c.T,i.value,a.value)}throw new Error("oneof cannot contain ".concat(c.kind));case"map":const u=Object.keys(i).concat(Object.keys(a));switch(r.V.kind){case"message":const d=r.V.T;return u.every(f=>d.equals(i[f],a[f]));case"enum":return u.every(f=>Mo(pe.INT32,i[f],a[f]));case"scalar":const h=r.V.T;return u.every(f=>Mo(h,i[f],a[f]))}break}})},clone(t){const e=t.getType(),n=new e,r=n;for(const i of e.fields.byMember()){const a=t[i.localName];let s;if(i.repeated)s=a.map(iy);else if(i.kind=="map"){s=r[i.localName];for(const[o,c]of Object.entries(a))s[o]=iy(c)}else i.kind=="oneof"?s=i.findField(a.case)?{case:a.case,value:iy(a.value)}:{case:void 0}:s=iy(a);r[i.localName]=s}for(const i of e.runtime.bin.listUnknownFields(t))e.runtime.bin.onUnknownField(r,i.no,i.wireType,i.data);return n}}}function iy(t){if(t===void 0)return t;if(Zs(t))return t.clone();if(t instanceof Uint8Array){const e=new Uint8Array(t.byteLength);return e.set(t),e}return t}function ep(t){return t instanceof Uint8Array?t:new Uint8Array(t)}function _fe(t,e,n){return{syntax:t,json:ffe(),bin:yfe(),util:Object.assign(Object.assign({},kfe()),{newFieldList:e,initFields:n}),makeMessageType(r,i,a){return Zhe(this,r,i,a)},makeEnum:Xhe,makeEnumType:QU,getEnumType:Jhe,makeExtension(r,i,a){return sfe(this,r,i,a)}}}class Cfe{constructor(e,n){this._fields=e,this._normalizer=n}findJsonName(e){if(!this.jsonNames){const n={};for(const r of this.list())n[r.jsonName]=n[r.name]=r;this.jsonNames=n}return this.jsonNames[e]}find(e){if(!this.numbers){const n={};for(const r of this.list())n[r.no]=r;this.numbers=n}return this.numbers[e]}list(){return this.all||(this.all=this._normalizer(this._fields)),this.all}byNumber(){return this.numbersAsc||(this.numbersAsc=this.list().concat().sort((e,n)=>e.no-n.no)),this.numbersAsc}byMember(){if(!this.members){this.members=[];const e=this.members;let n;for(const r of this.list())r.oneof?r.oneof!==n&&(n=r.oneof,e.push(n)):e.push(r)}return this.members}}function dz(t,e){const n=hz(t);return e?n:Afe(Nfe(n))}function Tfe(t){return dz(t,!1)}const Efe=hz;function hz(t){let e=!1;const n=[];for(let r=0;r<t.length;r++){let i=t.charAt(r);switch(i){case"_":e=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n.push(i),e=!1;break;default:e&&(e=!1,i=i.toUpperCase()),n.push(i);break}}return n.join("")}const jfe=new Set(["constructor","toString","toJSON","valueOf"]),Pfe=new Set(["getType","clone","equals","fromBinary","fromJson","fromJsonString","toBinary","toJson","toJsonString","toObject"]),fz=t=>"".concat(t,"$"),Nfe=t=>Pfe.has(t)?fz(t):t,Afe=t=>jfe.has(t)?fz(t):t;class Ofe{constructor(e){this.kind="oneof",this.repeated=!1,this.packed=!1,this.opt=!1,this.req=!1,this.default=void 0,this.fields=[],this.name=e,this.localName=Tfe(e)}addField(e){Nn(e.oneof===this,"field ".concat(e.name," not one of ").concat(this.name)),this.fields.push(e)}findField(e){if(!this._lookup){this._lookup=Object.create(null);for(let n=0;n<this.fields.length;n++)this._lookup[this.fields[n].localName]=this.fields[n]}return this._lookup[e]}}function Rfe(t,e){var n,r,i,a,s,o;const c=[];let u;for(const d of typeof t=="function"?t():t){const h=d;if(h.localName=dz(d.name,d.oneof!==void 0),h.jsonName=(n=d.jsonName)!==null&&n!==void 0?n:Efe(d.name),h.repeated=(r=d.repeated)!==null&&r!==void 0?r:!1,d.kind=="scalar"&&(h.L=(i=d.L)!==null&&i!==void 0?i:Dc.BIGINT),h.delimited=(a=d.delimited)!==null&&a!==void 0?a:!1,h.req=(s=d.req)!==null&&s!==void 0?s:!1,h.opt=(o=d.opt)!==null&&o!==void 0?o:!1,d.packed===void 0&&(h.packed=d.kind=="enum"||d.kind=="scalar"&&d.T!=pe.BYTES&&d.T!=pe.STRING),d.oneof!==void 0){const f=typeof d.oneof=="string"?d.oneof:d.oneof.name;(!u||u.name!=f)&&(u=new Ofe(f)),h.oneof=u,u.addField(h)}c.push(h)}return c}const X=_fe("proto3",t=>new Cfe(t,e=>Rfe(e)),t=>{for(const e of t.getType().fields.byMember()){if(e.opt)continue;const n=e.localName,r=t;if(e.repeated){r[n]=[];continue}switch(e.kind){case"oneof":r[n]={case:void 0};break;case"enum":r[n]=0;break;case"map":r[n]={};break;case"scalar":r[n]=Th(e.T,e.L);break}}});class ei extends iP{constructor(e){super(),this.seconds=mn.zero,this.nanos=0,X.util.initPartial(e,this)}fromJson(e,n){if(typeof e!="string")throw new Error("cannot decode google.protobuf.Timestamp from JSON: ".concat(X.json.debug(e)));const r=e.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!r)throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");const i=Date.parse(r[1]+"-"+r[2]+"-"+r[3]+"T"+r[4]+":"+r[5]+":"+r[6]+(r[8]?r[8]:"Z"));if(Number.isNaN(i))throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");if(i<Date.parse("0001-01-01T00:00:00Z")||i>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot decode message google.protobuf.Timestamp from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");return this.seconds=mn.parse(i/1e3),this.nanos=0,r[7]&&(this.nanos=parseInt("1"+r[7]+"0".repeat(9-r[7].length))-1e9),this}toJson(e){const n=Number(this.seconds)*1e3;if(n<Date.parse("0001-01-01T00:00:00Z")||n>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot encode google.protobuf.Timestamp to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");if(this.nanos<0)throw new Error("cannot encode google.protobuf.Timestamp to JSON: nanos must not be negative");let r="Z";if(this.nanos>0){const i=(this.nanos+1e9).toString().substring(1);i.substring(3)==="000000"?r="."+i.substring(0,3)+"Z":i.substring(6)==="000"?r="."+i.substring(0,6)+"Z":r="."+i+"Z"}return new Date(n).toISOString().replace(".000Z",r)}toDate(){return new Date(Number(this.seconds)*1e3+Math.ceil(this.nanos/1e6))}static now(){return ei.fromDate(new Date)}static fromDate(e){const n=e.getTime();return new ei({seconds:mn.parse(Math.floor(n/1e3)),nanos:n%1e3*1e6})}static fromBinary(e,n){return new ei().fromBinary(e,n)}static fromJson(e,n){return new ei().fromJson(e,n)}static fromJsonString(e,n){return new ei().fromJsonString(e,n)}static equals(e,n){return X.util.equals(ei,e,n)}}ei.runtime=X;ei.typeName="google.protobuf.Timestamp";ei.fields=X.util.newFieldList(()=>[{no:1,name:"seconds",kind:"scalar",T:3},{no:2,name:"nanos",kind:"scalar",T:5}]);const Dfe=X.makeMessageType("livekit.MetricsBatch",()=>[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:ei},{no:3,name:"str_data",kind:"scalar",T:9,repeated:!0},{no:4,name:"time_series",kind:"message",T:Mfe,repeated:!0},{no:5,name:"events",kind:"message",T:Lfe,repeated:!0}]),Mfe=X.makeMessageType("livekit.TimeSeriesMetric",()=>[{no:1,name:"label",kind:"scalar",T:13},{no:2,name:"participant_identity",kind:"scalar",T:13},{no:3,name:"track_sid",kind:"scalar",T:13},{no:4,name:"samples",kind:"message",T:Ife,repeated:!0},{no:5,name:"rid",kind:"scalar",T:13}]),Ife=X.makeMessageType("livekit.MetricSample",()=>[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:ei},{no:3,name:"value",kind:"scalar",T:2}]),Lfe=X.makeMessageType("livekit.EventMetric",()=>[{no:1,name:"label",kind:"scalar",T:13},{no:2,name:"participant_identity",kind:"scalar",T:13},{no:3,name:"track_sid",kind:"scalar",T:13},{no:4,name:"start_timestamp_ms",kind:"scalar",T:3},{no:5,name:"end_timestamp_ms",kind:"scalar",T:3,opt:!0},{no:6,name:"normalized_start_timestamp",kind:"message",T:ei},{no:7,name:"normalized_end_timestamp",kind:"message",T:ei,opt:!0},{no:8,name:"metadata",kind:"scalar",T:9},{no:9,name:"rid",kind:"scalar",T:13}]),pz=X.makeEnum("livekit.BackupCodecPolicy",[{no:0,name:"PREFER_REGRESSION"},{no:1,name:"SIMULCAST"},{no:2,name:"REGRESSION"}]),Da=X.makeEnum("livekit.TrackType",[{no:0,name:"AUDIO"},{no:1,name:"VIDEO"},{no:2,name:"DATA"}]),Un=X.makeEnum("livekit.TrackSource",[{no:0,name:"UNKNOWN"},{no:1,name:"CAMERA"},{no:2,name:"MICROPHONE"},{no:3,name:"SCREEN_SHARE"},{no:4,name:"SCREEN_SHARE_AUDIO"}]),sP=X.makeEnum("livekit.VideoQuality",[{no:0,name:"LOW"},{no:1,name:"MEDIUM"},{no:2,name:"HIGH"},{no:3,name:"OFF"}]),Cp=X.makeEnum("livekit.ConnectionQuality",[{no:0,name:"POOR"},{no:1,name:"GOOD"},{no:2,name:"EXCELLENT"},{no:3,name:"LOST"}]),Fm=X.makeEnum("livekit.ClientConfigSetting",[{no:0,name:"UNSET"},{no:1,name:"DISABLED"},{no:2,name:"ENABLED"}]),Wa=X.makeEnum("livekit.DisconnectReason",[{no:0,name:"UNKNOWN_REASON"},{no:1,name:"CLIENT_INITIATED"},{no:2,name:"DUPLICATE_IDENTITY"},{no:3,name:"SERVER_SHUTDOWN"},{no:4,name:"PARTICIPANT_REMOVED"},{no:5,name:"ROOM_DELETED"},{no:6,name:"STATE_MISMATCH"},{no:7,name:"JOIN_FAILURE"},{no:8,name:"MIGRATION"},{no:9,name:"SIGNAL_CLOSE"},{no:10,name:"ROOM_CLOSED"},{no:11,name:"USER_UNAVAILABLE"},{no:12,name:"USER_REJECTED"},{no:13,name:"SIP_TRUNK_FAILURE"},{no:14,name:"CONNECTION_TIMEOUT"},{no:15,name:"MEDIA_FAILURE"},{no:16,name:"AGENT_ERROR"}]),ll=X.makeEnum("livekit.ReconnectReason",[{no:0,name:"RR_UNKNOWN"},{no:1,name:"RR_SIGNAL_DISCONNECTED"},{no:2,name:"RR_PUBLISHER_FAILED"},{no:3,name:"RR_SUBSCRIBER_FAILED"},{no:4,name:"RR_SWITCH_CANDIDATE"}]),$fe=X.makeEnum("livekit.SubscriptionError",[{no:0,name:"SE_UNKNOWN"},{no:1,name:"SE_CODEC_UNSUPPORTED"},{no:2,name:"SE_TRACK_NOTFOUND"}]),or=X.makeEnum("livekit.AudioTrackFeature",[{no:0,name:"TF_STEREO"},{no:1,name:"TF_NO_DTX"},{no:2,name:"TF_AUTO_GAIN_CONTROL"},{no:3,name:"TF_ECHO_CANCELLATION"},{no:4,name:"TF_NOISE_SUPPRESSION"},{no:5,name:"TF_ENHANCED_NOISE_CANCELLATION"},{no:6,name:"TF_PRECONNECT_BUFFER"}]),mz=X.makeEnum("livekit.PacketTrailerFeature",[{no:0,name:"PTF_USER_TIMESTAMP"},{no:1,name:"PTF_FRAME_ID"}]),Sw=X.makeMessageType("livekit.Room",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"empty_timeout",kind:"scalar",T:13},{no:14,name:"departure_timeout",kind:"scalar",T:13},{no:4,name:"max_participants",kind:"scalar",T:13},{no:5,name:"creation_time",kind:"scalar",T:3},{no:15,name:"creation_time_ms",kind:"scalar",T:3},{no:6,name:"turn_password",kind:"scalar",T:9},{no:7,name:"enabled_codecs",kind:"message",T:Q0,repeated:!0},{no:8,name:"metadata",kind:"scalar",T:9},{no:9,name:"num_participants",kind:"scalar",T:13},{no:11,name:"num_publishers",kind:"scalar",T:13},{no:10,name:"active_recording",kind:"scalar",T:8},{no:13,name:"version",kind:"message",T:jz}]),Q0=X.makeMessageType("livekit.Codec",()=>[{no:1,name:"mime",kind:"scalar",T:9},{no:2,name:"fmtp_line",kind:"scalar",T:9}]),Ffe=X.makeMessageType("livekit.ParticipantPermission",()=>[{no:1,name:"can_subscribe",kind:"scalar",T:8},{no:2,name:"can_publish",kind:"scalar",T:8},{no:3,name:"can_publish_data",kind:"scalar",T:8},{no:9,name:"can_publish_sources",kind:"enum",T:X.getEnumType(Un),repeated:!0},{no:7,name:"hidden",kind:"scalar",T:8},{no:8,name:"recorder",kind:"scalar",T:8},{no:10,name:"can_update_metadata",kind:"scalar",T:8},{no:11,name:"agent",kind:"scalar",T:8},{no:12,name:"can_subscribe_metrics",kind:"scalar",T:8},{no:13,name:"can_manage_agent_session",kind:"scalar",T:8}]),lu=X.makeMessageType("livekit.ParticipantInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"identity",kind:"scalar",T:9}
vendor: 16,384 bytes, line 664
664,{no:3,name:"state",kind:"enum",T:X.getEnumType(Md)},{no:4,name:"tracks",kind:"message",T:gd,repeated:!0},{no:5,name:"metadata",kind:"scalar",T:9},{no:6,name:"joined_at",kind:"scalar",T:3},{no:17,name:"joined_at_ms",kind:"scalar",T:3},{no:9,name:"name",kind:"scalar",T:9},{no:10,name:"version",kind:"scalar",T:13},{no:11,name:"permission",kind:"message",T:Ffe},{no:12,name:"region",kind:"scalar",T:9},{no:13,name:"is_publisher",kind:"scalar",T:8},{no:14,name:"kind",kind:"enum",T:X.getEnumType(Bm)},{no:15,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:16,name:"disconnect_reason",kind:"enum",T:X.getEnumType(Wa)},{no:18,name:"kind_details",kind:"enum",T:X.getEnumType(Bfe),repeated:!0},{no:19,name:"data_tracks",kind:"message",T:kw,repeated:!0},{no:20,name:"client_protocol",kind:"scalar",T:5}]),Md=X.makeEnum("livekit.ParticipantInfo.State",[{no:0,name:"JOINING"},{no:1,name:"JOINED"},{no:2,name:"ACTIVE"},{no:3,name:"DISCONNECTED"}]),Bm=X.makeEnum("livekit.ParticipantInfo.Kind",[{no:0,name:"STANDARD"},{no:1,name:"INGRESS"},{no:2,name:"EGRESS"},{no:3,name:"SIP"},{no:4,name:"AGENT"},{no:7,name:"CONNECTOR"},{no:8,name:"BRIDGE"}]),Bfe=X.makeEnum("livekit.ParticipantInfo.KindDetail",[{no:0,name:"CLOUD_AGENT"},{no:1,name:"FORWARDED"},{no:2,name:"CONNECTOR_WHATSAPP"},{no:3,name:"CONNECTOR_TWILIO"},{no:4,name:"BRIDGE_RTSP"}]),Yt=X.makeEnum("livekit.Encryption.Type",[{no:0,name:"NONE"},{no:1,name:"GCM"},{no:2,name:"CUSTOM"}]),Ufe=X.makeMessageType("livekit.SimulcastCodecInfo",()=>[{no:1,name:"mime_type",kind:"scalar",T:9},{no:2,name:"mid",kind:"scalar",T:9},{no:3,name:"cid",kind:"scalar",T:9},{no:4,name:"layers",kind:"message",T:kc,repeated:!0},{no:5,name:"video_layer_mode",kind:"enum",T:X.getEnumType(gz)},{no:6,name:"sdp_cid",kind:"scalar",T:9}]),gd=X.makeMessageType("livekit.TrackInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:X.getEnumType(Da)},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"muted",kind:"scalar",T:8},{no:5,name:"width",kind:"scalar",T:13},{no:6,name:"height",kind:"scalar",T:13},{no:7,name:"simulcast",kind:"scalar",T:8},{no:8,name:"disable_dtx",kind:"scalar",T:8},{no:9,name:"source",kind:"enum",T:X.getEnumType(Un)},{no:10,name:"layers",kind:"message",T:kc,repeated:!0},{no:11,name:"mime_type",kind:"scalar",T:9},{no:12,name:"mid",kind:"scalar",T:9},{no:13,name:"codecs",kind:"message",T:Ufe,repeated:!0},{no:14,name:"stereo",kind:"scalar",T:8},{no:15,name:"disable_red",kind:"scalar",T:8},{no:16,name:"encryption",kind:"enum",T:X.getEnumType(Yt)},{no:17,name:"stream",kind:"scalar",T:9},{no:18,name:"version",kind:"message",T:jz},{no:19,name:"audio_features",kind:"enum",T:X.getEnumType(or),repeated:!0},{no:20,name:"backup_codec_policy",kind:"enum",T:X.getEnumType(pz)},{no:21,name:"packet_trailer_features",kind:"enum",T:X.getEnumType(mz),repeated:!0}]),kw=X.makeMessageType("livekit.DataTrackInfo",()=>[{no:1,name:"pub_handle",kind:"scalar",T:13},{no:2,name:"sid",kind:"scalar",T:9},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"encryption",kind:"enum",T:X.getEnumType(Yt)}]),zfe=X.makeMessageType("livekit.DataTrackSubscriptionOptions",()=>[{no:1,name:"target_fps",kind:"scalar",T:13,opt:!0}]),kc=X.makeMessageType("livekit.VideoLayer",()=>[{no:1,name:"quality",kind:"enum",T:X.getEnumType(sP)},{no:2,name:"width",kind:"scalar",T:13},{no:3,name:"height",kind:"scalar",T:13},{no:4,name:"bitrate",kind:"scalar",T:13},{no:5,name:"ssrc",kind:"scalar",T:13},{no:6,name:"spatial_layer",kind:"scalar",T:5},{no:7,name:"rid",kind:"scalar",T:9},{no:8,name:"repair_ssrc",kind:"scalar",T:13}]),gz=X.makeEnum("livekit.VideoLayer.Mode",[{no:0,name:"MODE_UNUSED"},{no:1,name:"ONE_SPATIAL_LAYER_PER_STREAM"},{no:2,name:"MULTIPLE_SPATIAL_LAYERS_PER_STREAM"},{no:3,name:"ONE_SPATIAL_LAYER_PER_STREAM_INCOMPLETE_RTCP_SR"}]),Fr=X.makeMessageType("livekit.DataPacket",()=>[{no:1,name:"kind",kind:"enum",T:X.getEnumType(Pl)},{no:4,name:"participant_identity",kind:"scalar",T:9},{no:5,name:"destination_identities",kind:"scalar",T:9,repeated:!0},{no:2,name:"user",kind:"message",T:oP,oneof:"value"},{no:3,name:"speaker",kind:"message",T:Wfe,oneof:"value"},{no:6,name:"sip_dtmf",kind:"message",T:xz,oneof:"value"},{no:7,name:"transcription",kind:"message",T:Vfe,oneof:"value"},{no:8,name:"metrics",kind:"message",T:Dfe,oneof:"value"},{no:9,name:"chat_message",kind:"message",T:eb,oneof:"value"},{no:10,name:"rpc_request",kind:"message",T:cP,oneof:"value"},{no:11,name:"rpc_ack",kind:"message",T:lP,oneof:"value"},{no:12,name:"rpc_response",kind:"message",T:uP,oneof:"value"},{no:13,name:"stream_header",kind:"message",T:tb,oneof:"value"},{no:14,name:"stream_chunk",kind:"message",T:nb,oneof:"value"},{no:15,name:"stream_trailer",kind:"message",T:rb,oneof:"value"},{no:18,name:"encrypted_packet",kind:"message",T:vz,oneof:"value"},{no:16,name:"sequence",kind:"scalar",T:13},{no:17,name:"participant_sid",kind:"scalar",T:9}]),Pl=X.makeEnum("livekit.DataPacket.Kind",[{no:0,name:"RELIABLE"},{no:1,name:"LOSSY"}]),vz=X.makeMessageType("livekit.EncryptedPacket",()=>[{no:1,name:"encryption_type",kind:"enum",T:X.getEnumType(Yt)},{no:2,name:"iv",kind:"scalar",T:12},{no:3,name:"key_index",kind:"scalar",T:13},{no:4,name:"encrypted_value",kind:"scalar",T:12}]),yz=X.makeMessageType("livekit.EncryptedPacketPayload",()=>[{no:1,name:"user",kind:"message",T:oP,oneof:"value"},{no:3,name:"chat_message",kind:"message",T:eb,oneof:"value"},{no:4,name:"rpc_request",kind:"message",T:cP,oneof:"value"},{no:5,name:"rpc_ack",kind:"message",T:lP,oneof:"value"},{no:6,name:"rpc_response",kind:"message",T:uP,oneof:"value"},{no:7,name:"stream_header",kind:"message",T:tb,oneof:"value"},{no:8,name:"stream_chunk",kind:"message",T:nb,oneof:"value"},{no:9,name:"stream_trailer",kind:"message",T:rb,oneof:"value"}]),Wfe=X.makeMessageType("livekit.ActiveSpeakerUpdate",()=>[{no:1,name:"speakers",kind:"message",T:bz,repeated:!0}]),bz=X.makeMessageType("livekit.SpeakerInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"level",kind:"scalar",T:2},{no:3,name:"active",kind:"scalar",T:8}]),oP=X.makeMessageType("livekit.UserPacket",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:5,name:"participant_identity",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:12},{no:3,name:"destination_sids",kind:"scalar",T:9,repeated:!0},{no:6,name:"destination_identities",kind:"scalar",T:9,repeated:!0},{no:4,name:"topic",kind:"scalar",T:9,opt:!0},{no:8,name:"id",kind:"scalar",T:9,opt:!0},{no:9,name:"start_time",kind:"scalar",T:4,opt:!0},{no:10,name:"end_time",kind:"scalar",T:4,opt:!0},{no:11,name:"nonce",kind:"scalar",T:12}]),xz=X.makeMessageType("livekit.SipDTMF",()=>[{no:3,name:"code",kind:"scalar",T:13},{no:4,name:"digit",kind:"scalar",T:9}]),Vfe=X.makeMessageType("livekit.Transcription",()=>[{no:2,name:"transcribed_participant_identity",kind:"scalar",T:9},{no:3,name:"track_id",kind:"scalar",T:9},{no:4,name:"segments",kind:"message",T:Hfe,repeated:!0}]),Hfe=X.makeMessageType("livekit.TranscriptionSegment",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"text",kind:"scalar",T:9},{no:3,name:"start_time",kind:"scalar",T:4},{no:4,name:"end_time",kind:"scalar",T:4},{no:5,name:"final",kind:"scalar",T:8},{no:6,name:"language",kind:"scalar",T:9}]),eb=X.makeMessageType("livekit.ChatMessage",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"timestamp",kind:"scalar",T:3},{no:3,name:"edit_timestamp",kind:"scalar",T:3,opt:!0},{no:4,name:"message",kind:"scalar",T:9},{no:5,name:"deleted",kind:"scalar",T:8},{no:6,name:"generated",kind:"scalar",T:8}]),cP=X.makeMessageType("livekit.RpcRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"method",kind:"scalar",T:9},{no:3,name:"payload",kind:"scalar",T:9},{no:4,name:"response_timeout_ms",kind:"scalar",T:13},{no:5,name:"version",kind:"scalar",T:13},{no:6,name:"compressed_payload",kind:"scalar",T:12}]),lP=X.makeMessageType("livekit.RpcAck",()=>[{no:1,name:"request_id",kind:"scalar",T:9}]),uP=X.makeMessageType("livekit.RpcResponse",()=>[{no:1,name:"request_id",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:9,oneof:"value"},{no:3,name:"error",kind:"message",T:wz,oneof:"value"},{no:4,name:"compressed_payload",kind:"scalar",T:12,oneof:"value"}]),wz=X.makeMessageType("livekit.RpcError",()=>[{no:1,name:"code",kind:"scalar",T:13},{no:2,name:"message",kind:"scalar",T:9},{no:3,name:"data",kind:"scalar",T:9}]),Sz=X.makeMessageType("livekit.ParticipantTracks",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sids",kind:"scalar",T:9,repeated:!0}]),kz=X.makeMessageType("livekit.ServerInfo",()=>[{no:1,name:"edition",kind:"enum",T:X.getEnumType(_z)},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"protocol",kind:"scalar",T:5},{no:4,name:"region",kind:"scalar",T:9},{no:5,name:"node_id",kind:"scalar",T:9},{no:6,name:"debug_info",kind:"scalar",T:9},{no:7,name:"agent_protocol",kind:"scalar",T:5}]),_z=X.makeEnum("livekit.ServerInfo.Edition",[{no:0,name:"Standard"},{no:1,name:"Cloud"}]),Cz=X.makeMessageType("livekit.ClientInfo",()=>[{no:1,name:"sdk",kind:"enum",T:X.getEnumType(Tz)},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"protocol",kind:"scalar",T:5},{no:4,name:"os",kind:"scalar",T:9},{no:5,name:"os_version",kind:"scalar",T:9},{no:6,name:"device_model",kind:"scalar",T:9},{no:7,name:"browser",kind:"scalar",T:9},{no:8,name:"browser_version",kind:"scalar",T:9},{no:9,name:"address",kind:"scalar",T:9},{no:10,name:"network",kind:"scalar",T:9},{no:11,name:"other_sdks",kind:"scalar",T:9},{no:12,name:"client_protocol",kind:"scalar",T:5}]),Tz=X.makeEnum("livekit.ClientInfo.SDK",[{no:0,name:"UNKNOWN"},{no:1,name:"JS"},{no:2,name:"SWIFT"},{no:3,name:"ANDROID"},{no:4,name:"FLUTTER"},{no:5,name:"GO"},{no:6,name:"UNITY"},{no:7,name:"REACT_NATIVE"},{no:8,name:"RUST"},{no:9,name:"PYTHON"},{no:10,name:"CPP"},{no:11,name:"UNITY_WEB"},{no:12,name:"NODE"},{no:13,name:"UNREAL"},{no:14,name:"ESP32"}]),Ez=X.makeMessageType("livekit.ClientConfiguration",()=>[{no:1,name:"video",kind:"message",T:YD},{no:2,name:"screen",kind:"message",T:YD},{no:3,name:"resume_connection",kind:"enum",T:X.getEnumType(Fm)},{no:4,name:"disabled_codecs",kind:"message",T:qfe},{no:5,name:"force_relay",kind:"enum",T:X.getEnumType(Fm)}]),YD=X.makeMessageType("livekit.VideoConfiguration",()=>[{no:1,name:"hardware_encoder",kind:"enum",T:X.getEnumType(Fm)}]),qfe=X.makeMessageType("livekit.DisabledCodecs",()=>[{no:1,name:"codecs",kind:"message",T:Q0,repeated:!0},{no:2,name:"publish",kind:"message",T:Q0,repeated:!0}]),jz=X.makeMessageType("livekit.TimedVersion",()=>[{no:1,name:"unix_micro",kind:"scalar",T:3},{no:2,name:"ticks",kind:"scalar",T:5}]),WC=X.makeEnum("livekit.DataStream.OperationType",[{no:0,name:"CREATE"},{no:1,name:"UPDATE"},{no:2,name:"DELETE"},{no:3,name:"REACTION"}]),Pz=X.makeMessageType("livekit.DataStream.TextHeader",()=>[{no:1,name:"operation_type",kind:"enum",T:X.getEnumType(WC)},{no:2,name:"version",kind:"scalar",T:5},{no:3,name:"reply_to_stream_id",kind:"scalar",T:9},{no:4,name:"attached_stream_ids",kind:"scalar",T:9,repeated:!0},{no:5,name:"generated",kind:"scalar",T:8}],{localName:"DataStream_TextHeader"}),Nz=X.makeMessageType("livekit.DataStream.ByteHeader",()=>[{no:1,name:"name",kind:"scalar",T:9}],{localName:"DataStream_ByteHeader"}),tb=X.makeMessageType("livekit.DataStream.Header",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"timestamp",kind:"scalar",T:3},{no:3,name:"topic",kind:"scalar",T:9},{no:4,name:"mime_type",kind:"scalar",T:9},{no:5,name:"total_length",kind:"scalar",T:4,opt:!0},{no:7,name:"encryption_type",kind:"enum",T:X.getEnumType(Yt)},{no:8,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:9,name:"text_header",kind:"message",T:Pz,oneof:"content_header"},{no:10,name:"byte_header",kind:"message",T:Nz,oneof:"content_header"}],{localName:"DataStream_Header"}),nb=X.makeMessageType("livekit.DataStream.Chunk",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"chunk_index",kind:"scalar",T:4},{no:3,name:"content",kind:"scalar",T:12},{no:4,name:"version",kind:"scalar",T:5},{no:5,name:"iv",kind:"scalar",T:12,opt:!0}],{localName:"DataStream_Chunk"}),rb=X.makeMessageType("livekit.DataStream.Trailer",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"reason",kind:"scalar",T:9},{no:3,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}}],{localName:"DataStream_Trailer"}),Kfe=X.makeMessageType("livekit.SubscribedAudioCodec",()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"enabled",kind:"scalar",T:8}]),Ma=X.makeEnum("livekit.SignalTarget",[{no:0,name:"PUBLISHER"},{no:1,name:"SUBSCRIBER"}]),VC=X.makeEnum("livekit.StreamState",[{no:0,name:"ACTIVE"},{no:1,name:"PAUSED"}]),Gfe=X.makeEnum("livekit.CandidateProtocol",[{no:0,name:"UDP"},{no:1,name:"TCP"},{no:2,name:"TLS"}]),Yfe=X.makeMessageType("livekit.SignalRequest",()=>[{no:1,name:"offer",kind:"message",T:Mc,oneof:"message"},{no:2,name:"answer",kind:"message",T:Mc,oneof:"message"},{no:3,name:"trickle",kind:"message",T:_w,oneof:"message"},{no:4,name:"add_track",kind:"message",T:Um,oneof:"message"},{no:5,name:"mute",kind:"message",T:Cw,oneof:"message"},{no:6,name:"subscription",kind:"message",T:Tw,oneof:"message"},{no:7,name:"track_setting",kind:"message",T:Rz,oneof:"message"},{no:8,name:"leave",kind:"message",T:Ew,oneof:"message"},{no:10,name:"update_layers",kind:"message",T:Mz,oneof:"message"},{no:11,name:"subscription_permission",kind:"message",T:$z,oneof:"message"},{no:12,name:"sync_state",kind:"message",T:yP,oneof:"message"},{no:13,name:"simulate",kind:"message",T:as,oneof:"message"},{no:14,name:"ping",kind:"scalar",T:3,oneof:"message"},{no:15,name:"update_metadata",kind:"message",T:gP,oneof:"message"},{no:16,name:"ping_req",kind:"message",T:Uz,oneof:"message"},{no:17,name:"update_audio_track",kind:"message",T:mP,oneof:"message"},{no:18,name:"update_video_track",kind:"message",T:Dz,oneof:"message"},{no:19,name:"publish_data_track_request",kind:"message",T:dP,oneof:"message"},{no:20,name:"unpublish_data_track_request",kind:"message",T:fP,oneof:"message"},{no:21,name:"update_data_subscription",kind:"message",T:Az,oneof:"message"}]),JD=X.makeMessageType("livekit.SignalResponse",()=>[{no:1,name:"join",kind:"message",T:Qfe,oneof:"message"},{no:2,name:"answer",kind:"message",T:Mc,oneof:"message"},{no:3,name:"offer",kind:"message",T:Mc,oneof:"message"},{no:4,name:"trickle",kind:"message",T:_w,oneof:"message"},{no:5,name:"update",kind:"message",T:npe,oneof:"message"},{no:6,name:"track_published",kind:"message",T:pP,oneof:"message"},{no:8,name:"leave",kind:"message",T:Ew,oneof:"message"},{no:9,name:"mute",kind:"message",T:Cw,oneof:"message"},{no:10,name:"speakers_changed",kind:"message",T:rpe,oneof:"message"},{no:11,name:"room_update",kind:"message",T:ipe,oneof:"message"},{no:12,name:"connection_quality",kind:"message",T:spe,oneof:"message"},{no:13,name:"stream_state_update",kind:"message",T:cpe,oneof:"message"},{no:14,name:"subscribed_quality_update",kind:"message",T:upe,oneof:"message"},{no:15,name:"subscription_permission_update",kind:"message",T:hpe,oneof:"message"},{no:16,name:"refresh_token",kind:"scalar",T:9,oneof:"message"},{no:17,name:"track_unpublished",kind:"message",T:tpe,oneof:"message"},{no:18,name:"pong",kind:"scalar",T:3,oneof:"message"},{no:19,name:"reconnect",kind:"message",T:epe,oneof:"message"},{no:20,name:"pong_resp",kind:"message",T:ppe,oneof:"message"},{no:21,name:"subscription_response",kind:"message",T:vpe,oneof:"message"},{no:22,name:"request_response",kind:"message",T:ype,oneof:"message"},{no:23,name:"track_subscribed",kind:"message",T:bpe,oneof:"message"},{no:24,name:"room_moved",kind:"message",T:fpe,oneof:"message"},{no:25,name:"media_sections_requirement",kind:"message",T:Spe,oneof:"message"},{no:26,name:"subscribed_audio_codec_update",kind:"message",T:dpe,oneof:"message"},{no:27,name:"publish_data_track_response",kind:"message",T:hP,oneof:"message"},{no:28,name:"unpublish_data_track_response",kind:"message",T:Jfe,oneof:"message"},{no:29,name:"data_track_subscriber_handles",kind:"message",T:Xfe,oneof:"message"}]),HC=X.makeMessageType("livekit.SimulcastCodec",()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"cid",kind:"scalar",T:9},{no:4,name:"layers",kind:"message",T:kc,repeated:!0},{no:5,name:"video_layer_mode",kind:"enum",T:X.getEnumType(gz)}]),Um=X.makeMessageType("livekit.AddTrackRequest",()=>[{no:1,name:"cid",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"type",k
vendor: 11,569 bytes, line 664
664ind:"enum",T:X.getEnumType(Da)},{no:4,name:"width",kind:"scalar",T:13},{no:5,name:"height",kind:"scalar",T:13},{no:6,name:"muted",kind:"scalar",T:8},{no:7,name:"disable_dtx",kind:"scalar",T:8},{no:8,name:"source",kind:"enum",T:X.getEnumType(Un)},{no:9,name:"layers",kind:"message",T:kc,repeated:!0},{no:10,name:"simulcast_codecs",kind:"message",T:HC,repeated:!0},{no:11,name:"sid",kind:"scalar",T:9},{no:12,name:"stereo",kind:"scalar",T:8},{no:13,name:"disable_red",kind:"scalar",T:8},{no:14,name:"encryption",kind:"enum",T:X.getEnumType(Yt)},{no:15,name:"stream",kind:"scalar",T:9},{no:16,name:"backup_codec_policy",kind:"enum",T:X.getEnumType(pz)},{no:17,name:"audio_features",kind:"enum",T:X.getEnumType(or),repeated:!0},{no:18,name:"packet_trailer_features",kind:"enum",T:X.getEnumType(mz),repeated:!0}]),dP=X.makeMessageType("livekit.PublishDataTrackRequest",()=>[{no:1,name:"pub_handle",kind:"scalar",T:13},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"encryption",kind:"enum",T:X.getEnumType(Yt)}]),hP=X.makeMessageType("livekit.PublishDataTrackResponse",()=>[{no:1,name:"info",kind:"message",T:kw}]),fP=X.makeMessageType("livekit.UnpublishDataTrackRequest",()=>[{no:1,name:"pub_handle",kind:"scalar",T:13}]),Jfe=X.makeMessageType("livekit.UnpublishDataTrackResponse",()=>[{no:1,name:"info",kind:"message",T:kw}]),Xfe=X.makeMessageType("livekit.DataTrackSubscriberHandles",()=>[{no:1,name:"sub_handles",kind:"map",K:13,V:{kind:"message",T:Zfe}}]),Zfe=X.makeMessageType("livekit.DataTrackSubscriberHandles.PublishedDataTrack",()=>[{no:1,name:"publisher_identity",kind:"scalar",T:9},{no:2,name:"publisher_sid",kind:"scalar",T:9},{no:3,name:"track_sid",kind:"scalar",T:9}],{localName:"DataTrackSubscriberHandles_PublishedDataTrack"}),_w=X.makeMessageType("livekit.TrickleRequest",()=>[{no:1,name:"candidateInit",kind:"scalar",T:9},{no:2,name:"target",kind:"enum",T:X.getEnumType(Ma)},{no:3,name:"final",kind:"scalar",T:8}]),Cw=X.makeMessageType("livekit.MuteTrackRequest",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"muted",kind:"scalar",T:8}]),Qfe=X.makeMessageType("livekit.JoinResponse",()=>[{no:1,name:"room",kind:"message",T:Sw},{no:2,name:"participant",kind:"message",T:lu},{no:3,name:"other_participants",kind:"message",T:lu,repeated:!0},{no:4,name:"server_version",kind:"scalar",T:9},{no:5,name:"ice_servers",kind:"message",T:Iz,repeated:!0},{no:6,name:"subscriber_primary",kind:"scalar",T:8},{no:7,name:"alternative_url",kind:"scalar",T:9},{no:8,name:"client_configuration",kind:"message",T:Ez},{no:9,name:"server_region",kind:"scalar",T:9},{no:10,name:"ping_timeout",kind:"scalar",T:5},{no:11,name:"ping_interval",kind:"scalar",T:5},{no:12,name:"server_info",kind:"message",T:kz},{no:13,name:"sif_trailer",kind:"scalar",T:12},{no:14,name:"enabled_publish_codecs",kind:"message",T:Q0,repeated:!0},{no:15,name:"fast_publish",kind:"scalar",T:8}]),epe=X.makeMessageType("livekit.ReconnectResponse",()=>[{no:1,name:"ice_servers",kind:"message",T:Iz,repeated:!0},{no:2,name:"client_configuration",kind:"message",T:Ez},{no:3,name:"server_info",kind:"message",T:kz},{no:4,name:"last_message_seq",kind:"scalar",T:13}]),pP=X.makeMessageType("livekit.TrackPublishedResponse",()=>[{no:1,name:"cid",kind:"scalar",T:9},{no:2,name:"track",kind:"message",T:gd}]),tpe=X.makeMessageType("livekit.TrackUnpublishedResponse",()=>[{no:1,name:"track_sid",kind:"scalar",T:9}]),Mc=X.makeMessageType("livekit.SessionDescription",()=>[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"sdp",kind:"scalar",T:9},{no:3,name:"id",kind:"scalar",T:13},{no:4,name:"mid_to_track_id",kind:"map",K:9,V:{kind:"scalar",T:9}}]),npe=X.makeMessageType("livekit.ParticipantUpdate",()=>[{no:1,name:"participants",kind:"message",T:lu,repeated:!0}]),Tw=X.makeMessageType("livekit.UpdateSubscription",()=>[{no:1,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:2,name:"subscribe",kind:"scalar",T:8},{no:3,name:"participant_tracks",kind:"message",T:Sz,repeated:!0}]),Az=X.makeMessageType("livekit.UpdateDataSubscription",()=>[{no:1,name:"updates",kind:"message",T:Oz,repeated:!0}]),Oz=X.makeMessageType("livekit.UpdateDataSubscription.Update",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"subscribe",kind:"scalar",T:8},{no:3,name:"options",kind:"message",T:zfe}],{localName:"UpdateDataSubscription_Update"}),Rz=X.makeMessageType("livekit.UpdateTrackSettings",()=>[{no:1,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:3,name:"disabled",kind:"scalar",T:8},{no:4,name:"quality",kind:"enum",T:X.getEnumType(sP)},{no:5,name:"width",kind:"scalar",T:13},{no:6,name:"height",kind:"scalar",T:13},{no:7,name:"fps",kind:"scalar",T:13},{no:8,name:"priority",kind:"scalar",T:13}]),mP=X.makeMessageType("livekit.UpdateLocalAudioTrack",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"features",kind:"enum",T:X.getEnumType(or),repeated:!0}]),Dz=X.makeMessageType("livekit.UpdateLocalVideoTrack",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"width",kind:"scalar",T:13},{no:3,name:"height",kind:"scalar",T:13}]),Ew=X.makeMessageType("livekit.LeaveRequest",()=>[{no:1,name:"can_reconnect",kind:"scalar",T:8},{no:2,name:"reason",kind:"enum",T:X.getEnumType(Wa)},{no:3,name:"action",kind:"enum",T:X.getEnumType(Id)},{no:4,name:"regions",kind:"message",T:mpe}]),Id=X.makeEnum("livekit.LeaveRequest.Action",[{no:0,name:"DISCONNECT"},{no:1,name:"RESUME"},{no:2,name:"RECONNECT"}]),Mz=X.makeMessageType("livekit.UpdateVideoLayers",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"layers",kind:"message",T:kc,repeated:!0}]),gP=X.makeMessageType("livekit.UpdateParticipantMetadata",()=>[{no:1,name:"metadata",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:4,name:"request_id",kind:"scalar",T:13}]),Iz=X.makeMessageType("livekit.ICEServer",()=>[{no:1,name:"urls",kind:"scalar",T:9,repeated:!0},{no:2,name:"username",kind:"scalar",T:9},{no:3,name:"credential",kind:"scalar",T:9}]),rpe=X.makeMessageType("livekit.SpeakersChanged",()=>[{no:1,name:"speakers",kind:"message",T:bz,repeated:!0}]),ipe=X.makeMessageType("livekit.RoomUpdate",()=>[{no:1,name:"room",kind:"message",T:Sw}]),ape=X.makeMessageType("livekit.ConnectionQualityInfo",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"quality",kind:"enum",T:X.getEnumType(Cp)},{no:3,name:"score",kind:"scalar",T:2}]),spe=X.makeMessageType("livekit.ConnectionQualityUpdate",()=>[{no:1,name:"updates",kind:"message",T:ape,repeated:!0}]),ope=X.makeMessageType("livekit.StreamStateInfo",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sid",kind:"scalar",T:9},{no:3,name:"state",kind:"enum",T:X.getEnumType(VC)}]),cpe=X.makeMessageType("livekit.StreamStateUpdate",()=>[{no:1,name:"stream_states",kind:"message",T:ope,repeated:!0}]),vP=X.makeMessageType("livekit.SubscribedQuality",()=>[{no:1,name:"quality",kind:"enum",T:X.getEnumType(sP)},{no:2,name:"enabled",kind:"scalar",T:8}]),lpe=X.makeMessageType("livekit.SubscribedCodec",()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"qualities",kind:"message",T:vP,repeated:!0}]),upe=X.makeMessageType("livekit.SubscribedQualityUpdate",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"subscribed_qualities",kind:"message",T:vP,repeated:!0},{no:3,name:"subscribed_codecs",kind:"message",T:lpe,repeated:!0}]),dpe=X.makeMessageType("livekit.SubscribedAudioCodecUpdate",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"subscribed_audio_codecs",kind:"message",T:Kfe,repeated:!0}]),Lz=X.makeMessageType("livekit.TrackPermission",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"all_tracks",kind:"scalar",T:8},{no:3,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:4,name:"participant_identity",kind:"scalar",T:9}]),$z=X.makeMessageType("livekit.SubscriptionPermission",()=>[{no:1,name:"all_participants",kind:"scalar",T:8},{no:2,name:"track_permissions",kind:"message",T:Lz,repeated:!0}]),hpe=X.makeMessageType("livekit.SubscriptionPermissionUpdate",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sid",kind:"scalar",T:9},{no:3,name:"allowed",kind:"scalar",T:8}]),fpe=X.makeMessageType("livekit.RoomMovedResponse",()=>[{no:1,name:"room",kind:"message",T:Sw},{no:2,name:"token",kind:"scalar",T:9},{no:3,name:"participant",kind:"message",T:lu},{no:4,name:"other_participants",kind:"message",T:lu,repeated:!0}]),yP=X.makeMessageType("livekit.SyncState",()=>[{no:1,name:"answer",kind:"message",T:Mc},{no:2,name:"subscription",kind:"message",T:Tw},{no:3,name:"publish_tracks",kind:"message",T:pP,repeated:!0},{no:4,name:"data_channels",kind:"message",T:Bz,repeated:!0},{no:5,name:"offer",kind:"message",T:Mc},{no:6,name:"track_sids_disabled",kind:"scalar",T:9,repeated:!0},{no:7,name:"datachannel_receive_states",kind:"message",T:Fz,repeated:!0},{no:8,name:"publish_data_tracks",kind:"message",T:hP,repeated:!0}]),Fz=X.makeMessageType("livekit.DataChannelReceiveState",()=>[{no:1,name:"publisher_sid",kind:"scalar",T:9},{no:2,name:"last_seq",kind:"scalar",T:13}]),Bz=X.makeMessageType("livekit.DataChannelInfo",()=>[{no:1,name:"label",kind:"scalar",T:9},{no:2,name:"id",kind:"scalar",T:13},{no:3,name:"target",kind:"enum",T:X.getEnumType(Ma)}]),as=X.makeMessageType("livekit.SimulateScenario",()=>[{no:1,name:"speaker_update",kind:"scalar",T:5,oneof:"scenario"},{no:2,name:"node_failure",kind:"scalar",T:8,oneof:"scenario"},{no:3,name:"migration",kind:"scalar",T:8,oneof:"scenario"},{no:4,name:"server_leave",kind:"scalar",T:8,oneof:"scenario"},{no:5,name:"switch_candidate_protocol",kind:"enum",T:X.getEnumType(Gfe),oneof:"scenario"},{no:6,name:"subscriber_bandwidth",kind:"scalar",T:3,oneof:"scenario"},{no:7,name:"disconnect_signal_on_resume",kind:"scalar",T:8,oneof:"scenario"},{no:8,name:"disconnect_signal_on_resume_no_messages",kind:"scalar",T:8,oneof:"scenario"},{no:9,name:"leave_request_full_reconnect",kind:"scalar",T:8,oneof:"scenario"}]),Uz=X.makeMessageType("livekit.Ping",()=>[{no:1,name:"timestamp",kind:"scalar",T:3},{no:2,name:"rtt",kind:"scalar",T:3}]),ppe=X.makeMessageType("livekit.Pong",()=>[{no:1,name:"last_ping_timestamp",kind:"scalar",T:3},{no:2,name:"timestamp",kind:"scalar",T:3}]),mpe=X.makeMessageType("livekit.RegionSettings",()=>[{no:1,name:"regions",kind:"message",T:gpe,repeated:!0}]),gpe=X.makeMessageType("livekit.RegionInfo",()=>[{no:1,name:"region",kind:"scalar",T:9},{no:2,name:"url",kind:"scalar",T:9},{no:3,name:"distance",kind:"scalar",T:3}]),vpe=X.makeMessageType("livekit.SubscriptionResponse",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"err",kind:"enum",T:X.getEnumType($fe)}]),ype=X.makeMessageType("livekit.RequestResponse",()=>[{no:1,name:"request_id",kind:"scalar",T:13},{no:2,name:"reason",kind:"enum",T:X.getEnumType(bl)},{no:3,name:"message",kind:"scalar",T:9},{no:4,name:"trickle",kind:"message",T:_w,oneof:"request"},{no:5,name:"add_track",kind:"message",T:Um,oneof:"request"},{no:6,name:"mute",kind:"message",T:Cw,oneof:"request"},{no:7,name:"update_metadata",kind:"message",T:gP,oneof:"request"},{no:8,name:"update_audio_track",kind:"message",T:mP,oneof:"request"},{no:9,name:"update_video_track",kind:"message",T:Dz,oneof:"request"},{no:10,name:"publish_data_track",kind:"message",T:dP,oneof:"request"},{no:11,name:"unpublish_data_track",kind:"message",T:fP,oneof:"request"}]),bl=X.makeEnum("livekit.RequestResponse.Reason",[{no:0,name:"OK"},{no:1,name:"NOT_FOUND"},{no:2,name:"NOT_ALLOWED"},{no:3,name:"LIMIT_EXCEEDED"},{no:4,name:"QUEUED"},{no:5,name:"UNSUPPORTED_TYPE"},{no:6,name:"UNCLASSIFIED_ERROR"},{no:7,name:"INVALID_HANDLE"}
vendor: 5,568 bytes, line 664
664,{no:8,name:"INVALID_NAME"},{no:9,name:"DUPLICATE_HANDLE"},{no:10,name:"DUPLICATE_NAME"}]),bpe=X.makeMessageType("livekit.TrackSubscribed",()=>[{no:1,name:"track_sid",kind:"scalar",T:9}]),zz=X.makeMessageType("livekit.ConnectionSettings",()=>[{no:1,name:"auto_subscribe",kind:"scalar",T:8},{no:2,name:"adaptive_stream",kind:"scalar",T:8},{no:3,name:"subscriber_allow_pause",kind:"scalar",T:8,opt:!0},{no:4,name:"disable_ice_lite",kind:"scalar",T:8},{no:5,name:"auto_subscribe_data_track",kind:"scalar",T:8,opt:!0}]),xpe=X.makeMessageType("livekit.JoinRequest",()=>[{no:1,name:"client_info",kind:"message",T:Cz},{no:2,name:"connection_settings",kind:"message",T:zz},{no:3,name:"metadata",kind:"scalar",T:9},{no:4,name:"participant_attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:5,name:"add_track_requests",kind:"message",T:Um,repeated:!0},{no:6,name:"publisher_offer",kind:"message",T:Mc},{no:7,name:"reconnect",kind:"scalar",T:8},{no:8,name:"reconnect_reason",kind:"enum",T:X.getEnumType(ll)},{no:9,name:"participant_sid",kind:"scalar",T:9},{no:10,name:"sync_state",kind:"message",T:yP}]),wpe=X.makeMessageType("livekit.WrappedJoinRequest",()=>[{no:1,name:"compression",kind:"enum",T:X.getEnumType(qC)},{no:2,name:"join_request",kind:"scalar",T:12}]),qC=X.makeEnum("livekit.WrappedJoinRequest.Compression",[{no:0,name:"NONE"},{no:1,name:"GZIP"}]),Spe=X.makeMessageType("livekit.MediaSectionsRequirement",()=>[{no:1,name:"num_audios",kind:"scalar",T:13},{no:2,name:"num_videos",kind:"scalar",T:13}]);function kpe(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var qy={exports:{}},_pe=qy.exports,XD;function Cpe(){return XD||(XD=1,function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(_pe,function(){var e=function(){},n="undefined",r=typeof window!==n&&typeof window.navigator!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"],a={},s=null;function o(m,v){var x=m[v];if(typeof x.bind=="function")return x.bind(m);try{return Function.prototype.bind.call(x,m)}catch{return function(){return Function.prototype.apply.apply(x,[m,arguments])}}}function c(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function u(m){return m==="debug"&&(m="log"),typeof console===n?!1:m==="trace"&&r?c:console[m]!==void 0?o(console,m):console.log!==void 0?o(console,"log"):e}function d(){for(var m=this.getLevel(),v=0;v<i.length;v++){var x=i[v];this[x]=v<m?e:this.methodFactory(x,m,this.name)}if(this.log=this.debug,typeof console===n&&m<this.levels.SILENT)return"No console available for logging"}function h(m){return function(){typeof console!==n&&(d.call(this),this[m].apply(this,arguments))}}function f(m,v,x){return u(m)||h.apply(this,arguments)}function p(m,v){var x=this,w,y,k,S="loglevel";typeof m=="string"?S+=":"+m:typeof m=="symbol"&&(S=void 0);function _(P){var M=(i[P]||"silent").toUpperCase();if(!(typeof window===n||!S)){try{window.localStorage[S]=M;return}catch{}try{window.document.cookie=encodeURIComponent(S)+"="+M+";"}catch{}}}function C(){var P;if(!(typeof window===n||!S)){try{P=window.localStorage[S]}catch{}if(typeof P===n)try{var M=window.document.cookie,U=encodeURIComponent(S),N=M.indexOf(U+"=");N!==-1&&(P=/^([^;]+)/.exec(M.slice(N+U.length+1))[1])}catch{}return x.levels[P]===void 0&&(P=void 0),P}}function T(){if(!(typeof window===n||!S)){try{window.localStorage.removeItem(S)}catch{}try{window.document.cookie=encodeURIComponent(S)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function E(P){var M=P;if(typeof M=="string"&&x.levels[M.toUpperCase()]!==void 0&&(M=x.levels[M.toUpperCase()]),typeof M=="number"&&M>=0&&M<=x.levels.SILENT)return M;throw new TypeError("log.setLevel() called with invalid level: "+P)}x.name=m,x.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},x.methodFactory=v||f,x.getLevel=function(){return k??y??w},x.setLevel=function(P,M){return k=E(P),M!==!1&&_(k),d.call(x)},x.setDefaultLevel=function(P){y=E(P),C()||x.setLevel(P,!1)},x.resetLevel=function(){k=null,T(),d.call(x)},x.enableAll=function(P){x.setLevel(x.levels.TRACE,P)},x.disableAll=function(P){x.setLevel(x.levels.SILENT,P)},x.rebuild=function(){if(s!==x&&(w=E(s.getLevel())),d.call(x),s===x)for(var P in a)a[P].rebuild()},w=E(s?s.getLevel():"WARN");var j=C();j!=null&&(k=E(j)),d.call(x)}s=new p,s.getLogger=function(v){if(typeof v!="symbol"&&typeof v!="string"||v==="")throw new TypeError("You must supply a name when creating a logger.");var x=a[v];return x||(x=a[v]=new p(v,s.methodFactory)),x};var g=typeof window!==n?window.log:void 0;return s.noConflict=function(){return typeof window!==n&&window.log===s&&(window.log=g),s},s.getLoggers=function(){return a},s.default=s,s})}(qy)),qy.exports}var jw=Cpe(),KC;(function(t){t[t.trace=0]="trace",t[t.debug=1]="debug",t[t.info=2]="info",t[t.warn=3]="warn",t[t.error=4]="error",t[t.silent=5]="silent"})(KC||(KC={}));var Rr;(function(t){t.Default="livekit",t.Room="livekit-room",t.TokenSource="livekit-token-source",t.Participant="livekit-participant",t.Track="livekit-track",t.Publication="livekit-track-publication",t.Engine="livekit-engine",t.Signal="livekit-signal",t.PCManager="livekit-pc-manager",t.PCTransport="livekit-pc-transport",t.E2EE="lk-e2ee",t.DataTracks="livekit-data-tracks"})(Rr||(Rr={}));let ft=jw.getLogger("livekit");Object.values(Rr).map(t=>jw.getLogger(t));ft.setDefaultLevel(KC.info);function li(t){const e=jw.getLogger(t);return e.setDefaultLevel(ft.getLevel()),e}
vendor: 59,866 bytes, lines 664-698
664const Tpe=jw.getLogger("lk-e2ee"),tp=7e3,Epe=[0,300,2*2*300,3*3*300,4*4*300,tp,tp,tp,tp,tp];class jpe{constructor(e){this._retryDelays=e!==void 0?[...e]:Epe}nextRetryDelayInMs(e){if(e.retryCount>=this._retryDelays.length)return null;const n=this._retryDelays[e.retryCount];return e.retryCount<=1?n:n+Math.random()*1e3}}function Ppe(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function F(t,e,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function o(d){try{u(r.next(d))}catch(h){s(h)}}function c(d){try{u(r.throw(d))}catch(h){s(h)}}function u(d){d.done?a(d.value):i(d.value).then(o,c)}u((r=r.apply(t,e||[])).next())})}function ZD(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Eh(t){return this instanceof Eh?(this.v=t,this):new Eh(t)}function Npe(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,a=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(p){return function(g){return Promise.resolve(g).then(p,h)}}function o(p,g){r[p]&&(i[p]=function(m){return new Promise(function(v,x){a.push([p,m,v,x])>1||c(p,m)})},g&&(i[p]=g(i[p])))}function c(p,g){try{u(r[p](g))}catch(m){f(a[0][3],m)}}function u(p){p.value instanceof Eh?Promise.resolve(p.value.v).then(d,h):f(a[0][2],p)}function d(p){c("next",p)}function h(p){c("throw",p)}function f(p,g){p(g),a.shift(),a.length&&c(a[0][0],a[0][1])}}function Ape(t){var e,n;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,a){e[i]=t[i]?function(s){return(n=!n)?{value:Eh(t[i](s)),done:!1}:a?a(s):s}:a}}function Ia(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof ZD=="function"?ZD(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(a){n[a]=t[a]&&function(s){return new Promise(function(o,c){s=t[a](s),i(o,c,s.done,s.value)})}}function i(a,s,o,c){Promise.resolve(c).then(function(u){a({value:u,done:o})},s)}}var ay={exports:{}},QD;function Ope(){if(QD)return ay.exports;QD=1;var t=typeof Reflect=="object"?Reflect:null,e=t&&typeof t.apply=="function"?t.apply:function(S,_,C){return Function.prototype.apply.call(S,_,C)},n;t&&typeof t.ownKeys=="function"?n=t.ownKeys:Object.getOwnPropertySymbols?n=function(S){return Object.getOwnPropertyNames(S).concat(Object.getOwnPropertySymbols(S))}:n=function(S){return Object.getOwnPropertyNames(S)};function r(k){console&&console.warn&&console.warn(k)}var i=Number.isNaN||function(S){return S!==S};function a(){a.init.call(this)}ay.exports=a,ay.exports.once=x,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var s=10;function o(k){if(typeof k!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof k)}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(k){if(typeof k!="number"||k<0||i(k))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+k+".");s=k}}),a.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(S){if(typeof S!="number"||S<0||i(S))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+S+".");return this._maxListeners=S,this};function c(k){return k._maxListeners===void 0?a.defaultMaxListeners:k._maxListeners}a.prototype.getMaxListeners=function(){return c(this)},a.prototype.emit=function(S){for(var _=[],C=1;C<arguments.length;C++)_.push(arguments[C]);var T=S==="error",E=this._events;if(E!==void 0)T=T&&E.error===void 0;else if(!T)return!1;if(T){var j;if(_.length>0&&(j=_[0]),j instanceof Error)throw j;var P=new Error("Unhandled error."+(j?" ("+j.message+")":""));throw P.context=j,P}var M=E[S];if(M===void 0)return!1;if(typeof M=="function")e(M,this,_);else for(var U=M.length,N=g(M,U),C=0;C<U;++C)e(N[C],this,_);return!0};function u(k,S,_,C){var T,E,j;if(o(_),E=k._events,E===void 0?(E=k._events=Object.create(null),k._eventsCount=0):(E.newListener!==void 0&&(k.emit("newListener",S,_.listener?_.listener:_),E=k._events),j=E[S]),j===void 0)j=E[S]=_,++k._eventsCount;else if(typeof j=="function"?j=E[S]=C?[_,j]:[j,_]:C?j.unshift(_):j.push(_),T=c(k),T>0&&j.length>T&&!j.warned){j.warned=!0;var P=new Error("Possible EventEmitter memory leak detected. "+j.length+" "+String(S)+" listeners added. Use emitter.setMaxListeners() to increase limit");P.name="MaxListenersExceededWarning",P.emitter=k,P.type=S,P.count=j.length,r(P)}return k}a.prototype.addListener=function(S,_){return u(this,S,_,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(S,_){return u(this,S,_,!0)};function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(k,S,_){var C={fired:!1,wrapFn:void 0,target:k,type:S,listener:_},T=d.bind(C);return T.listener=_,C.wrapFn=T,T}a.prototype.once=function(S,_){return o(_),this.on(S,h(this,S,_)),this},a.prototype.prependOnceListener=function(S,_){return o(_),this.prependListener(S,h(this,S,_)),this},a.prototype.removeListener=function(S,_){var C,T,E,j,P;if(o(_),T=this._events,T===void 0)return this;if(C=T[S],C===void 0)return this;if(C===_||C.listener===_)--this._eventsCount===0?this._events=Object.create(null):(delete T[S],T.removeListener&&this.emit("removeListener",S,C.listener||_));else if(typeof C!="function"){for(E=-1,j=C.length-1;j>=0;j--)if(C[j]===_||C[j].listener===_){P=C[j].listener,E=j;break}if(E<0)return this;E===0?C.shift():m(C,E),C.length===1&&(T[S]=C[0]),T.removeListener!==void 0&&this.emit("removeListener",S,P||_)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(S){var _,C,T;if(C=this._events,C===void 0)return this;if(C.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):C[S]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete C[S]),this;if(arguments.length===0){var E=Object.keys(C),j;for(T=0;T<E.length;++T)j=E[T],j!=="removeListener"&&this.removeAllListeners(j);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(_=C[S],typeof _=="function")this.removeListener(S,_);else if(_!==void 0)for(T=_.length-1;T>=0;T--)this.removeListener(S,_[T]);return this};function f(k,S,_){var C=k._events;if(C===void 0)return[];var T=C[S];return T===void 0?[]:typeof T=="function"?_?[T.listener||T]:[T]:_?v(T):g(T,T.length)}a.prototype.listeners=function(S){return f(this,S,!0)},a.prototype.rawListeners=function(S){return f(this,S,!1)},a.listenerCount=function(k,S){return typeof k.listenerCount=="function"?k.listenerCount(S):p.call(k,S)},a.prototype.listenerCount=p;function p(k){var S=this._events;if(S!==void 0){var _=S[k];if(typeof _=="function")return 1;if(_!==void 0)return _.length}return 0}a.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function g(k,S){for(var _=new Array(S),C=0;C<S;++C)_[C]=k[C];return _}function m(k,S){for(;S+1<k.length;S++)k[S]=k[S+1];k.pop()}function v(k){for(var S=new Array(k.length),_=0;_<S.length;++_)S[_]=k[_].listener||k[_];return S}function x(k,S){return new Promise(function(_,C){function T(j){k.removeListener(S,E),C(j)}function E(){typeof k.removeListener=="function"&&k.removeListener("error",T),_([].slice.call(arguments))}y(k,S,E,{once:!0}),S!=="error"&&w(k,T,{once:!0})})}function w(k,S,_){typeof k.on=="function"&&y(k,"error",S,_)}function y(k,S,_,C){if(typeof k.on=="function")C.once?k.once(S,_):k.on(S,_);else if(typeof k.addEventListener=="function")k.addEventListener(S,function T(E){C.once&&k.removeEventListener(S,T),_(E)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof k)}return ay.exports}var ca=Ope();let Wz=!0,Vz=!0;function Tp(t,e,n){const r=t.match(e);return r&&r.length>=n&&parseFloat(r[n],10)}function Su(t,e,n){if(!t.RTCPeerConnection)return;if(!Object.getOwnPropertyDescriptor(EventTarget.prototype,"addEventListener").writable){bP("Unable to polyfill events");return}const i=t.RTCPeerConnection.prototype,a=i.addEventListener;i.addEventListener=function(o,c){if(o!==e)return a.apply(this,arguments);const u=d=>{const h=n(d);h&&(c.handleEvent?c.handleEvent(h):c(h))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(c,u),a.apply(this,[o,u])};const s=i.removeEventListener;i.removeEventListener=function(o,c){if(o!==e||!this._eventMap||!this._eventMap[e])return s.apply(this,arguments);if(!this._eventMap[e].has(c))return s.apply(this,arguments);const u=this._eventMap[e].get(c);return this._eventMap[e].delete(c),this._eventMap[e].size===0&&delete this._eventMap[e],Object.keys(this._eventMap).length===0&&delete this._eventMap,s.apply(this,[o,u])},Object.defineProperty(i,"on"+e,{get(){return this["_on"+e]},set(o){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),o&&this.addEventListener(e,this["_on"+e]=o)},enumerable:!0,configurable:!0})}function Rpe(t){return typeof t!="boolean"?new Error("Argument type: "+typeof t+". Please use a boolean."):(Wz=t,t?"adapter.js logging disabled":"adapter.js logging enabled")}function Dpe(t){return typeof t!="boolean"?new Error("Argument type: "+typeof t+". Please use a boolean."):(Vz=!t,"adapter.js deprecation warnings "+(t?"disabled":"enabled"))}function bP(){if(typeof window=="object"){if(Wz)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function xP(t,e){Vz&&console.warn(t+" is deprecated, please use "+e+" instead.")}function Mpe(t){const e={browser:null,version:null};if(typeof t>"u"||!t.navigator||!t.navigator.userAgent)return e.browser="Not a browser.",e;const{navigator:n}=t;if(n.userAgentData&&n.userAgentData.brands){const r=n.userAgentData.brands.find(i=>i.brand==="Chromium");if(r)return{browser:"chrome",version:parseInt(r.version,10)}}if(n.mozGetUserMedia)e.browser="firefox",e.version=parseInt(Tp(n.userAgent,/Firefox\/(\d+)\./,1));else if(n.webkitGetUserMedia||t.isSecureContext===!1&&t.webkitRTCPeerConnection)e.browser="chrome",e.version=parseInt(Tp(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2))||null;else if(t.RTCPeerConnection&&n.userAgent.match(/AppleWebKit\/(\d+)\./))e.browser="safari",e.version=parseInt(Tp(n.userAgent,/AppleWebKit\/(\d+)\./,1)),e.supportsUnifiedPlan=t.RTCRtpTransceiver&&"currentDirection"in t.RTCRtpTransceiver.prototype,e._safariVersion=Tp(n.userAgent,/Version\/(\d+(\.?\d+))/,1);else return e.browser="Not a supported browser.",e;return e}function e4(t){return Object.prototype.toString.call(t)==="[object Object]"}function Hz(t){return e4(t)?Object.keys(t).reduce(function(e,n){const r=e4(t[n]),i=r?Hz(t[n]):t[n],a=r&&!Object.keys(i).length;return i===void 0||a?e:Object.assign(e,{[n]:i})},{}):t}function GC(t,e,n){!e||n.has(e.id)||(n.set(e.id,e),Object.keys(e).forEach(r=>{r.endsWith("Id")?GC(t,t.get(e[r]),n):r.endsWith("Ids")&&e[r].forEach(i=>{GC(t,t.get(i),n)})}))}function t4(t,e,n){const r=n?"outbound-rtp":"inbound-rtp",i=new Map;if(e===null)return i;const a=[];return t.forEach(s=>{s.type==="track"&&s.trackIdentifier===e.id&&a.push(s)}),a.forEach(s=>{t.forEach(o=>{o.type===r&&o.trackId===s.id&&GC(t,o,i)})}),i}const n4=bP;function qz(t,e){const n=t&&t.navigator;if(!n.mediaDevices)return;const r=function(o){if(typeof o!="object"||o.mandatory||o.optional)return o;const c={};return Object.keys(o).forEach(u=>{if(u==="require"||u==="advanced"||u==="mediaSource")return;const d=typeof o[u]=="object"?o[u]:{ideal:o[u]};d.exact!==void 0&&typeof d.exact=="number"&&(d.min=d.max=d.exact);const h=function(f,p){return f?f+p.charAt(0).toUpperCase()+p.slice(1):p==="deviceId"?"sourceId":p};if(d.ideal!==void 0){c.optional=c.optional||[];let f={};typeof d.ideal=="number"?(f[h("min",u)]=d.ideal,c.optional.push(f),f={},f[h("max",u)]=d.ideal,c.optional.push(f)):(f[h("",u)]=d.ideal,c.optional.push(f))}d.exact!==void 0&&typeof d.exact!="number"?(c.mandatory=c.mandatory||{},c.mandatory[h("",u)]=d.exact):["min","max"].forEach(f=>{d[f]!==void 0&&(c.mandatory=c.mandatory||{},c.mandatory[h(f,u)]=d[f])})}),o.advanced&&(c.optional=(c.optional||[]).concat(o.advanced)),c},i=function(o,c){if(e.version>=61)return c(o);if(o=JSON.parse(JSON.stringify(o)),o&&typeof o.audio=="object"){const u=function(d,h,f){h in d&&!(f in d)&&(d[f]=d[h],delete d[h])};o=JSON.parse(JSON.stringify(o)),u(o.audio,"autoGainControl","googAutoGainControl"),u(o.audio,"noiseSuppression","googNoiseSuppression"),o.audio=r(o.audio)}if(o&&typeof o.video=="object"){let u=o.video.facingMode;u=u&&(typeof u=="object"?u:{ideal:u});const d=e.version<66;if(u&&(u.exact==="user"||u.exact==="environment"||u.ideal==="user"||u.ideal==="environment")&&!(n.mediaDevices.getSupportedConstraints&&n.mediaDevices.getSupportedConstraints().facingMode&&!d)){delete o.video.facingMode;let h;if(u.exact==="environment"||u.ideal==="environment"?h=["back","rear"]:(u.exact==="user"||u.ideal==="user")&&(h=["front"]),h)return n.mediaDevices.enumerateDevices().then(f=>{f=f.filter(g=>g.kind==="videoinput");let p=f.find(g=>h.some(m=>g.label.toLowerCase().includes(m)));return!p&&f.length&&h.includes("back")&&(p=f[f.length-1]),p&&(o.video.deviceId=u.exact?{exact:p.deviceId}:{ideal:p.deviceId}),o.video=r(o.video),n4("chrome: "+JSON.stringify(o)),c(o)})}o.video=r(o.video)}return n4("chrome: "+JSON.stringify(o)),c(o)},a=function(o){return e.version>=64?o:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[o.name]||o.name,message:o.message,constraint:o.constraint||o.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}},s=function(o,c,u){i(o,d=>{n.webkitGetUserMedia(d,c,h=>{u&&u(a(h))})})};if(n.getUserMedia=s.bind(n),n.mediaDevices.getUserMedia){const o=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(c){return i(c,u=>o(u).then(d=>{if(u.audio&&!d.getAudioTracks().length||u.video&&!d.getVideoTracks().length)throw d.getTracks().forEach(h=>{h.stop()}),new DOMException("","NotFoundError");return d},d=>Promise.reject(a(d))))}}}function Kz(t){t.MediaStream=t.MediaStream||t.webkitMediaStream}function Gz(t,e){if(!(e.version>102))if(typeof t=="object"&&t.RTCPeerConnection&&!("ontrack"in t.RTCPeerConnection.prototype)){Object.defineProperty(t.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(r){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=r)},enumerable:!0,configurable:!0});const n=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=i=>{i.stream.addEventListener("addtrack",a=>{let s;t.RTCPeerConnection.prototype.getReceivers?s=this.getReceivers().find(c=>c.track&&c.track.id===a.track.id):s={track:a.track};const o=new Event("track");o.track=a.track,o.receiver=s,o.transceiver={receiver:s},o.streams=[i.stream],this.dispatchEvent(o)}),i.stream.getTracks().forEach(a=>{let s;t.RTCPeerConnection.prototype.getReceivers?s=this.getReceivers().find(c=>c.track&&c.track.id===a.id):s={track:a};const o=new Event("track");o.track=a,o.receiver=s,o.transceiver={receiver:s},o.streams=[i.stream],this.dispatchEvent(o)})},this.addEventListener("addstream",this._ontrackpoly)),n.apply(this,arguments)}}else Su(t,"track",n=>(n.transceiver||Object.defineProperty(n,"transceiver",{value:{receiver:n.receiver}}),n))}function Yz(t){if(typeof t=="object"&&t.RTCPeerConnection&&!("getSenders"in t.RTCPeerConnection.prototype)&&"createDTMFSender"in t.RTCPeerConnection.prototype){const e=function(i,a){return{track:a,get dtmf(){return this._dtmf===void 0&&(a.kind==="audio"?this._dtmf=i.createDTMFSender(a):this._dtmf=null),this._dtmf},_pc:i}};if(!t.RTCPeerConnection.prototype.getSenders){t.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const i=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addTrack=function(o,c){let u=i.apply(this,arguments);return u||(u=e(this,o),this._senders.push(u)),u};const a=t.RTCPeerConnection.prototype.removeTrack;t.RTCPeerConnection.prototype.removeTrack=function(o){a.apply(this,arguments);const c=this._senders.indexOf(o);c!==-1&&this._senders.splice(c,1)}}const n=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(a){this._senders=this._senders||[],n.apply(this,[a]),a.getTracks().forEach(s=>{this._senders.push(e(this,s))})};const r=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(a){this._senders=this._senders||[],r.apply(this,[a]),a.getTracks().forEach(s=>{const o=this._senders.find(c=>c.track===s);o&&this._senders.splice(this._senders.indexOf(o),1)})}}else if(typeof t=="object"&&t.RTCPeerConnection&&"getSenders"in t.RTCPeerConnection.prototype&&"createDTMFSender"in t.RTCPeerConnection.prototype&&t.RTCRtpSender&&!("dtmf"in t.RTCRtpSender.prototype)){const e=t.RTCPeerConnection.prototype.getSenders;t.RTCPeerConnection.prototype.getSenders=function(){const r=e.apply(this,[]);return r.forEach(i=>i._pc=this),r},Object.defineProperty(t.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function Jz(t,e){if(e.version>=67||!(typeof t=="object"&&t.RTCPeerConnection&&t.RTCRtpSender&&t.RTCRtpReceiver))return;if(!("getStats"in t.RTCRtpSender.prototype)){const r=t.RTCPeerConnection.prototype.getSenders;r&&(t.RTCPeerConnection.prototype.getSenders=function(){const s=r.apply(this,[]);return s.forEach(o=>o._pc=this),s});const i=t.RTCPeerConnection.prototype.addTrack;i&&(t.RTCPeerConnection.prototype.addTrack=function(){const s=i.apply(this,arguments);return s._pc=this,s}),t.RTCRtpSender.prototype.getStats=function(){const s=this;return this._pc.getStats().then(o=>t4(o,s.track,!0))}}if(!("getStats"in t.RTCRtpReceiver.prototype)){const r=t.RTCPeerConnection.prototype.getReceivers;r&&(t.RTCPeerConnection.prototype.getReceivers=function(){const a=r.apply(this,[]);return a.forEach(s=>s._pc=this),a}),Su(t,"track",i=>(i.receiver._pc=i.srcElement,i)),t.RTCRtpReceiver.prototype.getStats=function(){const a=this;return this._pc.getStats().then(s=>t4(s,a.track,!1))}}if(!("getStats"in t.RTCRtpSender.prototype&&"getStats"in t.RTCRtpReceiver.prototype))return;const n=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof t.MediaStreamTrack){const i=arguments[0];let a,s,o;return this.getSenders().forEach(c=>{c.track===i&&(a?o=!0:a=c)}),this.getReceivers().forEach(c=>(c.track===i&&(s?o=!0:s=c),c.track===i)),o||a&&s?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):a?a.getStats():s?s.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return n.apply(this,arguments)}}function Xz(t){t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(s=>this._shimmedLocalStreams[s][0])};const e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addTrack=function(s,o){if(!o)return e.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const c=e.apply(this,arguments);return this._shimmedLocalStreams[o.id]?this._shimmedLocalStreams[o.id].indexOf(c)===-1&&this._shimmedLocalStreams[o.id].push(c):this._shimmedLocalStreams[o.id]=[o,c],c};const n=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(s){this._shimmedLocalStreams=this._shimmedLocalStreams||{},s.getTracks().forEach(u=>{if(this.getSenders().find(h=>h.track===u))throw new DOMException("Track already exists.","InvalidAccessError")});const o=this.getSenders();n.apply(this,arguments);const c=this.getSenders().filter(u=>o.indexOf(u)===-1);this._shimmedLocalStreams[s.id]=[s].concat(c)};const r=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(s){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[s.id],r.apply(this,arguments)};const i=t.RTCPeerConnection.prototype.removeTrack;t.RTCPeerConnection.prototype.removeTrack=function(s){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},s&&Object.keys(this._shimmedLocalStreams).forEach(o=>{const c=this._shimmedLocalStreams[o].indexOf(s);c!==-1&&this._shimmedLocalStreams[o].splice(c,1),this._shimmedLocalStreams[o].length===1&&delete this._shimmedLocalStreams[o]}),i.apply(this,arguments)}}function Zz(t,e){if(!t.RTCPeerConnection)return;if(t.RTCPeerConnection.prototype.addTrack&&e.version>=65)return Xz(t);const n=t.RTCPeerConnection.prototype.getLocalStreams;t.RTCPeerConnection.prototype.getLocalStreams=function(){const d=n.apply(this);return this._reverseStreams=this._reverseStreams||{},d.map(h=>this._reverseStreams[h.id])};const r=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(d){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},d.getTracks().forEach(h=>{if(this.getSenders().find(p=>p.track===h))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[d.id]){const h=new t.MediaStream(d.getTracks());this._streams[d.id]=h,this._reverseStreams[h.id]=d,d=h}r.apply(this,[d])};const i=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(d){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[d.id]||d]),delete this._reverseStreams[this._streams[d.id]?this._streams[d.id].id:d.id],delete this._streams[d.id]},t.RTCPeerConnection.prototype.addTrack=function(d,h){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const f=[].slice.call(arguments,1);if(f.length!==1||!f[0].getTracks().find(m=>m===d))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(m=>m.track===d))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const g=this._streams[h.id];if(g)g.addTrack(d),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const m=new t.MediaStream([d]);this._streams[h.id]=m,this._reverseStreams[m.id]=h,this.addStream(m)}return this.getSenders().find(m=>m.track===d)};function a(u,d){let h=d.sdp;return Object.keys(u._reverseStreams||[]).forEach(f=>{const p=u._reverseStreams[f],g=u._streams[p.id];h=h.replace(new RegExp(g.id,"g"),p.id)}),new RTCSessionDescription({type:d.type,sdp:h})}function s(u,d){let h=d.sdp;return Object.keys(u._reverseStreams||[]).forEach(f=>{const p=u._reverseStreams[f],g=u._streams[p.id];h=h.replace(new RegExp(p.id,"g"),g.id)}),new RTCSessionDescription({type:d.type,sdp:h})}["createOffer","createAnswer"].forEach(function(u){const d=t.RTCPeerConnection.prototype[u],h={[u](){const f=arguments;return arguments.length&&typeof arguments[0]=="function"?d.apply(this,[g=>{const m=a(this,g);f[0].apply(null,[m])},g=>{f[1]&&f[1].apply(null,g)},arguments[2]]):d.apply(this,arguments).then(g=>a(this,g))}};t.RTCPeerConnection.prototype[u]=h[u]});const o=t.RTCPeerConnection.prototype.setLocalDescription;t.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type?o.apply(this,arguments):(arguments[0]=s(this,arguments[0]),o.apply(this,arguments))};const c=Object.getOwnPropertyDescriptor(t.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(t.RTCPeerConnection.prototype,"localDescription",{get(){const u=c.get.apply(this);return u.type===""?u:a(this,u)}}),t.RTCPeerConnection.prototype.removeTrack=function(d){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!d._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(d._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};let f;Object.keys(this._streams).forEach(p=>{this._streams[p].getTracks().find(m=>d.track===m)&&(f=this._streams[p])}),f&&(f.getTracks().length===1?this.removeStream(this._reverseStreams[f.id]):f.removeTrack(d.track),this.dispatchEvent(new Event("negotiationneeded")))}}function YC(t,e){!t.RTCPeerConnection&&t.webkitRTCPeerConnection&&(t.RTCPeerConnection=t.webkitRTCPeerConnection),t.RTCPeerConnection&&e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(n){const r=t.RTCPeerConnection.prototype[n],i={[n](){return arguments[0]=new(n==="addIceCandidate"?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};t.RTCPeerConnection.prototype[n]=i[n]})}function Qz(t,e){e.version>102||Su(t,"negotiationneeded",n=>{const r=n.target;if(!((e.version<72||r.getConfiguration&&r.getConfiguration().sdpSemantics==="plan-b")&&r.signalingState!=="stable"))return n})}var r4=Object.freeze({__proto__:null,fixNegotiationNeeded:Qz,shimAddTrackRemoveTrack:Zz,shimAddTrackRemoveTrackWithNative:Xz,shimGetSendersWithDtmf:Yz,shimGetUserMedia:qz,shimMediaStream:Kz,shimOnTrack:Gz,shimPeerConnection:YC,shimSenderReceiverGetStats:Jz});function eW(t,e){const n=t&&t.navigator,r=t&&t.MediaStreamTrack;if(n.getUserMedia=function(i,a,s){xP("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(i).then(a,s)},!(e.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const i=function(s,o,c){o in s&&!(c in s)&&(s[c]=s[o],delete s[o])},a=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(s){return typeof s=="object"&&typeof s.audio=="object"&&(s=JSON.parse(JSON.stringify(s)),i(s.audio,"autoGainControl","mozAutoGainControl"),i(s.audio,"noiseSuppression","mozNoiseSuppression")),a(s)},r&&r.prototype.getSettings){const s=r.prototype.getSettings;r.prototype.getSettings=function(){const o=s.apply(this,arguments);return i(o,"mozAutoGainControl","autoGainControl"),i(o,"mozNoiseSuppression","noiseSuppression"),o}}if(r&&r.prototype.applyConstraints){const s=r.prototype.applyConstraints;r.prototype.applyConstraints=function(o){return this.kind==="audio"&&typeof o=="object"&&(o=JSON.parse(JSON.stringify(o)),i(o,"autoGainControl","mozAutoGainControl"),i(o,"noiseSuppression","mozNoiseSuppression")),s.apply(this,[o])}}}}function Ipe(t,e){t.navigator.mediaDevices&&"getDisplayMedia"in t.navigator.mediaDevices||t.navigator.mediaDevices&&(t.navigator.mediaDevices.getDisplayMedia=function(r){if(!(r&&r.video)){const i=new DOMException("getDisplayMedia without video constraints is undefined");return i.name="NotFoundError",i.code=8,Promise.reject(i)}return r.video===!0?r.video={mediaSource:e}:r.video.mediaSource=e,t.navigator.mediaDevices.getUserMedia(r)})}function tW(t){typeof t=="object"&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function JC(t,e){typeof t!="object"||!(t.RTCPeerConnection||t.mozRTCPeerConnection)||(!t.RTCPeerConnection&&t.mozRTCPeerConnection&&(t.RTCPeerConnection=t.mozRTCPeerConnection),e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(n){const r=t.RTCPeerConnection.prototype[n],i={[n](){return arguments[0]=new(n==="addIceCandidate"?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};t.RTCPeerConnection.prototype[n]=i[n]}))}function nW(t,e){if(typeof t!="object"||!(t.RTCPeerConnection||t.mozRTCPeerConnection)||e.version>=151)return;const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},r=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){const[a,s,o]=arguments;return this.signalingState==="closed"?Promise.resolve(new Map):r.apply(this,[a||null]).then(c=>{if(e.version<53&&!s)try{c.forEach(u=>{u.type=n[u.type]||u.type})}catch(u){if(u.name!=="TypeError")throw u;c.forEach((d,h)=>{c.set(h,Object.assign({},d,{type:n[d.type]||d.type}))})}return c}).then(s,o)}}function rW(t){if(!(typeof t=="object"&&t.RTCPeerConnection&&t.RTCRtpSender)||t.RTCRtpSender&&"getStats"in t.RTCRtpSender.prototype)return;const e=t.RTCPeerConnection.prototype.getSenders;e&&(t.RTCPeerConnection.prototype.getSenders=function(){const i=e.apply(this,[]);return i.forEach(a=>a._pc=this),i});const n=t.RTCPeerConnection.prototype.addTrack;n&&(t.RTCPeerConnection.prototype.addTrack=function(){const i=n.apply(this,arguments);return i._pc=this,i}),t.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function iW(t){if(!(typeof t=="object"&&t.RTCPeerConnection&&t.RTCRtpSender)||t.RTCRtpSender&&"getStats"in t.RTCRtpReceiver.prototype)return;const e=t.RTCPeerConnection.prototype.getReceivers;e&&(t.RTCPeerConnection.prototype.getReceivers=function(){const r=e.apply(this,[]);return r.forEach(i=>i._pc=this),r}),Su(t,"track",n=>(n.receiver._pc=n.srcElement,n)),t.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function aW(t){!t.RTCPeerConnection||"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(n){xP("removeStream","removeTrack"),this.getSenders().forEach(r=>{r.track&&n.getTracks().includes(r.track)&&this.removeTrack(r)})})}function sW(t){t.DataChannel&&!t.RTCDataChannel&&(t.RTCDataChannel=t.DataChannel)}function oW(t){if(!(typeof t=="object"&&t.RTCPeerConnection))return;const e=t.RTCPeerConnection.prototype.addTransceiver;e&&(t.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let r=arguments[1]&&arguments[1].sendEncodings;r===void 0&&(r=[]),r=[...r];const i=r.length>0;i&&r.forEach(s=>{if("rid"in s&&!/^[a-z0-9]{0,16}$/i.test(s.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in s&&!(parseFloat(s.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in s&&!(parseFloat(s.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const a=e.apply(this,arguments);if(i){const{sender:s}=a,o=s.getParameters();(!("encodings"in o)||o.encodings.length===1&&Object.keys(o.encodings[0]).length===0)&&(o.encodings=r,s.sendEncodings=r,this.setParametersPromises.push(s.setParameters(o).then(()=>{delete s.sendEncodings}).catch(()=>{delete s.sendEncodings})))}return a})}function cW(t){if(!(typeof t=="object"&&t.RTCRtpSender))return;const e=t.RTCRtpSender.prototype.getParameters;e&&(t.RTCRtpSender.prototype.getParameters=function(){const r=e.apply(this,arguments);return"encodings"in r||(r.encodings=[].concat(this.sendEncodings||[{}])),r})}function lW(t){if(!(typeof t=="object"&&t.RTCPeerConnection))return;const e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}function uW(t){if(!(typeof t=="object"&&t.RTCPeerConnection))return;const e=t.RTCPeerConnection.prototype.createAnswer;t.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}var i4=Object.freeze({__proto__:null,shimAddTransceiver:oW,shimCreateAnswer:uW,shimCreateOffer:lW,shimGetDisplayMedia:Ipe,shimGetParameters:cW,shimGetStats:nW,shimGetUserMedia:eW,shimOnTrack:tW,shimPeerConnection:JC,shimRTCDataChannel:sW,shimReceiverGetStats:iW,shimRemoveStream:aW,shimSenderGetStats:rW});function dW(t){if(!(typeof t!="object"||!t.RTCPeerConnection)){if("getLocalStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in t.RTCPeerConnection.prototype)){const e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addStream=function(r){this._localStreams||(this._localStreams=[]),this._localStreams.includes(r)||this._localStreams.push(r),r.getAudioTracks().forEach(i=>e.call(this,i,r)),r.getVideoTracks().forEach(i=>e.call(this,i,r))},t.RTCPeerConnection.prototype.addTrack=function(r){for(var i=arguments.length,a=new Array(i>1?i-1:0),s=1;s<i;s++)a[s-1]=arguments[s];return a&&a.forEach(o=>{this._localStreams?this._localStreams.includes(o)||this._localStreams.push(o):this._localStreams=[o]}),e.apply(this,arguments)}}"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(n){this._localStreams||(this._localStreams=[]);const r=this._localStreams.indexOf(n);if(r===-1)return;this._localStreams.splice(r,1);const i=n.getTracks();this.getSenders().forEach(a=>{i.includes(a.track)&&this.removeTrack(a)})})}}function hW(t){if(!(typeof t!="object"||!t.RTCPeerConnection)&&("getRemoteStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in t.RTCPeerConnection.prototype))){Object.defineProperty(t.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(n){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=n),this.addEventListener("track",this._onaddstreampoly=r=>{r.streams.forEach(i=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(i))return;this._remoteStreams.push(i);const a=new Event("addstream");a.stream=i,this.dispatchEvent(a)})})}});const e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){const r=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(i){i.streams.forEach(a=>{if(r._remoteStreams||(r._remoteStreams=[]),r._remoteStreams.indexOf(a)>=0)return;r._remoteStreams.push(a);const s=new Event("addstream");s.stream=a,r.dispatchEvent(s)})}),e.apply(r,arguments)}}}function fW(t){if(typeof t!="object"||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype,n=e.createOffer,r=e.createAnswer,i=e.setLocalDescription,a=e.setRemoteDescription,s=e.addIceCandidate;e.createOffer=function(u,d){const h=arguments.length>=2?arguments[2]:arguments[0],f=n.apply(this,[h]);return d?(f.then(u,d),Promise.resolve()):f},e.createAnswer=function(u,d){const h=arguments.length>=2?arguments[2]:arguments[0],f=r.apply(this,[h]);return d?(f.then(u,d),Promise.resolve()):f};let o=function(c,u,d){const h=i.apply(this,[c]);return d?(h.then(u,d),Promise.resolve()):h};e.setLocalDescription=o,o=function(c,u,d){const h=a.apply(this,[c]);return d?(h.then(u,d),Promise.resolve()):h},e.setRemoteDescription=o,o=function(c,u,d){const h=s.apply(this,[c]);return d?(h.then(u,d),Promise.resolve()):h},e.addIceCandidate=o}function pW(t){const e=t&&t.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){const n=e.mediaDevices,r=n.getUserMedia.bind(n);e.mediaDevices.getUserMedia=i=>r(mW(i))}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=(function(r,i,a){e.mediaDevices.getUserMedia(r).then(i,a)}).bind(e))}function mW(t){return t&&t.video!==void 0?Object.assign({},t,{video:Hz(t.video)}):t}function gW(t){if(!t.RTCPeerConnection)return;const e=t.RTCPeerConnection;t.RTCPeerConnection=function(r,i){if(r&&r.iceServers){const a=[];for(let s=0;s<r.iceServers.length;s++){let o=r.iceServers[s];o.urls===void 0&&o.url?(xP("RTCIceServer.url","RTCIceServer.urls"),o=JSON.parse(JSON.stringify(o)),o.urls=o.url,delete o.url,a.push(o)):a.push(r.iceServers[s])}r.iceServers=a}return new e(r,i)},t.RTCPeerConnection.prototype=e.prototype,"generateCertificate"in e&&Object.defineProperty(t.RTCPeerConnection,"generateCertificate",{get(){return e.generateCertificate}})}function vW(t){typeof t=="object"&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function yW(t){const e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(r){if(r){typeof r.offerToReceiveAudio<"u"&&(r.offerToReceiveAudio=!!r.offerToReceiveAudio);const i=this.getTransceivers().find(s=>s.receiver.track.kind==="audio");r.offerToReceiveAudio===!1&&i?i.direction==="sendrecv"?i.setDirection?i.setDirection("sendonly"):i.direction="sendonly":i.direction==="recvonly"&&(i.setDirection?i.setDirection("inactive"):i.direction="inactive"):r.offerToReceiveAudio===!0&&!i&&this.addTransceiver("audio",{direction:"recvonly"}),typeof r.offerToReceiveVideo<"u"&&(r.offerToReceiveVideo=!!r.offerToReceiveVideo);const a=this.getTransceivers().find(s=>s.receiver.track.kind==="video");r.offerToReceiveVideo===!1&&a?a.direction==="sendrecv"?a.setDirection?a.setDirection("sendonly"):a.direction="sendonly":a.direction==="recvonly"&&(a.setDirection?a.setDirection("inactive"):a.direction="inactive"):r.offerToReceiveVideo===!0&&!a&&this.addTransceiver("video",{direction:"recvonly"})}return e.apply(this,arguments)}}function bW(t){typeof t!="object"||t.AudioContext||(t.AudioContext=t.webkitAudioContext)}var a4=Object.freeze({__proto__:null,shimAudioContext:bW,shimCallbacksAPI:fW,shimConstraints:mW,shimCreateOfferLegacy:yW,shimGetUserMedia:pW,shimLocalStreamsAPI:dW,shimRTCIceServerUrls:gW,shimRemoteStreamsAPI:hW,shimTrackEventTransceiver:vW}),GS={exports:{}},s4;function Lpe(){return s4||(s4=1,function(t){const e={};e.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)},e.localCName=e.generateIdentifier(),e.splitLines=function(n){return n.trim().split(` 665`).map(r=>r.trim())},e.splitSections=function(n){return n.split(` 666m=`).map((i,a)=>(a>0?"m="+i:i).trim()+`\r 667`)},e.getDescription=function(n){const r=e.splitSections(n);return r&&r[0]},e.getMediaSections=function(n){const r=e.splitSections(n);return r.shift(),r},e.matchPrefix=function(n,r){return e.splitLines(n).filter(i=>i.indexOf(r)===0)},e.parseCandidate=function(n){let r;n.indexOf("a=candidate:")===0?r=n.substring(12).split(" "):r=n.substring(10).split(" ");const i={foundation:r[0],component:{1:"rtp",2:"rtcp"}[r[1]]||r[1],protocol:r[2].toLowerCase(),priority:parseInt(r[3],10),ip:r[4],address:r[4],port:parseInt(r[5],10),type:r[7]};for(let a=8;a<r.length;a+=2)switch(r[a]){case"raddr":i.relatedAddress=r[a+1];break;case"rport":i.relatedPort=parseInt(r[a+1],10);break;case"tcptype":i.tcpType=r[a+1];break;case"ufrag":i.ufrag=r[a+1],i.usernameFragment=r[a+1];break;default:i[r[a]]===void 0&&(i[r[a]]=r[a+1]);break}return i},e.writeCandidate=function(n){const r=[];r.push(n.foundation);const i=n.component;i==="rtp"?r.push(1):i==="rtcp"?r.push(2):r.push(i),r.push(n.protocol.toUpperCase()),r.push(n.priority),r.push(n.address||n.ip),r.push(n.port);const a=n.type;return r.push("typ"),r.push(a),a!=="host"&&n.relatedAddress&&n.relatedPort!==void 0&&(r.push("raddr"),r.push(n.relatedAddress),r.push("rport"),r.push(n.relatedPort)),n.tcpType&&n.protocol.toLowerCase()==="tcp"&&(r.push("tcptype"),r.push(n.tcpType)),(n.usernameFragment||n.ufrag)&&(r.push("ufrag"),r.push(n.usernameFragment||n.ufrag)),"candidate:"+r.join(" ")},e.parseIceOptions=function(n){return n.substring(14).split(" ")},e.parseRtpMap=function(n){let r=n.substring(9).split(" ");const i={payloadType:parseInt(r.shift(),10)};return r=r[0].split("/"),i.name=r[0],i.clockRate=parseInt(r[1],10),i.channels=r.length===3?parseInt(r[2],10):1,i.numChannels=i.channels,i},e.writeRtpMap=function(n){let r=n.payloadType;n.preferredPayloadType!==void 0&&(r=n.preferredPayloadType);const i=n.channels||n.numChannels||1;return"a=rtpmap:"+r+" "+n.name+"/"+n.clockRate+(i!==1?"/"+i:"")+`\r 668`},e.parseExtmap=function(n){const r=n.substring(9).split(" ");return{id:parseInt(r[0],10),direction:r[0].indexOf("/")>0?r[0].split("/")[1]:"sendrecv",uri:r[1],attributes:r.slice(2).join(" ")}},e.writeExtmap=function(n){return"a=extmap:"+(n.id||n.preferredId)+(n.direction&&n.direction!=="sendrecv"?"/"+n.direction:"")+" "+n.uri+(n.attributes?" "+n.attributes:"")+`\r 669`},e.parseFmtp=function(n){const r={};let i;const a=n.substring(n.indexOf(" ")+1).split(";");for(let s=0;s<a.length;s++)i=a[s].trim().split("="),r[i[0].trim()]=i[1];return r},e.writeFmtp=function(n){let r="",i=n.payloadType;if(n.preferredPayloadType!==void 0&&(i=n.preferredPayloadType),n.parameters&&Object.keys(n.parameters).length){const a=[];Object.keys(n.parameters).forEach(s=>{n.parameters[s]!==void 0?a.push(s+"="+n.parameters[s]):a.push(s)}),r+="a=fmtp:"+i+" "+a.join(";")+`\r 670`}return r},e.parseRtcpFb=function(n){const r=n.substring(n.indexOf(" ")+1).split(" ");return{type:r.shift(),parameter:r.join(" ")}},e.writeRtcpFb=function(n){let r="",i=n.payloadType;return n.preferredPayloadType!==void 0&&(i=n.preferredPayloadType),n.rtcpFeedback&&n.rtcpFeedback.length&&n.rtcpFeedback.forEach(a=>{r+="a=rtcp-fb:"+i+" "+a.type+(a.parameter&&a.parameter.length?" "+a.parameter:"")+`\r 671`}),r},e.parseSsrcMedia=function(n){const r=n.indexOf(" "),i={ssrc:parseInt(n.substring(7,r),10)},a=n.indexOf(":",r);return a>-1?(i.attribute=n.substring(r+1,a),i.value=n.substring(a+1)):i.attribute=n.substring(r+1),i},e.parseSsrcGroup=function(n){const r=n.substring(13).split(" ");return{semantics:r.shift(),ssrcs:r.map(i=>parseInt(i,10))}},e.getMid=function(n){const r=e.matchPrefix(n,"a=mid:")[0];if(r)return r.substring(6)},e.parseFingerprint=function(n){const r=n.substring(14).split(" ");return{algorithm:r[0].toLowerCase(),value:r[1].toUpperCase()}},e.getDtlsParameters=function(n,r){return{role:"auto",fingerprints:e.matchPrefix(n+r,"a=fingerprint:").map(e.parseFingerprint)}},e.writeDtlsParameters=function(n,r){let i="a=setup:"+r+`\r 672`;return n.fingerprints.forEach(a=>{i+="a=fingerprint:"+a.algorithm+" "+a.value+`\r 673`}),i},e.parseCryptoLine=function(n){const r=n.substring(9).split(" ");return{tag:parseInt(r[0],10),cryptoSuite:r[1],keyParams:r[2],sessionParams:r.slice(3)}},e.writeCryptoLine=function(n){return"a=crypto:"+n.tag+" "+n.cryptoSuite+" "+(typeof n.keyParams=="object"?e.writeCryptoKeyParams(n.keyParams):n.keyParams)+(n.sessionParams?" "+n.sessionParams.join(" "):"")+`\r 674`},e.parseCryptoKeyParams=function(n){if(n.indexOf("inline:")!==0)return null;const r=n.substring(7).split("|");return{keyMethod:"inline",keySalt:r[0],lifeTime:r[1],mkiValue:r[2]?r[2].split(":")[0]:void 0,mkiLength:r[2]?r[2].split(":")[1]:void 0}},e.writeCryptoKeyParams=function(n){return n.keyMethod+":"+n.keySalt+(n.lifeTime?"|"+n.lifeTime:"")+(n.mkiValue&&n.mkiLength?"|"+n.mkiValue+":"+n.mkiLength:"")},e.getCryptoParameters=function(n,r){return e.matchPrefix(n+r,"a=crypto:").map(e.parseCryptoLine)},e.getIceParameters=function(n,r){const i=e.matchPrefix(n+r,"a=ice-ufrag:")[0],a=e.matchPrefix(n+r,"a=ice-pwd:")[0];return i&&a?{usernameFragment:i.substring(12),password:a.substring(10)}:null},e.writeIceParameters=function(n){let r="a=ice-ufrag:"+n.usernameFragment+`\r 675a=ice-pwd:`+n.password+`\r 676`;return n.iceLite&&(r+=`a=ice-lite\r 677`),r},e.parseRtpParameters=function(n){const r={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},a=e.splitLines(n)[0].split(" ");r.profile=a[2];for(let o=3;o<a.length;o++){const c=a[o],u=e.matchPrefix(n,"a=rtpmap:"+c+" ")[0];if(u){const d=e.parseRtpMap(u),h=e.matchPrefix(n,"a=fmtp:"+c+" ");switch(d.parameters=h.length?e.parseFmtp(h[0]):{},d.rtcpFeedback=e.matchPrefix(n,"a=rtcp-fb:"+c+" ").map(e.parseRtcpFb),r.codecs.push(d),d.name.toUpperCase()){case"RED":case"ULPFEC":r.fecMechanisms.push(d.name.toUpperCase());break}}}e.matchPrefix(n,"a=extmap:").forEach(o=>{r.headerExtensions.push(e.parseExtmap(o))});const s=e.matchPrefix(n,"a=rtcp-fb:* ").map(e.parseRtcpFb);return r.codecs.forEach(o=>{s.forEach(c=>{o.rtcpFeedback.find(d=>d.type===c.type&&d.parameter===c.parameter)||o.rtcpFeedback.push(c)})}),r},e.writeRtpDescription=function(n,r){let i="";i+="m="+n+" ",i+=r.codecs.length>0?"9":"0",i+=" "+(r.profile||"UDP/TLS/RTP/SAVPF")+" ",i+=r.codecs.map(s=>s.preferredPayloadType!==void 0?s.preferredPayloadType:s.payloadType).join(" ")+`\r 678`,i+=`c=IN IP4 0.0.0.0\r 679`,i+=`a=rtcp:9 IN IP4 0.0.0.0\r 680`,r.codecs.forEach(s=>{i+=e.writeRtpMap(s),i+=e.writeFmtp(s),i+=e.writeRtcpFb(s)});let a=0;return r.codecs.forEach(s=>{s.maxptime>a&&(a=s.maxptime)}),a>0&&(i+="a=maxptime:"+a+`\r 681`),r.headerExtensions&&r.headerExtensions.forEach(s=>{i+=e.writeExtmap(s)}),i},e.parseRtpEncodingParameters=function(n){const r=[],i=e.parseRtpParameters(n),a=i.fecMechanisms.indexOf("RED")!==-1,s=i.fecMechanisms.indexOf("ULPFEC")!==-1,o=e.matchPrefix(n,"a=ssrc:").map(f=>e.parseSsrcMedia(f)).filter(f=>f.attribute==="cname"),c=o.length>0&&o[0].ssrc;let u;const d=e.matchPrefix(n,"a=ssrc-group:FID").map(f=>f.substring(17).split(" ").map(g=>parseInt(g,10)));d.length>0&&d[0].length>1&&d[0][0]===c&&(u=d[0][1]),i.codecs.forEach(f=>{if(f.name.toUpperCase()==="RTX"&&f.parameters.apt){let p={ssrc:c,codecPayloadType:parseInt(f.parameters.apt,10)};c&&u&&(p.rtx={ssrc:u}),r.push(p),a&&(p=JSON.parse(JSON.stringify(p)),p.fec={ssrc:c,mechanism:s?"red+ulpfec":"red"},r.push(p))}}),r.length===0&&c&&r.push({ssrc:c});let h=e.matchPrefix(n,"b=");return h.length&&(h[0].indexOf("b=TIAS:")===0?h=parseInt(h[0].substring(7),10):h[0].indexOf("b=AS:")===0?h=parseInt(h[0].substring(5),10)*1e3*.95-50*40*8:h=void 0,r.forEach(f=>{f.maxBitrate=h})),r},e.parseRtcpParameters=function(n){const r={},i=e.matchPrefix(n,"a=ssrc:").map(o=>e.parseSsrcMedia(o)).filter(o=>o.attribute==="cname")[0];i&&(r.cname=i.value,r.ssrc=i.ssrc);const a=e.matchPrefix(n,"a=rtcp-rsize");r.reducedSize=a.length>0,r.compound=a.length===0;const s=e.matchPrefix(n,"a=rtcp-mux");return r.mux=s.length>0,r},e.writeRtcpParameters=function(n){let r="";return n.reducedSize&&(r+=`a=rtcp-rsize\r 682`),n.mux&&(r+=`a=rtcp-mux\r 683`),n.ssrc!==void 0&&n.cname&&(r+="a=ssrc:"+n.ssrc+" cname:"+n.cname+`\r 684`),r},e.parseMsid=function(n){let r;const i=e.matchPrefix(n,"a=msid:");if(i.length===1)return r=i[0].substring(7).split(" "),{stream:r[0],track:r[1]};const a=e.matchPrefix(n,"a=ssrc:").map(s=>e.parseSsrcMedia(s)).filter(s=>s.attribute==="msid");if(a.length>0)return r=a[0].value.split(" "),{stream:r[0],track:r[1]}},e.parseSctpDescription=function(n){const r=e.parseMLine(n),i=e.matchPrefix(n,"a=max-message-size:");let a;i.length>0&&(a=parseInt(i[0].substring(19),10)),isNaN(a)&&(a=65536);const s=e.matchPrefix(n,"a=sctp-port:");if(s.length>0)return{port:parseInt(s[0].substring(12),10),protocol:r.fmt,maxMessageSize:a};const o=e.matchPrefix(n,"a=sctpmap:");if(o.length>0){const c=o[0].substring(10).split(" ");return{port:parseInt(c[0],10),protocol:c[1],maxMessageSize:a}}},e.writeSctpDescription=function(n,r){let i=[];return n.protocol!=="DTLS/SCTP"?i=["m="+n.kind+" 9 "+n.protocol+" "+r.protocol+`\r 685`,`c=IN IP4 0.0.0.0\r 686`,"a=sctp-port:"+r.port+`\r 687`]:i=["m="+n.kind+" 9 "+n.protocol+" "+r.port+`\r 688`,`c=IN IP4 0.0.0.0\r 689`,"a=sctpmap:"+r.port+" "+r.protocol+` 65535\r 690`],r.maxMessageSize!==void 0&&i.push("a=max-message-size:"+r.maxMessageSize+`\r 691`),i.join("")},e.generateSessionId=function(){return Math.random().toString().substr(2,22)},e.writeSessionBoilerplate=function(n,r,i){let a;const s=r!==void 0?r:2;return n?a=n:a=e.generateSessionId(),`v=0\r 692o=`+(i||"thisisadapterortc")+" "+a+" "+s+` IN IP4 127.0.0.1\r 693s=-\r 694t=0 0\r 695`},e.getDirection=function(n,r){const i=e.splitLines(n);for(let a=0;a<i.length;a++)switch(i[a]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return i[a].substring(2)}return r?e.getDirection(r):"sendrecv"},e.getKind=function(n){return e.splitLines(n)[0].split(" ")[0].substring(2)},e.isRejected=function(n){return n.split(" ",2)[1]==="0"},e.parseMLine=function(n){const i=e.splitLines(n)[0].substring(2).split(" ");return{kind:i[0],port:parseInt(i[1],10),protocol:i[2],fmt:i.slice(3).join(" ")}},e.parseOLine=function(n){const i=e.matchPrefix(n,"o=")[0].substring(2).split(" ");return{username:i[0],sessionId:i[1],sessionVersion:parseInt(i[2],10),netType:i[3],addressType:i[4],address:i[5]}},e.isValidSDP=function(n){if(typeof n!="string"||n.length===0)return!1;const r=e.splitLines(n);for(let i=0;i<r.length;i++)if(r[i].length<2||r[i].charAt(1)!=="=")return!1;return!0},t.exports=e}(GS)),GS.exports}var xW=Lpe(),Ld=kpe(xW),$pe=zhe({__proto__:null,default:Ld},[xW]);function Ky(t){if(!t.RTCIceCandidate||t.RTCIceCandidate&&"foundation"in t.RTCIceCandidate.prototype)return;const e=t.RTCIceCandidate;t.RTCIceCandidate=function(r){if(typeof r=="object"&&r.candidate&&r.candidate.indexOf("a=")===0&&(r=JSON.parse(JSON.stringify(r)),r.candidate=r.candidate.substring(2)),r.candidate&&r.candidate.length){const i=new e(r),a=Ld.parseCandidate(r.candidate);for(const s in a)s in i||Object.defineProperty(i,s,{value:a[s]});return i.toJSON=function(){return{candidate:i.candidate,sdpMid:i.sdpMid,sdpMLineIndex:i.sdpMLineIndex,usernameFragment:i.usernameFragment}},i}return new e(r)},t.RTCIceCandidate.prototype=e.prototype,Su(t,"icecandidate",n=>(n.candidate&&Object.defineProperty(n,"candidate",{value:new t.RTCIceCandidate(n.candidate),writable:"false"}),n))}function XC(t){!t.RTCIceCandidate||t.RTCIceCandidate&&"relayProtocol"in t.RTCIceCandidate.prototype||Su(t,"icecandidate",e=>{if(e.candidate){const n=Ld.parseCandidate(e.candidate.candidate);n.type==="relay"&&(e.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[n.priority>>24])}return e})}function Gy(t,e){if(!t.RTCPeerConnection)return;"sctp"in t.RTCPeerConnection.prototype||Object.defineProperty(t.RTCPeerConnection.prototype,"sctp",{get(){return typeof this._sctp>"u"?null:this._sctp}});const n=function(o){if(!o||!o.sdp)return!1;const c=Ld.splitSections(o.sdp);return c.shift(),c.some(u=>{const d=Ld.parseMLine(u);return d&&d.kind==="application"&&d.protocol.indexOf("SCTP")!==-1})},r=function(o){const c=o.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(c===null||c.length<2)return-1;const u=parseInt(c[1],10);return u!==u?-1:u},i=function(o){let c=65536;return e.browser==="firefox"&&(e.version<57?o===-1?c=16384:c=2147483637:e.version<60?c=e.version===57?65535:65536:c=2147483637),c},a=function(o,c){let u=65536;e.browser==="firefox"&&e.version===57&&(u=65535);const d=Ld.matchPrefix(o.sdp,"a=max-message-size:");return d.length>0?u=parseInt(d[0].substring(19),10):e.browser==="firefox"&&c!==-1&&(u=2147483637),u},s=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,e.browser==="chrome"&&e.version>=76){const{sdpSemantics:c}=this.getConfiguration();c==="plan-b"&&Object.defineProperty(this,"sctp",{get(){return typeof this._sctp>"u"?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){const c=r(arguments[0]),u=i(c),d=a(arguments[0],c);let h;u===0&&d===0?h=Number.POSITIVE_INFINITY:u===0||d===0?h=Math.max(u,d):h=Math.min(u,d);const f={};Object.defineProperty(f,"maxMessageSize",{get(){return h}}),this._sctp=f}return s.apply(this,arguments)}}function Yy(t,e){if(!(t.RTCPeerConnection&&"createDataChannel"in t.RTCPeerConnection.prototype)||e.browser==="chrome"&&e.version>149||e.browser==="firefox"&&e.version>60)return;function n(i,a){const s=i.send;i.send=function(){const c=arguments[0],u=c.length||c.size||c.byteLength;if(i.readyState==="open"&&a.sctp&&u>a.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+a.sctp.maxMessageSize+" bytes)");return s.apply(i,arguments)}}const r=t.RTCPeerConnection.prototype.createDataChannel;t.RTCPeerConnection.prototype.createDataChannel=function(){const a=r.apply(this,arguments);return n(a,this),a},Su(t,"datachannel",i=>(n(i.channel,i.target),i))}function ZC(t){if(!t.RTCPeerConnection||"connectionState"in t.RTCPeerConnection.prototype)return;const e=t.RTCPeerConnection.prototype;Object.defineProperty(e,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(e,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(n){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),n&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=n)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(n=>{const r=e[n];e[n]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=i=>{const a=i.target;if(a._lastConnectionState!==a.connectionState){a._lastConnectionState=a.connectionState;const s=new Event("connectionstatechange",i);a.dispatchEvent(s)}return i},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),r.apply(this,arguments)}})}function QC(t,e){if(!t.RTCPeerConnection||e.browser==="chrome"&&e.version>=71||e.browser==="safari"&&e._safariVersion>=13.1)return;const n=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(i){if(i&&i.sdp&&i.sdp.indexOf(` 696a=extmap-allow-mixed`)!==-1){const a=i.sdp.split(` 697`).filter(s=>s.trim()!=="a=extmap-allow-mixed").join(` 698`);t.RTCSessionDescription&&i instanceof t.RTCSessionDescription?arguments[0]=new t.RTCSessionDescription({type:i.type,sdp:a}):i.sdp=a}return n.apply(this,arguments)}}function Jy(t,e){if(!(t.RTCPeerConnection&&t.RTCPeerConnection.prototype))return;const n=t.RTCPeerConnection.prototype.addIceCandidate;!n||n.length===0||(t.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?(e.browser==="chrome"&&e.version<78||e.browser==="firefox"&&e.version<68||e.browser==="safari")&&arguments[0]&&arguments[0].candidate===""?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function Xy(t,e){if(!(t.RTCPeerConnection&&t.RTCPeerConnection.prototype))return;const n=t.RTCPeerConnection.prototype.setLocalDescription;!n||n.length===0||(t.RTCPeerConnection.prototype.setLocalDescription=function(){let i=arguments[0]||{};if(typeof i!="object"||i.type&&i.sdp)return n.apply(this,arguments);if(i={type:i.type,sdp:i.sdp},!i.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":i.type="offer";break;default:i.type="answer";break}return i.sdp||i.type!=="offer"&&i.type!=="answer"?n.apply(this,[i]):(i.type==="offer"?this.createOffer:this.createAnswer).apply(this).then(s=>n.apply(this,[s]))})}var Fpe=Object.freeze({__proto__:null,removeExtmapAllowMixed:QC,shimAddIceCandidateNullOrEmpty:Jy,shimConnectionState:ZC,shimMaxMessageSize:Gy,shimParameterlessSetLocalDescription:Xy,shimRTCIceCandidate:Ky,shimRTCIceCandidateRelayProtocol:XC,shimSendThrowTypeError:Yy});function Bpe(){let{window:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimSafari:!0};const n=bP,r=Mpe(t),i={browserDetails:r,commonShim:Fpe,extractVersion:Tp,disableLog:Rpe,disableWarnings:Dpe,sdp:$pe};switch(r.browser){case"chrome":if(!r4||!YC||!e.shimChrome)return n("Chrome shim is not included in this adapter release."),i;if(r.version===null)return n("Chrome shim can not determine version, not shimming."),i;n("adapter.js shimming chrome."),i.browserShim=r4,Jy(t,r),Xy(t),qz(t,r),Kz(t),YC(t,r),Gz(t,r),Zz(t,r),Yz(t),Jz(t,r),Qz(t,r),Ky(t),XC(t),ZC(t),Gy(t,r),Yy(t,r),QC(t,r);break;case"firefox":if(!i4||!JC||!e.shimFirefox)return n("Firefox shim is not included in this adapter release."),i;n("adapter.js shimming firefox."),i.browserShim=i4,Jy(t,r),Xy(t),eW(t,r),JC(t,r),nW(t,r),tW(t),aW(t),rW(t),iW(t),sW(t),oW(t),cW(t),lW(t),uW(t),Ky(t),ZC(t),Gy(t,r),Yy(t,r);break;case"safari":if(!a4||!e.shimSafari)return n("Safari shim is not included in this adapter release."),i;n("adapter.js shimming safari."),i.browserShim=a4,Jy(t,r),Xy(t),gW(t),yW(t),fW(t),dW(t),hW(t),vW(t),pW(t),bW(t),Ky(t),XC(t),Gy(t,r),Yy(t,r),QC(t,r);break;default:n("Unsupported browser!");break}return i}Bpe({window:typeof window>"u"?void 0:window});var eT,wW;class jr extends(wW=Promise){constructor(e){super(e)}catch(e){return super.catch(e)}static reject(e){return super.reject(e)}static all(e){return super.all(e)}static race(e){return super.race(e)}}eT=jr;jr.resolve=t=>Reflect.get(wW,"resolve",eT).call(eT,t);const Upe=/version\/(\d+(\.?_?\d+)+)/i;let YS;function oi(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(typeof navigator>"u")return;const n=navigator.userAgent.toLowerCase();if(YS===void 0||e){const r=zpe.find(i=>{let{test:a}=i;return a.test(n)});YS=r==null?void 0:r.describe(n)}return YS}const zpe=[{test:/firefox|iceweasel|fxios/i,describe(t){return{name:"Firefox",version:Zy(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,t),os:t.toLowerCase().includes("fxios")?"iOS":void 0,osVersion:JS(t)}}},{test:/chrom|crios|crmo/i,describe(t){return{name:"Chrome",version:Zy(/(?:chrome|chromium|crios|crmo)\/(\d+(\.?_?\d+)+)/i,t),os:t.toLowerCase().includes("crios")?"iOS":void 0,osVersion:JS(t)}}},{test:/safari|applewebkit/i,describe(t){return{name:"Safari",version:Zy(Upe,t),os:t.includes("mobile/")?"iOS":"macOS",osVersion:JS(t)}}}];function Zy(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;const r=e.match(t);return r&&r.length>=n&&r[n]||""}function JS(t){return t.includes("mac os")?Zy(/\(.+?(\d+_\d+(:?_\d+)?)/,t,1).replace(/_/g,"."):void 0}var Wpe="2.18.5";const Vpe=Wpe,Hpe=16;
698class Hc extends Error{constructor(e,n,r){super(n||"an error has occurred"),this.name="LiveKitError",this.code=e,typeof(r==null?void 0:r.cause)<"u"&&(this.cause=r==null?void 0:r.cause)}}class la extends Hc{}var Gt;(function(t){t[t.NotAllowed=0]="NotAllowed",t[t.ServerUnreachable=1]="ServerUnreachable",t[t.InternalError=2]="InternalError",t[t.Cancelled=3]="Cancelled",t[t.LeaveRequest=4]="LeaveRequest",t[t.Timeout=5]="Timeout",t[t.WebSocket=6]="WebSocket",t[t.ServiceNotFound=7]="ServiceNotFound"})(Gt||(Gt={}));class Ge extends la{constructor(e,n,r,i){super(1,e),this.name="ConnectionError",this.status=r,this.reason=n,this.context=i,this.reasonName=Gt[n]}static notAllowed(e,n,r){return new Ge(e,Gt.NotAllowed,n,r)}static timeout(e){return new Ge(e,Gt.Timeout)}static leaveRequest(e,n){return new Ge(e,Gt.LeaveRequest,void 0,n)}static internal(e,n){return new Ge(e,Gt.InternalError,void 0,n)}static cancelled(e){return new Ge(e,Gt.Cancelled)}static serverUnreachable(e,n){return new Ge(e,Gt.ServerUnreachable,n)}static websocket(e,n,r){return new Ge(e,Gt.WebSocket,n,r)}static serviceNotFound(e,n){return new Ge(e,Gt.ServiceNotFound,void 0,n)}}class wP extends Hc{constructor(e){super(21,e??"device is unsupported"),this.name="DeviceUnsupportedError"}}class Qs extends Hc{constructor(e){super(20,e??"track is invalid"),this.name="TrackInvalidError"}}class qpe extends Hc{constructor(e){super(10,e??"unsupported server"),this.name="UnsupportedServer"}}class bn extends Hc{constructor(e){super(12,e??"unexpected connection state"),this.name="UnexpectedConnectionState"}}class _c extends Hc{constructor(e){super(13,e??"unable to negotiate"),this.name="NegotiationError"}}class o4 extends Hc{constructor(e,n){super(15,e),this.name="PublishTrackError",this.status=n}}class c4 extends la{constructor(e,n){super(15,e),this.name="SignalRequestError",this.reason=n,this.reasonName=typeof n=="string"?n:bl[n]}}var Ir;(function(t){t[t.AlreadyOpened=0]="AlreadyOpened",t[t.AbnormalEnd=1]="AbnormalEnd",t[t.DecodeFailed=2]="DecodeFailed",t[t.LengthExceeded=3]="LengthExceeded",t[t.Incomplete=4]="Incomplete",t[t.HandlerAlreadyRegistered=7]="HandlerAlreadyRegistered",t[t.EncryptionTypeMismatch=8]="EncryptionTypeMismatch"})(Ir||(Ir={}));class Wi extends la{constructor(e,n){super(16,e),this.name="DataStreamError",this.reason=n,this.reasonName=Ir[n]}}class Ku extends Hc{constructor(e){super(18,e),this.name="SignalReconnectError"}}var ib;(function(t){t.PermissionDenied="PermissionDenied",t.NotFound="NotFound",t.DeviceInUse="DeviceInUse",t.Other="Other"})(ib||(ib={}));(function(t){function e(n){if(n&&"name"in n)return n.name==="NotFoundError"||n.name==="DevicesNotFoundError"?t.NotFound:n.name==="NotAllowedError"||n.name==="PermissionDeniedError"?t.PermissionDenied:n.name==="NotReadableError"||n.name==="TrackStartError"?t.DeviceInUse:t.Other}t.getFailure=e})(ib||(ib={}));class Vn{}Vn.setTimeout=function(){return setTimeout(...arguments)};Vn.setInterval=function(){return setInterval(...arguments)};Vn.clearTimeout=function(){return clearTimeout(...arguments)};Vn.clearInterval=function(){return clearInterval(...arguments)};var be;(function(t){t.Connected="connected",t.Reconnecting="reconnecting",t.SignalReconnecting="signalReconnecting",t.Reconnected="reconnected",t.Disconnected="disconnected",t.ConnectionStateChanged="connectionStateChanged",t.Moved="moved",t.MediaDevicesChanged="mediaDevicesChanged",t.ParticipantConnected="participantConnected",t.ParticipantDisconnected="participantDisconnected",t.TrackPublished="trackPublished",t.TrackSubscribed="trackSubscribed",t.TrackSubscriptionFailed="trackSubscriptionFailed",t.TrackUnpublished="trackUnpublished",t.TrackUnsubscribed="trackUnsubscribed",t.TrackMuted="trackMuted",t.TrackUnmuted="trackUnmuted",t.LocalTrackPublished="localTrackPublished",t.LocalTrackUnpublished="localTrackUnpublished",t.LocalAudioSilenceDetected="localAudioSilenceDetected",t.ActiveSpeakersChanged="activeSpeakersChanged",t.ParticipantMetadataChanged="participantMetadataChanged",t.ParticipantNameChanged="participantNameChanged",t.ParticipantAttributesChanged="participantAttributesChanged",t.ParticipantActive="participantActive",t.RoomMetadataChanged="roomMetadataChanged",t.DataReceived="dataReceived",t.SipDTMFReceived="sipDTMFReceived",t.TranscriptionReceived="transcriptionReceived",t.ConnectionQualityChanged="connectionQualityChanged",t.TrackStreamStateChanged="trackStreamStateChanged",t.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",t.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",t.AudioPlaybackStatusChanged="audioPlaybackChanged",t.VideoPlaybackStatusChanged="videoPlaybackChanged",t.MediaDevicesError="mediaDevicesError",t.ParticipantPermissionsChanged="participantPermissionsChanged",t.SignalConnected="signalConnected",t.RecordingStatusChanged="recordingStatusChanged",t.ParticipantEncryptionStatusChanged="participantEncryptionStatusChanged",t.EncryptionError="encryptionError",t.DCBufferStatusChanged="dcBufferStatusChanged",t.ActiveDeviceChanged="activeDeviceChanged",t.ChatMessage="chatMessage",t.LocalTrackSubscribed="localTrackSubscribed",t.MetricsReceived="metricsReceived",t.DataTrackPublished="dataTrackPublished",t.DataTrackUnpublished="dataTrackUnpublished",t.LocalDataTrackPublished="localDataTrackPublished",t.LocalDataTrackUnpublished="localDataTrackUnpublished"})(be||(be={}));var Ee;(function(t){t.TrackPublished="trackPublished",t.TrackSubscribed="trackSubscribed",t.TrackSubscriptionFailed="trackSubscriptionFailed",t.TrackUnpublished="trackUnpublished",t.TrackUnsubscribed="trackUnsubscribed",t.TrackMuted="trackMuted",t.TrackUnmuted="trackUnmuted",t.LocalTrackPublished="localTrackPublished",t.LocalTrackUnpublished="localTrackUnpublished",t.LocalTrackCpuConstrained="localTrackCpuConstrained",t.LocalSenderCreated="localSenderCreated",t.ParticipantMetadataChanged="participantMetadataChanged",t.ParticipantNameChanged="participantNameChanged",t.DataReceived="dataReceived",t.SipDTMFReceived="sipDTMFReceived",t.TranscriptionReceived="transcriptionReceived",t.IsSpeakingChanged="isSpeakingChanged",t.ConnectionQualityChanged="connectionQualityChanged",t.TrackStreamStateChanged="trackStreamStateChanged",t.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",t.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",t.TrackCpuConstrained="trackCpuConstrained",t.MediaDevicesError="mediaDevicesError",t.AudioStreamAcquired="audioStreamAcquired",t.ParticipantPermissionsChanged="participantPermissionsChanged",t.PCTrackAdded="pcTrackAdded",t.AttributesChanged="attributesChanged",t.LocalTrackSubscribed="localTrackSubscribed",t.ChatMessage="chatMessage",t.Active="active"})(Ee||(Ee={}));var ve;(function(t){t.TransportsCreated="transportsCreated",t.Connected="connected",t.Disconnected="disconnected",t.Resuming="resuming",t.Resumed="resumed",t.Restarting="restarting",t.Restarted="restarted",t.SignalResumed="signalResumed",t.SignalRestarted="signalRestarted",t.Closing="closing",t.MediaTrackAdded="mediaTrackAdded",t.ActiveSpeakersUpdate="activeSpeakersUpdate",t.DataPacketReceived="dataPacketReceived",t.RTPVideoMapUpdate="rtpVideoMapUpdate",t.DCBufferStatusChanged="dcBufferStatusChanged",t.ParticipantUpdate="participantUpdate",t.RoomUpdate="roomUpdate",t.SpeakersChanged="speakersChanged",t.StreamStateChanged="streamStateChanged",t.ConnectionQualityUpdate="connectionQualityUpdate",t.SubscriptionError="subscriptionError",t.SubscriptionPermissionUpdate="subscriptionPermissionUpdate",t.RemoteMute="remoteMute",t.SubscribedQualityUpdate="subscribedQualityUpdate",t.LocalTrackUnpublished="localTrackUnpublished",t.LocalTrackSubscribed="localTrackSubscribed",t.Offline="offline",t.SignalRequestResponse="signalRequestResponse",t.SignalConnected="signalConnected",t.RoomMoved="roomMoved",t.PublishDataTrackResponse="publishDataTrackResponse",t.UnPublishDataTrackResponse="unPublishDataTrackResponse",t.DataTrackSubscriberHandles="dataTrackSubscriberHandles",t.DataTrackPacketReceived="dataTrackPacketReceived",t.Joined="joined",t.TokenRefreshed="tokenRefreshed",t.ServerRegionsReported="serverRegionsReported"})(ve||(ve={}));var ke;(function(t){t.Message="message",t.Muted="muted",t.Unmuted="unmuted",t.Restarted="restarted",t.Ended="ended",t.Subscribed="subscribed",t.Unsubscribed="unsubscribed",t.CpuConstrained="cpuConstrained",t.UpdateSettings="updateSettings",t.UpdateSubscription="updateSubscription",t.AudioPlaybackStarted="audioPlaybackStarted",t.AudioPlaybackFailed="audioPlaybackFailed",t.AudioSilenceDetected="audioSilenceDetected",t.VisibilityChanged="visibilityChanged",t.VideoDimensionsChanged="videoDimensionsChanged",t.VideoPlaybackStarted="videoPlaybackStarted",t.VideoPlaybackFailed="videoPlaybackFailed",t.ElementAttached="elementAttached",t.ElementDetached="elementDetached",t.UpstreamPaused="upstreamPaused",t.UpstreamResumed="upstreamResumed",t.SubscriptionPermissionChanged="subscriptionPermissionChanged",t.SubscriptionStatusChanged="subscriptionStatusChanged",t.SubscriptionFailed="subscriptionFailed",t.TrackProcessorUpdate="trackProcessorUpdate",t.AudioTrackFeatureUpdate="audioTrackFeatureUpdate",t.TranscriptionReceived="transcriptionReceived",t.TimeSyncUpdate="timeSyncUpdate",t.PreConnectBufferFlushed="preConnectBufferFlushed"})(ke||(ke={}));function Kpe(t){return typeof t>"u"?t:typeof structuredClone=="function"?typeof t=="object"&&t!==null?structuredClone(Object.assign({},t)):structuredClone(t):JSON.parse(JSON.stringify(t))}class Ht{constructor(e,n,r,i,a){if(typeof e=="object")this.width=e.width,this.height=e.height,this.aspectRatio=e.aspectRatio,this.encoding={maxBitrate:e.maxBitrate,maxFramerate:e.maxFramerate,priority:e.priority};else if(n!==void 0&&r!==void 0)this.width=e,this.height=n,this.aspectRatio=e/n,this.encoding={maxBitrate:r,maxFramerate:i,priority:a};else throw new TypeError("Unsupported options: provide at least width, height and maxBitrate")}get resolution(){return{width:this.width,height:this.height,frameRate:this.encoding.maxFramerate,aspectRatio:this.aspectRatio}}}const Gpe=["vp8","h264"],Ype=["vp8","h264","vp9","av1","h265"];function SW(t){return!!Gpe.find(e=>e===t)}const Jpe=SW;var l4;(function(t){t[t.PREFER_REGRESSION=0]="PREFER_REGRESSION",t[t.SIMULCAST=1]="SIMULCAST",t[t.REGRESSION=2]="REGRESSION"})(l4||(l4={}));var tT;(function(t){t.telephone={maxBitrate:12e3}
vendor: 8,938 bytes, line 698
698,t.speech={maxBitrate:24e3},t.music={maxBitrate:48e3},t.musicStereo={maxBitrate:64e3},t.musicHighQuality={maxBitrate:96e3},t.musicHighQualityStereo={maxBitrate:128e3}})(tT||(tT={}));const zm={h90:new Ht(160,90,9e4,20),h180:new Ht(320,180,16e4,20),h216:new Ht(384,216,18e4,20),h360:new Ht(640,360,45e4,20),h540:new Ht(960,540,8e5,25),h720:new Ht(1280,720,17e5,30),h1080:new Ht(1920,1080,3e6,30),h1440:new Ht(2560,1440,5e6,30),h2160:new Ht(3840,2160,8e6,30)},nT={h120:new Ht(160,120,7e4,20),h180:new Ht(240,180,125e3,20),h240:new Ht(320,240,14e4,20),h360:new Ht(480,360,33e4,20),h480:new Ht(640,480,5e5,20),h540:new Ht(720,540,6e5,25),h720:new Ht(960,720,13e5,30),h1080:new Ht(1440,1080,23e5,30),h1440:new Ht(1920,1440,38e5,30)},SP={h360fps3:new Ht(640,360,2e5,3,"medium"),h360fps15:new Ht(640,360,4e5,15,"medium"),h720fps5:new Ht(1280,720,8e5,5,"medium"),h720fps15:new Ht(1280,720,15e5,15,"medium"),h720fps30:new Ht(1280,720,2e6,30,"medium"),h1080fps15:new Ht(1920,1080,25e5,15,"medium"),h1080fps30:new Ht(1920,1080,5e6,30,"medium"),original:new Ht(0,0,7e6,30,"medium")};function kW(t,e,n){var r,i,a,s;const{optionsWithoutProcessor:o,audioProcessor:c,videoProcessor:u}=TW(t??{}),d=e==null?void 0:e.processor,h=n==null?void 0:n.processor,f=o??{};return f.audio===!0&&(f.audio={}),f.video===!0&&(f.video={}),f.audio&&(rT(f.audio,e),(r=(a=f.audio).deviceId)!==null&&r!==void 0||(a.deviceId={ideal:"default"}),(c||d)&&(f.audio.processor=c??d)),f.video&&(rT(f.video,n),(i=(s=f.video).deviceId)!==null&&i!==void 0||(s.deviceId={ideal:"default"}),(u||h)&&(f.video.processor=u??h)),f}function rT(t,e){return Object.keys(e).forEach(n=>{t[n]===void 0&&(t[n]=e[n])}),t}function kP(t){var e,n,r,i;const a={};if(t.video)if(typeof t.video=="object"){const s={},o=s,c=t.video;Object.keys(c).forEach(u=>{switch(u){case"resolution":rT(o,c.resolution);break;default:o[u]=c[u]}}),a.video=s,(e=(r=a.video).deviceId)!==null&&e!==void 0||(r.deviceId={ideal:"default"})}else a.video=t.video?{deviceId:{ideal:"default"}}:!1;else a.video=!1;return t.audio?typeof t.audio=="object"?(a.audio=t.audio,(n=(i=a.audio).deviceId)!==null&&n!==void 0||(i.deviceId={ideal:"default"})):a.audio={deviceId:{ideal:"default"}}:a.audio=!1,a}function _W(t){return F(this,arguments,void 0,function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:200;return function*(){const r=CW();if(r){const i=r.createAnalyser();i.fftSize=2048;const a=i.frequencyBinCount,s=new Uint8Array(a);r.createMediaStreamSource(new MediaStream([e.mediaStreamTrack])).connect(i),yield Nr(n),i.getByteTimeDomainData(s);const c=s.some(u=>u!==128&&u!==0);return r.close(),!c}return!1}()})}function CW(){var t;const e=typeof window<"u"&&(window.AudioContext||window.webkitAudioContext);if(e){const n=new e({latencyHint:"interactive"});if(n.state==="suspended"&&typeof window<"u"&&(!((t=window.document)===null||t===void 0)&&t.body)){const r=()=>F(this,void 0,void 0,function*(){var i;try{n.state==="suspended"&&(yield n.resume())}catch(a){console.warn("Error trying to auto-resume audio context",a)}finally{(i=window.document.body)===null||i===void 0||i.removeEventListener("click",r)}});n.addEventListener("statechange",()=>{var i;n.state==="closed"&&((i=window.document.body)===null||i===void 0||i.removeEventListener("click",r))}),window.document.body.addEventListener("click",r)}return n}}function Xpe(t){return t==="audioinput"?fe.Source.Microphone:t==="videoinput"?fe.Source.Camera:fe.Source.Unknown}function iT(t){return t===fe.Source.Microphone?"audioinput":t===fe.Source.Camera?"videoinput":void 0}function Zpe(t){var e,n;let r=(e=t.video)!==null&&e!==void 0?e:!0;return t.resolution&&t.resolution.width>0&&t.resolution.height>0&&(r=typeof r=="boolean"?{}:r,du()?r=Object.assign(Object.assign({},r),{width:{max:t.resolution.width},height:{max:t.resolution.height},frameRate:t.resolution.frameRate}):r=Object.assign(Object.assign({},r),{width:{ideal:t.resolution.width},height:{ideal:t.resolution.height},frameRate:t.resolution.frameRate})),{audio:(n=t.audio)!==null&&n!==void 0?n:!1,video:r,controller:t.controller,selfBrowserSurface:t.selfBrowserSurface,surfaceSwitching:t.surfaceSwitching,systemAudio:t.systemAudio,preferCurrentTab:t.preferCurrentTab}}function Vp(t){return t.split("/")[1].toLowerCase()}function Qpe(t){const e=[];return t.forEach(n=>{n.track!==void 0&&e.push(new pP({cid:n.track.mediaStreamID,track:n.trackInfo}))}),e}function St(t){return"mediaStreamTrack"in t?{trackID:t.sid,source:t.source,muted:t.isMuted,enabled:t.mediaStreamTrack.enabled,kind:t.kind,streamID:t.mediaStreamID,streamTrackID:t.mediaStreamTrack.id}:{trackID:t.trackSid,enabled:t.isEnabled,muted:t.isMuted,trackInfo:Object.assign({mimeType:t.mimeType,name:t.trackName,encrypted:t.isEncrypted,kind:t.kind,source:t.source},t.track?St(t.track):{})}}function eme(){return typeof RTCRtpReceiver<"u"&&"getSynchronizationSources"in RTCRtpReceiver}function tme(t,e){var n;t===void 0&&(t={}),e===void 0&&(e={});const r=[...Object.keys(e),...Object.keys(t)],i={};for(const a of r)t[a]!==e[a]&&(i[a]=(n=e[a])!==null&&n!==void 0?n:"");return i}function TW(t){const e=Object.assign({},t);let n,r;return typeof e.audio=="object"&&e.audio.processor&&(n=e.audio.processor,e.audio=Object.assign(Object.assign({},e.audio),{processor:void 0})),typeof e.video=="object"&&e.video.processor&&(r=e.video.processor,e.video=Object.assign(Object.assign({},e.video),{processor:void 0})),{audioProcessor:n,videoProcessor:r,optionsWithoutProcessor:Kpe(e)}}function nme(t){switch(t){case Un.CAMERA:return fe.Source.Camera;case Un.MICROPHONE:return fe.Source.Microphone;case Un.SCREEN_SHARE:return fe.Source.ScreenShare;case Un.SCREEN_SHARE_AUDIO:return fe.Source.ScreenShareAudio;default:return fe.Source.Unknown}}function u4(t,e){return t.width*t.height<e.width*e.height}function rme(t,e){var n;return(n=t.layers)===null||n===void 0?void 0:n.find(r=>r.quality===e)}const ime=5e3,np=[];var Ti;(function(t){t[t.LOW=0]="LOW",t[t.MEDIUM=1]="MEDIUM",t[t.HIGH=2]="HIGH"})(Ti||(Ti={}));class fe extends ca.EventEmitter{get streamState(){return this._streamState}setStreamState(e){this._streamState=e}constructor(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var i;super(),this.attachedElements=[],this.isMuted=!1,this._streamState=fe.StreamState.Active,this.isInBackground=!1,this._currentBitrate=0,this.log=ft,this.appVisibilityChangedListener=()=>{this.backgroundTimeout&&clearTimeout(this.backgroundTimeout),document.visibilityState==="hidden"?this.backgroundTimeout=setTimeout(()=>this.handleAppVisibilityChanged(),ime):this.handleAppVisibilityChanged()},this.log=li((i=r.loggerName)!==null&&i!==void 0?i:Rr.Track),this.loggerContextCb=r.loggerContextCb,this.setMaxListeners(100),this.kind=n,this._mediaStreamTrack=e,this._mediaStreamID=e.id,this.source=fe.Source.Unknown}get logContext(){var e;return Object.assign(Object.assign({},(e=this.loggerContextCb)===null||e===void 0?void 0:e.call(this)),St(this))}get currentBitrate(){return this._currentBitrate}get mediaStreamTrack(){return this._mediaStreamTrack}get mediaStreamID(){return this._mediaStreamID}attach(e){let n="audio";this.kind===fe.Kind.Video&&(n="video"),this.attachedElements.length===0&&this.kind===fe.Kind.Video&&this.addAppVisibilityListener(),e||(n==="audio"&&(np.forEach(a=>{a.parentElement===null&&!e&&(e=a)}),e&&np.splice(np.indexOf(e),1)),e||(e=document.createElement(n))),this.attachedElements.includes(e)||this.attachedElements.push(e),vd(this.mediaStreamTrack,e);const r=e.srcObject.getTracks(),i=r.some(a=>a.kind==="audio");return e.play().then(()=>{this.emit(i?ke.AudioPlaybackStarted:ke.VideoPlaybackStarted)}).catch(a=>{a.name==="NotAllowedError"?this.emit(i?ke.AudioPlaybackFailed:ke.VideoPlaybackFailed,a):a.name==="AbortError"?ft.debug("".concat(i?"audio":"video"," playback aborted, likely due to new play request")):ft.warn("could not playback ".concat(i?"audio":"video"),a),i&&e&&r.some(s=>s.kind==="video")&&a.name==="NotAllowedError"&&(e.muted=!0,e.play().catch(()=>{}))}),this.emit(ke.ElementAttached,e),e}detach(e){try{if(e){$d(this.mediaStreamTrack,e);const r=this.attachedElements.indexOf(e);return r>=0&&(this.attachedElements.splice(r,1),this.recycleElement(e),this.emit(ke.ElementDetached,e)),e}const n=[];return this.attachedElements.forEach(r=>{$d(this.mediaStreamTrack,r),n.push(r),this.recycleElement(r),this.emit(ke.ElementDetached,r)}),this.attachedElements=[],n}finally{this.attachedElements.length===0&&this.removeAppVisibilityListener()}}stop(){this.stopMonitor(),this._mediaStreamTrack.stop()}enable(){this._mediaStreamTrack.enabled=!0}disable(){this._mediaStreamTrack.enabled=!1}stopMonitor(){this.monitorInterval&&clearInterval(this.monitorInterval),this.timeSyncHandle&&cancelAnimationFrame(this.timeSyncHandle)}updateLoggerOptions(e){e.loggerName&&(this.log=li(e.loggerName)),e.loggerContextCb&&(this.loggerContextCb=e.loggerContextCb)}recycleElement(e){if(e instanceof HTMLAudioElement){let n=!0;
698e.pause(),np.forEach(r=>{r.parentElement||(n=!1)}),n&&np.push(e)}}handleAppVisibilityChanged(){return F(this,void 0,void 0,function*(){this.isInBackground=document.visibilityState==="hidden",!this.isInBackground&&this.kind===fe.Kind.Video&&setTimeout(()=>this.attachedElements.forEach(e=>e.play().catch(()=>{})),0)})}addAppVisibilityListener(){ni()?(this.isInBackground=document.visibilityState==="hidden",document.addEventListener("visibilitychange",this.appVisibilityChangedListener)):this.isInBackground=!1}removeAppVisibilityListener(){ni()&&document.removeEventListener("visibilitychange",this.appVisibilityChangedListener)}}function vd(t,e){let n;e.srcObject instanceof MediaStream?n=e.srcObject:n=new MediaStream;let r;t.kind==="audio"?r=n.getAudioTracks():r=n.getVideoTracks(),r.includes(t)||(r.forEach(i=>{n.removeTrack(i)}),n.addTrack(t)),(!du()||!(e instanceof HTMLVideoElement))&&(e.autoplay=!0),e.muted=n.getAudioTracks().length===0,e instanceof HTMLVideoElement&&(e.playsInline=!0),e.srcObject!==n&&(e.srcObject=n,(du()||uu())&&e instanceof HTMLVideoElement&&setTimeout(()=>{e.srcObject=n,e.play().catch(()=>{})},0))}function $d(t,e){if(e.srcObject instanceof MediaStream){const n=e.srcObject;n.removeTrack(t),n.getTracks().length>0?e.srcObject=n:e.srcObject=null}}(function(t){let e;(function(u){u.Audio="audio",u.Video="video",u.Unknown="unknown"})(e=t.Kind||(t.Kind={}));let n;(function(u){u.Camera="camera",u.Microphone="microphone",u.ScreenShare="screen_share",u.ScreenShareAudio="screen_share_audio",u.Unknown="unknown"})(n=t.Source||(t.Source={}));let r;(function(u){u.Active="active",u.Paused="paused",u.Unknown="unknown"})(r=t.StreamState||(t.StreamState={}));function i(u){switch(u){case e.Audio:return Da.AUDIO;case e.Video:return Da.VIDEO;default:return Da.DATA}}t.kindToProto=i;function a(u){switch(u){case Da.AUDIO:return e.Audio;case Da.VIDEO:return e.Video;default:return e.Unknown}}t.kindFromProto=a;function s(u){switch(u){case n.Camera:return Un.CAMERA;case n.Microphone:return Un.MICROPHONE;case n.ScreenShare:return Un.SCREEN_SHARE;case n.ScreenShareAudio:return Un.SCREEN_SHARE_AUDIO;default:return Un.UNKNOWN}}t.sourceToProto=s;function o(u){switch(u){case Un.CAMERA:return n.Camera;case Un.MICROPHONE:return n.Microphone;case Un.SCREEN_SHARE:return n.ScreenShare;case Un.SCREEN_SHARE_AUDIO:return n.ScreenShareAudio;default:return n.Unknown}}t.sourceFromProto=o;function c(u){switch(u){case VC.ACTIVE:return r.Active;case VC.PAUSED:return r.Paused;default:return r.Unknown}}t.streamStateFromProto=c})(fe||(fe={}));const ame="|",d4="https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension";function sme(t){const e=t.split(ame);return e.length>1?[e[0],t.substr(e[0].length+1)]:[t,""]}function Nr(t){return new jr(e=>Vn.setTimeout(e,t))}function aT(){return"addTransceiver"in RTCPeerConnection.prototype}function sT(){return"addTrack"in RTCPeerConnection.prototype}function ome(){if(!("getCapabilities"in RTCRtpSender)||du()||uu())return!1;const t=RTCRtpSender.getCapabilities("video");let e=!1;if(t){for(const n of t.codecs)if(n.mimeType.toLowerCase()==="video/av1"){e=!0;break}}return e}function cme(){if(!("getCapabilities"in RTCRtpSender)||uu())return!1;if(du()){const n=oi();if(n!=null&&n.version&&Ps(n.version,"16")<0||(n==null?void 0:n.os)==="iOS"&&(n!=null&&n.osVersion)&&Ps(n.osVersion,"16")<0)return!1}const t=RTCRtpSender.getCapabilities("video");let e=!1;if(t){for(const n of t.codecs)if(n.mimeType.toLowerCase()==="video/vp9"){e=!0;break}}return e}function La(t){return t==="av1"||t==="vp9"}function oT(t){return!document||Wm()?!1:(t||(t=document.createElement("audio")),"setSinkId"in t)}function lme(){return typeof RTCPeerConnection>"u"?!1:aT()||sT()}function uu(){var t;return((t=oi())===null||t===void 0?void 0:t.name)==="Firefox"}function h4(){const t=oi();return!!t&&t.name==="Chrome"&&t.os!=="iOS"}function du(){var t;return((t=oi())===null||t===void 0?void 0:t.name)==="Safari"}function Wm(){const t=oi();return(t==null?void 0:t.name)==="Safari"||(t==null?void 0:t.os)==="iOS"}function ume(){const t=oi();return(t==null?void 0:t.name)==="Safari"&&t.version.startsWith("17.")||(t==null?void 0:t.os)==="iOS"&&!!(t!=null&&t.osVersion)&&Ps(t.osVersion,"17")>=0}function dme(t){return t||(t=oi()),(t==null?void 0:t.name)==="Safari"&&Ps(t.version,"18.3")>0||(t==null?void 0:t.os)==="iOS"&&!!(t!=null&&t.osVersion)&&Ps(t.osVersion,"18.3")>0}function EW(){var t,e;return ni()?(e=(t=navigator.userAgentData)===null||t===void 0?void 0:t.mobile)!==null&&e!==void 0?e:/Tablet|iPad|Mobile|Android|BlackBerry/.test(navigator.userAgent):!1}function hme(){const t=oi(),e="17.2";if(t)return t.name!=="Safari"&&t.os!=="iOS"||t.os==="iOS"&&t.osVersion&&Ps(t.osVersion,e)>=0?!0:t.name==="Safari"&&Ps(t.version,e)>=0}function ni(){return typeof document<"u"}function js(){return navigator.product=="ReactNative"}function jh(t){return t.hostname.endsWith(".livekit.cloud")||t.hostname.endsWith(".livekit.run")}function XS(t){return jh(t)?t.hostname.split(".")[0]:null}function jW(){if(global&&global.LiveKitReactNativeGlobal)return global.LiveKitReactNativeGlobal}function PW(){if(!js())return;let t=jW();if(t)return t.platform}
vendor: 6,284 bytes, line 698
698function f4(){if(ni())return window.devicePixelRatio;if(js()){let t=jW();if(t)return t.devicePixelRatio}return 1}function Ps(t,e){const n=t.split("."),r=e.split("."),i=Math.min(n.length,r.length);for(let a=0;a<i;++a){const s=parseInt(n[a],10),o=parseInt(r[a],10);if(s>o)return 1;if(s<o)return-1;if(a===i-1&&s===o)return 0}return t===""&&e!==""?-1:e===""?1:n.length==r.length?0:n.length<r.length?-1:1}function fme(t){for(const e of t)e.target.handleResize(e)}function pme(t){for(const e of t)e.target.handleVisibilityChanged(e)}let ZS=null;const p4=()=>(ZS||(ZS=new ResizeObserver(fme)),ZS);let QS=null;const m4=()=>(QS||(QS=new IntersectionObserver(pme,{root:null,rootMargin:"0px"})),QS);function mme(){var t;const e=new Cz({sdk:Tz.JS,protocol:Hpe,version:Vpe});return js()&&(e.os=(t=PW())!==null&&t!==void 0?t:""),e}function g4(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:16,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:16,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;const i=document.createElement("canvas");i.width=t,i.height=e;const a=i.getContext("2d");a==null||a.fillRect(0,0,i.width,i.height),r&&a&&(a.beginPath(),a.arc(t/2,e/2,50,0,Math.PI*2,!0),a.closePath(),a.fillStyle="grey",a.fill());const s=i.captureStream(),[o]=s.getTracks();if(!o)throw Error("Could not get empty media stream video track");return o.enabled=n,o}let rp;function ek(){if(!rp){const t=new AudioContext,e=t.createOscillator(),n=t.createGain();n.gain.setValueAtTime(0,0);const r=t.createMediaStreamDestination();if(e.connect(n),n.connect(r),e.start(),[rp]=r.stream.getAudioTracks(),!rp)throw Error("Could not get empty media stream audio track");rp.enabled=!1}return rp.clone()}class Ur{get isResolved(){return this._isResolved}constructor(e,n){this._isResolved=!1,this.onFinally=n,this.promise=new Promise((r,i)=>F(this,void 0,void 0,function*(){this.resolve=r,this.reject=i,e&&(yield e(r,i))})).finally(()=>{var r;this._isResolved=!0,(r=this.onFinally)===null||r===void 0||r.call(this)})}}function gme(t){return Ype.includes(t)}function zl(t){if(typeof t=="string"||typeof t=="number")return t;if(Array.isArray(t))return t[0];if(t.exact!==void 0)return Array.isArray(t.exact)?t.exact[0]:t.exact;if(t.ideal!==void 0)return Array.isArray(t.ideal)?t.ideal[0]:t.ideal;throw Error("could not unwrap constraint")}function vme(t){return t.startsWith("http")?t.replace(/^(http)/,"ws"):t}function Vm(t){return t.startsWith("ws")?t.replace(/^(ws)/,"http"):t}function yme(t,e){return t.segments.map(n=>{let{id:r,text:i,language:a,startTime:s,endTime:o,final:c}=n;var u;const d=(u=e.get(r))!==null&&u!==void 0?u:Date.now(),h=Date.now();return c?e.delete(r):e.set(r,d),{id:r,text:i,startTime:Number.parseInt(s.toString()),endTime:Number.parseInt(o.toString()),final:c,language:a,firstReceivedTime:d,lastReceivedTime:h}})}function bme(t){const{id:e,timestamp:n,message:r,editTimestamp:i}=t;return{id:e,timestamp:Number.parseInt(n.toString()),editTimestamp:i?Number.parseInt(i.toString()):void 0,message:r}}function v4(t){switch(t.reason){case Gt.LeaveRequest:return t.context;case Gt.Cancelled:return Wa.CLIENT_INITIATED;case Gt.NotAllowed:return Wa.USER_REJECTED;case Gt.ServerUnreachable:return Wa.JOIN_FAILURE;default:return Wa.UNKNOWN_REASON}}function Qy(t){return t!==void 0?Number(t):void 0}function ul(t){return t!==void 0?BigInt(t):void 0}function Fd(t){return!!t&&!(t instanceof MediaStreamTrack)&&t.isLocal}function bs(t){return!!t&&t.kind==fe.Kind.Audio}function qc(t){return!!t&&t.kind==fe.Kind.Video}function Ls(t){return Fd(t)&&qc(t)}function Ws(t){return Fd(t)&&bs(t)}function cT(t){return!!t&&!t.isLocal}function xme(t){return!!t&&!t.isLocal}function tk(t){return cT(t)&&qc(t)}function wme(t){return t.isLocal}function Sme(t,e){const n=[];let r=new TextEncoder().encode(t);for(;r.length>e;){let i=e;for(;i>0;){const a=r[i];if(a!==void 0&&(a&192)!==128)break;i--}n.push(r.slice(0,i)),r=r.slice(i)}return r.length>0&&n.push(r),n}function kme(t){var e;const n=t.get("Cache-Control");if(n){const r=(e=n.match(/(?:^|[,\s])max-age=(\d+)/))===null||e===void 0?void 0:e[1];if(r)return parseInt(r,10)}}function lT(){return typeof CompressionStream<"u"}function _me(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const r=Cme(t,e);return n?r:_P(r,"v1")}function Cme(t,e){const n=new URL(vme(t));return e.forEach((r,i)=>{n.searchParams.set(i,r)}),_P(n,"rtc")}function Tme(t){const e=new URL(Vm(t));return _P(e,"validate")}function NW(t){return t.endsWith("/")?t:"".concat(t,"/")}function _P(t,e){return t.pathname="".concat(NW(t.pathname)).concat(e),t}function y4(t){if(typeof t=="string")return JD.fromJson(JSON.parse(t),{ignoreUnknownFields:!0});if(t instanceof ArrayBuffer)return JD.fromBinary(new Uint8Array(t));throw new Error("could not decode websocket message: ".concat(typeof t))}function Eme(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Unknown reason";if(!(t instanceof AbortSignal))return e;const n=t.reason;switch(typeof n){case"string":return n;case"object":return n instanceof Error?n.message:e;default:return"toString"in n?n.toString():e}}const jme=10,ip="lk_e2ee",Pme="LKFrameEncryptionKey",Nme={sharedKey:!1,ratchetSalt:Pme,ratchetWindowSize:8,failureTolerance:jme,keyringSize:16,keySize:128};var Cc;(function(t){t.SetKey="setKey",t.RatchetRequest="ratchetRequest",t.KeyRatcheted="keyRatcheted"})(Cc||(Cc={}));var b4;(function(t){t.KeyRatcheted="keyRatcheted"})(b4||(b4={}));var ac;(function(t){t.ParticipantEncryptionStatusChanged="participantEncryptionStatusChanged",t.EncryptionError="encryptionError"})(ac||(ac={}));var x4;(function(t){t.Error="cryptorError"})(x4||(x4={}));function Ame(){return Ome()||uT()}function uT(){return typeof window.RTCRtpScriptTransform<"u"}function Ome(){return typeof window.RTCRtpSender<"u"&&typeof window.RTCRtpSender.prototype.createEncodedStreams<"u"}function Rme(t){var e,n,r,i,a;if(((e=t.value)===null||e===void 0?void 0:e.case)!=="sipDtmf"&&((n=t.value)===null||n===void 0?void 0:n.case)!=="metrics"&&((r=t.value)===null||r===void 0?void 0:r.case)!=="speaker"&&((i=t.value)===null||i===void 0?void 0:i.case)!=="transcription"&&((a=t.value)===null||a===void 0?void 0:a.case)!=="encryptedPacket")return new yz
698({value:t.value})}class mBe extends ca.EventEmitter{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(),this.latestManuallySetKeyIndex=0,this.onKeyRatcheted=(n,r,i)=>{ft.debug("key ratcheted event received",{ratchetResult:n,participantId:r,keyIndex:i})},this.keyInfoMap=new Map,this.options=Object.assign(Object.assign({},Nme),e),this.on(Cc.KeyRatcheted,this.onKeyRatcheted)}onSetEncryptionKey(e,n,r){const i={key:e,participantIdentity:n,keyIndex:r};if(!this.options.sharedKey&&!n)throw new Error("participant identity needs to be passed for encryption key if sharedKey option is false");this.keyInfoMap.set("".concat(n??"shared","-").concat(r??0),i),r!==void 0&&(this.latestManuallySetKeyIndex=r),this.emit(Cc.SetKey,i,r!==void 0)}getKeys(){return Array.from(this.keyInfoMap.values())}getLatestManuallySetKeyIndex(){return this.latestManuallySetKeyIndex}getOptions(){return this.options}ratchetKey(e,n){this.emit(Cc.RatchetRequest,e,n)}}var w4;(function(t){t[t.InvalidKey=0]="InvalidKey",t[t.MissingKey=1]="MissingKey",t[t.InternalError=2]="InternalError"})(w4||(w4={}));class Dme extends ca.EventEmitter{constructor(e,n){super(),this.decryptDataRequests=new Map,this.encryptDataRequests=new Map,this.onWorkerMessage=r=>{var i,a;const{kind:s,data:o}=r.data;switch(s){case"error":if(ft.error(o.error.message),o.uuid){const d=this.decryptDataRequests.get(o.uuid);if(d!=null&&d.reject){d.reject(o.error);break}const h=this.encryptDataRequests.get(o.uuid);if(h!=null&&h.reject){h.reject(o.error);break}}this.emit(ac.EncryptionError,o.error,o.participantIdentity);break;case"initAck":o.enabled&&this.keyProvider.getKeys().forEach(d=>{this.postKey(d,!1)});break;case"enable":if(o.enabled&&this.keyProvider.getKeys().forEach(d=>{this.postKey(d,!1)}),this.encryptionEnabled!==o.enabled&&o.participantIdentity===((i=this.room)===null||i===void 0?void 0:i.localParticipant.identity))this.emit(ac.ParticipantEncryptionStatusChanged,o.enabled,this.room.localParticipant),this.encryptionEnabled=o.enabled;else if(o.participantIdentity){const d=(a=this.room)===null||a===void 0?void 0:a.getParticipantByIdentity(o.participantIdentity);if(!d)throw TypeError("couldn't set encryption status, participant not found".concat(o.participantIdentity));this.emit(ac.ParticipantEncryptionStatusChanged,o.enabled,d)}break;case"ratchetKey":this.keyProvider.emit(Cc.KeyRatcheted,o.ratchetResult,o.participantIdentity,o.keyIndex);break;case"decryptDataResponse":const c=this.decryptDataRequests.get(o.uuid);c!=null&&c.resolve&&c.resolve(o);break;case"encryptDataResponse":const u=this.encryptDataRequests.get(o.uuid);u!=null&&u.resolve&&u.resolve(o);break}},this.onWorkerError=r=>{ft.error("e2ee worker encountered an error:",{error:r.error}),this.emit(ac.EncryptionError,r.error,void 0)},this.keyProvider=e.keyProvider,this.worker=e.worker,this.encryptionEnabled=!1,this.dataChannelEncryptionEnabled=n}get isEnabled(){return this.encryptionEnabled}get isDataChannelEncryptionEnabled(){return this.isEnabled&&this.dataChannelEncryptionEnabled}
698setup(e){if(!Ame())throw new wP("tried to setup end-to-end encryption on an unsupported browser");if(ft.info("setting up e2ee"),e!==this.room){this.room=e,this.setupEventListeners(e,this.keyProvider);const n={kind:"init",data:{keyProviderOptions:this.keyProvider.getOptions(),loglevel:Tpe.getLevel()}};this.worker&&(ft.info("initializing worker",{worker:this.worker}),this.worker.onmessage=this.onWorkerMessage,this.worker.onerror=this.onWorkerError,this.worker.postMessage(n))}}setParticipantCryptorEnabled(e,n){ft.debug("set e2ee to ".concat(e," for participant ").concat(n)),this.postEnable(e,n)}setSifTrailer(e){!e||e.length===0?ft.warn("ignoring server sent trailer as it's empty"):this.postSifTrailer(e)}setupEngine(e){e.on(ve.RTPVideoMapUpdate,n=>{this.postRTPMap(n)})}setupEventListeners(e,n){e.on(be.TrackPublished,(r,i)=>this.setParticipantCryptorEnabled(r.trackInfo.encryption!==Yt.NONE,i.identity)),e.on(be.ConnectionStateChanged,r=>{r===At.Connected&&e.remoteParticipants.forEach(i=>{i.trackPublications.forEach(a=>{this.setParticipantCryptorEnabled(a.trackInfo.encryption!==Yt.NONE,i.identity)})})}).on(be.TrackUnsubscribed,(r,i,a)=>{var s;const o={kind:"removeTransform",data:{participantIdentity:a.identity,trackId:r.mediaStreamID}};(s=this.worker)===null||s===void 0||s.postMessage(o)}).on(be.TrackSubscribed,(r,i,a)=>{this.setupE2EEReceiver(r,a.identity,i.trackInfo)}).on(be.SignalConnected,()=>{if(!this.room)throw new TypeError("expected room to be present on signal connect");const r=n.getLatestManuallySetKeyIndex();n.getKeys().forEach(i=>{var a;this.postKey(i,r===((a=i.keyIndex)!==null&&a!==void 0?a:0))}),this.setParticipantCryptorEnabled(this.room.localParticipant.isE2EEEnabled,this.room.localParticipant.identity)}),e.localParticipant.on(Ee.LocalSenderCreated,(r,i)=>F(this,void 0,void 0,function*(){this.setupE2EESender(i,r)})),e.localParticipant.on(Ee.LocalTrackPublished,r=>{if(!qc(r.track)||!Wm())return;const i={kind:"updateCodec",data:{trackId:r.track.mediaStreamID,codec:Vp(r.trackInfo.codecs[0].mimeType),participantIdentity:this.room.localParticipant.identity}};this.worker.postMessage(i)}),n.on(Cc.SetKey,(r,i)=>this.postKey(r,i??!0)).on(Cc.RatchetRequest,(r,i)=>this.postRatchetRequest(r,i))}encryptData(e){return F(this,void 0,void 0,function*(){if(!this.worker)throw Error("could not encrypt data, worker is missing");const n=crypto.randomUUID(),r={kind:"encryptDataRequest",data:{uuid:n,payload:e,participantIdentity:this.room.localParticipant.identity}},i=new Ur;return i.onFinally=()=>{this.encryptDataRequests.delete(n)},this.encryptDataRequests.set(n,i),this.worker.postMessage(r),i.promise})}handleEncryptedData(e,n,r,i){if(!this.worker)throw Error("could not handle encrypted data, worker is missing");const a=crypto.randomUUID(),s={kind:"decryptDataRequest",data:{uuid:a,payload:e,iv:n,participantIdentity:r,keyIndex:i}},o=new Ur;return o.onFinally=()=>{this.decryptDataRequests.delete(a)},this.decryptDataRequests.set(a,o),this.worker.postMessage(s),o.promise}postRatchetRequest(e,n){if(!this.worker)throw Error("could not ratchet key, worker is missing");const r={kind:"ratchetRequest",data:{participantIdentity:e,keyIndex:n}};this.worker.postMessage(r)}postKey(e,n){let{key:r,participantIdentity:i,keyIndex:a}=e;var s;if(!this.worker)throw Error("could not set key, worker is missing");const o={kind:"setKey",data:{participantIdentity:i,isPublisher:i===((s=this.room)===null||s===void 0?void 0:s.localParticipant.identity),key:r,keyIndex:a,updateCurrentKeyIndex:n}};this.worker.postMessage(o)}postEnable(e,n){if(this.worker){const r={kind:"enable",data:{enabled:e,participantIdentity:n}};this.worker.postMessage(r)}else throw new ReferenceError("failed to enable e2ee, worker is not ready")}postRTPMap(e){var n;if(!this.worker)throw TypeError("could not post rtp map, worker is missing");if(!(!((n=this.room)===null||n===void 0)&&n.localParticipant.identity))throw TypeError("could not post rtp map, local participant identity is missing");const r={kind:"setRTPMap",data:{map:e,participantIdentity:this.room.localParticipant.identity}};this.worker.postMessage(r)}postSifTrailer(e){if(!this.worker)throw Error("could not post SIF trailer, worker is missing");const n={kind:"setSifTrailer",data:{trailer:e}};this.worker.postMessage(n)}setupE2EEReceiver(e,n,r){if(e.receiver){if(!(r!=null&&r.mimeType)||r.mimeType==="")throw new TypeError("MimeType missing from trackInfo, cannot set up E2EE cryptor");this.handleReceiver(e.receiver,e.mediaStreamID,n,e.kind==="video"?Vp(r.mimeType):void 0)}}setupE2EESender(e,n){if(!Fd(e)||!n){n||ft.warn("early return because sender is not ready");return}this.handleSender(n,e.mediaStreamID,void 0)}handleReceiver(e,n,r,i){return F(this,void 0,void 0,function*(){if(this.worker){if(uT()&&!h4()){const a={kind:"decode",participantIdentity:r,trackId:n,codec:i};e.transform=new RTCRtpScriptTransform(this.worker,a)}else{if(ip in e&&i){const c={kind:"updateCodec",data:{trackId:n,codec:i,participantIdentity:r}};this.worker.postMessage(c);return}let a=e.writableStream,s=e.readableStream;if(!a||!s){const c=e.createEncodedStreams();e.writableStream=c.writable,a=c.writable,e.readableStream=c.readable,s=c.readable}const o={kind:"decode",data:{readableStream:s,writableStream:a,trackId:n,codec:i,participantIdentity:r,isReuse:ip in e}};this.worker.postMessage(o,[s,a])}e[ip]=!0}})}handleSender(e,n,r){var i;if(!(ip in e||!this.worker)){if(!(!((i=this.room)===null||i===void 0)&&i.localParticipant.identity)||this.room.localParticipant.identity==="")throw TypeError("local identity needs to be known in order to set up encrypted sender");if(uT()&&!h4()){ft.info("initialize script transform");const a={kind:"encode",participantIdentity:this.room.localParticipant.identity,trackId:n,codec:r};e.transform=new RTCRtpScriptTransform(this.worker,a)}else{ft.info("initialize encoded streams");const a=e.createEncodedStreams(),s={kind:"encode",data:{readableStream:a.readable,writableStream:a.writable,codec:r,trackId:n,participantIdentity:this.room.localParticipant.identity,isReuse:!1}};this.worker.postMessage(s,[a.readable,a.writable])}e[ip]=!0}}}const Mme=500,Ime=15e3;class Bd{constructor(){this.failedConnectionAttempts=new Map,this.backOffPromises=new Map}static getInstance(){return this._instance||(this._instance=new Bd),this._instance}addFailedConnectionAttempt(e){var n;
698const r=new URL(e),i=XS(r);if(!i)return;let a=(n=this.failedConnectionAttempts.get(i))!==null&&n!==void 0?n:0;this.failedConnectionAttempts.set(i,a+1),this.backOffPromises.set(i,Nr(Math.min(Mme*Math.pow(2,a),Ime)))}getBackOffPromise(e){const n=new URL(e),r=n&&XS(n);return r&&this.backOffPromises.get(r)||Promise.resolve()}resetFailedConnectionAttempts(e){const n=new URL(e),r=n&&XS(n);r&&(this.failedConnectionAttempts.set(r,0),this.backOffPromises.set(r,Promise.resolve()))}resetAll(){this.backOffPromises.clear(),this.failedConnectionAttempts.clear()}}Bd._instance=null;const nk="default";class cr{constructor(){this._previousDevices=[]}static getInstance(){return this.instance===void 0&&(this.instance=new cr),this.instance}get previousDevices(){return this._previousDevices}getDevices(e){return F(this,arguments,void 0,function(n){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){var a;if(((a=cr.userMediaPromiseMap)===null||a===void 0?void 0:a.size)>0){ft.debug("awaiting getUserMedia promise");try{n?yield cr.userMediaPromiseMap.get(n):yield Promise.all(cr.userMediaPromiseMap.values())}catch{ft.warn("error waiting for media permissons")}}let s=yield navigator.mediaDevices.enumerateDevices();if(i&&!(du()&&r.hasDeviceInUse(n))&&(s.filter(c=>c.kind===n).length===0||s.some(c=>{const u=c.label==="",d=n?c.kind===n:!0;return u&&d}))){const c={video:n!=="audioinput"&&n!=="audiooutput",audio:n!=="videoinput"&&{deviceId:{ideal:"default"}}},u=yield navigator.mediaDevices.getUserMedia(c);s=yield navigator.mediaDevices.enumerateDevices(),u.getTracks().forEach(d=>{d.stop()})}return r._previousDevices=s,n&&(s=s.filter(o=>o.kind===n)),s}()})}normalizeDeviceId(e,n,r){return F(this,void 0,void 0,function*(){if(n!==nk)return n;const i=yield this.getDevices(e),a=i.find(o=>o.deviceId===nk);if(!a){ft.warn("could not reliably determine default device");return}const s=i.find(o=>o.deviceId!==nk&&o.groupId===(r??a.groupId));if(!s){ft.warn("could not reliably determine default device");return}return s==null?void 0:s.deviceId})}hasDeviceInUse(e){return e?cr.userMediaPromiseMap.has(e):cr.userMediaPromiseMap.size>0}}cr.mediaDeviceKinds=["audioinput","audiooutput","videoinput"];cr.userMediaPromiseMap=new Map;const CP=65535,AW=4294967295;class Va{static u16(e){return new Va(e,CP)}static u32(e){return new Va(e,AW)}constructor(e,n){if(this.value=e,e<0)throw new Error("WrapAroundUnsignedInt: cannot faithfully represent an integer smaller than 0");if(n>Number.MAX_SAFE_INTEGER)throw new Error("WrapAroundUnsignedInt: cannot faithfully represent an integer bigger than MAX_SAFE_INTEGER.");this.maxSize=n,this.clamp()}clamp(){for(;this.value>this.maxSize;)this.value-=this.maxSize+1;for(;this.value<0;)this.value+=this.maxSize+1}clone(){return new Va(this.value,this.maxSize)}update(e){this.value=e(this.value),this.clamp()}increment(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.update(n=>n+e)}decrement(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.update(n=>n-e)}getThenIncrement(){const e=this.value;return this.increment(),new Va(e,this.maxSize)}isBefore(e){const n=this.value>>>0,i=(e.value>>>0)-n>>>0;return i!==0&&i<this.maxSize+1}}class Ud{static fromRtpTicks(e){return new Ud(e,9e4)}static rtpRandom(){const e=Math.round(Math.random()*AW);return Ud.fromRtpTicks(e)}constructor(e,n){this.timestamp=Va.u32(e),this.rateInHz=n}asTicks(){return this.timestamp.value}clone(){return new Ud(this.timestamp.value,this.rateInHz)}wrappingAdd(e){this.timestamp.increment(e)}isBefore(e){return this.timestamp.isBefore(e.timestamp)}}class xl{constructor(e,n,r){this.epoch=n,this.base=r,this.previous=r.clone(),this.rateInHz=e}static startingNow(e,n){return new xl(n,new Date,e)}static startingAtTime(e,n,r){return new xl(r,e,n)}static rtpStartingNow(e){return xl.startingNow(e,9e4)}static rtpStartingAtTime(e,n){return xl.startingAtTime(e,n,9e4)}now(){return this.at(new Date)}at(e){let n=e.getTime()-this.epoch.getTime(),r=xl.durationInMsToTicks(n,this.rateInHz),i=this.base.clone();return i.wrappingAdd(r),i.isBefore(this.previous)&&(i=this.previous),this.previous=i.clone(),i.clone()}static durationInMsToTicks(e,n){let i=(e*1e6*n+5e8)/1e9;return Math.round(i)}}function TP(t){if(t instanceof DataView)return t;if(t instanceof ArrayBuffer)return new DataView(t);if(t instanceof Uint8Array)return new DataView(t.buffer,t.byteOffset,t.byteLength);throw new Error("Error coercing ".concat(t," to DataView - input was not DataView, ArrayBuffer, or Uint8Array."))}var Wl;(function(t){t[t.Reserved=0]="Reserved",t[t.TooLarge=1]="TooLarge"})(Wl||(Wl={}));class Ph extends la{constructor(e,n){super(19,e),this.name="DataTrackHandleError",this.reason=n,this.reasonName=Wl[n]}isReason(e){return this.reason===e}static tooLarge(){return new Ph("Value too large to be a valid track handle",Wl.TooLarge)}static reserved(e){return new Ph("0x".concat(e.toString(16)," is a reserved value."),Wl.Reserved)}}const Lme={fromNumber(t){if(t===0)throw Ph.reserved(t);if(t>CP)throw Ph.tooLarge();return t}};class $me{constructor(){this.value=0}get(){return this.value+=1,this.value>CP?null:this.value}}const ab={from(t){return{sid:t.sid,pubHandle:t.pubHandle,name:t.name,usesE2ee:t.encryption!==Yt.NONE}},toProtobuf(t){return new kw({sid:t.sid,pubHandle:t.pubHandle,name:t.name,encryption:t.usesE2ee?Yt.GCM:Yt.NONE})}};var Hp;(function(t){t[t.WAITING=0]="WAITING",t[t.RUNNING=1]="RUNNING",t[t.COMPLETED=2]="COMPLETED"})(Hp||(Hp={}));class Fme{constructor(){this.pendingTasks=new Map,this.taskMutex=new gr,this.nextTaskIndex=0}run(e){return F(this,void 0,void 0,function*(){const n={id:this.nextTaskIndex++,enqueuedAt:Date.now(),status:Hp.WAITING};this.pendingTasks.set(n.id,n);const r=yield this.taskMutex.lock();try{return n.executedAt=Date.now(),n.status=Hp.RUNNING,yield e()}finally{n.status=Hp.COMPLETED,this.pendingTasks.delete(n.id),r()}})}flush(){return F(this,void 0,void 0,function*(){return this.run(()=>F(this,void 0,void 0,function*(){}))})}
698snapshot(){return Array.from(this.pendingTasks.values())}}class Bme{get readyState(){return this.ws.readyState}constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r,i;if(!((r=n.signal)===null||r===void 0)&&r.aborted)throw new DOMException("This operation was aborted","AbortError");this.url=e;const a=new WebSocket(e,(i=n.protocols)!==null&&i!==void 0?i:[]);a.binaryType="arraybuffer",this.ws=a;const s=function(){let{closeCode:o,reason:c}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return a.close(o,c)};this.opened=new jr((o,c)=>{const u=()=>{c(Ge.websocket("Encountered websocket error during connection establishment"))};a.onopen=()=>{o({readable:new ReadableStream({start(d){a.onmessage=h=>{let{data:f}=h;return d.enqueue(f)},a.onerror=h=>d.error(h)},cancel:s}),writable:new WritableStream({write(d){a.send(d)},abort(){a.close()},close:s}),protocol:a.protocol,extensions:a.extensions}),a.removeEventListener("error",u)},a.addEventListener("error",u)}),this.closed=new jr((o,c)=>{const u=()=>F(this,void 0,void 0,function*(){const d=new jr(f=>{a.readyState!==WebSocket.CLOSED&&a.addEventListener("close",p=>{f(p)},{once:!0})}),h=yield jr.race([Nr(250),d]);h?o(h):c(Ge.websocket("Encountered unspecified websocket error without a timely close event"))});a.onclose=d=>{let{code:h,reason:f}=d;o({closeCode:h,reason:f}),a.removeEventListener("error",u)},a.addEventListener("error",u)}),n.signal&&(n.signal.onabort=()=>a.close()),this.close=s}}const Ume=["syncState","trickle","offer","answer","simulate","leave"];function zme(t){const e=Ume.indexOf(t.case)>=0;return ft.trace("request allowed to bypass queue:",{canPass:e,req:t}),e}var Kt;(function(t){t[t.CONNECTING=0]="CONNECTING",t[t.CONNECTED=1]="CONNECTED",t[t.RECONNECTING=2]="RECONNECTING",t[t.DISCONNECTING=3]="DISCONNECTING",t[t.DISCONNECTED=4]="DISCONNECTED"})(Kt||(Kt={}));const Wme=250;class EP{get currentState(){return this.state}get isDisconnected(){return this.state===Kt.DISCONNECTING||this.state===Kt.DISCONNECTED}get isEstablishingConnection(){return this.state===Kt.CONNECTING||this.state===Kt.RECONNECTING}getNextRequestId(){return this._requestId+=1,this._requestId}constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r;this.rtt=0,this.state=Kt.DISCONNECTED,this.log=ft,this._requestId=0,this.useV0SignalPath=!1,this.resetCallbacks=()=>{this.onAnswer=void 0,this.onLeave=void 0,this.onLocalTrackPublished=void 0,this.onLocalTrackUnpublished=void 0,this.onNegotiateRequested=void 0,this.onOffer=void 0,this.onRemoteMuteChanged=void 0,this.onSubscribedQualityUpdate=void 0,this.onTokenRefresh=void 0,this.onTrickle=void 0,this.onClose=void 0,this.onMediaSectionsRequirement=void 0},this.log=li((r=n.loggerName)!==null&&r!==void 0?r:Rr.Signal),this.loggerContextCb=n.loggerContextCb,this.useJSON=e,this.requestQueue=new Fme,this.queuedRequests=[],this.closingLock=new gr,this.connectionLock=new gr,this.state=Kt.DISCONNECTED}get logContext(){var e,n;return(n=(e=this.loggerContextCb)===null||e===void 0?void 0:e.call(this))!==null&&n!==void 0?n:{}}join(e,n,r,i){return F(this,arguments,void 0,function(a,s,o,c){var u=this;let d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,h=arguments.length>5?arguments[5]:void 0;return function*(){return u.state=Kt.CONNECTING,u.options=o,yield u.connect(a,s,o,c,d,h)}()})}reconnect(e,n,r,i){return F(this,void 0,void 0,function*(){if(!this.options){this.log.warn("attempted to reconnect without signal options being set, ignoring",this.logContext);return}return this.state=Kt.RECONNECTING,this.clearPingInterval(),yield this.connect(e,n,Object.assign(Object.assign({},this.options),{reconnect:!0,sid:r,reconnectReason:i}),void 0,this.useV0SignalPath)})}connect(e,n,r,i){return F(this,arguments,void 0,function(a,s,o,c){var u=this;let d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,h=arguments.length>5?arguments[5]:void 0;return function*(){const f=yield u.connectionLock.lock();u.connectOptions=o,u.useV0SignalPath=d;
698const p=mme(),g=d?Vme(s,p,o):yield Hme(s,p,o,h),m=_me(a,g,d).toString(),v=Tme(m).toString();return new Promise((x,w)=>F(u,void 0,void 0,function*(){var y,k;try{let S=!1;const _=P=>F(this,void 0,void 0,function*(){if(S)return;S=!0;const M=P instanceof Event?P.currentTarget:P,U=Eme(M,"Abort handler called");this.streamWriter&&!this.isDisconnected?this.sendLeave().then(()=>this.close(U)).catch(N=>{this.log.error(N),this.close()}):this.close(),C(),w(Ge.cancelled(U))});c==null||c.addEventListener("abort",_);const C=()=>{clearTimeout(T),c==null||c.removeEventListener("abort",_)},T=setTimeout(()=>{_(Ge.timeout("room connection has timed out (signal)"))},o.websocketTimeout),E=(P,M)=>{this.handleSignalConnected(P,T,M)},j=new URL(m);j.searchParams.has("access_token")&&j.searchParams.set("access_token","<redacted>"),this.log.debug("connecting to ".concat(j),Object.assign({reconnect:o.reconnect,reconnectReason:o.reconnectReason},this.logContext)),this.ws&&(yield this.close(!1)),this.ws=new Bme(m);try{this.ws.closed.then(I=>{var R;this.isEstablishingConnection&&w(Ge.internal("Websocket got closed during a (re)connection attempt: ".concat(I.reason))),I.closeCode!==1e3&&(this.log.warn("websocket closed",Object.assign(Object.assign({},this.logContext),{reason:I.reason,code:I.closeCode,wasClean:I.closeCode===1e3,state:this.state})),this.state===Kt.CONNECTED&&this.handleOnClose((R=I.reason)!==null&&R!==void 0?R:"Unexpected WS error"))}).catch(I=>{this.isEstablishingConnection&&w(Ge.internal("Websocket error during a (re)connection attempt: ".concat(I)))});const P=yield this.ws.opened.catch(I=>F(this,void 0,void 0,function*(){if(this.state!==Kt.CONNECTED){this.state=Kt.DISCONNECTED,clearTimeout(T);const R=yield this.handleConnectionError(I,v);w(R);return}this.handleWSError(I),w(I)}));if(clearTimeout(T),!P)return;const M=P.readable.getReader();this.streamWriter=P.writable.getWriter();const U=yield M.read();if(M.releaseLock(),!U.value)throw Ge.internal("no message received as first message");const N=y4(U.value),B=this.validateFirstMessage(N,(y=o.reconnect)!==null&&y!==void 0?y:!1);if(!B.isValid){w(B.error);return}((k=N.message)===null||k===void 0?void 0:k.case)==="join"&&(this.pingTimeoutDuration=N.message.value.pingTimeout,this.pingIntervalDuration=N.message.value.pingInterval,this.pingTimeoutDuration&&this.pingTimeoutDuration>0&&this.log.debug("ping config",Object.assign(Object.assign({},this.logContext),{timeout:this.pingTimeoutDuration,interval:this.pingIntervalDuration})),this.onJoined&&this.onJoined(N.message.value));const $=B.shouldProcessFirstMessage?N:void 0;E(P,$),x(B.response)}catch(P){w(P)}finally{C()}}finally{f()}}))}()})}startReadingLoop(e,n){return F(this,void 0,void 0,function*(){for(n&&this.handleSignalResponse(n);;){this.signalLatency&&(yield Nr(this.signalLatency));const{done:r,value:i}=yield e.read();if(r)break;const a=y4(i);
698this.handleSignalResponse(a)}})}close(){return F(this,arguments,void 0,function(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Close method called on signal client";return function*(){if([Kt.DISCONNECTING||Kt.DISCONNECTED].includes(e.state)){e.log.debug("ignoring signal close as it's already in disconnecting state");return}const i=yield e.closingLock.lock();try{if(e.clearPingInterval(),n&&(e.state=Kt.DISCONNECTING),e.ws){e.ws.close({closeCode:1e3,reason:r});const a=e.ws.closed;e.ws=void 0,e.streamWriter=void 0,yield Promise.race([a,Nr(Wme)])}}catch(a){e.log.debug("websocket error while closing",Object.assign(Object.assign({},e.logContext),{error:a}))}finally{n&&(e.state=Kt.DISCONNECTED),i()}}()})}sendOffer(e,n){this.log.debug("sending offer",Object.assign(Object.assign({},this.logContext),{offerSdp:e.sdp})),this.sendRequest({case:"offer",value:wl(e,n)})}sendAnswer(e,n){return this.log.debug("sending answer",Object.assign(Object.assign({},this.logContext),{answerSdp:e.sdp})),this.sendRequest({case:"answer",value:wl(e,n)})}sendIceCandidate(e,n){return this.log.debug("sending ice candidate",Object.assign(Object.assign({},this.logContext),{candidate:e})),this.sendRequest({case:"trickle",value:new _w({candidateInit:JSON.stringify(e),target:n})})}sendMuteTrack(e,n){return this.sendRequest({case:"mute",value:new Cw({sid:e,muted:n})})}sendAddTrack(e){return this.sendRequest({case:"addTrack",value:e})}sendUpdateLocalMetadata(e,n){return F(this,arguments,void 0,function(r,i){var a=this;let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){const o=a.getNextRequestId();return yield a.sendRequest({case:"updateMetadata",value:new gP({requestId:o,metadata:r,name:i,attributes:s})}),o}()})}sendUpdateTrackSettings(e){this.sendRequest({case:"trackSetting",value:e})}sendUpdateSubscription(e){return this.sendRequest({case:"subscription",value:e})}sendSyncState(e){return this.sendRequest({case:"syncState",value:e})}sendUpdateVideoLayers(e,n){return this.sendRequest({case:"updateLayers",value:new Mz({trackSid:e,layers:n})})}sendUpdateSubscriptionPermissions(e,n){return this.sendRequest({case:"subscriptionPermission",value:new $z({allParticipants:e,trackPermissions:n})})}sendSimulateScenario(e){return this.sendRequest({case:"simulate",value:e})}sendPing(){return Promise.all([this.sendRequest({case:"ping",value:mn.parse(Date.now())}),this.sendRequest({case:"pingReq",value:new Uz({timestamp:mn.parse(Date.now()),rtt:mn.parse(this.rtt)})})])}sendUpdateLocalAudioTrack(e,n){return this.sendRequest({case:"updateAudioTrack",value:new mP({trackSid:e,features:n})})}sendLeave(){return this.sendRequest({case:"leave",value:new Ew({reason:Wa.CLIENT_INITIATED,action:Id.DISCONNECT})})}sendPublishDataTrackRequest(e,n,r){return this.sendRequest({case:"publishDataTrackRequest",value:new dP({pubHandle:e,name:n,encryption:r?Yt.GCM:Yt.NONE})})}sendUnPublishDataTrackRequest(e){return this.sendRequest({case:"unpublishDataTrackRequest",value:new fP({pubHandle:e})})}sendUpdateDataSubscription(e,n){return this.sendRequest({case:"updateDataSubscription",value:new Az({updates:[new Oz({trackSid:e,subscribe:n})]})})}sendRequest(e){return F(this,arguments,void 0,function(n){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return function*(){if(!i&&!zme(n)&&r.state===Kt.RECONNECTING){r.queuedRequests.push(()=>F(r,void 0,void 0,function*(){yield this.sendRequest(n,!0)}));return}if(i||(yield r.requestQueue.flush()),r.signalLatency&&(yield Nr(r.signalLatency)),r.isDisconnected){r.log.debug("skipping signal request (type: ".concat(n.case,") - SignalClient disconnected"));return}if(!r.streamWriter){r.log.error("cannot send signal request before connected, type: ".concat(n==null?void 0:n.case),r.logContext);return}const s=new Yfe({message:n});try{r.useJSON?yield r.streamWriter.write(s.toJsonString()):yield r.streamWriter.write(s.toBinary())}catch(o){r.log.error("error sending signal message",Object.assign(Object.assign({},r.logContext),{error:o}))}}()})}handleSignalResponse(e){var n,r;const i=e.message;if(i==null){this.log.debug("received unsupported message",this.logContext);return}let a=!1;if(i.case==="answer"){const s=S4(i.value);this.onAnswer&&this.onAnswer(s,i.value.id,i.value.midToTrackId)}else if(i.case==="offer"){const s=S4(i.value);this.onOffer&&this.onOffer(s,i.value.id,i.value.midToTrackId)}else if(i.case==="trickle"){const s=JSON.parse(i.value.candidateInit);this.onTrickle&&this.onTrickle(s,i.value.target)}else i.case==="update"?this.onParticipantUpdate&&this.onParticipantUpdate((n=i.value.participants)!==null&&n!==void 0?n:[]):i.case==="trackPublished"?this.onLocalTrackPublished&&this.onLocalTrackPublished(i.value):i.case==="speakersChanged"?this.onSpeakersChanged&&this.onSpeakersChanged((r=i.value.speakers)!==null&&r!==void 0?r:[]):i.case==="leave"?this.onLeave&&this.onLeave(i.value):i.case==="mute"?this.onRemoteMuteChanged&&this.onRemoteMuteChanged(i.value.sid,i.value.muted):i.case==="roomUpdate"?this.onRoomUpdate&&i.value.room&&this.onRoomUpdate(i.value.room):i.case==="connectionQuality"?this.onConnectionQuality&&this.onConnectionQuality(i.value):i.case==="streamStateUpdate"?this.onStreamStateUpdate&&this.onStreamStateUpdate(i.value):i.case==="subscribedQualityUpdate"?this.onSubscribedQualityUpdate&&this.onSubscribedQualityUpdate(i.value):i.case==="subscriptionPermissionUpdate"?this.onSubscriptionPermissionUpdate&&this.onSubscriptionPermissionUpdate(i.value):i.case==="refreshToken"?this.onTokenRefresh&&this.onTokenRefresh(i.value):i.case==="trackUnpublished"?this.onLocalTrackUnpublished&&this.onLocalTrackUnpublished(i.value):i.case==="subscriptionResponse"?this.onSubscriptionError&&this.onSubscriptionError(i.value):i.case==="pong"||(i.case==="pongResp"?(this.rtt=Date.now()-Number.parseInt(i.value.lastPingTimestamp.toString()),this.resetPingTimeout(),a=!0):i.case==="requestResponse"?this.onRequestResponse&&this.onRequestResponse(i.value):i.case==="trackSubscribed"?this.onLocalTrackSubscribed&&this.onLocalTrackSubscribed(i.value.trackSid):i.case==="roomMoved"?(this.onTokenRefresh&&this.onTokenRefresh(i.value.token),this.onRoomMoved&&this.onRoomMoved(i.value)):i.case==="mediaSectionsRequirement"?this.onMediaSectionsRequirement&&this.onMediaSectionsRequirement
698(i.value):i.case==="publishDataTrackResponse"?this.onPublishDataTrackResponse&&this.onPublishDataTrackResponse(i.value):i.case==="unpublishDataTrackResponse"?this.onUnPublishDataTrackResponse&&this.onUnPublishDataTrackResponse(i.value):i.case==="dataTrackSubscriberHandles"?this.onDataTrackSubscriberHandles&&this.onDataTrackSubscriberHandles(i.value):this.log.debug("unsupported message",Object.assign(Object.assign({},this.logContext),{msgCase:i.case})));a||this.resetPingTimeout()}setReconnected(){for(;this.queuedRequests.length>0;){const e=this.queuedRequests.shift();e&&this.requestQueue.run(e)}}handleOnClose(e){return F(this,void 0,void 0,function*(){if(this.state===Kt.DISCONNECTED)return;const n=this.onClose;yield this.close(void 0,e),this.log.debug("websocket connection closed: ".concat(e),Object.assign(Object.assign({},this.logContext),{reason:e})),n&&n(e)})}handleWSError(e){this.log.error("websocket error",Object.assign(Object.assign({},this.logContext),{error:e}))}resetPingTimeout(){if(this.clearPingTimeout(),!this.pingTimeoutDuration){this.log.warn("ping timeout duration not set",this.logContext);return}this.pingTimeout=Vn.setTimeout(()=>{this.log.warn("ping timeout triggered. last pong received at: ".concat(new Date(Date.now()-this.pingTimeoutDuration*1e3).toUTCString()),this.logContext),this.handleOnClose("ping timeout")},this.pingTimeoutDuration*1e3)}clearPingTimeout(){this.pingTimeout&&Vn.clearTimeout(this.pingTimeout)}startPingInterval(){if(this.clearPingInterval(),this.resetPingTimeout(),!this.pingIntervalDuration){this.log.warn("ping interval duration not set",this.logContext);return}this.log.debug("start ping interval",this.logContext),this.pingInterval=Vn.setInterval(()=>{this.sendPing()},this.pingIntervalDuration*1e3)}clearPingInterval(){this.log.debug("clearing ping interval",this.logContext),this.clearPingTimeout(),this.pingInterval&&Vn.clearInterval(this.pingInterval)}handleSignalConnected(e,n,r){this.state=Kt.CONNECTED,clearTimeout(n),this.startPingInterval(),this.startReadingLoop(e.readable.getReader(),r)}validateFirstMessage(e,n){var r,i,a,s,o;return((r=e.message)===null||r===void 0?void 0:r.case)==="join"?{isValid:!0,response:e.message.value}:this.state===Kt.RECONNECTING&&((i=e.message)===null||i===void 0?void 0:i.case)!=="leave"?((a=e.message)===null||a===void 0?void 0:a.case)==="reconnect"?{isValid:!0,response:e.message.value}:(this.log.debug("declaring signal reconnected without reconnect response received",this.logContext),{isValid:!0,response:void 0,shouldProcessFirstMessage:!0}):this.isEstablishingConnection&&((s=e.message)===null||s===void 0?void 0:s.case)==="leave"?{isValid:!1,error:Ge.leaveRequest("Received leave request while trying to (re)connect",e.message.value.reason)}:n?{isValid:!1,error:Ge.internal("Unexpected first message")}:{isValid:!1,error:Ge.internal("did not receive join response, got ".concat((o=e.message)===null||o===void 0?void 0:o.case," instead"))}}handleConnectionError(e,n){return F(this,void 0,void 0,function*(){try{const r=yield fetch(n);switch(r.status){case 404:const i=yield r.text();return i.includes("requested room does not exist")?Ge.notAllowed(i,r.status):Ge.serviceNotFound("v1 RTC path not found. Consider upgrading your LiveKit server version","v0-rtc");case 401:case 403:const a=yield r.text();return Ge.notAllowed(a,r.status);default:break}return e instanceof Ge?e:Ge.internal("Encountered unknown websocket error during connection: ".concat(e),{status:r.status,statusText:r.statusText})}catch(r){return r instanceof Ge?r:Ge.serverUnreachable(r instanceof Error?r.message:"server was not reachable")}})}}function S4(t){const e={type:"offer",sdp:t.sdp};switch(t.type){case"answer":case"offer":case"pranswer":case"rollback":e.type=t.type;break}return e}function wl(t,e){return new Mc({sdp:t.sdp,type:t.type,id:e})}function Vme(t,e,n){var r;const i=new URLSearchParams;return i.set("access_token",t),n.reconnect&&(i.set("reconnect","1"),n.sid&&i.set("sid",n.sid)),i.set("auto_subscribe",n.autoSubscribe?"1":"0"),i.set("sdk",js()?"reactnative":"js"),i.set("version",e.version),i.set("protocol",e.protocol.toString()),e.deviceModel&&i.set("device_model",e.deviceModel),e.os&&i.set("os",e.os),e.osVersion&&i.set("os_version",e.osVersion),e.browser&&i.set("browser",e.browser),e.browserVersion&&i.set("browser_version",e.browserVersion),n.adaptiveStream&&i.set("adaptive_stream","1"),n.reconnectReason&&i.set("reconnect_reason",n.reconnectReason.toString()),!((r=navigator.connection)===null||r===void 0)&&r.type&&i.set("network",navigator.connection.type),i}function Hme(t,e,n,r){return F(this,void 0,void 0,function*(){const i=new URLSearchParams;i.set("access_token",t);const a=new xpe({clientInfo:e,connectionSettings:new zz({autoSubscribe:!!n.autoSubscribe,adaptiveStream:!!n.adaptiveStream}),reconnect:!!n.reconnect,participantSid:n.sid?n.sid:void 0,publisherOffer:r});n.reconnectReason&&(a.reconnectReason=n.reconnectReason);const s=a.toBinary();let o,c;
698if(lT()){const f=new CompressionStream("gzip"),p=f.writable.getWriter();p.write(new Uint8Array(s)),p.close();const g=[],m=f.readable.getReader();for(;;){const{done:y,value:k}=yield m.read();if(y)break;g.push(k)}const v=g.reduce((y,k)=>y+k.length,0),x=new Uint8Array(v);let w=0;for(const y of g)x.set(y,w),w+=y.length;o=x,c=qC.GZIP}else o=s,c=qC.NONE;const d=new wpe({joinRequest:o,compression:c}).toBinary(),h=f=>{const p=Array.from(f,g=>String.fromCodePoint(g)).join("");return btoa(p)};return i.set("join_request",h(d).replace(/\+/g,"-").replace(/\//g,"_")),i})}class k4{constructor(){this.buffer=[],this._totalSize=0}push(e){this.buffer.push(e),this._totalSize+=e.data.byteLength}pop(){const e=this.buffer.shift();return e&&(this._totalSize-=e.data.byteLength),e}getAll(){return this.buffer.slice()}popToSequence(e){for(;this.buffer.length>0&&this.buffer[0].sequence<=e;)this.pop()}alignBufferedAmount(e){for(;this.buffer.length>0;){const n=this.buffer[0];if(this._totalSize-n.data.byteLength<=e)break;this.pop()}}get length(){return this.buffer.length}}class qme{constructor(e){this._map=new Map,this._lastCleanup=0,this.ttl=e}set(e,n){const r=Date.now();r-this._lastCleanup>this.ttl/2&&this.cleanup();const i=r+this.ttl;return this._map.set(e,{value:n,expiresAt:i}),this}get(e){const n=this._map.get(e);if(n){if(n.expiresAt<Date.now()){this._map.delete(e);return}return n.value}}has(e){const n=this._map.get(e);return n?n.expiresAt<Date.now()?(this._map.delete(e),!1):!0:!1}delete(e){return this._map.delete(e)}clear(){this._map.clear()}cleanup(){const e=Date.now();for(const[n,r]of this._map.entries())r.expiresAt<e&&this._map.delete(n);this._lastCleanup=e}get size(){return this.cleanup(),this._map.size}forEach(e){this.cleanup();for(const[n,r]of this._map.entries())r.expiresAt>=Date.now()&&e(r.value,n,this.asValueMap())}map(e){this.cleanup();const n=[],r=this.asValueMap();for(const[i,a]of r.entries())n.push(e(a,i,r));return n}asValueMap(){const e=new Map;for(const[n,r]of this._map.entries())r.expiresAt>=Date.now()&&e.set(n,r.value);return e}}var ga={},rk={},ik={exports:{}},_4;function jP(){if(_4)return ik.exports;_4=1;var t=ik.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(e){return e.encoding?"rtpmap:%d %s/%s/%s":e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(e){return e.address!=null?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(e){return e.subtype!=null?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(e){return"extmap:%d"+(e.direction?"/%s":"%v")+(e["encrypt-uri"]?" %s":"%v")+" %s"+(e.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(e){return e.sessionConfig!=null?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(e){var n="candidate:%s %d %s %d %s %d typ %s";return n+=e.raddr!=null?" raddr %s rport %d":"%v%v",n+=e.tcptype!=null?" tcptype %s":"%v",e.generation!=null&&(n+=" generation %d"),n+=e["network-id"]!=null?" network-id %d":"%v",n+=e["network-cost"]!=null?" network-cost %d":"%v",n}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(e){var n="ssrc:%d";return e.attribute!=null&&(n+=" %s",e.value!=null&&(n+=":%s")),n}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","max
698MessageSize"],format:function(e){return e.maxMessageSize!=null?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(e){return e.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(e){return"imageattr:%s %s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(e){return"simulcast:%s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(e){return"ts-refclk:%s"+(e.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(e){var n="mediaclk:";return n+=e.id!=null?"id=%s %s":"%v%s",n+=e.mediaClockValue!=null?"=%s":"",n+=e.rateNumerator!=null?" rate=%s":"",n+=e.rateDenominator!=null?"/%s":"",n}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};return Object.keys(t).forEach(function(e){var n=t[e];n.forEach(function(r){r.reg||(r.reg=/(.*)/),r.format||(r.format="%s")})}),ik.exports}var C4;function Kme(){return C4||(C4=1,function(t){var e=function(o){return String(Number(o))===o?Number(o):o},n=function(o,c,u,d){if(d&&!u)c[d]=e(o[1]);else for(var h=0;h<u.length;h+=1)o[h+1]!=null&&(c[u[h]]=e(o[h+1]))},r=function(o,c,u){var d=o.name&&o.names;o.push&&!c[o.push]?c[o.push]=[]:d&&!c[o.name]&&(c[o.name]={});var h=o.push?{}:d?c[o.name]:c;n(u.match(o.reg),h,o.names,o.name),o.push&&c[o.push].push(h)},i=jP(),a=RegExp.prototype.test.bind(/^([a-z])=(.*)/);t.parse=function(o){var c={},u=[],d=c;return o.split(/(\r\n|\r|\n)/).filter(a).forEach(function(h){var f=h[0],p=h.slice(2);f==="m"&&(u.push({rtp:[],fmtp:[]}),d=u[u.length-1]);for(var g=0;g<(i[f]||[]).length;g+=1){var m=i[f][g];if(m.reg.test(p))return r(m,d,p)}}),c.media=u,c};var s=function(o,c){var u=c.split(/=(.+)/,2);return u.length===2?o[u[0]]=e(u[1]):u.length===1&&c.length>1&&(o[u[0]]=void 0),o};t.parseParams=function(o){return o.split(/;\s?/).reduce(s,{})},t.parseFmtpConfig=t.parseParams,t.parsePayloads=function(o){return o.toString().split(" ").map(Number)},t.parseRemoteCandidates=function(o){for(var c=[],u=o.split(" ").map(e),d=0;d<u.length;d+=3)c.push({component:u[d],ip:u[d+1],port:u[d+2]});return c},t.parseImageAttributes=function(o){return o.split(" ").map(function(c){return c.substring(1,c.length-1).split(",").reduce(s,{})})},t.parseSimulcastStreamList=function(o){return o.split(";").map(function(c){return c.split(",").map(function(u){var d,h=!1;return u[0]!=="~"?d=e(u):(d=e(u.substring(1,u.length)),h=!0),{scid:d,paused:h}})})}}(rk)),rk}var ak,T4;function Gme(){if(T4)return ak;T4=1;var t=jP(),e=/%[sdv%]/g,n=function(s){var o=1,c=arguments,u=c.length;return s.replace(e,function(d){if(o>=u)return d;var h=c[o];switch(o+=1,d){case"%%":return"%";case"%s":return String(h);case"%d":return Number(h);case"%v":return""}})}
698,r=function(s,o,c){var u=o.format instanceof Function?o.format(o.push?c:c[o.name]):o.format,d=[s+"="+u];if(o.names)for(var h=0;h<o.names.length;h+=1){var f=o.names[h];o.name?d.push(c[o.name][f]):d.push(c[o.names[h]])}else d.push(c[o.name]);return n.apply(null,d)},i=["v","o","s","i","u","e","p","c","b","t","r","z","a"],a=["i","c","b","a"];return ak=function(s,o){o=o||{},s.version==null&&(s.version=0),s.name==null&&(s.name=" "),s.media.forEach(function(h){h.payloads==null&&(h.payloads="")});var c=o.outerOrder||i,u=o.innerOrder||a,d=[];return c.forEach(function(h){t[h].forEach(function(f){f.name in s&&s[f.name]!=null?d.push(r(h,f,s)):f.push in s&&s[f.push]!=null&&s[f.push].forEach(function(p){d.push(r(h,f,p))})})}),s.media.forEach(function(h){d.push(r("m",t.m[0],h)),u.forEach(function(f){t[f].forEach(function(p){p.name in h&&h[p.name]!=null?d.push(r(f,p,h)):p.push in h&&h[p.push]!=null&&h[p.push].forEach(function(g){d.push(r(f,p,g))})})})}),d.join(`\r 699`)+`\r 700`},ak}var E4;function Yme(){if(E4)return ga;E4=1;var t=Kme(),e=Gme(),n=jP();return ga.grammar=n,ga.write=e,ga.parse=t.parse,ga.parseParams=t.parseParams,ga.parseFmtpConfig=t.parseFmtpConfig,ga.parsePayloads=t.parsePayloads,ga.parseRemoteCandidates=t.parseRemoteCandidates,ga.parseImageAttributes=t.parseImageAttributes,ga.parseSimulcastStreamList=t.parseSimulcastStreamList,ga}var Ui=Yme();function PP(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:50,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r,i;let a;const s=(r=n.isImmediate)!==null&&r!==void 0?r:!1,o=(i=n.callback)!==null&&i!==void 0?i:!1,c=n.maxWait;let u=Date.now(),d=[];function h(){if(c!==void 0){const p=Date.now()-u;if(p+e>=c)return c-p}return e}const f=function(){for(var p=arguments.length,g=new Array(p),m=0;m<p;m++)g[m]=arguments[m];const v=this;return new Promise((x,w)=>{const y=function(){if(a=void 0,u=Date.now(),!s){const S=t.apply(v,g);o&&o(S),d.forEach(_=>{let{resolve:C}=_;return C(S)}),d=[]}},k=s&&a===void 0;if(a!==void 0&&Vn.clearTimeout(a),a=Vn.setTimeout(y,h()),k){const S=t.apply(v,g);return o&&o(S),x(S)}d.push({resolve:x,reject:w})})};return f.cancel=function(p){a!==void 0&&Vn.clearTimeout(a),d.forEach(g=>{let{reject:m}=g;return m(p)}),d=[]},f}const Jme=.7,Xme=20,Vl={NegotiationStarted:"negotiationStarted",NegotiationComplete:"negotiationComplete",RTPVideoPayloadTypes:"rtpVideoPayloadTypes"};class j4 extends ca.EventEmitter{get pc(){return this._pc||(this._pc=this.createPC()),this._pc}constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r;super(),this.log=ft,this.ddExtID=0,this.latestOfferId=0,this.pendingCandidates=[],this.restartingIce=!1,this.renegotiate=!1,this.trackBitrates=[],this.remoteStereoMids=[],this.remoteNackMids=[],this.negotiate=PP(i=>F(this,void 0,void 0,function*(){this.emit(Vl.NegotiationStarted);try{yield this.createAndSendOffer()}catch(a){if(i)i(a);else throw a}}),Xme),this.close=()=>{this._pc&&(this.pendingInitialOffer=void 0,this._pc.close(),this._pc.onconnectionstatechange=null,this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.ondatachannel=null,this._pc.onnegotiationneeded=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ondatachannel=null,this._pc.ontrack=null,this._pc.onconnectionstatechange=null,this._pc.oniceconnectionstatechange=null,this._pc=null)},this.log=li((r=n.loggerName)!==null&&r!==void 0?r:Rr.PCTransport),this.loggerOptions=n,this.config=e,this._pc=this.createPC(),this.offerLock=new gr}createPC(){const e=new RTCPeerConnection(this.config);return e.onicecandidate=n=>{var r;n.candidate&&((r=this.onIceCandidate)===null||r===void 0||r.call(this,n.candidate))},e.onicecandidateerror=n=>{var r;(r=this.onIceCandidateError)===null||r===void 0||r.call(this,n)},e.oniceconnectionstatechange=()=>{var n;(n=this.onIceConnectionStateChange)===null||n===void 0||n.call(this,e.iceConnectionState)},e.onsignalingstatechange=()=>{var n;(n=this.onSignalingStatechange)===null||n===void 0||n.call(this,e.signalingState)},e.onconnectionstatechange=()=>{var n;(n=this.onConnectionStateChange)===null||n===void 0||n.call(this,e.connectionState)},e.ondatachannel=n=>{var r;(r=this.onDataChannel)===null||r===void 0||r.call(this,n)},e.ontrack=n=>{var r;(r=this.onTrack)===null||r===void 0||r.call(this,n)},e}get logContext(){var e,n;return Object.assign({},(n=(e=this.loggerOptions).loggerContextCb)===null||n===void 0?void 0:n.call(e))}get isICEConnected(){return this._pc!==null&&(this.pc.iceConnectionState==="connected"||this.pc.iceConnectionState==="completed")}addIceCandidate(e){return F(this,void 0,void 0,function*(){if(this.pc.remoteDescription&&!this.restartingIce)return this.pc.addIceCandidate(e);this.pendingCandidates.push(e)})}setRemoteDescription(e,n){return F(this,void 0,void 0,function*(){var r,i;if(e.type==="answer"&&this.latestOfferId>0&&n>0&&n!==this.latestOfferId)return this.log.warn("ignoring answer for old offer",Object.assign(Object.assign({},this.logContext),{offerId:n,latestOfferId:this.latestOfferId})),!1;let a;if(e.type==="offer"){let{stereoMids:s,nackMids:o}=Zme(e);this.remoteStereoMids=s,this.remoteNackMids=o}else if(e.type==="answer"){if(this.pendingInitialOffer&&this._pc){const o=this.pendingInitialOffer;this.pendingInitialOffer=void 0;const c=Ui.parse((r=o.sdp)!==null&&r!==void 0?r:"");
700c.media.forEach(u=>{sy(u)}),this.log.debug("setting pending initial offer before processing answer",this.logContext),yield this.setMungedSDP(o,Ui.write(c))}const s=Ui.parse((i=e.sdp)!==null&&i!==void 0?i:"");s.media.forEach(o=>{const c=NP(o.mid);o.type==="audio"&&this.trackBitrates.some(u=>{if(!u.transceiver||c!=u.transceiver.mid)return!1;let d=0;if(o.rtp.some(f=>f.codec.toUpperCase()===u.codec.toUpperCase()?(d=f.payload,!0):!1),d===0)return!0;let h=!1;for(const f of o.fmtp)if(f.payload===d){f.config=f.config.split(";").filter(p=>!p.includes("maxaveragebitrate")).join(";"),u.maxbr>0&&(f.config+=";maxaveragebitrate=".concat(u.maxbr*1e3)),h=!0;break}return h||u.maxbr>0&&o.fmtp.push({payload:d,config:"maxaveragebitrate=".concat(u.maxbr*1e3)}),!0})}),a=Ui.write(s)}return yield this.setMungedSDP(e,a,!0),this.pendingCandidates.forEach(s=>{this.pc.addIceCandidate(s)}),this.pendingCandidates=[],this.restartingIce=!1,this.renegotiate?(this.renegotiate=!1,yield this.createAndSendOffer()):e.type==="answer"&&(this.emit(Vl.NegotiationComplete),e.sdp&&Ui.parse(e.sdp).media.forEach(o=>{o.type==="video"&&this.emit(Vl.RTPVideoPayloadTypes,o.rtp)})),!0})}createInitialOffer(){return F(this,void 0,void 0,function*(){var e;const n=yield this.offerLock.lock();try{if(this.pc.signalingState!=="stable"){this.log.warn("signaling state is not stable, cannot create initial offer",this.logContext);return}const r=this.latestOfferId+1;this.latestOfferId=r;const i=yield this.pc.createOffer();this.pendingInitialOffer={sdp:i.sdp,type:i.type};const a=Ui.parse((e=i.sdp)!==null&&e!==void 0?e:"");return a.media.forEach(s=>{sy(s)}),i.sdp=Ui.write(a),{offer:i,offerId:r}}finally{n()}})}createAndSendOffer(e){return F(this,void 0,void 0,function*(){var n;const r=yield this.offerLock.lock();try{if(this.onOffer===void 0)return;if(e!=null&&e.iceRestart&&(this.log.debug("restarting ICE",this.logContext),this.restartingIce=!0),this._pc&&(this._pc.signalingState==="have-local-offer"||this.pendingInitialOffer)){const o=this._pc.remoteDescription;if(e!=null&&e.iceRestart&&o)yield this._pc.setRemoteDescription(o);else{this.renegotiate=!0,this.log.debug("requesting renegotiation",Object.assign({},this.logContext));return}}else if(!this._pc||this._pc.signalingState==="closed"){this.log.warn("could not createOffer with closed peer connection",this.logContext);return}this.log.debug("starting to negotiate",this.logContext);const i=this.latestOfferId+1;this.latestOfferId=i;const a=yield this.pc.createOffer(e);this.log.debug("original offer",Object.assign({sdp:a.sdp},this.logContext));const s=Ui.parse((n=a.sdp)!==null&&n!==void 0?n:"");if(s.media.forEach(o=>{sy(o),o.type==="audio"?P4(o,["all"],[]):o.type==="video"&&this.trackBitrates.some(c=>{if(!o.msid||!c.cid||!o.msid.includes(c.cid))return!1;let u=0;if(o.rtp.some(h=>h.codec.toUpperCase()===c.codec.toUpperCase()?(u=h.payload,!0):!1),u===0||(La(c.codec)&&!du()&&this.ensureVideoDDExtensionForSVC(o,s),!La(c.codec)))return!0;const d=Math.round(c.maxbr*Jme);for(const h of o.fmtp)if(h.payload===u){h.config.includes("x-google-start-bitrate")||(h.config+=";x-google-start-bitrate=".concat(d));break}return!0})}),this.latestOfferId>i){this.log.warn("latestOfferId mismatch",Object.assign(Object.assign({},this.logContext),{latestOfferId:this.latestOfferId,offerId:i}));return}yield this.setMungedSDP(a,Ui.write(s)),this.onOffer(a,this.latestOfferId)}finally{r()}})}createAndSetAnswer(){return F(this,void 0,void 0,function*(){var e;const n=yield this.pc.createAnswer(),r=Ui.parse((e=n.sdp)!==null&&e!==void 0?e:"");return r.media.forEach(i=>{sy(i),i.type==="audio"&&P4(i,this.remoteStereoMids,this.remoteNackMids)}),yield this.setMungedSDP(n,Ui.write(r)),n})}createDataChannel(e,n){return this.pc.createDataChannel(e,n)}addTransceiver(e,n){return this.pc.addTransceiver(e,n)}addTransceiverOfKind(e,n){return this.pc.addTransceiver(e,n)}addTrack(e){if(!this._pc)throw new bn("PC closed, cannot add track");return this._pc.addTrack(e)}setTrackCodecBitrate(e){this.trackBitrates.push(e)}setConfiguration(e){var n;if(!this._pc)throw new bn("PC closed, cannot configure");return(n=this._pc)===null||n===void 0?void 0:n.setConfiguration(e)}canRemoveTrack(){var e;return!!(!((e=this._pc)===null||e===void 0)&&e.removeTrack)}removeTrack(e){var n;return(n=this._pc)===null||n===void 0?void 0:n.removeTrack(e)}getConnectionState(){var e,n;return(n=(e=this._pc)===null||e===void 0?void 0:e.connectionState)!==null&&n!==void 0?n:"closed"}getICEConnectionState(){var e,n;return(n=(e=this._pc)===null||e===void 0?void 0:e.iceConnectionState)!==null&&n!==void 0?n:"closed"}getSignallingState(){var e,n;return(n=(e=this._pc)===null||e===void 0?void 0:e.signalingState)!==null&&n!==void 0?n:"closed"}getTransceivers(){var e,n;return(n=(e=this._pc)===null||e===void 0?void 0:e.getTransceivers())!==null&&n!==void 0?n:[]}getSenders(){var e,n;return(n=(e=this._pc)===null||e===void 0?void 0:e.getSenders())!==null&&n!==void 0?n:[]}getLocalDescription(){var e;return(e=this._pc)===null||e===void 0?void 0:e.localDescription}getRemoteDescription(){var e;return(e=this.pc)===null||e===void 0?void 0:e.remoteDescription}getStats(){return this.pc.getStats()}getConnectedAddress(){return F(this,void 0,void 0,function*(){var e;if(!this._pc)return;let n="";const r=new Map,i=new Map;
700if((yield this._pc.getStats()).forEach(o=>{switch(o.type){case"transport":n=o.selectedCandidatePairId;break;case"candidate-pair":n===""&&o.selected&&(n=o.id),r.set(o.id,o);break;case"remote-candidate":i.set(o.id,"".concat(o.address,":").concat(o.port));break}}),n==="")return;const s=(e=r.get(n))===null||e===void 0?void 0:e.remoteCandidateId;if(s!==void 0)return i.get(s)})}setMungedSDP(e,n,r){return F(this,void 0,void 0,function*(){var i,a;const s=e.sdp;if(n){e.sdp=n;try{this.log.debug("setting munged ".concat(r?"remote":"local"," description"),this.logContext),r?yield this.pc.setRemoteDescription(e):yield this.pc.setLocalDescription(e);return}catch(o){this.log.warn("not able to set ".concat(e.type,", falling back to unmodified sdp"),Object.assign(Object.assign({},this.logContext),{error:o,mungedSdp:n,originalSdp:s})),e.sdp=s}}try{r?yield(i=this._pc)===null||i===void 0?void 0:i.setRemoteDescription(e):yield(a=this._pc)===null||a===void 0?void 0:a.setLocalDescription(e)}catch(o){let c="unknown error";o instanceof Error?c=o.message:typeof o=="string"&&(c=o);const u={error:c,sdp:e.sdp};throw n&&n!==s&&(u.mungedSdp=n),!r&&this.pc.remoteDescription&&(u.remoteSdp=this.pc.remoteDescription),this.log.error("unable to set ".concat(e.type),Object.assign(Object.assign({},this.logContext),{fields:u})),new _c(c)}})}ensureVideoDDExtensionForSVC(e,n){var r,i;if(!((r=e.ext)===null||r===void 0?void 0:r.some(s=>s.uri===d4))){if(this.ddExtID===0){let s=0;n.media.forEach(o=>{var c;(c=o.ext)===null||c===void 0||c.forEach(u=>{u.value>s&&(s=u.value)})}),this.ddExtID=s+1}(i=e.ext)===null||i===void 0||i.push({value:this.ddExtID,uri:d4})}}}function P4(t,e,n){const r=NP(t.mid);let i=0;t.rtp.some(a=>a.codec==="opus"?(i=a.payload,!0):!1),i>0&&(t.rtcpFb||(t.rtcpFb=[]),n.includes(r)&&!t.rtcpFb.some(a=>a.payload===i&&a.type==="nack")&&t.rtcpFb.push({payload:i,type:"nack"}),(e.includes(r)||e.length===1&&e[0]==="all")&&t.fmtp.some(a=>a.payload===i?(a.config.includes("stereo=1")||(a.config+=";stereo=1"),!0):!1))}function Zme(t){var e;const n=[],r=[],i=Ui.parse((e=t.sdp)!==null&&e!==void 0?e:"");let a=0;return i.media.forEach(s=>{var o;const c=NP(s.mid);s.type==="audio"&&(s.rtp.some(u=>u.codec==="opus"?(a=u.payload,!0):!1),!((o=s.rtcpFb)===null||o===void 0)&&o.some(u=>u.payload===a&&u.type==="nack")&&r.push(c),s.fmtp.some(u=>u.payload===a?(u.config.includes("sprop-stereo=1")&&n.push(c),!0):!1))}),{stereoMids:n,nackMids:r}}function sy(t){if(t.connection){const e=t.connection.ip.indexOf(":")>=0;(t.connection.version===4&&e||t.connection.version===6&&!e)&&(t.connection.ip="0.0.0.0",t.connection.version=4)}}function NP(t){return typeof t=="number"?t.toFixed(0):t}const dT="vp8",Qme={audioPreset:tT.music,dtx:!0,red:!0,forceStereo:!1,simulcast:!0,screenShareEncoding:SP.h1080fps15.encoding,stopMicTrackOnMute:!1,videoCodec:dT,backupCodec:!0,preConnectBuffer:!1},OW={deviceId:{ideal:"default"},autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0,voiceIsolation:!0},RW={deviceId:{ideal:"default"},resolution:zm.h720.resolution},ege={adaptiveStream:!1,dynacast:!1,stopLocalTrackOnUnpublish:!0,reconnectPolicy:new jpe,disconnectOnPageLeave:!0,webAudioMix:!1,singlePeerConnection:!0},AP={autoSubscribe:!0,maxRetries:1,peerConnectionTimeout:15e3,websocketTimeout:15e3};var wn;(function(t){t[t.NEW=0]="NEW",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED",t[t.FAILED=3]="FAILED",t[t.CLOSING=4]="CLOSING",t[t.CLOSED=5]="CLOSED"})(wn||(wn={}));class N4{get needsPublisher(){return this.isPublisherConnectionRequired}get needsSubscriber(){return this.isSubscriberConnectionRequired}get currentState(){return this.state}get mode(){return this._mode}constructor(e,n,r){var i;this.peerConnectionTimeout=AP.peerConnectionTimeout,this.log=ft,this.updateState=()=>{var a,s;const o=this.state,c=this.requiredTransports.map(u=>u.getConnectionState());c.every(u=>u==="connected")?this.state=wn.CONNECTED:c.some(u=>u==="failed")?this.state=wn.FAILED:c.some(u=>u==="connecting")?this.state=wn.CONNECTING:c.every(u=>u==="closed")?this.state=wn.CLOSED:c.some(u=>u==="closed")?this.state=wn.CLOSING:c.every(u=>u==="new")&&(this.state=wn.NEW),o!==this.state&&(this.log.debug("pc state change: from ".concat(wn[o]," to ").concat(wn[this.state]),this.logContext),(a=this.onStateChange)===null||a===void 0||a.call(this,this.state,this.publisher.getConnectionState(),(s=this.subscriber)===null||s===void 0?void 0:s.getConnectionState()))},this.log=li((i=n.loggerName)!==null&&i!==void 0?i:Rr.PCManager),this.loggerOptions=n,this.isPublisherConnectionRequired=e!=="subscriber-primary",this.isSubscriberConnectionRequired=e==="subscriber-primary",this.publisher=new j4(r,n),this._mode=e,e!=="publisher-only"&&(this.subscriber=new j4(r,n),this.subscriber.onConnectionStateChange=this.updateState,this.subscriber.onIceConnectionStateChange=this.updateState,this.subscriber.onSignalingStatechange=this.updateState,this.subscriber.onIceCandidate=a=>{var s;(s=this.onIceCandidate)===null||s===void 0||s.call(this,a,Ma.SUBSCRIBER)},this.subscriber.onDataChannel=a=>{var s;(s=this.onDataChannel)===null||s===void 0||s.call(this,a)},this.subscriber.onTrack=a=>{var s;(s=this.onTrack)===null||s===void 0||s.call(this,a)}),this.publisher.onConnectionStateChange=this.updateState,this.publisher.onIceConnectionStateChange=this.updateState,this.publisher.onSignalingStatechange=this.updateState,this.publisher.onIceCandidate=a=>{var s;(s=this.onIceCandidate)===null||s===void 0||s.call(this,a,Ma.PUBLISHER)},this.publisher.onTrack=a=>{var s;(s=this.onTrack)===null||s===void 0||s.call(this,a)},this.publisher.onOffer=(a,s)=>{var o;(o=this.onPublisherOffer)===null||o===void 0||o.call(this,a,s)},this.state=wn.NEW,this.connectionLock=new gr,this.remoteOfferLock=new gr}get logContext(){var e,n;return Object.assign({},(n=(e=this.loggerOptions).loggerContextCb)===null||n===void 0?void 0:n.call(e))}requirePublisher(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.isPublisherConnectionRequired=e,this.updateState()}createAndSendPublisherOffer(e){return this.publisher.createAndSendOffer(e)}setPublisherAnswer(e,n){return this.publisher.setRemoteDescription(e,n)}removeTrack(e){return this.publisher.removeTrack(e)}close(){return F(this,void 0,void 0,function*(){var e;if(this.publisher&&this.publisher.getSignallingState()!=="closed"){const n=this.publisher;for(const r of n.getSenders())try{n.canRemoveTrack()&&n.removeTrack(r)}catch(i){this.log.warn("could not removeTrack",Object.assign(Object.assign({},this.logContext),{error:i}))}}yield Promise.all([this.publisher.close(),(e=this.subscriber)===null||e===void 0?void 0:e.close()]),this.updateState()})}triggerIceRestart(){return F(this,void 0,void 0,function*(){this.subscriber&&(this.subscriber.restartingIce=!0),this.needsPublisher&&(yield this.createAndSendPublisherOffer({iceRestart:!0}))})}addIceCandidate(e,n){return F(this,void 0,void 0,function*(){var r;n===Ma.PUBLISHER?yield this.publisher.addIceCandidate(e):yield(r=this.subscriber)===null||r===void 0?void 0:r.addIceCandidate(e)})}createSubscriberAnswerFromOffer(e,n){return F(this,void 0,void 0,function*(){var r,i,a;this.log.debug("received server offer",Object.assign(Object.assign({},this.logContext),{RTCSdpType:e.type,sdp:e.sdp,signalingState:(r=this.subscriber)===null||r===void 0?void 0:r.getSignallingState().toString()}));const s=yield this.remoteOfferLock.lock();try{return(yield(i=this.subscriber)===null||i===void 0?void 0:i.setRemoteDescription(e,n))?yield(a=this.subscriber)===null||a===void 0?void 0:a.createAndSetAnswer():void 0}finally{s()}})}updateConfiguration(e,n){var r;this.publisher.setConfiguration(e),(r=this.subscriber)===null||r===void 0||r.setConfiguration(e),n&&this.triggerIceRestart()}ensurePCTransportConnection(e,n){return F(this,void 0,void 0,function*(){var r;const i=yield this.connectionLock.lock();try{this.isPublisherConnectionRequired&&this.publisher.getConnectionState()!=="connected"&&this.publisher.getConnectionState()!=="connecting"&&(this.log.debug("negotiation required, start negotiating",this.logContext),this.publisher.negotiate()),yield Promise.all((r=this.requiredTransports)===null||r===void 0?void 0:r.map(a=>
700this.ensureTransportConnected(a,e,n)))}finally{i()}})}negotiate(e){return F(this,void 0,void 0,function*(){return new jr((n,r)=>F(this,void 0,void 0,function*(){let i=setTimeout(()=>{r(new _c("negotiation timed out"))},this.peerConnectionTimeout);const a=()=>{clearTimeout(i),this.publisher.off(Vl.NegotiationStarted,o),e.signal.removeEventListener("abort",s)},s=()=>{a(),r(new _c("negotiation aborted"))},o=()=>{e.signal.aborted||(clearTimeout(i),i=setTimeout(()=>{a(),r(new _c("negotiation timed out"))},this.peerConnectionTimeout))};e.signal.addEventListener("abort",s),this.publisher.on(Vl.NegotiationStarted,o),this.publisher.once(Vl.NegotiationComplete,()=>{a(),n()}),yield this.publisher.negotiate(c=>{a(),c instanceof Error?r(c):r(new Error(String(c)))})}))})}addPublisherTransceiver(e,n){return this.publisher.addTransceiver(e,n)}addPublisherTransceiverOfKind(e,n){return this.publisher.addTransceiverOfKind(e,n)}getMidForReceiver(e){const r=(this.subscriber?this.subscriber.getTransceivers():this.publisher.getTransceivers()).find(i=>i.receiver===e);return r==null?void 0:r.mid}addPublisherTrack(e){return this.publisher.addTrack(e)}createPublisherDataChannel(e,n){return this.publisher.createDataChannel(e,n)}getConnectedAddress(e){return e===Ma.PUBLISHER?this.publisher.getConnectedAddress():e===Ma.SUBSCRIBER?this.publisher.getConnectedAddress():this.requiredTransports[0].getConnectedAddress()}get requiredTransports(){const e=[];return this.isPublisherConnectionRequired&&e.push(this.publisher),this.isSubscriberConnectionRequired&&this.subscriber&&e.push(this.subscriber),e}ensureTransportConnected(e,n){return F(this,arguments,void 0,function(r,i){var a=this;let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.peerConnectionTimeout;return function*(){if(r.getConnectionState()!=="connected")return new Promise((c,u)=>F(a,void 0,void 0,function*(){const d=()=>{this.log.warn("abort transport connection",this.logContext),Vn.clearTimeout(h),u(Ge.cancelled("room connection has been cancelled"))};i!=null&&i.signal.aborted&&d(),i==null||i.signal.addEventListener("abort",d);const h=Vn.setTimeout(()=>{i==null||i.signal.removeEventListener("abort",d),u(Ge.internal("could not establish pc connection"))},s);for(;this.state!==wn.CONNECTED;)if(yield Nr(50),i!=null&&i.signal.aborted){u(Ge.cancelled("room connection has been cancelled"));return}Vn.clearTimeout(h),i==null||i.signal.removeEventListener("abort",d),c()}))}()})}}class An extends Error{constructor(e,n,r){super(n),this.code=e,this.message=A4(n,An.MAX_MESSAGE_BYTES),this.data=r?A4(r,An.MAX_DATA_BYTES):void 0}static fromProto(e){return new An(e.code,e.message,e.data)}toProto(){return new wz({code:this.code,message:this.message,data:this.data})}static builtIn(e,n){return new An(An.ErrorCode[e],An.ErrorMessage[e],n)}}An.MAX_MESSAGE_BYTES=256;An.MAX_DATA_BYTES=15360;An.ErrorCode={APPLICATION_ERROR:1500,CONNECTION_TIMEOUT:1501,RESPONSE_TIMEOUT:1502,RECIPIENT_DISCONNECTED:1503,RESPONSE_PAYLOAD_TOO_LARGE:1504,SEND_FAILED:1505,UNSUPPORTED_METHOD:1400,RECIPIENT_NOT_FOUND:1401,REQUEST_PAYLOAD_TOO_LARGE:1402,UNSUPPORTED_SERVER:1403,UNSUPPORTED_VERSION:1404};An.ErrorMessage={APPLICATION_ERROR:"Application error in method handler",CONNECTION_TIMEOUT:"Connection timeout",RESPONSE_TIMEOUT:"Response timeout",RECIPIENT_DISCONNECTED:"Recipient disconnected",RESPONSE_PAYLOAD_TOO_LARGE:"Response payload too large",SEND_FAILED:"Failed to send",UNSUPPORTED_METHOD:"Method not supported at destination",RECIPIENT_NOT_FOUND:"Recipient not found",REQUEST_PAYLOAD_TOO_LARGE:"Request payload too large",UNSUPPORTED_SERVER:"RPC not supported by server",UNSUPPORTED_VERSION:"Unsupported RPC version"};const DW=15360;function OP(t){return new TextEncoder().encode(t).length}function A4(t,e){if(OP(t)<=e)return t;let n=0,r=t.length;const i=new TextEncoder;for(;n<r;){const a=Math.floor((n+r+1)/2);i.encode(t.slice(0,a)).length<=e?n=a:r=a-1}return t.slice(0,n)}const RP=2e3;function Pw(t,e){if(!e)return 0;let n,r;return"bytesReceived"in t?(n=t.bytesReceived,r=e.bytesReceived):"bytesSent"in t&&(n=t.bytesSent,r=e.bytesSent),n===void 0||r===void 0||t.timestamp===void 0||e.timestamp===void 0?0:(n-r)*8*1e3/(t.timestamp-e.timestamp)}const DP=typeof MediaRecorder<"u";class tge{constructor(){throw new Error("MediaRecorder is not available in this environment")}}const nge=DP?MediaRecorder:tge;class rge extends nge{constructor(e,n){if(!DP)throw new Error("MediaRecorder is not available in this environment");super(new MediaStream([e.mediaStreamTrack]),n);let r,i;const a=()=>i===void 0,s=()=>{this.removeEventListener("dataavailable",r),this.removeEventListener("stop",s),this.removeEventListener("error",o),i==null||i.close(),i=void 0},o=c=>{i==null||i.error(c),this.removeEventListener("dataavailable",r),this.removeEventListener("stop",s),this.removeEventListener("error",o),i=void 0};this.byteStream=new ReadableStream({start:c=>{i=c,r=u=>F(this,void 0,void 0,function*(){let d;if(u.data.arrayBuffer){const h=yield u.data.arrayBuffer();d=new Uint8Array(h)}else if(u.data.byteArray)d=u.data.byteArray;else throw new Error("no data available!");a()||c.enqueue(d)}),this.addEventListener("dataavailable",r)},cancel:()=>{s()}}),this.addEventListener("stop",s),this.addEventListener("error",o)}}function ige(){return DP}const age=1e3,sge=1e4;class MW extends fe{get sender(){return this._sender}set sender(e){this._sender=e}get constraints(){return this._constraints}get hasPreConnectBuffer(){return!!this.localTrackRecorder}constructor(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,a=arguments.length>4?arguments[4]:void 0;super(e,n,a),this.manuallyStopped=!1,this.pendingDeviceChange=!1,this._isUpstreamPaused=!1,this.handleTrackMuteEvent=()=>this.debouncedTrackMuteHandler().catch(()=>this.log.debug("track mute bounce got cancelled by an unmute event",this.logContext)),this.debouncedTrackMuteHandler=PP(()=>F(this,void 0,void 0,function*(){yield this.pauseUpstream()}),5e3),this.handleTrackUnmuteEvent=()=>F(this,void 0,void 0,function*(){this.debouncedTrackMuteHandler.cancel("unmute"),yield this.resumeUpstream()}),this.handleEnded=()=>
vendor: 10,528 bytes, line 700
700{this.isInBackground&&(this.reacquireTrack=!0),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent),this.emit(ke.Ended,this)},this.reacquireTrack=!1,this.providedByUser=i,this.muteLock=new gr,this.pauseUpstreamLock=new gr,this.trackChangeLock=new gr,this.trackChangeLock.lock().then(s=>F(this,void 0,void 0,function*(){try{yield this.setMediaStreamTrack(e,!0)}finally{s()}})),this._constraints=e.getConstraints(),r&&(this._constraints=r)}get id(){return this._mediaStreamTrack.id}get dimensions(){if(this.kind!==fe.Kind.Video)return;const{width:e,height:n}=this._mediaStreamTrack.getSettings();if(e&&n)return{width:e,height:n}}get isUpstreamPaused(){return this._isUpstreamPaused}get isUserProvided(){return this.providedByUser}get mediaStreamTrack(){var e,n;return(n=(e=this.processor)===null||e===void 0?void 0:e.processedTrack)!==null&&n!==void 0?n:this._mediaStreamTrack}get isLocal(){return!0}getSourceTrackSettings(){return this._mediaStreamTrack.getSettings()}setMediaStreamTrack(e,n,r){return F(this,void 0,void 0,function*(){var i;if(e===this._mediaStreamTrack&&!n)return;this._mediaStreamTrack&&(this.attachedElements.forEach(s=>{$d(this._mediaStreamTrack,s)}),this.debouncedTrackMuteHandler.cancel("new-track"),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent)),this.mediaStream=new MediaStream([e]),e&&(e.addEventListener("ended",this.handleEnded),e.addEventListener("mute",this.handleTrackMuteEvent),e.addEventListener("unmute",this.handleTrackUnmuteEvent),this._constraints=e.getConstraints());let a;if(this.processor&&e){if(this.log.debug("restarting processor",this.logContext),this.kind==="unknown")throw TypeError("cannot set processor on track of unknown kind");this.processorElement&&(vd(e,this.processorElement),this.processorElement.muted=!0),yield this.processor.restart({track:e,kind:this.kind,element:this.processorElement}),a=this.processor.processedTrack}this.sender&&((i=this.sender.transport)===null||i===void 0?void 0:i.state)!=="closed"&&(yield this.sender.replaceTrack(a??e)),!this.providedByUser&&this._mediaStreamTrack!==e&&this._mediaStreamTrack.stop(),this._mediaStreamTrack=e,e&&(this._mediaStreamTrack.enabled=r?!0:!this.isMuted,yield this.resumeUpstream(),this.attachedElements.forEach(s=>{vd(a??e,s)}))})}waitForDimensions(){return F(this,arguments,void 0,function(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:age;return function*(){var r;if(e.kind===fe.Kind.Audio)throw new Error("cannot get dimensions for audio tracks");((r=oi())===null||r===void 0?void 0:r.os)==="iOS"&&(yield Nr(10));const i=Date.now();for(;Date.now()-i<n;){const a=e.dimensions;if(a)return a;yield Nr(50)}throw new Qs("unable to get track dimensions after timeout")}()})}setDeviceId(e){return F(this,void 0,void 0,function*(){return this._constraints.deviceId===e&&this._mediaStreamTrack.getSettings().deviceId===zl(e)?!0:(this._constraints.deviceId=e,this.isMuted?(this.pendingDeviceChange=!0,!0):(yield this.restartTrack(),zl(e)===this._mediaStreamTrack.getSettings().deviceId))})}getDeviceId(){return F(this,arguments,void 0,function(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){if(e.source===fe.Source.ScreenShare)return;const{deviceId:r,groupId:i}=e._mediaStreamTrack.getSettings(),a=e.kind===fe.Kind.Audio?"audioinput":"videoinput";return n?cr.getInstance().normalizeDeviceId(a,r,i):r}()})}mute(){return F(this,void 0,void 0,function*(){return this.setTrackMuted(!0),this})}unmute(){return F(this,void 0,void 0,function*(){return this.setTrackMuted(!1),this})}replaceTrack(e,n){return F(this,void 0,void 0,function*(){const r=yield this.trackChangeLock.lock();try{if(!this.sender)throw new Qs("unable to replace an unpublished track");let i,a;typeof n=="boolean"?i=n:n!==void 0&&(i=n.userProvidedTrack,a=n.stopProcessor),this.providedByUser=i??!0,this.log.debug("replace MediaStreamTrack",this.logContext),yield this.setMediaStreamTrack(e),a&&this.processor&&(yield this.internalStopProcessor())}finally{r()}return yield this.onSenderTrackSwapped(),this})}onSenderTrackSwapped(){return F(this,void 0,void 0,function*(){})}restart(e,n){return F(this,void 0,void 0,function*(){this.manuallyStopped=!1;const r=yield this.trackChangeLock.lock();try{e||(e=this._constraints);const{deviceId:i,facingMode:a}=e,s=Ppe(e,["deviceId","facingMode"]);this.log.debug("restarting track with constraints",Object.assign(Object.assign({},this.logContext),{constraints:e}));const o={audio:!1,video:!1};this.kind===fe.Kind.Video?o.video=i||a?{deviceId:i,facingMode:a}:!0:o.audio=i?Object.assign({deviceId:i},s):!0,this.attachedElements.forEach(d=>{$d(this.mediaStreamTrack,d)}),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.stop();const u=(yield navigator.mediaDevices.getUserMedia(o)).getTracks()[0];return this.kind===fe.Kind.Video&&(yield u.applyConstraints(s)),u.addEventListener("ended",this.handleEnded),this.log.debug("re-acquired MediaStreamTrack",this.logContext),yield this.setMediaStreamTrack(u,!1,n),this._constraints=e,this.pendingDeviceChange=!1,this.emit(ke.Restarted,this),this.manuallyStopped&&(this.log.warn("track was stopped during a restart, stopping restarted track",this.logContext),this.stop()),this}finally{r()}})}setTrackMuted(e){this.log.debug("setting ".concat(this.kind," track ").concat(e?"muted":"unmuted"),this.logContext),!(this.isMuted===e&&this._mediaStreamTrack.enabled!==e)&&(this.isMuted=e,this._mediaStreamTrack.enabled=!e,this.emit(e?ke.Muted:ke.Unmuted,this))}get needsReAcquisition(){return this._mediaStreamTrack.readyState!=="live"||this._mediaStreamTrack.muted||!this._mediaStreamTrack.enabled||this.reacquireTrack}handleAppVisibilityChanged(){const e=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return F(this,void 0,void 0,function*(){yield e.handleAppVisibilityChanged.call(this),EW()&&(this.log.debug("visibility changed, is in Background: ".concat(this.isInBackground),this.logContext),!this.isInBackground&&this.needsReAcquisition&&!this.isUserProvided&&!this.isMuted&&(this.log.debug("track needs to be reacquired, restarting ".concat(this.source),this.logContext),yield this.restart(),this.reacquireTrack=!1))})}stop(){var e;this.manuallyStopped=!0,super.stop(),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent),(e=this.processor)===null||e===void 0||e.destroy(),this.processor=void 0}pauseUpstream(){return F(this,void 0,void 0,function*(){var e;const n=yield this.pauseUpstreamLock.lock();try{if(this._isUpstreamPaused===!0)return;if(!this.sender){this.log.warn("unable to pause upstream for an unpublished track",this.logContext);return}this._isUpstreamPaused=!0,this.emit(ke.UpstreamPaused,this);const r=oi();if((r==null?void 0:r.name)==="Safari"&&Ps(r.version,"12.0")<0)throw new wP("pauseUpstream is not supported on Safari < 12.");((e=this.sender.transport)===null||e===void 0?void 0:e.state)!=="closed"&&(yield this.sender.replaceTrack(null))}finally{n()}})}resumeUpstream(){return F(this,void 0,void 0,function*(){var e;const n=yield this.pauseUpstreamLock.lock();try{if(this._isUpstreamPaused===!1)return;if(!this.sender){this.log.warn("unable to resume upstream for an unpublished track",this.logContext);return}this._isUpstreamPaused=!1,this.emit(ke.UpstreamResumed,this),((e=this.sender.transport)===null||e===void 0?void 0:e.state)!=="closed"&&(yield this.sender.replaceTrack(this.mediaStreamTrack))}finally{n()}})}getRTCStatsReport(){return F(this,void 0,void 0,function*(){var e;return!((e=this.sender)===null||e===void 0)&&e.getStats?yield this.sender.getStats():void 0})}setProcessor(e){return F(this,arguments,void 0,function(n){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){var a;const s=yield r.trackChangeLock.lock();try{r.log.debug("setting up processor",r.logContext);const o=document.createElement(r.kind),c={kind:r.kind,track:r._mediaStreamTrack,element:o,audioContext:r.audioContext};if(yield n.init(c),r.log.debug("processor initialized",r.logContext),r.processor&&(yield r.internalStopProcessor()),r.kind==="unknown")throw TypeError("cannot set processor on track of unknown kind");if(vd(r._mediaStreamTrack,o),o.muted=!0,o.play().catch(u=>{u instanceof DOMException&&u.name==="AbortError"?(r.log.warn("failed to play processor element, retrying",Object.assign(Object.assign({},r.logContext),{error:u})),setTimeout(()=>{o.play().catch(d=>{r.log.error("failed to play processor element",Object.assign(Object.assign({},r.logContext),{err:d}))})},100)):r.log.error("failed to play processor element",Object.assign(Object.assign({},r.logContext),{error:u}))}),r.processor=n,r.processorElement=o,r.processor.processedTrack){for(const u of r.attachedElements)u!==r.processorElement&&i&&($d(r._mediaStreamTrack,u),vd(r.processor.processedTrack,u));yield(a=r.sender)===null||a===void 0?void 0:a.replaceTrack(r.processor.processedTrack)}r.emit(ke.TrackProcessorUpdate,r.processor)}finally{s()}yield r.onSenderTrackSwapped()}()})}getProcessor(){return this.processor}stopProcessor(){return F(this,arguments,void 0,function(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){const r=yield e.trackChangeLock.lock();try{yield e.internalStopProcessor(n)}finally{r()}yield e.onSenderTrackSwapped()}()})}internalStopProcessor(){return F(this,arguments,void 0,function(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){var r,i;e.processor&&(e.log.debug("stopping processor",e.logContext),(r=e.processor.processedTrack)===null||r===void 0||r.stop(),yield e.processor.destroy(),e.processor=void 0,n||((i=e.processorElement)===null||i===void 0||i.remove(),e.processorElement=void 0),yield e._mediaStreamTrack.applyConstraints(e._constraints),yield e.setMediaStreamTrack(e._mediaStreamTrack,!0),e.emit(ke.TrackProcessorUpdate))}()})}startPreConnectBuffer(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:100;if(!ige()){this.log.warn("MediaRecorder is not available, cannot start prec
700onnect buffer",this.logContext);return}if(this.localTrackRecorder){this.log.warn("preconnect buffer already started");return}else{let n="audio/webm;codecs=opus";MediaRecorder.isTypeSupported(n)||(n="video/mp4"),this.localTrackRecorder=new rge(this,{mimeType:n})}this.localTrackRecorder.start(e),this.autoStopPreConnectBuffer=setTimeout(()=>{this.log.warn("preconnect buffer timed out, stopping recording automatically",this.logContext),this.stopPreConnectBuffer()},sge)}stopPreConnectBuffer(){clearTimeout(this.autoStopPreConnectBuffer),this.localTrackRecorder&&(this.localTrackRecorder.stop(),this.localTrackRecorder=void 0)}getPreConnectBuffer(){var e;return(e=this.localTrackRecorder)===null||e===void 0?void 0:e.byteStream}getPreConnectBufferMimeType(){var e;return(e=this.localTrackRecorder)===null||e===void 0?void 0:e.mimeType}}class sb extends MW{get enhancedNoiseCancellation(){return this.isKrispNoiseFilterEnabled}constructor(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;super(e,fe.Kind.Audio,n,r,a),this.stopOnMute=!1,this.isKrispNoiseFilterEnabled=!1,this.monitorSender=()=>F(this,void 0,void 0,function*(){if(!this.sender){this._currentBitrate=0;return}let s;try{s=yield this.getSenderStats()}catch(o){this.log.error("could not get audio sender stats",Object.assign(Object.assign({},this.logContext),{error:o}));return}s&&this.prevStats&&(this._currentBitrate=Pw(s,this.prevStats)),this.prevStats=s}),this.handleKrispNoiseFilterEnable=()=>{this.isKrispNoiseFilterEnabled=!0,this.log.debug("Krisp noise filter enabled",this.logContext),this.emit(ke.AudioTrackFeatureUpdate,this,or.TF_ENHANCED_NOISE_CANCELLATION,!0)},this.handleKrispNoiseFilterDisable=()=>{this.isKrispNoiseFilterEnabled=!1,this.log.debug("Krisp noise filter disabled",this.logContext),this.emit(ke.AudioTrackFeatureUpdate,this,or.TF_ENHANCED_NOISE_CANCELLATION,!1)},this.audioContext=i,this.checkForSilence()}mute(){const e=Object.create(null,{mute:{get:()=>super.mute}});return F(this,void 0,void 0,function*(){const n=yield this.muteLock.lock();try{return this.isMuted?(this.log.debug("Track already muted",this.logContext),this):(this.source===fe.Source.Microphone&&this.stopOnMute&&!this.isUserProvided&&(this.log.debug("stopping mic track",this.logContext),this._mediaStreamTrack.stop()),yield e.mute.call(this),this)}finally{n()}})}unmute(){const e=Object.create(null,{unmute:{get:()=>super.unmute}});return F(this,void 0,void 0,function*(){const n=yield this.muteLock.lock();try{return this.isMuted?(this.source===fe.Source.Microphone&&(this.stopOnMute||this._mediaStreamTrack.readyState==="ended"||this.pendingDeviceChange)&&!this.isUserProvided&&(this.log.debug("reacquiring mic track",this.logContext),yield this.restart(void 0,!0)),yield e.unmute.call(this),this):(this.log.debug("Track already unmuted",this.logContext),this)}finally{n()}})}restartTrack(e){return F(this,void 0,void 0,function*(){let n;if(e){const r=kP({audio:e});typeof r.audio!="boolean"&&(n=r.audio)}yield this.restart(n)})}restart(e,n){const r=Object.create(null,{restart:{get:()=>super.restart}});return F(this,void 0,void 0,function*(){const i=yield r.restart.call(this,e,n);return this.checkForSilence(),i})}startMonitor(){ni()&&(this.monitorInterval||(this.monitorInterval=setInterval(()=>{this.monitorSender()},RP)))}setProcessor(e){return F(this,void 0,void 0,function*(){var n;const r=yield this.trackChangeLock.lock();try{if(!js()&&!this.audioContext)throw Error("Audio context needs to be set on LocalAudioTrack in order to enable processors");this.processor&&(yield this.internalStopProcessor());const i={kind:this.kind,track:this._mediaStreamTrack,audioContext:this.audioContext};this.log.debug("setting up audio processor ".concat(e.name),this.logContext),yield e.init(i),this.processor=e,this.processor.processedTrack&&(yield(n=this.sender)===null||n===void 0?void 0:n.replaceTrack(this.processor.processedTrack),this.processor.processedTrack.addEventListener("enable-lk-krisp-noise-filter",this.handleKrispNoiseFilterEnable),this.processor.processedTrack.addEventListener("disable-lk-krisp-noise-filter",this.handleKrispNoiseFilterDisable)),this.emit
vendor: 11,055 bytes, line 700
700(ke.TrackProcessorUpdate,this.processor)}finally{r()}})}setAudioContext(e){this.audioContext=e}getSenderStats(){return F(this,void 0,void 0,function*(){var e;if(!(!((e=this.sender)===null||e===void 0)&&e.getStats))return;const n=yield this.sender.getStats();let r;return n.forEach(i=>{i.type==="outbound-rtp"&&(r={type:"audio",streamId:i.id,packetsSent:i.packetsSent,packetsLost:i.packetsLost,bytesSent:i.bytesSent,timestamp:i.timestamp,roundTripTime:i.roundTripTime,jitter:i.jitter})}),r})}checkForSilence(){return F(this,void 0,void 0,function*(){const e=yield _W(this);return e&&(this.isMuted||this.log.debug("silence detected on local audio track",this.logContext),this.emit(ke.AudioSilenceDetected)),e})}}function oge(t,e,n){switch(t.kind){case"audio":return new sb(t,e,!1,void 0,n);case"video":return new cb(t,e,!1,n);default:throw new Qs("unsupported track type: ".concat(t.kind))}}const cge=Object.values(zm),lge=Object.values(nT),uge=Object.values(SP),dge=[zm.h180,zm.h360],hge=[nT.h180,nT.h360],fge=t=>[{scaleResolutionDownBy:2,fps:t.encoding.maxFramerate}].map(n=>{var r,i;return new Ht(Math.floor(t.width/n.scaleResolutionDownBy),Math.floor(t.height/n.scaleResolutionDownBy),Math.max(15e4,Math.floor(t.encoding.maxBitrate/(Math.pow(n.scaleResolutionDownBy,2)*(((r=t.encoding.maxFramerate)!==null&&r!==void 0?r:30)/((i=n.fps)!==null&&i!==void 0?i:30))))),n.fps,t.encoding.priority)}),hT=["q","h","f"];function ob(t,e,n,r){var i,a;let s=r==null?void 0:r.videoEncoding;t&&(s=r==null?void 0:r.screenShareEncoding);const o=r==null?void 0:r.simulcast,c=r==null?void 0:r.scalabilityMode,u=r==null?void 0:r.videoCodec;if(!s&&!o&&!c||!e||!n)return[{}];s||(s=pge(t,e,n,u),ft.debug("using video encoding",s));const d=s.maxFramerate,h=new Ht(e,n,s.maxBitrate,s.maxFramerate,s.priority);if(c&&La(u)){const g=new LW(c),m=[];if(g.spatial>3)throw new Error("unsupported scalabilityMode: ".concat(c));const v=oi();if(Wm()||js()||(v==null?void 0:v.name)==="Chrome"&&Ps(v==null?void 0:v.version,"113")<0){const x=g.suffix=="h"?2:3,w=dme(v);for(let y=0;y<g.spatial;y+=1)m.push({rid:hT[2-y],maxBitrate:s.maxBitrate/Math.pow(x,y),maxFramerate:h.encoding.maxFramerate,scaleResolutionDownBy:w?Math.pow(2,y):void 0});m[0].scalabilityMode=c}else m.push({maxBitrate:s.maxBitrate,maxFramerate:h.encoding.maxFramerate,scalabilityMode:c});return h.encoding.priority&&(m[0].priority=h.encoding.priority,m[0].networkPriority=h.encoding.priority),ft.debug("using svc encoding",{encodings:m}),m}if(!o)return[s];let f=[];t?f=(i=R4(r==null?void 0:r.screenShareSimulcastLayers))!==null&&i!==void 0?i:O4(t,h):f=(a=R4(r==null?void 0:r.videoSimulcastLayers))!==null&&a!==void 0?a:O4(t,h);let p;if(f.length>0){const g=f[0];f.length>1&&([,p]=f);const m=Math.max(e,n);if(m>=960&&p)return sk(e,n,[g,p,h],d);if(m>=480)return sk(e,n,[g,h],d)}return sk(e,n,[h])}function IW(t,e,n){var r,i,a,s;if(!n.backupCodec||n.backupCodec===!0||n.backupCodec.codec===n.videoCodec)return;e!==n.backupCodec.codec&&ft.warn("requested a different codec than specified as backup",{serverRequested:e,backup:n.backupCodec.codec}),n.videoCodec=e,n.videoEncoding=n.backupCodec.encoding;const o=t.mediaStreamTrack.getSettings(),c=(r=o.width)!==null&&r!==void 0?r:(i=t.dimensions)===null||i===void 0?void 0:i.width,u=(a=o.height)!==null&&a!==void 0?a:(s=t.dimensions)===null||s===void 0?void 0:s.height;return t.source===fe.Source.ScreenShare&&n.simulcast&&(n.simulcast=!1),ob(t.source===fe.Source.ScreenShare,c,u,n)}function pge(t,e,n,r){const i=mge(t,e,n);let{encoding:a}=i[0];const s=Math.max(e,n);for(let o=0;o<i.length;o+=1){const c=i[o];if(a=c.encoding,c.width>=s)break}if(r)switch(r){case"av1":case"h265":a=Object.assign({},a),a.maxBitrate=a.maxBitrate*.7;break;case"vp9":a=Object.assign({},a),a.maxBitrate=a.maxBitrate*.85;break}return a}function mge(t,e,n){if(t)return uge;const r=e>n?e/n:n/e;return Math.abs(r-16/9)<Math.abs(r-4/3)?cge:lge}function O4(t,e){if(t)return fge(e);const{width:n,height:r}=e,i=n>r?n/r:r/n;return Math.abs(i-16/9)<Math.abs(i-4/3)?dge:hge}function sk(t,e,n,r){const i=[];if(n.forEach((a,s)=>{if(s>=hT.length)return;const o=Math.min(t,e),u={rid:hT[s],scaleResolutionDownBy:Math.max(1,o/Math.min(a.width,a.height)),maxBitrate:a.encoding.maxBitrate},d=r&&a.encoding.maxFramerate?Math.min(r,a.encoding.maxFramerate):a.encoding.maxFramerate;d&&(u.maxFramerate=d);const h=uu()||s===0;a.encoding.priority&&h&&(u.priority=a.encoding.priority,u.networkPriority=a.encoding.priority),i.push(u)}),js()&&PW()==="ios"){let a;i.forEach(o=>{a?o.maxFramerate&&o.maxFramerate>a&&(a=o.maxFramerate):a=o.maxFramerate});let s=!0;i.forEach(o=>{var c;o.maxFramerate!=a&&(s&&(s=!1,ft.info("Simulcast on iOS React-Native requires all encodings to share the same framerate.")),ft.info('Setting framerate of encoding "'.concat((c=o.rid)!==null&&c!==void 0?c:"",'" to ').concat(a)),o.maxFramerate=a)})}return i}function R4(t){if(t)return t.sort((e,n)=>{const{encoding:r}=e,{encoding:i}=n;return r.maxBitrate>i.maxBitrate?1:r.maxBitrate<i.maxBitrate?-1:r.maxBitrate===i.maxBitrate&&r.maxFramerate&&i.maxFramerate?r.maxFramerate>i.maxFramerate?1:-1:0})}class LW{constructor(e){const n=e.match(/^L(\d)T(\d)(h|_KEY|_KEY_SHIFT){0,1}$/);if(!n)throw new Error("invalid scalability mode");if(this.spatial=parseInt(n[1]),this.temporal=parseInt(n[2]),n.length>3)switch(n[3]){case"h":case"_KEY":case"_KEY_SHIFT":this.suffix=n[3]}}toString(){var e;return"L".concat(this.spatial,"T").concat(this.temporal).concat((e=this.suffix)!==null&&e!==void 0?e:"")}}function gge(t){return t.source===fe.Source.ScreenShare||t.constraints.height&&zl(t.constraints.height)>=1080?"maintain-resolution":"balanced"}const vge=5e3;class cb extends MW{get sender(){return this._sender}set sender(e){this._sender=e,this.degradationPreference&&this.setDegradationPreference(this.degradationPreference)}constructor(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3?arguments[3]:void 0;super(e,fe.Kind.Video,n,r,i),this.simulcastCodecs=new Map,this.degradationPreference="balanced",this.isCpuConstrained=!1,this.optimizeForPerformance=!1,this.monitorSender=()=>F(this,void 0,void 0,function*(){if(!this.sender){this._currentBitrate=0;return}let a;try{a=yield this.getSenderStats()}catch(c){this.log.error("could not get video sender stats",Object.assign(Object.assign({},this.logContext),{error:c}));return}const s=new Map(a.map(c=>[c.rid,c])),o=a.some(c=>c.qualityLimitationReason==="cpu");if(o!==this.isCpuConstrained&&(this.isCpuConstrained=o,this.isCpuConstrained&&this.emit(ke.CpuConstrained)),this.prevStats){let c=0;s.forEach((u,d)=>{var h;const f=(h=this.prevStats)===null||h===void 0?void 0:h.get(d);c+=Pw(u,f)}),this._currentBitrate=c}this.prevStats=s}),this.senderLock=new gr}get isSimulcast(){return!!(this.sender&&this.sender.getParameters().encodings.length>1)}startMonitor(e){var n;if(this.signalClient=e,!ni())return;const r=(n=this.sender)===null||n===void 0?void 0:n.getParameters();r&&(this.encodings=r.encodings),!this.monitorInterval&&(this.monitorInterval=setInterval(()=>{this.monitorSender()},RP))}stop(){this._mediaStreamTrack.getConstraints(),this.simulcastCodecs.forEach(e=>{e.mediaStreamTrack.stop()}),super.stop()}pauseUpstream(){const e=Object.create(null,{pauseUpstream:{get:()=>super.pauseUpstream}});return F(this,void 0,void 0,function*(){var n,r,i,a,s;yield e.pauseUpstream.call(this);try{for(var o=!0,c=Ia(this.simulcastCodecs.values()),u;u=yield c.next(),n=u.done,!n;o=!0)a=u.value,o=!1,yield(s=a.sender)===null||s===void 0?void 0:s.replaceTrack(null)}catch(d){r={error:d}}finally{try{!o&&!n&&(i=c.return)&&(yield i.call(c))}finally{if(r)throw r.error}}})}resumeUpstream(){const e=Object.create(null,{resumeUpstream:{get:()=>super.resumeUpstream}});return F(this,void 0,void 0,function*(){var n,r,i,a,s;yield e.resumeUpstream.call(this);try{for(var o=!0,c=Ia(this.simulcastCodecs.values()),u;u=yield c.next(),n=u.done,!n;o=!0){a=u.value,o=!1;const d=a;yield(s=d.sender)===null||s===void 0?void 0:s.replaceTrack(d.mediaStreamTrack)}}catch(d){r={error:d}}finally{try{!o&&!n&&(i=c.return)&&(yield i.call(c))}finally{if(r)throw r.error}}})}mute(){const e=Object.create(null,{mute:{get:()=>super.mute}});return F(this,void 0,void 0,function*(){const n=yield this.muteLock.lock();try{return this.isMuted?(this.log.debug("Track already muted",this.logContext),this):(this.source===fe.Source.Camera&&!this.isUserProvided&&(this.log.debug("stopping camera track",this.logContext),this._mediaStreamTrack.stop()),yield e.mute.call(this),this)}finally{n()}})}unmute(){const e=Object.create(null,{unmute:{get:()=>super.unmute}});return F(this,void 0,void 0,function*(){const n=yield this.muteLock.lock();try{return this.isMuted?(this.source===fe.Source.Camera&&!this.isUserProvided&&(this.log.debug("reacquiring camera track",this.logContext),yield this.restart(void 0,!0)),yield e.unmute.call(this),this):(this.log.debug("Track already unmuted",this.logContext),this)}finally{n()}})}setTrackMuted(e){super.setTrackMuted(e);for(const n of this.simulcastCodecs.values())n.mediaStreamTrack.enabled=!e}getSenderStats(){return F(this,void 0,void 0,function*(){var e;if(!(!((e=this.sender)===null||e===void 0)&&e.getStats))return[];const n=[],r=yield this.sender.getStats();return r.forEach(i=>{var a;if(i.type==="outbound-rtp"){const s={type:"video",streamId:i.id,frameHeight:i.frameHeight,frameWidth:i.frameWidth,framesPerSecond:i.framesPerSecond,framesSent:i.framesSent,firCount:i.firCount,pliCount:i.pliCount,nackCount:i.nackCount,packetsSent:i.packetsSent,bytesSent:i.bytesSent,qualityLimitationReason:i.qualityLimitationReason,qualityLimitationDurations:i.qualityLimitationDurations,qualityLimitationResolutionChanges:i.qualityLimitationResolutionChanges,rid:(a=i.rid)!==null&&a!==void 0?a:i.id,retransmittedPacketsSent:i.retransmittedPacketsSent,targetBitrate:i.targetBitrate,timestamp:i.timestamp},o=r.get(i.remoteId);o&&(s.jitter=o.jitter,s.packetsLost=o.packetsLost,s.roundTripTime=o.roundTripTime),n.push(s)}}),n.sort((i,a)=>{var s,o;return((s=a.frameWidth)!==null&&s!==void 0?s:0)-((o=i.frameWidth)!==null&&o!==void 0?o:0)}),n})}setPublishingQuality(e){const n=[];for(let r=Ti.LOW;r<=Ti.HIGH;r+=1)n.push(new vP({quality:r,enabled:r<=e}));this.log.debug("setting publishing quality. max quality ".concat(e),this.logContext),this.setPublishingLayers(La(this.codec),n)}restartTrack(e){return F(this,void 0,void 0,function*(){var n,r,i,a,s;let o;if(e){const h=kP({video:e});typeof h.video!="boolean"&&(o=h.video)}yield this.restart(o),this.isCpuConstrained=!1;try{for(var c=!0,u=Ia(this.simulcastCodecs.values()),d;d=yield u.next(),n=d.done,!n;c=!0){a=d.value,c=!1;const h=a;h.sender&&((s=h.sender.transport)===null||s===void 0?void 0:s.state)!=="closed"&&(h.mediaStreamTrack=this.mediaStreamTrack.clone(),yield h.sender.replaceTrack(h.mediaStreamTrack))}}catch(h){r={error:h}}finally{try{!c&&!n&&(i=u.return)&&(yield i.call(u))}finally{if(r)throw r.error}}yield this.onSenderTrackSwapped()})}onSenderTrackSwapped(){return F(this,void 0,void 0,function*(){yield this.refreshSen
700derEncodings()})}refreshSenderEncodings(){return F(this,void 0,void 0,function*(){var e;if(!this.sender||!this.publishOptions||this.optimizeForPerformance)return;const n=yield this.senderLock.lock();try{let r;try{r=yield this.waitForDimensions()}catch(s){this.log.warn("could not determine new track dimensions, skipping encoding recompute",Object.assign(Object.assign({},this.logContext),{error:s}));return}if(this.lastEncodedDimensions&&this.lastEncodedDimensions.width===r.width&&this.lastEncodedDimensions.height===r.height)return;const i=this.source===fe.Source.ScreenShare,a=ob(i,r.width,r.height,Object.assign({},this.publishOptions));yield this.applyEncodingsToSender(this.sender,a),this.encodings=a,this.lastEncodedDimensions=r;for(const[s,o]of this.simulcastCodecs){if(!o.sender||((e=o.sender.transport)===null||e===void 0?void 0:e.state)==="closed"||!SW(s))continue;const c=Object.assign({},this.publishOptions),u=IW(this,s,c);u&&(yield this.applyEncodingsToSender(o.sender,u),o.encodings=u)}}catch(r){this.log.warn("failed to apply recomputed encodings",Object.assign(Object.assign({},this.logContext),{error:r}))}finally{n()}})}applyEncodingsToSender(e,n){return F(this,void 0,void 0,function*(){const r=e.getParameters();!r.encodings||r.encodings.length!==n.length||(r.encodings.forEac
700h((i,a)=>{if(i.active===!1)return;const s=n[a];s.scaleResolutionDownBy!==void 0&&(i.scaleResolutionDownBy=s.scaleResolutionDownBy),s.maxBitrate!==void 0&&(i.maxBitrate=s.maxBitrate),s.maxFramerate!==void 0&&(i.maxFramerate=s.maxFramerate),s.priority!==void 0&&(i.priority=s.priority,i.networkPriority=s.priority)}),this.log.debug("updating sender encodings after track restart",Object.assign(Object.assign({},this.logContext),{encodings:r.encodings})),yield e.setParameters(r))})}setProcessor(e){const n=Object.create(null,{setProcessor:{get:()=>super.setProcessor}});return F(this,arguments,void 0,function(r){var i=this;let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){var s,o,c,u,d,h;if(yield n.setProcessor.call(i,r,a),!((d=i.processor)===null||d===void 0)&&d.processedTrack)try{for(var f=!0,p=Ia(i.simulcastCodecs.values()),g;g=yield p.next(),s=g.done,!s;f=!0)u=g.value,f=!1,yield(h=u.sender)===null||h===void 0?void 0:h.replaceTrack(i.processor.processedTrack)}catch(m){o={error:m}}finally{try{!f&&!s&&(c=p.return)&&(yield c.call(p))}finally{if(o)throw o.error}}}()})}setDegradationPreference(e){return F(this,void 0,void 0,function*(){if(this.degradationPreference=e,this.sender)try{this.log.debug("setting degradationPreference to ".concat(e),this.logContext);const n=this.sender.getParameters();n.degradationPreference=e,this.sender.setParameters(n)}catch(n){this.log.warn("failed to set degradationPreference",Object.assign({error:n},this.logContext))}})}addSimulcastTrack(e,n){if(this.simulcastCodecs.has(e)){this.log.error("".concat(e," already added, skipping adding simulcast codec"),this.logContext);return}const r={codec:e,mediaStreamTrack:this.mediaStreamTrack.clone(),sender:void 0,encodings:n};return this.simulcastCodecs.set(e,r),r}setSimulcastTrackSender(e,n){const r=this.simulcastCodecs.get(e);r&&(r.sender=n,setTimeout(()=>{this.subscribedCodecs&&this.setPublishingCodecs(this.subscribedCodecs)},vge))}setPublishingCodecs(e){return F(this,void 0,void 0,function*(){var n,r,i,a,s,o,c;if(this.log.debug("setting publishing codecs",Object.assign(Object.assign({},this.logContext),{codecs:e,currentCodec:this.codec})),!this.codec&&e.length>0)return yield this.setPublishingLayers(La(e[0].codec),e[0].qualities),[];this.subscribedCodecs=e;const u=[];try{for(n=!0,r=Ia(e);i=yield r.next(),a=i.done,!a;n=!0){c=i.value,n=!1;const d=c;if(!this.codec||this.codec===d.codec)yield this.setPublishingLayers(La(d.codec),d.qualities);else{const h=this.simulcastCodecs.get(d.codec);if(this.log.debug("try setPublishingCodec for ".concat(d.codec),Object.assign(Object.assign({},this.logContext),{simulcastCodecInfo:h})),!h||!h.sender){for(const f of d.qualities)if(f.enabled){u.push(d.codec);break}}else h.encodings&&(this.log.debug("try setPublishingLayersForSender ".concat(d.codec),this.logContext),yield D4(h.sender,h.encodings,d.qualities,this.senderLock,La(d.codec),this.log,this.logContext))}}}catch(d){s={error:d}}finally{try{!n&&!a&&(o=r.return)&&(yield o.call(r))}finally{if(s)throw s.error}}return u})}setPublishingLayers(e,n){return F(this,void 0,void 0,function*(){if(this.optimizeForPerformance){this.log.info("skipping setPublishingLayers due to optimized publishing performance",Object.assign(Object.assign({},this.logContext),{qualities:n}));return}this.log.debug("setting publishing layers",Object.assign(Object.assign({},this.logContext),{qualities:n})),!(!this.sender||!this.encodings)&&(yield D4(this.sender,this.encodings,n,this.senderLock,e,this.log,this.logContext))})}prioritizePerformance(){return F(this,void 0,void 0,function*(){if(!this.sender)throw new Error("sender not found");const e=yield this.senderLock.lock();try{this.optimizeForPerformance=!0;const n=this.sender.getParameters();n.encodings=n.encodings.map((r,i)=>{var a;return Object.assign(Object.assign({},r),{active:i===0,scaleResolutionDownBy:Math.max(1,Math.ceil(((a=this.mediaStreamTrack.getSettings().height)!==null&&a!==void 0?a:360)/360)),scalabilityMode:i===0&&La(this.codec)?"L1T3":void 0,maxFramerate:i===0?15:0,maxBitrate:i===0?r.maxBitrate:0})}),this.log.debug("setting performance optimised encodings",Object.assign(Object.assign({},this.logContext),{encodings:n.encodings})),this.encodings=n.encodings,yield this.sender.setParameters(n)}catch(n){this.log.error("failed to set performance optimised encodings",Object.assign(Object.assign({},this.logContext),{error:n})),this.optimizeForPerformance=!1}finally{e()}})}handleAppVisibilityChanged(){const e=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return F(this,void 0,void 0,function*(){yield e.handleAppVisibilityChanged.call(this),EW()&&this.isInBackgroun
700d&&this.source===fe.Source.Camera&&(this._mediaStreamTrack.enabled=!1)})}}function D4(t,e,n,r,i,a,s){return F(this,void 0,void 0,function*(){const o=yield r.lock();a.debug("setPublishingLayersForSender",Object.assign(Object.assign({},s),{sender:t,qualities:n,senderEncodings:e}));try{const c=t.getParameters(),{encodings:u}=c;if(!u)return;if(u.length!==e.length){a.warn("cannot set publishing layers, encodings mismatch",Object.assign(Object.assign({},s),{encodings:u,senderEncodings:e}));return}let d=!1;!1&&u[0].scalabilityMode||(i&&n.some(p=>p.enabled)&&n.forEach(p=>p.enabled=!0),u.forEach((f,p)=>{var g;let m=(g=f.rid)!==null&&g!==void 0?g:"";m===""&&(m="q");const v=$W(m),x=n.find(w=>w.quality===v);x&&f.active!==x.enabled&&(d=!0,f.active=x.enabled,a.debug("setting layer ".concat(x.quality," to ").concat(f.active?"enabled":"disabled"),s),uu()&&(x.enabled?(f.scaleResolutionDownBy=e[p].scaleResolutionDownBy,f.maxBitrate=e[p].maxBitrate,f.maxFrameRate=e[p].maxFrameRate):(f.scaleResolutionDownBy=4,f.maxBitrate=10,f.maxFrameRate=2)))})),d&&(c.encodings=u,a.debug("setting encodings",Object.assign(Object.assign({},s),{encodings:c.encodings})),yield t.setParameters(c))}finally{o()}})}function $W(t){switch(t){case"f":return Ti.HIGH;case"h":return Ti.MEDIUM;case"q":return Ti.LOW;default:return Ti.HIGH}}function M4(t,e,n,r){if(!n)return[new kc({quality:Ti.HIGH,width:t,height:e,bitrate:0,ssrc:0})];if(r){const i=n[0].scalabilityMode,a=new LW(i),s=[],o=a.suffix=="h"?1.5:2,c=a.suffix=="h"?2:3;for(let u=0;u<a.spatial;u+=1)s.push(new kc({quality:Math.min(Ti.HIGH,a.spatial-1)-u,width:Math.ceil(t/Math.pow(o,u)),height:Math.ceil(e/Math.pow(o,u)),bitrate:n[0].maxBitrate?Math.ceil(n[0].maxBitrate/Math.pow(c,u)):0,ssrc:0}));return s}return n.map(i=>{var a,s,o;const c=(a=i.scaleResolutionDownBy)!==null&&a!==void 0?a:1;let u=$W((s=i.rid)!==null&&s!==void 0?s:"");return new kc({quality:u,width:Math.ceil(t/c),height:Math.ceil(e/c),bitrate:(o=i.maxBitrate)!==null&&o!==void 0?o:0,ssrc:0})})}const I4="_lossy",L4="_reliable",$4="_data_track",yge=2*1e3,ok="leave-reconnect",bge=3e4,xge=8*1024,wge=256*1024,Sge=3,kge=3;var zi;(function(t){t[t.New=0]="New",t[t.Connected=1]="Connected",t[t.Disconnected=2]="Disconnected",t[t.Reconnecting=3]="Reconnecting",t[t.Closed=4]="Closed"})(zi||(zi={}));var xt;(function(t){t[t.RELIABLE=0]="RELIABLE",t[t.LOSSY=1]="LOSSY",t[t.DATA_TRACK_LOSSY=2]="DATA_TRACK_LOSSY"})(xt||(xt={}));class _ge extends ca.EventEmitter{get isClosed(){return this._isClosed}get isNewlyCreated(){return this._isNewlyCreated}get pendingReconnect(){return!!this.reconnectTimeout}constructor(e){var n;super(),this.options=e,this.rtcConfig={},this.peerConnectionTimeout=AP.peerConnectionTimeout,this.fullReconnectOnNext=!1,this.latestRemoteOfferId=0,this.subscriberPrimary=!1,this.pcState=zi.New,this._isClosed=!0,this._isNewlyCreated=!0,this.pendingTrackResolvers={},this.reconnectAttempts=0,this.reconnectStart=0,this.attemptingReconnect=!1,this.joinAttempts=0,this.maxJoinAttempts=1,this.shouldFailNext=!1,this.shouldFailOnV1Path=!1,this.log=ft,this.reliableDataSequence=1,this.reliableMessageBuffer=new k4,this.reliableReceivedState=new qme(bge),this.lossyDataStatCurrentBytes=0,this.lossyDataStatByterate=0,this.lossyDataDropCount=0,this.midToTrackId={},this.isWaitingForNetworkReconnect=!1,this.bufferStatusLowClosingFuture=new Ur,this.handleDataChannel=r=>F(this,[r],void 0,function(i){var a=this;let{channel:s}=i;return function*(){if(!s)return;let o;if(s.label===L4)a.reliableDCSub=s,o=a.handleDataMessage;else if(s.label===I4)a.lossyDCSub=s,o=a.handleDataMessage;else if(s.label===$4)a.dataTrackDCSub=s,o=a.handleDataTrackMessage;else return;a.log.debug("on data channel ".concat(s.id,", ").concat(s.label),a.logContext),s.onmessage=o}()}),this.handleDataMessage=r=>F(this,void 0,void 0,function*(){var i,a,s,o,c;const u=yield this.dataProcessLock.lock();try{let d;if(r.data instanceof ArrayBuffer)d=r.data;else if(r.data instanceof Blob)d=yield r.data.arrayBuffer();else{this.log.error("unsupported data type",Object.assign(Object.assign({},this.logContext),{data:r.data}));return}const h=Fr.fromBinary(new Uint8Array(d));if(h.sequence>0&&h.participantSid!==""){const f=this.reliableReceivedState.get(h.participantSid);if(f&&h.sequence<=f)return;this.reliableReceivedState.set(h.participantSid,h.sequence)}if(((i=h.value)===null||i===void 0?void 0:i.case)==="speaker")this.emit
700(ve.ActiveSpeakersUpdate,h.value.value.speakers);else if(((a=h.value)===null||a===void 0?void 0:a.case)==="encryptedPacket"){if(!this.e2eeManager){this.log.error("Received encrypted packet but E2EE not set up",this.logContext);return}const f=yield(s=this.e2eeManager)===null||s===void 0?void 0:s.handleEncryptedData(h.value.value.encryptedValue,h.value.value.iv,h.participantIdentity,h.value.value.keyIndex),p=yz.fromBinary(f.payload),g=new Fr({value:p.value,participantIdentity:h.participantIdentity,participantSid:h.participantSid});((o=g.value)===null||o===void 0?void 0:o.case)==="user"&&F4(g,g.value.value),this.emit(ve.DataPacketReceived,g,h.value.value.encryptionType)}else((c=h.value)===null||c===void 0?void 0:c.case)==="user"&&F4(h,h.value.value),this.emit(ve.DataPacketReceived,h,Yt.NONE)}finally{u()}}),this.handleDataTrackMessage=r=>F(this,void 0,void 0,function*(){let i;if(r.data instanceof ArrayBuffer)i=r.data;else if(r.data instanceof Blob)i=yield r.data.arrayBuffer();else{this.log.error("unsupported data type",Object.assign(Object.assign({},this.logContext),{data:r.data}));return}this.emit("dataTrackPacketReceived",new Uint8Array(i))}),this.handleDataError=r=>{const a=r.currentTarget.maxRetransmits===0?"lossy":"reliable";if(r instanceof ErrorEvent&&r.error){const{error:s}=r.error;this.log.error("DataChannel error on ".concat(a,": ").concat(r.message),Object.assign(Object.assign({},this.logContext),{error:s}))}else this.log.error("Unknown DataChannel error on ".concat(a),Object.assign(Object.assign({},this.logContext),{event:r}))},this.handleBufferedAmountLow=r=>{this.updateAndEmitDCBufferStatus(r)},this.handleDisconnect=(r,i)=>{if(this._isClosed)return;this.log.warn("".concat(r," disconnected"),this.logContext),this.reconnectAttempts===0&&(this.reconnectStart=Date.now());const a=c=>{this.log.warn("could not recover connection after ".concat(this.reconnectAttempts," attempts, ").concat(c,"ms. giving up"),this.logContext),this.emit(ve.Disconnected),this.close()},s=Date.now()-this.reconnectStart;let o=this.getNextRetryDelay({elapsedMs:s,retryCount:this.reconnectAttempts});if(o===null){a(s);return}r===ok&&(o=0),this.log.debug("reconnecting in ".concat(o,"ms"),this.logContext),this.clearReconnectTimeout(),this.token&&this.emit(ve.TokenRefreshed,this.token),this.reconnectTimeout=Vn.setTimeout(()=>this.attemptReconnect(i).finally(()=>this.reconnectTimeout=void 0),o)},this.waitForRestarted=()=>new Promise((r,i)=>{this.pcState===zi.Connected&&r();const a=()=>{this.off(ve.Disconnected,s),r()},s=()=>{this.off(ve.Restarted,a),i()};this.once(ve.Restarted,a),this.once(ve.Disconnected,s)}),this.updateAndEmitDCBufferStatus=r=>{if(r===xt.RELIABLE){const a=this.dataChannelForKind(r);a&&this.reliableMessageBuffer.alignBufferedAmount(a.bufferedAmount)}const i=this.isBufferStatusLow(r);typeof i<"u"&&i!==this.dcBufferStatus.get(r)&&(this.dcBufferStatus.set(r,i),this.emit(ve.DCBufferStatusChanged,i,r))},this.isBufferStatusLow=r=>{const i=this.dataChannelForKind(r);if(i)return i.bufferedAmount<=i.bufferedAmountLowThreshold},this.handleBrowserOnLine=()=>F(this,void 0,void 0,function*(){!this.url||!(yield fetch(Vm(this.url),{method:"HEAD"}).then(i=>i.ok).catch(()=>!1))||(this.log.info("detected network reconnected"),(this.client.currentState===Kt.RECONNECTING||this.isWaitingForNetworkReconnect&&this.client.currentState===Kt.CONNECTED)&&(this.clearReconnectTimeout(),this.attemptReconnect(ll.RR_SIGNAL_DISCONNECTED),this.isWaitingForNetworkReconnect=!1))}),this.handleBrowserOffline=()=>F(this,void 0,void 0,function*(){if(this.url)try{yield Promise.race([fetch(Vm(this.url),{method:"HEAD"}),Nr(4e3).then(()=>Promise.reject())])}catch{window.navigator.onLine===!1&&(this.log.info("detected network interruption"),this.isWaitingForNetworkReconnect=!0)}}),this.log=li((n=e.loggerName)!==null&&n!==void 0?n:Rr.Engine),this.loggerOptions={loggerName:e.loggerName,loggerContextCb:()=>this.logContext},this.client=new EP(void 0,this.loggerOptions),this.client.signalLatency=this.options.expSignalLatency,this.reconnectPolicy=this.options.reconnectPolicy,this.closingLock=new gr,this.dataProcessLock=new gr,this.dcBufferStatus=new Map([[xt.RELIABLE,!0],[xt.LOSSY,!0
700],[xt.DATA_TRACK_LOSSY,!0]]),this.client.onParticipantUpdate=r=>this.emit(ve.ParticipantUpdate,r),this.client.onConnectionQuality=r=>this.emit(ve.ConnectionQualityUpdate,r),this.client.onRoomUpdate=r=>this.emit(ve.RoomUpdate,r),this.client.onSubscriptionError=r=>this.emit(ve.SubscriptionError,r),this.client.onSubscriptionPermissionUpdate=r=>this.emit(ve.SubscriptionPermissionUpdate,r),this.client.onSpeakersChanged=r=>this.emit(ve.SpeakersChanged,r),this.client.onStreamStateUpdate=r=>this.emit(ve.StreamStateChanged,r),this.client.onRequestResponse=r=>this.emit(ve.SignalRequestResponse,r),this.client.onParticipantUpdate=r=>this.emit(ve.ParticipantUpdate,r),this.client.onJoined=r=>this.emit(ve.Joined,r),this.on(ve.Closing,()=>{var r,i;(i=(r=this.bufferStatusLowClosingFuture).reject)===null||i===void 0||i.call(r,new bn("engine closed"))}),this.bufferStatusLowClosingFuture.promise.catch(()=>{})}get logContext(){var e,n,r,i,a,s;return{room:(n=(e=this.latestJoinResponse)===null||e===void 0?void 0:e.room)===null||n===void 0?void 0:n.name,roomID:(i=(r=this.latestJoinResponse)===null||r===void 0?void 0:r.room)===null||i===void 0?void 0:i.sid,participant:(s=(a=this.latestJoinResponse)===null||a===void 0?void 0:a.participant)===null||s===void 0?void 0:s.identity,participantID:this.participantSid}}join(e,n,r,i){return F(this,arguments,void 0,function(a,s,o,c){var u=this;let d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;return function*(){var h,f,p,g,m,v;u._isNewlyCreated=!1,u.url=a,u.token=s,u.signalOpts=o,u.maxJoinAttempts=o.maxRetries;try{u.joinAttempts+=1,u.setupSignalClientCallbacks();let x;if(!d&&lT()){u.pcManager||(yield u.configure(),u.createDataChannels(),u.addMediaSections(Sge,kge));const k=yield(h=u.pcManager)===null||h===void 0?void 0:h.publisher.createInitialOffer();k&&(x=wl(k.offer,k.offerId))}if(c!=null&&c.aborted)throw Ge.cancelled("Connection aborted");if(!d&&u.shouldFailOnV1Path)throw u.shouldFailOnV1Path=!1,Ge.serviceNotFound("Simulated v1 path failure","v0-rtc");const w=yield u.client.join(a,s,o,c,d,x);u._isClosed=!1,u.latestJoinResponse=w,u.participantSid=(f=w.participant)===null||f===void 0?void 0:f.sid,u.subscriberPrimary=w.subscriberPrimary,!d&&lT()?(p=u.pcManager)===null||p===void 0||p.updateConfiguration(u.makeRTCConfiguration(w)):(u.pcManager||(yield u.configure(w,!d)),(!u.subscriberPrimary||w.fastPublish)&&u.negotiate().catch(k=>{ft.error(k,u.logContext)})),u.registerOnLineListener(),u.clientConfiguration=w.clientConfiguration,u.emit(ve.SignalConnected,w);let y=w.serverInfo;return y||(y={version:w.serverVersion,region:w.serverRegion}),u.log.debug("connected to Livekit Server ".concat(Object.entries(y).map(k=>{let[S,_]=k;return"".concat(S,": ").concat(_)}).join(", ")),{room:(g=w.room)===null||g===void 0?void 0:g.name,roomSid:(m=w.room)===null||m===void 0?void 0:m.sid,identity:(v=w.participant)===null||v===void 0?void 0:v.identity}),{joinResponse:w,serverInfo:y}}catch(x){if(x instanceof Ge){if(x.reason===Gt.ServerUnreachable){if(u.log.warn("Couldn't connect to server, attempt ".concat(u.joinAttempts," of ").concat(u.maxJoinAttempts),u.logContext),u.joinAttempts<u.maxJoinAttempts)return u.join(a,s,o,c,d)}else if(x.reason===Gt.ServiceNotFound)return u.log.warn("Initial connection failed: ".concat(x.message," â Retrying")),u.pcManager&&(u.pcManager.onStateChange=void 0,yield u.cleanupPeerConnections()),u.join(a,s,o,c,!0)}throw x}}()})}close(){return F(this,void 0,void 0,function*(){const e=yield this.closingLock.lock();if(this.isClosed){e();return}try{this._isClosed=!0,this.joinAttempts=0,this.emit(ve.Closing),this.removeAllListeners(),this.deregisterOnLineListener(),this.clearPendingReconnect(),this.cleanupLossyDataStats(),yield this.cleanupPeerConnections(),yield this.cleanupClient()}finally{e()}})}cleanupPeerConnections(){return F(this,void 0,void 0,function*(){var e;yield(e=this.pcManager)===null||e===void 0?void 0:e.close(),this.pcManager=void 0;const n=r=>{r&&(r.close(),r.onbufferedamountlow=null,r.onclose=null,r.onclosing=null,r.onerror=null,r.onmessage=null,r.onopen=null)};n(this.lossyDC),n(this.lossyDCSub),n(this.reliableDC),n(this.reliableDCSub),n(this.dataTrackDC),n(this.dataTrackDCSub),this.lossyDC=void 0,this.lossyDCSub=void 0,this.reliableDC=void 0,this.reliableDCSub=void 0,this.dataTrackDC=void 0,this.dataTrackDCSub=void 0,this.reliableMessageBuffer=new k4,this.reliableDataSequence=1,this.reliableReceivedState.clear()})}cleanupLossyDataStats(){this.lossyDataStatByterate=0,this.lossyDataStatCurrentBytes=0,this.lossyDataStatInterval&&(clearInterval(this.lossyDataStatInterval),this.lossyDataStatInterval=void 0),this.lossyDataDropCount=0}cleanupClient(){return F(this,void 0,void 0,function*(){yield this.client.close(),this.client.resetCallbacks();for(const e of Object.keys(this.pendingTrackResolvers))this.pendingTrackResolvers[e].reject();this.pendingTrackResolvers={}})}addTrack(e){if(this.pendingTrackResolvers[e.cid])throw new Qs("a track with the same ID has already been published");return new Promise((n,r)=>{const i=setTimeout(()=>{delete this.pendingTrackResolvers[e.cid],r(Ge.timeout("publication of local track timed out, no response from server"))},1e4);this.pendingTrackResolvers[e.cid]={resolve:a=>{clearTimeout(i),n(a)},reject:()=>{clearTimeout(i),r(new Error("Cancelled publication by calling unpublish"))}},this.client.sendAddTrack(e)})}removeTrack(e){if(e.track&&this.pendingTrackResolvers[e.track.id]){const{reject:n}=this.pendingTrackResolvers[e.track.id];n&&n(),delete this.pendingTrackResolvers[e.track.id]}try{return this.pcManager.removeTrack(e),!0}catch(n){this.log.warn("failed to remove track",Object.assign(Object.assign({},this.logContext),{error:n}))}return!1}
700updateMuteStatus(e,n){this.client.sendMuteTrack(e,n)}get dataSubscriberReadyState(){var e;return(e=this.reliableDCSub)===null||e===void 0?void 0:e.readyState}getConnectedServerAddress(){return F(this,void 0,void 0,function*(){var e;return(e=this.pcManager)===null||e===void 0?void 0:e.getConnectedAddress()})}setRegionStrategy(e){this.regionStrategy=e}configure(e,n){return F(this,void 0,void 0,function*(){var r;if(!(this.pcManager&&this.pcManager.currentState!==wn.NEW)){if(e){this.participantSid=(r=e.participant)===null||r===void 0?void 0:r.sid;const i=this.makeRTCConfiguration(e);this.pcManager=new N4(n?"publisher-only":e.subscriberPrimary?"subscriber-primary":"publisher-primary",this.loggerOptions,i)}else{const i=this.makeRTCConfiguration();this.pcManager=new N4("publisher-only",this.loggerOptions,i)}this.emit(ve.TransportsCreated,this.pcManager.publisher,this.pcManager.subscriber),this.pcManager.onIceCandidate=(i,a)=>{this.client.sendIceCandidate(i,a)},this.pcManager.onPublisherOffer=(i,a)=>{this.client.sendOffer(i,a)},this.pcManager.onDataChannel=this.handleDataChannel,this.pcManager.onStateChange=(i,a,s)=>F(this,void 0,void 0,function*(){if(this.log.debug("primary PC state changed ".concat(i),this.logContext),["closed","disconnected","failed"].includes(a)&&(this.publisherConnectionPromise=void 0),i===wn.CONNECTED){const u=this.pcState===zi.New;this.pcState=zi.Connected,u&&this.emit(ve.Connected,this.latestJoinResponse)}else i===wn.FAILED&&(this.pcState===zi.Connected||this.pcState===zi.Reconnecting)&&(this.pcState=zi.Disconnected,this.handleDisconnect("peerconnection failed",s==="failed"?ll.RR_SUBSCRIBER_FAILED:ll.RR_PUBLISHER_FAILED));const o=this.client.isDisconnected||this.client.currentState===Kt.RECONNECTING,c=[wn.FAILED,wn.CLOSING,wn.CLOSED].includes(i);o&&c&&!this._isClosed&&this.emit(ve.Offline)}),this.pcManager.onTrack=i=>{i.streams.length!==0&&this.emit(ve.MediaTrackAdded,i.track,i.streams[0],i.receiver)}}})}setupSignalClientCallbacks(){this.client.onAnswer=(e,n,r)=>F(this,void 0,void 0,function*(){this.pcManager&&(this.log.debug("received server answer",Object.assign(Object.assign({},this.logContext),{RTCSdpType:e.type,sdp:e.sdp,midToTrackId:r})),this.midToTrackId=r,yield this.pcManager.setPublisherAnswer(e,n))}),this.client.onTrickle=(e,n)=>{this.pcManager&&(this.log.debug("got ICE candidate from peer",Object.assign(Object.assign({},this.logContext),{candidate:e,target:n})),this.pcManager.addIceCandidate(e,n))},this.client.onOffer=(e,n,r)=>F(this,void 0,void 0,function*(){if(this.latestRemoteOfferId=n,!this.pcManager)return;this.midToTrackId=r;const i=yield this.pcManager.createSubscriberAnswerFromOffer(e,n);i&&this.client.sendAnswer(i,n)}),this.client.onLocalTrackPublished=e=>{var n;if(this.log.debug("received trackPublishedResponse",Object.assign(Object.assign({},this.logContext),{cid:e.cid,track:(n=e.track)===null||n===void 0?void 0:n.sid})),!this.pendingTrackResolvers[e.cid]){this.log.error("missing track resolver for ".concat(e.cid),Object.assign(Object.assign({},this.logContext),{cid:e.cid}));return}const{resolve:r}=this.pendingTrackResolvers[e.cid];delete this.pendingTrackResolvers[e.cid],r(e.track)},this.client.onLocalTrackUnpublished=e=>{this.emit(ve.LocalTrackUnpublished,e)},this.client.onLocalTrackSubscribed=e=>{this.emit(ve.LocalTrackSubscribed,e)},this.client.onTokenRefresh=e=>{this.token=e,this.emit(ve.TokenRefreshed,e)},this.client.onRemoteMuteChanged=(e,n)=>{this.emit(ve.RemoteMute,e,n)},this.client.onSubscribedQualityUpdate=e=>{this.emit(ve.SubscribedQualityUpdate,e)},this.client.onRoomMoved=e=>{var n;this.participantSid=(n=e.participant)===null||n===void 0?void 0:n.sid,this.latestJoinResponse&&(this.latestJoinResponse.room=e.room),this.emit(ve.RoomMoved,e)},this.client.onMediaSectionsRequirement=e=>{this.addMediaSections(e.numAudios,e.numVideos),this.negotiate()},this.client.onPublishDataTrackResponse=e=>{this.emit(ve.PublishDataTrackResponse,e)},this.client.onUnPublishDataTrackResponse=e=>{this.emit(ve.UnPublishDataTrackResponse,e)},this.client.onDataTrackSubscriberHandles=e=>{this.emit(ve.DataTrackSubscriberHandles,e)},this.client.onClose=()=>{this.handleDisconnect("signal",ll.RR_SIGNAL_DISCONNECTED)},this.client.onLeave=e=>{switch(this.log.debug("client leave request",Object.assign(Object.assign({},this.logContext),{reason:e==null?void 0:e.reason}
vendor: 5,298 bytes, line 700
700)),e.regions&&(this.log.debug("updating regions",this.logContext),this.emit(ve.ServerRegionsReported,e.regions)),e.action){case Id.DISCONNECT:this.emit(ve.Disconnected,e==null?void 0:e.reason),this.close();break;case Id.RECONNECT:this.fullReconnectOnNext=!0,this.handleDisconnect(ok);break;case Id.RESUME:this.handleDisconnect(ok)}}}makeRTCConfiguration(e){var n;const r=Object.assign({},this.rtcConfig);if(!((n=this.signalOpts)===null||n===void 0)&&n.e2eeEnabled&&(this.log.debug("E2EE - setting up transports with insertable streams",this.logContext),r.encodedInsertableStreams=!0),r.sdpSemantics="unified-plan",r.continualGatheringPolicy="gather_continually",!e)return r;if(e.iceServers&&!r.iceServers){const i=[];e.iceServers.forEach(a=>{const s={urls:a.urls};a.username&&(s.username=a.username),a.credential&&(s.credential=a.credential),i.push(s)}),r.iceServers=i}return e.clientConfiguration&&e.clientConfiguration.forceRelay===Fm.ENABLED&&(r.iceTransportPolicy="relay"),r}addMediaSections(e,n){var r,i;const a={direction:"recvonly"};for(let s=0;s<e;s++)(r=this.pcManager)===null||r===void 0||r.addPublisherTransceiverOfKind("audio",a);for(let s=0;s<n;s++)(i=this.pcManager)===null||i===void 0||i.addPublisherTransceiverOfKind("video",a)}createDataChannels(){this.pcManager&&(this.lossyDC&&(this.lossyDC.onmessage=null,this.lossyDC.onerror=null),this.reliableDC&&(this.reliableDC.onmessage=null,this.reliableDC.onerror=null),this.dataTrackDC&&(this.dataTrackDC.onmessage=null,this.dataTrackDC.onerror=null),this.lossyDC=this.pcManager.createPublisherDataChannel(I4,{ordered:!1,maxRetransmits:0}),this.reliableDC=this.pcManager.createPublisherDataChannel(L4,{ordered:!0}),this.dataTrackDC=this.pcManager.createPublisherDataChannel($4,{ordered:!1,maxRetransmits:0}),this.lossyDC.onmessage=this.handleDataMessage,this.reliableDC.onmessage=this.handleDataMessage,this.dataTrackDC.onmessage=this.handleDataTrackMessage,this.lossyDC.onerror=this.handleDataError,this.reliableDC.onerror=this.handleDataError,this.dataTrackDC.onerror=this.handleDataError,this.lossyDC.bufferedAmountLowThreshold=65535,this.reliableDC.bufferedAmountLowThreshold=65535,this.dataTrackDC.bufferedAmountLowThreshold=65535,this.lossyDC.onbufferedamountlow=()=>this.handleBufferedAmountLow(xt.LOSSY),this.reliableDC.onbufferedamountlow=()=>this.handleBufferedAmountLow(xt.RELIABLE),this.dataTrackDC.onbufferedamountlow=()=>this.handleBufferedAmountLow(xt.DATA_TRACK_LOSSY),this.cleanupLossyDataStats(),this.lossyDataStatInterval=setInterval(()=>{this.lossyDataStatByterate=this.lossyDataStatCurrentBytes,this.lossyDataStatCurrentBytes=0;const e=this.dataChannelForKind(xt.LOSSY);if(e){const n=this.lossyDataStatByterate/10;e.bufferedAmountLowThreshold=Math.min(Math.max(n,xge),wge)}},1e3))}createSender(e,n,r){return F(this,void 0,void 0,function*(){if(aT())return yield this.createTransceiverRTCRtpSender(e,n,r);if(sT())return this.log.warn("using add-track fallback",this.logContext),yield this.createRTCRtpSender(e.mediaStreamTrack);throw new bn("Required webRTC APIs not supported on this device")})}createSimulcastSender(e,n,r,i){return F(this,void 0,void 0,function*(){if(aT())return this.createSimulcastTransceiverSender(e,n,r,i);if(sT())return this.log.debug("using add-track fallback",this.logContext),this.createRTCRtpSender(e.mediaStreamTrack);throw new bn("Cannot stream on this device")})}createTransceiverRTCRtpSender(e,n,r){return F(this,void 0,void 0,function*(){if(!this.pcManager)throw new bn("publisher is closed");const i=[];e.mediaStream&&i.push(e.mediaStream),qc(e)&&(e.codec=n.videoCodec);const a={direction:"sendonly",streams:i};return r&&(a.sendEncodings=r),(yield this.pcManager.addPublisherTransceiver(e.mediaStreamTrack,a)).sender})}createSimulcastTransceiverSender(e,n,r,i){return F(this,void 0,void 0,function*(){if(!this.pcManager)throw new bn("publisher is closed");const a={direction:"sendonly"};i&&(a.sendEncodings=i);const s=yield this.pcManager.addPublisherTransceiver(n.mediaStreamTrack,a);if(r.videoCodec)return e.setSimulcastTrackSender(r.videoCodec,s.sender),s.sender})}createRTCRtpSender(e){return F(this,void 0,void 0,function*(){if(!this.pcManager)throw new bn("publisher is closed");return this.pcManager.addPublisherTrack(e)})}attemptReconnect(e){return F(this,void 0,void 0,function*(){var n,r,i;if(!this._isClosed){if(this.attemptingReconnect){ft.warn("already attempting reconnect, returning early",this.logContext);return}(((n=this.clientConfiguration)===null||n===void 0?void 0:n.resumeConnection)===Fm.DISABLED||((i=(r=this.pcManager)===null||r===void 0?void 0:r.currentState)!==null&&i!==void 0?i:wn.NEW)===wn.NEW)&&(this.fullReconnectOnNext=!0);try{this.attemptingReconnect=!0,this.fullReconnectOnNext?yield this.restartConnection():yield this.resumeConnection(e),this.clearPendingReconnect(),this.fullReconnectOnNext=!1}catch(a){this.reconnectAttempts+=1;let s=!0;a instanceof bn?(this.log.debug("received unrecoverable error",Object.assign(Object.assign({},this.logContext),{error:a})),s=!1):a instanceof Ku||(this.fullReconnectOnNext=!0),s?this.handleDisconnect("reconnect",ll.RR_UNKNOWN):(this.log.info("could not recover connection after ".concat(this.reconnectAttempts," attempts, ").concat(Date.now()-this.reconnectStart,"ms. giving up"),this.logContext),this.emit
vendor: 2,400 bytes, line 700
700(ve.Disconnected),yield this.close())}finally{this.attemptingReconnect=!1}}})}getNextRetryDelay(e){try{return this.reconnectPolicy.nextRetryDelayInMs(e)}catch(n){this.log.warn("encountered error in reconnect policy",Object.assign(Object.assign({},this.logContext),{error:n}))}return null}restartConnection(e){return F(this,void 0,void 0,function*(){var n,r,i;try{if(!this.url||!this.token)throw new bn("could not reconnect, url or token not saved");this.log.info("reconnecting, attempt: ".concat(this.reconnectAttempts),this.logContext),this.emit(ve.Restarting),this.client.isDisconnected||(yield this.client.sendLeave()),yield this.cleanupPeerConnections(),yield this.cleanupClient();let a;try{if(!this.signalOpts)throw this.log.warn("attempted connection restart, without signal options present",this.logContext),new Ku;a=(yield this.join(e??this.url,this.token,this.signalOpts,void 0,!this.options.singlePeerConnection)).joinResponse}catch(s){throw s instanceof Ge&&s.reason===Gt.NotAllowed?new bn("could not reconnect, token might be expired"):new Ku}if(this.shouldFailNext)throw this.shouldFailNext=!1,new Error("simulated failure");if(this.client.setReconnected(),this.emit(ve.SignalRestarted,a),yield this.waitForPCReconnected(),this.client.currentState!==Kt.CONNECTED)throw new Ku("Signal connection got severed during reconnect");(n=this.regionStrategy)===null||n===void 0||n.resetAttempts(),this.emit(ve.Restarted)}catch(a){const s=yield(r=this.regionStrategy)===null||r===void 0?void 0:r.getNextUrl();if(s){yield this.restartConnection(s);return}else throw(i=this.regionStrategy)===null||i===void 0||i.resetAttempts(),a}})}resumeConnection(e){return F(this,void 0,void 0,function*(){var n;if(!this.url||!this.token)throw new bn("could not reconnect, url or token not saved");if(!this.pcManager)throw new bn("publisher and subscriber connections unset");this.log.info("resuming signal connection, attempt ".concat(this.reconnectAttempts),this.logContext),this.emit(ve.Resuming);let r;try{this.setupSignalClientCallbacks(),r=yield this.client.reconnect(this.url,this.token,this.participantSid,e)}catch(i){let a="";throw i instanceof Error&&(a=i.message,this.log.error(i.message,Object.assign(Object.assign({},this.logContext),{error:i}))),i instanceof Ge&&i.reason===Gt.NotAllowed?new bn("could not reconnect, token might be expired"):i instanceof Ge&&i.reason===Gt.LeaveRequest?i:new Ku(a)}
700if(this.emit(ve.SignalResumed),r){const i=this.makeRTCConfiguration(r);this.pcManager.updateConfiguration(i),this.latestJoinResponse&&(this.latestJoinResponse.serverInfo=r.serverInfo)}else this.log.warn("Did not receive reconnect response",this.logContext);if(this.shouldFailNext)throw this.shouldFailNext=!1,new Error("simulated failure");if(yield this.pcManager.triggerIceRestart(),yield this.waitForPCReconnected(),this.client.currentState!==Kt.CONNECTED)throw new Ku("Signal connection got severed during reconnect");this.client.setReconnected(),((n=this.reliableDC)===null||n===void 0?void 0:n.readyState)==="open"&&this.reliableDC.id===null&&this.createDataChannels(),r!=null&&r.lastMessageSeq&&this.resendReliableMessagesForResume(r.lastMessageSeq),this.emit(ve.Resumed)})}waitForPCInitialConnection(e,n){return F(this,void 0,void 0,function*(){if(!this.pcManager)throw new bn("PC manager is closed");yield this.pcManager.ensurePCTransportConnection(n,e)})}waitForPCReconnected(){return F(this,void 0,void 0,function*(){this.pcState=zi.Reconnecting,this.log.debug("waiting for peer connection to reconnect",this.logContext);try{if(yield Nr(yge),!this.pcManager)throw new bn("PC manager is closed");yield this.pcManager.ensurePCTransportConnection(void 0,this.peerConnectionTimeout),this.pcState=zi.Connected}catch(e){throw this.pcState=zi.Disconnected,Ge.internal("could not establish PC connection, ".concat(e.message))}})}publishRpcResponse(e,n,r,i){return F(this,void 0,void 0,function*(){const a=new Fr({destinationIdentities:[e],kind:Pl.RELIABLE,value:{case:"rpcResponse",value:new uP({requestId:n,value:i?{case:"error",value:i.toProto()}:{case:"payload",value:r??""}})}});yield this.sendDataPacket(a,xt.RELIABLE)})}publishRpcAck(e,n){return F(this,void 0,void 0,function*(){const r=new Fr({destinationIdentities:[e],kind:Pl.RELIABLE,value:{case:"rpcAck",value:new lP({requestId:n})}});yield this.sendDataPacket(r,xt.RELIABLE)})}sendDataPacket(e,n){return F(this,void 0,void 0,function*(){if(yield this.ensurePublisherConnected(n),this.e2eeManager&&this.e2eeManager.isDataChannelEncryptionEnabled){const i=Rme(e);if(i){const a=yield this.e2eeManager.encryptData(i.toBinary());e.value={case:"encryptedPacket",value:new vz({encryptedValue:a.payload,iv:a.iv,keyIndex:a.keyIndex})}}}n===xt.RELIABLE&&(e.sequence=this.reliableDataSequence,this.reliableDataSequence+=1);const r=e.toBinary();switch(n){case xt.LOSSY:case xt.DATA_TRACK_LOSSY:return this.sendLossyBytes(r,n);case xt.RELIABLE:const i=this.dataChannelForKind(n);if(i){if(yield this.waitForBufferStatusLow(n),this.reliableMessageBuffer.push({data:r,sequence:e.sequence}),this.attemptingReconnect)return;i.send(r)}this.updateAndEmitDCBufferStatus(n);break}})}sendLossyBytes(e,n){return F(this,arguments,void 0,function(r,i){var a=this;let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"drop";return function*(){yield a.ensurePublisherConnected(i);const o=a.dataChannelForKind(i);if(o){if(!a.isBufferStatusLow(i))switch(s){case"wait":yield a.waitForBufferStatusLow(i);break;case"drop":a.lossyDataDropCount+=1,a.lossyDataDropCount%100===0&&a.log.warn("dropping lossy data channel messages, total dropped: ".concat(a.lossyDataDropCount),a.logContext);return}if(a.lossyDataStatCurrentBytes+=r.byteLength,a.attemptingReconnect)return;o.send(r)}a.updateAndEmitDCBufferStatus(i)}()})}resendReliableMessagesForResume(e){return F(this,void 0,void 0,function*(){yield this.ensurePublisherConnected(xt.RELIABLE);const n=this.dataChannelForKind(xt.RELIABLE);n&&(this.reliableMessageBuffer.popToSequence(e),this.reliableMessageBuffer.getAll().forEach(r=>{n.send(r.data)})),this.updateAndEmitDCBufferStatus(xt.RELIABLE)})}waitForBufferStatusLow(e){return F(this,void 0,void 0,function*(){return new jr((n,r)=>F(this,void 0,void 0,function*(){if(this.isClosed&&r(new bn("engine closed")),this.isBufferStatusLow(e))n();else{const i=this.dataChannelForKind(e);if(!i){r(new bn("DataChannel not found, kind: ".concat(e)));return}this.bufferStatusLowClosingFuture.promise.catch(a=>r(a)),i.addEventListener("bufferedamountlow",()=>n(),{once:!0})}}))})}ensureDataTransportConnected(e){return F(this,arguments,void 0,function(n){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.subscriberPrimary;return function*(){var a;if(!r.pcManager)throw new bn("PC manager is closed");const s=i?r.pcManager.subscriber:r.pcManager.publisher,o=i?"Subscriber":"Publisher";if(!s)throw Ge.internal("".concat(o," connection not set"));let c=!1;!i&&!r.dataChannelForKind(n,i)&&(r.createDataChannels(),c=!0),!c&&!i&&!r.pcManager.publisher.isICEConnected&&r.pcManager.publisher.getICEConnectionState()!=="checking"&&(c=!0),c&&r.negotiate().catch(h=>{ft.error(h,r.logContext)});const u=r.dataChannelForKind(n,i);if((u==null?void 0:u.readyState)==="open")return;const d=new Date().getTime()+r.peerConnectionTimeout;for(;new Date().getTime()<d;){if(s.isICEConnected&&((a=r.dataChannelForKind(n,i))===null||a===void 0?void 0:a.readyState)==="open")return;yield Nr(50)}throw Ge.internal("could not establish ".concat(o," connection, state: ").concat(s.getICEConnectionState()))}()})}ensurePublisherConnected(e){return F(this,void 0,void 0,function*(){this.publisherConnectionPromise||(this.publisherConnectionPromise=this.ensureDataTransportConnected(e,!1)),yield this.publisherConnectionPromise})}verifyTransport(){return!(!this.pcManager||![wn.CONNECTING,wn.CONNECTED].includes(this.pcManager.currentState)||!this.client.ws||this.client.ws.readyState===WebSocket.CLOSED)}negotiate(){return F(this,void 0,void 0,function*(){return new jr((e,n)=>F(this,void 0,void 0,function*(){if(!this.pcManager){n(new _c("PC manager is closed"));return}this.pcManager.requirePublisher(),this.pcManager.publisher.getTransceivers().length==0&&!this.lossyDC&&!this.reliableDC&&!this.dataTrackDC&&this.createDataChannels();const r=new AbortController,i=()=>{r.abort(),this.log.debug("engine disconnected while negotiation was ongoing",this.logContext),e()};this.isClosed&&n(new _c("cannot negotiate on closed engine")),this.on(ve.Closing,i),this.on(ve.Restarting,i),this.pcManager.publisher.once(Vl.RTPVideoPayloadTypes,a=>{const s=new Map;a.forEach(o=>{const c=o.codec.toLowerCase();gme(c)&&s.set(o.payload,c)}
700),this.emit(ve.RTPVideoMapUpdate,s)});try{yield this.pcManager.negotiate(r),e()}catch(a){if(r.signal.aborted){e();return}a instanceof _c&&(this.fullReconnectOnNext=!0),this.handleDisconnect("negotiation",ll.RR_UNKNOWN),a instanceof Error?n(a):n(new Error(String(a)))}finally{this.off(ve.Closing,i),this.off(ve.Restarting,i)}}))})}dataChannelForKind(e,n){switch(e){case xt.RELIABLE:return n?this.reliableDCSub:this.reliableDC;case xt.LOSSY:return n?this.lossyDCSub:this.lossyDC;case xt.DATA_TRACK_LOSSY:return n?this.dataTrackDCSub:this.dataTrackDC}}sendSyncState(e,n,r){var i,a,s,o;if(!this.pcManager){this.log.warn("sync state cannot be sent without peer connection setup",this.logContext);return}const c=this.pcManager.publisher.getLocalDescription(),u=this.pcManager.publisher.getRemoteDescription(),d=(i=this.pcManager.subscriber)===null||i===void 0?void 0:i.getRemoteDescription(),h=(a=this.pcManager.subscriber)===null||a===void 0?void 0:a.getLocalDescription(),f=(o=(s=this.signalOpts)===null||s===void 0?void 0:s.autoSubscribe)!==null&&o!==void 0?o:!0,p=new Array,g=new Array;e.forEach(m=>{m.isDesired!==f&&p.push(m.trackSid),m.isEnabled||g.push(m.trackSid)}),this.client.sendSyncState(new yP({answer:this.pcManager.mode==="publisher-only"?u?wl({sdp:u.sdp,type:u.type}):void 0:h?wl({sdp:h.sdp,type:h.type}):void 0,offer:this.pcManager.mode==="publisher-only"?c?wl({sdp:c.sdp,type:c.type}):void 0:d?wl({sdp:d.sdp,type:d.type}):void 0,subscription:new Tw({trackSids:p,subscribe:!f,participantTracks:[]}),publishTracks:Qpe(n),dataChannels:this.dataChannelsInfo(),trackSidsDisabled:g,datachannelReceiveStates:this.reliableReceivedState.map((m,v)=>new Fz({publisherSid:v,lastSeq:m})),publishDataTracks:r.map(m=>new hP({info:ab.toProtobuf(m)}))}))}failNext(){this.shouldFailNext=!0}failNextV1Path(){this.shouldFailOnV1Path=!0}dataChannelsInfo(){const e=[],n=(r,i)=>{(r==null?void 0:r.id)!==void 0&&r.id!==null&&e.push(new Bz({label:r.label,id:r.id,target:i}))};return n(this.dataChannelForKind(xt.LOSSY),Ma.PUBLISHER),n(this.dataChannelForKind(xt.RELIABLE),Ma.PUBLISHER),n(this.dataChannelForKind(xt.LOSSY,!0),Ma.SUBSCRIBER),n(this.dataChannelForKind(xt.RELIABLE,!0),Ma.SUBSCRIBER),e}clearReconnectTimeout(){this.reconnectTimeout&&Vn.clearTimeout(this.reconnectTimeout)}clearPendingReconnect(){this.clearReconnectTimeout(),this.reconnectAttempts=0}registerOnLineListener(){ni()&&(window.addEventListener("online",this.handleBrowserOnLine),window.addEventListener("offline",this.handleBrowserOffline))}deregisterOnLineListener(){ni()&&(window.removeEventListener("online",this.handleBrowserOnLine),window.removeEventListener("offline",this.handleBrowserOffline))}getTrackIdForReceiver(e){var n;const r=(n=this.pcManager)===null||n===void 0?void 0:n.getMidForReceiver(e);if(r){const i=Object.entries(this.midToTrackId).find(a=>{let[s]=a;return s===r});if(i)return i[1]}}}function F4(t,e){const n=t.participantIdentity?t.participantIdentity:e.participantIdentity;t.participantIdentity=n,e.participantIdentity=n;const r=t.destinationIdentities.length!==0?t.destinationIdentities:e.destinationIdentities;t.destinationIdentities=r,e.destinationIdentities=r}const fT=5e3,Cge=3e4;class Tt{static fetchRegionSettings(e,n,r){return F(this,void 0,void 0,function*(){const i=yield Tt.fetchLock.lock();try{const a=yield fetch("".concat(Tge(e),"/regions"),{headers:{authorization:"Bearer ".concat(n)},signal:r});if(a.ok){const s=kme(a.headers),o=s?s*1e3:fT;return{regionSettings:yield a.json(),updatedAtInMs:Date.now(),maxAgeInMs:o}}else throw a.status===401?Ge.notAllowed("Could not fetch region settings: ".concat(a.statusText),a.status):Ge.internal("Could not fetch region settings: ".concat(a.statusText))}catch(a){throw a instanceof Ge?a:r!=null&&r.aborted?Ge.cancelled("Region fetching was aborted"):Ge.serverUnreachable("Could not fetch region settings, ".concat(a instanceof Error?"".concat(a.name,": ").concat(a.message):a))}finally{i()}})}static scheduleRefetch(e,n,r){return F(this,void 0,void 0,function*(){const i=Tt.settingsTimeouts.get(e.hostname);clearTimeout(i),Tt.settingsTimeouts.set(e.hostname,setTimeout(()=>F(this,void 0,void 0,function*(){try{const a=yield Tt.fetchRegionSettings(e,n
700);Tt.updateCachedRegionSettings(e,n,a)}catch(a){if(a instanceof Ge&&a.reason===Gt.NotAllowed){ft.debug("token is not valid, cancelling auto region refresh");return}ft.debug("auto refetching of region settings failed",{error:a}),Tt.scheduleRefetch(e,n,r)}}),r))})}static updateCachedRegionSettings(e,n,r){Tt.cache.set(e.hostname,r),Tt.scheduleRefetch(e,n,r.maxAgeInMs)}static stopRefetch(e){const n=Tt.settingsTimeouts.get(e);n&&(clearTimeout(n),Tt.settingsTimeouts.delete(e))}static scheduleCleanup(e){let n=Tt.connectionTrackers.get(e);n&&(n.cleanupTimeout&&clearTimeout(n.cleanupTimeout),n.cleanupTimeout=setTimeout(()=>{const r=Tt.connectionTrackers.get(e);r&&r.connectionCount===0&&(ft.debug("stopping region refetch after disconnect delay",{hostname:e}),Tt.stopRefetch(e)),r&&(r.cleanupTimeout=void 0)},Cge))}static cancelCleanup(e){const n=Tt.connectionTrackers.get(e);n!=null&&n.cleanupTimeout&&(clearTimeout(n.cleanupTimeout),n.cleanupTimeout=void 0)}notifyConnected(){const e=this.serverUrl.hostname;let n=Tt.connectionTrackers.get(e);n||(n={connectionCount:0},Tt.connectionTrackers.set(e,n)),n.connectionCount++,Tt.cancelCleanup(e)}notifyDisconnected(){const e=this.serverUrl.hostname,n=Tt.connectionTrackers.get(e);n&&(n.connectionCount=Math.max(0,n.connectionCount-1),n.connectionCount===0&&Tt.scheduleCleanup(e))}constructor(e,n){this.attemptedRegions=[],this.serverUrl=new URL(e),this.token=n}updateToken(e){var n;this.token=e;const r=this.getServerUrl(),i=Tt.cache.get(r.hostname);Tt.scheduleRefetch(this.serverUrl,this.token,(n=i==null?void 0:i.maxAgeInMs)!==null&&n!==void 0?n:fT)}isCloud(){return jh(this.serverUrl)}getServerUrl(){return this.serverUrl}fetchRegionSettings(e){return F(this,void 0,void 0,function*(){return Tt.fetchRegionSettings(this.serverUrl,this.token,e)})}getNextBestRegionUrl(e){return F(this,void 0,void 0,function*(){if(!this.isCloud())throw Error("region availability is only supported for LiveKit Cloud domains");let n=Tt.cache.get(this.serverUrl.hostname);(!n||Date.now()-n.updatedAtInMs>n.maxAgeInMs)&&(n=yield this.fetchRegionSettings(e),Tt.updateCachedRegionSettings(this.serverUrl,this.token,n));const r=n.regionSettings.regions.filter(i=>!this.attemptedRegions.find(a=>a.url===i.url));if(r.length>0){const i=r[0];return this.attemptedRegions.push(i),ft.debug("next region: ".concat(i.region)),i.url}else return null})}resetAttempts(){this.attemptedRegions=[]}setServerReportedRegions(e){Tt.updateCachedRegionSettings(this.serverUrl,this.token,e)}}Tt.cache=new Map;Tt.settingsTimeouts=new Map;Tt.connectionTrackers=new Map;Tt.fetchLock=new gr;function Tge(t){return"".concat(t.protocol.replace("ws","http"),"//").concat(t.host,"/settings")}class FW{get info(){return this._info}validateBytesReceived(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!(typeof this.totalByteSize!="number"||this.totalByteSize===0)){if(e&&this.bytesReceived<this.totalByteSize)throw new Wi("Not enough chunk(s) received - expected ".concat(this.totalByteSize," bytes of data total, only received ").concat(this.bytesReceived," bytes"),Ir.Incomplete);if(this.bytesReceived>this.totalByteSize)throw new Wi("Extra chunk(s) received - expected ".concat(this.totalByteSize," bytes of data total, received ").concat(this.bytesReceived," bytes"),Ir.LengthExceeded)}}constructor(e,n,r){this.reader=n,this.totalByteSize=r,this._info=e,this.bytesReceived=0}}class Ege extends FW{handleChunkReceived(e){var n;this.bytesReceived+=e.content.byteLength,this.validateBytesReceived();const r=this.totalByteSize?this.bytesReceived/this.totalByteSize:void 0;(n=this.onProgress)===null||n===void 0||n.call(this,r)}[Symbol.asyncIterator](){const e=this.reader.getReader();e.closed.catch(()=>{});const n=()=>{e.releaseLock(),this.signal=void 0};return{next:()=>F(this,void 0,void 0,function*(){try{const r=this.signal;if(r!=null&&r.aborted)throw r.reason;const i=yield new Promise((a,s)=>{if(r){const o=()=>s(r.reason);r.addEventListener("abort",o,{once:!0}),e.read().then(a,s).finally(()=>{r.removeEventListener("abort",o)})}else e.read().then(a,s)});return i.done?(this.validateBytesReceived(!0),{done:!0,value:void 0}):(this.handleChunkReceived(i.value),{done:!1,value:i.value.content})}catch(r){throw n(),r}}),return(){return F(this,void 0,void 0,function*(){return n(),{done:!0,value:void 0}})}}}withAbortSignal(e){return this.signal=e,this}readAll(){return F(this,arguments,void 0,function(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return function*(){var r,i,a,s;let o=new Set;const c=n.signal?e.withAbortSignal(n.signal):e;try{for(var u=!0,d=Ia(c),h;h=yield d.next(),r=h.done,!r;u=!0){s=h.value,u=!1;const f=s;o.add(f)}}catch(f){i={error:f}}finally{try{!u&&!r&&(a=d.return)&&(yield a.call(d))}finally{if(i)throw i.error}}return Array.from(o)}()})}}class jge extends FW{constructor(e,n,r){super(e,n,r),this.receivedChunks=new Map}handleChunkReceived(e){var n;const r=Qy(e.chunkIndex),i=this.receivedChunks.get(r);if(i&&i.version>e.version)return;this.receivedChunks.set(r,e),this.bytesReceived+=e.content.byteLength,this.validateBytesReceived();const a=this.totalByteSize?this.bytesReceived/this.totalByteSize:void 0;(n=this.onProgress)===null||n===void 0||n.call(this,a)}[Symbol.asyncIterator](){const e=this.reader.getReader();e.closed.catch(()=>{});const n=new TextDecoder("utf-8",{fatal:!0}),r=this.signal,i=()=>{e.releaseLock(),this.signal=void 0};return{next:()=>F(this,void 0,void 0,function*(){try{if(r!=null&&r.aborted)throw r.reason;const a=yield new Promise((s,o)=>
700{if(r){const c=()=>o(r.reason);r.addEventListener("abort",c,{once:!0}),e.read().then(s,o).finally(()=>{r.removeEventListener("abort",c)})}else e.read().then(s,o)});if(a.done)return this.validateBytesReceived(!0),{done:!0,value:void 0};{this.handleChunkReceived(a.value);let s;try{s=n.decode(a.value.content)}catch(o){throw new Wi("Cannot decode datastream chunk ".concat(a.value.chunkIndex," as text: ").concat(o),Ir.DecodeFailed)}return{done:!1,value:s}}}catch(a){throw i(),a}}),return(){return F(this,void 0,void 0,function*(){return i(),{done:!0,value:void 0}})}}}withAbortSignal(e){return this.signal=e,this}readAll(){return F(this,arguments,void 0,function(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return function*(){var r,i,a,s;let o="";const c=n.signal?e.withAbortSignal(n.signal):e;try{for(var u=!0,d=Ia(c),h;h=yield d.next(),r=h.done,!r;u=!0)s=h.value,u=!1,o+=s}catch(f){i={error:f}}finally{try{!u&&!r&&(a=d.return)&&(yield a.call(d))}finally{if(i)throw i.error}}return o}()})}}class Pge{constructor(){this.log=ft,this.byteStreamControllers=new Map,this.textStreamControllers=new Map,this.byteStreamHandlers=new Map,this.textStreamHandlers=new Map,this.isConnected=!1,this.bufferedPackets=[]}setConnected(e){this.isConnected=e,e&&this.flushBufferedPackets()}flushBufferedPackets(){const e=this.bufferedPackets;this.bufferedPackets=[];for(const{packet:n,encryptionType:r}of e)this.handleDataStreamPacket(n,r)}registerTextStreamHandler(e,n){if(this.textStreamHandlers.has(e))throw new Wi('A text stream handler for topic "'.concat(e,'" has already been set.'),Ir.HandlerAlreadyRegistered);this.textStreamHandlers.set(e,n)}unregisterTextStreamHandler(e){this.textStreamHandlers.delete(e)}registerByteStreamHandler(e,n){if(this.byteStreamHandlers.has(e))throw new Wi('A byte stream handler for topic "'.concat(e,'" has already been set.'),Ir.HandlerAlreadyRegistered);this.byteStreamHandlers.set(e,n)}unregisterByteStreamHandler(e){this.byteStreamHandlers.delete(e)}clearControllers(){this.byteStreamControllers.clear(),this.textStreamControllers.clear(),this.bufferedPackets=[]}validateParticipantHasNoActiveDataStreams(e){const n=Array.from(this.textStreamControllers.entries()).filter(i=>i[1].sendingParticipantIdentity===e),r=Array.from(this.byteStreamControllers.entries()).filter(i=>i[1].sendingParticipantIdentity===e);if(n.length>0||r.length>0){const i=new Wi("Participant ".concat(e," unexpectedly disconnected in the middle of sending data"),Ir.AbnormalEnd);for(const[a,s]of r)s.controller.error(i),this.byteStreamControllers.delete(a);for(const[a,s]of n)s.controller.error(i),this.textStreamControllers.delete(a)}}handleDataStreamPacket(e,n){if(!this.isConnected){this.bufferedPackets.push({packet:e,encryptionType:n});return}switch(e.value.case){case"streamHeader":return this.handleStreamHeader(e.value.value,e.participantIdentity,n);case"streamChunk":return this.handleStreamChunk(e.value.value,n);case"streamTrailer":return this.handleStreamTrailer(e.value.value,n);default:throw new Error('DataPacket of value "'.concat(e.value.case,'" is not data stream related!'))}}handleStreamHeader(e,n,r){var i;if(e.contentHeader.case==="byteHeader"){const a=this.byteStreamHandlers.get(e.topic);if(!a){this.log.debug("ignoring incoming byte stream due to no handler for topic",e.topic);return}let s;const o={id:e.streamId,name:(i=e.contentHeader.value.name)!==null&&i!==void 0?i:"unknown",mimeType:e.mimeType,size:e.totalLength?Number(e.totalLength):void 0,topic:e.topic,timestamp:Qy(e.timestamp),attributes:e.attributes,encryptionType:r},c=new ReadableStream({start:u=>{if(s=u,this.textStreamControllers.has(e.streamId))throw new Wi("A data stream read is already in progress for a stream with id ".concat(e.streamId,"."),Ir.AlreadyOpened);this.byteStreamControllers.set(e.streamId,{info:o,controller:s,startTime:Date.now(),sendingParticipantIdentity:n})}});a(new Ege(o,c,Qy(e.totalLength)),{identity:n})}else if(e.contentHeader.case==="textHeader"){const a=this.textStreamHandlers.get(e.topic);if(!a){this.log.debug("ignoring incoming text stream due to no handler for topic",e.topic);return}let s;const o={id:e.streamId,mimeType:e.mimeType,size:e.totalLength?Number(e.totalLength):void 0,topic:e.topic,timestamp:Number(e.timestamp),attributes:e.attributes,encryptionType:r,attachedStreamIds:e.contentHeader.value.attachedStreamIds},c=new ReadableStream({start:u=>{if(s=u,this.textStreamControllers.has(e.streamId))throw new Wi("A data stream read is already in progress for a stream with i
700d ".concat(e.streamId,"."),Ir.AlreadyOpened);this.textStreamControllers.set(e.streamId,{info:o,controller:s,startTime:Date.now(),sendingParticipantIdentity:n})}});a(new jge(o,c,Qy(e.totalLength)),{identity:n})}}handleStreamChunk(e,n){const r=this.byteStreamControllers.get(e.streamId);r&&(r.info.encryptionType!==n?(r.controller.error(new Wi("Encryption type mismatch for stream ".concat(e.streamId,". Expected ").concat(n,", got ").concat(r.info.encryptionType),Ir.EncryptionTypeMismatch)),this.byteStreamControllers.delete(e.streamId)):e.content.length>0&&r.controller.enqueue(e));const i=this.textStreamControllers.get(e.streamId);i&&(i.info.encryptionType!==n?(i.controller.error(new Wi("Encryption type mismatch for stream ".concat(e.streamId,". Expected ").concat(n,", got ").concat(i.info.encryptionType),Ir.EncryptionTypeMismatch)),this.textStreamControllers.delete(e.streamId)):e.content.length>0&&i.controller.enqueue(e))}handleStreamTrailer(e,n){const r=this.textStreamControllers.get(e.streamId);r&&(r.info.encryptionType!==n?r.controller.error(new Wi("Encryption type mismatch for stream ".concat(e.streamId,". Expected ").concat(n,", got ").concat(r.info.encryptionType),Ir.EncryptionTypeMismatch)):(r.info.attributes=Object.assign(Object.assign({},r.info.attributes),e.attributes),r.controller.close(),this.textStreamControllers.delete(e.streamId)));const i=this.byteStreamControllers.get(e.streamId);i&&(i.info.encryptionType!==n?i.controller.error(new Wi("Encryption type mismatch for stream ".concat(e.streamId,". Expected ").concat(n,", got ").concat(i.info.encryptionType),Ir.EncryptionTypeMismatch)):(i.info.attributes=Object.assign(Object.assign({},i.info.attributes),e.attributes),i.controller.close()),this.byteStreamControllers.delete(e.streamId))}}class BW{constructor(e,n,r){this.writableStream=e,this.defaultWriter=e.getWriter(),this.onClose=r,this.info=n}write(e){return this.defaultWriter.write(e)}close(){return F(this,void 0,void 0,function*(){var e;yield this.defaultWriter.close(),this.defaultWriter.releaseLock(),(e=this.onClose)===null||e===void 0||e.call(this)})}}class Nge extends BW{}class Age extends BW{}const B4=15e3;class Oge{constructor(e,n){this.engine=e,this.log=n}setupEngine(e){this.engine=e}sendText(e,n){return F(this,void 0,void 0,function*(){var r;const i=crypto.randomUUID(),s=new TextEncoder().encode(e).byteLength,o=(r=n==null?void 0:n.attachments)===null||r===void 0?void 0:r.map(()=>crypto.randomUUID()),c=new Array(o?o.length+1:1).fill(0),u=(h,f)=>{var p;c[f]=h;const g=c.reduce((m,v)=>m+v,0);(p=n==null?void 0:n.onProgress)===null||p===void 0||p.call(n,g)},d=yield this.streamText({streamId:i,totalSize:s,destinationIdentities:n==null?void 0:n.destinationIdentities,topic:n==null?void 0:n.topic,attachedStreamIds:o,attributes:n==null?void 0:n.attributes});return yield d.write(e),u(1,0),yield d.close(),n!=null&&n.attachments&&o&&(yield Promise.all(n.attachments.map((h,f)=>F(this,void 0,void 0,function*(){return this._sendFile(o[f],h,{topic:n.topic,mimeType:h.type,onProgress:p=>{u(p,f+1)}})})))),d.info})}streamText(e){return F(this,void 0,void 0,function*(){var n,r,i;const a=(n=e==null?void 0:e.streamId)!==null&&n!==void 0?n:crypto.randomUUID(),s={id:a,mimeType:"text/plain",timestamp:Date.now(),topic:(r=e==null?void 0:e.topic)!==null&&r!==void 0?r:"",size:e==null?void 0:e.totalSize,attributes:e==null?void 0:e.attributes,encryptionType:!((i=this.engine.e2eeManager)===null||i===void 0)&&i.isDataChannelEncryptionEnabled?Yt.GCM:Yt.NONE,attachedStreamIds:e==null?void 0:e.attachedStreamIds},o=new tb({streamId:a,mimeType:s.mimeType,topic:s.topic,timestamp:ul(s.timestamp),totalLength:ul(s.size),attributes:s.attributes,contentHeader:{case:"textHeader",value:new Pz({version:e==null?void 0:e.version,attachedStreamIds:s.attachedStreamIds,replyToStreamId:e==null?void 0:e.replyToStreamId,operationType:(e==null?void 0:e.type)==="update"?WC.UPDATE:WC.C
700REATE})}}),c=e==null?void 0:e.destinationIdentities,u=new Fr({destinationIdentities:c,value:{case:"streamHeader",value:o}});yield this.engine.sendDataPacket(u,xt.RELIABLE);let d=0;const h=this.engine,f=new WritableStream({write(m){return F(this,void 0,void 0,function*(){for(const v of Sme(m,B4)){const x=new nb({content:v,streamId:a,chunkIndex:ul(d)}),w=new Fr({destinationIdentities:c,value:{case:"streamChunk",value:x}});yield h.sendDataPacket(w,xt.RELIABLE),d+=1}})},close(){return F(this,void 0,void 0,function*(){const m=new rb({streamId:a}),v=new Fr({destinationIdentities:c,value:{case:"streamTrailer",value:m}});yield h.sendDataPacket(v,xt.RELIABLE)})},abort(m){console.log("Sink error:",m)}});let p=()=>F(this,void 0,void 0,function*(){yield g.close()});h.once(ve.Closing,p);const g=new Nge(f,s,()=>this.engine.off(ve.Closing,p));return g})}sendFile(e,n){return F(this,void 0,void 0,function*(){const r=crypto.randomUUID();return yield this._sendFile(r,e,n),{id:r}})}_sendFile(e,n,r){return F(this,void 0,void 0,function*(){var i;const a=yield this.streamBytes({streamId:e,totalSize:n.size,name:n.name,mimeType:(i=r==null?void 0:r.mimeType)!==null&&i!==void 0?i:n.type,topic:r==null?void 0:r.topic,destinationIdentities:r==null?void 0:r.destinationIdentities}),s=n.stream().getReader();for(;;){const{done:o,value:c}=yield s.read();if(o)break;yield a.write(c)}return yield a.close(),a.info})}streamBytes(e){return F(this,void 0,void 0,function*(){var n,r,i,a,s;const o=(n=e==null?void 0:e.streamId)!==null&&n!==void 0?n:crypto.randomUUID(),c=e==null?void 0:e.destinationIdentities,u={id:o,mimeType:(r=e==null?void 0:e.mimeType)!==null&&r!==void 0?r:"application/octet-stream",topic:(i=e==null?void 0:e.topic)!==null&&i!==void 0?i:"",timestamp:Date.now(),attributes:e==null?void 0:e.attributes,size:e==null?void 0:e.totalSize,name:(a=e==null?void 0:e.name)!==null&&a!==void 0?a:"unknown",encryptionType:!((s=this.engine.e2eeManager)===null||s===void 0)&&s.isDataChannelEncryptionEnabled?Yt.GCM:Yt.NONE},d=new tb({totalLength:ul(u.size),mimeType:u.mimeType,streamId:o,topic:u.topic,timestamp:ul(Date.now()),attributes:u.attributes,contentHeader:{case:"byteHeader",value:new Nz({name:u.name})}}),h=new Fr({destinationIdentities:c,value:{case:"streamHeader",value:d}});yield this.engine.sendDataPacket(h,xt.RELIABLE);let f=0;const p=new gr,g=this.engine,m=this.log,v=new WritableStream({write(w){return F(this,void 0,void 0,function*(){const y=yield p.lock();let k=0;try{for(;k<w.byteLength;){const S=w.slice(k,k+B4),_=new Fr({destinationIdentities:c,value:{case:"streamChunk",value:new nb({content:S,streamId:o,chunkIndex:ul(f)})}});yield g.sendDataPacket(_,xt.RELIABLE),f+=1,k+=S.byteLength}}finally{y()}})},close(){return F(this,void 0,void 0,function*(){const w=new rb({streamId:o}),y=new Fr({destinationIdentities:c,value:{case:"streamTrailer",value:w}});yield g.sendDataPacket(y,xt.RELIABLE)})},abort(w){m.error("Sink error:",w)}});return new Age(v,u)})}}function UW(t){if(t.length===0)return new AbortController().signal;if(t.length===1)return t[0];for(const i of t)if(i.aborted)return i;const e=new AbortController,n=Array(t.length),r=()=>{for(const i of n)i()};return t.forEach((i,a)=>{const s=()=>{e.abort(i.reason),r()};i.addEventListener("abort",s),n[a]=()=>i.removeEventListener("abort",s)}),e.signal}function zW(t){const e=new AbortController;return setTimeout(()=>{e.abort(new DOMException("signal timed out after ".concat(t," ms"),"TimeoutError"))},t),e.signal}const On=1,$s=2,U4=4,Rge=8,z4=0,W4=12,V4=5,Dge=7,H4=3,Mge=3,q4=2,K4=1,G4=0,Y4=3,Ige=2,J4=2,Lge=1,$ge=0;var qs;(function(t){t[t.TooShort=0]="TooShort",t[t.HeaderOverrun=1]="HeaderOverrun",t[t.MissingExtWords=2]="MissingExtWords",t[t.UnsupportedVersion=3]="UnsupportedVersion",t[t.InvalidHandle=4]="InvalidHandle",t[t.MalformedExt=5]="MalformedExt"})(qs||(qs={}));class Br extends la{constructor(e,n,r){super(19,e,r),this.name="DataTrackDeserializeError",this.reason=n,this.reasonName=qs[n]}static tooShort(){return new Br("Too short to contain a valid header",qs.TooShort)}static headerOverrun(){return new Br("Header exceeds total packet length",qs.HeaderOverrun)}static missingExtWords(){return new Br("Extension word indicator is missing",qs.MissingExtWords)}static unsupportedVersion(e){return new Br("Unsupported version ".concat(e),qs.UnsupportedVersion)}
700static invalidHandle(e){return new Br("invalid track handle: ".concat(e.message),qs.InvalidHandle,{cause:e})}static malformedExt(e){return new Br("Extension with tag ".concat(e," is malformed"),qs.MalformedExt)}}var qp;(function(t){t[t.TooSmallForHeader=0]="TooSmallForHeader",t[t.TooSmallForPayload=1]="TooSmallForPayload"})(qp||(qp={}));class Hm extends la{constructor(e,n,r){super(19,e,r),this.name="DataTrackSerializeError",this.reason=n,this.reasonName=qp[n]}static tooSmallForHeader(){return new Hm("Buffer cannot fit header",qp.TooSmallForHeader)}static tooSmallForPayload(){return new Hm("Buffer cannot fit payload",qp.TooSmallForPayload)}}class Nw{toBinary(){const e=this.toBinaryLengthBytes(),n=new ArrayBuffer(e),r=new DataView(n),i=this.toBinaryInto(r);if(e!==i)throw new Error("".concat(this.constructor.name,".toBinary: written bytes (").concat(i," bytes) not equal to allocated array buffer length (").concat(e," bytes)."));return new Uint8Array(n)}}var Nh;(function(t){t[t.UserTimestamp=2]="UserTimestamp",t[t.E2ee=1]="E2ee"})(Nh||(Nh={}));class WW extends Nw{}class $a extends WW{constructor(e){super(),this.timestamp=e}toBinaryLengthBytes(){return On+On+$a.lengthBytes}toBinaryInto(e){let n=0;e.setUint8(n,$a.tag),n+=On,e.setUint8(n,$a.lengthBytes),n+=On,e.setBigUint64(n,this.timestamp),n+=Rge;const r=this.toBinaryLengthBytes();if(n!==r)throw new Error("DataTrackUserTimestampExtension.toBinaryInto: Wrote ".concat(n," bytes but expected length was ").concat(r," bytes"));return n}toJSON(){return{tag:$a.tag,lengthBytes:$a.lengthBytes,timestamp:this.timestamp}}}$a.tag=Nh.UserTimestamp;$a.lengthBytes=8;class Fa extends WW{constructor(e,n){super(),this.keyIndex=e,this.iv=n}toBinaryLengthBytes(){return On+On+Fa.lengthBytes}toBinaryInto(e){let n=0;e.setUint8(n,Fa.tag),n+=On,e.setUint8(n,Fa.lengthBytes),n+=On,e.setUint8(n,this.keyIndex),n+=On;for(let i=0;i<this.iv.length;i+=1)e.setUint8(n,this.iv[i]),n+=On;const r=this.toBinaryLengthBytes();if(n!==r)throw new Error("DataTrackE2eeExtension.toBinaryInto: Wrote ".concat(n," bytes but expected length was ").concat(r," bytes"));return n}toJSON(){return{tag:Fa.tag,lengthBytes:Fa.lengthBytes,keyIndex:this.keyIndex,iv:this.iv}}}Fa.tag=Nh.E2ee;Fa.lengthBytes=13;class zd extends Nw{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(),this.userTimestamp=e.userTimestamp,this.e2ee=e.e2ee}toBinaryLengthBytes(){let e=0;return this.userTimestamp&&(e+=this.userTimestamp.toBinaryLengthBytes()),this.e2ee&&(e+=this.e2ee.toBinaryLengthBytes()),e}toBinaryInto(e){let n=0;if(this.e2ee){const i=this.e2ee.toBinaryInto(e);n+=i}if(this.userTimestamp){const i=this.userTimestamp.toBinaryInto(new DataView(e.buffer,e.byteOffset+n));n+=i}const r=this.toBinaryLengthBytes();if(n!==r)throw new Error("DataTrackExtensions.toBinaryInto: Wrote ".concat(n," bytes but expected length was ").concat(r," bytes"));return n}static fromBinary(e){const n=TP(e);let r,i,a=0;for(;n.byteLength-a>=On+On;){const s=n.getUint8(a);a+=On;const o=n.getUint8(a);if(a+=On,s!==$ge)switch(s){case Nh.UserTimestamp:if(n.byteLength-a<$a.lengthBytes)throw Br.malformedExt(s);r=new $a(n.getBigUint64(a)),a+=o;break;case Nh.E2ee:if(n.byteLength-a<Fa.lengthBytes)throw Br.malformedExt(s);const c=n.getUint8(a),u=new Uint8Array(12);for(let d=0;d<u.length;d+=1){let h=a;h+=On,h+=d*On,u[d]=n.getUint8(h)}i=new Fa(c,u),a+=o;break;default:if(n.byteLength-a<o)throw Br.malformedExt(s);a+=o;break}}return[new zd({userTimestamp:r,e2ee:i}),n.byteLength]}toJSON(){var e,n,r,i;return{userTimestamp:(n=(e=this.userTimestamp)===null||e===void 0?void 0:e.toJSON())!==null&&n!==void 0?n:null,e2ee:(i=(r=this.e2ee)===null||r===void 0?void 0:r.toJSON())!==null&&i!==void 0?i:null}}}const VW={from(t){return{payload:t.payload,extensions:new zd({userTimestamp:t.userTimestamp?new $a(t.userTimestamp):void 0})}},lossyIntoFrame(t){var e;return{payload:t.payload,userTimestamp:(e=t.extensions.userTimestamp)===null||e===void 0?void 0:e.timestamp}}},HW=Symbol.for("lk.track"),qW=Symbol.for("lk.data-track");class KW{constructor(e,n,r){this.trackSymbol=HW,this.isLocal=!1,this.typeSymbol=qW,this.info=e,this.manager=n,this.publisherIdentity=r.publisherIdentity}subscribe(e){try{const[n]=this.manager.openSubscriptionStream(this.info.sid,e==null?void 0:e.signal,e==null?void 0:e.bufferSize);return n}catch(n){throw n}}}class qm extends Nw{constructor(e){var n;super(),this.marker=e.marker,this.trackHandle=e.trackHandle,this.sequence=e.sequence,this.frameNumber=e.frameNumber,this.timestamp=e.timestamp,this.extensions=(n=e.extensions)!==null&&n!==void 0?n:new zd}extensionsMetrics(){const e=this.extensions.toBinaryLengthBytes(),n=Math.ceil(e/4),r=n*4-e;return{lengthBytes:e,lengthWords:n,paddingLengthBytes:r}}toBinaryLengthBytes(){const{lengthBytes:e,paddingLengthBytes:n}=this.extensionsMetrics();let r=W4;return e>0&&(r+=Ige+e+n),r}toBinaryInto(e){if(e.byteLength<this.toBinaryLengthBytes())throw Hm.tooSmallForHeader();let n=z4<<V4,r;switch(this.marker){case fn.Inter:r=G4;break;case fn.Final:r=K4;break;case fn.Start:r=q4;break;case fn.Single:r=Y4;break}n|=r<<H4;const{lengthBytes:i,lengthWords:a,paddingLengthBytes:s}=this.extensionsMetrics();i>0&&(n|=1<<J4);let o=0;if(e.setUint8(o,n),o+=On,e.setUint8(o,0),o+=On,e.setUint16(o,this.trackHandle),o+=$s,e.setUint16(o,this.sequence.value),o+=$s,e.setUint16(o,this.frameNumber.value),o+=$s,e.setUint32(o,this.timestamp.asTicks()),o+=U4,i>0){const u=a-1;e.setUint16(o,u),o+=$s;const d=this.extensions.toBinaryInto(new DataView(e.buffer,e.byteOffset+o));o+=d;for(let h=0;h<s;h+=1)e.setUint8(o,0),o+=On}const c=this.toBinaryLengthBytes();if(o!==c)throw new Error("DataTrackPacketHeader.toBinaryInto: Wrote ".concat(o," bytes but expected length
700was ").concat(c," bytes"));return c}static fromBinary(e){const n=TP(e);if(n.byteLength<W4)throw Br.tooShort();let r=0;const i=n.getUint8(r);r+=On;const a=i>>V4&Dge;if(a>z4)throw Br.unsupportedVersion(a);let s;switch(i>>H4&Mge){case q4:s=fn.Start;break;case K4:s=fn.Final;break;case Y4:s=fn.Single;break;case G4:default:s=fn.Inter;break}const o=(i>>J4&Lge)>0;r+=On;let c;try{c=Lme.fromNumber(n.getUint16(r))}catch(p){throw p instanceof Ph&&(p.isReason(Wl.Reserved)||p.isReason(Wl.TooLarge))?Br.invalidHandle(p):p}r+=$s;const u=Va.u16(n.getUint16(r));r+=$s;const d=Va.u16(n.getUint16(r));r+=$s;const h=Ud.fromRtpTicks(n.getUint32(r));r+=U4;let f=new zd;if(o){if(n.byteLength-r<$s)throw Br.missingExtWords();let p=n.getUint16(r);r+=$s;let m=4*(p+1);if(r+m>n.byteLength)throw Br.headerOverrun();let v=new DataView(n.buffer,n.byteOffset+r,m);const[x,w]=zd.fromBinary(v);f=x,r+=w}return[new qm({marker:s,trackHandle:c,sequence:u,frameNumber:d,timestamp:h,extensions:f}),r]}toJSON(){return{marker:this.marker,trackHandle:this.trackHandle,sequence:this.sequence.value,frameNumber:this.frameNumber.value,timestamp:this.timestamp.asTicks(),extensions:this.extensions.toJSON()}}}var fn;(function(t){t[t.Start=0]="Start",t[t.Inter=1]="Inter",t[t.Final=2]="Final",t[t.Single=3]="Single"})(fn||(fn={}));class Aw extends Nw{constructor(e,n){super(),this.header=e,this.payload=n}toBinaryLengthBytes(){return this.header.toBinaryLengthBytes()+this.payload.byteLength}toBinaryInto(e){let n=0;const r=this.header.toBinaryInto(e);if(n+=r,e.byteLength-n<this.payload.byteLength)throw Hm.tooSmallForPayload();for(let a=0;a<this.payload.length;a+=1)e.setUint8(n,this.payload[a]),n+=On;const i=this.toBinaryLengthBytes();if(n!==i)throw new Error("DataTrackPacket.toBinaryInto: Wrote ".concat(n," bytes but expected length was ").concat(i," bytes"));return i}static fromBinary(e){const n=TP(e),[r,i]=qm.fromBinary(n),a=n.buffer.slice(n.byteOffset+i,n.byteOffset+n.byteLength);return[new Aw(r,new Uint8Array(a)),n.byteLength]}toJSON(){return{header:this.header.toJSON(),payload:this.payload}}}const ck=li(Rr.DataTracks);class Ra extends la{constructor(e,n,r,i){super(19,"Frame ".concat(r," dropped: ").concat(e),i),this.name="DataTrackDepacketizerDropError",this.reason=n,this.reasonName=Sl[n],this.frameNumber=r}static interrupted(e,n){return new Ra("Interrupted by the start of a new frame ".concat(n),Sl.Interrupted,e)}static unknownFrame(e){return new Ra("Initial packet was never received.",Sl.UnknownFrame,e)}static bufferFull(e){return new Ra("Reorder buffer is full.",Sl.BufferFull,e)}static incomplete(e,n,r){return new Ra("Not all packets received before final packet. Received ".concat(n," packets, expected ").concat(r," packets."),Sl.Incomplete,e)}}var Sl;(function(t){t[t.Interrupted=0]="Interrupted",t[t.UnknownFrame=1]="UnknownFrame",t[t.BufferFull=2]="BufferFull",t[t.Incomplete=3]="Incomplete"})(Sl||(Sl={}));class Ow{constructor(){this.partial=null}push(e,n){switch(e.header.marker){case fn.Single:return this.frameFromSingle(e,n);case fn.Start:return this.beginPartial(e,n);case fn.Inter:case fn.Final:return this.pushToPartial(e)}}reset(){this.partial=null}frameFromSingle(e,n){if(e.header.marker!==fn.Single)throw new Error("Depacketizer.frameFromSingle: packet.header.marker was not FrameMarker.Single, found ".concat(e.header.marker,"."));if(this.partial)if(n!=null&&n.errorOnPartialFrames){const r=this.partial.frameNumber;throw this.reset(),Ra.interrupted(r,e.header.frameNumber.value)}else ck.warn("Data track frame ".concat(this.partial.frameNumber," was interrupted by the start of a new frame, dropping."));return this.reset(),{payload:e.payload,extensions:e.header.extensions}}beginPartial(e,n){if(e.header.marker!==fn.Start)throw new Error("Depacketizer.beginPartial: packet.header.marker was not FrameMarker.Start, found ".concat(e.header.marker,"."));if(this.partial)if(n!=null&&n.errorOnPartialFrames){const i=this.partial.frameNumber;throw this.reset(),Ra.interrupted(i,e.header.frameNumber.value)}else ck.warn("Data track frame ".concat(this.partial.frameNumber," was interrupted by the start of a new frame ").concat(e.header.frameNumber.value,", dropping."));this.reset();const r=e.header.sequence;return this.partial={frameNumber:e.header.frameNumber.value,startSequence:r,extensions:e.header.extensions,payloads:new Map([[r.value,e.payload]])},null}pushToPartial(e){if(e.header.marker!==fn.Inter&&e.header.marker!==fn.Final)throw new Error("Depacketizer.pushToPartial: packet.header.marker was not FrameMarker.Inter or FrameMarker.Final, found ".concat(e.header.marker,"."));if(!this.partial)throw this.reset(),Ra.unknownFrame(e.header.frameNumber.value);if(e.header.frameNumber.value!==this.partial.frameNumber){const n=this.partial.frameNumber;throw this.reset(),Ra.interrupted(n,e.header.frameNumber.value)}if(this.partial.payloads.size>=Ow.MAX_BUFFER_PACKETS){const n=this.partial.frameNumber;throw this.reset(),Ra.bufferFull(n)}return this.partial.payloads.has(e.header.sequence.value)&&ck.warn("Data track frame ".concat(this.partial.frameNumber," received duplicate packet for sequence ").concat(e.header.sequence.value,", so replacing with newly received packet.")),this.partial.payloads.set(e.header.sequence.value,e.payload),e.header.marker===fn.Final?this.finalize(this.partial,e.header.sequence.value):null}finalize(e,n){const r=e.payloads.size;let i=0;for(const c of e.payloads.values())i+=c.length;const a=new Uint8Array(i);let s=e.startSequence.clone(),o=0;for(;;){const c=e.payloads.get(s.value);if(!c)break;e.payloads.delete(s.value);const u=a.length-o;if(c.length>u)throw new Error("Depacketizer.finalize: Expected at least ".concat(c.length," more bytes left in the payload buffer, only got ").concat(u," bytes."));if(a.set(c,o),o+=c.length,s.value!=n){s.increment();continue}return this.reset(),{payload:a,extensions:e.extensions}}throw this.reset(),Ra.incomplete(e.frameNumber,r,n-e.startSequence.value+1)}}Ow.MAX_BUFFER_PACKETS=128;var kl;(function(t){t[t.Unpublished=0]="Unpublished",t[t.Timeout=1]="Timeout",t[t.Disconnected=2]="Disconnected",t[t.Cancelled=4]="Cancelled"})(kl||(kl={}));class Zr extends la{constructor(e,n,r){super(22,e,r),this.name="DataTrackSubscribeError",this.reason=n,this.reasonName=kl[n]}static unpublished(){return new Zr("The track has been unpublished and is no longer available",kl.Unpublished)}static timeout(){return new Zr("Request to subscribe to data track t
700imed-out",kl.Timeout)}static disconnected(){return new Zr("Cannot subscribe to data track when disconnected",kl.Disconnected)}static cancelled(){return new Zr("Subscription to data track cancelled by caller",kl.Cancelled)}}const lk=li(Rr.DataTracks);class Fge{constructor(e){var n;const r=e.e2eeManager!==null;if(e.info.usesE2ee!==r)throw new Error("IncomingDataTrackPipeline: DataTrackInfo.usesE2ee must match presence of decryptionProvider");const i=new Ow;this.publisherIdentity=e.publisherIdentity,this.e2eeManager=(n=e.e2eeManager)!==null&&n!==void 0?n:null,this.depacketizer=i}updateE2eeManager(e){this.e2eeManager=e}processPacket(e){return F(this,void 0,void 0,function*(){const n=this.depacketize(e);if(!n)return null;const r=yield this.decryptIfNeeded(n);return r||null})}depacketize(e){let n;try{n=this.depacketizer.push(e)}catch(r){return lk.warn("Data frame depacketize error: ".concat(r)),null}return n}decryptIfNeeded(e){return F(this,void 0,void 0,function*(){var n,r;const i=this.e2eeManager;if(!i)return e;const a=(r=(n=e.extensions)===null||n===void 0?void 0:n.e2ee)!==null&&r!==void 0?r:null;if(!a)return lk.error("Missing E2EE meta"),null;let s;try{s=yield i.handleEncryptedData(e.payload,a.iv,this.publisherIdentity,a.keyIndex)}catch(o){return lk.error("Error decrypting packet: ".concat(o)),null}return e.payload=s.payload,e})}}const Sr=li(Rr.DataTracks),Bge=1e4,Uge=16;class zge extends ca.EventEmitter{constructor(e){var n;super(),this.descriptors=new Map,this.subscriptionHandles=new Map,this.e2eeManager=(n=e==null?void 0:e.e2eeManager)!==null&&n!==void 0?n:null}updateE2eeManager(e){this.e2eeManager=e;for(const n of this.descriptors.values())n.subscription.type==="active"&&n.subscription.pipeline.updateE2eeManager(e)}openSubscriptionStream(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Uge,i=null;const a=new Ur,s=()=>{n==null||n.removeEventListener("abort",c)},o=()=>{if(s(),!i){Sr.warn("ReadableStream subscribed to ".concat(e," was not started."));return}const d=this.descriptors.get(e);if(!d){Sr.warn("Unknown track ".concat(e,", skipping cancel..."));return}if(d.subscription.type!=="active"){Sr.warn("Subscription for track ".concat(e," is not active, skipping cancel..."));return}d.subscription.streamControllers.delete(i),d.subscription.streamControllers.size===0&&this.unSubscribeRequest(d.info.sid)},c=()=>{var d;if(!i)return;const h=this.descriptors.get(e);(h==null?void 0:h.subscription.type)==="active"&&h.subscription.streamControllers.delete(i),i.error(Zr.cancelled()),(d=a.reject)===null||d===void 0||d.call(a,Zr.cancelled()),o()};return[new ReadableStream({start:d=>{i=d,this.subscribeRequest(e,n).then(()=>F(this,void 0,void 0,function*(){var h,f,p;const g=this.descriptors.get(e);if(!g){Sr.error("Unknown track ".concat(e));const m=Zr.disconnected();d.error(m),(h=a.reject)===null||h===void 0||h.call(a,m);return}if(g.subscription.type!=="active"){Sr.error("Subscription for track ".concat(e," is not active"));const m=Zr.disconnected();d.error(m),(f=a.reject)===null||f===void 0||f.call(a,m);return}if(n!=null&&n.aborted){c();return}n==null||n.addEventListener("abort",c),g.subscription.streamControllers.set(d,s),(p=a.resolve)===null||p===void 0||p.call(a)})).catch(h=>{var f;d.error(h),(f=a.reject)===null||f===void 0||f.call(a,h)})},cancel:()=>{o()}},new CountQueuingStrategy({highWaterMark:r})),a.promise]}subscribeRequest(e,n){return F(this,void 0,void 0,function*(){const r=this.descriptors.get(e);if(!r)throw new Error("Cannot subscribe to unknown track");const i=(a,s,o)=>F(this,void 0,void 0,function*(){if(a.subscription.type==="active")return;if(a.subscription.type!=="pending")throw new Error("Descriptor for track ".concat(e," is not pending, found ").concat(a.subscription.type));const c=UW([s,o].filter(h=>typeof h<"u")),u=new Ur;a.subscription.completionFuture.promise.then(()=>{var h;return(h=u.resolve)===null||h===void 0?void 0:h.call(u)}).catch(h=>{var f;return(f=u.reject)===null||f===void 0?void 0:f.call(u,h)});const d=()=>{var h;if(a.subscription.type==="pending"){if(a.subscription.pendingRequestCount-=1,o!=null&&o.aborted){a.subscription.cancel();return}if(a.subscription.pendingRequestCount<=0){a.subscription.cancel();return}(h=u.reject)===null||h===void 0||h.call(u,Zr.cancelled())}};c.aborted&&d(),c.addEventListener("abort",d),yield u.promise,c.removeEventListener("abort",d)});switch(r.subscription.type){case"none":{r.subscription={type:"pending",completionFuture:new Ur,pendingRequestCount:1,cancel:()=>{var s,o;const c=r.subscription;r.subscription={type:"none"}
700,this.emit("sfuUpdateSubscription",{sid:e,subscribe:!1}),c.type==="pending"&&((o=(s=c.completionFuture).reject)===null||o===void 0||o.call(s,a.aborted?Zr.timeout():Zr.cancelled()))}},this.emit("sfuUpdateSubscription",{sid:e,subscribe:!0});const a=zW(Bge);yield i(r,n,a);return}case"pending":{r.subscription.pendingRequestCount+=1,yield i(r,n);return}case"active":return}})}querySubscribed(){return F(this,void 0,void 0,function*(){return Array.from(this.descriptors.values()).filter(n=>n.subscription.type==="active").map(n=>[n.info,n.publisherIdentity])})}unSubscribeRequest(e){var n;const r=this.descriptors.get(e);if(!r)throw new Error("Cannot subscribe to unknown track");if(r.subscription.type!=="active"){Sr.warn("Unexpected descriptor state in unSubscribeRequest, expected active, found ".concat((n=r.subscription)===null||n===void 0?void 0:n.type));return}this.closeStreamControllers(r.subscription.streamControllers,e);const i=r.subscription;r.subscription={type:"none"},this.subscriptionHandles.delete(i.subcriptionHandle),this.emit("sfuUpdateSubscription",{sid:e,subscribe:!1})}closeStreamControllers(e,n){for(const[r,i]of e){i();try{r.close()}catch(a){Sr.warn("Failed to close readable stream for track ".concat(n,": ").concat(a))}}}receiveSfuPublicationUpdates(e){return F(this,void 0,void 0,function*(){if(e.size===0)return;const n=new Map;for(const[r,i]of e.entries()){const a=new Set;for(const s of i)a.add(s.sid),!this.descriptors.has(s.sid)&&(yield this.handleTrackPublished(r,s));n.set(r,a)}for(const[r,i]of n.entries()){let s=Array.from(this.descriptors.entries()).filter(o=>{let[c,u]=o;return u.publisherIdentity===r}).map(o=>{let[c]=o;return c}).filter(o=>!i.has(o));for(const o of s)this.handleTrackUnpublished(o)}})}queryPublications(){return F(this,void 0,void 0,function*(){return Array.from(this.descriptors.values()).map(e=>e.info)})}handleTrackPublished(e,n){return F(this,void 0,void 0,function*(){if(this.descriptors.has(n.sid)){Sr.error("Existing descriptor for track ".concat(n.sid));return}let r={info:n,publisherIdentity:e,subscription:{type:"none"}};this.descriptors.set(r.info.sid,r);const i=new KW(r.info,this,{publisherIdentity:e});this.emit("trackPublished",{track:i})})}handleTrackUnpublished(e){const n=this.descriptors.get(e);if(!n){Sr.error("Unknown track ".concat(e));return}this.descriptors.delete(e),n.subscription.type==="active"&&(this.closeStreamControllers(n.subscription.streamControllers,e),this.subscriptionHandles.delete(n.subscription.subcriptionHandle)),this.emit("trackUnpublished",{sid:e,publisherIdentity:n.publisherIdentity})}receivedSfuSubscriberHandles(e){for(const[n,r]of e.entries())this.registerSubscriberHandle(n,r)}registerSubscriberHandle(e,n){var r,i;const a=this.descriptors.get(n);if(!a){Sr.error("Unknown track ".concat(n));return}switch(a.subscription.type){case"none":{Sr.warn("No subscription for ".concat(n));return}case"active":{a.subscription.subcriptionHandle=e,this.subscriptionHandles.set(e,n);return}case"pending":{const s=new Fge({info:a.info,publisherIdentity:a.publisherIdentity,e2eeManager:this.e2eeManager}),o=a.subscription;a.subscription={type:"active",subcriptionHandle:e,pipeline:s,streamControllers:new Map},this.subscriptionHandles.set(e,n),(i=(r=o.completionFuture).resolve)===null||i===void 0||i.call(r)}}}packetReceived(e){return F(this,void 0,void 0,function*(){let n;try{[n]=Aw.fromBinary(e)}catch(s){Sr.error("Failed to deserialize packet: ".concat(s));return}const r=this.subscriptionHandles.get(n.header.trackHandle);if(!r){Sr.warn("Unknown subscriber handle ".concat(n.header.trackHandle));return}const i=this.descriptors.get(r);if(!i){Sr.error("Missing descriptor for track ".concat(r));return}if(i.subscription.type!=="active"){Sr.warn("Received packet for track ".concat(r," without active subscription"));return}const a=yield i.subscription.pipeline.processPacket(n);if(a)for(const s of i.subscription.streamControllers.keys()){if(s.desiredSize!==null&&s.desiredSize<=0){Sr.warn("Cannot send frame to subscribers: readable stream is full (desiredSize is ".concat(s.desiredSize,"). To increase this threshold, set a higher 'options.highWaterMark' when calling .subscribe()."));continue}const o=VW.lossyIntoFrame(a);s.enqueue(o)}})}resendSubscriptionUpdates(){for(const[e,n]of this.descriptors)n.subscription.type!=="none"&&this.emit
700("sfuUpdateSubscription",{sid:e,subscribe:!0})}handleRemoteParticipantDisconnected(e){var n,r;for(const i of this.descriptors.values())if(i.publisherIdentity===e)switch(i.subscription.type){case"none":break;case"pending":(r=(n=i.subscription.completionFuture).reject)===null||r===void 0||r.call(n,Zr.disconnected());break;case"active":this.unSubscribeRequest(i.info.sid);break}}shutdown(){var e,n;for(const r of this.descriptors.values())this.emit("trackUnpublished",{sid:r.info.sid,publisherIdentity:r.publisherIdentity}),r.subscription.type==="pending"&&((n=(e=r.subscription.completionFuture).reject)===null||n===void 0||n.call(e,Zr.disconnected())),r.subscription.type==="active"&&this.closeStreamControllers(r.subscription.streamControllers,r.info.sid);this.descriptors.clear()}}class Rw extends la{constructor(e,n,r){super(19,e,r),this.name="DataTrackPacketizerError",this.reason=n,this.reasonName=lb[n]}static mtuTooShort(){return new Rw("MTU is too short to send frame",lb.MtuTooShort)}}var lb;(function(t){t[t.MtuTooShort=0]="MtuTooShort"})(lb||(lb={}));class MP{constructor(e,n){this.sequence=Va.u16(0),this.frameNumber=Va.u16(0),this.clock=xl.rtpStartingNow(Ud.rtpRandom()),this.handle=e,this.mtuSizeBytes=n}static computeFrameMarker(e,n){return n<=1?fn.Single:e===0?fn.Start:e===n-1?fn.Final:fn.Inter}*packetize(e,n){var r;const i=this.frameNumber.getThenIncrement(),a={marker:fn.Inter,trackHandle:this.handle,sequence:Va.u16(0),frameNumber:i,timestamp:(r=n==null?void 0:n.now)!==null&&r!==void 0?r:this.clock.now(),extensions:e.extensions},s=new qm(a).toBinaryLengthBytes();if(s>=this.mtuSizeBytes)throw Rw.mtuTooShort();const o=this.mtuSizeBytes-s,c=Math.ceil(e.payload.byteLength/o);for(let u=0,d=0;d<e.payload.byteLength;[u,d]=[u+1,d+o]){const h=this.sequence.getThenIncrement(),f=new qm(Object.assign(Object.assign({},a),{marker:MP.computeFrameMarker(u,c),sequence:h})),p=Math.min(o,e.payload.byteLength-d),g=new Uint8Array(e.payload.buffer,e.payload.byteOffset+d,p);yield new Aw(f,g)}}}var xa;(function(t){t[t.NotAllowed=0]="NotAllowed",t[t.DuplicateName=1]="DuplicateName",t[t.Timeout=2]="Timeout",t[t.LimitReached=3]="LimitReached",t[t.Disconnected=4]="Disconnected",t[t.Cancelled=5]="Cancelled",t[t.InvalidName=6]="InvalidName",t[t.Unknown=7]="Unknown"})(xa||(xa={}));class Zn extends la{constructor(e,n,r){super(21,e,r),this.name="DataTrackPublishError",this.reason=n,this.reasonName=xa[n],this.rawMessage=r==null?void 0:r.rawMessage}static notAllowed(e){return new Zn("Data track publishing unauthorized",xa.NotAllowed,{rawMessage:e})}static duplicateName(e){return new Zn("Track name already taken",xa.DuplicateName,{rawMessage:e})}static invalidName(e){return new Zn("Track name is invalid",xa.InvalidName,{rawMessage:e})}static timeout(){return new Zn("Publish data track timed-out. Does the LiveKit server support data tracks?",xa.Timeout)}static limitReached(e){return new Zn("Data track publication limit reached",xa.LimitReached,{rawMessage:e})}static unknown(e,n){return new Zn("Received RequestResponse for publishDataTrack, but reason was unrecognised (".concat(e,", ").concat(n,")"),xa.Unknown)}static disconnected(){return new Zn("Room disconnected",xa.Disconnected)}static cancelled(){return new Zn("Publish data track cancelled by caller",xa.Cancelled)}}var Kp;(function(t){t[t.TrackUnpublished=0]="TrackUnpublished",t[t.Dropped=1]="Dropped"})(Kp||(Kp={}));class sc extends la{constructor(e,n,r){super(22,e,r),this.name="DataTrackPushFrameError",this.reason=n,this.reasonName=Kp[n]}static trackUnpublished(){return new sc("Track is no longer published",Kp.TrackUnpublished)}static dropped(e){return new sc("Frame was dropped",Kp.Dropped,{cause:e})}}var Gp;(function(t){t[t.Packetizer=0]="Packetizer",t[t.Encryption=1]="Encryption"})(Gp||(Gp={}));class Km extends la{constructor(e,n,r){super(21,e,r),this.name="DataTrackOutgoingPipelineError",this.reason=n,this.reasonName=Gp[n]}static packetizer(e){return new Km("Error packetizing frame",Gp.Packetizer,{cause:e})}static encryption(e){return new Km("Error encrypting frame",Gp.Encryption,{cause:e})}}
700class Dw{constructor(e,n){this.trackSymbol=HW,this.isLocal=!0,this.typeSymbol=qW,this.handle=null,this.log=ft,this.options=e,this.manager=n,this.log=li(Rr.DataTracks)}static withExplicitHandle(e,n,r){const i=new Dw(e,n);return i.handle=r,i}get info(){const e=this.descriptor;if((e==null?void 0:e.type)==="active")return e.info}get descriptor(){return this.handle?this.manager.getDescriptor(this.handle):null}publish(e){return F(this,void 0,void 0,function*(){try{this.handle=yield this.manager.publishRequest(this.options,e)}catch(n){throw n}})}isPublished(){var e;return((e=this.descriptor)===null||e===void 0?void 0:e.type)==="active"&&this.descriptor.publishState!=="unpublished"}tryPush(e){if(!this.handle)throw sc.trackUnpublished();const n=VW.from(e);try{return this.manager.tryProcessAndSend(this.handle,n)}catch(r){throw r}}unpublish(){return F(this,void 0,void 0,function*(){if(!this.handle){ft.warn('Data track "'.concat(this.options.name,'" is not published, so unpublishing has no effect.'));return}try{yield this.manager.unpublishRequest(this.handle)}catch(e){throw e}})}}class Mw{constructor(e){this.e2eeManager=e.e2eeManager,this.packetizer=new MP(e.info.pubHandle,Mw.TRANSPORT_MTU_BYTES)}updateE2eeManager(e){this.e2eeManager=e}processFrame(e){return Npe(this,arguments,function*(){const r=yield Eh(this.encryptIfNeeded(e));try{yield Eh(yield*Ape(Ia(this.packetizer.packetize(r))))}catch(i){throw i instanceof Rw?Km.packetizer(i):i}})}encryptIfNeeded(e){return F(this,void 0,void 0,function*(){if(!this.e2eeManager)return e;let n;try{n=yield this.e2eeManager.encryptData(e.payload)}catch(r){throw Km.encryption(r)}return e.payload=n.payload,e.extensions.e2ee=new Fa(n.keyIndex,n.iv),e})}}Mw.TRANSPORT_MTU_BYTES=16e3;const Fs=li(Rr.DataTracks),X4={pending(){return{type:"pending",completionFuture:new Ur}},active(t,e){return{type:"active",info:t,publishState:"published",pipeline:new Mw({info:t,e2eeManager:e}),unpublishingFuture:new Ur}}},Wge=1e4;class IP extends ca.EventEmitter{constructor(e){var n;super(),this.handleAllocator=new $me,this.descriptors=new Map,this.e2eeManager=(n=e==null?void 0:e.e2eeManager)!==null&&n!==void 0?n:null}static withDescriptors(e){const n=new IP;return n.descriptors=e,n}updateE2eeManager(e){this.e2eeManager=e;for(const n of this.descriptors.values())n.type==="active"&&n.pipeline.updateE2eeManager(e)}getDescriptor(e){var n;return(n=this.descriptors.get(e))!==null&&n!==void 0?n:null}tryProcessAndSend(e,n){return F(this,void 0,void 0,function*(){var r,i,a,s;const o=this.getDescriptor(e);if((o==null?void 0:o.type)!=="active"||o.publishState==="unpublished")throw sc.trackUnpublished();if(o.publishState==="republishing")throw sc.dropped("Data track republishing");try{try{for(var c=!0,u=Ia(o.pipeline.processFrame(n)),d;d=yield u.next(),r=d.done,!r;c=!0){s=d.value,c=!1;const h=s;this.emit("packetAvailable",{bytes:h.toBinary()})}}catch(h){i={error:h}}finally{try{!c&&!r&&(a=u.return)&&(yield a.call(u))}finally{if(i)throw i.error}}}catch(h){throw sc.dropped(h)}})}publishRequest(e,n){return F(this,void 0,void 0,function*(){const r=this.handleAllocator.get();if(!r)throw Zn.limitReached();const i=zW(Wge),a=n?UW([n,i]):i;if(this.descriptors.has(r))throw new Error("Descriptor for handle already exists");const s=X4.pending();this.descriptors.set(r,s);const o=()=>{var c,u;const d=this.descriptors.get(r);if(!d){Fs.warn("No descriptor for ".concat(r));return}this.descriptors.delete(r),this.emit("sfuUnpublishRequest",{handle:r}),d.type==="pending"&&((u=(c=d.completionFuture).reject)===null||u===void 0||u.call(c,i.aborted?Zn.timeout():Zn.cancelled()))};return a.aborted?(o(),s.completionFuture.promise.then(()=>r)):(a.addEventListener("abort",o),this.emit("sfuPublishRequest",{handle:r,name:e.name,usesE2ee:this.e2eeManager!==null}),yield s.completionFuture.promise,a.removeEventListener("abort",o),this.emit("trackPublished",{track:Dw.withExplicitHandle(e,this,r)}),r)})}queryPublished(){return Array.from(this.descriptors.values()).filter(n=>n.type==="active").map(n=>n.info)}unpublishRequest(e){return F(this,void 0,void 0,function*(){const n=this.descriptors.get(e);if(!n){Fs.warn("No descriptor for ".concat(e));return}if(n.type!=="active"){Fs.warn("Track ".concat(e," not active"));return}
700this.emit("sfuUnpublishRequest",{handle:e}),yield n.unpublishingFuture.promise,this.emit("trackUnpublished",{sid:n.info.sid})})}receivedSfuPublishResponse(e,n){var r,i,a,s;const o=this.descriptors.get(e);if(!o){Fs.warn("No descriptor for ".concat(e));return}switch(this.descriptors.delete(e),o.type){case"pending":{if(n.type==="ok"){const c=n.data,u=c.usesE2ee?this.e2eeManager:null;this.descriptors.set(c.pubHandle,X4.active(c,u)),(i=(r=o.completionFuture).resolve)===null||i===void 0||i.call(r)}else(s=(a=o.completionFuture).reject)===null||s===void 0||s.call(a,n.error);return}case"active":{if(o.publishState!=="republishing"){Fs.warn("Track ".concat(e," already active"));return}if(n.type==="error"){Fs.warn("Republish failed for track ".concat(e));return}Fs.debug("Track ".concat(e," republished")),o.info.sid=n.data.sid,o.publishState="published",this.descriptors.set(o.info.pubHandle,o)}}}receivedSfuUnpublishResponse(e){var n,r;const i=this.descriptors.get(e);if(!i){Fs.warn("No descriptor for ".concat(e));return}if(this.descriptors.delete(e),i.type!=="active"){Fs.warn("Track ".concat(e," not active"));return}i.publishState="unpublished",(r=(n=i.unpublishingFuture).resolve)===null||r===void 0||r.call(n)}sfuWillRepublishTracks(){var e,n;for(const[r,i]of this.descriptors.entries())switch(i.type){case"pending":this.descriptors.delete(r),(n=(e=i.completionFuture).reject)===null||n===void 0||n.call(e,Zn.disconnected());break;case"active":i.publishState="republishing",this.emit("sfuPublishRequest",{handle:i.info.pubHandle,name:i.info.name,usesE2ee:i.info.usesE2ee})}}shutdown(){return F(this,void 0,void 0,function*(){var e,n,r,i;for(const a of this.descriptors.values())switch(a.type){case"pending":(n=(e=a.completionFuture).reject)===null||n===void 0||n.call(e,Zn.disconnected());break;case"active":(i=(r=a.unpublishingFuture).resolve)===null||i===void 0||i.call(r),yield this.unpublishRequest(a.info.pubHandle);break}this.descriptors.clear()})}}class GW extends fe{constructor(e,n,r,i,a){super(e,r,a),this.sid=n,this.receiver=i}get isLocal(){return!1}setMuted(e){this.isMuted!==e&&(this.isMuted=e,this._mediaStreamTrack.enabled=!e,this.emit(e?ke.Muted:ke.Unmuted,this))}setMediaStream(e){this.mediaStream=e;const n=r=>{r.track===this._mediaStreamTrack&&(e.removeEventListener("removetrack",n),this.receiver&&"playoutDelayHint"in this.receiver&&(this.receiver.playoutDelayHint=void 0),this.receiver=void 0,this._currentBitrate=0,this.emit(ke.Ended,this))};e.addEventListener("removetrack",n)}start(){this.startMonitor(),super.enable()}stop(){this.stopMonitor(),super.disable()}getRTCStatsReport(){return F(this,void 0,void 0,function*(){var e;return!((e=this.receiver)===null||e===void 0)&&e.getStats?yield this.receiver.getStats():void 0})}setPlayoutDelay(e){this.receiver?"playoutDelayHint"in this.receiver?this.receiver.playoutDelayHint=e:this.log.warn("Playout delay not supported in this browser"):this.log.warn("Cannot set playout delay, track already ended")}getPlayoutDelay(){if(this.receiver){if("playoutDelayHint"in this.receiver)return this.receiver.playoutDelayHint;this.log.warn("Playout delay not supported in this browser")}else this.log.warn("Cannot get playout delay, track already ended");return 0}startMonitor(){this.monitorInterval||(this.monitorInterval=setInterval(()=>this.monitorReceiver(),RP)),eme()&&this.registerTimeSyncUpdate()}registerTimeSyncUpdate(){const e=()=>{var n;this.timeSyncHandle=requestAnimationFrame(()=>e());const r=(n=this.receiver)===null||n===void 0?void 0:n.getSynchronizationSources()[0];if(r){const{timestamp:i,rtpTimestamp:a}=r;a&&this.rtpTimestamp!==a&&(this.emit(ke.TimeSyncUpdate,{timestamp:i,rtpTimestamp:a}),this.rtpTimestamp=a)}};e()}}class Vge extends GW{constructor(e,n,r,i,a,s){super(e,n,fe.Kind.Audio,r,s),this.monitorReceiver=()=>F(this,void 0,void 0,function*(){if(!this.receiver){this._currentBitrate=0;return}const o=yield this.getReceiverStats();o&&this.prevStats&&this.receiver&&(this._currentBitrate=Pw(o,this.prevStats)),this.prevStats=o}),this.audioContext=i,this.webAudioPluginNodes=[],a&&(this.sinkId=a.deviceId)}setVolume(e){var n;for(const r of this.attachedElements)this.audioContext?(n=this.gainNode)===null||n===void 0||n.gain.setTargetAtTime(e,0,.1):r.volume=e;js()&&this._mediaStreamTrack._setVolume(e),this.elementVolume=e}getVolume(){if(this.elementVolume)return this.elementVolume;if(js())return 1;let e=0;
vendor: 19,045 bytes, line 700
700return this.attachedElements.forEach(n=>{n.volume>e&&(e=n.volume)}),e}setSinkId(e){return F(this,void 0,void 0,function*(){this.sinkId=e,yield Promise.all(this.attachedElements.map(n=>{if(oT(n))return n.setSinkId(e)}))})}attach(e){const n=this.attachedElements.length===0;return e?super.attach(e):e=super.attach(),this.sinkId&&oT(e)&&e.setSinkId(this.sinkId).catch(r=>{this.log.error("Failed to set sink id on remote audio track",r,this.logContext)}),this.audioContext&&n&&(this.log.debug("using audio context mapping",this.logContext),this.connectWebAudio(this.audioContext,e),e.volume=0,e.muted=!0),this.elementVolume&&this.setVolume(this.elementVolume),e}detach(e){let n;return e?(n=super.detach(e),this.audioContext&&(this.attachedElements.length>0?this.connectWebAudio(this.audioContext,this.attachedElements[0]):this.disconnectWebAudio())):(n=super.detach(),this.disconnectWebAudio()),n}setAudioContext(e){this.audioContext=e,e&&this.attachedElements.length>0?this.connectWebAudio(e,this.attachedElements[0]):e||this.disconnectWebAudio()}setWebAudioPlugins(e){this.webAudioPluginNodes=e,this.attachedElements.length>0&&this.audioContext&&this.connectWebAudio(this.audioContext,this.attachedElements[0])}connectWebAudio(e,n){this.disconnectWebAudio(),this.sourceNode=e.createMediaStreamSource(n.srcObject);let r=this.sourceNode;this.webAudioPluginNodes.forEach(i=>{r.connect(i),r=i}),this.gainNode=e.createGain(),r.connect(this.gainNode),this.gainNode.connect(e.destination),this.elementVolume&&this.gainNode.gain.setTargetAtTime(this.elementVolume,0,.1),e.state!=="running"&&e.resume().then(()=>{e.state!=="running"&&this.emit(ke.AudioPlaybackFailed,new Error("Audio Context couldn't be started automatically"))}).catch(i=>{this.emit(ke.AudioPlaybackFailed,i)})}disconnectWebAudio(){var e,n;(e=this.gainNode)===null||e===void 0||e.disconnect(),(n=this.sourceNode)===null||n===void 0||n.disconnect(),this.gainNode=void 0,this.sourceNode=void 0}getReceiverStats(){return F(this,void 0,void 0,function*(){if(!this.receiver||!this.receiver.getStats)return;const e=yield this.receiver.getStats();let n;return e.forEach(r=>{r.type==="inbound-rtp"&&(n={type:"audio",streamId:r.id,timestamp:r.timestamp,jitter:r.jitter,bytesReceived:r.bytesReceived,concealedSamples:r.concealedSamples,concealmentEvents:r.concealmentEvents,silentConcealedSamples:r.silentConcealedSamples,silentConcealmentEvents:r.silentConcealmentEvents,totalAudioEnergy:r.totalAudioEnergy,totalSamplesDuration:r.totalSamplesDuration})}),n})}}const uk=100;class Hge extends GW{constructor(e,n,r,i,a){super(e,n,fe.Kind.Video,r,a),this.elementInfos=[],this.monitorReceiver=()=>F(this,void 0,void 0,function*(){if(!this.receiver){this._currentBitrate=0;return}const s=yield this.getReceiverStats();s&&this.prevStats&&this.receiver&&(this._currentBitrate=Pw(s,this.prevStats)),this.prevStats=s}),this.debouncedHandleResize=PP(()=>{this.updateDimensions()},uk),this.adaptiveStreamSettings=i}get isAdaptiveStream(){return this.adaptiveStreamSettings!==void 0}setStreamState(e){super.setStreamState(e),this.log.debug("setStreamState",e),this.isAdaptiveStream&&e===fe.StreamState.Active&&this.updateVisibility()}get mediaStreamTrack(){return this._mediaStreamTrack}setMuted(e){super.setMuted(e),this.attachedElements.forEach(n=>{e?$d(this._mediaStreamTrack,n):vd(this._mediaStreamTrack,n)})}attach(e){if(e?super.attach(e):e=super.attach(),this.adaptiveStreamSettings&&this.elementInfos.find(n=>n.element===e)===void 0){const n=new qge(e);this.observeElementInfo(n)}return e}observeElementInfo(e){this.adaptiveStreamSettings&&this.elementInfos.find(n=>n===e)===void 0?(e.handleResize=()=>{this.debouncedHandleResize()},e.handleVisibilityChanged=()=>{this.updateVisibility()},this.elementInfos.push(e),e.observe(),this.debouncedHandleResize(),this.updateVisibility()):this.log.warn("visibility resize observer not triggered",this.logContext)}stopObservingElementInfo(e){if(!this.isAdaptiveStream){this.log.warn("stopObservingElementInfo ignored",this.logContext);return}const n=this.elementInfos.filter(r=>r===e);for(const r of n)r.stopObserving();this.elementInfos=this.elementInfos.filter(r=>r!==e),this.updateVisibility(),this.debouncedHandleResize()}detach(e){let n=[];if(e)return this.stopObservingElement(e),super.detach(e);n=super.detach();for(const r of n)this.stopObservingElement(r);return n}getDecoderImplementation(){var e;return(e=this.prevStats)===null||e===void 0?void 0:e.decoderImplementation}getReceiverStats(){return F(this,void 0,void 0,function*(){if(!this.receiver||!this.receiver.getStats)return;const e=yield this.receiver.getStats();let n,r="",i=new Map;return e.forEach(a=>{a.type==="inbound-rtp"?(r=a.codecId,n={type:"video",streamId:a.id,framesDecoded:a.framesDecoded,framesDropped:a.framesDropped,framesReceived:a.framesReceived,packetsReceived:a.packetsReceived,packetsLost:a.packetsLost,frameWidth:a.frameWidth,frameHeight:a.frameHeight,pliCount:a.pliCount,firCount:a.firCount,nackCount:a.nackCount,jitter:a.jitter,timestamp:a.timestamp,bytesReceived:a.bytesReceived,decoderImplementation:a.decoderImplementation}):a.type==="codec"&&i.set(a.id,a)}),n&&r!==""&&i.get(r)&&(n.mimeType=i.get(r).mimeType),n})}stopObservingElement(e){const n=this.elementInfos.filter(r=>r.element===e);for(const r of n)this.stopObservingElementInfo(r)}handleAppVisibilityChanged(){const e=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return F(this,void 0,void 0,function*(){yield e.handleAppVisibilityChanged.call(this),this.isAdaptiveStream&&this.updateVisibility()})}updateVisibility(e){var n,r;const i=this.elementInfos.reduce((c,u)=>Math.max(c,u.visibilityChangedAt||0),0),a=!((r=(n=this.adaptiveStreamSettings)===null||n===void 0?void 0:n.pauseVideoInBackground)!==null&&r!==void 0)||r?this.isInBackground:!1,s=this.elementInfos.some(c=>c.pictureInPicture),o=this.elementInfos.some(c=>c.visible)&&!a||s;if(!(this.lastVisible===o&&!e)){if(!o&&Date.now()-i<uk){Vn.setTimeout(()=>{this.updateVisibility()},uk);return}this.lastVisible=o,this.emit(ke.VisibilityChanged,o,this)}}updateDimensions(){var e,n;let r=0,i=0;const a=this.getPixelDensity();for(const s of this.elementInfos){const o=s.width()*a,c=s.height()*a;o+c>r+i&&(r=o,i=c)}((e=this.lastDimensions)===null||e===void 0?void 0:e.width)===r&&((n=this.lastDimensions)===null||n===void 0?void 0:n.height)===i||(this.lastDimensions={width:r,height:i},this.emit(ke.VideoDimensionsChanged,this.lastDimensions,this))}getPixelDensity(){var e;const n=(e=this.adaptiveStreamSettings)===null||e===void 0?void 0:e.pixelDensity;return n==="screen"?f4():n||(f4()>2?2:1)}}class qge{get visible(){return this.isPiP||this.isIntersecting}get pictureInPicture(){return this.isPiP}constructor(e,n){this.onVisibilityChanged=r=>{var i;const{target:a,isIntersecting:s}=r;a===this.element&&(this.isIntersecting=s,this.isPiP=ap(this.element),this.visibilityChangedAt=Date.now(),(i=this.handleVisibilityChanged)===null||i===void 0||i.call(this))},this.onEnterPiP=()=>{var r,i;(i=(r=window.documentPictureInPicture)===null||r===void 0?void 0:r.window)===null||i===void 0||i.addEventListener("pagehide",this.onLeavePiP),queueMicrotask(()=>{requestAnimationFrame(()=>{var a;this.isPiP=ap(this.element),(a=this.handleVisibilityChanged)===null||a===void 0||a.call(this)})})},this.onLeavePiP=()=>{var r;this.isPiP=ap(this.element),(r=this.handleVisibilityChanged)===null||r===void 0||r.call(this)},this.element=e,this.isIntersecting=n??pT(e),this.isPiP=ni()&&ap(e),this.visibilityChangedAt=0}width(){return this.element.clientWidth}height(){return this.element.clientHeight}observe(){var e,n,r;this.isIntersecting=pT(this.element),this.isPiP=ap(this.element),this.element.handleResize=()=>{var i;(i=this.handleResize)===null||i===void 0||i.call(this)},this.element.handleVisibilityChanged=this.onVisibilityChanged,m4().observe(this.element),p4().observe(this.element),this.element.addEventListener("enterpictureinpicture",this.onEnterPiP),this.element.addEventListener("leavepictureinpicture",this.onLeavePiP),(e=window.documentPictureInPicture)===null||e===void 0||e.addEventListener("enter",this.onEnterPiP),(r=(n=window.documentPictureInPicture)===null||n===void 0?void 0:n.window)===null||r===void 0||r.addEventListener("pagehide",this.onLeavePiP)}stopObserving(){var e,n,r,i,a;(e=m4())===null||e===void 0||e.unobserve(this.element),(n=p4())===null||n===void 0||n.unobserve(this.element),this.element.removeEventListener("enterpictureinpicture",this.onEnterPiP),this.element.removeEventListener("leavepictureinpicture",this.onLeavePiP),(r=window.documentPictureInPicture)===null||r===void 0||r.removeEventListener("enter",this.onEnterPiP),(a=(i=window.documentPictureInPicture)===null||i===void 0?void 0:i.window)===null||a===void 0||a.removeEventListener("pagehide",this.onLeavePiP)}}function ap(t){var e,n;return document.pictureInPictureElement===t?!0:!((e=window.documentPictureInPicture)===null||e===void 0)&&e.window?pT(t,(n=window.documentPictureInPicture)===null||n===void 0?void 0:n.window):!1}function pT(t,e){const n=e||window;let r=t.offsetTop,i=t.offsetLeft;const a=t.offsetWidth,s=t.offsetHeight,{hidden:o}=t,{display:c}=getComputedStyle(t);for(;t.offsetParent;)t=t.offsetParent,r+=t.offsetTop,i+=t.offsetLeft;return r<n.pageYOffset+n.innerHeight&&i<n.pageXOffset+n.innerWidth&&r+s>n.pageYOffset&&i+a>n.pageXOffset&&!o&&c!=="none"}class Ys extends ca.EventEmitter{constructor(e,n,r,i){var a;super(),this.metadataMuted=!1,this.encryption=Yt.NONE,this.log=ft,this.handleMuted=()=>{this.emit(ke.Muted)},this.handleUnmuted=()=>{this.emit(ke.Unmuted)},this.log=li((a=i==null?void 0:i.loggerName)!==null&&a!==void 0?a:Rr.Publication),this.loggerContextCb=this.loggerContextCb,this.setMaxListeners(100),this.kind=e,this.trackSid=n,this.trackName=r,this.source=fe.Source.Unknown}setTrack(e){this.track&&(this.track.off(ke.Muted,this.handleMuted),this.track.off(ke.Unmuted,this.handleUnmuted)),this.track=e,e&&(e.on(ke.Muted,this.handleMuted),e.on(ke.Unmuted,this.handleUnmuted))}get logContext(){var e;return Object.assign(Object.assign({},(e=this.loggerContextCb)===null||e===void 0?void 0:e.call(this)),St(this))}get isMuted(){return this.metadataMuted}get isEnabled(){return!0}get isSubscribed(){return this.track!==void 0}get isEncrypted(){return this.encryption!==Yt.NONE}get audioTrack(){if(bs(this.track))return this.track}get videoTrack(){if(qc(this.track))return this.track}updateInfo(e){this.trackSid=e.sid,this.trackName=e.name,this.source=fe.sourceFromProto(e.source),this.mimeType=e.mimeType,this.kind===fe.Kind.Video&&e.width>0&&(this.dimensions={width:e.width,height:e.height},this.simulcasted=e.simulcast),this.encryption=e.encryption,this.trackInfo=e,this.log.debug("update publication info",Object.assign(Object.assign({},this.logContext),{info:e}))}}(function(t){(function(e){e.Desired="desired",e.Subscribed="subscribed",e.Unsubscribed="unsubscribed"})(t.SubscriptionStatus||(t.SubscriptionStatus={})),function(e){e.Allowed="allowed",e.NotAllowed="not_allowed"}(t.PermissionStatus||(t.PermissionStatus={}))})(Ys||(Ys={}));class mT extends Ys{get isUpstreamPaused(){var e;return(e=this.track)===null||e===void 0?void 0:e.isUpstreamPaused}constructor(e,n,r,i){super(e,n.sid,n.name,i),this.track=void 0,this.handleTrackEnded=()=>{this.emit(ke.Ended)},this.handleCpuConstrained=()=>{this.track&&qc(this.track)&&this.emit(ke.CpuConstrained,this.track)},this.updateInfo(n),this.setTrack(r)}setTrack(e){this.track&&(this.track.off(ke.Ended,this.handleTrackEnded),this.track.off(ke.CpuConstrained,this.handleCpuConstrained)),super.setTrack(e),e&&(e.on(ke.Ended,this.handleTrackEnded),e.on(ke.CpuConstrained,this.handleCpuConstrained))}get isMuted(){return this.track?this.track.isMuted:super.isMuted}get audioTrack(){return super.audioTrack}get videoTrack(){return super.videoTrack}get isLocal(){return!0}mute(){return F(this,void 0,void 0,function*(){var e;return(e=this.track)===null||e===void 0?void 0:e.mute()})}unmute(){return F(this,void 0,void 0,function*(){var e;return(e=this.track)===null||e===void 0?void 0:e.unmute()})}pauseUpstream(){return F(this,void 0,void 0,function*(){var e;yield(e=this.track)===null||e===void 0?void 0:e.pauseUpstream()})}resumeUpstream(){return F(this,void 0,void 0,function*(){var e;yield(e=this.track)===null||e===void 0?void 0:e.resumeUpstream()})}getTrackFeatures(){var e;if(bs(this.track)){const n=this.track.getSourceTrackSettings(),r=new Set;return n.autoGainControl&&r.add(or.TF_AUTO_GAIN_CONTROL),n.echoCancellation&&r.add(or.TF_ECHO_CANCELLATION),n.noiseSuppression&&r.add(or.TF_NOISE_SUPPRESSION),n.channelCount&&n.channelCount>1&&r.add(or.TF_STEREO),!((e=this.options)===null||e===void 0)&&e.dtx||r.add(or.TF_NO_DTX),this.track.enhancedNoiseCancellation&&r.add(or.TF_ENHANCED_NOISE_CANCELLATION),Array.from(r.values())}else return[]}}function Iw(t,e){return F(this,void 0,void 0,function*(){t??(t={});let n=!1;const{audioProcessor:r,videoProcessor:i,optionsWithoutProcessor:a}=TW(t);let s=a.audio,o=a.video;if(r&&typeof a.audio=="object"&&(a.audio.processor=r),i&&typeof a.video=="object"&&(a.video.processor=i),t.audio&&typeof a.audio=="object"&&typeof a.audio.deviceId=="string"){const h=a.audio.deviceId;a.audio.deviceId={exact:h},n=!0,s=Object.assign(Object.assign({},a.audio),{deviceId:{ideal:h}})}if(a.video&&typeof a.video=="object"&&typeof a.video.deviceId=="string"){const h=a.video.deviceId;a.video.deviceId={exact:h},n=!0,o=Object.assign(Object.assign({},a.video),{deviceId:{ideal:h}})}a.audio===!0?a.audio={deviceId:"default"}:typeof a.audio=="object"&&a.audio!==null&&(a.audio=Object.assign(Object.assign({},a.audio),{deviceId:a.audio.deviceId||"default"})),a.video===!0?a.video={deviceId:"default"}:typeof a.video=="object"&&!a.video.deviceId&&(a.video.deviceId="default");const c=kW(a,OW,RW),u=kP(c),d=navigator.mediaDevices.getUserMedia(u);a.audio&&(cr.userMediaPromiseMap.set("audioinput",d),d.catch(()=>cr.userMediaPromiseMap.delete("audioinput"))),a.video&&(cr.userMediaPromiseMap.set("videoinput",d),d.catch(()=>cr.userMediaPromiseMap.delete("videoinput")));try{const h=yield d;return yield Promise.all(h.getTracks().map(f=>F(this,void 0,void 0,function*(){const p=f.kind==="audio";let g=p?c.audio:c.video;(typeof g=="boolean"||!g)&&(g={});let m;const v=p?u.audio:u.video;typeof v!="boolean"&&(m=v);const x=f.getSettings().deviceId;m!=null&&m.deviceId&&zl(m.deviceId)!==x?m.deviceId=x:m||(m={deviceId:x});const w=oge(f,m,e);return w.kind===fe.Kind.Video?w.source=fe.Source.Camera:w.kind===fe.Kind.Audio&&(w.source=fe.Source.Microphone),w.mediaStream=h,bs(w)&&r?yield w.setProcessor(r):qc(w)&&i&&(yield w.setProcessor(i)),w})))}catch(h){if(!n)throw h;return Iw(Object.assign(Object.assign({},t),{audio:s,video:o}),e)}})}function Kge(t){return F(this,void 0,void 0,function*(){return(yield Iw({audio:!1,video:!0}))[0]})}function Gge(t){return F(this,void 0,void 0,function*(){return(yield Iw({audio:!0,video:!1}))[0]})}var Go;(function(t){t.Excellent="excellent",t.Good="good",t.Poor="poor",t.Lost="lost",t.Unknown="unknown"})(Go||(Go={}));function Yge(t){switch(t){case Cp.EXCELLENT:return Go.Excellent;case Cp.GOOD:return Go.Good;case Cp.POOR:return Go.Poor;case Cp.LOST:return Go.Lost;default:return Go.Unknown}}class YW extends ca.EventEmitter{get logContext(){var e,n;return Object.assign({},(n=(e=this.loggerOptions)===null||e===void 0?void 0:e.loggerContextCb)===null||n===void 0?void 0:n.call(e))}get isEncrypted(){return this.trackPublications.size>0&&Array.from(this.trackPublications.values()).every(e=>e.isEncrypted)}get isAgent(){var e;return((e=this.permissions)===null||e===void 0?void 0:e.agent)||this.kind===Bm.AGENT}get isActive(){var e;return((e=this.participantInfo)===null||e===void 0?void 0:e.state)===Md.ACTIVE}get kind(){return this._kind}get attributes(){return Object.freeze(Object.assign({},this._attributes))}constructor(e,n,r,i,a,s){let o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:Bm.STANDARD;var c;super(),this.audioLevel=0,this.isSpeaking=!1,this._connectionQuality=Go.Unknown,this.log=ft,this.log=li((c=s==null?void 0:s.loggerName)!==null&&c!==void 0?c:Rr.Participant),this.loggerOptions=s,this.setMaxListeners(100),this.sid=e,this.identity=n,this.name=r,this.metadata=i,this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.trackPublications=new Map,this._kind=o,this._attributes=a??{}}getTrackPublications(){return Array.from(this.trackPublications.values())}getTrackPublication(e){for(const[,n]of this.trackPublications)if(n.source===e)return n}getTrackPublicationByName(e){for(const[,n]of this.trackPublications)if(n.trackName===e)return n}waitUntilActive(){return this.isActive?Promise.resolve():this.activeFuture?this.activeFuture.promise:(this.activeFuture=new Ur,this.once(Ee.Active,()=>{var e,n;(n=(e=this.activeFuture)===null||e===void 0?void 0:e.resolve)===null||n===void 0||n.call(e),this.activeFuture=void 0}),this.activeFuture.promise)}get connectionQuality(){return this._connectionQuality}get isCameraEnabled(){var e;const n=this.getTrackPublication(fe.Source.Camera);return!(!((e=n==null?void 0:n.isMuted)!==null&&e!==void 0)||e)}get isMicrophoneEnabled(){var e;const n=this.getTrackPublication(fe.Source.Microphone);return!(!((e=n==null?void 0:n.isMuted)!==null&&e!==void 0)||e)}get isScreenShareEnabled(){return!!this.getTrackPublication(fe.Source.ScreenShare)}get isLocal(){return!1}get joinedAt(){return this.participantInfo?new Date(Number.parseInt(this.participantInfo.joinedAt.toString())*1e3):new Date}updateInfo(e){var n;return this.participantInfo&&this.participantInfo.sid===e.sid&&this.participantInfo.version>e.version?!1:(this.identity=e.identity,this.sid=e.sid,this._setName(e.name),this._setMetadata(e.metadata),this._setAttributes(e.attributes),e.state===Md.ACTIVE&&((n=this.participantInfo)===null||n===void 0?void 0:n.state)!==Md.ACTIVE&&this.emit(Ee.Active),e.permission&&this.setPermissions(e.permission),this.participantInfo=e,!0)}_setMetadata(e){const n=this.metadata!==e,r=this.metadata;this.metadata=e,n&&this.emit(Ee.ParticipantMetadataChanged,r)}_setName(e){const n=this.name!==e;this.name=e,n&&this.emit(Ee.ParticipantNameChanged,e)}_setAttributes(e){const n=tme(this.attributes,e);this._attributes=e,Object.keys(n).length>0&&this.emit(Ee.AttributesChanged,n)}setPermissions(e){var n,r,i,a,s,o;const c=this.permissions,u=e.canPublish!==((n=this.permissions)===null||n===void 0?void 0:n.canPublish)||e.canSubscribe!==((r=this.permissions)===null||r===void 0?void 0:r.canSubscribe)||e.canPublishData!==((i=this.permissions)===null||i===void 0?void 0:i.canPublishData)||e.hidden!==((a=this.permissions)===null||a===void 0?void 0:a.hidden)||e.recorder!==((s=this.permissions)===null||s===void 0?void 0:s.recorder)||e.canPublishSources.length!==this.permissions.canPublishSources.length||e.canPublishSources.some((d,h)=>{var f;return d!==((f=this.permissions)===null||f===void 0?void 0:f.canPublishSources[h])})||e.canSubscribeMetrics!==((o=this.permissions)===null||o===void 0?void 0:o.canSubscribeMetrics);
700return this.permissions=e,u&&this.emit(Ee.ParticipantPermissionsChanged,c),u}setIsSpeaking(e){e!==this.isSpeaking&&(this.isSpeaking=e,e&&(this.lastSpokeAt=new Date),this.emit(Ee.IsSpeakingChanged,e))}setConnectionQuality(e){const n=this._connectionQuality;this._connectionQuality=Yge(e),n!==this._connectionQuality&&this.emit(Ee.ConnectionQualityChanged,this._connectionQuality)}setDisconnected(){var e,n;this.activeFuture&&((n=(e=this.activeFuture).reject)===null||n===void 0||n.call(e,new Error("Participant disconnected")),this.activeFuture=void 0)}setAudioContext(e){this.audioContext=e,this.audioTrackPublications.forEach(n=>bs(n.track)&&n.track.setAudioContext(e))}addTrackPublication(e){e.on(ke.Muted,()=>{this.emit(Ee.TrackMuted,e)}),e.on(ke.Unmuted,()=>{this.emit(Ee.TrackUnmuted,e)});const n=e;switch(n.track&&(n.track.sid=e.trackSid),this.trackPublications.set(e.trackSid,e),e.kind){case fe.Kind.Audio:this.audioTrackPublications.set(e.trackSid,e);break;case fe.Kind.Video:this.videoTrackPublications.set(e.trackSid,e);break}}}function Jge(t){var e,n,r;if(!t.participantSid&&!t.participantIdentity)throw new Error("Invalid track permission, must provide at least one of participantIdentity and participantSid");return new Lz({participantIdentity:(e=t.participantIdentity)!==null&&e!==void 0?e:"",participantSid:(n=t.participantSid)!==null&&n!==void 0?n:"",allTracks:(r=t.allowAll)!==null&&r!==void 0?r:!1,trackSids:t.allowedTrackSids||[]})}class Xge extends YW{constructor(e,n,r,i,a,s,o){super(e,n,void 0,void 0,void 0,{loggerName:i.loggerName,loggerContextCb:()=>this.engine.logContext}),this.pendingPublishing=new Set,this.pendingPublishPromises=new Map,this.participantTrackPermissions=[],this.allParticipantsAllowedToSubscribe=!0,this.encryptionType=Yt.NONE,this.e2eeStateMutex=new gr,this.enabledPublishVideoCodecs=[],this.pendingAcks=new Map,this.pendingResponses=new Map,this.handleReconnecting=()=>{this.reconnectFuture||(this.reconnectFuture=new Ur)},this.handleReconnected=()=>{var c,u;(u=(c=this.reconnectFuture)===null||c===void 0?void 0:c.resolve)===null||u===void 0||u.call(c),this.reconnectFuture=void 0,this.updateTrackSubscriptionPermissions()},this.handleClosing=()=>{var c,u,d,h,f,p;this.reconnectFuture&&(this.reconnectFuture.promise.catch(g=>this.log.warn(g.message,this.logContext)),(u=(c=this.reconnectFuture)===null||c===void 0?void 0:c.reject)===null||u===void 0||u.call(c,new Error("Got disconnected during reconnection attempt")),this.reconnectFuture=void 0),this.signalConnectedFuture&&((h=(d=this.signalConnectedFuture).reject)===null||h===void 0||h.call(d,new Error("Got disconnected without signal connected")),this.signalConnectedFuture=void 0),(p=(f=this.activeAgentFuture)===null||f===void 0?void 0:f.reject)===null||p===void 0||p.call(f,new Error("Got disconnected without active agent present")),this.activeAgentFuture=void 0,this.firstActiveAgent=void 0},this.handleSignalConnected=c=>{var u,d;c.participant&&this.updateInfo(c.participant),this.signalConnectedFuture||(this.signalConnectedFuture=new Ur),(d=(u=this.signalConnectedFuture).resolve)===null||d===void 0||d.call(u)},this.handleSignalRequestResponse=c=>{const{requestId:u,reason:d,message:h}=c,f=this.pendingSignalRequests.get(u);switch(f&&(d!==bl.OK&&f.reject(new c4(h,d)),this.pendingSignalRequests.delete(u)),c.request.case){case"publishDataTrack":{let p;switch(c.reason){case bl.NOT_ALLOWED:p=Zn.notAllowed(c.message);break;case bl.DUPLICATE_NAME:p=Zn.duplicateName(c.message);break;case bl.INVALID_NAME:p=Zn.invalidName(c.message);break;case bl.LIMIT_EXCEEDED:p=Zn.limitReached(c.message);break;default:p=Zn.unknown(c.reason,c.message);return}this.roomOutgoingDataTrackManager.receivedSfuPublishResponse(c.request.value.pubHandle,{type:"error",error:p});break}}},this.handleDataPacket=c=>{switch(c.value.case){case"rpcResponse":let u=c.value.value,d=null,h=null;u.value.case==="payload"?d=u.value.value:u.value.case==="error"&&(h=An.fromProto(u.value.value)),this.handleIncomingRpcResponse(u.requestId,d,h);break;case"rpcAck":let f=c.value.value;this.handleIncomingRpcAck(f.requestId);break}},this.updateTrackSubscriptionPermissions=()=>{this.log.debug("updating track subscription permissions",Object.assign(Object.assign({},this.logContext),{allParticipantsAllowed:this.allParticipantsAllowedToSubscribe,participantTrackPermissions:this.participantTrackPermissions})),this.engine.client.sendUpdateSubscriptionPermissions(this.allParticipantsAllowedToSubscribe,this.participantTrackPermissions.map(c=>Jge(c)))},this.onTrackUnmuted=c=>{this.onTrackMuted(c,c.isUpstreamPaused)},this.onTrackMuted=(c,u)=>{if(u===void 0&&(u=!0),!c.sid){this.log.error("could not update mute status for unpublished track",Object.assign(Object.assign({},this.logContext),St(c)));return}this.engine.updateMuteStatus(c.sid,u)},this.onTrackUpstreamPaused=c=>{this.log.debug("upstream paused",Object.assign(Object.assign({},this.logContext),St(c))),this.onTrackMuted(c,!0)},this.onTrackUpstreamResumed=c=>{this.log.debug("upstream resumed",Object.assign(Object.assign({},this.logContext),St(c))),this.onTrackMuted(c,c.isMuted)},this.onTrackFeatureUpdate=c=>{const u=this.audioTrackPublications.get(c.sid);if(!u){this.log.warn("Could not update local audio track settings, missing publication for track ".concat(c.sid),this.logContext);return}this.engine.client.sendUpdateLocalAudioTrack(u.trackSid,u.getTrackFeatures())},this.onTrackCpuConstrained=(c,u)=>{this.log.debug("track cpu constrained",Object.assign(Object.assign({}
vendor: 18,474 bytes, line 700
700,this.logContext),St(u))),this.emit(Ee.LocalTrackCpuConstrained,c,u)},this.handleSubscribedQualityUpdate=c=>F(this,void 0,void 0,function*(){var u,d,h,f,p;if(!(!((p=this.roomOptions)===null||p===void 0)&&p.dynacast))return;const g=this.videoTrackPublications.get(c.trackSid);if(!g){this.log.warn("received subscribed quality update for unknown track",Object.assign(Object.assign({},this.logContext),{trackSid:c.trackSid}));return}if(!g.videoTrack)return;const m=yield g.videoTrack.setPublishingCodecs(c.subscribedCodecs);try{for(var v=!0,x=Ia(m),w;w=yield x.next(),u=w.done,!u;v=!0){f=w.value,v=!1;const y=f;Jpe(y)&&(this.log.debug("publish ".concat(y," for ").concat(g.videoTrack.sid),Object.assign(Object.assign({},this.logContext),St(g))),yield this.publishAdditionalCodecForTrack(g.videoTrack,y,g.options))}}catch(y){d={error:y}}finally{try{!v&&!u&&(h=x.return)&&(yield h.call(x))}finally{if(d)throw d.error}}}),this.handleLocalTrackUnpublished=c=>{const u=this.trackPublications.get(c.trackSid);if(!u){this.log.warn("received unpublished event for unknown track",Object.assign(Object.assign({},this.logContext),{trackSid:c.trackSid}));return}this.unpublishTrack(u.track)},this.handleTrackEnded=c=>F(this,void 0,void 0,function*(){if(c.source===fe.Source.ScreenShare||c.source===fe.Source.ScreenShareAudio)this.log.debug("unpublishing local track due to TrackEnded",Object.assign(Object.assign({},this.logContext),St(c))),this.unpublishTrack(c);else if(c.isUserProvided)yield c.mute();else if(Ws(c)||Ls(c))try{if(ni())try{const u=yield navigator==null?void 0:navigator.permissions.query({name:c.source===fe.Source.Camera?"camera":"microphone"});if(u&&u.state==="denied")throw this.log.warn("user has revoked access to ".concat(c.source),Object.assign(Object.assign({},this.logContext),St(c))),u.onchange=()=>{u.state!=="denied"&&(c.isMuted||c.restartTrack(),u.onchange=null)},new Error("GetUserMedia Permission denied")}catch{}c.isMuted||(this.log.debug("track ended, attempting to use a different device",Object.assign(Object.assign({},this.logContext),St(c))),Ws(c)?yield c.restartTrack({deviceId:"default"}):yield c.restartTrack())}catch{this.log.warn("could not restart track, muting instead",Object.assign(Object.assign({},this.logContext),St(c))),yield c.mute()}}),this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.trackPublications=new Map,this.engine=r,this.roomOptions=i,this.setupEngine(r),this.activeDeviceMap=new Map([["audioinput","default"],["videoinput","default"],["audiooutput","default"]]),this.pendingSignalRequests=new Map,this.rpcHandlers=a,this.roomOutgoingDataStreamManager=s,this.roomOutgoingDataTrackManager=o}get lastCameraError(){return this.cameraError}get lastMicrophoneError(){return this.microphoneError}get isE2EEEnabled(){return this.encryptionType!==Yt.NONE}getTrackPublication(e){const n=super.getTrackPublication(e);if(n)return n}getTrackPublicationByName(e){const n=super.getTrackPublicationByName(e);if(n)return n}setupEngine(e){var n;this.engine=e,this.engine.on(ve.RemoteMute,(r,i)=>{const a=this.trackPublications.get(r);!a||!a.track||(i?a.mute():a.unmute())}),!((n=this.signalConnectedFuture)===null||n===void 0)&&n.isResolved&&(this.signalConnectedFuture=void 0),this.engine.on(ve.Connected,this.handleReconnected).on(ve.SignalConnected,this.handleSignalConnected).on(ve.SignalRestarted,this.handleReconnected).on(ve.SignalResumed,this.handleReconnected).on(ve.Restarting,this.handleReconnecting).on(ve.Resuming,this.handleReconnecting).on(ve.LocalTrackUnpublished,this.handleLocalTrackUnpublished).on(ve.SubscribedQualityUpdate,this.handleSubscribedQualityUpdate).on(ve.Closing,this.handleClosing).on(ve.SignalRequestResponse,this.handleSignalRequestResponse).on(ve.DataPacketReceived,this.handleDataPacket)}setMetadata(e){return F(this,void 0,void 0,function*(){yield this.requestMetadataUpdate({metadata:e})})}setName(e){return F(this,void 0,void 0,function*(){yield this.requestMetadataUpdate({name:e})})}setAttributes(e){return F(this,void 0,void 0,function*(){yield this.requestMetadataUpdate({attributes:e})})}requestMetadataUpdate(e){return F(this,arguments,void 0,function(n){var r=this;let{metadata:i,name:a,attributes:s}=n;return function*(){return new jr((o,c)=>F(r,void 0,void 0,function*(){var u,d;try{let h=!1;const f=yield this.engine.client.sendUpdateLocalMetadata((u=i??this.metadata)!==null&&u!==void 0?u:"",(d=a??this.name)!==null&&d!==void 0?d:"",s),p=performance.now();for(this.pendingSignalRequests.set(f,{resolve:o,reject:g=>{c(g),h=!0},values:{name:a,metadata:i,attributes:s}});performance.now()-p<5e3&&!h;){if((!a||this.name===a)&&(!i||this.metadata===i)&&(!s||Object.entries(s).every(g=>{let[m,v]=g;return this.attributes[m]===v||v===""&&!this.attributes[m]}))){this.pendingSignalRequests.delete(f),o();return}yield Nr(50)}c(new c4("Request to update local metadata timed out","TimeoutError"))}catch(h){h instanceof Error?c(h):c(new Error(String(h)))}}))}()})}setCameraEnabled(e,n,r){return this.setTrackEnabled(fe.Source.Camera,e,n,r)}setMicrophoneEnabled(e,n,r){return this.setTrackEnabled(fe.Source.Microphone,e,n,r)}setScreenShareEnabled(e,n,r){return this.setTrackEnabled(fe.Source.ScreenShare,e,n,r)}setE2EEEnabled(e){return F(this,void 0,void 0,function*(){const n=yield this.e2eeStateMutex.lock();try{if(this.encryptionType=e?Yt.GCM:Yt.NONE,yield Promise.all(this.pendingPublishPromises.values()),this.trackPublications.size===0||Array.from(this.trackPublications.values()).every(r=>r.isEncrypted===e))return;yield this.republishAllTracks(void 0,!1)}finally{n()}})}setTrackEnabled(e,n,r,i){return F(this,void 0,void 0,function*(){var a,s;this.log.debug("setTrackEnabled",Object.assign(Object.assign({},this.logContext),{source:e,enabled:n})),this.republishPromise&&(yield this.republishPromise);let o=this.getTrackPublication(e);if(n)if(o)yield o.unmute();else{let c;if(this.pendingPublishing.has(e)){const u=yield this.waitForPendingPublicationOfSource(e);return u||this.log.info("waiting for pending publication promise timed out",Object.assign(Object.assign({},this.logContext),{source:e})),yield u==null?void 0:u.unmute(),u}this.pendingPublishing.add(e);try{switch(e){case fe.Source.Camera:c=yield this.createTracks({video:(a=r)!==null&&a!==void 0?a:!0});break;case fe.Source.Microphone:c=yield this.createTracks({audio:(s=r)!==null&&s!==void 0?s:!0});break;case fe.Source.ScreenShare:c=yield this.createScreenTracks(Object.assign({},r));break;default:throw new Qs(e)}}catch(u){throw c==null||c.forEach(d=>{d.stop()}),u instanceof Error&&this.emit(Ee.MediaDevicesError,u,iT(e)),this.pendingPublishing.delete(e),u}for(const u of c){const d=Object.assign(Object.assign({},this.roomOptions.publishDefaults),r);e===fe.Source.Microphone&&bs(u)&&d.preConnectBuffer&&(this.log.info("starting preconnect buffer for microphone",Object.assign({},this.logContext)),u.startPreConnectBuffer())}try{const u=[];for(const h of c)this.log.info("publishing track",Object.assign(Object.assign({},this.logContext),St(h))),u.push(this.publishTrack(h,i));[o]=yield Promise.all(u)}catch(u){throw c==null||c.forEach(d=>{d.stop()}),u}finally{this.pendingPublishing.delete(e)}}else if(!(o!=null&&o.track)&&this.pendingPublishing.has(e)&&(o=yield this.waitForPendingPublicationOfSource(e),o||this.log.info("waiting for pending publication promise timed out",Object.assign(Object.assign({},this.logContext),{source:e}))),o&&o.track)if(e===fe.Source.ScreenShare){const c=[this.unpublishTrack(o.track)],u=this.getTrackPublication(fe.Source.ScreenShareAudio);u&&u.track&&c.push(this.unpublishTrack(u.track)),[o]=yield Promise.all(c)}else yield o.mute();return o})}enableCameraAndMicrophone(){return F(this,void 0,void 0,function*(){if(!(this.pendingPublishing.has(fe.Source.Camera)||this.pendingPublishing.has(fe.Source.Microphone))){this.pendingPublishing.add(fe.Source.Camera),this.pendingPublishing.add(fe.Source.Microphone);try{const e=yield this.createTracks({audio:!0,video:!0});yield Promise.all(e.map(n=>this.publishTrack(n)))}finally{this.pendingPublishing.delete(fe.Source.Camera),this.pendingPublishing.delete(fe.Source.Microphone)}}})}createTracks(e){return F(this,void 0,void 0,function*(){var n,r;e??(e={});const i=kW(e,(n=this.roomOptions)===null||n===void 0?void 0:n.audioCaptureDefaults,(r=this.roomOptions)===null||r===void 0?void 0:r.videoCaptureDefaults);try{return(yield Iw(i,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext})).map(o=>(bs(o)&&(this.microphoneError=void 0,o.setAudioContext(this.audioContext),o.source=fe.Source.Microphone,this.emit(Ee.AudioStreamAcquired)),qc(o)&&(this.cameraError=void 0,o.source=fe.Source.Camera),o))}catch(a){throw a instanceof Error&&(e.audio&&(this.microphoneError=a),e.video&&(this.cameraError=a)),a}})}createScreenTracks(e){return F(this,void 0,void 0,function*(){if(e===void 0&&(e={}),navigator.mediaDevices.getDisplayMedia===void 0)throw new wP("getDisplayMedia not supported");e.resolution===void 0&&!ume()&&(e.resolution=SP.h1080fps30.resolution);const n=Zpe(e),r=yield navigator.mediaDevices.getDisplayMedia(n),i=r.getVideoTracks();if(i.length===0)throw new Qs("no video track found");const a=new cb(i[0],void 0,!1,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});a.source=fe.Source.ScreenShare,e.contentHint&&(a.mediaStreamTrack.contentHint=e.contentHint);const s=[a];if(r.getAudioTracks().length>0){this.emit(Ee.AudioStreamAcquired);const o=new sb(r.getAudioTracks()[0],void 0,!1,this.audioContext,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});o.source=fe.Source.ScreenShareAudio,s.push(o)}return s})}publishTrack(e,n){return F(this,void 0,void 0,function*(){return this.publishOrRepublishTrack(e,n)})}waitForNextEngineRestart(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:15e3;return new Promise((n,r)=>{const i=()=>{clearTimeout(o),this.engine.off(ve.Restarted,a),this.engine.off(ve.Closing,s)},a=()=>{i(),n()},s=()=>{i(),r(new Error("engine closed before restart completed"))},o=setTimeout(()=>{i(),r(new Error("timed out waiting for engine restart"))},e);this.engine.once(ve.Restarted,a),this.engine.once(ve.Closing,s)})}publishOrRepublishTrack(e,n){return F(this,arguments,void 0,function(r,i){var a=this;let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return function*(){var c,u,d,h;Ws(r)&&r.setAudioContext(a.audioContext),yield(c=a.reconnectFuture)===null||c===void 0?void 0:c.promise,a.republishPromise&&!s&&(yield a.republishPromise),Fd(r)&&a.pendingPublishPromises.has(r)&&(yield a.pendingPublishPromises.get(r));let f;if(r instanceof MediaStreamTrack)f=r.getConstraints();else{f=r.constraints;let w;switch(r.source){case fe.Source.Microphone:w="audioinput";break;case fe.Source.Camera:w="videoinput"}w&&a.activeDeviceMap.has(w)&&(f=Object.assign(Object.assign({},f),{deviceId:a.activeDeviceMap.get(w)}))}if(r instanceof MediaStreamTrack)switch(r.kind){case"audio":r=new sb(r,f,!0,a.audioContext,{loggerName:a.roomOptions.loggerName,loggerContextCb:()=>a.logContext});break;case"video":r=new cb(r,f,!0,{loggerName:a.roomOptions.loggerName,loggerContextCb:()=>a.logContext});break;default:throw new Qs("unsupported MediaStreamTrack kind ".concat(r.kind))}else r.updateLoggerOptions({loggerName:a.roomOptions.loggerName,loggerContextCb:()=>a.logContext});let p;if(a.trackPublications.forEach(w=>{w.track&&w.track===r&&(p=w)}),p)return a.log.warn("track has already been published, skipping",Object.assign(Object.assign({},a.logContext),St(p))),p;const g=Object.assign(Object.assign({},a.roomOptions.publishDefaults),i),m="channelCount"in r.mediaStreamTrack.getSettings()&&r.mediaStreamTrack.getSettings().channelCount===2||r.mediaStreamTrack.getConstraints().channelCount===2,v=(u=g.forceStereo)!==null&&u!==void 0?u:m;v&&(g.dtx===void 0&&a.log.info("Opus DTX will be disabled for stereo tracks by default. Enable them explicitly to make it work.",Object.assign(Object.assign({},a.logContext),St(r))),g.red===void 0&&a.log.info("Opus RED will be disabled for stereo tracks by default. Enable them explicitly to make it work."),(d=g.dtx)!==null&&d!==void 0||(g.dtx=!1),(h=g.red)!==null&&h!==void 0||(g.red=!1)),!hme()&&a.roomOptions.e2ee&&(a.log.info("End-to-end encryption is set up, simulcast publishing will be disabled on Safari versions and iOS browsers running iOS < v17.2",Object.assign({},a.logContext)),g.simulcast=!1),g.source&&(r.source=g.source);const x=new Promise((w,y)=>F(a,void 0,void 0,function*(){try{if(this.engine.client.currentState!==Kt.CONNECTED){this.log.debug("deferring track publication until signal is connected",Object.assign(Object.assign({},this.logContext),{track:St(r)}));let k=!1;const S=setTimeout(()=>{k=!0,r.stop(),y(new o4("publishing rejected as engine not connected within timeout",408))},15e3);if(yield this.waitUntilEngineConnected(),clearTimeout(S),k)return;const _=yield this.publish(r,g,v);w(_)}else try{const k=yield this.publish(r,g,v);w(k)}catch(k){y(k)}}catch(k){y(k)}}));a.pendingPublishPromises.set(r,x);try{return yield x}catch(w){if(!o&&w instanceof _c)return a.log.warn("negotiation due to track publish failed, retrying after reconnect",Object.assign(Object.assign({},a.logContext),{error:w})),a.pendingPublishPromises.delete(r),yield a.waitForNextEngineRestart(),yield a.publishOrRepublishTrack(r,i,s,!0);throw w}finally{a.pendingPublishPromises.delete(r)}}()})}waitUntilEngineConnected(){return this.signalConnectedFuture||(this.signalConnectedFuture=new Ur),this.signalConnectedFuture.promise}hasPermissionsToPublish(e){if(!this.permissions)return this.log.warn("no permissions present for publishing track",Object.assign(Object.assign({},this.logContext),St(e))),!1;const{canPublish:n,canPublishSources:r}=this.permissions;return n&&(r.length===0||r.map(i=>nme(i)).includes(e.source))?!0:(this.log.warn("insufficient permissions to publish",Object.assign(Object.assign({},this.logContext),St(e))),!1)}publish(e,n,r){return F(this,void 0,void 0,function*(){var i,a,s,o,c,u,d,h,f,p;if(!this.hasPermissionsToPublish(e))throw new o4("failed to publish track, insufficient permissions",403);Array.from(this.trackPublications.values()).find(E=>Fd(e)&&E.source===e.source)&&e.source!==fe.Source.Unknown&&this.log.info("publishing a second track with the same source: ".concat(e.source),Object.assign(Object.assign({},this.logContext),St(e))),n.stopMicTrackOnMute&&bs(e)&&(e.stopOnMute=!0),e.source===fe.Source.ScreenShare&&uu()&&(n.simulcast=!1),n.videoCodec==="av1"&&!ome()&&(n.videoCodec=void 0),n.videoCodec==="vp9"&&!cme()&&(n.videoCodec=void 0),n.videoCodec===void 0&&(n.videoCodec=dT),this.enabledPublishVideoCodecs.length>0&&(this.enabledPublishVideoCodecs.some(E=>n.videoCodec===Vp(E.mime))||(n.videoCodec=Vp(this.enabledPublishVideoCodecs[0].mime)));const m=n.videoCodec;e.on(ke.Muted,this.onTrackMuted),e.on(ke.Unmuted,this.onTrackUnmuted),e.on(ke.Ended,this.handleTrackEnded),e.on(ke.UpstreamPaused,this.onTrackUpstreamPaused),e.on(ke.UpstreamResumed,this.onTrackUpstreamResumed),e.on(ke.AudioTrackFeatureUpdate,this.onTrackFeatureUpdate);const v=[],x=!(!((i=n.dtx)!==null&&i!==void 0)||i),w=e.getSourceTrackSettings();w.autoGainControl&&v.push(or.TF_AUTO_GAIN_CONTROL),w.echoCancellation&&v.push(or.TF_ECHO_CANCELLATION),w.noiseSuppression&&v.push(or.TF_NOISE_SUPPRESSION),w.channelCount&&w.channelCount>1&&v.push(or.TF_STEREO),x&&v.push(or.TF_NO_DTX),Ws(e)&&e.hasPreConnectBuffer&&v.push(or.TF_PRECONNECT_BUFFER);const y=new Um({cid:e.mediaStreamTrack.id,name:n.name,type:fe.kindToProto(e.kind),muted:e.isMuted,source:fe.sourceToProto(e.source),disableDtx:x,encryption:this.encryptionType,stereo:r,disableRed:this.isE2EEEnabled||!(!((a=n.red)!==null&&a!==void 0)||a),stream:n==null?void 0:n.stream,backupCodecPolicy:n==null?void 0:n.backupCodecPolicy,audioFeatures:v});let k;if(e.kind===fe.Kind.Video){let E={width:0,height:0};try{E=yield e.waitForDimensions()}catch{const P=(o=(s=this.roomOptions.videoCaptureDefaults)===null||s===void 0?void 0:s.resolution)!==null&&o!==void 0?o:zm.h720.resolution;E={width:P.width,height:P.height},this.log.error("could not determine track dimensions, using defaults",Object.assign(Object.assign(Object.assign({},this.logContext),St(e)),{dims:E}))}y.width=E.width,y.height=E.height,Ls(e)&&(La(m)&&(e.source===fe.Source.ScreenShare&&(n.scalabilityMode="L1T3","contentHint"in e.mediaStreamTrack&&(e.mediaStreamTrack.contentHint="motion",this.log.info("forcing contentHint to motion for screenshare with SVC codecs",Object.assign(Object.assign({},this.logContext),St(e))))),n.scalabilityMode=(c=n.scalabilityMode)!==null&&c!==void 0?c:"L3T3_KEY"),y.simulcastCodecs=[new HC({codec:m,cid:e.mediaStreamTrack.id})],n.backupCodec===!0&&(n.backupCodec={codec:dT}),n.backupCodec&&m!==n.backupCodec.codec&&y.encryption===Yt.NONE&&(this.roomOptions.dynacast||(this.roomOptions.dynacast=!0),y.simulcastCodecs.push(new HC({codec:n.backupCodec.codec,cid:""})))),k=ob(e.source===fe.Source.ScreenShare,y.width,y.height,n),y.layers=M4(y.width,y.height,k,La(n.videoCodec))}else e.kind===fe.Kind.Audio&&(k=[{maxBitrate:(u=n.audioPreset)===null||u===void 0?void 0:u.maxBitrate,priority:(h=(d=n.audioPreset)===null||d===void 0?void 0:d.priority)!==null&&h!==void 0?h:"high",networkPriority:(p=(f=n.audioPreset)===null||f===void 0?void 0:f.priority)!==null&&p!==void 0?p:"high"}]);if(!this.engine||this.engine.isClosed)throw new bn("cannot publish track when not connected");const S=()=>F(this,void 0,void 0,function*(){var E,j,P;if(!this.engine.pcManager)throw new bn("pcManager is not ready");if(e.sender=yield this.engine.createSender(e,n,k),this.emit(Ee.LocalSenderCreated,e.sender,e),Ls(e)&&((E=n.degradationPreference)!==null&&E!==void 0||(n.degradationPreference=gge(e)),e.setDegradationPreference(n.degradationPreference)),k)if(uu()&&e.kind===fe.Kind.Audio){let M;for(const U of this.engine.pcManager.publisher.getTransceivers())if(U.sender===e.sender){M=U;break}M&&this.engine.pcManager.publisher.setTrackCodecBitrate({transceiver:M,codec:"opus",maxbr:!((j=k[0])===null||j===void 0)&&j.maxBitrate?k[0].maxBitrate/1e3:0})}else e.codec&&La(e.codec)&&(!((P=k[0])===null||P===void 0)&&P.maxBitrate)&&this.engine.pcManager.publisher.setTrackCodecBitrate({cid:y.cid,codec:e.codec,maxbr:k[0].maxBitrate/1e3});yield this.engine.negotiate()});let _;const C=new Promise((E,j)=>F(this,void 0,void 0,function*(){var P;try{_=yield this.engine.addTrack(y),E(_)}
700catch(M){if(e.sender&&(!((P=this.engine.pcManager)===null||P===void 0)&&P.publisher)){try{this.engine.pcManager.publisher.removeTrack(e.sender)}catch(U){this.log.error(U,this.logContext)}yield this.engine.negotiate().catch(U=>{this.log.error("failed to negotiate after removing track due to failed add track request",Object.assign(Object.assign(Object.assign({},this.logContext),St(e)),{error:U}))})}j(M)}}));if(this.enabledPublishVideoCodecs.length>0)_=(yield Promise.all([C,S()]))[0];else{_=yield C;let E;if(_.codecs.forEach(j=>{E===void 0&&(E=j.mimeType)}),E&&e.kind===fe.Kind.Video){const j=Vp(E);j!==m&&(this.log.debug("falling back to server selected codec",Object.assign(Object.assign(Object.assign({},this.logContext),St(e)),{codec:j})),n.videoCodec=j,k=ob(e.source===fe.Source.ScreenShare,y.width,y.height,n))}yield S()}const T=new mT(e.kind,_,e,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});if(T.on(ke.CpuConstrained,E=>this.onTrackCpuConstrained(E,T)),T.options=n,e.sid=_.sid,Ls(e)&&(e.publishOptions=n,y.width&&y.height&&(e.lastEncodedDimensions={width:y.width,height:y.height})),this.log.debug("publishing ".concat(e.kind," with encodings"),Object.assign(Object.assign({},this.logContext),{encodings:k,trackInfo:_})),Ls(e)?e.startMonitor(this.engine.client):Ws(e)&&e.startMonitor(),this.addTrackPublication(T),this.emit(Ee.LocalTrackPublished,T),Ws(e)&&_.audioFeatures.includes(or.TF_PRECONNECT_BUFFER)){const E=e.getPreConnectBuffer(),j=e.getPreConnectBufferMimeType();this.on(Ee.LocalTrackSubscribed,P=>{if(P.trackSid===_.sid){if(!e.hasPreConnectBuffer){this.log.warn("subscribe event came to late, buffer already closed",this.logContext);return}this.log.debug("finished recording preconnect buffer",Object.assign(Object.assign({},this.logContext),St(e))),e.stopPreConnectBuffer()}}),E&&new Promise((M,U)=>F(this,void 0,void 0,function*(){var N,B,$,I,R,z;try{this.log.debug("waiting for agent",Object.assign(Object.assign({},this.logContext),St(e)));const V=setTimeout(()=>{U(new Error("agent not active within 10 seconds"))},1e4),Y=yield this.waitUntilActiveAgentPresent();clearTimeout(V),this.log.debug("sending preconnect buffer",Object.assign(Object.assign({},this.logContext),St(e)));const Q=yield this.streamBytes({name:"preconnect-buffer",mimeType:j,topic:"lk.agent.pre-connect-audio-buffer",destinationIdentities:[Y.identity],attributes:{trackId:T.trackSid,sampleRate:String((R=w.sampleRate)!==null&&R!==void 0?R:"48000"),channels:String((z=w.channelCount)!==null&&z!==void 0?z:"1")}});try{for(var O=!0,A=Ia(E),L;L=yield A.next(),N=L.done,!N;O=!0){I=L.value,O=!1;const re=I;yield Q.write(re)}}catch(re){B={error:re}}finally{try{!O&&!N&&($=A.return)&&(yield $.call(A))}finally{if(B)throw B.error}}yield Q.close(),M()}catch(V){U(V)}})).then(()=>{this.log.debug("preconnect buffer sent successfully",Object.assign(Object.assign({},this.logContext),St(e)))}).catch(M=>{this.log.error("error sending preconnect buffer",Object.assign(Object.assign(Object.assign({},this.logContext),St(e)),{error:M}))})}return T})}get isLocal(){return!0}publishAdditionalCodecForTrack(e,n,r){return F(this,void 0,void 0,function*(){var i;if(this.encryptionType!==Yt.NONE)return;let a;if(this.trackPublications.forEach(p=>{p.track&&p.track===e&&(a=p)}),!a)throw new Qs("track is not published");if(!Ls(e))throw new Qs("track is not a video track");const s=Object.assign(Object.assign({},(i=this.roomOptions)===null||i===void 0?void 0:i.publishDefaults),r),o=IW(e,n,s);if(!o){this.log.info("backup codec has been disabled, ignoring request to add additional codec for track",Object.assign(Object.assign({},this.logContext),St(e)));return}const c=e.addSimulcastTrack(n,o);if(!c)return;const u=new Um({cid:c.mediaStreamTrack.id,type:fe.kindToProto(e.kind),muted:e.isMuted,source:fe.sourceToProto(e.source),sid:e.sid,simulcastCodecs:[{codec:s.videoCodec,cid:c.mediaStreamTrack.id}]});if(u.layers=M4(u.width,u.height,o),!this.engine||this.engine.isClosed)throw new bn("cannot publish track when not connected");const d=()=>F(this,void 0,void 0,function*(){yield this.engine.createSimulcastSender(e,c,s,o),yield this.engine.negotiate()}),f=(yield Promise.all([this.engine.addTrack(u),d()]))[0];this.log.debug("published ".concat(n," for track ").concat(e.sid),Object.assign(Object.assign({},this.logContext),{encodings:o,trackInfo:f}))})}unpublishTrack(e,n){return F(this,void 0,void 0,function*(){var r,i;if(Fd(e)){const u=this.pendingPublishPromises.get(e);u&&(this.log.info("awaiting publish promise before attempting to unpublish",Object.assign(Object.assign({},this.logContext),St(e))),yield u)}const a=this.getPublicationForTrack(e),s=a?St(a):void 0;if(this.log.debug("unpublishing track",Object.assign(Object.assign({},this.logContext),s)),!a||!a.track){this.log.warn("track was not unpublished because no publication was found",Object.assign(Object.assign({},this.logContext),s));return}e=a.track,e.off(ke.Muted,this.onTrackMuted),e.off(ke.Unmuted,this.onTrackUnmuted),e.off(ke.Ended,this.handleTrackEnded),e.off(ke.UpstreamPaused,this.onTrackUpstreamPaused),e.off(ke.UpstreamResumed,this.onTrackUpstreamResumed),e.off(ke.AudioTrackFeatureUpdate,this.onTrackFeatureUpdate),n===void 0&&(n=(i=(r=this.roomOptions)===null||r===void 0?void 0:r.stopLocalTrackOnUnpublish)!==null&&i!==void 0?i:!0),n?e.stop():e.stopMonitor();let o=!1;const c=e.sender;if(e.sender=void 0,this.engine.pcManager&&this.engine.pcManager.currentState<wn.FAILED&&c)try{for(const u of this.engine.pcManager.publisher.getTransceivers())u.sender===c&&(u.direction="inactive",o=!0);try{o=this.engine.removeTrack(c)}catch(u){this.log.warn(u,this.logContext),o=!0}if(Ls(e)){for(const[,u]of e.simulcastCodecs)if(u.sender){try{o=this.engine.removeTrack(u.sender)}catch(d){this.log.warn(d,this.logContext),o=!0}u.sender=void 0}e.simulcastCodecs.clear()}}catch(u){this.log.warn("failed to unpublish track",Object.assign(Object.assign(Object.assign({},this.logContext),s),{error:u}))}switch(this.trackPublications.delete(a.trackSid),a.kind){case fe.Kind.Audio:this.audioTrackPublications.delete(a.trackSid);break;case fe.Kind.Video:this.videoTrackPublications.delete(a.trackSid);break}
vendor: 4,196 bytes, line 700
700return this.emit(Ee.LocalTrackUnpublished,a),a.setTrack(void 0),o&&(yield this.engine.negotiate()),a})}unpublishTracks(e){return F(this,void 0,void 0,function*(){return(yield Promise.all(e.map(r=>this.unpublishTrack(r)))).filter(r=>!!r)})}republishAllTracks(e){return F(this,arguments,void 0,function(n){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){r.republishPromise&&(yield r.republishPromise),r.republishPromise=new jr((a,s)=>F(r,void 0,void 0,function*(){try{const o=[];this.trackPublications.forEach(c=>{c.track&&(n&&(c.options=Object.assign(Object.assign({},c.options),n)),o.push(c))}),yield Promise.all(o.map(c=>F(this,void 0,void 0,function*(){const u=c.track;yield this.unpublishTrack(u,!1),i&&!u.isMuted&&u.source!==fe.Source.ScreenShare&&u.source!==fe.Source.ScreenShareAudio&&(Ws(u)||Ls(u))&&!u.isUserProvided&&(this.log.debug("restarting existing track",Object.assign(Object.assign({},this.logContext),{track:c.trackSid})),yield u.restartTrack()),yield this.publishOrRepublishTrack(u,c.options,!0)}))),a()}catch(o){o instanceof Error?s(o):s(new Error(String(o)))}finally{this.republishPromise=void 0}})),yield r.republishPromise}()})}publishData(e){return F(this,arguments,void 0,function(n){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){const a=i.reliable?xt.RELIABLE:xt.LOSSY,s=i.reliable?Pl.RELIABLE:Pl.LOSSY,o=i.destinationIdentities,c=i.topic;let u=new oP({participantIdentity:r.identity,payload:n,destinationIdentities:o,topic:c});const d=new Fr({kind:s,value:{case:"user",value:u}});yield r.engine.sendDataPacket(d,a)}()})}publishDtmf(e,n){return F(this,void 0,void 0,function*(){const r=new Fr({kind:Pl.RELIABLE,value:{case:"sipDtmf",value:new xz({code:e,digit:n})}});yield this.engine.sendDataPacket(r,xt.RELIABLE)})}sendChatMessage(e,n){return F(this,void 0,void 0,function*(){const r={id:crypto.randomUUID(),message:e,timestamp:Date.now(),attachedFiles:n==null?void 0:n.attachments},i=new Fr({value:{case:"chatMessage",value:new eb(Object.assign(Object.assign({},r),{timestamp:mn.parse(r.timestamp)}))}});return yield this.engine.sendDataPacket(i,xt.RELIABLE),this.emit(Ee.ChatMessage,r),r})}editChatMessage(e,n){return F(this,void 0,void 0,function*(){const r=Object.assign(Object.assign({},n),{message:e,editTimestamp:Date.now()}),i=new Fr({value:{case:"chatMessage",value:new eb(Object.assign(Object.assign({},r),{timestamp:mn.parse(r.timestamp),editTimestamp:mn.parse(r.editTimestamp)}))}});return yield this.engine.sendDataPacket(i,xt.RELIABLE),this.emit(Ee.ChatMessage,r),r})}sendText(e,n){return F(this,void 0,void 0,function*(){return this.roomOutgoingDataStreamManager.sendText(e,n)})}streamText(e){return F(this,void 0,void 0,function*(){return this.roomOutgoingDataStreamManager.streamText(e)})}sendFile(e,n){return F(this,void 0,void 0,function*(){return this.roomOutgoingDataStreamManager.sendFile(e,n)})}streamBytes(e){return F(this,void 0,void 0,function*(){return this.roomOutgoingDataStreamManager.streamBytes(e)})}performRpc(e){let{destinationIdentity:n,method:r,payload:i,responseTimeout:a=15e3}=e;const s=7e3,o=s+1e3;return new jr((c,u)=>F(this,void 0,void 0,function*(){var d,h,f,p;if(OP(i)>DW){u(An.builtIn("REQUEST_PAYLOAD_TOO_LARGE"));return}if(!((h=(d=this.engine.latestJoinResponse)===null||d===void 0?void 0:d.serverInfo)===null||h===void 0)&&h.version&&Ps((p=(f=this.engine.latestJoinResponse)===null||f===void 0?void 0:f.serverInfo)===null||p===void 0?void 0:p.version,"1.8.0")<0){u(An.builtIn("UNSUPPORTED_SERVER"));return}const g=Math.max(a,o),m=crypto.randomUUID();yield this.publishRpcRequest(n,m,r,i,g);const v=setTimeout(()=>{this.pendingAcks.delete(m),u(An.builtIn("CONNECTION_TIMEOUT")),this.pendingResponses.delete(m),clearTimeout(x)},s);this.pendingAcks.set(m,{resolve:()=>{clearTimeout(v)},participantIdentity:n});const x=setTimeout(()=>{this.pendingResponses.delete(m),u(An.builtIn("RESPONSE_TIMEOUT"))},a);this.pendingResponses.set(m,{resolve:(w,y)=>{clearTimeout(x),this.pendingAcks.has(m)&&(this.log.warn("RPC response received before ack",m),this.pendingAcks.delete(m),clearTimeout(v)),y?u(y):c(w??"")},participantIdentity:n})}))}
700registerRpcMethod(e,n){this.rpcHandlers.has(e)&&this.log.warn("you're overriding the RPC handler for method ".concat(e,", in the future this will throw an error")),this.rpcHandlers.set(e,n)}unregisterRpcMethod(e){this.rpcHandlers.delete(e)}setTrackSubscriptionPermissions(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];this.participantTrackPermissions=n,this.allParticipantsAllowedToSubscribe=e,this.engine.client.isDisconnected||this.updateTrackSubscriptionPermissions()}handleIncomingRpcAck(e){const n=this.pendingAcks.get(e);n?(n.resolve(),this.pendingAcks.delete(e)):console.error("Ack received for unexpected RPC request",e)}handleIncomingRpcResponse(e,n,r){const i=this.pendingResponses.get(e);i?(i.resolve(n,r),this.pendingResponses.delete(e)):console.error("Response received for unexpected RPC request",e)}publishRpcRequest(e,n,r,i,a){return F(this,void 0,void 0,function*(){const s=new Fr({destinationIdentities:[e],kind:Pl.RELIABLE,value:{case:"rpcRequest",value:new cP({id:n,method:r,payload:i,responseTimeoutMs:a,version:1})}});yield this.engine.sendDataPacket(s,xt.RELIABLE)})}handleParticipantDisconnected(e){for(const[n,{participantIdentity:r}]of this.pendingAcks)r===e&&this.pendingAcks.delete(n);for(const[n,{participantIdentity:r,resolve:i}]of this.pendingResponses)r===e&&(i(null,An.builtIn("RECIPIENT_DISCONNECTED")),this.pendingResponses.delete(n))}setEnabledPublishCodecs(e){this.enabledPublishVideoCodecs=e.filter(n=>n.mime.split("/")[0].toLowerCase()==="video")}updateInfo(e){return super.updateInfo(e)?(e.tracks.forEach(n=>{var r,i;const a=this.trackPublications.get(n.sid);if(a){const s=a.isMuted||((i=(r=a.track)===null||r===void 0?void 0:r.isUpstreamPaused)!==null&&i!==void 0?i:!1);s!==n.muted&&(this.log.debug("updating server mute state after reconcile",Object.assign(Object.assign(Object.assign({},this.logContext),St(a)),{mutedOnServer:s})),this.engine.client.sendMuteTrack(n.sid,s))}}),!0):!1}setActiveAgent(e){var n,r,i,a;this.firstActiveAgent=e,e&&!this.firstActiveAgent&&(this.firstActiveAgent=e),e?(r=(n=this.activeAgentFuture)===null||n===void 0?void 0:n.resolve)===null||r===void 0||r.call(n,e):(a=(i=this.activeAgentFuture)===null||i===void 0?void 0:i.reject)===null||a===void 0||a.call(i,new Error("Agent disconnected")),this.activeAgentFuture=void 0}waitUntilActiveAgentPresent(){return this.firstActiveAgent?Promise.resolve(this.firstActiveAgent):(this.activeAgentFuture||(this.activeAgentFuture=new Ur),this.activeAgentFuture.promise)}getPublicationForTrack(e){let n;return this.trackPublications.forEach(r=>{const i=r.track;i&&(e instanceof MediaStreamTrack?(Ws(i)||Ls(i))&&i.mediaStreamTrack===e&&(n=r):e===i&&(n=r))}),n}waitForPendingPublicationOfSource(e){return F(this,void 0,void 0,function*(){const r=Date.now();for(;Date.now()<r+1e4;){const i=Array.from(this.pendingPublishPromises.entries()).find(a=>{let[s]=a;return s.source===e});if(i)return i[1];yield Nr(20)}})}publishDataTrack(e){return F(this,void 0,void 0,function*(){const n=new Dw(e,this.roomOutgoingDataTrackManager);return yield n.publish(),n})}}class Z4 extends DOMException{constructor(e,n){super(e,"AbortError"),this.reason=n}}class Zge extends Map{constructor(){super(...arguments),this.pending=new Map}set(e,n){var r,i;super.set(e,n);const a=(r=this.pending)===null||r===void 0?void 0:r.get(e);if(a){for(const s of a)s.isResolved||(i=s.resolve)===null||i===void 0||i.call(s,n);this.pending.delete(e)}return this}get[Symbol.toStringTag](){return"DeferrableMap"}getDeferred(e,n){return F(this,void 0,void 0,function*(){const r=this.get(e);if(typeof r<"u")return r;if(n!=null&&n.aborted)throw new Z4("The operation was aborted.",n.reason);const i=new Ur(void 0,()=>{const s=this.pending.get(e);if(!s)return;const o=s.indexOf(i);o!==-1&&s.splice(o,1),s.length===0&&this.pending.delete(e)}),a=this.pending.get(e);if(a?a.push(i):this.pending.set(e,[i]),n){const s=()=>{var o;i.isResolved||(o=i.reject)===null||o===void 0||o.call(i,new Z4("The operation was aborted.",n.reason))};n.addEventListener("abort",s,{once:!0}),i.promise.finally(()=>{n.removeEventListener("abort",s)})}return i.promise})}}class Qge extends Ys{constructor(e,n,r,i){super(e,n.sid,n.name,i),this.track=void 0,this.allowed=!0,this.requestedDisabled=void 0,this.visible=!0,this.handleEnded=a=>
700{this.setTrack(void 0),this.emit(ke.Ended,a)},this.handleVisibilityChange=a=>{this.log.debug("adaptivestream video visibility ".concat(this.trackSid,", visible=").concat(a),this.logContext),this.visible=a,this.emitTrackUpdate()},this.handleVideoDimensionsChange=a=>{this.log.debug("adaptivestream video dimensions ".concat(a.width,"x").concat(a.height),this.logContext),this.videoDimensionsAdaptiveStream=a,this.emitTrackUpdate()},this.subscribed=r,this.updateInfo(n)}setSubscribed(e){const n=this.subscriptionStatus,r=this.permissionStatus;this.subscribed=e,e&&(this.allowed=!0);const i=new Tw({trackSids:[this.trackSid],subscribe:this.subscribed,participantTracks:[new Sz({participantSid:"",trackSids:[this.trackSid]})]});this.emit(ke.UpdateSubscription,i),this.emitSubscriptionUpdateIfChanged(n),this.emitPermissionUpdateIfChanged(r)}get subscriptionStatus(){return this.subscribed===!1?Ys.SubscriptionStatus.Unsubscribed:super.isSubscribed?Ys.SubscriptionStatus.Subscribed:Ys.SubscriptionStatus.Desired}get permissionStatus(){return this.allowed?Ys.PermissionStatus.Allowed:Ys.PermissionStatus.NotAllowed}get isSubscribed(){return this.subscribed===!1?!1:super.isSubscribed}get isDesired(){return this.subscribed!==!1}get isEnabled(){return this.requestedDisabled!==void 0?!this.requestedDisabled:this.isAdaptiveStream?this.visible:!0}get isLocal(){return!1}setEnabled(e){!this.isManualOperationAllowed()||this.requestedDisabled===!e||(this.requestedDisabled=!e,this.emitTrackUpdate())}setVideoQuality(e){!this.isManualOperationAllowed()||this.requestedMaxQuality===e||(this.requestedMaxQuality=e,this.requestedVideoDimensions=void 0,this.emitTrackUpdate())}setVideoDimensions(e){var n,r;this.isManualOperationAllowed()&&(((n=this.requestedVideoDimensions)===null||n===void 0?void 0:n.width)===e.width&&((r=this.requestedVideoDimensions)===null||r===void 0?void 0:r.height)===e.height||(tk(this.track)&&(this.requestedVideoDimensions=e),this.requestedMaxQuality=void 0,this.emitTrackUpdate()))}setVideoFPS(e){this.isManualOperationAllowed()&&tk(this.track)&&this.fps!==e&&(this.fps=e,this.emitTrackUpdate())}get videoQuality(){var e;return(e=this.requestedMaxQuality)!==null&&e!==void 0?e:Ti.HIGH}setTrack(e){const n=this.subscriptionStatus,r=this.permissionStatus,i=this.track;i!==e&&(i&&(i.off(ke.VideoDimensionsChanged,this.handleVideoDimensionsChange),i.off(ke.VisibilityChanged,this.handleVisibilityChange),i.off(ke.Ended,this.handleEnded),i.detach(),i.stopMonitor(),this.emit(ke.Unsubscribed,i)),super.setTrack(e),e&&(e.sid=this.trackSid,e.on(ke.VideoDimensionsChanged,this.handleVideoDimensionsChange),e.on(ke.VisibilityChanged,this.handleVisibilityChange),e.on(ke.Ended,this.handleEnded),this.emit(ke.Subscribed,e)),this.emitPermissionUpdateIfChanged(r),this.emitSubscriptionUpdateIfChanged(n))}setAllowed(e){const n=this.subscriptionStatus,r=this.permissionStatus;this.allowed=e,this.emitPermissionUpdateIfChanged(r),this.emitSubscriptionUpdateIfChanged(n)}setSubscriptionError(e){this.emit(ke.SubscriptionFailed,e)}updateInfo(e){super.updateInfo(e);const n=this.metadataMuted;this.metadataMuted=e.muted,this.track?this.track.setMuted(e.muted):n!==e.muted&&this.emit(e.muted?ke.Muted:ke.Unmuted)}emitSubscriptionUpdateIfChanged(e){const n=this.subscriptionStatus;e!==n&&this.emit(ke.SubscriptionStatusChanged,n,e)}emitPermissionUpdateIfChanged(e){this.permissionStatus!==e&&this.emit(ke.SubscriptionPermissionChanged,this.permissionStatus,e)}isManualOperationAllowed(){return this.isDesired?!0:(this.log.warn("cannot update track settings when not subscribed",this.logContext),!1)}get isAdaptiveStream(){return tk(this.track)&&this.track.isAdaptiveStream}emitTrackUpdate(){const e=new Rz({trackSids:[this.trackSid],disabled:!this.isEnabled,fps:this.fps});if(this.kind===fe.Kind.Video){let n=this.requestedVideoDimensions;if(this.videoDimensionsAdaptiveStream!==void 0)if(n)u4(this.videoDimensionsAdaptiveStream,n)&&(this.log.debug("using adaptive stream dimensions instead of requested",Object.assign(Object.assign({},this.logContext),this.videoDimensionsAdaptiveStream)),n=this.videoDimensionsAdaptiveStream);else if(this.requestedMaxQuality!==void 0&&this.trackInfo){const r=rme(this.trackInfo,this.requestedMaxQuality);r&&u4(this.videoDimensionsAdaptiveStream,r)&&(this.log.debug("using adaptive stream dimensions instead of max quality layer",Object.assign(Object.assign({},this.logContext),this.videoDimensionsAdaptiveStream)),n=this.videoDimensionsAdaptiveStream)}else this.log.debug("using adaptive stream dimensions",Object.assign(Object.assign({},this.logContext),this.videoDimensionsAdaptiveStream)),n=this.videoDimensionsAdaptiveStream;n?(e.width=Math.ceil(n.width),e.height=Math.ceil(n.height)):this.requestedMaxQuality!==void 0?(this.log.debug("using requested max quality",Object.assign(Object.assign({},this.logContext),{quality:this.requestedMaxQuality})),e.quality=this.requestedMaxQuality):(this.log.debug("using default qual
700ity",Object.assign(Object.assign({},this.logContext),{quality:Ti.HIGH})),e.quality=Ti.HIGH)}this.emit(ke.UpdateSettings,e)}}class ub extends YW{static fromParticipantInfo(e,n,r,i){return new ub(e,n.sid,n.identity,n.name,n.metadata,n.attributes,r,n.kind,n.dataTracks.map(a=>{const s=ab.from(a);return new KW(s,i,{publisherIdentity:n.identity})}))}get logContext(){return Object.assign(Object.assign({},super.logContext),{remoteParticipantID:this.sid,remoteParticipant:this.identity})}constructor(e,n,r,i,a,s,o){let c=arguments.length>7&&arguments[7]!==void 0?arguments[7]:Bm.STANDARD,u=arguments.length>8&&arguments[8]!==void 0?arguments[8]:[];super(n,r||"",i,a,s,o,c),this.signalClient=e,this.trackPublications=new Map,this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.dataTracks=new Zge(u.map(d=>[d.info.name,d])),this.volumeMap=new Map}addTrackPublication(e){super.addTrackPublication(e),e.on(ke.UpdateSettings,n=>{this.log.debug("send update settings",Object.assign(Object.assign(Object.assign({},this.logContext),St(e)),{settings:n})),this.signalClient.sendUpdateTrackSettings(n)}),e.on(ke.UpdateSubscription,n=>{n.participantTracks.forEach(r=>{r.participantSid=this.sid}),this.signalClient.sendUpdateSubscription(n)}),e.on(ke.SubscriptionPermissionChanged,n=>{this.emit(Ee.TrackSubscriptionPermissionChanged,e,n)}),e.on(ke.SubscriptionStatusChanged,n=>{this.emit(Ee.TrackSubscriptionStatusChanged,e,n)}),e.on(ke.Subscribed,n=>{this.emit(Ee.TrackSubscribed,n,e)}),e.on(ke.Unsubscribed,n=>{this.emit(Ee.TrackUnsubscribed,n,e)}),e.on(ke.SubscriptionFailed,n=>{this.emit(Ee.TrackSubscriptionFailed,e.trackSid,n)})}getTrackPublication(e){const n=super.getTrackPublication(e);if(n)return n}getTrackPublicationByName(e){const n=super.getTrackPublicationByName(e);if(n)return n}setVolume(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:fe.Source.Microphone;this.volumeMap.set(n,e);const r=this.getTrackPublication(n);r&&r.track&&r.track.setVolume(e)}getVolume(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:fe.Source.Microphone;const n=this.getTrackPublication(e);return n&&n.track?n.track.getVolume():this.volumeMap.get(e)}addSubscribedMediaTrack(e,n,r,i,a,s){let o=this.getTrackPublicationBySid(n);if(o||n.startsWith("TR")||this.trackPublications.forEach(d=>{!o&&e.kind===d.kind.toString()&&(o=d)}),!o){if(s===0){this.log.error("could not find published track",Object.assign(Object.assign({},this.logContext),{trackSid:n})),this.emit(Ee.TrackSubscriptionFailed,n);return}s===void 0&&(s=20),setTimeout(()=>{this.addSubscribedMediaTrack(e,n,r,i,a,s-1)},150);return}if(e.readyState==="ended"){this.log.error("unable to subscribe because MediaStreamTrack is ended. Do not call MediaStreamTrack.stop()",Object.assign(Object.assign({},this.logContext),St(o))),this.emit(Ee.TrackSubscriptionFailed,n);return}const c=e.kind==="video";let u;return c?u=new Hge(e,n,i,a):u=new Vge(e,n,i,this.audioContext,this.audioOutput),u.source=o.source,u.isMuted=o.isMuted,u.setMediaStream(r),u.start(),o.setTrack(u),this.volumeMap.has(o.source)&&cT(u)&&bs(u)&&u.setVolume(this.volumeMap.get(o.source)),o}get hasMetadata(){return!!this.participantInfo}getTrackPublicationBySid(e){return this.trackPublications.get(e)}updateInfo(e){if(!super.updateInfo(e))return!1;const n=new Map,r=new Map;return e.tracks.forEach(i=>{var a,s;let o=this.getTrackPublicationBySid(i.sid);if(o)o.updateInfo(i);else{const c=fe.kindFromProto(i.type);if(!c)return;o=new Qge(c,i,(a=this.signalClient.connectOptions)===null||a===void 0?void 0:a.autoSubscribe,{loggerContextCb:()=>this.logContext,loggerName:(s=this.loggerOptions)===null||s===void 0?void 0:s.loggerName}),o.updateInfo(i),r.set(i.sid,o);const u=Array.from(this.trackPublications.values()).find(d=>d.source===(o==null?void 0:o.source));u&&o.source!==fe.Source.Unknown&&this.log.debug("received a second track publication for ".concat(this.identity," with the same source: ").concat(o.source),Object.assign(Object.assign({},this.logContext),{oldTrack:St(u),newTrack:St(o)})),this.addTrackPublication(o)}n.set(i.sid,o)}),this.trackPublications.forEach(i=>
vendor: 6,409 bytes, line 700
700{n.has(i.trackSid)||(this.log.trace("detected removed track on remote participant, unpublishing",Object.assign(Object.assign({},this.logContext),St(i))),this.unpublishTrack(i.trackSid,!0))}),r.forEach(i=>{this.emit(Ee.TrackPublished,i)}),!0}unpublishTrack(e,n){const r=this.trackPublications.get(e);if(!r)return;const{track:i}=r;switch(i&&(i.stop(),r.setTrack(void 0)),this.trackPublications.delete(e),r.kind){case fe.Kind.Audio:this.audioTrackPublications.delete(e);break;case fe.Kind.Video:this.videoTrackPublications.delete(e);break}n&&this.emit(Ee.TrackUnpublished,r)}setAudioOutput(e){return F(this,void 0,void 0,function*(){this.audioOutput=e;const n=[];this.audioTrackPublications.forEach(r=>{var i;bs(r.track)&&cT(r.track)&&n.push(r.track.setSinkId((i=e.deviceId)!==null&&i!==void 0?i:"default"))}),yield Promise.all(n)})}addRemoteDataTrack(e){this.dataTracks.set(e.info.name,e)}removeRemoteDataTrack(e){for(const[n,r]of this.dataTracks.entries())e===r.info.sid&&this.dataTracks.delete(n)}emit(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return this.log.trace("participant event",Object.assign(Object.assign({},this.logContext),{event:e,args:r})),super.emit(e,...r)}}var At;(function(t){t.Disconnected="disconnected",t.Connecting="connecting",t.Connected="connected",t.Reconnecting="reconnecting",t.SignalReconnecting="signalReconnecting"})(At||(At={}));const eve=4*1e3;class Gm extends ca.EventEmitter{get hasE2EESetup(){return this.e2eeManager!==void 0}constructor(e){var n,r,i,a,s,o,c;if(super(),n=this,this.state=At.Disconnected,this.activeSpeakers=[],this.isE2EEEnabled=!1,this.audioEnabled=!0,this.e2eeStateMutex=new gr,this.isVideoPlaybackBlocked=!1,this.log=ft,this.bufferedEvents=[],this.isResuming=!1,this.rpcHandlers=new Map,this.connect=(u,d,h)=>F(this,void 0,void 0,function*(){var f;if(!lme())throw js()?Error("WebRTC isn't detected, have you called registerGlobals?"):Error("LiveKit doesn't seem to be supported on this browser. Try to update your browser and make sure no browser extensions are disabling webRTC.");const p=yield this.disconnectLock.lock();if(this.state===At.Connected)return this.log.info("already connected to room ".concat(this.name),this.logContext),p(),Promise.resolve();if(this.connectFuture)return p(),this.connectFuture.promise;this.setAndEmitConnectionState(At.Connecting),((f=this.regionUrlProvider)===null||f===void 0?void 0:f.getServerUrl().toString())!==NW(u)&&(this.regionUrl=void 0,this.regionUrlProvider=void 0),jh(new URL(u))&&(this.regionUrlProvider===void 0?this.regionUrlProvider=new Tt(u,d):this.regionUrlProvider.updateToken(d),this.regionUrlProvider.fetchRegionSettings().then(v=>{var x;(x=this.regionUrlProvider)===null||x===void 0||x.setServerReportedRegions(v)}).catch(v=>{this.log.warn("could not fetch region settings",Object.assign(Object.assign({},this.logContext),{error:v}))}));const g=(v,x,w)=>F(this,void 0,void 0,function*(){var y,k;this.abortController&&this.abortController.abort();const S=new AbortController;this.abortController=S,p==null||p();try{if(yield Bd.getInstance().getBackOffPromise(u),S.signal.aborted)throw Ge.cancelled("Connection attempt aborted");yield this.attemptConnection(w??u,d,h,S),this.abortController=void 0,v()}catch(_){if(this.regionUrlProvider&&_ instanceof Ge&&_.reason!==Gt.Cancelled&&_.reason!==Gt.NotAllowed){let C=null;try{this.log.debug("Fetching next region"),C=yield this.regionUrlProvider.getNextBestRegionUrl((y=this.abortController)===null||y===void 0?void 0:y.signal)}catch(T){if(T instanceof Ge&&(T.status===401||T.reason===Gt.Cancelled)){this.handleDisconnect(this.options.stopLocalTrackOnUnpublish),x(T);return}}[Gt.InternalError,Gt.ServerUnreachable,Gt.Timeout].includes(_.reason)&&(this.log.debug("Adding failed connection attempt to back off"),Bd.getInstance().addFailedConnectionAttempt(u)),C&&!(!((k=this.abortController)===null||k===void 0)&&k.signal.aborted)?(this.log.info("Initial connection failed with ConnectionError: ".concat(_.message,". Retrying with another region: ").concat(C),this.logContext),this.recreateEngine(!0),yield g(v,x,C)):(this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,v4(_)),x(_))}else{let C=Wa.UNKNOWN_REASON;_ instanceof Ge&&(C=v4(_)),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,C),x(_)}}}),m=this.regionUrl;return this.regionUrl=void 0,this.connectFuture=new Ur((v,x)=>{g(v,x,m)},()=>{this.clearConnectionFutures()}),this.connectFuture.promise}),this.connectSignal=(u,d,h,f,p,g)=>F(this,void 0,void 0,function*(){const{joinResponse:m,serverInfo:v}=yield h.join(u,d,{autoSubscribe:f.autoSubscribe,adaptiveStream:typeof p.adaptiveStream=="object"?!0:p.adaptiveStream,maxRetries:f.maxRetries,e2eeEnabled:!!this.e2eeManager,websocketTimeout:f.websocketTimeout},g.signal,!p.singlePeerConnection);if(this.serverInfo=v,!v.version)throw new qpe("unknown server version");return v.version==="0.15.1"&&this.options.dynacast&&(this.log.debug("disabling dynacast due to server version",this.logContext),p.dynacast=!1),m}),this.applyJoinResponse=u=>{const d=u.participant;if(this.localParticipant.sid=d.sid,this.localParticipant.identity=d.identity,this.localParticipant.setEnabledPublishCodecs(u.enabledPublishCodecs),this.e2eeManager)try{this.e2eeManager.setSifTrailer(u.sifTrailer)}catch(h){this.log.error(h instanceof Error?h.message:"Could not set SifTrailer",Object.assign(Object.assign({},this.logContext),{error:h}))}this.handleParticipantUpdates([d,...u.otherParticipants]),u.room&&this.handleRoomUpdate(u.room)},this.attemptConnection=(u,d,h,f)=>F(this,void 0,void 0,function*(){var p,g;this.state===At.Reconnecting||this.isResuming||!((p=this.engine)===null||p===void 0)&&p.pendingReconnect?(this.log.info("Reconnection attempt replaced by new connection attempt",this.logContext),this.recreateEngine(!0)):this.maybeCreateEngine(),!((g=this.regionUrlProvider)===null||g===void 0)&&g.isCloud()&&this.engine.setRegionStrategy(this.createRegionStrategy()),this.acquireAudioContext(),this.connOptions=Object.assign(Object.assign({},AP),h),this.connOptions.rtcConfig&&(this.engine.rtcConfig=this.connOptions.rtcConfig),this.connOptions.peerConnectionTimeout&&(this.engine.peerConnectionTimeout=this.connOptions.peerConnectionTimeout);try{const m=yield this.connectSignal(u,d,this.engine,this.connOptions,this.options,f);this.applyJoinResponse(m),this.setupLocalParticipantEvents(),this.emit
vendor: 2,951 bytes, line 700
700(be.SignalConnected)}catch(m){yield this.engine.close(),this.recreateEngine();const v=f.signal.aborted?Ge.cancelled("Signal connection aborted"):Ge.serverUnreachable("could not establish signal connection");throw m instanceof Error&&(v.message="".concat(v.message,": ").concat(m.message)),m instanceof Ge&&(v.reason=m.reason,v.status=m.status),this.log.debug("error trying to establish signal connection",Object.assign(Object.assign({},this.logContext),{error:m})),v}if(f.signal.aborted)throw yield this.engine.close(),this.recreateEngine(),Ge.cancelled("Connection attempt aborted");try{yield this.engine.waitForPCInitialConnection(this.connOptions.peerConnectionTimeout,f)}catch(m){throw yield this.engine.close(),this.recreateEngine(),m}ni()&&this.options.disconnectOnPageLeave&&(window.addEventListener("pagehide",this.onPageLeave),window.addEventListener("beforeunload",this.onPageLeave)),ni()&&window.addEventListener("freeze",this.onPageLeave),this.setAndEmitConnectionState(At.Connected),this.emit(be.Connected),Bd.getInstance().resetFailedConnectionAttempts(u),this.registerConnectionReconcile(),this.regionUrlProvider&&this.regionUrlProvider.notifyConnected()}),this.disconnect=function(){for(var u=arguments.length,d=new Array(u),h=0;h<u;h++)d[h]=arguments[h];return F(n,[...d],void 0,function(){var f=this;let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){var g,m,v;const x=yield f.disconnectLock.lock();try{if(f.state===At.Disconnected){f.log.debug("already disconnected",f.logContext);return}if(f.log.info("disconnect from room",Object.assign({},f.logContext)),f.state===At.Connecting||f.state===At.Reconnecting||f.isResuming){const w="Abort connection attempt due to user initiated disconnect";f.log.warn(w,f.logContext),(g=f.abortController)===null||g===void 0||g.abort(w),(v=(m=f.connectFuture)===null||m===void 0?void 0:m.reject)===null||v===void 0||v.call(m,Ge.cancelled("Client initiated disconnect")),f.connectFuture=void 0}f.engine&&(f.engine.client.isDisconnected||(yield f.engine.client.sendLeave()),yield f.engine.close()),f.handleDisconnect(p,Wa.CLIENT_INITIATED),f.engine=void 0}finally{x()}}()})},this.onPageLeave=()=>F(this,void 0,void 0,function*(){this.log.info("Page leave detected, disconnecting",this.logContext),yield this.disconnect()}),this.startAudio=()=>F(this,void 0,void 0,function*(){const u=[],d=oi();if(d&&d.os==="iOS"){const h="livekit-dummy-audio-el";let f=document.getElementById(h);if(!f){f=document.createElement("audio"),f.id=h,f.autoplay=!0,f.hidden=!0;const p=ek();p.enabled=!0;const g=new MediaStream([p]);f.srcObject=g,document.addEventListener("visibilitychange",()=>{f&&(f.srcObject=document.hidden?null:g,document.hidden||(this.log.debug("page visible again, triggering startAudio to resume playback and update playback status",this.logContext),this.startAudio()))}),document.body.append(f),this.once(be.Disconnected,()=>{f==null||f.remove(),f=null})}u.push(f)}
vendor: 3,078 bytes, line 700
700this.remoteParticipants.forEach(h=>{h.audioTrackPublications.forEach(f=>{f.track&&f.track.attachedElements.forEach(p=>{u.push(p)})})});try{yield Promise.all([this.acquireAudioContext(),...u.map(h=>(h.muted=!1,h.play()))]),this.handleAudioPlaybackStarted()}catch(h){throw this.handleAudioPlaybackFailed(h),h}}),this.startVideo=()=>F(this,void 0,void 0,function*(){const u=[];for(const d of this.remoteParticipants.values())d.videoTrackPublications.forEach(h=>{var f;(f=h.track)===null||f===void 0||f.attachedElements.forEach(p=>{u.includes(p)||u.push(p)})});yield Promise.all(u.map(d=>d.play())).then(()=>{this.handleVideoPlaybackStarted()}).catch(d=>{d.name==="NotAllowedError"?this.handleVideoPlaybackFailed():this.log.warn("Resuming video playback failed, make sure you call `startVideo` directly in a user gesture handler",this.logContext)})}),this.handleRestarting=()=>{this.clearConnectionReconcile(),this.isResuming=!1;for(const u of this.remoteParticipants.values())this.handleParticipantDisconnected(u.identity,u);this.setAndEmitConnectionState(At.Reconnecting)&&this.emit(be.Reconnecting)},this.handleRestarted=()=>{this.outgoingDataTrackManager.sfuWillRepublishTracks(),this.incomingDataTrackManager.resendSubscriptionUpdates()},this.handleSignalRestarted=u=>F(this,void 0,void 0,function*(){this.log.debug("signal reconnected to server, region ".concat(u.serverRegion),Object.assign(Object.assign({},this.logContext),{region:u.serverRegion})),this.bufferedEvents=[],this.applyJoinResponse(u);try{yield this.localParticipant.republishAllTracks(void 0,!0)}catch(d){this.log.error("error trying to re-publish tracks after reconnection",Object.assign(Object.assign({},this.logContext),{error:d}))}try{yield this.engine.waitForRestarted(),this.log.debug("fully reconnected to server",Object.assign(Object.assign({},this.logContext),{region:u.serverRegion}))}catch{return}this.setAndEmitConnectionState(At.Connected),this.emit(be.Reconnected),this.registerConnectionReconcile(),this.emitBufferedEvents()}),this.handleParticipantUpdates=u=>{var d;for(const f of u){if(f.identity===this.localParticipant.identity){this.localParticipant.updateInfo(f);continue}f.identity===""&&(f.identity=(d=this.sidToIdentity.get(f.sid))!==null&&d!==void 0?d:"");let p=this.remoteParticipants.get(f.identity);f.state===Md.DISCONNECTED?this.handleParticipantDisconnected(f.identity,p):p=this.getOrCreateParticipant(f.identity,f)}const h=new Map(u.filter(f=>f.identity!==this.localParticipant.identity).map(f=>[f.identity,f.dataTracks.map(p=>ab.from(p))]));this.incomingDataTrackManager.receiveSfuPublicationUpdates(h)},this.handleActiveSpeakersUpdate=u=>{const d=[],h={};u.forEach(f=>{if(h[f.sid]=!0,f.sid===this.localParticipant.sid)this.localParticipant.audioLevel=f.level,this.localParticipant.setIsSpeaking(!0),d.push(this.localParticipant);else{const p=this.getRemoteParticipantBySid(f.sid);p&&(p.audioLevel=f.level,p.setIsSpeaking(!0),d.push(p))}}),h[this.localParticipant.sid]||(this.localParticipant.audioLevel=0,this.localParticipant.setIsSpeaking(!1)),this.remoteParticipants.forEac
vendor: 4,302 bytes, line 700
700h(f=>{h[f.sid]||(f.audioLevel=0,f.setIsSpeaking(!1))}),this.activeSpeakers=d,this.emitWhenConnected(be.ActiveSpeakersChanged,d)},this.handleSpeakersChanged=u=>{const d=new Map;this.activeSpeakers.forEach(f=>{const p=this.remoteParticipants.get(f.identity);p&&p.sid!==f.sid||d.set(f.sid,f)}),u.forEach(f=>{let p=this.getRemoteParticipantBySid(f.sid);f.sid===this.localParticipant.sid&&(p=this.localParticipant),p&&(p.audioLevel=f.level,p.setIsSpeaking(f.active),f.active?d.set(f.sid,p):d.delete(f.sid))});const h=Array.from(d.values());h.sort((f,p)=>p.audioLevel-f.audioLevel),this.activeSpeakers=h,this.emitWhenConnected(be.ActiveSpeakersChanged,h)},this.handleStreamStateUpdate=u=>{u.streamStates.forEach(d=>{const h=this.getRemoteParticipantBySid(d.participantSid);if(!h)return;const f=h.getTrackPublicationBySid(d.trackSid);if(!f||!f.track)return;const p=fe.streamStateFromProto(d.state);f.track.setStreamState(p),p!==f.track.streamState&&(h.emit(Ee.TrackStreamStateChanged,f,f.track.streamState),this.emitWhenConnected(be.TrackStreamStateChanged,f,f.track.streamState,h))})},this.handleSubscriptionPermissionUpdate=u=>{const d=this.getRemoteParticipantBySid(u.participantSid);if(!d)return;const h=d.getTrackPublicationBySid(u.trackSid);h&&h.setAllowed(u.allowed)},this.handleSubscriptionError=u=>{const d=Array.from(this.remoteParticipants.values()).find(f=>f.trackPublications.has(u.trackSid));if(!d)return;const h=d.getTrackPublicationBySid(u.trackSid);h&&h.setSubscriptionError(u.err)},this.handleDataPacket=(u,d)=>{const h=this.remoteParticipants.get(u.participantIdentity);if(u.value.case==="user")this.handleUserPacket(h,u.value.value,u.kind,d);else if(u.value.case==="transcription")this.handleTranscription(h,u.value.value);else if(u.value.case==="sipDtmf")this.handleSipDtmf(h,u.value.value);else if(u.value.case==="chatMessage")this.handleChatMessage(h,u.value.value);else if(u.value.case==="metrics")this.handleMetrics(u.value.value,h);else if(u.value.case==="streamHeader"||u.value.case==="streamChunk"||u.value.case==="streamTrailer")this.handleDataStream(u,d);else if(u.value.case==="rpcRequest"){const f=u.value.value;this.handleIncomingRpcRequest(u.participantIdentity,f.id,f.method,f.payload,f.responseTimeoutMs,f.version)}},this.handleUserPacket=(u,d,h,f)=>{this.emit(be.DataReceived,d.payload,u,h,d.topic,f),u==null||u.emit(Ee.DataReceived,d.payload,h,f)},this.handleSipDtmf=(u,d)=>{this.emit(be.SipDTMFReceived,d,u),u==null||u.emit(Ee.SipDTMFReceived,d)},this.handleTranscription=(u,d)=>{const h=d.transcribedParticipantIdentity===this.localParticipant.identity?this.localParticipant:this.getParticipantByIdentity(d.transcribedParticipantIdentity),f=h==null?void 0:h.trackPublications.get(d.trackId),p=yme(d,this.transcriptionReceivedTimes);f==null||f.emit(ke.TranscriptionReceived,p),h==null||h.emit(Ee.TranscriptionReceived,p,f),this.emit(be.TranscriptionReceived,p,h,f)},this.handleChatMessage=(u,d)=>{const h=bme(d);this.emit(be.ChatMessage,h,u)},this.handleMetrics=(u,d)=>{this.emit(be.MetricsReceived,u,d)},this.handleDataStream=(u,d)=>{this.incomingDataStreamManager.handleDataStreamPacket(u,d)},this.bufferedSegments=new Map,this.handleAudioPlaybackStarted=()=>{this.canPlaybackAudio||(this.audioEnabled=!0,this.emit(be.AudioPlaybackStatusChanged,!0))},this.handleAudioPlaybackFailed=u=>{this.log.warn("could not playback audio",Object.assign(Object.assign({},this.logContext),{error:u})),this.canPlaybackAudio&&(this.audioEnabled=!1,this.emit(be.AudioPlaybackStatusChanged,!1))},this.handleVideoPlaybackStarted=()=>{this.isVideoPlaybackBlocked&&(this.isVideoPlaybackBlocked=!1,this.emit(be.VideoPlaybackStatusChanged,!0))},this.handleVideoPlaybackFailed=()=>{this.isVideoPlaybackBlocked||(this.isVideoPlaybackBlocked=!0,this.emit(be.VideoPlaybackStatusChanged,!1))},this.handleDeviceChange=()=>F(this,void 0,void 0,function*(){var u;((u=oi())===null||u===void 0?void 0:u.os)!=="iOS"&&(yield this.selectDefaultDevices()),this.emit(be.MediaDevicesChanged)}),this.handleRoomUpdate=u=>{const d=this.roomInfo;this.roomInfo=u,d&&d.metadata!==u.metadata&&this.emitWhenConnected(be.RoomMetadataChanged,u.metadata),(d==null?void 0:d.activeRecording)!==u.activeRecording&&this.emitWhenConnected(be.RecordingStatusChanged,u.activeRecording)},this.handleConnectionQualityUpdate=u=>
700{u.updates.forEach(d=>{if(d.participantSid===this.localParticipant.sid){this.localParticipant.setConnectionQuality(d.quality);return}const h=this.getRemoteParticipantBySid(d.participantSid);h&&h.setConnectionQuality(d.quality)})},this.onLocalParticipantMetadataChanged=u=>{this.emit(be.ParticipantMetadataChanged,u,this.localParticipant)},this.onLocalParticipantNameChanged=u=>{this.emit(be.ParticipantNameChanged,u,this.localParticipant)},this.onLocalAttributesChanged=u=>{this.emit(be.ParticipantAttributesChanged,u,this.localParticipant)},this.onLocalTrackMuted=u=>{this.emit(be.TrackMuted,u,this.localParticipant)},this.onLocalTrackUnmuted=u=>{this.emit(be.TrackUnmuted,u,this.localParticipant)},this.onTrackProcessorUpdate=u=>{var d;(d=u==null?void 0:u.onPublish)===null||d===void 0||d.call(u,this)},this.onLocalTrackPublished=u=>F(this,void 0,void 0,function*(){var d,h,f,p,g,m;(d=u.track)===null||d===void 0||d.on(ke.TrackProcessorUpdate,this.onTrackProcessorUpdate),(h=u.track)===null||h===void 0||h.on(ke.Restarted,this.onLocalTrackRestarted),(g=(p=(f=u.track)===null||f===void 0?void 0:f.getProcessor())===null||p===void 0?void 0:p.onPublish)===null||g===void 0||g.call(p,this),this.emit(be.LocalTrackPublished,u,this.localParticipant),Ws(u.track)&&(yield u.track.checkForSilence())&&this.emit(be.LocalAudioSilenceDetected,u);const v=yield(m=u.track)===null||m===void 0?void 0:m.getDeviceId(!1),x=iT(u.source);x&&v&&v!==this.localParticipant.activeDeviceMap.get(x)&&(this.localParticipant.activeDeviceMap.set(x,v),this.emit(be.ActiveDeviceChanged,x,v))}),this.onLocalTrackUnpublished=u=>{var d,h;(d=u.track)===null||d===void 0||d.off(ke.TrackProcessorUpdate,this.onTrackProcessorUpdate),(h=u.track)===null||h===void 0||h.off(ke.Restarted,this.onLocalTrackRestarted),this.emit(be.LocalTrackUnpublished,u,this.localParticipant)},this.onLocalTrackRestarted=u=>F(this,void 0,void 0,function*(){const d=yield u.getDeviceId(!1),h=iT(u.source);h&&d&&d!==this.localParticipant.activeDeviceMap.get(h)&&(this.log.debug("local track restarted, setting ".concat(h," ").concat(d," active"),this.logContext),this.localParticipant.activeDeviceMap.set(h,d),this.emit(be.ActiveDeviceChanged,h,d))}),this.onLocalConnectionQualityChanged=u=>{this.emit(be.ConnectionQualityChanged,u,this.localParticipant)},this.onMediaDevicesError=(u,d)=>{this.emit(be.MediaDevicesError,u,d)},this.onLocalParticipantPermissionsChanged=u=>{this.emit(be.ParticipantPermissionsChanged,u,this.localParticipant)},this.onLocalChatMessageSent=u=>{this.emit(be.ChatMessage,u,this.localParticipant)},this.setMaxListeners(100),this.remoteParticipants=new Map,this.sidToIdentity=new Map,this.options=Object.assign(Object.assign({},ege),e),this.log=li((r=this.options.loggerName)!==null&&r!==void 0?r:Rr.Room),this.transcriptionReceivedTimes=new Map,this.options.audioCaptureDefaults=Object.assign(Object.assign({},OW),e==null?void 0:e.audioCaptureDefaults),this.options.videoCaptureDefaults=Object.assign(Object.assign({},RW),e==null?void 0:e.videoCaptureDefaults),this.options.publishDefaults=Object.assign(Object.assign({},Qme),e==null?void 0:e.publishDefaults),this.maybeCreateEngine(),this.incomingDataStreamManager=new Pge,this.outgoingDataStreamManager=new Oge(this.engine,this.log),this.incomingDataTrackManager=new zge({e2eeManager:this.e2eeManager}),this.incomingDataTrackManager.on("sfuUpdateSubscription",u=>{this.engine.client.sendUpdateDataSubscription(u.sid,u.subscribe)}).on("trackPublished",u=>{var d;u.track.publisherIdentity!==this.localParticipant.identity&&(this.emit(be.DataTrackPublished,u.track),(d=this.remoteParticipants.get(u.track.publisherIdentity))===null||d===void 0||d.addRemoteDataTrack(u.track))}).on("trackUnpublished",u=>{var d;u.publisherIdentity!==this.localParticipant.identity&&(this.emit(be.DataTrackUnpublished,u.sid),(d=this.remoteParticipants.get(u.publisherIdentity))===null||d===void 0||d.removeRemoteDataTrack(u.sid))}),this.outgoingDataTrackManager=new IP({e2eeManager:this.e2eeManager}),this.outgoingDataTrackManager.on("sfuPublishRequest",u=>{this.engine.client.sendPublishDataTrackRequest(u.handle,u.name,u.usesE2ee)}).on("sfuUnpublishRequest",u=>{this.engine.client.sendUnPublishDataTrackRequest(u.handle)}).on("trackPublished",u=>
700{this.emit(be.LocalDataTrackPublished,u.track)}).on("trackUnpublished",u=>{this.emit(be.LocalDataTrackUnpublished,u.sid)}).on("packetAvailable",u=>{let{bytes:d}=u;this.engine.sendLossyBytes(d,xt.DATA_TRACK_LOSSY,"wait")}),this.disconnectLock=new gr,this.localParticipant=new Xge("","",this.engine,this.options,this.rpcHandlers,this.outgoingDataStreamManager,this.outgoingDataTrackManager),(this.options.e2ee||this.options.encryption)&&this.setupE2EE(),this.engine.e2eeManager=this.e2eeManager,this.incomingDataTrackManager.updateE2eeManager((i=this.e2eeManager)!==null&&i!==void 0?i:null),this.outgoingDataTrackManager.updateE2eeManager((a=this.e2eeManager)!==null&&a!==void 0?a:null),this.options.videoCaptureDefaults.deviceId&&this.localParticipant.activeDeviceMap.set("videoinput",zl(this.options.videoCaptureDefaults.deviceId)),this.options.audioCaptureDefaults.deviceId&&this.localParticipant.activeDeviceMap.set("audioinput",zl(this.options.audioCaptureDefaults.deviceId)),!((s=this.options.audioOutput)===null||s===void 0)&&s.deviceId&&this.switchActiveDevice("audiooutput",zl(this.options.audioOutput.deviceId)).catch(u=>this.log.warn("Could not set audio output: ".concat(u.message),this.logContext)),ni()){const u=new AbortController;(c=(o=navigator.mediaDevices)===null||o===void 0?void 0:o.addEventListener)===null||c===void 0||c.call(o,"devicechange",this.handleDeviceChange,{signal:u.signal}),Gm.cleanupRegistry&&Gm.cleanupRegistry.register(this,()=>{u.abort()})}}registerTextStreamHandler(e,n){return this.incomingDataStreamManager.registerTextStreamHandler(e,n)}unregisterTextStreamHandler(e){return this.incomingDataStreamManager.unregisterTextStreamHandler(e)}registerByteStreamHandler(e,n){return this.incomingDataStreamManager.registerByteStreamHandler(e,n)}unregisterByteStreamHandler(e){return this.incomingDataStreamManager.unregisterByteStreamHandler(e)}registerRpcMethod(e,n){if(this.rpcHandlers.has(e))throw Error("RPC handler already registered for method ".concat(e,", unregisterRpcMethod before trying to register again"));this.rpcHandlers.set(e,n)}unregisterRpcMethod(e){this.rpcHandlers.delete(e)}setE2EEEnabled(e){return F(this,void 0,void 0,function*(){const n=yield this.e2eeStateMutex.lock();try{if(this.e2eeManager)this.isE2EEEnabled!==e&&(yield this.localParticipant.setE2EEEnabled(e),this.localParticipant.identity!==""&&this.e2eeManager.setParticipantCryptorEnabled(e,this.localParticipant.identity));else throw Error("e2ee not configured, please set e2ee settings within the room options")}finally{n()}})}setupE2EE(){var e,n;const r=!!this.options.encryption,i=this.options.encryption||this.options.e2ee;i&&("e2eeManager"in i?(this.e2eeManager=i.e2eeManager,this.e2eeManager.isDataChannelEncryptionEnabled=r):this.e2eeManager=new Dme(i,r),this.e2eeManager.on(ac.ParticipantEncryptionStatusChanged,(a,s)=>{wme(s)&&(this.isE2EEEnabled=a),this.emit(be.ParticipantEncryptionStatusChanged,a,s)}),this.e2eeManager.on(ac.EncryptionError,(a,s)=>{const o=s?this.getParticipantByIdentity(s):void 0;this.emit(be.EncryptionError,a,o)}),(e=this.e2eeManager)===null||e===void 0||e.setup(this),(n=this.e2eeManager)===null||n===void 0||n.setupEngine(this.engine))}get logContext(){var e;return{room:this.name,roomID:(e=this.roomInfo)===null||e===void 0?void 0:e.sid,participant:this.localParticipant.identity,participantID:this.localParticipant.sid}}get isRecording(){var e,n;return(n=(e=this.roomInfo)===null||e===void 0?void 0:e.activeRecording)!==null&&n!==void 0?n:!1}getSid(){return this.state===At.Disconnected?jr.resolve(""):this.roomInfo&&this.roomInfo.sid!==""?jr.resolve(this.roomInfo.sid):new jr((e,n)=>{const r=i=>{i.sid!==""&&(this.engine.off(ve.RoomUpdate,r),e(i.sid))};this.engine.on(ve.RoomUpdate,r),this.once(be.Disconnected,()=>{this.engine.off(ve.RoomUpdate,r),n(new bn("Room disconnected before room server id was available"))})})}get name(){var e,n;return(n=(e=this.roomInfo)===null||e===void 0?void 0:e.name)!==null&&n!==void 0?n:""}get metadata(){var e;return(e=this.roomInfo)===null||e===void 0?void 0:e.metadata}get numParticipants(){var e,n;return(n=(e=this.roomInfo)===null||e===void 0?void 0:e.numParticipants)!==null&&n!==void 0?n:0}get numPublishers(){var e,n;return(n=(e=this.roomInfo)===null||e===void 0?void 0:e.numPublishers)!==null&&n!==void 0?n:0}maybeCreateEngine(){this.engine&&(this.engine.isNewlyCreated||!this.engine.isClosed)||(this.engine=new _ge(this.options),this.engine.e2eeManager=this.e2eeManager,this.engine.on(ve.ParticipantUpdate,this.handleParticipantUpdates).on(ve.RoomUpdate,this.handleRoomUpdate).on(ve.SpeakersChanged,this.handleSpeakersChanged).on(ve.StreamStateChanged,this.handleStreamStateUpdate).on(ve.ConnectionQualityUpdate,this.handleConnectionQualityUpdate).on(ve.SubscriptionError,this.handleSubscriptionError).on(ve.SubscriptionPermissionUpdate,this.handleSubscriptionPermissionUpdate).on(ve.MediaTrackAdded,(e,n,r)=>{this.onTrackAdded(e,n,r)}).on(ve.Disconnected,e=>{this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,e)}).on(ve.ActiveSpeakersUpdate,this.handleActiveSpeakersUpdate).on(ve.DataPacketReceived,this.handleDataPacket).on(ve.Resuming,()=>{this.clearConnectionReconcile(),this.isResuming=!0,this.log.info("Resuming signal connection",this.logContext),this.setAndEmitConnectionState(At.SignalReconnecting)&&this.emit
700(be.SignalReconnecting)}).on(ve.Resumed,()=>{this.registerConnectionReconcile(),this.isResuming=!1,this.log.info("Resumed signal connection",this.logContext),this.updateSubscriptions(),this.emitBufferedEvents(),this.setAndEmitConnectionState(At.Connected)&&this.emit(be.Reconnected)}).on(ve.SignalResumed,()=>{this.bufferedEvents=[],(this.state===At.Reconnecting||this.isResuming)&&this.sendSyncState()}).on(ve.Restarting,this.handleRestarting).on(ve.Restarted,this.handleRestarted).on(ve.SignalRestarted,this.handleSignalRestarted).on(ve.Offline,()=>{this.setAndEmitConnectionState(At.Reconnecting)&&this.emit(be.Reconnecting)}).on(ve.DCBufferStatusChanged,(e,n)=>{this.emit(be.DCBufferStatusChanged,e,n)}).on(ve.LocalTrackSubscribed,e=>{this.handleLocalTrackSubscribed(e)}).on(ve.RoomMoved,e=>{this.log.debug("room moved",e),e.room&&this.handleRoomUpdate(e.room),this.remoteParticipants.forEach((n,r)=>{this.handleParticipantDisconnected(r,n)}),this.emit(be.Moved,e.room.name),e.participant?this.handleParticipantUpdates([e.participant,...e.otherParticipants]):this.handleParticipantUpdates(e.otherParticipants)}).on(ve.PublishDataTrackResponse,e=>{if(!e.info){this.log.warn("received PublishDataTrackResponse, but event.info was ".concat(e.info,", so skipping."),this.logContext);return}this.outgoingDataTrackManager.receivedSfuPublishResponse(e.info.pubHandle,{type:"ok",data:{sid:e.info.sid,pubHandle:e.info.pubHandle,name:e.info.name,usesE2ee:e.info.encryption!==Yt.NONE}})}).on(ve.UnPublishDataTrackResponse,e=>{if(!e.info){this.log.warn("received UnPublishDataTrackResponse, but event.info was ".concat(e.info,", so skipping."),this.logContext);return}this.outgoingDataTrackManager.receivedSfuUnpublishResponse(e.info.pubHandle)}).on(ve.DataTrackSubscriberHandles,e=>{const n=new Map(Object.entries(e.subHandles).map(r=>{let[i,a]=r;return[parseInt(i,10),a.trackSid]}));this.incomingDataTrackManager.receivedSfuSubscriberHandles(n)}).on(ve.DataTrackPacketReceived,e=>{try{this.incomingDataTrackManager.packetReceived(e)}catch(n){throw n}}).on(ve.Joined,e=>{const n=new Map(e.otherParticipants.map(r=>[r.identity,r.dataTracks.map(i=>ab.from(i))]));this.incomingDataTrackManager.receiveSfuPublicationUpdates(n)}).on(ve.TokenRefreshed,e=>{var n;(n=this.regionUrlProvider)===null||n===void 0||n.updateToken(e)}).on(ve.ServerRegionsReported,e=>{var n;(n=this.regionUrlProvider)===null||n===void 0||n.setServerReportedRegions({regionSettings:e,updatedAtInMs:Date.now(),maxAgeInMs:fT})}),this.localParticipant&&this.localParticipant.setupEngine(this.engine),this.e2eeManager&&this.e2eeManager.setupEngine(this.engine),this.outgoingDataStreamManager&&this.outgoingDataStreamManager.setupEngine(this.engine))}createRegionStrategy(){return{getNextUrl:e=>F(this,void 0,void 0,function*(){return this.regionUrlProvider?this.regionUrlProvider.getNextBestRegionUrl(e):null}),resetAttempts:()=>{var e;return(e=this.regionUrlProvider)===null||e===void 0?void 0:e.resetAttempts()}}}static getLocalDevices(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return cr.getInstance().getDevices(e,n)}prepareConnection(e,n){return F(this,void 0,void 0,function*(){if(this.state===At.Disconnected){this.log.debug("prepareConnection to ".concat(e),this.logContext);try{if(jh(new URL(e))&&n){this.regionUrlProvider=new Tt(e,n);const r=yield this.regionUrlProvider.getNextBestRegionUrl();r&&this.state===At.Disconnected&&(this.regionUrl=r,yield fetch(Vm(r),{method:"HEAD"}),this.log.debug("prepared connection to ".concat(r),this.logContext))}else yield fetch(Vm(e),{method:"HEAD"})}catch(r){this.log.warn("could not prepare connection",Object.assign(Object.assign({},this.logContext),{error:r}))}}})}getParticipantByIdentity(e){return this.localParticipant.identity===e?this.localParticipant:this.remoteParticipants.get(e)}clearConnectionFutures(){this.connectFuture=void 0}simulateScenario(e,n){return F(this,void 0,void 0,function*(){let r=()=>F(this,void 0,void 0,function*(){}),i;switch(e){case"signal-reconnect":yield this.engine.client.handleOnClose("simulate disconnect");break;case"fail-on-v1-path":this.engine.failNextV1Path();break;case"speaker":i=new as({scenario:{case:"speakerUpdate",value:3}});break;case"node-failure":i=new as({scenario:{case:"nodeFailure",value:!0}});break;case"server-leave":i=new as({scenario:{case:"serverLeave",value:!0}});break;case"migration":i=new as({scenario:{case:"migration",value:!0}});break;case"resume-reconnect":this.engine.failNext(),yield this.engine.client.handleOnClose("simulate resume-disconnect");break;case"disconnect-signal-on-resume":r=()=>F(this,void 0,void 0,function*(){yield this.engine.client.handleOnClose("simulate resume-disconnect")}),i=new as({scenario:{case:"disconnectSignalOnResume",value:!0}});break;case"disconnect-signal-on-resume-no-messages":r=()=>F(this,void 0,void 0,function*(){yield this.engine.client.handleOnClose("simulate resume-disconnect")}),i=new as({scenario:{case:"disconnectSignalOnResumeNoMessages",value:!0}});break;case"full-reconnect":this.engine.fullReconnectOnNext=!0,yield this.engine.client.handleOnClose("simulate full-reconnect");break;case"force-tcp":case"force-tls":i=new as({scenario:{case:"switchCandidateProtocol",value:e==="force-tls"?2:1}}),r=()=>F(this,void 0,void 0,function*(){const a=this.engine.client.onLeave;a&&a(new Ew({reason:Wa.CLIENT_INITIATED,action:Id.RECONNECT}))});break;case"subscriber-bandwidth":if(n===void 0||typeof n!="number")throw new Error("subscriber-bandwidth requires a number as argument");i=new as({scenario:{case:"subscriberBandwidth",value:ul(n)}});break;case"leave-full-reconnect":i=new as({scenario:{case:"leaveRequestFullReconnect",value:!0}})}i&&(yield this.engine.client.sendSimulateScenario(i),yield r())})}get canPlaybackAudio(){return this.audioEnabled}get canPlaybackVideo(){return!this.isVideoPlaybackBlocked}getActiveDevice(e){return this.localParticipant.activeDeviceMap.get(e)}switchActiveDevice(e,n){return F(this,arguments,void 0,function(r,i){var a=this;let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return function*(){var o,c,u,d,h,f,p;let g=!0,m=!1;const v=s?{exact:i}:i;if(r==="audioinput"){m=a.localParticipant.audioTrackPublications.size===0;const x=(o=a.getActiveDevice(r))!==null&&o!==void 0?o:a.options.audioCaptureDefaults.deviceId;a.options.audioCaptureDefaults.deviceId=v;const w=Array.from(a.localParticipant.audioTrackPublications.values()).filter(k=>k.source===fe.Source.Microphone);try{g=(yield Promise.all(w.map(k=>{var S;return(S=k.audioTrack)===null||S===void 0?void 0:S.setDeviceId(v)}))).every(k=>k===!0)}catch(k){throw a.options.audioCaptureDefaults.deviceId=x,k}const y=w.some(k=>{var S,_;return(_=(S=k.track)===null||S===void 0?void 0:S.isMuted)!==null&&_!==void 0?_:!1});g&&y&&(m=!0)}else if(r==="videoinput"){m=a.localParticipant.videoTrackPublications.size===0;const x=(c=a.getActiveDevice(r))!==null&&c!==void 0?c:a.options.videoCaptureDefaults.deviceId;a.options.videoCaptureDefaults.deviceId=v;const w=Array.from(a.localParticipant.videoTrackPublications.values()).filter(k=>k.source===fe.Source.Camera);try{g=(yield Promise.all(w.map(k=>{var S;return(S=k.videoTrack)===null||S===void 0?void 0:S.setDeviceId(v)}))).every(k=>k===!0)}catch(k){throw a.options.videoCaptureDefaults.deviceId=x,k}const y=w.some(k=>{var S,_;return(_=(S=k.track)===null||S===void 0?void 0:S.isMuted)!==null&&_!==void 0?_:!1});g&&y&&(m=!0)}else if(r==="audiooutput"){if(m=!0,!oT()&&!a.options.webAudioMix||a.options.webAudioMix&&a.audioContext&&!("setSinkId"in a.audioContext))throw new Error("cannot switch audio output, the current browser does not support it");a.options.webAudioMix&&(i=(u=yield cr.getInstance().normalizeDeviceId("audiooutput",i))!==null&&u!==void 0?u:""),(d=(p=a.options).audioOutput)!==null&&d!==void 0||(p.audioOutput={});const x=(h=a.getActiveDevice(r))!==null&&h!==void 0?h:a.options.audioOutput.deviceId;a.options.audioOutput.deviceId=i;try{a.options.webAudioMix&&((f=a.audioContext)===null||f===void 0||f.setSinkId(i)),yield Promise.all(Array.from(a.remoteParticipants.values()).map(w=>w.setAudioOutput({deviceId:i})))}catch(w){throw a.options.audioOutput.deviceId=x,w}}return m&&(a.localParticipant.activeDeviceMap.set(r,i),a.emit(be.ActiveDeviceChanged,r,i)),g}()})}setupLocalParticipantEvents(){this.localParticipant.on(Ee.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).on(Ee.ParticipantNameChanged,this.onLocalParticipantNameChanged).on(Ee.AttributesChanged,this.onLocalAttributesChanged).on(Ee.TrackMuted,this.onLocalTrackMuted).on(Ee.TrackUnmuted,this.onLocalTrackUnmuted).on(Ee.LocalTrackPublished,this.onLocalTrackPublished).on(Ee.LocalTrackUnpublished,this.onLocalTrackUnpublished).on(Ee.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).on(Ee.MediaDevicesError,this.onMediaDevicesError).on(Ee.AudioStreamAcquired,this.startAudio).on(Ee.ChatMessage,this.onLocalChatMessageSent).on(Ee.ParticipantPermissionsChanged,this.onLocalParticipantPermissionsChanged)}recreateEngine(e){const n=this.engine;e&&n&&!n.client.isDisconnected?n.client.sendLeave().finally(()=>n.close()):n==null||n.close(),this.engine=void 0,this.isResuming=!1,this.remoteParticipants.clear(),this.sidToIdentity.clear(),this.bufferedEvents=[],this.maybeCreateEngine()}onTrackAdded(e,n,r){if(this.state===At.Connecting||this.state===At.Reconnecting){const h=()=>{this.log.debug("deferring on track for later",{mediaTrackId:e.id,mediaStreamId:n.id,tracksInStream:n.getTracks().map(p=>p.id)}),this.onTrackAdded(e,n,r),f()},f=()=>{this.off(be.Reconnected,h),this.off(be.Connected,h),this.off(be.Disconnected,f)};this.once(be.Reconnected,h),this.once(be.Connected,h),this.once(be.Disconnected,f);return}if(this.state===At.Disconnected){this.log.warn("skipping incoming track after Room disconnected",this.logContext);return}if(e.readyState==="ended"){this.log.info("skipping incoming track as it already ended",this.logContext);return}const i=sme(n.id),a=i[0];let s=i[1],o=e.id;if(s&&s.startsWith("TR")&&(o=s),a===this.localParticipant.sid){this.log.warn("tried to create RemoteParticipant for local participant",this.logContext);return}const c=Array.from(this.remoteParticipants.values()).find(h=>h.sid===a);if(!c){a.startsWith("PA")&&this.log.error("Tried to add a track for a participant, that's not present. Sid: ".concat(a),this.logContext);return}if(!o.startsWith("TR")){const h=this.engine.getTrackIdForReceiver(r);
700if(!h){this.log.error("Tried to add a track whose 'sid' could not be found for a participant, that's not present. Sid: ".concat(a),this.logContext);return}o=h}o.startsWith("TR")||this.log.warn("Tried to add a track whose 'sid' could not be determined for a participant, that's not present. Sid: ".concat(a,", streamId: ").concat(s,", trackId: ").concat(o),Object.assign(Object.assign({},this.logContext),{remoteParticipantID:a,streamId:s,trackId:o}));let u;this.options.adaptiveStream&&(typeof this.options.adaptiveStream=="object"?u=this.options.adaptiveStream:u={});const d=c.addSubscribedMediaTrack(e,o,n,r,u);d!=null&&d.isEncrypted&&!this.e2eeManager&&this.emit(be.EncryptionError,new Error("Encrypted ".concat(d.source," track received from participant ").concat(c.sid,", but room does not have encryption enabled!")))}handleLocalTrackSubscribed(e){const n=()=>this.localParticipant.getTrackPublications().find(c=>{let{trackSid:u}=c;return u===e}),r=n();if(r){this.emitLocalTrackSubscribed(r);return}this.log.debug("deferring LocalTrackSubscribed, publication not yet available",Object.assign(Object.assign({},this.logContext),{subscribedSid:e}));const i=1e4;let a;const s=c=>{c.trackSid===e&&(o(),this.emitLocalTrackSubscribed(c))},o=()=>{clearTimeout(a),this.localParticipant.off(Ee.LocalTrackPublished,s),this.off(be.Disconnected,o)};this.localParticipant.on(Ee.LocalTrackPublished,s),this.once(be.Disconnected,o),a=setTimeout(()=>{o();const c=n();c?this.emitLocalTrackSubscribed(c):this.log.warn("could not find local track publication for LocalTrackSubscribed event after timeout",Object.assign(Object.assign({},this.logContext),{subscribedSid:e}))},i)}emitLocalTrackSubscribed(e){this.localParticipant.emit(Ee.LocalTrackSubscribed,e),this.emitWhenConnected(be.LocalTrackSubscribed,e,this.localParticipant)}handleDisconnect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,n=arguments.length>1?arguments[1]:void 0;var r,i;if(this.clearConnectionReconcile(),this.isResuming=!1,this.bufferedEvents=[],this.transcriptionReceivedTimes.clear(),this.incomingDataStreamManager.clearControllers(),this.state!==At.Disconnected){this.regionUrl=void 0,this.regionUrlProvider&&this.regionUrlProvider.notifyDisconnected();
vendor: 20,504 bytes, line 700
700try{this.remoteParticipants.forEach(a=>{a.trackPublications.forEach(s=>{a.unpublishTrack(s.trackSid)})}),this.localParticipant.trackPublications.forEach(a=>{var s,o,c;a.track&&this.localParticipant.unpublishTrack(a.track,e),e?((s=a.track)===null||s===void 0||s.detach(),(o=a.track)===null||o===void 0||o.stop()):(c=a.track)===null||c===void 0||c.stopMonitor()}),this.localParticipant.off(Ee.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).off(Ee.ParticipantNameChanged,this.onLocalParticipantNameChanged).off(Ee.AttributesChanged,this.onLocalAttributesChanged).off(Ee.TrackMuted,this.onLocalTrackMuted).off(Ee.TrackUnmuted,this.onLocalTrackUnmuted).off(Ee.LocalTrackPublished,this.onLocalTrackPublished).off(Ee.LocalTrackUnpublished,this.onLocalTrackUnpublished).off(Ee.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).off(Ee.MediaDevicesError,this.onMediaDevicesError).off(Ee.AudioStreamAcquired,this.startAudio).off(Ee.ChatMessage,this.onLocalChatMessageSent).off(Ee.ParticipantPermissionsChanged,this.onLocalParticipantPermissionsChanged),this.localParticipant.trackPublications.clear(),this.localParticipant.videoTrackPublications.clear(),this.localParticipant.audioTrackPublications.clear(),this.remoteParticipants.clear(),this.sidToIdentity.clear(),this.activeSpeakers=[],this.audioContext&&typeof this.options.webAudioMix=="boolean"&&(this.audioContext.close(),this.audioContext=void 0),ni()&&(window.removeEventListener("beforeunload",this.onPageLeave),window.removeEventListener("pagehide",this.onPageLeave),window.removeEventListener("freeze",this.onPageLeave),(i=(r=navigator.mediaDevices)===null||r===void 0?void 0:r.removeEventListener)===null||i===void 0||i.call(r,"devicechange",this.handleDeviceChange))}finally{this.setAndEmitConnectionState(At.Disconnected),this.emit(be.Disconnected,n)}}}handleParticipantDisconnected(e,n){var r;this.remoteParticipants.delete(e),n&&(this.incomingDataStreamManager.validateParticipantHasNoActiveDataStreams(e),this.incomingDataTrackManager.handleRemoteParticipantDisconnected(e),n.trackPublications.forEach(i=>{n.unpublishTrack(i.trackSid,!0)}),this.emit(be.ParticipantDisconnected,n),n.setDisconnected(),(r=this.localParticipant)===null||r===void 0||r.handleParticipantDisconnected(n.identity))}handleIncomingRpcRequest(e,n,r,i,a,s){return F(this,void 0,void 0,function*(){if(yield this.engine.publishRpcAck(e,n),s!==1){yield this.engine.publishRpcResponse(e,n,null,An.builtIn("UNSUPPORTED_VERSION"));return}const o=this.rpcHandlers.get(r);if(!o){yield this.engine.publishRpcResponse(e,n,null,An.builtIn("UNSUPPORTED_METHOD"));return}let c=null,u=null;try{const d=yield o({requestId:n,callerIdentity:e,payload:i,responseTimeout:a});OP(d)>DW?(c=An.builtIn("RESPONSE_PAYLOAD_TOO_LARGE"),this.log.warn("RPC Response payload too large for ".concat(r))):u=d}catch(d){d instanceof An?c=d:(this.log.warn("Uncaught error returned by RPC handler for ".concat(r,". Returning APPLICATION_ERROR instead."),d),c=An.builtIn("APPLICATION_ERROR"))}yield this.engine.publishRpcResponse(e,n,u,c)})}selectDefaultDevices(){return F(this,void 0,void 0,function*(){var e,n,r;const i=cr.getInstance().previousDevices,a=yield cr.getInstance().getDevices(void 0,!1),s=oi();if((s==null?void 0:s.name)==="Chrome"&&s.os!=="iOS")for(let c of a){const u=i.find(d=>d.deviceId===c.deviceId);u&&u.label!==""&&u.kind===c.kind&&u.label!==c.label&&this.getActiveDevice(c.kind)==="default"&&this.emit(be.ActiveDeviceChanged,c.kind,c.deviceId)}const o=["audiooutput","audioinput","videoinput"];for(let c of o){const u=Xpe(c),d=this.localParticipant.getTrackPublication(u);if(d&&(!((e=d.track)===null||e===void 0)&&e.isUserProvided))continue;const h=a.filter(p=>p.kind===c),f=this.getActiveDevice(c);if(f===((n=i.filter(p=>p.kind===c)[0])===null||n===void 0?void 0:n.deviceId)&&h.length>0&&((r=h[0])===null||r===void 0?void 0:r.deviceId)!==f){yield this.switchActiveDevice(c,h[0].deviceId);continue}c==="audioinput"&&!Wm()||c==="videoinput"||h.length>0&&!h.find(p=>p.deviceId===this.getActiveDevice(c))&&(c!=="audiooutput"||!Wm())&&(yield this.switchActiveDevice(c,h[0].deviceId))}})}acquireAudioContext(){return F(this,void 0,void 0,function*(){var e,n;if(typeof this.options.webAudioMix!="boolean"&&this.options.webAudioMix.audioContext?this.audioContext=this.options.webAudioMix.audioContext:(!this.audioContext||this.audioContext.state==="closed")&&(this.audioContext=(e=CW())!==null&&e!==void 0?e:void 0),this.options.webAudioMix&&this.remoteParticipants.forEach(i=>i.setAudioContext(this.audioContext)),this.localParticipant.setAudioContext(this.audioContext),this.audioContext&&this.audioContext.state==="suspended")try{yield Promise.race([this.audioContext.resume(),Nr(200)])}catch(i){this.log.warn("Could not resume audio context",Object.assign(Object.assign({},this.logContext),{error:i}))}const r=((n=this.audioContext)===null||n===void 0?void 0:n.state)==="running";r!==this.canPlaybackAudio&&(this.audioEnabled=r,this.emit(be.AudioPlaybackStatusChanged,r))})}createParticipant(e,n){var r;let i;return n?i=ub.fromParticipantInfo(this.engine.client,n,{loggerContextCb:()=>this.logContext,loggerName:this.options.loggerName},this.incomingDataTrackManager):i=new ub(this.engine.client,"",e,void 0,void 0,void 0,{loggerContextCb:()=>this.logContext,loggerName:this.options.loggerName}),this.options.webAudioMix&&i.setAudioContext(this.audioContext),!((r=this.options.audioOutput)===null||r===void 0)&&r.deviceId&&i.setAudioOutput(this.options.audioOutput).catch(a=>this.log.warn("Could not set audio output: ".concat(a.message),this.logContext)),i}getOrCreateParticipant(e,n){if(this.remoteParticipants.has(e)){const i=this.remoteParticipants.get(e);return n&&i.updateInfo(n)&&this.sidToIdentity.set(n.sid,n.identity),i}const r=this.createParticipant(e,n);return this.remoteParticipants.set(e,r),this.sidToIdentity.set(n.sid,n.identity),this.emitWhenConnected(be.ParticipantConnected,r),r.on(Ee.TrackPublished,i=>{this.emitWhenConnected(be.TrackPublished,i,r)}).on(Ee.TrackSubscribed,(i,a)=>{i.kind===fe.Kind.Audio?(i.on(ke.AudioPlaybackStarted,this.handleAudioPlaybackStarted),i.on(ke.AudioPlaybackFailed,this.handleAudioPlaybackFailed)):i.kind===fe.Kind.Video&&(i.on(ke.VideoPlaybackFailed,this.handleVideoPlaybackFailed),i.on(ke.VideoPlaybackStarted,this.handleVideoPlaybackStarted)),this.emitWhenConnected(be.TrackSubscribed,i,a,r)}).on(Ee.TrackUnpublished,i=>{this.emit(be.TrackUnpublished,i,r)}).on(Ee.TrackUnsubscribed,(i,a)=>{this.emit(be.TrackUnsubscribed,i,a,r)}).on(Ee.TrackMuted,i=>{this.emitWhenConnected(be.TrackMuted,i,r)}).on(Ee.TrackUnmuted,i=>{this.emitWhenConnected(be.TrackUnmuted,i,r)}).on(Ee.ParticipantMetadataChanged,i=>{this.emitWhenConnected(be.ParticipantMetadataChanged,i,r)}).on(Ee.ParticipantNameChanged,i=>{this.emitWhenConnected(be.ParticipantNameChanged,i,r)}).on(Ee.AttributesChanged,i=>{this.emitWhenConnected(be.ParticipantAttributesChanged,i,r)}).on(Ee.ConnectionQualityChanged,i=>{this.emitWhenConnected(be.ConnectionQualityChanged,i,r)}).on(Ee.ParticipantPermissionsChanged,i=>{this.emitWhenConnected(be.ParticipantPermissionsChanged,i,r)}).on(Ee.TrackSubscriptionStatusChanged,(i,a)=>{this.emitWhenConnected(be.TrackSubscriptionStatusChanged,i,a,r)}).on(Ee.TrackSubscriptionFailed,(i,a)=>{this.emit(be.TrackSubscriptionFailed,i,r,a)}).on(Ee.TrackSubscriptionPermissionChanged,(i,a)=>{this.emitWhenConnected(be.TrackSubscriptionPermissionChanged,i,a,r)}).on(Ee.Active,()=>{this.emitWhenConnected(be.ParticipantActive,r),r.kind===Bm.AGENT&&this.localParticipant.setActiveAgent(r)}),n&&r.updateInfo(n),r}sendSyncState(){const e=Array.from(this.remoteParticipants.values()).reduce((i,a)=>(i.push(...a.getTrackPublications()),i),[]),n=this.localParticipant.getTrackPublications(),r=this.outgoingDataTrackManager.queryPublished();this.engine.sendSyncState(e,n,r)}updateSubscriptions(){for(const e of this.remoteParticipants.values())for(const n of e.videoTrackPublications.values())n.isSubscribed&&xme(n)&&n.emitTrackUpdate()}getRemoteParticipantBySid(e){const n=this.sidToIdentity.get(e);if(n)return this.remoteParticipants.get(n)}registerConnectionReconcile(){this.clearConnectionReconcile();let e=0;this.connectionReconcileInterval=Vn.setInterval(()=>{!this.engine||this.engine.isClosed||!this.engine.verifyTransport()?(e++,this.log.warn("detected connection state mismatch",Object.assign(Object.assign({},this.logContext),{numFailures:e,engine:this.engine?{closed:this.engine.isClosed,transportsConnectedOrConnecting:this.engine.verifyTransport()}:void 0})),e>=3&&(this.recreateEngine(),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,Wa.STATE_MISMATCH))):e=0},eve)}clearConnectionReconcile(){this.connectionReconcileInterval&&Vn.clearInterval(this.connectionReconcileInterval)}setAndEmitConnectionState(e){return e===this.state?!1:(this.state=e,this.incomingDataStreamManager.setConnected(e===At.Connected),this.emit(be.ConnectionStateChanged,this.state),!0)}emitBufferedEvents(){this.bufferedEvents.forEach(e=>{let[n,r]=e;this.emit(n,...r)}),this.bufferedEvents=[]}emitWhenConnected(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];if(this.state===At.Reconnecting||this.isResuming||!this.engine||this.engine.pendingReconnect)this.bufferedEvents.push([e,r]);else if(this.state===At.Connected)return this.emit(e,...r);return!1}simulateParticipants(e){return F(this,void 0,void 0,function*(){var n,r,i,a;const s=Object.assign({audio:!0,video:!0,useRealTracks:!1},e.publish),o=Object.assign({count:9,audio:!1,video:!0,aspectRatios:[1.66,1.7,1.3]},e.participants);if(this.handleDisconnect(),this.roomInfo=new Sw({sid:"RM_SIMULATED",name:"simulated-room",emptyTimeout:0,maxParticipants:0,creationTime:mn.parse(new Date().getTime()),metadata:"",numParticipants:1,numPublishers:1,turnPassword:"",enabledCodecs:[],activeRecording:!1}),this.localParticipant.updateInfo(new lu({identity:"simulated-local",name:"local-name"})),this.setupLocalParticipantEvents(),this.emit(be.SignalConnected),this.emit(be.Connected),this.setAndEmitConnectionState(At.Connected),s.video){const c=new mT(fe.Kind.Video,new gd({source:Un.CAMERA,sid:Math.floor(Math.random()*1e4).toString(),type:Da.AUDIO,name:"video-dummy"}),new cb(s.useRealTracks&&(!((n=window.navigator.mediaDevices)===null||n===void 0)&&n.getUserMedia)?(yield window.navigator.mediaDevices.getUserMedia({video:!0})).getVideoTracks()[0]:g4(160*((r=o.aspectRatios[0])!==null&&r!==void 0?r:1),160,!0,!0),void 0,!1,{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext}),{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext});this.localParticipant.addTrackPublication(c),this.localParticipant.emit(Ee.LocalTrackPublished,c)}if(s.audio){const c=new mT(fe.Kind.Audio,new gd({source:Un.MICROPHONE,sid:Math.floor(Math.random()*1e4).toString(),type:Da.AUDIO}),new sb(s.useRealTracks&&(!((i=navigator.mediaDevices)===null||i===void 0)&&i.getUserMedia)?(yield navigator.mediaDevices.getUserMedia({audio:!0})).getAudioTracks()[0]:ek(),void 0,!1,this.audioContext,{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext}),{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext});this.localParticipant.addTrackPublication(c),this.localParticipant.emit(Ee.LocalTrackPublished,c)}for(let c=0;c<o.count-1;c+=1){let u=new lu({sid:Math.floor(Math.random()*1e4).toString(),identity:"simulated-".concat(c),state:Md.ACTIVE,tracks:[],joinedAt:mn.parse(Date.now())});const d=this.getOrCreateParticipant(u.identity,u);if(o.video){const h=g4(160*((a=o.aspectRatios[c%o.aspectRatios.length])!==null&&a!==void 0?a:1),160,!1,!0),f=new gd({source:Un.CAMERA,sid:Math.floor(Math.random()*1e4).toString(),type:Da.AUDIO});d.addSubscribedMediaTrack(h,f.sid,new MediaStream([h]),new RTCRtpReceiver),u.tracks=[...u.tracks,f]}if(o.audio){const h=ek(),f=new gd({source:Un.MICROPHONE,sid:Math.floor(Math.random()*1e4).toString(),type:Da.AUDIO});d.addSubscribedMediaTrack(h,f.sid,new MediaStream([h]),new RTCRtpReceiver),u.tracks=[...u.tracks,f]}d.updateInfo(u)}})}emit(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];if(e!==be.ActiveSpeakersChanged&&e!==be.TranscriptionReceived){const a=JW(r).filter(s=>s!==void 0);(e===be.TrackSubscribed||e===be.TrackUnsubscribed)&&this.log.trace("subscribe trace: ".concat(e),Object.assign(Object.assign({},this.logContext),{event:e,args:a})),this.log.debug("room event ".concat(e),Object.assign(Object.assign({},this.logContext),{event:e,args:a}))}return super.emit(e,...r)}}Gm.cleanupRegistry=typeof FinalizationRegistry<"u"&&new FinalizationRegistry(t=>{t()});function JW(t){return t.map(e=>{if(e)return Array.isArray(e)?JW(e):typeof e=="object"?"logContext"in e?e.logContext:void 0:e})}var Pa;(function(t){t[t.IDLE=0]="IDLE",t[t.RUNNING=1]="RUNNING",t[t.SKIPPED=2]="SKIPPED",t[t.SUCCESS=3]="SUCCESS",t[t.FAILED=4]="FAILED"})(Pa||(Pa={}));class Kc extends ca.EventEmitter{constructor(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};super(),this.status=Pa.IDLE,this.logs=[],this.options={},this.url=e,this.token=n,this.name=this.constructor.name,this.room=new Gm(r.roomOptions),this.connectOptions=r.connectOptions,this.options=r}run(e){return F(this,void 0,void 0,function*(){if(this.status!==Pa.IDLE)throw Error("check is running already");this.setStatus(Pa.RUNNING);try{yield this.perform()}catch(n){n instanceof Error&&(this.options.errorsAsWarnings?this.appendWarning(n.message):this.appendError(n.message))}return yield this.disconnect(),yield new Promise(n=>setTimeout(n,500)),this.status!==Pa.SKIPPED&&this.setStatus(this.isSuccess()?Pa.SUCCESS:Pa.FAILED),e&&e(),this.getInfo()})}isSuccess(){return!this.logs.some(e=>e.level==="error")}connect(e){return F(this,void 0,void 0,function*(){return this.room.state===At.Connected?this.room:(e||(e=this.url),yield this.room.connect(e,this.token,this.connectOptions),this.room)})}disconnect(){return F(this,void 0,void 0,function*(){this.room&&this.room.state!==At.Disconnected&&(yield this.room.disconnect(),yield new Promise(e=>setTimeout(e,500)))})}skip(){this.setStatus(Pa.SKIPPED)}switchProtocol(e){return F(this,void 0,void 0,function*(){let n=!1,r=!1;if(this.room.on(be.Reconnecting,()=>{n=!0}),this.room.once(be.Reconnected,()=>{r=!0}),this.room.simulateScenario("force-".concat(e)),yield new Promise(a=>setTimeout(a,1e3)),!n)return;const i=Date.now()+1e4;for(;Date.now()<i;){if(r)return;yield Nr(100)}throw new Error("Could not reconnect using ".concat(e," protocol after 10 seconds"))})}appendMessage(e){this.logs.push({level:"info",message:e}),this.emit("update",this.getInfo())}appendWarning(e){this.logs.push({level:"warning",message:e}),this.emit("update",this.getInfo())}appendError(e){this.logs.push({level:"error",message:e}),this.emit("update",this.getInfo())}setStatus(e){this.status=e,this.emit("update",this.getInfo())}get engine(){var e;return(e=this.room)===null||e===void 0?void 0:e.engine}getInfo(){return{logs:this.logs,name:this.name,status:this.status,description:this.description}}}class tve extends Kc{get description(){return"Cloud regions"}perform(){return F(this,void 0,void 0,function*(){const e=new Tt(this.url,this.token);if(!e.isCloud()){this.skip();return}const n=[],r=new Set;for(let a=0;a<3;a++){const s=yield e.getNextBestRegionUrl();if(!s)break;if(r.has(s))continue;r.add(s);const o=yield this.checkCloudRegion(s);this.appendMessage("".concat(o.region," RTT: ").concat(o.rtt,"ms, duration: ").concat(o.duration,"ms")),n.push(o)}n.sort((a,s)=>(a.duration-s.duration)*.5+(a.rtt-s.rtt)*.5);const i=n[0];this.bestStats=i,this.appendMessage("best Cloud region: ".concat(i.region))})}getInfo(){const e=super.getInfo();return e.data=this.bestStats,e}checkCloudRegion(e){return F(this,void 0,void 0,function*(){var n,r;yield this.connect(e),this.options.protocol==="tcp"&&(yield this.switchProtocol("tcp"));const i=(n=this.room.serverInfo)===null||n===void 0?void 0:n.region;if(!i)throw new Error("Region not found");const a=yield this.room.localParticipant.streamText({topic:"test"}),s=1e3,c=1e6/s,u="A".repeat(s),d=Date.now();for(let g=0;g<c;g++)yield a.write(u);yield a.close();const h=Date.now(),f=yield(r=this.room.engine.pcManager)===null||r===void 0?void 0:r.publisher.getStats(),p={region:i,rtt:1e4,duration:h-d};return f==null||f.forEach(g=>{g.type==="candidate-pair"&&g.nominated&&(p.rtt=g.currentRoundTripTime*1e3)}),yield this.disconnect(),p})}}const dk=1e4;class nve extends Kc{get description(){return"Connection via UDP vs TCP"}perform(){return F(this,void 0,void 0,function*(){const e=yield this.checkConnectionProtocol("udp"),n=yield this.checkConnectionProtocol("tcp");this.bestStats=e,e.qualityLimitationDurations.bandwidth-n.qualityLimitationDurations.bandwidth>.5||(e.packetsLost-n.packetsLost)/e.packetsSent>.01?(this.appendMessage("best connection quality via tcp"),this.bestStats=n):this.appendMessage("best connection quality via udp");const r=this.bestStats;this.appendMessage("upstream bitrate: ".concat((r.bitrateTotal/r.count/1e3/1e3).toFixed(2)," mbps")),this.appendMessage("RTT: ".concat((r.rttTotal/r.count*1e3).toFixed(2)," ms")),this.appendMessage("jitter: ".concat((r.jitterTotal/r.count*1e3).toFixed(2)," ms")),r.packetsLost>0&&this.appendWarning("packets lost: ".concat((r.packetsLost/r.packetsSent*100).toFixed(2),"%")),r.qualityLimitationDurations.bandwidth>1&&this.appendWarning("bandwidth limited ".concat((r.qualityLimitationDurations.bandwidth/(dk/1e3)*100).toFixed(2),"%")),r.qualityLimitationDurations.cpu>0&&this.appendWarning("cpu limited ".concat((r.qualityLimitationDurations.cpu/(dk/1e3)*100).toFixed(2),"%"))})}getInfo(){const e=super.getInfo();return e.data=this.bestStats,e}checkConnectionProtocol(e){return F(this,void 0,void 0,function*(){yield this.connect(),e==="tcp"?yield this.switchProtocol("tcp"):yield this.switchProtocol("udp");const n=document.createElement("canvas");n.width=1280,n.height=720;const r=n.getContext("2d");if(!r)throw new Error("Could not get canvas context");let i=0;const a=()=>{i=(i+1)%360,r.fillStyle="hsl(".concat(i,", 100%, 50%)"),r.fillRect(0,0,n.width,n.height),requestAnimationFrame(a)};a();const o=n.captureStream(30).getVideoTracks()[0],u=(yield this.room.localParticipant.publishTrack(o,{simulcast:!1,degradationPreference:"maintain-resolution",videoEncoding:{maxBitrate:2e6}})).track,d={protocol:e,packetsLost:0,packetsSent:0,qualityLimitationDurations:{},rttTotal:0,jitterTotal:0,bitrateTotal:0,count:0},h=setInterval(()=>F(this,void 0,void 0,function*(){const f=yield u.getRTCStatsReport();f==null||f.forEach(p=>{p.type==="outbound-rtp"?(d.packetsSent=p.packetsSent,d.qualityLimitationDurations=p.qualityLimitationDurations,d.bitrateTotal+=p.targetBitrate,d.count++):p.type==="remote-inbound-rtp"&&(d.packetsLost=p.packetsLost,d.rttTotal+=p.roundTripTime,d.jitterTotal+=p.jitter)})}),1e3);return yield new Promise(f=>setTimeout(f,dk)),clearInterval(h),o.stop(),n.remove(),yield this.disconnect(),d})}}class rve extends Kc{get description(){return"Can publish audio"}perform(){return F(this,void 0,void 0,function*(){var e;const n=yield this.connect(),r=yield Gge();if(yield _W(r,1e3))throw new Error("unable to detect audio from microphone");this.appendMessage("detected audio from microphone"),n.localParticipant.publishTrack(r),yield new Promise(o=>setTimeout(o,3e3));const a=yield(e=r.sender)===null||e===void 0?void 0:e.getStats();if(!a)throw new Error("Could not get RTCStats");let s=0;if(a.forEach(o=>{o.type==="outbound-rtp"&&(o.kind==="audio"||!o.kind&&o.mediaType==="audio")&&(s=o.packetsSent)}),s===0)throw new Error("Could not determine packets are sent");this.appendMessage("published ".concat(s," audio packets"))})}}class ive extends Kc{get description(){return"Can publish video"}perform(){return F(this,void 0,void 0,function*(){var e;const n=yield this.connect(),r=yield Kge();yield this.checkForVideo(r.mediaStreamTrack),n.localParticipant.publishTrack(r),yield new Promise(s=>setTimeout(s,5e3));const i=yield(e=r.sender)===null||e===void 0?void 0:e.getStats();if(!i)throw new Error("Could not get RTCStats");let a=0;if(i.forEach(s=>{s.type==="outbound-rtp"&&(s.kind==="video"||!s.kind&&s.mediaType==="video")&&(a+=s.packetsSent)}),a===0)throw new Error("Could not determine packets are sent");this.appendMessage("published ".concat(a," video packets"))})}checkForVideo(e){return F(this,void 0,void 0,function*(){const n=new MediaStream;n.addTrack(e.clone());const r=document.createElement("video");
700r.srcObject=n,r.muted=!0,r.autoplay=!0,r.playsInline=!0,r.setAttribute("playsinline","true"),document.body.appendChild(r),yield new Promise(i=>{r.onplay=()=>{setTimeout(()=>{var a,s,o,c;const u=document.createElement("canvas"),d=e.getSettings(),h=(s=(a=d.width)!==null&&a!==void 0?a:r.videoWidth)!==null&&s!==void 0?s:1280,f=(c=(o=d.height)!==null&&o!==void 0?o:r.videoHeight)!==null&&c!==void 0?c:720;u.width=h,u.height=f;const p=u.getContext("2d");p.drawImage(r,0,0);const m=p.getImageData(0,0,u.width,u.height).data;let v=!0;for(let x=0;x<m.length;x+=4)if(m[x]!==0||m[x+1]!==0||m[x+2]!==0){v=!1;break}v?this.appendError("camera appears to be producing only black frames"):this.appendMessage("received video frames"),i()},1e3)},r.play()}),n.getTracks().forEach(i=>i.stop()),r.remove()})}}class ave extends Kc{get description(){return"Resuming connection after interruption"}perform(){return F(this,void 0,void 0,function*(){var e;const n=yield this.connect();let r=!1,i=!1,a;const s=new Promise(u=>{setTimeout(u,5e3),a=u}),o=()=>{r=!0};n.on(be.SignalReconnecting,o).on(be.Reconnecting,o).on(be.Reconnected,()=>{i=!0,a(!0)}),(e=n.engine.client.ws)===null||e===void 0||e.close();const c=n.engine.client.onClose;if(c&&c(""),yield s,r){if(!i||n.state!==At.Connected)throw this.appendWarning("reconnection is only possible in Redis-based configurations"),new Error("Not able to reconnect")}else throw new Error("Did not attempt to reconnect")})}}class sve extends Kc{get description(){return"Can connect via TURN"}perform(){return F(this,void 0,void 0,function*(){var e,n,r;jh(new URL(this.url))&&(this.appendMessage("Using region specific url"),this.url=(e=yield new Tt(this.url,this.token).getNextBestRegionUrl())!==null&&e!==void 0?e:this.url);const i=new EP,a=yield i.join(this.url,this.token,{autoSubscribe:!0,maxRetries:0,e2eeEnabled:!1,websocketTimeout:15e3},void 0,!0);let s=!1,o=!1,c=!1;for(let u of a.iceServers)for(let d of u.urls)d.startsWith("turn:")?(o=!0,c=!0):d.startsWith("turns:")&&(o=!0,c=!0,s=!0),d.startsWith("stun:")&&(c=!0);c?o&&!s&&this.appendWarning("TURN is configured server side, but TURN/TLS is unavailable."):this.appendWarning("No STUN servers configured on server side."),yield i.close(),!((r=(n=this.connectOptions)===null||n===void 0?void 0:n.rtcConfig)===null||r===void 0)&&r.iceServers||o?yield this.room.connect(this.url,this.token,{rtcConfig:{iceTransportPolicy:"relay"}}):(this.appendWarning("No TURN servers configured."),this.skip(),yield new Promise(u=>setTimeout(u,0)))})}}class ove extends Kc{get description(){return"Establishing WebRTC connection"}perform(){return F(this,void 0,void 0,function*(){let e=!1,n=!1;this.room.on(be.SignalConnected,()=>{var r;const i=this.room.engine.client.onTrickle;this.room.engine.client.onTrickle=(a,s)=>{if(a.candidate){const o=new RTCIceCandidate(a);let c="".concat(o.protocol," ").concat(o.address,":").concat(o.port," ").concat(o.type);o.address&&(cve(o.address)?c+=" (private)":o.protocol==="tcp"&&o.tcpType==="passive"?(e=!0,c+=" (passive)"):o.protocol==="udp"&&(n=!0)),this.appendMessage(c)}i&&i(a,s)},!((r=this.room.engine.pcManager)===null||r===void 0)&&r.subscriber&&(this.room.engine.pcManager.subscriber.onIceCandidateError=a=>{a instanceof RTCPeerConnectionIceErrorEvent&&this.appendWarning("error with ICE candidate: ".concat(a.errorCode," ").concat(a.errorText," ").concat(a.url))})});try{yield this.connect(),ft.info("now the room is connected")}catch(r){throw this.appendWarning("ports need to be open on firewall in order to connect."),r}e||this.appendWarning("Server is not configured for ICE/TCP"),n||this.appendWarning("No public IPv4 UDP candidates were found. Your server is likely not configured correctly")})}}function cve(t){const e=t.split(".");if(e.length===4){if(e[0]==="10")return!0;if(e[0]==="192"&&e[1]==="168")return!0;if(e[0]==="172"){const n=parseInt(e[1],10);if(n>=16&&n<=31)return!0}}return!1}class lve extends Kc{get description(){return"Connecting to signal connection via WebSocket"}perform(){return F(this,void 0,void 0,function*(){var e,n,r;(this.url.startsWith("ws:")||this.url.startsWith("http:"))&&this.appendWarning("Server is insecure, clients may block connections to it");let i=new EP,a;try{a=yield i.join(this.url,this.token,{autoSubscribe:!0,maxRetries:0,e2eeEnabled:!1,websocketTimeout:15e3},void 0,!0)}catch(s){if(jh(new URL(this.url))){this.appendMessage("Initial connection failed with error ".concat(s.message,". Retrying with region fallback"));const c=yield new Tt(this.url,this.token).getNextBestRegionUrl();c&&(a=yield i.join(c,this.token,{autoSubscribe:!0,maxRetries:0,e2eeEnabled:!1,websocketTimeout:15e3},void 0,!0),this.appendMessage("Fallback to region worked. To avoid initial connections failing, ensure you're calling room.prepareConnection() ahead of time"))}}a?(this.appendMessage("Connected to server, version ".concat(a.serverVersion,".")),((e=a.serverInfo)===null||e===void 0?void 0:e.edition)===_z.Cloud&&(!((n=a.serverInfo)===null||n===void 0)&&n.region)&&this.appendMessage("LiveKit Cloud: ".concat((r=a.serverInfo)===null||r===void 0?void 0:r.region))):this.appendError("Websocket connection could not be established"),yield i.close()})}}class gBe extends ca.EventEmitter{constructor(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};super(),this.options={},this.checkResults=new Map,this.url=e,this.token=n,this.options=r}getNextCheckId(){const e=this.checkResults.size;return this.checkResults.set(e,{logs:[],status:Pa.IDLE,name:"",description:""}),e}
700updateCheck(e,n){this.checkResults.set(e,n),this.emit("checkUpdate",e,n)}isSuccess(){return Array.from(this.checkResults.values()).every(e=>e.status!==Pa.FAILED)}getResults(){return Array.from(this.checkResults.values())}createAndRunCheck(e){return F(this,void 0,void 0,function*(){const n=this.getNextCheckId(),r=new e(this.url,this.token,this.options),i=s=>{this.updateCheck(n,s)};r.on("update",i);const a=yield r.run();return r.off("update",i),a})}checkWebsocket(){return F(this,void 0,void 0,function*(){return this.createAndRunCheck(lve)})}checkWebRTC(){return F(this,void 0,void 0,function*(){return this.createAndRunCheck(ove)})}checkTURN(){return F(this,void 0,void 0,function*(){return this.createAndRunCheck(sve)})}checkReconnect(){return F(this,void 0,void 0,function*(){return this.createAndRunCheck(ave)})}checkPublishAudio(){return F(this,void 0,void 0,function*(){return this.createAndRunCheck(rve)})}checkPublishVideo(){return F(this,void 0,void 0,function*(){return this.createAndRunCheck(ive)})}checkConnectionProtocol(){return F(this,void 0,void 0,function*(){const e=yield this.createAndRunCheck(nve);if(e.data&&"protocol"in e.data){const n=e.data;this.options.protocol=n.protocol}return e})}checkCloudRegion(){return F(this,void 0,void 0,function*(){return this.createAndRunCheck(tve)})}}function kt(t,e,n){return(e=dve(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function uve(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function dve(t){var e=uve(t,"string");return typeof e=="symbol"?e:e+""}new TextEncoder;new TextDecoder;class Jr extends Error{constructor(e,n){var r;super(e,n),kt(this,"code","ERR_JOSE_GENERIC"),this.name=this.constructor.name,(r=Error.captureStackTrace)===null||r===void 0||r.call(Error,this,this.constructor)}}
700kt(Jr,"code","ERR_JOSE_GENERIC");class hve extends Jr{constructor(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"unspecified",i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unspecified";super(e,{cause:{claim:r,reason:i,payload:n}}),kt(this,"code","ERR_JWT_CLAIM_VALIDATION_FAILED"),kt(this,"claim",void 0),kt(this,"reason",void 0),kt(this,"payload",void 0),this.claim=r,this.reason=i,this.payload=n}}kt(hve,"code","ERR_JWT_CLAIM_VALIDATION_FAILED");class fve extends Jr{constructor(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"unspecified",i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unspecified";super(e,{cause:{claim:r,reason:i,payload:n}}),kt(this,"code","ERR_JWT_EXPIRED"),kt(this,"claim",void 0),kt(this,"reason",void 0),kt(this,"payload",void 0),this.claim=r,this.reason=i,this.payload=n}}kt(fve,"code","ERR_JWT_EXPIRED");class pve extends Jr{constructor(){super(...arguments),kt(this,"code","ERR_JOSE_ALG_NOT_ALLOWED")}}kt(pve,"code","ERR_JOSE_ALG_NOT_ALLOWED");class mve extends Jr{constructor(){super(...arguments),kt(this,"code","ERR_JOSE_NOT_SUPPORTED")}}kt(mve,"code","ERR_JOSE_NOT_SUPPORTED");class gve extends Jr{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"decryption operation failed",n=arguments.length>1?arguments[1]:void 0;super(e,n),kt(this,"code","ERR_JWE_DECRYPTION_FAILED")}}kt(gve,"code","ERR_JWE_DECRYPTION_FAILED");class vve extends Jr{constructor(){super(...arguments),kt(this,"code","ERR_JWE_INVALID")}}kt(vve,"code","ERR_JWE_INVALID");class yve extends Jr{constructor(){super(...arguments),kt(this,"code","ERR_JWS_INVALID")}}kt(yve,"code","ERR_JWS_INVALID");class bve extends Jr{constructor(){super(...arguments),kt(this,"code","ERR_JWT_INVALID")}}kt(bve,"code","ERR_JWT_INVALID");class xve extends Jr{constructor(){super(...arguments),kt(this,"code","ERR_JWK_INVALID")}}kt(xve,"code","ERR_JWK_INVALID");class wve extends Jr{constructor(){super(...arguments),kt(this,"code","ERR_JWKS_INVALID")}}kt(wve,"code","ERR_JWKS_INVALID");class Sve extends Jr{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"no applicable key found in the JSON Web Key Set",n=arguments.length>1?arguments[1]:void 0;super(e,n),kt(this,"code","ERR_JWKS_NO_MATCHING_KEY")}}kt(Sve,"code","ERR_JWKS_NO_MATCHING_KEY");class kve extends Jr{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"multiple matching keys found in the JSON Web Key Set",n=arguments.length>1?arguments[1]:void 0;super(e,n),kt(this,Symbol.asyncIterator,void 0),kt(this,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS")}}kt(kve,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS");class _ve extends Jr{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"request timed out",n=arguments.length>1?arguments[1]:void 0;super(e,n),kt(this,"code","ERR_JWKS_TIMEOUT")}}kt(_ve,"code","ERR_JWKS_TIMEOUT");class Cve extends Jr{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"signature verification failed",n=arguments.length>1?arguments[1]:void 0;super(e,n),kt(this,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED")}}kt(Cve,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED");const oy=new Map;function Tve(t,e){return async(n,r)=>{const i=oy.get(t);if(i)return n.addModule(i);if(r)try{return await n.addModule(r),void oy.set(t,r)}catch(o){throw new Error(`Failed to load the ${t} worklet module from path: ${r}. Error: ${o}`)}const a=new Blob([e],{type:"application/javascript"}),s=URL.createObjectURL(a);try{return await n.addModule(s),void oy.set(t,s)}catch{URL.revokeObjectURL(s)}try{const o=`data:application/javascript;base64,${btoa(e)}`;await n.addModule(o),oy.set(t,o)}catch{throw new Error(`Failed to load the ${t} worklet module. Make sure the browser supports AudioWorklets. If you are using a strict CSP, you may need to self-host the worklet files.`)}}}let Eve=class{constructor(){this.listeners=new Map}on(e,n){this.listeners.has(e)||this.listeners.set(e,new Set);const r=this.listeners.get(e);r&&r.add(n)}off(e,n){const r=this.listeners.get(e);r&&r.delete(n)}emit(e,...n){const r=this.listeners.get(e);r&&r.forEach(i=>
700{i(...n)})}};var qe;(function(t){t.SESSION_STARTED="session_started",t.PARTIAL_TRANSCRIPT="partial_transcript",t.COMMITTED_TRANSCRIPT="committed_transcript",t.COMMITTED_TRANSCRIPT_WITH_TIMESTAMPS="committed_transcript_with_timestamps",t.AUTH_ERROR="auth_error",t.ERROR="error",t.OPEN="open",t.CLOSE="close",t.QUOTA_EXCEEDED="quota_exceeded",t.COMMIT_THROTTLED="commit_throttled",t.TRANSCRIBER_ERROR="transcriber_error",t.UNACCEPTED_TERMS="unaccepted_terms",t.RATE_LIMITED="rate_limited",t.INPUT_ERROR="input_error",t.QUEUE_OVERFLOW="queue_overflow",t.RESOURCE_EXHAUSTED="resource_exhausted",t.SESSION_TIME_LIMIT_EXCEEDED="session_time_limit_exceeded",t.CHUNK_SIZE_EXCEEDED="chunk_size_exceeded",t.INSUFFICIENT_AUDIO_ACTIVITY="insufficient_audio_activity"})(qe||(qe={}));class jve{constructor(e){this.websocket=null,this.eventEmitter=new Eve,this.currentSampleRate=16e3,this._audioCleanup=void 0,this.currentSampleRate=e}setWebSocket(e){this.websocket=e,this.websocket.readyState===WebSocket.OPEN?this.eventEmitter.emit(qe.OPEN):this.websocket.addEventListener("open",()=>{this.eventEmitter.emit(qe.OPEN)}),this.websocket.addEventListener("message",n=>{try{const r=JSON.parse(n.data);switch(r.message_type){case"session_started":this.eventEmitter.emit(qe.SESSION_STARTED,r);break;case"partial_transcript":this.eventEmitter.emit(qe.PARTIAL_TRANSCRIPT,r);break;case"committed_transcript":this.eventEmitter.emit(qe.COMMITTED_TRANSCRIPT,r);break;case"committed_transcript_with_timestamps":this.eventEmitter.emit(qe.COMMITTED_TRANSCRIPT_WITH_TIMESTAMPS,r);break;case"auth_error":this.eventEmitter.emit(qe.AUTH_ERROR,r),this.eventEmitter.emit(qe.ERROR,r);break;case"quota_exceeded":this.eventEmitter.emit(qe.QUOTA_EXCEEDED,r),this.eventEmitter.emit(qe.ERROR,r);break;case"commit_throttled":this.eventEmitter.emit(qe.COMMIT_THROTTLED,r),this.eventEmitter.emit(qe.ERROR,r);break;case"transcriber_error":this.eventEmitter.emit(qe.TRANSCRIBER_ERROR,r),this.eventEmitter.emit(qe.ERROR,r);break;case"unaccepted_terms":this.eventEmitter.emit(qe.UNACCEPTED_TERMS,r),this.eventEmitter.emit(qe.ERROR,r);break;case"rate_limited":this.eventEmitter.emit(qe.RATE_LIMITED,r),this.eventEmitter.emit(qe.ERROR,r);break;case"input_error":this.eventEmitter.emit(qe.INPUT_ERROR,r),this.eventEmitter.emit(qe.ERROR,r);break;case"queue_overflow":this.eventEmitter.emit(qe.QUEUE_OVERFLOW,r),this.eventEmitter.emit(qe.ERROR,r);break;case"resource_exhausted":this.eventEmitter.emit(qe.RESOURCE_EXHAUSTED,r),this.eventEmitter.emit(qe.ERROR,r);break;case"session_time_limit_exceeded":this.eventEmitter.emit(qe.SESSION_TIME_LIMIT_EXCEEDED,r),this.eventEmitter.emit(qe.ERROR,r);break;case"chunk_size_exceeded":this.eventEmitter.emit(qe.CHUNK_SIZE_EXCEEDED,r),this.eventEmitter.emit(qe.ERROR,r);break;case"insufficient_audio_activity":this.eventEmitter.emit(qe.INSUFFICIENT_AUDIO_ACTIVITY,r),this.eventEmitter.emit(qe.ERROR,r);break;case"error":this.eventEmitter.emit(qe.ERROR,r);break;default:console.warn("Unknown message type:",r)}}catch(r){console.error("Failed to parse WebSocket message:",r,n.data),this.eventEmitter.emit(qe.ERROR,new Error(`Failed to parse message: ${r}`))}}),this.websocket.addEventListener("error",n=>{console.error("WebSocket error:",n),this.eventEmitter.emit(qe.ERROR,n)}),this.websocket.addEventListener("close",n=>{if(console.log(`WebSocket closed: code=${n.code}, reason="${n.reason}", wasClean=${n.wasClean}`),!n.wasClean||n.code!==1e3&&n.code!==1005){const r=`WebSocket closed unexpectedly: ${n.code} - ${n.reason||"No reason provided"}`;console.error(r),this.eventEmitter.emit(qe.ERROR,new Error(r))}this.eventEmitter.emit(qe.CLOSE,n)})}on(e,n){this.eventEmitter.on(e,n)}off(e,n){this.eventEmitter.off(e,n)}send(e){var n,r;if(!this.websocket||this.websocket.readyState!==WebSocket.OPEN)throw new Error("WebSocket is not connected");const i={message_type:"input_audio_chunk",audio_base_64:e.audioBase64,commit:(n=e.commit)!=null&&n,sample_rate:(r=e.sampleRate)!=null?r:this.currentSampleRate,previous_text:e.previousText};this.websocket.send(JSON.stringify(i))}commit(){if(!this.websocket||this.websocket.readyState!==WebSocket.OPEN)throw new Error("WebSocket is not connected");this.websocket.send(JSON.stringify({message_type:"input_audio_chunk",audio_base_64:"",commit:!0,sample_rate:this.currentSampleRate}))}close(){this._audioCleanup&&this._audioCleanup(),this.websocket&&this.websocket.close(1e3,"User ended session")}}const Pve=Tve("scribeAudioProcessor",`/* 701 * Scribe Audio Processor for converting microphone audio to PCM16 format 702 * Supports resampling for browsers like Firefox that don't support 703 * AudioContext sample rate constraints. 704 * USED BY @elevenlabs/client 705 */ 706 707class ScribeAudioProcessor extends AudioWorkletProcessor { 708 constructor() { 709 super(); 710 this.buffer = []; 711 this.bufferSize = 4096; // Buffer size for optimal chunk transmission 712 713 // Resampling state 714 this.inputSampleRate = null; 715 this.outputSampleRate = null; 716 this.resampleRatio = 1; 717 this.lastSample = 0; 718 this.resampleAccumulator = 0; 719 720 this.port.onmessage = ({ data }) => { 721 if (data.type === "configure") { 722 this.inputSampleRate = data.inputSampleRate; 723 this.outputSampleRate = data.outputSampleRate; 724 if (this.inputSampleRate && this.outputSampleRate) { 725 this.resampleRatio = this.inputSampleRate / this.outputSampleRate; 726 } 727 } 728 }; 729 } 730 731 // Linear interpolation resampling 732 resample(inputData) { 733 if (this.resampleRatio === 1 || !this.inputSampleRate) { 734 return inputData; 735 } 736 737 const outputSamples = []; 738 739 for (let i = 0; i < inputData.length; i++) { 740 const currentSample = inputData[i]; 741 742 // Generate output samples using linear interpolation 743 while (this.resampleAccumulator < 1) { 744 const interpolated = 745 this.lastSample + 746 (currentSample - this.lastSample) * this.resampleAccumulator; 747 outputSamples.push(interpolated); 748 this.resampleAccumulator += this.resampleRatio; 749 } 750 751 this.resampleAccumulator -= 1; 752 this.lastSample = currentSample; 753 } 754 755 return new Float32Array(outputSamples); 756 } 757 758 process(inputs) { 759 const input = inputs[0]; 760 if (input.length > 0) { 761 let channelData = input[0]; // Get first channel (mono) 762 763 // Resample if needed (for Firefox and other browsers that don't 764 // support AudioContext sample rate constraints) 765 if (this.resampleRatio !== 1) { 766 channelData = this.resample(channelData); 767 } 768 769 // Add incoming audio to buffer 770 for (let i = 0; i < channelData.length; i++) { 771 this.buffer.push(channelData[i]); 772 } 773 774 // When buffer reaches threshold, convert and send 775 if (this.buffer.length >= this.bufferSize) { 776 const float32Array = new Float32Array(this.buffer); 777 const int16Array = new Int16Array(float32Array.length); 778 779 // Convert Float32 [-1, 1] to Int16 [-32768, 32767] 780 for (let i = 0; i < float32Array.length; i++) { 781 // Clamp the value to prevent overflow 782 const sample = Math.max(-1, Math.min(1, float32Array[i])); 783 // Scale to PCM16 range 784 int16Array[i] = sample < 0 ? sample * 32768 : sample * 32767; 785 } 786 787 // Send to main thread as transferable ArrayBuffer 788 this.port.postMessage( 789 { 790 audioData: int16Array.buffer 791 }, 792 [int16Array.buffer] 793 ); 794 795 // Clear buffer 796 this.buffer = []; 797 } 798 } 799 800 return true; // Continue processing 801 } 802} 803 804registerProcessor("scribeAudioProcessor", ScribeAudioProcessor); 805 806`);var Q4,eM;(function(t){t.PCM_8000="pcm_8000",t.PCM_16000="pcm_16000",t.PCM_22050="pcm_22050",t.PCM_24000="pcm_24000",t.PCM_44100="pcm_44100",t.PCM_48000="pcm_48
806000",t.ULAW_8000="ulaw_8000"})(Q4||(Q4={})),function(t){t.MANUAL="manual",t.VAD="vad"}(eM||(eM={}));class oc{static getWebSocketUri(e=oc.DEFAULT_BASE_URI){return`${e}/v1/speech-to-text/realtime`}static buildWebSocketUri(e){const n=oc.getWebSocketUri(e.baseUri),r=new URLSearchParams;if(r.append("model_id",e.modelId),r.append("token",e.token),e.commitStrategy!==void 0&&r.append("commit_strategy",e.commitStrategy),e.audioFormat!==void 0&&r.append("audio_format",e.audioFormat),e.vadSilenceThresholdSecs!==void 0){if(e.vadSilenceThresholdSecs<=.3||e.vadSilenceThresholdSecs>3)throw new Error("vadSilenceThresholdSecs must be between 0.3 and 3.0");r.append("vad_silence_threshold_secs",e.vadSilenceThresholdSecs.toString())}if(e.vadThreshold!==void 0){if(e.vadThreshold<.1||e.vadThreshold>.9)throw new Error("vadThreshold must be between 0.1 and 0.9");r.append("vad_threshold",e.vadThreshold.toString())}if(e.minSpeechDurationMs!==void 0){if(e.minSpeechDurationMs<=50||e.minSpeechDurationMs>2e3)throw new Error("minSpeechDurationMs must be between 50 and 2000");r.append("min_speech_duration_ms",e.minSpeechDurationMs.toString())}if(e.minSilenceDurationMs!==void 0){if(e.minSilenceDurationMs<=50||e.minSilenceDurationMs>2e3)throw new Error("minSilenceDurationMs must be between 50 and 2000");r.append("min_silence_duration_ms",e.minSilenceDurationMs.toString())}e.languageCode!==void 0&&r.append("language_code",e.languageCode),e.includeTimestamps!==void 0&&r.append("include_timestamps",e.includeTimestamps?"true":"false");const i=r.toString();return i?`${n}?${i}`:n}static connect(e){if(!e.modelId)throw new Error("modelId is required");const n=new jve("microphone"in e&&e.microphone?16e3:e.sampleRate),r=oc.buildWebSocketUri(e),i=new WebSocket(r);return"microphone"in e&&e.microphone&&i.addEventListener("open",()=>{oc.streamFromMicrophone(e,n)}),n.setWebSocket(i),n}static async streamFromMicrophone(e,n){try{var i,a,s,o,c,u,d,h,f,p;const g=await navigator.mediaDevices.getUserMedia({audio:{deviceId:(i=e.microphone)==null?void 0:i.deviceId,echoCancellation:(a=(s=e.microphone)==null?void 0:s.echoCancellation)==null||a,noiseSuppression:(o=(c=e.microphone)==null?void 0:c.noiseSuppression)==null||o,autoGainControl:(u=(d=e.microphone)==null?void 0:d.autoGainControl)==null||u,channelCount:(h=(f=e.microphone)==null?void 0:f.channelCount)!=null?h:1,sampleRate:{ideal:16e3}}}),m=(p=g.getAudioTracks()[0])==null?void 0:p.getSettings(),v=m==null?void 0:m.sampleRate,x=new AudioContext(v?{sampleRate:v}:{});await Pve(x.audioWorklet);const w=x.createMediaStreamSource(g),y=new AudioWorkletNode(x,"scribeAudioProcessor");x.sampleRate!==16e3&&y.port.postMessage({type:"configure",inputSampleRate:x.sampleRate,outputSampleRate:16e3}),y.port.onmessage=k=>{const{audioData:S}=k.data,_=new Uint8Array(S);let C="";for(let E=0;E<_.length;E++)C+=String.fromCharCode(_[E]);const T=btoa(C);n.send({audioBase64:T})},w.connect(y),x.state==="suspended"&&await x.resume(),n._audioCleanup=()=>{g.getTracks().forEach(k=>{k.stop()}),w.disconnect(),y.disconnect(),x.close()}}catch(g){throw console.error("Failed to start microphone streaming:",g),g}}}oc.DEFAULT_BASE_URI="wss://api.elevenlabs.io";function gT(){return gT=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},gT.apply(null,arguments)}function Nve(t={}){const{onSessionStarted:e,onPartialTranscript:n,onCommittedTranscript:r,onCommittedTranscriptWithTimestamps:i,onError:a,onAuthError:s,onQuotaExceededError:o,onCommitThrottledError:c,onTranscriberError:u,onUnacceptedTermsError:d,onRateLimitedError:h,onInputError:f,onQueueOverflowError:p,onResourceExhaustedError:g,onSessionTimeLimitExceededError:m,onChunkSizeExceededError:v,onInsufficientAudioActivityError:x,onConnect:w,onDisconnect:y,token:k,modelId:S,baseUri:_,commitStrategy:C,vadSilenceThresholdSecs:T,vadThreshold:E,minSpeechDurationMs:j,minSilenceDurationMs:P,languageCode:M,microphone:U,audioFormat:N,sampleRate:B,autoConnect:$=!1,includeTimestamps:I}=t,R=b.useRef(null),[z,O]=b.useState("disconnected"),[A,L]=b.useState(""),[V,Y]=b.useState([]),[Q,re]=b.useState(null);b.useEffect(()=>()=>{var oe;(oe=R.current)==null||oe.close()},[]);const J=b.useCallback(async(oe={})=>
806{if(R.current)console.warn("Already connected");else try{var W,H;O("connecting"),re(null);const q=oe.token||k,te=oe.modelId||S;if(!q)throw new Error("Token is required");if(!te)throw new Error("Model ID is required");const he=oe.microphone||U,xe=oe.audioFormat||N,De=oe.sampleRate||B;let ge;const Re=(W=(H=oe.includeTimestamps)!=null?H:I)!=null?W:!(!oe.onCommittedTranscriptWithTimestamps&&!i);if(he)ge=oc.connect({token:q,modelId:te,baseUri:oe.baseUri||_,commitStrategy:oe.commitStrategy||C,vadSilenceThresholdSecs:oe.vadSilenceThresholdSecs||T,vadThreshold:oe.vadThreshold||E,minSpeechDurationMs:oe.minSpeechDurationMs||j,minSilenceDurationMs:oe.minSilenceDurationMs||P,languageCode:oe.languageCode||M,microphone:he,includeTimestamps:Re});else{if(!xe||!De)throw new Error("Either microphone options or (audioFormat + sampleRate) must be provided");ge=oc.connect({token:q,modelId:te,baseUri:oe.baseUri||_,commitStrategy:oe.commitStrategy||C,vadSilenceThresholdSecs:oe.vadSilenceThresholdSecs||T,vadThreshold:oe.vadThreshold||E,minSpeechDurationMs:oe.minSpeechDurationMs||j,minSilenceDurationMs:oe.minSilenceDurationMs||P,languageCode:oe.languageCode||M,includeTimestamps:Re,audioFormat:xe,sampleRate:De})}R.current=ge,ge.on(qe.SESSION_STARTED,()=>{O("connected"),e==null||e()}),ge.on(qe.PARTIAL_TRANSCRIPT,Oe=>{const ye=Oe;L(ye.text),O("transcribing"),n==null||n(ye)}),ge.on(qe.COMMITTED_TRANSCRIPT,Oe=>{const ye=Oe,Ct={id:`${Date.now()}-${Math.random()}`,text:ye.text,timestamp:Date.now(),isFinal:!0};Y(le=>[...le,Ct]),L(""),r==null||r(ye)}),ge.on(qe.COMMITTED_TRANSCRIPT_WITH_TIMESTAMPS,Oe=>{const ye=Oe,Ct={id:`${Date.now()}-${Math.random()}`,text:ye.text,timestamp:Date.now(),isFinal:!0,words:ye.words};Y(le=>[...le,Ct]),L(""),i==null||i(ye)}),ge.on(qe.ERROR,Oe=>{const ye=Oe;re(ye.error),O("error"),a==null||a(new Error(ye.error))}),ge.on(qe.AUTH_ERROR,Oe=>{const ye=Oe;re(ye.error),O("error"),s==null||s(ye)}),ge.on(qe.QUOTA_EXCEEDED,Oe=>{const ye=Oe;re(ye.error),O("error"),o==null||o(ye)}),ge.on(qe.COMMIT_THROTTLED,Oe=>{const ye=Oe;re(ye.error),O("error"),c==null||c(ye)}),ge.on(qe.TRANSCRIBER_ERROR,Oe=>{const ye=Oe;re(ye.error),O("error"),u==null||u(ye)}),ge.on(qe.UNACCEPTED_TERMS,Oe=>{const ye=Oe;re(ye.error),O("error"),d==null||d(ye)}),ge.on(qe.RATE_LIMITED,Oe=>{const ye=Oe;re(ye.error),O("error"),h==null||h(ye)}),ge.on(qe.INPUT_ERROR,Oe=>{const ye=Oe;re(ye.error),O("error"),f==null||f(ye)}),ge.on(qe.QUEUE_OVERFLOW,Oe=>{const ye=Oe;re(ye.error),O("error"),p==null||p(ye)}),ge.on(qe.RESOURCE_EXHAUSTED,Oe=>{const ye=Oe;re(ye.error),O("error"),g==null||g(ye)}),ge.on(qe.SESSION_TIME_LIMIT_EXCEEDED,Oe=>{const ye=Oe;re(ye.error),O("error"),m==null||m(ye)}),ge.on(qe.CHUNK_SIZE_EXCEEDED,Oe=>{const ye=Oe;re(ye.error),O("error"),v==null||v(ye)}),ge.on(qe.INSUFFICIENT_AUDIO_ACTIVITY,Oe=>{const ye=Oe;re(ye.error),O("error"),x==null||x(ye)}),ge.on(qe.OPEN,()=>{w==null||w()}),ge.on(qe.CLOSE,()=>{O("disconnected"),R.current=null,y==null||y()})}catch(q){const te=q instanceof Error?q.message:"Failed to connect";throw re(te),O("error"),q}},[k,S,_,C,T,E,j,P,M,U,N,B,I,e,n,r,i,a,s,o,c,u,d,h,f,p,g,m,v,x,w,y]),ne=b.useCallback(()=>{var oe;(oe=R.current)==null||oe.close(),R.current=null,O("disconnected")},[]),G=b.useCallback((oe,W)=>{if(!R.current)throw new Error("Not connected to Scribe");R.current.send(gT({audioBase64:oe},W))},[]),Z=b.useCallback(()=>{if(!R.current)throw new Error("Not connected to Scribe");R.current.commit()},[]),ee=b.useCallback(()=>{Y([]),L("")},[]),K=b.useCallback(()=>R.current,[]);return b.useEffect(()=>{$&&J()},[$,J]),{status:z,isConnected:z==="connected"||z==="transcribing",isTranscribing:z==="transcribing",partialTranscript:A,committedTranscripts:V,error:Q,connect:J,disconnect:ne,sendAudio:G,commit:Z,clearTranscripts:ee,getConnection:K}}const vT=t=>{if(!t)return;const e=t.trim();if(/^\d{4}-\d{2}-\d{2}$/.test(e))return e;const n=new Date(e);if(!Number.isNaN(n.getTime()))return $e(n,"yyyy-MM-dd")},hk=t=>{const e=vT(t);if(!e)return null;const[n,r,i]=e.split("-").map(Number);return Rc(new Date(n,r-1,i))},Ave=[{value:0,label:"S",fullLabel:"Sunday"},{value:1,label:"M",fullLabel:"Monday"},{value:2,label:"T",fullLabel:"Tuesday"},{value:3,label:"W",fullLabel:"Wednesday"},{value:4,label:"T",fullLabel:"Thursday"},{value:5,label:"F",fullLabel:"Friday"},{value:6,label:"S",fullLabel:"Saturday"}],tM=t=>{t&&(t.style.height="0px",t.style.height=`${t.scrollHeight}px`)},Ove=[{id:"doctor",name:"Doctor Visit",icon:j0,title:"Doctor Visit",duration:1,participants:["Dr"]},{id:"nurse",name:"Nurse Visit",icon:q_,title:"Nurse Visit",duration:.5,participants:["RN"]},{id:"logopedist",name:"Logopediste",icon:b$,title:"Logopediste",duration:.5,participants:[]},{id:"huisarts",name:"Huisarts",icon:j0,title:"Huisarts",duration:.5,participants:["Dr"]}
806,{id:"skincream",name:"Apply Skincream",icon:rZ,title:"Apply Skincream",duration:.25,participants:[]},{id:"huisproject",name:"Huisproject",icon:m$,title:"Huisproject",duration:2,participants:[]},{id:"kinesitherapeut",name:"Kinesitherapeut",icon:$p,title:"Kinesitherapeut",duration:.5,participants:[]},{id:"meeting",name:"Family Meeting",icon:Ql,title:"Family Meeting",duration:1,participants:[]},{id:"meal",name:"Meal Time",icon:K2,title:"Meal",duration:1,participants:[]},{id:"cleaning",name:"Cleaning",icon:ta,title:"Cleaning Service",duration:2,participants:["CL"]},{id:"medication",name:"Medication",icon:v$,title:"Medication Time",duration:.25,participants:[]}],Rve=[{code:"nld",label:"NL",name:"Nederlands"},{code:"eng",label:"EN",name:"English"},{code:"fra",label:"FR",name:"Français"},{code:"deu",label:"DE",name:"Deutsch"}],fk=()=>localStorage.getItem("voiceInputLang")||"nld",Dve=t=>localStorage.setItem("voiceInputLang",t),tv=({open:t,onOpenChange:e,calendarId:n,onEventCreated:r,initialDateTime:i,initialEndDateTime:a,buttonRect:s})=>{var K,oe,W;const[o,c]=b.useState("voice"),[u,d]=b.useState(!1),[h,f]=b.useState(!1),[p,g]=b.useState(""),[m,v]=b.useState(""),[x,w]=b.useState(""),[y,k]=b.useState(null),[S,_]=b.useState([]),[C,T]=b.useState(!1),[E,j]=b.useState(!1),[P,M]=b.useState(fk),{createEvent:U,isSharedAccess:N,accessCode:B}=wu(),{toast:$}=ML(),I=b.useRef(()=>{}),R=Nve({modelId:"scribe_v2_realtime",languageCode:P,commitStrategy:"vad",onPartialTranscript:H=>{w(H.text)},onCommittedTranscript:H=>{H.text.trim()&&(w(""),R.disconnect(),d(!1),I.current(H.text.trim()))}});b.useEffect(()=>{I.current=H=>{V(H)}});const z=b.useCallback(async()=>{try{const{data:H,error:q}=await me.functions.invoke("elevenlabs-scribe-token");if(q||!(H!=null&&H.token))throw new Error("Could not get STT token");await R.connect({token:H.token,microphone:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}}),d(!0)}catch(H){console.error("Scribe connect error:",H),$({variant:"destructive",title:"Microphone error",description:"Could not start speech recognition. Check microphone permissions."})}},[R,$]),O=async()=>{await z()},A=()=>{R.isConnected&&(R.disconnect(),d(!1),x.trim()&&(V(x.trim()),w("")))},L=H=>({appointment:j0,meeting:Ql,reminder:vc,meal:K2,medication:v$,other:yc})[H]||yc,V=async H=>{if(H.trim()){f(!0);try{const q=new Date().getTimezoneOffset(),{data:te,error:he}=await me.functions.invoke("parse-event",{body:{text:H,timezone:q}});if(he||te!=null&&te.error){const De=(te==null?void 0:te.error)||(he==null?void 0:he.message)||"Unknown error";throw De.includes("rate limit")||De.includes("Rate limit")?new Error(te!=null&&te.resetAt?`Rate limit exceeded. Try again after ${new Date(te.resetAt).toLocaleTimeString()}.`:"Rate limit exceeded. Please try again later."):De.includes("Authentication required")?new Error("Please sign in to use AI features."):new Error(De)}v(te.transcribedText||H);const xe=te.eventData;(!xe.participants||xe.participants.length===0)&&(xe.participants=Q(xe.title)),i&&(xe.startTime=i.toISOString(),xe.endTime=a?a.toISOString():FS(i,1).toISOString()),k(xe)}catch(q){console.error("Error processing voice transcript:",q),$({title:"Couldn't parse event",description:(q==null?void 0:q.message)||"Something went wrong. Please try again.",variant:"destructive"})}finally{f(!1)}}},Y=async()=>{if(p.trim()){if(p.length>5e3){console.error("Text is too long. Maximum 5000 characters allowed.");return}f(!0);try{const H=new Date().getTimezoneOffset(),{data:q,error:te}=await me.functions.invoke("parse-event",{body:{text:p,timezone:H}});if(te||q!=null&&q.error){const xe=(q==null?void 0:q.error)||(te==null?void 0:te.message)||"Unknown error";throw xe.includes("rate limit")||xe.includes("Rate limit")?new Error(q!=null&&q.resetAt?`Rate limit exceeded. Try again after ${new Date(q.resetAt).toLocaleTimeString()}.`:"Rate limit exceeded. Please try again later."):xe.includes("Authentication required")?new Error("Please sign in to use AI features."):xe.includes("Text input too long")?new Error("Text is too long. Maximum 5000 characters allowed."):new Error(xe)}v(q.transcribedText);const he=q.eventData;(!he.participants||he.participants.length===0)&&(he.participants=Q(he.title)),i&&(he.startTime=i.toISOString(),he.endTime=a?a.toISOString():FS(i,1).toISOString()),k(he)}catch(H){console.error("Error processing text:",H),$({title:"Couldn't parse event",description:(H==null?void 0:H.message)||"Something went wrong. Please try again.",variant:"destructive"})}finally{f(!1)}}},Q=H=>{const q=H.toLowerCase(),te=[];return q.includes("nurse")&&te.push("RN"),(q.includes("doctor")||q.includes("dr."))&&te.push("Dr"),q.includes("sister")&&te.push("Sis"),q.includes("brother")&&te.push("Bro"),q.includes("daughter")&&te.push("D"),q.includes("son")&&te.push("S"),(q.includes("mom")||q.includes("mother"))&&te.push("M"),(q.includes("dad")||q.includes("father"))&&te.push("F"),q.includes("clean")&&te.push("CL"),q.includes("therapist")&&te.push("TH"),(q.includes("caregiver")||q.includes("carer"))&&te.push("CG"),te.length>0?te:null},re=async()=>{var H,q,te,he,xe,De;if(console.log("[createEvent] Called! eventData:",y),!y){console.log("[createEvent] No eventData, returning early");return}f(!0);try{if(n==="demo"){const Re=localStorage.getItem("demoEvents"),Oe=Re?JSON.parse(Re):[],ye={id:`demo-${Date.now()}`,calendar_id:"demo",title:y.title,start_time:y.startTime,end_time:y.endTime||y.startTime,duration:null,color:"blue",notes:[y.notes,y.location?`Location: ${y.location}`:null,y.eventType==="away"?"Type: Away/Unavailable":null].filter(
806Boolean).join(` 807`),participants:y.participants||null,created_by:"demo",created_at:new Date().toISOString(),updated_at:new Date().toISOString(),is_recurring:!1,recurrence_end_date:null,recurrence_parent_id:null,recurrence_pattern:null,location:y.location||null};Oe.push(ye),localStorage.setItem("demoEvents",JSON.stringify(Oe)),r==null||r(),ne(),f(!1);return}const ge=Intl.DateTimeFormat().resolvedOptions().timeZone;if(N&&B){console.log("[createEvent] Using shared access path via RPC");const Re=[y.notes,y.location?`Location: ${y.location}`:null,y.eventType==="away"?"Type: Away/Unavailable":null].filter(Boolean).join(` 808`);if(y.recurrencePattern&&y.recurrencePattern!==null&&y.recurrenceEndDate){const ye=new Date(y.startTime),Ct=vT(y.recurrenceEndDate),le=hk(y.recurrenceEndDate);if(!le||!Ct)throw new Error("Invalid recurrence end date");let Te=new Date(ye),Pe=0;const st=365;let Mt=null,yn=0;for(;Te<=le&&Pe<st;){if((y.recurrencePattern==="weekly"||y.recurrencePattern==="biweekly")&&((H=y.recurrenceDays)!=null&&H.length)?y.recurrenceDays.includes(Te.getDay()):!0){const an=new Date(Te),He=y.endTime?new Date(Te.getTime()+(new Date(y.endTime).getTime()-new Date(y.startTime).getTime())):new Date(Te),{data:hi,error:fi}=await U(n,{title:y.title,start_time:an.toISOString(),end_time:He.toISOString(),notes:Re||void 0,location:y.location||void 0,participants:y.participants||void 0,created_by:"editor",created_timezone:ge,is_recurring:!0,recurrence_pattern:y.recurrencePattern||void 0,recurrence_end_date:Ct,recurrence_parent_id:Mt||void 0});if(fi)throw fi;!Mt&&hi&&(Mt=hi.id),yn++}if(y.recurrencePattern==="daily")Te.setDate(Te.getDate()+1);else if(y.recurrencePattern==="weekly")(q=y.recurrenceDays)!=null&&q.length?Te.setDate(Te.getDate()+1):Te.setDate(Te.getDate()+7);else if(y.recurrencePattern==="biweekly")(te=y.recurrenceDays)!=null&&te.length?(Te.setDate(Te.getDate()+1),Te.getDay()===new Date(y.startTime).getDay()&&Te.setDate(Te.getDate()+7)):Te.setDate(Te.getDate()+14);else if(y.recurrencePattern==="monthly")Te.setMonth(Te.getMonth()+1);else if(y.recurrencePattern==="custom"&&y.recurrenceInterval){const an=y.recurrenceInterval;y.recurrenceUnit==="days"?Te.setDate(Te.getDate()+an):y.recurrenceUnit==="weeks"?Te.setDate(Te.getDate()+an*7):y.recurrenceUnit==="months"&&Te.setMonth(Te.getMonth()+an)}Pe++}if(yn===0)throw new Error("No recurring dates matched your selected pattern and end date.")}else{const{error:ye}=await U(n,{title:y.title,start_time:y.startTime,end_time:y.endTime||y.startTime,notes:Re||void 0,location:y.location||void 0,participants:y.participants||void 0,created_by:"editor",created_timezone:ge});if(ye)throw ye}}else{const{data:{user:Re}}=await me.auth.getUser();if(!Re)throw new Error("Not authenticated");const Oe=y.recurrencePattern&&y.recurrencePattern!==null,ye=[];if(Oe&&y.recurrenceEndDate){const Ct=new Date(y.startTime),le=vT(y.recurrenceEndDate),Te=hk(y.recurrenceEndDate);if(!Te||!le)throw new Error("Invalid recurrence end date");let Pe=new Date(Ct),st=0;const Mt=365;for(;Pe<=Te&&st<Mt;){if((y.recurrencePattern==="weekly"||y.recurrencePattern==="biweekly")&&((he=y.recurrenceDays)!=null&&he.length)?y.recurrenceDays.includes(Pe.getDay()):!0){const He=new Date(Pe),hi=y.endTime?new Date(Pe.getTime()+(new Date(y.endTime).getTime()-new Date(y.startTime).getTime())):new Date(Pe);ye.push({calendar_id:n,title:y.title,start_time:He.toISOString(),end_time:hi.toISOString(),notes:[y.notes,y.location?`Location: ${y.location}`:null,y.eventType==="away"?"Type: Away/Unavailable":null].filter(Boolean).join(` 809`),participants:y.participants||null,created_by:Re.id,created_timezone:ge,is_recurring:!0,recurrence_pattern:y.recurrencePattern,recurrence_end_date:le,recurrence_parent_id:ye.length===0?null:void 0,language:fk()})}if(y.recurrencePattern==="daily")Pe.setDate(Pe.getDate()+1);else if(y.recurrencePattern==="weekly")(xe=y.recurrenceDays)!=null&&xe.length?Pe.setDate(Pe.getDate()+1):Pe.setDate(Pe.getDate()+7);else if(y.recurrencePattern==="biweekly")(De=y.recurrenceDays)!=null&&De.length?(Pe.setDate(Pe.getDate()+1),Pe.getDay()===new Date(y.startTime).getDay()&&Pe.setDate(Pe.getDate()+7)):Pe.setDate(Pe.getDate()+14);else if(y.recurrencePattern==="monthly")Pe.setMonth(Pe.getMonth()+1);else if(y.recurrencePattern==="custom"&&y.recurrenceInterval){const He=y.recurrenceInterval;y.recurrenceUnit==="days"?Pe.setDate(Pe.getDate()+He):y.recurrenceUnit==="weeks"?Pe.setDate(Pe.getDate()+He*7):y.recurrenceUnit==="months"&&Pe.setMonth(Pe.getMonth()+He)}st++}if(ye.length===0)throw new Error("No recurring dates matched your selected pattern and end date.");const{data:yn,error:Kn}=await me.from("events").insert(ye[0]).select().single();if(Kn)throw Kn;if(ye.length>1){const an=ye.slice(1).map(hi=>({...hi,recurrence_parent_id:yn.id})),{error:He}=await me.from("events").insert(an);if(He)throw He}}else{const{error:Ct}=await me.from("events").insert({calendar_id:n,title:y.title,start_time:y.startTime,end_time:y.endTime||y.startTime,notes:[y.notes,y.location?`Location: ${y.location}`:null,y.eventType==="away"?"Type: Away/Unavailable":null].filter(
809Boolean).join(` 810`),participants:y.participants||null,created_by:Re.id,created_timezone:ge,language:fk()});if(Ct)throw Ct}}f(!1),j(!0),setTimeout(()=>{r==null||r(),j(!1),ne()},1200)}catch(ge){console.error("Error creating event:",ge),f(!1),$({title:"Error creating event",description:ge instanceof Error?ge.message:"Something went wrong. Please try again.",variant:"destructive"})}},J=H=>{const q=i||new Date,te=q.toISOString(),he=a?a.toISOString():FS(q,H.duration).toISOString();k({title:H.title,startTime:te,endTime:he,participants:H.participants.length>0?H.participants:void 0})},ne=()=>{c(i?"manual":"voice"),d(!1),f(!1),g(""),v(""),w(""),k(null),j(!1),R.isConnected&&R.disconnect(),e(!1)},G=()=>{v(""),k(null)},ee=(()=>{if(!s)return{x:"50%",y:"50%"};const H=s.left+s.width/2,q=s.top+s.height/2,te=window.innerWidth,he=window.innerHeight;return{x:`${H/te*100}%`,y:`${q/he*100}%`}})();return l.jsx(l.Fragment,{children:l.jsx(Za,{open:t,onOpenChange:ne,children:l.jsxs(Rj,{children:[l.jsx(Dj,{className:"bg-background/20 backdrop-blur-md z-[100]"}),l.jsxs(Yg,{className:ce("z-[101] p-0 bg-background [&>button.absolute]:hidden","fixed inset-0 w-full h-full overflow-y-auto overflow-x-hidden overscroll-y-contain","lg:inset-auto lg:left-1/2 lg:top-1/2 lg:-translate-x-1/2 lg:-translate-y-1/2 lg:w-[90vw] lg:max-w-4xl lg:h-[90vh] lg:rounded-2xl lg:shadow-2xl lg:border lg:border-border"),style:{pointerEvents:"auto",transformOrigin:`${ee.x} ${ee.y}`,animation:t?"dialogEnter 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards":"dialogExit 0.3s cubic-bezier(0.4, 0, 1, 1) forwards"},children:[l.jsx("style",{children:` 811 @keyframes dialogEnter { 812 from { 813 opacity: 0; 814 transform: scale(0.05); 815 border-radius: 50%; 816 } 817 to { 818 opacity: 1; 819 transform: scale(1); 820 border-radius: 0; 821 } 822 } 823 824 @keyframes dialogExit { 825 from { 826 opacity: 1; 827 transform: scale(1); 828 border-radius: 0; 829 } 830 to { 831 opacity: 0; 832 transform: scale(0.05); 833 border-radius: 50%; 834 } 835 } 836 837 @media (min-width: 1024px) { 838 @keyframes dialogEnter { 839 from { 840 opacity: 0; 841 transform: translate(-50%, -50%) scale(0.95); 842 } 843 to { 844 opacity: 1; 845 transform: translate(-50%, -50%) scale(1); 846 } 847 } 848 849 @keyframes dialogExit { 850 from { 851 opacity: 1; 852 transform: translate(-50%, -50%) scale(1); 853 } 854 to { 855 opacity: 0; 856 transform: translate(-50%, -50%) scale(0.95); 857 } 858 } 859 } 860 `}),E&&Fc.createPortal(l.jsxs("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-background/95 backdrop-blur-sm",children:[l.jsxs("div",{className:"flex flex-col items-center gap-4 animate-scale-in",children:[l.jsx("div",{className:"w-24 h-24 rounded-full bg-calendar-mint-dark flex items-center justify-center shadow-lg shadow-calendar-mint-dark/30",children:l.jsx(_s,{className:"w-12 h-12 text-white animate-[checkmark_0.4s_ease-out_0.2s_forwards] opacity-0",strokeWidth:3})}),l.jsx("p",{className:"text-xl font-semibold text-foreground animate-fade-in",children:"Event Created!"})]}),l.jsx("style",{children:` 861 @keyframes checkmark { 862 0% { 863 opacity: 0; 864 transform: scale(0.5) rotate(-45deg); 865 } 866 50% { 867 transform: scale(1.2) rotate(0deg); 868 } 869 100% { 870 opacity: 1; 871 transform: scale(1) rotate(0deg); 872 } 873 } 874 `})]}),document.body),l.jsxs("div",{className:"relative w-full max-w-full min-h-full overflow-x-hidden p-4 sm:p-6 lg:p-8 pt-16 sm:pt-8 lg:pt-6 pb-28 lg:pb-8",children:[l.jsx("button",{onClick:ne,className:"fixed lg:absolute top-6 right-4 sm:top-4 sm:right-4 lg:top-4 lg:right-4 z-50 p-2 rounded-full border-2 border-border hover:bg-accent transition-colors","aria-label":"Close",children:l.jsx(vo,{className:"w-5 h-5 lg:w-4 lg:h-4 text-muted-foreground"})}),l.jsxs("div",{className:"w-full min-w-0 max-w-4xl mx-auto animate-scale-in lg:animate-none",children:[l.jsx(na,{className:"mb-6 sm:mb-8",children:l.jsx(ra,{className:"text-2xl sm:text-3xl",children:y?"Confirm Event Details":"Create Event"})}),y?l.jsxs("div",{className:"space-y-5 sm:space-y-6",children:[m&&l.jsx("div",{className:"p-4 sm:p-5 bg-muted/60 rounded-2xl",children:l.jsxs("p",{className:"text-sm sm:text-base italic text-muted-foreground leading-relaxed",children:['"',m,'"']})}),l.jsxs("div",{className:"group relative rounded-2xl bg-card border border-border/60 p-4 sm:p-5 transition-all hover:border-foreground
874/20 focus-within:border-foreground/30 focus-within:shadow-sm",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[l.jsx("div",{className:"w-8 h-8 rounded-full bg-calendar-peach/30 flex items-center justify-center shrink-0",children:l.jsx(mZ,{className:"w-4 h-4 text-calendar-peach-dark"})}),l.jsx(yt,{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Title"})]}),l.jsx("textarea",{ref:tM,value:y.title,onChange:H=>k({...y,title:H.target.value}),onInput:H=>tM(H.currentTarget),rows:1,className:"w-full min-w-0 resize-none overflow-hidden text-lg sm:text-2xl font-semibold leading-tight text-foreground bg-transparent border-0 rounded-none focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0 shadow-none px-0 touch-manipulation py-1",placeholder:"Event title"})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3 sm:gap-4",children:[l.jsxs("div",{className:"group relative rounded-2xl bg-card border border-border/60 p-4 sm:p-5 transition-all hover:border-foreground
874/20 focus-within:border-foreground/30 focus-within:shadow-sm",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[l.jsx("div",{className:"w-8 h-8 rounded-full bg-calendar-blue/30 flex items-center justify-center shrink-0",children:l.jsx(yc,{className:"w-4 h-4 text-calendar-blue-dark"})}),l.jsx(yt,{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Start"})]}),l.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2 sm:gap-3",children:[l.jsx("input",{type:"date",value:$e(new Date(y.startTime),"yyyy-MM-dd"),onChange:H=>{const q=new Date(y.startTime),te=$e(q,"HH:mm"),[he,xe,De]=H.target.value.split("-"),ge=new Date(parseInt(he),parseInt(xe)-1,parseInt(De)),[Re,Oe]=te.split(":");ge.setHours(parseInt(Re),parseInt(Oe),0,0),k({...y,startTime:ge.toISOString()})},className:"form-datetime-input block text-base font-medium text-foreground bg-muted/40 border-0 rounded-xl shadow-none touch-manipulation flex-1 min-w-0 w-full h-11 px-3 [-webkit-appearance:none] [text-align:left] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-foreground/20"}),l.jsx("input",{type:"time",value:$e(new Date(y.startTime),"HH:mm"),onChange:H=>{const q=new Date(y.startTime),[te,he,xe]=[q.getFullYear(),q.getMonth(),q.getDate()],[De,ge]=H.target.value.split(":"),Re=new Date(te,he,xe,parseInt(De),parseInt(ge),0,0);k({...y,startTime:Re.toISOString()})},className:"form-datetime-input block text-base font-medium text-foreground bg-muted/40 border-0 rounded-xl shadow-none touch-manipulation w-24 sm:w-28 h-11 px-3 shrink-0 [-webkit-appearance:none] [text-align:left] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-foreground/20"})]})]}),y.endTime&&l.jsxs("div",{className:"group relative rounded-2xl bg-card border border-border/60 p-4 sm:p-5 transition-all hover:border-foreground
874/20 focus-within:border-foreground/30 focus-within:shadow-sm",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[l.jsx("div",{className:"w-8 h-8 rounded-full bg-calendar-coral/30 flex items-center justify-center shrink-0",children:l.jsx(Dx,{className:"w-4 h-4 text-calendar-coral-dark"})}),l.jsx(yt,{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"End"})]}),l.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2 sm:gap-3",children:[l.jsx("input",{type:"date",value:$e(new Date(y.endTime),"yyyy-MM-dd"),onChange:H=>{const q=new Date(y.endTime),te=$e(q,"HH:mm"),[he,xe,De]=H.target.value.split("-"),ge=new Date(parseInt(he),parseInt(xe)-1,parseInt(De)),[Re,Oe]=te.split(":");ge.setHours(parseInt(Re),parseInt(Oe),0,0),k({...y,endTime:ge.toISOString()})},className:"form-datetime-input block text-base font-medium text-foreground bg-muted/40 border-0 rounded-xl shadow-none touch-manipulation flex-1 min-w-0 w-full h-11 px-3 [-webkit-appearance:none] [text-align:left] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-foreground/20"}),l.jsx("input",{type:"time",value:$e(new Date(y.endTime),"HH:mm"),onChange:H=>{const q=new Date(y.endTime),[te,he,xe]=[q.getFullYear(),q.getMonth(),q.getDate()],[De,ge]=H.target.value.split(":"),Re=new Date(te,he,xe,parseInt(De),parseInt(ge),0,0);k({...y,endTime:Re.toISOString()})},className:"form-datetime-input block text-base font-medium text-foreground bg-muted/40 border-0 rounded-xl shadow-none touch-manipulation w-24 sm:w-28 h-11 px-3 shrink-0 [-webkit-appearance:none] [text-align:left] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-foreground/20"})]})]})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3 sm:gap-4",children:[l.jsxs("div",{className:"group relative rounded-2xl bg-card border border-border/60 p-4 sm:p-5 transition-all hover:border-foreground
874/20 focus-within:border-foreground/30 focus-within:shadow-sm",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[l.jsx("div",{className:"w-8 h-8 rounded-full bg-calendar-mint/30 flex items-center justify-center shrink-0",children:l.jsx(df,{className:"w-4 h-4 text-calendar-mint-dark"})}),l.jsx(yt,{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Location"})]}),l.jsx(qt,{value:y.location||"",onChange:H=>k({...y,location:H.target.value}),className:"text-base font-medium text-foreground bg-transparent border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 shadow-none px-0 touch-manipulation h-auto py-1 w-full min-w-0",placeholder:"Add location"})]}),l.jsxs("div",{className:"group relative rounded-2xl bg-card border border-border/60 p-4 sm:p-5 transition-all hover:border-foreground/20 focus-within:border-foreground/30 focus-within:shadow-sm",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[l.jsx("div",{className:"w-8 h-8 rounded-full bg-calendar-oatmeal/30 flex items-center justify-center shrink-0",children:l.jsx(TZ,{className:"w-4 h-4 text-calendar-oatmeal-dark"})}),l.jsx(yt,{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Participants"})]}),l.jsx(qt,{value:((K=y.participants)==null?void 0:K.join(", "))||"",onChange:H=>k({...y,participants:H.target.value?H.target.value.split(",").map(q=>q.trim()):[]}),className:"text-base font-medium text-foreground bg-transparent border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 shadow-none px-0 touch-manipulation h-auto py-1 w-full min-w-0",placeholder:"Add participants"})]})]}),l.jsxs("div",{className:"group relative rounded-2xl bg-card border border-border/60 p-4 sm:p-5 transition-all hover:border-foreground
874/20 focus-within:border-foreground/30 focus-within:shadow-sm",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[l.jsx("div",{className:"w-8 h-8 rounded-full bg-calendar-sea/30 flex items-center justify-center shrink-0",children:l.jsx(Wg,{className:"w-4 h-4 text-calendar-sea-dark"})}),l.jsx(yt,{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Notes"})]}),l.jsx(cu,{value:y.notes||"",onChange:H=>k({...y,notes:H.target.value}),className:"text-base text-foreground bg-transparent border-0 border-none rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 focus-visible:border-0 focus-visible:shadow-none focus:outline-none shadow-none px-0 resize-none min-h-[60px] touch-manipulation w-full min-w-0",placeholder:"Add notes"})]}),l.jsxs("div",{className:"group relative rounded-2xl bg-card border border-border/60 p-4 sm:p-5 transition-all hover:border-foreground/20 focus-within:border-foreground/30 focus-within:shadow-sm",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[l.jsx("div",{className:"w-8 h-8 rounded-full bg-calendar-chartreuse/30 flex items-center justify-center shrink-0",children:l.jsx(y$,{className:"w-4 h-4 text-calendar-chartreuse-dark"})}),l.jsx(yt,{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Repeat"})]}),l.jsxs("div",{className:"w-full min-w-0",children:[l.jsxs(bh,{value:y.recurrencePattern||"none",onValueChange:H=>{const q=H==="none"?null:H,te=new Date(y.startTime).getDay();k({...y,recurrencePattern:q,recurrenceEndDate:q?Or(new Date(y.startTime),3).toISOString().split("T")[0]:void 0,recurrenceInterval:q==="custom"?2:void 0,recurrenceUnit:q==="custom"?"days":void 0,recurrenceDays:q==="weekly"||q==="biweekly"?[te]:void 0})},children:[l.jsx(au,{className:"w-full min-w-0 text-base font-medium text-foreground bg-muted/40 border-0 rounded-xl focus:ring-1 focus:ring-foreground/20 shadow-none h-11 touch-manipulation",children:l.jsx(xh,{})}),l.jsxs(su,{children:[l.jsx(Bt,{value:"none",children:"Does not repeat"}),l.jsx(Bt,{value:"daily",children:"Daily"}),l.jsx(Bt,{value:"weekly",children:"Weekly"}),l.jsx(Bt,{value:"biweekly",children:"Bi-weekly"}),l.jsx(Bt,{value:"monthly",children:"Monthly"}),l.jsx(Bt,{value:"custom",children:"Custom..."})]})]}),(y.recurrencePattern==="weekly"||y.recurrencePattern==="biweekly")&&l.jsxs("div",{className:"mt-4 space-y-2",children:[l.jsx(yt,{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"On days"}),l.jsx("div",{className:"flex gap-2 flex-wrap",children:Ave.map(H=>{var te;const q=(te=y.recurrenceDays)==null?void 0:te.includes(H.value);return l.jsx("button",{type:"button",onClick:()=>{const he=y.recurrenceDays||[],xe=q?he.filter(De=>De!==H.value):[...he,H.value].sort((De,ge)=>De-ge);xe.length>0&&k({...y,recurrenceDays:xe})},className:ce("w-10 h-10 rounded-full text-sm font-semibold transition-all touch-manipulation",q?"bg-primary text-primary-foreground shadow-sm":"bg-muted/60 text-muted-foreground hover:bg-muted"),title:H.fullLabel,children:H.label},H.value)})})]}),y.recurrencePattern==="custom"&&l.jsxs("div",{className:"mt-4 space-y-2",children:[l.jsx(yt,{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Every"}),l.jsxs("div",{className:"flex w-full min-w-0 items-center gap-3 flex-wrap sm:flex-nowrap",children:[l.jsx(qt,{type:"number",min:1,max:365,value:y.recurrenceInterval||2,onChange:H=>k({...y,recurrenceInterval:Math.max(1,Math.min(365,parseInt(H.target.value)||1))}),className:"w-24 sm:w-20 text-base font-medium text-foreground bg-muted/40 border-0 rounded-xl h-11 focus-visible:ring-1 focus-visible:ring-foreground/20 touch-manipulation shrink-0"}),l.jsxs(bh,{value:y.recurrenceUnit||"days",onValueChange:H=>k({...y,recurrenceUnit:H}),children:[l.jsx(au,{className:"w-full sm:w-32 min-w-0 text-base font-medium text-foreground bg-muted/40 border-0 rounded-xl h-11 focus:ring-1 focus:ring-foreground/20 touch-manipulation",children:l.jsx(xh,{})}),l.jsxs(su,{children:[l.jsx(Bt,{value:"days",children:"Days"}),l.jsx(Bt,{value:"weeks",children:"Weeks"}),l.jsx(Bt,{value:"months",children:"Months"})]})]})]})]}),y.recurrencePattern&&y.recurrencePattern!==null&&l.jsxs("div",{className:"mt-3 sm:mt-4 space-y-2 w-full min-w-0",children:[l.jsx(yt,{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Until"}),l.jsx("input",{type:"date",value:y.recurrenceEndDate||"",onChange:H=>k({...y,recurrenceEndDate:H.target.value}),min:$e(new Date(y.startTime),"yyyy-MM-dd"),className:"form-datetime-input block h-11 w-full min-w-0 max-w-full box-border bg-muted/40 border-0 rounded-xl px-3 text-base font-medium text-foreground [text-align:left] [direction:ltr] [-webkit-text-size-adjust:100%] [-webkit-appearance:none] shadow-none touch-manipulation focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-foreground
874/20 [font-variant-numeric:tabular-nums] [&::-webkit-date-and-time-value]:text-left [&::-webkit-date-and-time-value]:m-0 [&::-webkit-date-and-time-value]:p-0 [&::-webkit-datetime-edit]:text-left [&::-webkit-datetime-edit]:m-0 [&::-webkit-datetime-edit]:p-0"})]}),y.recurrencePattern&&y.recurrencePattern!==null&&y.recurrenceEndDate&&l.jsxs("div",{className:"mt-4 space-y-2",children:[l.jsx(yt,{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Preview"}),l.jsx("div",{className:"space-y-1",children:(()=>{var Re,Oe,ye,Ct,le,Te;const H=[],q=new Date(y.startTime),te=hk(y.recurrenceEndDate);if(!te)return null;let he=new Date(q);const xe=5;for(;he<=te&&H.length<xe;)if(((y.recurrencePattern==="weekly"||y.recurrencePattern==="biweekly")&&((Re=y.recurrenceDays)!=null&&Re.length)?y.recurrenceDays.includes(he.getDay()):!0)&&H.push(new Date(he)),y.recurrencePattern==="daily")he.setDate(he.getDate()+1);else if(y.recurrencePattern==="weekly")(Oe=y.recurrenceDays)!=null&&Oe.length?he.setDate(he.getDate()+1):he.setDate(he.getDate()+7);else if(y.recurrencePattern==="biweekly")(ye=y.recurrenceDays)!=null&&ye.length?(he.setDate(he.getDate()+1),he.getDay()===q.getDay()&&he.setDate(he.getDate()+7)):he.setDate(he.getDate()+14);else if(y.recurrencePattern==="monthly")he.setMonth(he.getMonth()+1);else if(y.recurrencePattern==="custom"&&y.recurrenceInterval){const st=y.recurrenceInterval;y.recurrenceUnit==="days"?he.setDate(he.getDate()+st):y.recurrenceUnit==="weeks"?he.setDate(he.getDate()+st*7):y.recurrenceUnit==="months"&&he.setMonth(he.getMonth()+st)}let De=0,ge=new Date(q);for(;ge<=te&&De<365;)if(((y.recurrencePattern==="weekly"||y.recurrencePattern==="biweekly")&&((Ct=y.recurrenceDays)!=null&&Ct.length)?y.recurrenceDays.includes(ge.getDay()):!0)&&De++,y.recurrencePattern==="daily")ge.setDate(ge.getDate()+1);else if(y.recurrencePattern==="weekly")(le=y.recurrenceDays)!=null&&le.length?ge.setDate(ge.getDate()+1):ge.setDate(ge.getDate()+7);else if(y.recurrencePattern==="biweekly")(Te=y.recurrenceDays)!=null&&Te.length?(ge.setDate(ge.getDate()+1),ge.getDay()===q.getDay()&&ge.setDate(ge.getDate()+7)):ge.setDate(ge.getDate()+14);else if(y.recurrencePattern==="monthly")ge.setMonth(ge.getMonth()+1);else if(y.recurrencePattern==="custom"&&y.recurrenceInterval){const st=y.recurrenceInterval;y.recurrenceUnit==="days"?ge.setDate(ge.getDate()+st):y.recurrenceUnit==="weeks"?ge.setDate(ge.getDate()+st*7):y.recurrenceUnit==="months"&&ge.setMonth(ge.getMonth()+st)}return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex flex-wrap gap-3 items-center",children:[H.map((Pe,st)=>l.jsxs("div",{className:"flex flex-col items-center gap-1",children:[l.jsx("span",{className:"text-[10px] font-medium uppercase text-muted-foreground tracking-wider",children:$e(Pe,"EEE")}),l.jsx("div",{className:"w-11 h-11 rounded-full bg-primary text-primary-foreground flex items-center justify-center text-sm font-bold shadow-sm",children:$e(Pe,"d")}),l.jsx("span",{className:"text-[10px] text-muted-foreground",children:$e(Pe,"MMM")})]},st)),De>xe&&l.jsxs("div",{className:"flex flex-col items-center gap-1",children:[l.jsx("span",{className:"text-[10px] font-medium uppercase text-muted-foreground tracking-wider",children:"Â "}),l.jsxs("div",{className:"w-11 h-11 rounded-full bg-muted/60 border-2 border-dashed border-muted-foreground/30 flex items-center justify-center text-xs font-medium text-muted-foreground",children:["+",De-xe]}),l.jsx("span",{className:"text-[10px] text-muted-foreground",children:"more"})]})]}),l.jsxs("p",{className:"text-xs text-muted-foreground mt-3",children:[De," occurrence",De!==1?"s":""," total"]})]})})()})]})]})]}),y.eventType==="away"&&l.jsx("div",{className:"p-4 bg-calendar-oatmeal/20 border border-calendar-oatmeal/40 rounded-2xl",children:l.jsx("p",{className:"text-sm text-foreground/70",children:'This will be marked as an "Away" event (vacation, unavailable, etc.)'})}),l.jsxs("form",{className:"mt-2 pb-6 flex gap-3",onSubmit:H=>{var q;H.preventDefault(),!h&&((q=y==null?void 0:y.title)!=null&&q.trim())&&re()},children:[l.jsx("button",{type:"button",onClick:G,className:"flex-1 h-14 text-base sm:text-lg rounded-2xl border border-border bg-card hover:bg-muted active:scale-[0.98] transition-all font-medium touch-manipulation",children:"Back"}),l.jsx("button",{type:"submit",disabled:h||!((oe=y==null?void 0:y.title)!=null&&oe.trim()),className:ce("flex-1 h-14 text-base sm:text-lg rounded-2xl bg-primary text-primary-foreground active:scale-[0.98] transition-all flex items-center justify-center font-medium touch-manipulation",(h||!((W=y==null?void 0:y.title)!=null&&W.trim()))&&"opacity-50 cursor-not-allowed"),children:h?l.jsxs(l.Fragment,{children:[l.jsx(Er,{className:"w-4 h-4 mr-2 animate-spin"}),"Creating..."]}):"Create Event"})]})]}):l.jsxs("div",{className:"space-y-6 sm:space-y-8 lg:space-y-6",children:[l.jsxs("div",{className:"space-y-4 sm:sp
874ace-y-6 lg:space-y-4 max-w-2xl lg:max-w-3xl mx-auto",children:[l.jsxs("div",{className:"flex items-center justify-center gap-2 sm:gap-4 px-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:ce("w-8 h-8 sm:w-10 sm:h-10 rounded-full flex items-center justify-center border-2 transition-all duration-300",u?"bg-calendar-coral border-calendar-coral text-white scale-110":m?"bg-muted border-muted-foreground/30 text-muted-foreground":"bg-background border-border text-muted-foreground"),children:u?l.jsx(G_,{className:"w-4 h-4 sm:w-5 sm:h-5"}):"1"}),l.jsx("span",{className:ce("text-xs sm:text-sm font-medium transition-colors",u?"text-foreground":"text-muted-foreground"),children:"Record"})]}),l.jsx("div",{className:ce("h-0.5 w-8 sm:w-12 transition-all duration-300",h||m?"bg-calendar-coral":"bg-border")}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:ce("w-8 h-8 sm:w-10 sm:h-10 rounded-full flex items-center justify-center border-2 transition-all duration-300",h?"bg-calendar-blue border-calendar-blue text-white scale-110":m?"bg-muted border-muted-foreground/30 text-muted-foreground":"bg-background border-border text-muted-foreground"),children:h?l.jsx(Er,{className:"w-4 h-4 sm:w-5 sm:h-5 animate-spin"}):"2"}),l.jsx("span",{className:ce("text-xs sm:text-sm font-medium transition-colors",h?"text-foreground":"text-muted-foreground"),children:"Process"})]}),l.jsx("div",{className:ce("h-0.5 w-8 sm:w-12 transition-all duration-300",m?"bg-calendar-coral":"bg-border")}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:ce("w-8 h-8 sm:w-10 sm:h-10 rounded-full flex items-center justify-center border-2 transition-all duration-300",m?"bg-calendar-peach border-calendar-peach text-white scale-110":"bg-background border-border text-muted-foreground"),children:m?l.jsx(ta,{className:"w-4 h-4 sm:w-5 sm:h-5"}):"3"}),l.jsx("span",{className:ce("text-xs sm:text-sm font-medium transition-colors",m?"text-foreground":"text-muted-foreground"),children:"Complete"})]})]}),l.jsxs("div",{className:"flex flex-col items-center gap-4 sm:gap-6 lg:gap-4 py-6 sm:py-10 lg:py-6",children:[l.jsxs("div",{className:"relative flex items-center justify-center",children:[u&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"absolute inset-0 w-24 h-24 sm:w-28 sm:h-28 lg:w-20 lg:h-20 rounded-full bg-gradient-to-br from-calendar-blue/30 via-calendar-coral/30 to-calendar-peach/30 animate-[ping_2s_ease-in-out_infinite]"}),l.jsx("div",{className:"absolute inset-0 w-24 h-24 sm:w-28 sm:h-28 lg:w-20 lg:h-20 rounded-full bg-gradient-to-br from-calendar-blue/20 via-calendar-coral/20 to-calendar-peach/20 animate-[ping_2s_ease-in-out_infinite_0.5s]"}),l.jsx("div",{className:"absolute inset-0 w-24 h-24 sm:w-28 sm:h-28 lg:w-20 lg:h-20 rounded-full bg-gradient-to-br from-calendar-blue/10 via-calendar-coral/10 to-calendar-peach/10 animate-[ping_2s_ease-in-out_infinite_1s]"})]}),h&&l.jsx("div",{className:"absolute inset-0 w-28 h-28 sm:w-32 sm:h-32 lg:w-24 lg:h-24 rounded-full bg-calendar-blue/20 animate-pulse"}),l.jsx(de,{size:"lg",onClick:u?A:O,disabled:h,className:ce("relative w-24 h-24 sm:w-28 sm:h-28 lg:w-20 lg:h-20 rounded-full bg-gradient-to-br from-calendar-blue via-calendar-coral to-calendar-peach hover:opacity-90 text-white border-0 transition-all duration-300 z-10 touch-manipulation",u&&"scale-110 shadow-[0_0_30px_rgba(255,99,71,0.5)]"),children:h?l.jsx(Er,{className:"w-10 h-10 sm:w-12 sm:h-12 lg:w-8 lg:h-8 animate-spin"}):l.jsx(G_,{className:"w-10 h-10 sm:w-12 sm:h-12 lg:w-8 lg:h-8"})})]}),l.jsx("p",{className:"text-base sm:text-lg lg:text-base text-muted-foreground text-center px-4",children:h?"Processing...":u?"Listening... Tap to stop":"Tap to start speaking"}),!u&&!h&&l.jsx("div",{className:"flex items-center justify-center gap-1.5",children:Rve.map(H=>l.jsx("button",{type:"button",onClick:()=>{M(H.code),Dve(H.code)},title:H.name,className:ce("px-2.5 py-1 rounded-full text-xs font-medium transition-all duration-200",P===H.code?"bg-primary text-primary-foreground shadow-sm":"bg-muted text-muted-foreground hover:bg-muted/80"),children:H.label},H.code))})]}),u&&x&&l.jsxs("div",{className:"p-4 sm:p-6 lg:p-4 bg-muted/50 rounded-lg animate-fade-in border border-border/50",children:[l.jsx(yt,{className:"text-sm text-muted-foreground",children:"Hearing:"}
vendor: 9,605 bytes, lines 874-876
874),l.jsxs("p",{className:"text-base mt-2 italic text-foreground/70",children:[x,"..."]})]}),h&&l.jsxs("div",{className:"p-4 sm:p-6 lg:p-4 bg-muted rounded-lg space-y-3 animate-fade-in",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Er,{className:"w-4 h-4 animate-spin text-calendar-blue"}),l.jsx("p",{className:"text-sm font-medium",children:"Transcribing your voice..."})]}),l.jsx(Wt,{className:"h-4 w-full"}),l.jsx(Wt,{className:"h-4 w-5/6"}),l.jsx(Wt,{className:"h-4 w-4/5"})]}),m&&!h&&l.jsxs("div",{className:"p-4 sm:p-6 lg:p-4 bg-muted rounded-lg animate-fade-in",children:[l.jsx(yt,{className:"text-sm text-muted-foreground",children:"Transcribed:"}),l.jsx("p",{className:"text-base mt-2",children:m})]})]}),l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"absolute inset-0 flex items-center",children:l.jsx("span",{className:"w-full border-t"})}),l.jsx("div",{className:"relative flex justify-center text-xs sm:text-sm uppercase",children:l.jsx("span",{className:"bg-background px-3 text-muted-foreground",children:"Or"})})]}),l.jsxs("div",{className:"space-y-3 sm:space-y-4 lg:space-y-3 max-w-2xl lg:max-w-3xl mx-auto",children:[l.jsx(cu,{placeholder:`E.g., Meeting with John tomorrow at 2pm for 1 hour at the office 875 876Or: Sarah on vacation next week in Hawaii`,value:p,onChange:H=>g(H.target.value),className:"min-h-[120px] sm:min-h-[140px] lg:min-h-[100px] text-base p-3 sm:p-4 lg:p-3 touch-manipulation",disabled:h}),l.jsx(de,{onClick:Y,disabled:!p.trim()||h,className:"w-full h-12 sm:h-14 lg:h-11 text-base sm:text-lg lg:text-base touch-manipulation",children:h?l.jsxs(l.Fragment,{children:[l.jsx(Er,{className:"w-4 h-4 mr-2 animate-spin"}),"Processing..."]}):"Parse Event"})]}),l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"absolute inset-0 flex items-center",children:l.jsx("span",{className:"w-full border-t"})}),l.jsx("div",{className:"relative flex justify-center text-xs sm:text-sm uppercase",children:l.jsx("span",{className:"bg-background px-3 text-muted-foreground",children:"Or use a template"})})]}),l.jsx("div",{className:"space-y-4 sm:space-y-6 lg:space-y-4 max-w-2xl lg:max-w-3xl mx-auto",children:C?l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-3 sm:mb-4",children:[l.jsx(Wt,{className:"h-4 w-4 sm:h-5 sm:w-5 rounded-full"}),l.jsx(Wt,{className:"h-5 w-48 sm:w-56"})]}),l.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3 sm:gap-4",children:[...Array(6)].map((H,q)=>l.jsx(Wt,{className:"h-24 sm:h-28 lg:h-24 rounded-lg",style:{animationDelay:`${q*50}ms`}},q))})]}):l.jsxs(l.Fragment,{children:[S.length>0&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4 flex items-center gap-2",children:[l.jsx(ta,{className:"w-4 h-4 sm:w-5 sm:h-5 text-calendar-peach"}),"AI-Suggested Templates"]}),l.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3 sm:gap-4",children:S.map((H,q)=>{const te=L(H.eventType);return l.jsxs(de,{variant:"outline",onClick:()=>J({id:`ai-${q}`,name:H.title,icon:te,title:H.title,duration:H.defaultDuration/60,participants:H.suggestedParticipants||[]}),className:"h-24 sm:h-28 lg:h-24 flex flex-col items-center justify-center gap-2 sm:gap-3 hover:bg-muted border-calendar-peach/30 animate-fade-in touch-manipulation",style:{animationDelay:`${q*100}ms`},children:[l.jsx(te,{className:"w-6 h-6 sm:w-8 sm:h-8 lg:w-6 lg:h-6 text-calendar-peach"}),l.jsx("span",{className:"text-xs sm:text-sm font-medium text-center px-1 sm:px-2",children:H.title})]},`ai-${q}`)})})]}),l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"absolute inset-0 flex items-center",children:l.jsx("span",{className:"w-full border-t"})}),l.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:l.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"Standard Templates"})})]})]}),l.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3 sm:gap-4",children:Ove.map((H,q)=>{const te=H.icon;return l.jsxs(de,{variant:"outline",onClick:()=>J(H),className:"h-24 sm:h-28 lg:h-24 flex flex-col items-center justify-center gap-2 sm:gap-3 hover:bg-muted animate-fade-in touch-manipulation",style:{animationDelay:`${q*100}ms`},children:[l.jsx(te,{className:"w-6 h-6 sm:w-8 sm:h-8 lg:w-6 lg:h-6"}),l.jsx("span",{className:"text-sm sm:text-base lg:text-sm font-medium",children:H.name})]},H.id)})})]})})]})]})]})]})]})})})};var Lw="Popover",[XW,yBe]=Yr(Lw,[mf]),nv=mf(),[Mve,Gc]=XW(Lw),ZW=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:s=!1}=t,o=nv(e),c=b.useRef(null),[u,d]=b.useState(!1),[h,f]=ks({prop:r,defaultProp:i??!1,onChange:a,caller:Lw});return l.jsx(aj,{...o,children:l.jsx(Mve,{scope:e,contentId:gs(),triggerRef:c,open:h,onOpenChange:f,onOpenToggle:b.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:u,onCustomAnchorAdd:b.useCallback(()=>d(!0),[]),onCustomAnchorRemove:b.useCallback(()=>d(!1),[]),modal:s,children:n})})};ZW.displayName=Lw;var QW="PopoverAnchor",Ive=b.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Gc(QW,n),a=nv(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:o}=i;return b.useEffect(()=>(s(),()=>o()),[s,o]),l.jsx(Fx,{...a,...r,ref:e})});Ive.displayName=QW;var eV="PopoverTrigger",tV=b.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Gc(eV,n),a=nv(n),s=bt(e,i.triggerRef),o=l.jsx(Ke.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":sV(i.open),...r,ref:s,onClick:Ie(t.onClick,i.onOpenToggle)});return i.hasCustomAnchor?o:l.jsx(Fx,{asChild:!0,...a,children:o})});tV.displayName=eV;var LP="PopoverPortal",[Lve,$ve]=XW(LP,{forceMount:void 0}),nV=t=>{const{__scopePopover:e,forceMount:n,children:r,container:i}=t,a=Gc(LP,e);return l.jsx(Lve,{scope:e,forceMount:n,children:l.jsx(ui,{present:n||a.open,children:l.jsx(Bg,{asChild:!0,container:i,children:r})})})};nV.displayName=LP;var Ah="PopoverContent",rV=b.forwardRef((t,e)=>{const n=$ve(Ah,t.__scopePopover),{forceMount:r=n.forceMount,...i}=t,a=Gc(Ah,t.__scopePopover);return l.jsx(ui,{present:r||a.open,children:a.modal?l.jsx(Bve,{...i,ref:e}):l.jsx(Uve,{...i,ref:e})})});rV.displayName=Ah;var Fve=Zl("PopoverContent.RemoveScroll"),Bve=b.forwardRef((t,e)=>{const n=Gc(Ah,t.__scopePopover),r=b.useRef(null),i=bt(e,r),a=b.useRef(!1);return b.useEffect(()=>{const s=r.current;if(s)return _j(s)},[]),l.jsx(Jx,{as:Fve,allowPinchZoom:!0,children:l.jsx(iV,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ie(t.onCloseAutoFocus,s=>{var o;s.preventDefault(),a.current||(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Ie(t.onPointerDownOutside,s=>{const o=s.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0,u=o.button===2||c;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:Ie(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),Uve=b.forwardRef((t,e)=>{const n=Gc(Ah,t.__scopePopover),r=b.useRef(!1),i=b.useRef(!1);return l.jsx(iV,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var s,o;(s=t.onCloseAutoFocus)==null||s.call(t,a),a.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),a.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:a=>{var c,u;(c=t.onInteractOutside)==null||c.call(t,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=a.target;((u=n.triggerRef.current)==null?void 0:u.contains(s))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),iV=b.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...h}=t,f=Gc(Ah,n),p=nv(n);return kj(),l.jsx(Gx,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:l.jsx(uf,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:l.jsx(sj,{"data-state":sV(f.open),role:"dialog",id:f.contentId,...p,...h,ref:e,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),aV="PopoverClose",zve=b.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Gc(aV,n);return l.jsx(Ke.button,{type:"button",...r,ref:e,onClick:Ie(t.onClick,()=>i.onOpenChange(!1))})});zve.displayName=aV;var Wve="PopoverArrow",Vve=b.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=nv(n);return l.jsx(oj,{...i,...r,ref:e})});Vve.displayName=Wve;function sV(t){return t?"open":"closed"}var Hve=ZW,qve=tV,Kve=nV,oV=rV;const cV=Hve,lV=qve,$P=b.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},i)=>l.jsx(Kve,{children:l.jsx(oV,{ref:i,align:e,sideOffset:n,className:ce("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
876de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})}));$P.displayName=oV.displayName;var nt=function(){return nt=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},nt.apply(this,arguments)};function Gve(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function uV(t,e,n){for(var r=0,i=e.length,a;r<i;r++)(a||!(r in e))&&(a||(a=Array.prototype.slice.call(e,0,r)),a[r]=e[r]);return t.concat(a||Array.prototype.slice.call(e))}function rv(t){return t.mode==="multiple"}function iv(t){return t.mode==="range"}function $w(t){return t.mode==="single"}var Yve={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function Jve(t,e){return $e(t,"LLLL y",e)}function Xve(t,e){return $e(t,"d",e)}function Zve(t,e){return $e(t,"LLLL",e)}function Qve(t){return"".concat(t)}function eye(t,e){return $e(t,"cccccc",e)}function tye(t,e){return $e(t,"yyyy",e)}var nye=Object.freeze({__proto__:null,formatCaption:Jve,formatDay:Xve,formatMonthCaption:Zve,formatWeekNumber:Qve,formatWeekdayName:eye,formatYearCaption:tye}),rye=function(t,e,n){return $e(t,"do MMMM (EEEE)",n)},iye=function(){return"Month: "},aye=function(){return"Go to next month"},sye=function(){return"Go to previous month"},oye=function(t,e){return $e(t,"cccc",e)},cye=function(t){return"Week n. ".concat(t)},lye=function(){return"Year: "},uye=Object.freeze({__proto__:null,labelDay:rye,labelMonthDropdown:iye,labelNext:aye,labelPrevious:sye,labelWeekNumber:cye,labelWeekday:oye,labelYearDropdown:lye});function dye(){var t="buttons",e=Yve,n=eP,r={},i={},a=1,s={},o=new Date;return{captionLayout:t,classNames:e,formatters:nye,labels:uye,locale:n,modifiersClassNames:r,modifiers:i,numberOfMonths:a,styles:s,today:o,mode:"default"}}function hye(t){var e=t.fromYear,n=t.toYear,r=t.fromMonth,i=t.toMonth,a=t.fromDate,s=t.toDate;return r?a=Pr(r):e&&(a=new Date(e,0,1)),i?s=kf(i):n&&(s=new Date(n,11,31)),{fromDate:a?Qn(a):void 0,toDate:s?Qn(s):void 0}}var dV=b.createContext(void 0);function fye(t){var e,n=t.initialProps,r=dye(),i=hye(n),a=i.fromDate,s=i.toDate,o=(e=n.captionLayout)!==null&&e!==void 0?e:r.captionLayout;o!=="buttons"&&(!a||!s)&&(o="buttons");var c;($w(n)||rv(n)||iv(n))&&(c=n.onSelect);var u=nt(nt(nt({},r),n),{captionLayout:o,classNames:nt(nt({},r.classNames),n.classNames),components:nt({},n.components),formatters:nt(nt({},r.formatters),n.formatters),fromDate:a,labels:nt(nt({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:nt(nt({},r.modifiers),n.modifiers),modifiersClassNames:nt(nt({},r.modifiersClassNames),n.modifiersClassNames),onSelect:c,styles:nt(nt({},r.styles),n.styles),toDate:s});return l.jsx(dV.Provider,{value:u,children:t.children})}function rn(){var t=b.useContext(dV);if(!t)throw new Error("useDayPicker must be used within a DayPickerProvider.");return t}function hV(t){var e=rn(),n=e.locale,r=e.classNames,i=e.styles,a=e.formatters.formatCaption;return l.jsx("div",{className:r.caption_label,style:i.caption_label,"aria-live":"polite",role:"presentation",id:t.id,children:a(t.displayMonth,{locale:n})})}function pye(t){return l.jsx("svg",nt({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},t,{children:l.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.7
87678175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function fV(t){var e,n,r=t.onChange,i=t.value,a=t.children,s=t.caption,o=t.className,c=t.style,u=rn(),d=(n=(e=u.components)===null||e===void 0?void 0:e.IconDropdown)!==null&&n!==void 0?n:pye;return l.jsxs("div",{className:o,style:c,children:[l.jsx("span",{className:u.classNames.vhidden,children:t["aria-label"]}),l.jsx("select",{name:t.name,"aria-label":t["aria-label"],className:u.classNames.dropdown,style:u.styles.dropdown,value:i,onChange:r,children:a}),l.jsxs("div",{className:u.classNames.caption_label,style:u.styles.caption_label,"aria-hidden":"true",children:[s,l.jsx(d,{className:u.classNames.dropdown_icon,style:u.styles.dropdown_icon})]})]})}function mye(t){var e,n=rn(),r=n.fromDate,i=n.toDate,a=n.styles,s=n.locale,o=n.formatters.formatMonthCaption,c=n.classNames,u=n.components,d=n.labels.labelMonthDropdown;if(!r)return l.jsx(l.Fragment,{});if(!i)return l.jsx(l.Fragment,{});var h=[];if(Bde(r,i))for(var f=Pr(r),p=r.getMonth();p<=i.getMonth();p++)h.push(zS(f,p));else for(var f=Pr(new Date),p=0;p<=11;p++)h.push(zS(f,p));var g=function(v){var x=Number(v.target.value),w=zS(Pr(t.displayMonth),x);t.onChange(w)},m=(e=u==null?void 0:u.Dropdown)!==null&&e!==void 0?e:fV;return l.jsx(m,{name:"months","aria-label":d(),className:c.dropdown_month,style:a.dropdown_month,onChange:g,value:t.displayMonth.getMonth(),caption:o(t.displayMonth,{locale:s}),children:h.map(function(v){return l.jsx("option",{value:v.getMonth(),children:o(v,{locale:s})},v.getMonth())})})}function gye(t){var e,n=t.displayMonth,r=rn(),i=r.fromDate,a=r.toDate,s=r.locale,o=r.styles,c=r.classNames,u=r.components,d=r.formatters.formatYearCaption,h=r.labels.labelYearDropdown,f=[];if(!i)return l.jsx(l.Fragment,{});if(!a)return l.jsx(l.Fragment,{});for(var p=i.getFullYear(),g=a.getFullYear(),m=p;m<=g;m++)f.push(AD(SU(new Date),m));var v=function(w){var y=AD(Pr(n),Number(w.target.value));t.onChange(y)},x=(e=u==null?void 0:u.Dropdown)!==null&&e!==void 0?e:fV;return l.jsx(x,{name:"years","aria-label":h(),className:c.dropdown_year,style:o.dropdown_year,onChange:v,value:n.getFullYear(),caption:d(n,{locale:s}),children:f.map(function(w){return l.jsx("option",{value:w.getFullYear(),children:d(w,{locale:s})},w.getFullYear())})})}function vye(t,e){var n=b.useState(t),r=n[0],i=n[1],a=e===void 0?r:e;return[a,i]}function yye(t){var e=t.month,n=t.defaultMonth,r=t.today,i=e||n||r||new Date,a=t.toDate,s=t.fromDate,o=t.numberOfMonths,c=o===void 0?1:o;if(a&&kh(a,i)<0){var u=-1*(c-1);i=Or(a,u)}return s&&kh(i,s)<0&&(i=s),Pr(i)}function bye(){var t=rn(),e=yye(t),n=vye(e,t.month),r=n[0],i=n[1],a=function(s){var o;if(!t.disableNavigation){var c=Pr(s);i(c),(o=t.onMonthChange)===null||o===void 0||o.call(t,c)}};return[r,a]}function xye(t,e){for(var n=e.reverseMonths,r=e.numberOfMonths,i=Pr(t),a=Pr(Or(i,r)),s=kh(a,i),o=[],c=0;c<s;c++){var u=Or(i,c);o.push(u)}return n&&(o=o.reverse()),o}function wye(t,e){if(!e.disableNavigation){var n=e.toDate,r=e.pagedNavigation,i=e.numberOfMonths,a=i===void 0?1:i,s=r?a:1,o=Pr(t);if(!n)return Or(o,s);var c=kh(n,t);if(!(c<a))return Or(o,s)}}function Sye(t,e){if(!e.disableNavigation){var n=e.fromDate,r=e.pagedNavigation,i=e.numberOfMonths,a=i===void 0?1:i,s=r?a:1,o=Pr(t);if(!n)return Or(o,-s);var c=kh(o,n);if(!(c<=0))return Or(o,-s)}}var pV=b.createContext(void 0);function kye(t){var e=rn(),n=bye(),r=n[0],i=n[1],a=xye(r,e),s=wye(r,e),o=Sye(r,e),c=function(h){return a.some(function(f){return mw(h,f)})},u=function(h,f){c(h)||(f&&tP(h,f)?i(Or(h,1+e.numberOfMonths*-1)):i(h))},d={currentMonth:r,displayMonths:a,goToMonth:i,goToDate:u,previousMonth:o,nextMonth:s,isDateDisplayed:c};return l.jsx(pV.Provider,{value:d,children:t.children})}function av(){var t=b.useContext(pV);if(!t)throw new Error("useNavigation must be used within a NavigationProvider");return t}function nM(t){var e,n=rn(),r=n.classNames,i=n.styles,a=n.components,s=av().goToMonth,o=function(d){s(Or(d,t.dis
876playIndex?-t.displayIndex:0))},c=(e=a==null?void 0:a.CaptionLabel)!==null&&e!==void 0?e:hV,u=l.jsx(c,{id:t.id,displayMonth:t.displayMonth});return l.jsxs("div",{className:r.caption_dropdowns,style:i.caption_dropdowns,children:[l.jsx("div",{className:r.vhidden,children:u}),l.jsx(mye,{onChange:o,displayMonth:t.displayMonth}),l.jsx(gye,{onChange:o,displayMonth:t.displayMonth})]})}function _ye(t){return l.jsx("svg",nt({width:"16px",height:"16px",viewBox:"0 0 120 120"},t,{children:l.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function Cye(t){return l.jsx("svg",nt({width:"16px",height:"16px",viewBox:"0 0 120 120"},t,{children:l.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var db=b.forwardRef(function(t,e){var n=rn(),r=n.classNames,i=n.styles,a=[r.button_reset,r.button];t.className&&a.push(t.className);var s=a.join(" "),o=nt(nt({},i.button_reset),i.button);return t.style&&Object.assign(o,t.style),l.jsx("button",nt({},t,{ref:e,type:"button",className:s,style:o}))});function Tye(t){var e,n,r=rn(),i=r.dir,a=r.locale,s=r.classNames,o=r.styles,c=r.labels,u=c.labelPrevious,d=c.labelNext,h=r.components;if(!t.nextMonth&&!t.previousMonth)return l.jsx(l.Fragment,{});var f=u(t.previousMonth,{locale:a}),p=[s.nav_button,s.nav_button_previous].join(" "),g=d(t.nextMonth,{locale:a}),m=[s.nav_button,s.nav_button_next].join(" "),v=(e=h==null?void 0:h.IconRight)!==null&&e!==void 0?e:Cye,x=(n=h==null?void 0:h.IconLeft)!==null&&n!==void 0?n:_ye;return l.jsxs("div",{className:s.nav,style:o.nav,children:[!t.hidePrevious&&l.jsx(db,{name:"previous-month","aria-label":f,className:p,style:o.nav_button_previous,disabled:!t.previousMonth,onClick:t.onPreviousClick,children:i==="rtl"?l.jsx(v,{className:s.nav_icon,style:o.nav_icon}):l.jsx(x,{className:s.nav_icon,style:o.nav_icon})}),!t.hideNext&&l.jsx(db,{name:"next-month","aria-label":g,className:m,style:o.nav_button_next,disabled:!t.nextMonth,onClick:t.onNextClick,children:i==="rtl"?l.jsx(x,{className:s.nav_icon,style:o.nav_icon}):l.jsx(v,{className:s.nav_icon,style:o.nav_icon})})]})}function rM(t){var e=rn().numberOfMonths,n=av(),r=n.previousMonth,i=n.nextMonth,a=n.goToMonth,s=n.displayMonths,o=s.findIndex(function(g){return mw(t.displayMonth,g)}),c=o===0,u=o===s.length-1,d=e>1&&(c||!u),h=e>1&&(u||!c),f=function(){r&&a(r)},p=function(){i&&a(i)};return l.jsx(Tye,{displayMonth:t.displayMonth,hideNext:d,hidePrevious:h,nextMonth:i,previousMonth:r,onPreviousClick:f,onNextClick:p})}function Eye(t){var e,n=rn(),r=n.classNames,i=n.disableNavigation,a=n.styles,s=n.captionLayout,o=n.components,c=(e=o==null?void 0:o.CaptionLabel)!==null&&e!==void 0?e:hV,u;return i?u=l.jsx(c,{id:t.id,displayMonth:t.displayMonth}):s==="dropdown"?u=l.jsx(nM,{displayMonth:t.displayMonth,id:t.id}):s==="dropdown-buttons"?u=l.jsxs(l.Fragment,{children:[l.jsx(nM,{displayMonth:t.displayMonth,displayIndex:t.displayIndex,id:t.id}),l.jsx(rM,{displayMonth:t.displayMonth,displayIndex:t.displayIndex,id:t.id})]}):u=l.jsxs(l.Fragment,{children:[l.jsx(c,{id:t.id,displayMonth:t.displayMonth,displayIndex:t.displayIndex}),l.jsx(rM,{displayMonth:t.displayMonth,id:t.id})]}),l.jsx("div",{className:r.caption,style:a.caption,children:u})}function jye(t){var e=rn(),n=e.footer,r=e.styles,i=e.classNames.tfoot;return n?l.jsx("tfoot",{className:i,style:r.tfoot,children:l.jsx("tr",{children:l.jsx("td",{colSpan:8,children:n})})}):l.jsx(l.Fragment,{})}function Pye(t,e,n){for(var r=n?ou(new Date):ia(new Date,{locale:t,weekStartsOn:e}),i=[],a=0;a<7;a++){var s=jn(r,a);i.push(s)}return i}function Nye(){var t=rn(),e=t.classNames,n=t.styles,r=t.showWeekNumber,i=t.locale,a=t.weekStartsOn,s=t.ISOWeek,o=t.formatters.formatWeekdayName,c=t.labels.labelWeekday,u=Pye(i,a,s);return l.jsxs("tr",{style:n.head_row,className:e.head_row,children:[r&&l.jsx("td",{style:n.head_cell,className:e.head_cell}),u.map(function(d,h){return l.jsx("th",{scope:"col",className:e.head_cell,style:n.head_cell,"aria-label":c(d,{locale:i}),children:o(d,{locale:i})},h)})]})}function Aye(){var t,e=rn(),n=e.classNames,r=e.styles,i=e.components,a=(t=i==null?void 0:i.HeadRow)!==null&&t!==void 0?t:Nye;return l.jsx("thead",{style:r.head,className:n.head,children:l.jsx(a,{})})}function Oye(t){var e=rn(),n=e.locale,r=e.formatters.formatDay;return l.jsx(l.Fragment,{children:r(t.date,{locale:n})})}var FP=b.createContext(void 0);function Rye(t){if(!rv(t.initialProps)){var e={selected:void 0,modifiers:{disabled:[]}};return l.jsx(FP.Provider,{value:e,children:t.children})}return l.jsx(Dye,{initialProps:t.initialProps,children:t.children})}function Dye(t){var e=t.initialProps,n=t.children,r=e.selected,i=e.min,a=e.max,s=function(u,d,h){var f,p;(f=e.onDayClick)===null||f===void 0||f.call(e,u,d,h);var g=!!(d.selected&&i&&(r==null?void 0:r.length)===i);if(!g){var m=!!(!d.selected&&a&&(r==null?void 0:r.length)===a);if(!m){var v=r?uV([],r):[];if(d.selected){var x=v.findIndex(function(w){return gn(u,w)});v.splice(x,1)}else v.push(u);(p=e.onSelect)===null||p===void 0||p.call(e,v,u,d,h)}}},o={disabled:[]};r&&o.disabled.push(function(u){var d=a&&r.length>a-1,h=r.some(function(f){return gn(f,u)});return!!(d&&!h)});var c={selected:r,onDayClick:s,modifiers:o};return l.jsx(FP.Provider,{value:c,children:n})}function BP(){var t=b.useContext(FP);if(!t)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return t}function Mye(t,e){var n=e||{},r=n.from,i=n.to;return r&&i?gn(i,t)&&gn(r,t)?void 0:gn(i,t)?{from:i,to:void 0}:gn(r,t)?void 0:$m(r,t)?{from:t,to:i}:{from:r,to:t}:i?$m(t,i)?{from:i,to:t}:{from:t,to:i}:r?tP(t,r)?{from:t,to:r}:{from:r,to:t}:{from:t,to:void 0}}var UP=b.createContext(void 0);function Iye(t){if(!iv(t.initialProps)){var e={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return l.jsx(UP.Provider,{value:e,children:t.children})}return l.jsx(Lye,{initialProps:t.initialProps,children:t.children})}function Lye(t){var e=t.initialProps,n=t.children,r=e.selected,i=r||{},a=i.from,s=i.to,o=e.min,c=e.max,u=function(p,g,m){var v,x;(v=e.onDayClick)===null||v===void 0||v.call(e,p,g,m);var w=Mye(p,r);(x=e.onSelect)===null||x===void 0||x.call(e,w,p,g,m)},d={range_start:[],range_end:[],range_middle:[],disabled:[]};if(a?(d.range_start=[a],s?(d.range_end=[s],gn(a,s)||(d.range_middle=[{after:a,before:s}])):d.range_end=[a]):s&&(d.range_start=[s],d.range_end=[s]),o&&(a&&!s&&d.disabled.push({after:Up(a,o-1),before:jn(a,o-1)}),a&&s&&d.disabled.push({after:a,before:jn(a,o-1)}),!a&&s&&d.disabled.push({after:Up(s,o-1),before:jn(s,o-1)})),c){if(a&&!s&&(d.disabled.push({before:jn(a,-c+1)}),d.disabled.push({after:jn(a,c-1)})),a&&s){var h=za(s,a)+1,f=c-h;d.disabled.push({before:Up(a,f)}),d.disabled.push({after:jn(s,f)})}!a&&s&&(d.disabled.push({before:jn(s,-c+1)}),d.disabled.push({after:jn(s,c-1)}))}return l.jsx(UP.Provider,{value:{selected:r,onDayClick:u,modifiers:d},children:n})}function zP(){var t=b.useContext(UP);if(!t)throw new Error("useSelectRange must be used within a SelectRangeProvider");return t}function e0(t){return Array.isArray(t)?uV([],t):t!==void 0?[t]:[]}function $ye(t){var e={};return Object.entries(t).forEach(function(n){var r=n[0],i=n[1];e[r]=e0(i)}),e}var Qa;(function(t){t.Outside="outside",t.Disabled="disabled",t.Selected="selected",t.Hidden="hidden",t.Today="today",t.RangeStart="range_start",t.RangeEnd="range_end",t.RangeMiddle="range_middle"}
876)(Qa||(Qa={}));var Fye=Qa.Selected,Bs=Qa.Disabled,Bye=Qa.Hidden,Uye=Qa.Today,pk=Qa.RangeEnd,mk=Qa.RangeMiddle,gk=Qa.RangeStart,zye=Qa.Outside;function Wye(t,e,n){var r,i=(r={},r[Fye]=e0(t.selected),r[Bs]=e0(t.disabled),r[Bye]=e0(t.hidden),r[Uye]=[t.today],r[pk]=[],r[mk]=[],r[gk]=[],r[zye]=[],r);return t.fromDate&&i[Bs].push({before:t.fromDate}),t.toDate&&i[Bs].push({after:t.toDate}),rv(t)?i[Bs]=i[Bs].concat(e.modifiers[Bs]):iv(t)&&(i[Bs]=i[Bs].concat(n.modifiers[Bs]),i[gk]=n.modifiers[gk],i[mk]=n.modifiers[mk],i[pk]=n.modifiers[pk]),i}var mV=b.createContext(void 0);function Vye(t){var e=rn(),n=BP(),r=zP(),i=Wye(e,n,r),a=$ye(e.modifiers),s=nt(nt({},i),a);return l.jsx(mV.Provider,{value:s,children:t.children})}function gV(){var t=b.useContext(mV);if(!t)throw new Error("useModifiers must be used within a ModifiersProvider");return t}function Hye(t){return!!(t&&typeof t=="object"&&"before"in t&&"after"in t)}function qye(t){return!!(t&&typeof t=="object"&&"from"in t)}function Kye(t){return!!(t&&typeof t=="object"&&"after"in t)}function Gye(t){return!!(t&&typeof t=="object"&&"before"in t)}function Yye(t){return!!(t&&typeof t=="object"&&"dayOfWeek"in t)}function Jye(t,e){var n,r=e.from,i=e.to;if(r&&i){var a=za(i,r)<0;a&&(n=[i,r],r=n[0],i=n[1]);var s=za(t,r)>=0&&za(i,t)>=0;return s}return i?gn(i,t):r?gn(r,t):!1}function Xye(t){return Qj(t)}function Zye(t){return Array.isArray(t)&&t.every(Qj)}function Qye(t,e){return e.some(function(n){if(typeof n=="boolean")return n;if(Xye(n))return gn(t,n);if(Zye(n))return n.includes(t);if(qye(n))return Jye(t,n);if(Yye(n))return n.dayOfWeek.includes(t.getDay());if(Hye(n)){var r=za(n.before,t),i=za(n.after,t),a=r>0,s=i<0,o=$m(n.before,n.after);return o?s&&a:a||s}return Kye(n)?za(t,n.after)>0:Gye(n)?za(n.before,t)>0:typeof n=="function"?n(t):!1})}function WP(t,e,n){var r=Object.keys(e).reduce(function(a,s){var o=e[s];return Qye(t,o)&&a.push(s),a},[]),i={};return r.forEach(function(a){return i[a]=!0}),n&&!mw(t,n)&&(i.outside=!0),i}function e0e(t,e){for(var n=Pr(t[0]),r=kf(t[t.length-1]),i,a,s=n;s<=r;){var o=WP(s,e),c=!o.disabled&&!o.hidden;if(!c){s=jn(s,1);continue}if(o.selected)return s;o.today&&!a&&(a=s),i||(i=s),s=jn(s,1)}return a||i}var t0e=365;function vV(t,e){var n=e.moveBy,r=e.direction,i=e.context,a=e.modifiers,s=e.retry,o=s===void 0?{count:0,lastFocused:t}:s,c=i.weekStartsOn,u=i.fromDate,d=i.toDate,h=i.locale,f={day:jn,week:Sh,month:Or,year:Tue,startOfWeek:function(v){return i.ISOWeek?ou(v):ia(v,{locale:h,weekStartsOn:c})},endOfWeek:function(v){return i.ISOWeek?kU(v):Qg(v,{locale:h,weekStartsOn:c})}},p=f[n](t,r==="after"?1:-1);r==="before"&&u?p=Eue([u,p]):r==="after"&&d&&(p=jue([d,p]));var g=!0;if(a){var m=WP(p,a);g=!m.disabled&&!m.hidden}return g?p:o.count>t0e?o.lastFocused:vV(p,{moveBy:n,direction:r,context:i,modifiers:a,retry:nt(nt({},o),{count:o.count+1})})}var yV=b.createContext(void 0);function n0e(t){var e=av(),n=gV(),r=b.useState(),i=r[0],a=r[1],s=b.useState(),o=s[0],c=s[1],u=e0e(e.displayMonths,n),d=i??(o&&e.isDateDisplayed(o))?o:u,h=function(){c(i),a(void 0)},f=function(v){a(v)},p=rn(),g=function(v,x){if(i){var w=vV(i,{moveBy:v,direction:x,context:p,modifiers:n});
876gn(i,w)||(e.goToDate(w,i),f(w))}},m={focusedDay:i,focusTarget:d,blur:h,focus:f,focusDayAfter:function(){return g("day","after")},focusDayBefore:function(){return g("day","before")},focusWeekAfter:function(){return g("week","after")},focusWeekBefore:function(){return g("week","before")},focusMonthBefore:function(){return g("month","before")},focusMonthAfter:function(){return g("month","after")},focusYearBefore:function(){return g("year","before")},focusYearAfter:function(){return g("year","after")},focusStartOfWeek:function(){return g("startOfWeek","before")},focusEndOfWeek:function(){return g("endOfWeek","after")}};return l.jsx(yV.Provider,{value:m,children:t.children})}function VP(){var t=b.useContext(yV);if(!t)throw new Error("useFocusContext must be used within a FocusProvider");return t}function r0e(t,e){var n=gV(),r=WP(t,n,e);return r}var HP=b.createContext(void 0);function i0e(t){if(!$w(t.initialProps)){var e={selected:void 0};return l.jsx(HP.Provider,{value:e,children:t.children})}return l.jsx(a0e,{initialProps:t.initialProps,children:t.children})}function a0e(t){var e=t.initialProps,n=t.children,r=function(a,s,o){var c,u,d;if((c=e.onDayClick)===null||c===void 0||c.call(e,a,s,o),s.selected&&!e.required){(u=e.onSelect)===null||u===void 0||u.call(e,void 0,a,s,o);return}(d=e.onSelect)===null||d===void 0||d.call(e,a,a,s,o)},i={selected:e.selected,onDayClick:r};return l.jsx(HP.Provider,{value:i,children:n})}function bV(){var t=b.useContext(HP);if(!t)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return t}function s0e(t,e){var n=rn(),r=bV(),i=BP(),a=zP(),s=VP(),o=s.focusDayAfter,c=s.focusDayBefore,u=s.focusWeekAfter,d=s.focusWeekBefore,h=s.blur,f=s.focus,p=s.focusMonthBefore,g=s.focusMonthAfter,m=s.focusYearBefore,v=s.focusYearAfter,x=s.focusStartOfWeek,w=s.focusEndOfWeek,y=function(I){var R,z,O,A;$w(n)?(R=r.onDayClick)===null||R===void 0||R.call(r,t,e,I):rv(n)?(z=i.onDayClick)===null||z===void 0||z.call(i,t,e,I):iv(n)?(O=a.onDayClick)===null||O===void 0||O.call(a,t,e,I):(A=n.onDayClick)===null||A===void 0||A.call(n,t,e,I)},k=function(I){var R;f(t),(R=n.onDayFocus)===null||R===void 0||R.call(n,t,e,I)},S=function(I){var R;h(),(R=n.onDayBlur)===null||R===void 0||R.call(n,t,e,I)},_=function(I){var R;(R=n.onDayMouseEnter)===null||R===void 0||R.call(n,t,e,I)},C=function(I){var R;(R=n.onDayMouseLeave)===null||R===void 0||R.call(n,t,e,I)},T=function(I){var R;(R=n.onDayPointerEnter)===null||R===void 0||R.call(n,t,e,I)},E=function(I){var R;(R=n.onDayPointerLeave)===null||R===void 0||R.call(n,t,e,I)},j=function(I){var R;(R=n.onDayTouchCancel)===null||R===void 0||R.call(n,t,e,I)},P=function(I){var R;(R=n.onDayTouchEnd)===null||R===void 0||R.call(n,t,e,I)},M=function(I){var R;(R=n.onDayTouchMove)===null||R===void 0||R.call(n,t,e,I)},U=function(I){var R;(R=n.onDayTouchStart)===null||R===void 0||R.call(n,t,e,I)},N=function(I){var R;(R=n.onDayKeyUp)===null||R===void 0||R.call(n,t,e,I)},B=function(I){var R;switch(I.key){case"ArrowLeft":I.preventDefault(),I.stopPropagation(),n.dir==="rtl"?o():c();break;case"ArrowRight":I.preventDefault(),I.stopPropagation(),n.dir==="rtl"?c():o();break;case"ArrowDown":I.preventDefault(),I.stopPropagation(),u();break;case"ArrowUp":I.preventDefault(),I.stopPropagation(),d();break;case"PageUp":I.preventDefault(),I.stopPropagation(),I.shiftKey?m():p();break;case"PageDown":I.preventDefault(),I.stopPropagation(),I.shiftKey?v():g();break;case"Home":I.preventDefault(),I.stopPropagation(),x();break;case"End":I.preventDefault(),I.stopPropagation(),w();break}(R=n.onDayKeyDown)===null||R===void 0||R.call(n,t,e,I)},$={onClick:y,onFocus:k,onBlur:S,onKeyDown:B,onKeyUp:N,onMouseEnter:_,onMouseLeave:C,onPointerEnter:T,onPointerLeave:E,onTouchCancel:j,onTouchEnd:P,onTouchMove:M,onTouchStart:U};return $}function o0e(){var t=rn(),e=bV(),n=BP(),r=zP(),i=$w(t)?e.selected:rv(t)?n.selected:iv(t)?r.selected:void 0;return i}function c0e(t){return Object.values(Qa).includes(t)}function l0e(t,e){var n=[t.classNames.day];return Object.keys(e).forEach(function(r){var i=t.modifiersClassNames[r];if(i)n.push(i);else if(c0e(r)){var a=t.classNames["day_".concat(r)];a&&n.push(a)}}),n}function u0e(t,e){var n=nt({},t.styles.day);return Object.keys(e).forEach(function(r){var i;n=nt(nt({},n),(i=t.modifiersStyles)===null||i===void 0?void 0:i[r])}),n}function d0e(t,e,n){var r,i,a,s=rn(),o=VP(),c=r0e(t,e),u=s0e(t,c),d=o0e(),h=!!(s.onDayCl
876ick||s.mode!=="default");b.useEffect(function(){var _;c.outside||o.focusedDay&&h&&gn(o.focusedDay,t)&&((_=n.current)===null||_===void 0||_.focus())},[o.focusedDay,t,n,h,c.outside]);var f=l0e(s,c).join(" "),p=u0e(s,c),g=!!(c.outside&&!s.showOutsideDays||c.hidden),m=(a=(i=s.components)===null||i===void 0?void 0:i.DayContent)!==null&&a!==void 0?a:Oye,v=l.jsx(m,{date:t,displayMonth:e,activeModifiers:c}),x={style:p,className:f,children:v,role:"gridcell"},w=o.focusTarget&&gn(o.focusTarget,t)&&!c.outside,y=o.focusedDay&&gn(o.focusedDay,t),k=nt(nt(nt({},x),(r={disabled:c.disabled,role:"gridcell"},r["aria-selected"]=c.selected,r.tabIndex=y||w?0:-1,r)),u),S={isButton:h,isHidden:g,activeModifiers:c,selectedDays:d,buttonProps:k,divProps:x};return S}function h0e(t){var e=b.useRef(null),n=d0e(t.date,t.displayMonth,e);return n.isHidden?l.jsx("div",{role:"gridcell"}):n.isButton?l.jsx(db,nt({name:"day",ref:e},n.buttonProps)):l.jsx("div",nt({},n.divProps))}function f0e(t){var e=t.number,n=t.dates,r=rn(),i=r.onWeekNumberClick,a=r.styles,s=r.classNames,o=r.locale,c=r.labels.labelWeekNumber,u=r.formatters.formatWeekNumber,d=u(Number(e),{locale:o});if(!i)return l.jsx("span",{className:s.weeknumber,style:a.weeknumber,children:d});var h=c(Number(e),{locale:o}),f=function(p){i(e,n,p)};return l.jsx(db,{name:"week-number","aria-label":h,className:s.weeknumber,style:a.weeknumber,onClick:f,children:d})}function p0e(t){var e,n,r=rn(),i=r.styles,a=r.classNames,s=r.showWeekNumber,o=r.components,c=(e=o==null?void 0:o.Day)!==null&&e!==void 0?e:h0e,u=(n=o==null?void 0:o.WeekNumber)!==null&&n!==void 0?n:f0e,d;return s&&(d=l.jsx("td",{className:a.cell,style:i.cell,children:l.jsx(u,{number:t.weekNumber,dates:t.dates})})),l.jsxs("tr",{className:a.row,style:i.row,children:[d,t.dates.map(function(h){return l.jsx("td",{className:a.cell,style:i.cell,role:"presentation",children:l.jsx(c,{displayMonth:t.displayMonth,date:h})},Lde(h))})]})}function iM(t,e,n){for(var r=n!=null&&n.ISOWeek?kU(e):Qg(e,n),i=n!=null&&n.ISOWeek?ou(t):ia(t,n),a=za(r,i),s=[],o=0;o<=a;o++)s.push(jn(i,o));var c=s.reduce(function(u,d){var h=n!=null&&n.ISOWeek?_U(d):TU(d,n),f=u.find(function(p){return p.weekNumber===h});return f?(f.dates.push(d),u):(u.push({weekNumber:h,dates:[d]}),u)},[]);return c}function m0e(t,e){var n=iM(Pr(t),kf(t),e);if(e!=null&&e.useFixedWeeks){var r=Fde(t,e);if(r<6){var i=n[n.length-1],a=i.dates[i.dates.length-1],s=Sh(a,6-r),o=iM(Sh(a,1),s,e);n.push.apply(n,o)}}return n}function g0e(t){var e,n,r,i=rn(),a=i.locale,s=i.classNames,o=i.styles,c=i.hideHead,u=i.fixedWeeks,d=i.components,h=i.weekStartsOn,f=i.firstWeekContainsDate,p=i.ISOWeek,g=m0e(t.displayMonth,{useFixedWeeks:!!u,ISOWeek:p,locale:a,weekStartsOn:h,firstWeekContainsDate:f}),m=(e=d==null?void 0:d.Head)!==null&&e!==void 0?e:Aye,v=(n=d==null?void 0:d.Row)!==null&&n!==void 0?n:p0e,x=(r=d==null?void 0:d.Footer)!==null&&r!==void 0?r:jye;return l.jsxs("table",{id:t.id,className:s.table,style:o.table,role:"grid","aria-labelledby":t["aria-labelledby"],children:[!c&&l.jsx(m,{}),l.jsx("tbody",{className:s.tbody,style:o.tbody,children:g.map(function(w){return l.jsx(v,{displayMonth:t.displayMonth,dates:w.dates,weekNumber:w.weekNumber},w.weekNumber)})}),l.jsx(x,{displayMonth:t.displayMonth})]})}function v0e(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var y0e=v0e()?b.useLayoutEffect:b.useEffect,vk=!1,b0e=0;function aM(){return"react-day-picker-".concat(++b0e)}function x0e(t){var e,n=t??(vk?aM():null),r=b.useState(n),i=r[0],a=r[1];return y0e(function(){i===null&&a(aM())},[]),b.useEffect(function(){vk===!1&&(vk=!0)},[]),(e=t??i)!==null&&e!==void 0?e:void 0}function w0e(t){var e,n,r=rn(),i=r.dir,a=r.classNames,s=r.styles,o=r.components,c=av().displayMonths,u=x0e(r.id?"".concat(r.id,"-").concat(t.displayIndex):void 0),d=r.id?"".concat(r.id,"-grid-").concat(t.displayIndex):void 0,h=[a.month],f=s.month,p=t.displayIndex===0,g=t.displayIndex===c.length-1,m=!p&&!g;i==="rtl"&&(e=[p,g],g=e[0],p=e[1]),p&&(h.push(a.caption_start),f=nt(nt({},f),s.caption_start)),g&&(h.push(a.caption_end),f=nt(nt({},f),s.caption_end)),m&&(h.push(a.caption_between),f=nt(nt({},f),s.caption_between));var v=(n=o==null?void 0:o.Caption)!==null&&n!==void 0?n:Eye;return l.jsxs("div",{className:h.join(" "),style:f,children:[l.jsx(v,{id:u,displayMonth:t.displayMonth,displayIndex:t.displayIndex}),l.jsx(g0e,{id:d,"aria-labelledby":u,displayMonth:t.displayMonth})]},t.displayIndex)}function S0e(t){var e=rn(),n=e.classNames,r=e.styles;return l.jsx("div",{className:n.months,style:r.months,children:t.children})}function k0e(t){var e,n,r=t.initialProps,i=rn(),a=VP(),s=av(),o=b.useState(!1),c=o[0],u=o[1];b.useEffect(function(){i.initialFocus&&a.focusTarget&&(c||(a.focus(a.focusTarget),u(!0)))},[i.initialFocus,c,a.focus,a.focusTarget,a]);var d=[i.classNames.root,i.className];i.numberOfMonths>1&&d.push(i.classNames.multiple_months),i.showWeekNumber&&d.push(i.classNames.with_weeknumber);var h=nt(nt({},i.styles.root),i.style),f=Object.keys(r).filter(function(g){return g.startsWith("data-")}).reduce(function(g,m){var v;return nt(nt({},g),(v={},v[m]=r[m],v))},{}),p=(n=(e=r.components)===null||e===void 0?void 0:e.Months)!==null&&n!==void 0?n:S0e;return l.jsx("div",nt({className:d.join(" "),style:h,dir:i.dir,id:i.id,nonce:r.nonce,title:r.title,lang:r.lang},f,{children:l.jsx(p,{children:s.displayMonths.map(function(g,m){return l.jsx(w0e,{displayIndex:m,displayMonth:g},m)})})}))}function _0e(t){var e=t.children,n=Gve(t,["children"]);return l.jsx(fye,{initialProps:n,children:l.jsx(kye,{children:l.jsx(i0e,{initialProps:n,children:l.jsx(Rye,{initialProps:n,children:l.jsx(Iye,{initialProps:n,children:l.jsx(Vye,{children:l.jsx(n0e,{children:e})})})})})})})}function C0e(t){return l.jsx(_0e,nt({},t,{children:l.jsx(k0e,{initialProps:t})}))}function qP({className:t,classNames:e,showOutsideDays:n=!0,...r}){return l.jsx(C0e,{showOutsideDays:n,className:ce("p-3",t),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:sp
876ace-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:ce(Om({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:ce(Om({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...e},components:{IconLeft:({...i})=>l.jsx(ch,{className:"h-4 w-4"}),IconRight:({...i})=>l.jsx(lh,{className:"h-4 w-4"})},...r})}qP.displayName="Calendar";const T0e=()=>{const t=[];for(let e=0;e<24;e++){const n=(6+e)%24,r=new Date(2e3,0,1,n,0);t.push($e(r,"h a").toLowerCase())}return t},is=T0e(),E0e=()=>{const e=new Date().getHours();return e>=6?e-6:e+18},KP=({calendarId:t,canEdit:e})=>{const[n,r]=b.useState(new Date),[i,a]=b.useState(new Date),[s,o]=b.useState(null),[c,u]=b.useState(!1),[d,h]=b.useState(null),[f,p]=b.useState({}),[g,m]=b.useState(!0),[v,x]=b.useState(!1),[w,y]=b.useState(void 0),[k,S]=b.useState(void 0),[_,C]=b.useState(!1),[T,E]=b.useState(null),[j,P]=b.useState(null),[M,U]=b.useState(null),[N,B]=b.useState(null),[$,I]=b.useState(null),[R,z]=b.useState(null),[O,A]=b.useState(!1),[L,V]=b.useState(null),[Y,Q]=b.useState(null),[re,J]=b.useState(!1),[ne,G]=b.useState(null),[Z,ee]=b.useState(null),[K,oe]=b.useState(!1),[W,H]=b.useState(!1),{palette:q}=bf(),{fetchEvents:te,isSharedAccess:he}=wu(),xe=b.useRef(null),De=b.useRef(!1),ge=ia(n,{weekStartsOn:1}),Re=Qg(n,{weekStartsOn:1}),Oe=Array.from({length:7},(se,Ne)=>jn(ge,Ne)),ye=(se=10)=>{"vibrate"in navigator&&navigator.vibrate(se)};b.useEffect(()=>{Ct()},[t,n,q]),b.useEffect(()=>{const se=setInterval(()=>{a(new Date)},6e4);return()=>clearInterval(se)},[]),b.useEffect(()=>{if(t==="demo"||g||he)return;const se=setTimeout(()=>{const Ne=me.channel("week-events-changes").on("postgres_changes",{event:"*",schema:"public",table:"events",filter:`calendar_id=eq.${t}`},Ae=>{console.log("Realtime week event change detected:",Ae),H(!0),Ct()}).subscribe();return()=>{me.removeChannel(Ne)}},500);return()=>clearTimeout(se)},[t,n,q,g,he]);const Ct=async()=>{m(!0);const{data:se,error:Ne}=await te(t,{startDate:ge,endDate:Re});if(Ne){console.error("Error fetching week events:",Ne),m(!1);return}const Ae={};(se||[]).forEach(Be=>{xw(Be,ge,Rc(Re)).forEach(It=>{const pi=It.displayStart,Ou=It.displayEnd,gv=Ou.getTime()-pi.getTime(),Ru=Math.floor(gv/(1e3*60*60)),$t=Math.floor(gv%(1e3*60*60)/(1e3*60));let fa="";It.isMultiDay&&It.isContinuation?fa="All day":Ru>0&&$t>0?fa=`${Ru}h ${$t}m`:Ru>0?fa=`${Ru}h`:$t>0&&(fa=`${$t}m`);const $f=It.dateKey;Ae[$f]||(Ae[$f]=[]);const bG=ev(Be.title,q),xG=It.isContinuation?"12 am":$e(pi,"h a").toLowerCase();Ae[$f].push({id:It.isContinuation?`${Be.id}-${It.dateKey}`:Be.id,title:Be.title,time:xG,startTime:It.isContinuation?"12:00 AM":$e(pi,"h:mm a"),endTime:It.continuesNext?"11:59 PM":$e(Ou,"h:mm a"),duration:fa,color:Be.color||"blue",rawStartTime:Be.start_time,rawEndTime:Be.end_time,rawUpdatedAt:Be.updated_at,notes:Be.notes,location:Be.location,participants:Be.participants||void 0,colorSet
876:bG,isRecurring:Be.is_recurring,recurrencePattern:Be.recurrence_pattern,recurrenceParentId:Be.recurrence_parent_id,createdTimezone:Be.created_timezone,language:Be.language||void 0,isContinuation:It.isContinuation,continuesNext:It.continuesNext,isMultiDay:It.isMultiDay})})}),Object.keys(Ae).forEach(Be=>{Ae[Be].sort((gt,It)=>{if(gt.isContinuation&&!It.isContinuation)return-1;if(!gt.isContinuation&&It.isContinuation)return 1;const pi=new Date(gt.rawStartTime||"").getTime(),Ou=new Date(It.rawStartTime||"").getTime();return pi-Ou})}),p(Ae),m(!1)},le=se=>{const Ne=$e(se,"yyyy-MM-dd");return f[Ne]||[]},Te=(se,Ne)=>{const Ae=Ne.currentTarget.getBoundingClientRect();h(Ae),o(se),u(!0)},Pe=(se,Ne)=>{const[Ae,Be]=Ne.split(" ");let gt=parseInt(Ae);Be.toLowerCase()==="pm"&>!==12&&(gt+=12),Be.toLowerCase()==="am"&>===12&&(gt=0);const It=new Date(se);return It.setHours(gt,0,0,0),It},st=(se,Ne,Ae)=>{e&&(Ae.preventDefault(),ye(15),C(!0),E({day:se,timeSlot:Ne}),P({day:se,timeSlot:Ne}))},Mt=(se,Ne)=>{if(!e||!_)return;const Ae=j==null?void 0:j.timeSlot;P({day:se,timeSlot:Ne}),Ae!==Ne&&ye(5)},yn=()=>{if(!(!e||!_||!T||!j)){if(C(!1),ye([10,50,10]),$e(T.day,"yyyy-MM-dd")===$e(j.day,"yyyy-MM-dd")){const se=Pe(T.day,T.timeSlot),Ne=is.indexOf(j.timeSlot),Ae=Pe(j.day,is[Math.min(Ne+1,is.length-1)]);y(se),S(Ae),x(!0)}E(null),P(null)}},Kn=(se,Ne,Ae)=>{if(!e)return;const Be=Ae.touches[0];Q({x:Be.clientX,y:Be.clientY}),J(!1),L&&clearTimeout(L);const gt=setTimeout(()=>{ye([20,100,20]),J(!0),C(!0),E({day:se,timeSlot:Ne}),P({day:se,timeSlot:Ne})},1e3);V(gt)},an=se=>{const Ne=document.elementFromPoint(se.clientX,se.clientY);if(!Ne)return null;const Ae=Ne.closest("[data-day][data-timeslot]");if(!Ae)return null;const Be=Ae.getAttribute("data-day"),gt=Ae.getAttribute("data-timeslot");return!Be||!gt?null:{day:new Date(Be),timeSlot:gt}},He=se=>{if(!e)return;const Ne=se.touches[0];if(Y&&!re){const Be=Math.abs(Ne.clientX-Y.x),gt=Math.abs(Ne.clientY-Y.y);if(Be>10||gt>10){L&&(clearTimeout(L),V(null)),Q(null);return}}if(!_||!re)return;se.preventDefault();const Ae=an(Ne);if(Ae){const Be=j==null?void 0:j.timeSlot;P(Ae),Be!==Ae.timeSlot&&ye(5)}},hi=se=>{if(L&&(clearTimeout(L),V(null)),Q(null),!!e){if(!_||!re||!T||!j){C(!1),J(!1),E(null),P(null);return}if(se.preventDefault(),C(!1),J(!1),ye([10,50,10]),$e(T.day,"yyyy-MM-dd")===$e(j.day,"yyyy-MM-dd")){const Ne=Pe(T.day,T.timeSlot),Ae=is.indexOf(j.timeSlot),Be=Pe(j.day,is[Math.min(Ae+1,is.length-1)]);y(Ne),S(Be),x(!0)}E(null),P(null)}},fi=(se,Ne)=>{if(!_||!T||!j||$e(se,"yyyy-MM-dd")!==$e(T.day,"yyyy-MM-dd"))return!1;const Ae=is.indexOf(T.timeSlot),Be=is.indexOf(j.timeSlot),gt=is.indexOf(Ne),It=Math.min(Ae,Be),pi=Math.max(Ae,Be);return gt>=It&><=pi},yr=b.useCallback(se=>{if(!e||!De.current||!xe.current)return;se.preventDefault();const Ne=se.touches[0];console.log("â
Dragging event...",{x:Ne.clientX,y:Ne.clientY});const Ae=document.elementFromPoint(Ne.clientX,Ne.clientY);if(!Ae)return;const Be=Ae.closest("[data-day][data-timeslot]");if(!Be)return;const gt=Be.getAttribute("data-day"),It=Be.getAttribute("data-timeslot");if(gt&&It){const pi={day:new Date(gt),timeSlot:It};console.log("ð¯ Drop target:",pi.day.toDateString(),pi.timeSlot),B(pi),ye(5)}},[e]),Lf=b.useCallback((se,Ne)=>{if(!e)return;Ne.stopPropagation(),console.log("ð¢ Touch start:",se.title);const Ae=Ne.touches[0];ee({x:Ae.clientX,y:Ae.clientY}),oe(!1),De.current=!1,ne&&clearTimeout(ne);const Be=setTimeout(()=>{console.log("â° Long press activated:",se.title),ye([30,150,30]),oe(!0),De.current=!0,U(se),xe.current=se,document.addEventListener("touchmove",yr,{passive:!1})},1500);G(Be)},[e,ne,yr]),ju=b.useCallback(se=>{if(!e||!Z)return;const Ne=se.touches[0],Ae=Math.abs(Ne.clientX-Z.x),Be=Math.abs(Ne.clientY-Z.y);(Ae>15||Be>15)&&(console.log("â ï¸ Movement detected, cancelling"),ne&&(clearTimeout(ne),G(null)),ee(null))},[e,Z,ne]),Pu=b.useCallback(se=>{if(console.log("ð´ Touch end - longPress:",De.current),document.removeEventListener("touchmove",yr),ne&&(clearTimeout(ne),G(null)),ee(null),!!e){if(!De.current||!xe.current){console.log("Not a long press"),oe(!1),De.current=!1,U(null),xe.current=null,B(null);return}se.preventDefault(),se.stopPropagation(),console.log("â
Completing drag"),Nu(),oe(!1),De.current=!1,xe.current=null}},[e,ne,yr]);b.useEffect(()=>()=>{L&&clearTimeout(L),ne&&clearTimeout(ne),document.removeEventListener("touchmove",yr)},[L,ne,yr]);
876const Nu=async()=>{if(!M||!N){U(null),B(null);return}try{ye([10,50,10]);const se=new Date(M.rawStartTime),Ae=new Date(M.rawEndTime).getTime()-se.getTime(),Be=Pe(N.day,N.timeSlot),gt=new Date(Be.getTime()+Ae),{error:It}=await me.from("events").update({start_time:Be.toISOString(),end_time:gt.toISOString()}).eq("id",M.id);if(It)throw It;await Ct()}catch(se){console.error("Error rescheduling event:",se)}finally{U(null),B(null)}},Qc=(se,Ne,Ae)=>{M&&(Ae.preventDefault(),Ae.dataTransfer.dropEffect="move",B({day:se,timeSlot:Ne}))},Li=se=>{se.preventDefault(),Nu()},Au=(se,Ne)=>!M||!N?!1:$e(se,"yyyy-MM-dd")===$e(N.day,"yyyy-MM-dd")&&Ne===N.timeSlot,ie=se=>{I({x:se.touches[0].clientX,y:se.touches[0].clientY})},je=se=>{z({x:se.touches[0].clientX,y:se.touches[0].clientY})},Qe=()=>{if(!$||!R)return;const se=$.x-R.x,Ne=$.y-R.y;Math.abs(se)>Math.abs(Ne)&&Math.abs(se)>50&&(ye(15),se>0?r(Sh(n,1)):r(OD(n,1))),I(null),z(null)},tt=se=>{se&&(ye(15),r(se),A(!1))};return l.jsxs(l.Fragment,{children:[l.jsx(yw,{show:W,onHide:()=>H(!1)}),l.jsx(vw,{event:s,open:c,onOpenChange:u,cardRect:d,calendarId:t,onEventUpdated:Ct,canEdit:e}),l.jsx(tv,{open:v,onOpenChange:x,calendarId:t,onEventCreated:Ct,initialDateTime:w,initialEndDateTime:k}),l.jsxs("div",{className:"max-w-md md:max-w-4xl lg:max-w-6xl mx-auto px-3 md:px-6 animate-fade-in flex flex-col h-[calc(100vh-140px)] md:h-[calc(100vh-160px)] overflow-hidden",onMouseLeave:()=>{_&&(C(!1),E(null),P(null))},children:[l.jsxs("div",{className:"flex-shrink-0 flex items-center justify-center gap-2 md:gap-6 mb-3 md:mb-6 animate-scale-in touch-pan-y",onTouchStart:ie,onTouchMove:je,onTouchEnd:Qe,children:[l.jsx(ch,{className:"text-muted-foreground cursor-pointer hover:text-foreground transition-all duration-300 hover:scale-125 hover:-translate-x-1 touch-manipulation min-w-[44px] min-h-[44px] flex-shrink-0",onClick:()=>r(OD(n,1))}),l.jsxs(cV,{open:O,onOpenChange:A,children:[l.jsx(lV,{asChild:!0,children:l.jsxs("h2",{className:"text-sm md:text-3xl lg:text-4xl font-bold text-center select-none cursor-pointer hover:text-primary transition-colors truncate",children:[$e(ge,"MMM d")," - ",$e(jn(ge,6),"MMM d, yyyy")]})}),l.jsx($P,{className:"w-auto p-0 bg-background border-border z-50",align:"center",children:l.jsx(qP,{mode:"single",selected:n,onSelect:tt,initialFocus:!0,className:ce("p-3 pointer-events-auto")})})]}),l.jsx(lh,{className:"text-muted-foreground cursor-pointer hover:text-foreground transition-all duration-300 hover:scale-125 hover:translate-x-1 touch-manipulation min-w-[44px] min-h-[44px] flex-shrink-0",onClick:()=>r(Sh(n,1))})]}),l.jsx("div",{className:"-mx-3 md:mx-0 flex-1 overflow-auto scroll-smooth scrollbar-thin scrollbar-thumb-primary/20 scrollbar-track-transparent hover:scrollbar-thumb-primary/40",children:l.jsxs("div",{className:"min-w-[650px] md:min-w-0 relative",children:[l.jsxs("div",{className:"sticky top-0 z-30 bg-background pb-2 flex gap-0",children:[l.jsx("div",{className:"flex-shrink-0 w-14 md:w-16 lg:w-20 bg-background sticky left-0 z-40"}),l.jsx("div",{className:"flex-1 grid grid-cols-7 gap-1 md:gap-2 lg:gap-3",children:Oe.map((se,Ne)=>{const Ae=$e(se,"yyyy-MM-dd")===$e(new Date,"yyyy-MM-dd");return l.jsxs("div",{className:"text-center p-2 md:p-3 lg:p-4 rounded-xl md:rounded-2xl transition-all duration-300 hover:scale-105 bg-muted",children:[l.jsx("p",{className:"text-[10px] md:text-xs lg:text-sm font-medium opacity-80 mb-1",children:$e(se,"EEE")}),l.jsx("p",{className:`text-lg md:text-2xl lg:text-3xl font-bold ${Ae?"bg-primary text-primary-foreground w-10 h-10 md:w-12 md:h-12 lg:w-14 lg:h-14 rounded-full flex items-center justify-center mx-auto":""}`,children:$e(se,"dd")})]},se.toISOString())})})]}),l.jsx("div",{className:"mt-3 md:mt-4 space-y-1 md:space-y-2 lg:space-y-3",children:is.map((se,Ne)=>l.jsxs("div",{className:"flex gap-0 animate-fade-in",style:{animationDelay:`${.3+Ne*.05}s`,opacity:0,animationFillMode:"forwards"},children:[l.jsx("div",{className:"flex-shrink-0 w-14 md:w-16 lg:w-20 bg-background border-r border-border/50 sticky left-0 z-20",children:l.jsx("div",{className:"text-[10px] md:text-sm lg:text-base font-medium text-muted-foreground text-right pr-2 py-1 md:py-2 min-h-[36px] md:min-
876h-[60px] lg:min-h-[70px] flex items-start justify-end",children:se})}),l.jsx("div",{className:"flex-1 grid grid-cols-7 gap-1 md:gap-2 lg:gap-3",children:Oe.map(Ae=>{const gt=le(Ae).filter($t=>{const fa=$t.time.toLowerCase().trim(),$f=se.toLowerCase().trim();return fa===$f}),It=fi(Ae,se),pi=Au(Ae,se),Ou=$e(Ae,"yyyy-MM-dd")===$e(i,"yyyy-MM-dd"),gv=Ne===E0e(),Ru=i.getMinutes()/60*100;return l.jsxs("div",{"data-day":$e(Ae,"yyyy-MM-dd"),"data-timeslot":se,className:`relative min-h-[36px] md:min-h-[60px] lg:min-h-[70px] rounded-lg md:rounded-xl transition-all duration-200 touch-manipulation ${gt.length>0?"p-0.5 md:p-1 lg:p-2 bg-muted/40":pi?"bg-green-500/30 flex items-center justify-center cursor-pointer border-2 border-green-500":It?"bg-primary/30 flex items-center justify-center cursor-pointer":"bg-muted/40 hover:bg-muted/60 flex items-center justify-center cursor-pointer"}`,onMouseDown:$t=>gt.length===0&&!M&&st(Ae,se,$t),onMouseEnter:()=>gt.length===0&&!M&&Mt(Ae,se),onMouseUp:yn,onTouchStart:$t=>{gt.length===0&&!M&&Kn(Ae,se,$t)},onTouchMove:He,onTouchEnd:hi,onTouchCancel:()=>{L&&(clearTimeout(L),V(null)),Q(null),J(!1),C(!1),E(null),P(null)},onDragOver:$t=>Qc(Ae,se,$t),onDrop:Li,children:[Ou&&gv&&l.jsx("div",{className:"absolute left-0 right-0 z-10 pointer-events-none",style:{top:`${Ru}%`},children:l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"w-2 h-2 rounded-full bg-red-500 -ml-1"}),l.jsx("div",{className:"flex-1 h-0.5 bg-red-500"})]})}),gt.length>0?l.jsx("div",{className:"flex flex-col gap-1 md:gap-2 h-full",children:gt.map($t=>l.jsxs("div",{onClick:fa=>{!M&&!K&&Te($t,fa)},onTouchStart:fa=>Lf($t,fa),onTouchMove:ju,onTouchEnd:Pu,onTouchCancel:()=>{document.removeEventListener("touchmove",yr),ne&&(clearTimeout(ne),G(null)),ee(null),oe(!1),De.current=!1,U(null),xe.current=null,B(null)},className:`hover:scale-105 hover:shadow-md text-[9px] md:text-xs lg:text-sm font-bold px-2 md:px-3 lg:px-4 py-1 md:py-2 lg:py-3 rounded flex-1 flex flex-col items-center justify-center gap-0.5 min-h-[28px] md:min-h-[40px] lg:min-h-[50px] text-center leading-tight break-words whitespace-normal border-2 border-background/20 shadow-sm transition-all touch-manipulation select-none ${(M==null?void 0:M.id)===$t.id?"opacity-50 scale-95 ring-4 ring-primary animate-pulse":""}`,style:{backgroundColor:$t.colorSet?$t.colorSet.background:`hsl(var(--calendar-${$t.color}))`,color:$t.colorSet?$t.colorSet.textClass==="text-gray-900"?"#111827":"#ffffff":"#111827",transition:"background-color 0.5s ease-in-out, color 0.5s ease-in-out, transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out",WebkitUserSelect:"none",userSelect:"none",WebkitTouchCallout:"none"},children:[l.jsx("span",{className:"truncate w-full",children:$t.title}),($t.location||$t.notes)&&l.jsxs("div",{className:"hidden md:flex flex-col items-center gap-0.5 w-full opacity-80 font-normal",children:[$t.location&&l.jsxs("span",{className:"flex items-center gap-1 text-[8px] lg:text-[10px] truncate max-w-full",children:[l.jsx(df,{className:"h-2 w-2 lg:h-2.5 lg:w-2.5 flex-shrink-0"}),l.jsx("span",{className:"truncate",children:$t.location})]}),$t.notes&&l.jsxs("span",{className:"flex items-center gap-1 text-[8px] lg:text-[10px] truncate max-w-full",children:[l.jsx(Wg,{className:"h-2 w-2 lg:h-2.5 lg:w-2.5 flex-shrink-0"}),l.jsx("span",{className:"truncate",children:$t.notes})]})]})]},$t.id))}):l.jsx("div",{className:"w-7 h-7 md:w-8 md:h-8 lg:w-10 lg:h-10 flex items-center justify-center rounded-full border-2 border-foreground
876/10 hover:border-foreground/30 transition-all duration-200 hover:scale-110 hover:rotate-90 opacity-0 hover:opacity-100 touch-manipulation",children:l.jsx(pl,{className:"h-3 w-3 lg:h-4 lg:w-4 text-foreground/40"})})]},Ae.toISOString())})})]},se))})]})})]})]})};function j0e(t,e){return t.date.getTime()-e.date.getTime()}function xV(t,e){if(t.isContinuation&&!e.isContinuation)return-1;if(!t.isContinuation&&e.isContinuation)return 1;const n=new Date(t.rawStartTime||"").getTime(),r=new Date(e.rawStartTime||"").getTime();return Number.isNaN(n)&&Number.isNaN(r)?0:Number.isNaN(n)?1:Number.isNaN(r)?-1:n-r}const P0e=()=>{const t=[{title:"Team Meeting",color:"mint",bgColor:"hsl(165, 70%, 85%)",textColor:"#111827"},{title:"Doctor Appointment",color:"blue",bgColor:"hsl(220, 75%, 80%)",textColor:"#ffffff"},{title:"Lunch with Family",color:"chartreuse",bgColor:"hsl(75, 70%, 75%)",textColor:"#111827"}];return l.jsxs("div",{className:"relative",children:[l.jsxs("div",{className:"text-center mb-6 space-y-1",children:[l.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"No events this month"}),l.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Here's how your events will appear"})]}),l.jsx("div",{className:"relative h-[280px] flex items-center justify-center",children:t.map((e,n)=>{const r=n===0?-8:n===1?0:8,i=1,a=30-n*10,s=n*-40,o=n*30;return l.jsx("div",{className:"absolute w-full max-w-[280px]",style:{transform:`rotate(${r}deg) scale(${i}) translateY(${s}px) translateX(${o}px)`,zIndex:a,animation:`spreadCards 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) ${n*.15}s both`},children:l.jsxs("div",{className:"bg-muted rounded-2xl p-4 border-2 border-dashed border-border/50 shadow-lg",children:[l.jsx("div",{className:"grid grid-cols-7 gap-1 mb-3",children:["M","T","W","T","F","S","S"].map((c,u)=>l.jsx("div",{className:"text-[8px] font-semibold text-muted-foreground text-center",children:c},u))}),l.jsx("div",{className:"grid grid-cols-7 gap-1",children:Array.from({length:14}).map((c,u)=>{const d=u===8;return l.jsxs("div",{className:"aspect-square rounded-md bg-background/50 flex items-center justify-center relative",children:[l.jsx("span",{className:"text-[9px] text-muted-foreground/70",children:u+1}),d&&l.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-[3px] rounded-full mx-0.5 mb-0.5",style:{backgroundColor:e.bgColor}})]},u)})}),l.jsx("div",{className:"mt-3 flex justify-center",children:l.jsx("div",{className:"text-[10px] px-3 py-1.5 rounded-lg font-medium border-2 border-white/20 shadow-sm",style:{backgroundColor:e.bgColor,color:e.textColor},children:e.title})})]})},n)})}),l.jsx("p",{className:"text-xs text-center text-muted-foreground/50 mt-4",children:"Add your first event to get started"})]})},N0e=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],GP=({calendarId:t,canEdit:e})=>{const[n,r]=b.useState(new Date),[i,a]=b.useState(null),[s,o]=b.useState(!1),[c,u]=b.useState(null),[d,h]=b.useState({}),[f,p]=b.useState(!0),[g,m]=b.useState(!1),[v,x]=b.useState(void 0),[w,y]=b.useState(!1),{palette:k}=bf(),{fetchEvents:S,isSharedAccess:_}=wu(),C=Pr(n),T=kf(n),E=ia(C,{weekStartsOn:1}),j=Qg(T,{weekStartsOn:1});b.useEffect(()=>{P()},[t,n,k]),b.useEffect(()=>{if(t==="demo"||f||_)return;const R=setTimeout(()=>{const z=me.channel("month-events-changes").on("postgres_changes",{event:"*",schema:"public",table:"events",filter:`calendar_id=eq.${t}`},O=>{console.log("Realtime month event change detected:",O),y(!0),P()}).subscribe();return()=>{me.removeChannel(z)}},500);return()=>clearTimeout(R)},[t,n,k,f,_]);const P=async()=>{const{data:R,error:z}=await S(t,{startDate:E,endDate:j});if(z){console.error("Error fetching month events:",z),p(!1);return}const O={};(R||[]).forEach(A=>{xw(A,E,Rc(j)).forEach(V=>{const Y=V.displayStart,Q=V.displayEnd,re=Q.getTime()-Y.getTime(),J=Math.floor(re/(1e3*60*60)),ne=Math.floor(re%(1e3*60*60)/(1e3*60));let G="";V.isMultiDay&&V.isContinuation?G="All day":J>0&&ne>0?G=`${J}h ${ne}m`:J>0?G=`${J}h`:ne>0&&(G=`${ne}m`);const Z=V.dateKey;O[Z]||(O[Z]=[]);const ee=ev(A.title,k);O[Z].push({id:V.isContinuation?`${A.id}-${V.dateKey}`:A.id,title:A.title,startTime:V.isContinuation?"12:00 AM":$e(Y,"h:mm a"),endTime:V.continuesNext?"11:59 PM":$e(Q,"h:mm a"),duration:G,color:A.color||"blue",rawStartTime:A.start_time,rawEndTime:A.end_time,rawUpdatedAt:A.updated_at,notes:A.notes,location:A.location,participants:A.participants||void 0,colorSet
876:ee,isRecurring:A.is_recurring,recurrencePattern:A.recurrence_pattern,recurrenceParentId:A.recurrence_parent_id,createdTimezone:A.created_timezone,language:A.language||void 0,isContinuation:V.isContinuation,continuesNext:V.continuesNext,isMultiDay:V.isMultiDay})})}),Object.keys(O).forEach(A=>{O[A].sort(xV)}),h(O),p(!1)},M=[];let U=[],N=E;for(;N<=j;){for(let R=0;R<7;R++)U.push(N),N=jn(N,1);M.push(U),U=[]}const B=R=>{const z=$e(R,"yyyy-MM-dd");return d[z]||[]},$=(R,z)=>{z.stopPropagation();const O=z.currentTarget.getBoundingClientRect();u(O),a(R),o(!0)},I=R=>{if(!e)return;const z=new Date(R);z.setHours(9,0,0,0),x(z),m(!0)};return l.jsxs(l.Fragment,{children:[l.jsx(yw,{show:w,onHide:()=>y(!1)}),l.jsx(vw,{event:i,open:s,onOpenChange:o,cardRect:c,calendarId:t,onEventUpdated:P,canEdit:e}),l.jsx(tv,{open:g,onOpenChange:m,calendarId:t,onEventCreated:P,initialDateTime:v}),l.jsxs("div",{className:"max-w-md md:max-w-4xl lg:max-w-6xl mx-auto px-3 md:px-6 pb-8 animate-fade-in",children:[l.jsxs("div",{className:"flex items-center justify-center gap-3 md:gap-8 mb-4 md:mb-8 animate-scale-in",children:[l.jsx(ch,{className:"text-muted-foreground cursor-pointer hover:text-foreground transition-all duration-300 hover:scale-125 hover:-translate-x-1 touch-manipulation min-w-[44px] min-h-[44px]",onClick:()=>r(FC(n,1))}),l.jsx("h2",{className:"text-2xl md:text-4xl lg:text-5xl font-bold min-w-[150px] md:min-w-[200px] text-center",children:$e(n,"MMMM yyyy")}),l.jsx(lh,{className:"text-muted-foreground cursor-pointer hover:text-foreground transition-all duration-300 hover:scale-125 hover:translate-x-1 touch-manipulation min-w-[44px] min-h-[44px]",onClick:()=>r(Or(n,1))})]}),l.jsx("div",{className:"overflow-x-auto md:overflow-x-visible -mx-3 px-3 md:mx-0 md:px-0 scroll-smooth scrollbar-thin scrollbar-thumb-primary/20 scrollbar-track-transparent hover:scrollbar-thumb-primary/40",children:l.jsxs("div",{className:"min-w-[700px] md:min-w-0 animate-fade-in-up",children:[l.jsx("div",{className:"grid grid-cols-7 gap-0.5 md:gap-2 lg:gap-3 mb-1 md:mb-2",children:N0e.map((R,z)=>l.jsx("div",{className:"text-center text-xs md:text-xs lg:text-sm font-semibold text-muted-foreground py-1 md:py-1 lg:py-2 animate-fade-in",style:{animationDelay:`${z*.05}s`,opacity:0,animationFillMode:"forwards"},children:R},R))}),Object.keys(d).length===0?l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(P0e,{})}):l.jsx("div",{className:"space-y-0.5 md:space-y-2 lg:space-y-3",children:M.map((R,z)=>l.jsx("div",{className:"grid grid-cols-7 gap-0.5 md:gap-2 lg:gap-3",children:R.map((O,A)=>{const L=B(O),V=mw(O,n),Y=$C(O);return l.jsx("div",{className:ce("min-h-[80px] md:min-h-[90px] lg:min-h-[110px] rounded-lg md:rounded-xl p-2 md:p-2 lg:p-3 transition-all duration-300 hover:scale-[1.02] cursor-pointer animate-fade-in-up touch-manipulation",V?"bg-muted":"bg-muted/30"),style:{animationDelay:`${.2+z*.05+A*.02}s`,opacity:0,animationFillMode:"forwards"},onClick:()=>e&&I(O),children:l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsx("div",{className:ce("text-xs md:text-xs lg:text-sm font-semibold mb-1 md:mb-1",Y&&"bg-primary text-primary-foreground w-5 h-5 md:w-6 md:h-6 lg:w-7 lg:h-7 rounded-full flex items-center justify-center text-[10px] md:text-xs lg:text-sm",!V&&"text-muted-foreground"),children:$e(O,"d")}),l.jsx("div",{className:"space-y-1 md:space-y-1 flex-1 max-h-[100px] md:max-h-[100px] lg:max-h-[120px] overflow-y-auto scrollbar-thin scrollbar-thumb-foreground
876/20 scrollbar-track-transparent",children:L.map(Q=>l.jsxs("div",{onClick:re=>$(Q,re),className:"text-[10px] md:text-[10px] lg:text-xs px-1.5 md:px-2 py-1 md:py-1 rounded md:rounded-md font-medium transition-all duration-200 hover:scale-105 cursor-pointer touch-manipulation leading-tight",style:{backgroundColor:Q.colorSet?Q.colorSet.background:`hsl(var(--calendar-${Q.color}-dark))`,color:Q.colorSet&&Q.colorSet.textClass==="text-gray-900"?"#111827":"#ffffff",transition:"background-color 0.5s ease-in-out, color 0.5s ease-in-out, transform 0.2s ease-in-out"},children:[l.jsxs("div",{className:"truncate",children:[Q.isContinuation&&l.jsx("span",{className:"opacity-60 mr-0.5",children:"â³ "}),Q.title]}),(Q.location||Q.notes)&&l.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5 opacity-80",children:[Q.location&&l.jsx(df,{className:"h-2.5 w-2.5 flex-shrink-0"}),Q.notes&&l.jsx(Wg,{className:"h-2.5 w-2.5 flex-shrink-0"})]})]},Q.id))})]})},O.toISOString())})},z))})]})})]})]})},A0e=()=>{const t=[{dayName:"Monday",dayNum:"15",month:"JAN",color:"peach",events:[{title:"Team Meeting",time:"10 AM",bgColor:"hsl(25, 75%, 75%)",textColor:"#111827"},{title:"Lunch Break",time:"12 PM",bgColor:"hsl(35, 65%, 70%)",textColor:"#111827"}]},{dayName:"Tuesday",dayNum:"16",month:"JAN",color:"coral",events:[{title:"Doctor Appointment",time:"2 PM",bgColor:"hsl(15, 70%, 70%)",textColor:"#111827"},{title:"Grocery Shopping",time:"4 PM",bgColor:"hsl(20, 60%, 75%)",textColor:"#111827"}]},{dayName:"Wednesday",dayNum:"17",month:"JAN",color:"oatmeal",events:[{title:"Lunch with Family",time:"12 PM",bgColor:"hsl(40, 30%, 75%)",textColor:"#111827"},{title:"Book Club",time:"6 PM",bgColor:"hsl(35, 35%, 70%)",textColor:"#111827"}]}];return l.jsxs("div",{className:"relative",children:[l.jsxs("div",{className:"text-center mb-6 space-y-1",children:[l.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"No events this month"}),l.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Here's how your events will appear"})]}),l.jsx("div",{className:"relative h-[320px] flex items-end justify-center pb-8",children:t.map((e,n)=>{const r=n===0?-6:n===1?0:6,i=30-n*10,a=n*-40,s=n===0?-20:n===2?20:0;return l.jsx("div",{className:"absolute w-full max-w-[240px]",style:{transform:`rotate(${r}deg) translateY(${a}px) translateX(${s}px)`,zIndex:i,animation:`spreadCards 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) ${n*.15}s both`},children:l.jsxs("div",{className:"rounded-2xl p-4 shadow-xl border-2 border-white/20",style:{backgroundColor:`hsl(var(--calendar-${e.color}))`},children:[l.jsxs("div",{className:"mb-3",children:[l.jsx("p",{className:"text-foreground text-sm font-medium mb-1",children:e.dayName}),l.jsxs("div",{className:"flex items-baseline gap-1",children:[l.jsx("span",{className:"text-4xl font-bold text-foreground leading-none",children:e.dayNum}),l.jsx("span",{className:"text-2xl font-bold text-foreground leading-none ml-1.5",children:e.month})]})]}),l.jsx("div",{className:"space-y-2 mt-4",children:e.events.map((o,c)=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("p",{className:"text-[10px] text-foreground/70 font-medium min-w-[45px]",children:o.time}),l.jsx("div",{className:"flex items-center gap-2 flex-1 px-3 py-2 rounded-xl text-xs font-medium border-2 border-white/20 shadow-sm",style:{backgroundColor:o.bgColor,color:o.textColor},children:l.jsx("span",{className:"flex-1 text-left",children:o.title})})]},c))})]})},n)})}),l.jsx("p",{className:"text-xs text-center text-muted-foreground/50 mt-4",children:"Add your first event to get started"})]})},YP=({calendarId:t,canEdit:e})=>{const[n,r]=b.useState(new Date),[i,a]=b.useState([]),[s,o]=b.useState(!0),[c,u]=b.useState(null),[d,h]=b.useState(!1),[f,p]=b.useState(null),g=b.useRef(null),m=b.useRef(null),v=b.useRef(null),[x,w]=b.useState(!1),[y,k]=b.useState(null),[S,_]=b.useState(!1),{palette:C}=bf(),{fetchEvents:T,isSharedAccess:E}=wu(),{isSimplified:j}=OF(),P=b.useRef(null),M=b.useMemo(()=>Qn(new Date),[]),U=b.useRef(!1);b.useRef(n);const N=b.useRef(null),B=80,$=60,I=1.5,R=600,z=10,O=b.useCallback(G=>
876{S||(k(G==="next"?"left":"right"),_(!0),setTimeout(()=>{r(Z=>G==="next"?Or(Z,1):FC(Z,1)),k(null),setTimeout(()=>_(!1),50)},150))},[S]);b.useEffect(()=>{A()},[t,n,C]),b.useEffect(()=>{if(t==="demo"||s||E)return;const G=setTimeout(()=>{const Z=me.channel("calendar-events-changes").on("postgres_changes",{event:"*",schema:"public",table:"events",filter:`calendar_id=eq.${t}`},ee=>{console.log("Realtime calendar event change detected:",ee),w(!0),A()}).subscribe();return()=>{me.removeChannel(Z)}},500);return()=>clearTimeout(G)},[t,n,C,s,E]),b.useEffect(()=>{!s&&P.current&&!U.current&&(U.current=!0,setTimeout(()=>{var G;(G=P.current)==null||G.scrollIntoView({behavior:"smooth",block:"start"})},100))},[s]),b.useEffect(()=>(window.__resetToCurrentMonth=()=>{r(new Date),U.current=!1},()=>{delete window.__resetToCurrentMonth}),[]);const A=async()=>{const G=Pr(n),Z=kf(n),{data:ee,error:K}=await T(t,{startDate:G,endDate:Z});if(K){console.error("Error fetching calendar events:",K),o(!1);return}const oe={};(ee||[]).forEach(H=>{xw(H,G,Rc(Z)).forEach(te=>{const he=te.displayStart,xe=te.displayEnd,De=xe.getTime()-he.getTime(),ge=Math.floor(De/(1e3*60*60)),Re=Math.floor(De%(1e3*60*60)/(1e3*60));let Oe="";te.isMultiDay&&te.isContinuation?Oe="All day":ge>0&&Re>0?Oe=`${ge}h ${Re}m`:ge>0?Oe=`${ge}h`:Re>0&&(Oe=`${Re}m`);const ye=te.dateKey;oe[ye]||(oe[ye]={date:te.date,events:[],color:H.color||"blue"}),oe[ye].events.push({id:te.isContinuation?`${H.id}-${te.dateKey}`:H.id,title:H.title,time:te.isContinuation?"12 am":$e(he,"h a"),startTime:te.isContinuation?"12:00 AM":$e(he,"h:mm a"),endTime:te.continuesNext?"11:59 PM":$e(xe,"h:mm a"),duration:Oe,color:H.color||"blue",rawStartTime:H.start_time,rawEndTime:H.end_time,rawUpdatedAt:H.updated_at,notes:H.notes,location:H.location,participants:H.participants||void 0,colorSet:ev(H.title,C),isRecurring:H.is_recurring,recurrencePattern:H.recurrence_pattern,recurrenceParentId:H.recurrence_parent_id,createdTimezone:H.created_timezone,language:H.language||void 0,isContinuation:te.isContinuation,continuesNext:te.continuesNext,isMultiDay:te.isMultiDay})})}),Object.values(oe).forEach(H=>{H.events.sort(xV)});const W=Object.values(oe).sort(j0e);a(W),o(!1)},L=$e(FC(n,1),"MMM").toUpperCase(),V=$e(n,"MMM").toUpperCase(),Y=$e(Or(n,1),"MMM").toUpperCase(),Q=(G,Z)=>{const ee=Z.currentTarget.getBoundingClientRect();p(ee),u(G),h(!0)},re=G=>{const Z=G.targetTouches[0];g.current={x:Z.clientX,y:Z.clientY,t:Date.now()},m.current=null,v.current=null},J=G=>{if(!g.current)return;const Z=G.targetTouches[0];if(m.current={x:Z.clientX,y:Z.clientY},!v.current){const ee=Math.abs(Z.clientX-g.current.x),K=Math.abs(Z.clientY-g.current.y);(ee>z||K>z)&&(v.current=ee>K?"horizontal":"vertical")}},ne=()=>{const G=g.current,Z=m.current;g.current=null,m.current=null;const ee=v.current;if(v.current=null,!G||!Z||ee!=="horizontal")return;const K=Z.x-G.x,oe=Math.abs(Z.y-G.y);Date.now()-G.t>R||oe>$||Math.abs(K)<B||Math.abs(K)<oe*I||(K<0?O("next"):O("prev"))};return l.jsxs(l.Fragment,{children:[l.jsx(yw,{show:x,onHide:()=>w(!1)}),l.jsx(vw,{event:c,open:d,onOpenChange:h,cardRect:f,calendarId:t,onEventUpdated:A,canEdit:e}),l.jsxs("div",{className:"max-w-md sm:max-w-xl md:max-w-2xl lg:max-w-5xl xl:max-w-7xl mx-auto px-3 md:px-6 lg:px-8 pb-8 animate-fade-in",onTouchStart:re,onTouchMove:J,onTouchEnd:ne,children:[l.jsxs("div",{className:"flex items-center justify-center gap-3 md:gap-8 lg:gap-10 mb-4 md:mb-6 lg:mb-8 animate-fade-in",children:[l.jsx("button",{onClick:()=>O("prev"),className:"text-muted-foreground text-lg md:text-2xl lg:text-3xl font-bold hover:text-foreground transition-all duration-300 hover:scale-110 touch-manipulation min-h-[44px] flex items-center",children:L}),l.jsx(ch,{className:"text-muted-foreground cursor-pointer hover:text-foreground transition-all duration-300 hover:scale-125 hover:-translate-x-1 touch-manipulation min-w-[44px] min-h-[44px] lg:w-12 lg:h-12",onClick:()=>O("prev")}),l.jsx("h2",{className:ce("font-bold min-w-[80px] md:min-w-[100px] lg:min-w-[120px] text-center transition-all duration-200",j?"text-4xl md:text-5xl lg:text-6xl":"text-3xl md:text-4xl lg:text-5xl",S&&"opacity-50 scale-95"),children:V}),l.jsx(lh,{className:"text-muted-foreground cursor-pointer hover:text-foreground transition-all duration-300 hover:scale-125 hover:translate-x-1 touch-manipulation min-w-[44px] min-h-[44px] lg:w-12 lg:h-12",onClick:()=>O("next")}),l.jsx("button",{onClick:()=>O("next"),className:"text-muted-foreground text-lg md:text-2xl lg:text-3xl font-bold hover:text-foreground transition-all duration-300 hover:scale-110 touch-manipulation min-h-[44px] flex items-center",children:Y})]}),l.jsx("div",{ref:N,className:ce("space-y-3 sm:grid sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 sm:gap-3 md:gap-4 sm:sp
876ace-y-0 transition-all duration-200 ease-out",y==="left"&&"opacity-0 translate-x-8",y==="right"&&"opacity-0 -translate-x-8",!y&&"opacity-100 translate-x-0"),children:s?l.jsx("p",{className:"text-center text-muted-foreground",children:"Loading events..."}):i.length===0?l.jsx("div",{className:"sm:col-span-2 md:col-span-3 xl:col-span-4",children:l.jsx(A0e,{})}):i.map((G,Z)=>{const ee=gn(Qn(G.date),M);return l.jsxs("div",{ref:ee?P:null,className:"rounded-3xl p-4 sm:p-3 md:p-4 lg:p-5 transition-all duration-300 hover:scale-[1.02] hover:shadow-xl cursor-pointer touch-manipulation relative animate-fade-in-up",style:{animationDelay:`${Z*.05}s`,opacity:0,animationFillMode:"forwards",backgroundColor:`hsl(var(--calendar-${G.color}))`,transition:"background-color 0.5s ease-in-out, transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out"},children:[ee&&l.jsx("div",{className:"absolute top-4 right-4 sm:top-3 sm:right-3 md:top-3 md:right-3 bg-white/20 px-3 py-1 sm:px-2 sm:py-0.5 md:px-2 md:py-0.5 rounded-full text-xs sm:text-[10px] md:text-[10px] backdrop-blur-sm text-black font-semibold",children:"TODAY"}),l.jsxs("div",{className:"mb-3 sm:mb-2 md:mb-2 lg:mb-3",children:[l.jsx("p",{className:"text-foreground text-base sm:text-sm md:text-sm lg:text-base font-medium mb-1",children:$e(G.date,"EEEE")}),l.jsxs("div",{className:"flex items-baseline gap-1",children:[l.jsx("span",{className:"text-5xl sm:text-4xl md:text-4xl lg:text-5xl font-bold text-foreground leading-none",children:$e(G.date,"dd")}),l.jsx("span",{className:"text-3xl sm:text-2xl md:text-2xl lg:text-3xl font-bold text-foreground leading-none ml-2",children:$e(G.date,"MMM").toUpperCase()})]})]}),l.jsxs("div",{className:"space-y-2 sm:space-y-1.5 md:space-y-1.5 lg:space-y-2 mt-4 sm:mt-3 md:mt-3 lg:mt-4 overflow-hidden",children:[G.events.map(K=>l.jsxs("div",{className:"flex items-start gap-2 sm:gap-1.5 md:gap-1.5 min-w-0",children:[l.jsx("p",{className:"text-xs sm:text-[10px] md:text-[10px] text-foreground/70 font-medium w-[50px] sm:w-[40px] md:w-[40px] flex-shrink-0 pt-1",children:K.time}),l.jsxs("button",{onClick:oe=>Q(K,oe),className:"flex flex-col items-start gap-0.5 flex-1 min-w-0 px-2 py-1.5 sm:px-2 sm:py-1 md:px-2 md:py-1 lg:px-2.5 lg:py-1.5 rounded-xl sm:rounded-lg md:rounded-lg text-xs sm:text-[10px] md:text-[10px] lg:text-xs font-medium transition-all duration-200 hover:scale-105 hover:shadow-md touch-manipulation cursor-pointer overflow-hidden",style:{backgroundColor:K.colorSet.background,color:K.colorSet.textClass==="text-gray-900"?"#111827":"#ffffff",transition:"background-color 0.5s ease-in-out, color 0.5s ease-in-out, transform 0.2s ease-in-out"},children:[l.jsx("span",{className:ce("truncate w-full text-left font-semibold",j&&"text-sm"),children:K.title}),(K.location||K.notes)&&l.jsxs("div",{className:"flex flex-col gap-0.5 w-full opacity-80",children:[K.location&&l.jsxs("span",{className:"flex items-center gap-1 text-[9px] sm:text-[8px] truncate w-full",children:[l.jsx(df,{className:"h-2.5 w-2.5 flex-shrink-0"}),l.jsx("span",{className:"truncate",children:K.location})]}),K.notes&&l.jsxs("span",{className:"flex items-center gap-1 text-[9px] sm:text-[8px] truncate w-full",children:[l.jsx(Wg,{className:"h-2.5 w-2.5 flex-shrink-0"}),l.jsx("span",{className:"truncate",children:K.notes})]})]})]})]},K.id)),G.events.length===0&&l.jsx("p",{className:"text-center text-foreground/50 py-4",children:"No events scheduled"})]})]},G.date.toISOString())})})]})]})};function O0e(){const[t,e]=b.useState([]),[n,r]=b.useState(!0),[i,a]=b.useState(null),[s,o]=b.useState(null);return b.useEffect(()=>{(async()=>{var f,p;try{a(null),localStorage.removeItem("demoEvents");const{data:g,error:m}=await me.functions.invoke("create-demo-calendar");if(m){if((f=m.message)!=null&&f.includes("Rate limit")||(p=m.message)!=null&&p.includes("429")){const v=typeof m=="object"?m:{};a("Demo usage limit reached. Please try again in an hour."),o(v.reset_at||null),r(!1);return}throw m}if(g!=null&&g.events){const v=g.events.map((x,w)=>({id:`demo-${w}`,calendar_id:"demo",title:x.title,start_time:x.start_time,end_time:x.end_time,duration:x.duration,color:x.color,notes:x.notes,created_by:"demo",created_at:new Date().toISOString(),updated_at:new Date().toISOString(),is_recurring:!1,recurrence_end_date:null,recurrence_parent_id:null,recurrence_pattern:null,location:x.location||null,participants:x.participants||null}));e(v),localStorage.setItem("demoEvents",JSON.stringify(v))}}catch(g){console.error("Error loading demo events:",g),a((g==null?void 0:g.message)||"Failed to load demo events")}finally{r(!1)}})()},[]),{events:t,loading:n,error:i,rateLimitResetAt:s,addEvent:h=>{const f={...h,id:`demo-${Date.now()}`,created_at:new Date().toISOString(),updated_at:new Date().toISOString()},p=[...t,f];e(p),localStorage.setItem("demoEvents",JSON.stringify(p))},updateEvent:(h,f)=>{const p=t.map(g=>g.id===h?{...g,...f,updated_at:new Date().toISOString()}:g);e(p),localStorage.setItem("demoEvents",JSON.stringify(p))},deleteEvent:h=>{const f=t.filter(p=>p.id!==h);e(f),localStorage.setItem("demoEvents",JSON.stringify(f))}}}function R0e(){const t=rr(),[e,n]=b.useState("today"),[r,i]=b.useState(!1),[a,s]=b.useState(0),{events:o,loading:c,error:u,rateLimitResetAt:d}=O0e(),h=()=>{i(!0)},f=()=>{s(g=>g+1)},p=()=>{const g="demo";switch(e){case"today":return l.jsx(Ch,{calendarId:g,canEdit:!0},a);case"week":return l.jsx(KP,{calendarId:g,canEdit:!0},a);case"month":return l.jsx(GP,{calendarId:g,canEdit:!0},a);case"calendar":return l.jsx(YP,{calendarId:g,canEdit:!0},a);default:return l.jsx(Ch,{calendarId:g,canEdit:!0},a)}};return l.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[l.jsx(es,{title:"Try the Demo Calendar",description:"Try Caréable with a live demo calendar â create events with voice or AI, explore views, nothing is saved.",canonical:"https://careable.co/demo"}),l.jsx("div",{className:"border-b border-border/40 backdrop-blur-sm bg-background/80 sticky top-0 z-50",children:l.jsx("div",{className:"container mx-auto px-6 py-3 flex items-center justify-between",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(de,{variant:"ghost",size:"icon",onClick:()=>t("/"),className:"h-9 w-9",children:l.jsx(ci,{className:"h-4 w-4"})}),l.jsxs("div",{children:[l.jsx("h1",{className:"text-lg font-semibold",children:"Demo Calendar"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Try all features - nothing is saved"})]})]})})}),l.jsx(Jj,{activeView:e,onViewChange:n,onAddClick:h,showBackButton:!1,isViewingToday:!0,onTodayClick:()=>n("today")}),l.jsxs("div",{className:"flex-1",children:[u&&l.jsx("div",{className:"container mx-auto px-6 pt-6",children:l.jsxs(Sc,{variant:"destructive",children:[l.jsx(f$,{className:"h-4 w-4"}),l.jsxs(no,{children:[u,d&&l.jsxs("span",{className:"block text-xs mt-1 opacity-80",children:["Try again after ",new Date(d).toLocaleTimeString()]})]})]})}),c?l.jsx("div",{className:"flex items-center justify-center h-64",children:l.jsx(Er,{className:"w-8 h-8 animate-spin text-calendar-blue"})}):p()]}),l.jsx(tv,{open:r,onOpenChange:i,calendarId:"demo",onEventCreated:f})]})}function JP(t,e){const[n,r]=b.useState({calendarId:null,permission:null,loading:!0,error:null,requiresPassword:!1,validatePassword:async()=>({success:!1})});return b.useEffect(()=>{async function i(){if(e){r({calendarId:e,permission:"owner",loading:!1,error:null,requiresPassword:!1,validatePassword:async()=>({success:!0})});return}if(t)try{const{data:a,error:s}=await me.rpc("check_calendar_link_public",{_access_code:t});if(s){console.error("Link check error:",s),r({calendarId:null,permission:null,loading:!1,error:"Failed to validate link",requiresPassword:!1,validatePassword:async()=>({success:!1})});return}const o=a==null?void 0:a[0];if(!o||!o.link_exists){r({calendarId:null,permission:null,loading:!1,error:"Invalid or expired link",requiresPassword:!1,validatePassword:async()=>({success:!1})});return}const c=o.requires_password||!1,u=async d=>{try{const{data:h,error:f}=await me.rpc("verify_calendar_link_password",{_access_code:t,_password:d,_ip_address:null});if(f)return console.error("Password verification error:",f),{success:!1,error:"verification_failed",message:"Failed to verify password"};const p=h;return{success:(p==null?void 0:p.success)||!1,error:p==null?void 0:p.error,message:p==null?void 0:p.message}}catch(h){return console.error("Password verification failed:",h),{success:!1,error:"verification_failed",message:"Failed to verify password"}}};r({calendarId:o.calendar_id,permission:o.link_type,loading:!1,error:null,requiresPassword:c,validatePassword:u});return}catch{r({calendarId:null,permission:null,loading:!1,error:"Failed to validate access",requiresPassword:!1,validatePassword:async()=>({success:!1})});return}r({calendarId:null,permission:null,loading:!1,error:"No access credentials provided",requiresPassword:!1,validatePassword:async()=>({success:!1})})}i()},[t,e]),n}const wV=({calendarId:t,onDateSelect:e,selectedDate:n,isCollapsed:r=!1,onToggleCollapse:i})=>{const[a,s]=b.useState([]),[o,c]=b.useState(!0),[u,d]=b.useState(!0),[h,f]=b.useState(!0),{palette:p}=bf(),{fetchEvents:g}=wu();b.useEffect(()=>{m()},[t,p]);const m=async()=>{const w=new Date,{data:y,error:k}=await g(t,{startDate:w,limit:5});if(k){console.error("Error fetching upcoming events:",k),c(!1);return}const S=(y||[]).sort((_,C)=>new Date(_.start_time).getTime()-new Date(C.start_time).getTime()).slice(0,5).map(_=>({id:_.id,title:_.title,startTime:new Date(_.start_time),colorSet
876:ev(_.title,p)}));s(S),c(!1)},v=w=>{w&&e&&e(w)},x=w=>{const y=Qn(new Date),k=Qn(w);return gn(k,y)?"Today":gn(k,jn(y,1))?"Tomorrow":$e(w,"EEE, MMM d")};return l.jsxs(l.Fragment,{children:[r&&l.jsx(de,{variant:"outline",size:"icon",onClick:i,className:"hidden lg:flex fixed top-4 left-4 z-20 rounded-full min-w-[40px] min-h-[40px] bg-background border-2 hover:bg-muted transition-all duration-300 hover:scale-110 shadow-md",children:l.jsx(fZ,{className:"h-4 w-4"})}),l.jsx("aside",{className:ce("hidden lg:block flex-shrink-0 fixed top-0 left-0 border-r border-border bg-muted/30 h-screen overflow-y-auto z-10 transition-all duration-300 ease-in-out animate-fade-in",r?"-translate-x-full w-0":"translate-x-0 w-72 xl:w-80"),children:l.jsxs("div",{className:"p-4 space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("img",{src:"/careable-icon.png?v=10",alt:"Caréable",className:"w-8 h-8 rounded-full"}),l.jsx("span",{className:"font-semibold text-lg tracking-tight",children:"Caréable"})]}),i&&l.jsx(de,{variant:"ghost",size:"icon",onClick:i,className:"rounded-full min-w-[36px] min-h-[36px] hover:bg-muted transition-all duration-300",children:l.jsx(hZ,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"bg-background rounded-xl border border-border overflow-hidden",children:[l.jsxs("button",{onClick:()=>d(!u),className:"w-full flex items-center justify-between p-3 hover:bg-muted/50 transition-colors",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(yc,{className:"w-4 h-4 text-primary"}),l.jsx("span",{className:"font-medium text-sm",children:"Calendar"})]}),u?l.jsx(V_,{className:"w-4 h-4 text-muted-foreground"}):l.jsx(T0,{className:"w-4 h-4 text-muted-foreground"})]}),u&&l.jsx("div",{className:"px-2 pb-3",children:l.jsx(qP,{mode:"single",selected:n,onSelect:v,className:"rounded-md"})})]}),l.jsxs("div",{className:"bg-background rounded-xl border border-border overflow-hidden",children:[l.jsxs("button",{onClick:()=>f(!h),className:"w-full flex items-center justify-between p-3 hover:bg-muted/50 transition-colors",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Dx,{className:"w-4 h-4 text-primary"}),l.jsx("span",{className:"font-medium text-sm",children:"Upcoming Events"})]}),h?l.jsx(V_,{className:"w-4 h-4 text-muted-foreground"}):l.jsx(T0,{className:"w-4 h-4 text-muted-foreground"})]}),h&&l.jsx("div",{className:"px-3 pb-3",children:o?l.jsx("div",{className:"space-y-2",children:[1,2,3].map(w=>l.jsx("div",{className:"animate-pulse h-14 bg-muted rounded-lg"},w))}):a.length===0?l.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No upcoming events"}):l.jsx("div",{className:"space-y-2",children:a.map(w=>l.jsxs("div",{className:"p-2.5 rounded-lg border border-border/50 hover:border-border transition-colors cursor-pointer",style:{backgroundColor:`${w.colorSet.background}20`,borderLeftWidth:"3px",borderLeftColor:w.colorSet.background},children:[l.jsx("p",{className:"font-medium text-sm truncate",children:w.title}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:[x(w.startTime)," at ",$e(w.startTime,"h:mm a")]})]},w.id))})})]}),l.jsxs("div",{className:"bg-background rounded-xl border border-border p-4",children:[l.jsx("h3",{className:"font-medium text-sm mb-3",children:"Quick Stats"}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{className:"text-center p-3 bg-muted/50 rounded-lg",children:[l.jsx("p",{className:"text-2xl font-bold text-primary",children:a.length}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Upcoming"})]}),l.jsxs("div",{className:"text-center p-3 bg-muted/50 rounded-lg",children:[l.jsx("p",{className:"text-2xl font-bold text-primary",children:a.filter(w=>gn(w.startTime,new Date)).length}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Today"})]})]})]})]})})]})};function D0e(){const{calendarId:t}=Kg(),{user:e,loading:n,refreshing:r}=sa(),{calendarId:i,permission:a,loading:s,error:o}=JP(void 0,t),[c,u]=b.useState("today"),[d,h]=b.useState(!0),[f,p]=b.useState(!1),[g,m]=b.useState(null),[v,x]=b.useState(0),[w,y]=b.useState(new Date),[k,S]=b.useState(!1),_=rr(),C=U=>{m(U),p(!0)},T=()=>{x(U=>U+1)},E=()=>{window.__resetToToday&&window.__resetToToday()},j=()=>{window.__resetToCurrentMonth&&window.__resetToCurrentMonth()},P=U=>{y(U),u("today"),window.__navigateToDate&&window.__navigateToDate(U)};if(b.useEffect(()=>{!n&&!r&&!e&&_("/auth")},[e,n,r,_]),b.useEffect(()=>{const U=N=>{const B=N.detail;B!=null&&B.__replay||u($=>($!=="today"&&setTimeout(()=>{window.dispatchEvent(new CustomEvent("careable:open-event",{detail:{...B,__replay:!0}}))},80),"today"))};return window.addEventListener("careable:open-event",U),()=>window.removeEventListener("careable:open-event",U)},[]),s||n||r)return l.jsxs("div",{className:"min-h-screen bg-background",children:[l.jsx("div",{className:"flex items-center justify-center h-16 border-b border-border",children:l.jsx("div",{className:"animate-pulse h-8 w-32 bg-muted rounded"})}),l.jsx("div",{className:"pt-4",children:l.jsxs("div",{className:"max-w-md mx-auto px-3",children:[l.jsxs("div",{className:"text-center mb-6",children:[l.jsx("div",{className:"animate-pulse h-12 w-40 bg-muted rounded mx-auto mb-2"}),l.jsx("div",{className:"animate-pulse h-16 w-32 bg-muted rounded mx-auto"})]}),l.jsx("div",{className:"space-y-3",children:[1,2,3].map(U=>l.jsx("div",{className:"rounded-3xl p-6 bg-muted/50 animate-pulse h-32"},U))})]})})]});if(o||!i||a!=="owner")return l.jsx("div",{className:"min-h-screen flex items-center justify-center",children:l.jsxs("div",{className:"text-center",children:[l.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Access Denied"}),l.jsx("p",{className:"text-muted-foreground",children:o||"Calendar not found"})]})});const M=()=>{switch(c){case"today":return l.jsx(Ch,{calendarId:i,canEdit:!0,onTodayStatusChange:h,onResetToToday:E},v);case"week":return l.jsx(KP,{calendarId:i,canEdit:!0},v);case"month":return l.jsx(GP,{calendarId:i,canEdit:!0},v);case"calendar":return l.jsx(YP,{calendarId:i,canEdit:!0},v);default:return l.jsx(Ch,{calendarId:i,canEdit:!0,onTodayStatusChange:h,onResetToToday:E},v)}};return l.jsxs("div",{className:"min-h-screen bg-background overflow-x-hidden",children:[l.jsx(es,{title:"My Calendar",description:"Manage your Caréable care calendar â create, edit, and share events with family and caregivers in one place."}),l.jsx(Jj,{activeView:c,onViewChange:u,onAddClick:C,onBackClick:()=>_("/dashboard"),showBackButton:!0,isViewingToday:d,onTodayClick:E,onThisMonthClick:j,isSidebarCollapsed:k,calendarId:i}),l.jsx(tv,{open:f,onOpenChange:p,calendarId:i,onEventCreated:T,buttonRect:g}),l.jsxs("div",{className:"flex overflow-x-hidden",children:[l.jsx(wV,{calendarId:i,onDateSelect:P,selectedDate:w,isCollapsed:k,onToggleCollapse:()=>S(!k)}),l.jsx("main",{className:ce("flex-1 pt-2 md:pt-4 transition-all duration-300 overflow-x-hidden",k?"lg:ml-0":"lg:ml-72 xl:ml-80"),children:M()})]})]})}function M0e(){return l.jsx(KU,{accessCode:null,children:l.jsx(D0e,{})})}const I0e=({open:t,onSubmit:e,error:n,isVerifying:r=!1,linkType:i,requiresPassword:a=!0,calendarName:s,calendarDescription:o})=>{const[c,u]=b.useState(""),[d,h]=b.useState(!1),f=w=>{w.preventDefault(),a&&c.trim()?e(c):a||e("")};if(!t)return null;const p=i==="editor",g=p?Mx:go,m=p?"hsl(var(--calendar-coral))":"hsl(var(--calendar-blue))",v={editor:["You've been invited as an editor! ð","Ready to collaborate? Enter your passcode","Let's build something amazing together"],viewer:["Welc
876ome! You've been invited to view this calendar â¨","Enter your secret passcode to peek inside","Your window into the schedule awaits"]},x=p?v.editor:v.viewer;return l.jsxs("div",{className:"min-h-screen w-full relative overflow-hidden flex items-center justify-center p-4",children:[l.jsx("div",{className:"absolute -top-20 left-1/4 w-[600px] h-[600px] rounded-full blur-[180px] animate-orb-1"}),l.jsx("div",{className:"absolute -bottom-20 right-1/3 w-[450px] h-[450px] rounded-full blur-[140px] animate-orb-2"}),l.jsx("div",{className:"absolute top-1/3 right-1/4 w-[350px] h-[350px] rounded-full blur-[100px] animate-orb-3"}),l.jsx("div",{className:"absolute bottom-1/3 left-1/3 w-[280px] h-[280px] rounded-full blur-[90px] animate-orb-4"}),l.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-background/40 via-transparent to-background/20 backdrop-blur-[1px]"}),l.jsx("div",{className:"relative z-10 w-full max-w-md animate-scale-in",children:l.jsxs("div",{className:"relative backdrop-blur-xl bg-background/60 border border-border/50 rounded-2xl shadow-2xl overflow-hidden",children:[l.jsx("div",{className:"absolute top-0 left-0 right-0 h-1 bg-gradient-to-r from-calendar-blue via-calendar-coral via-calendar-peach to-calendar-mint",style:{backgroundSize:"200% 100%"}}),l.jsxs("div",{className:"p-8 md:p-10",children:[l.jsx("div",{className:"flex items-center justify-center mb-6",children:l.jsxs("div",{className:"relative w-16 h-16 rounded-2xl flex items-center justify-center",style:{background:`linear-gradient(135deg, ${m}15, ${m}25)`,boxShadow:`0 8px 24px ${m}20`},children:[l.jsx("div",{className:"absolute inset-0 rounded-2xl animate-pulse",style:{background:`${m}10`}}),b.createElement(g,{className:"w-8 h-8 relative z-10",style:{color:m}})]})}),l.jsxs("div",{className:"text-center space-y-3 mb-8",children:[l.jsx("h1",{className:"text-2xl md:text-3xl font-bold bg-gradient-to-r from-foreground to-foreground/70 bg-clip-text",children:x[0]}),s&&l.jsxs("div",{className:"space-y-1.5 py-3",children:[l.jsx("div",{className:"text-lg font-semibold text-foreground",children:s}),o&&l.jsx("div",{className:"text-sm text-muted-foreground/90 max-w-md mx-auto",children:o})]}),a&&l.jsx("p",{className:"text-base text-muted-foreground",children:x[1]}),l.jsxs("p",{className:"text-sm text-muted-foreground/80 flex items-center justify-center gap-1",children:[l.jsx(ta,{className:"w-3.5 h-3.5"}),x[2]]})]}),l.jsxs("form",{onSubmit:f,className:"space-y-6",children:[a&&l.jsxs("div",{className:"space-y-3",children:[l.jsxs("label",{htmlFor:"calendar-password",className:"text-sm font-medium text-foreground/90 flex items-center gap-2",children:[l.jsx(xm,{className:"w-4 h-4",style:{color:m}}),"Secret Passcode"]}),l.jsxs("div",{className:"relative",children:[l.jsx(qt,{id:"calendar-password",type:d?"text":"password",value:c,onChange:w=>u(w.target.value),placeholder:"Enter your passcode",className:"min-h-[52px] pr-12 bg-background/50 border-border/50 focus:border-primary/50 text-base backdrop-blur-sm",autoFocus:!0,disabled:r}),l.jsx("button",{type:"button",onClick:()=>h(!d),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",disabled:r,children:d?l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"})}):l.jsxs("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]})})]}),n&&l.jsxs("div",{className:"flex items-start gap-2 text-sm text-destructive bg-destructive/10 border border-destructive/20 rounded-lg p-3 animate-fade-in",children:[l.jsx("svg",{className:"w-4 h-4 mt-0.5 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),l.jsx("span",{children:n})]})]}),l.jsxs(de,{type:"submit",className:"w-full min-h-[52px] text-base font-medium transition-all relative overflow-hidden group",disabled:a&&(!c.trim()||r),style:{background:r?"hsl(var(--muted))":`linear-gradient(135deg, ${m}, ${m}dd)`,color:r?"inherit":"#000000"},children:[l.jsx("span",{className:"relative z-10 flex items-center justify-center gap-2",children:r?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"w-4 h-4 border-2 border-background/30 border-t-background rounded-full animate-spin"}
876),a?"Verifying your passcode...":"Loading calendar..."]}):l.jsxs(l.Fragment,{children:[a?"Unlock Calendar":"View Calendar",l.jsx(HX,{className:"w-4 h-4 group-hover:translate-x-1 transition-transform"})]})}),!r&&l.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-white/0 via-white/20 to-white/0 translate-x-[-100%] group-hover:translate-x-[100%] transition-transform duration-700"})]})]}),l.jsx("div",{className:"mt-6 pt-6 border-t border-border/30",children:l.jsx("p",{className:"text-xs text-center text-muted-foreground",children:a?p?l.jsx(l.Fragment,{children:"⨠As an editor, you'll be able to create and modify events"}):l.jsx(l.Fragment,{children:"ð You'll have view-only access to this calendar"}):p?l.jsx(l.Fragment,{children:"⨠You have full editing access to this calendar"}):l.jsx(l.Fragment,{children:"ð You can view all events in this calendar"})})})]})]})})]})};function L0e(){const{accessCode:t}=Kg();b.useEffect(()=>{if(t){const L=`/calendar/${t}`;localStorage.setItem("careable_shared_calendar_url",L),document.cookie=`careable_shared_calendar_url=${encodeURIComponent(L)}; path=/; max-age=31536000; SameSite=Lax`}},[t]);const{calendarId:e,permission:n,loading:r,error:i,requiresPassword:a,validatePassword:s}=JP(t),[o,c]=b.useState("today"),[u,d]=b.useState(!1),[h,f]=b.useState(0),[p,g]=b.useState(!1),[m,v]=b.useState(""),[x,w]=b.useState(!1),[y,k]=b.useState(!0),[S,_]=b.useState(),[C,T]=b.useState(),[E,j]=b.useState(new Date),[P,M]=b.useState(!1),[U,N]=b.useState(!0),B=()=>{window.__resetToToday&&window.__resetToToday()},$=()=>{window.__resetToCurrentMonth&&window.__resetToCurrentMonth()},I=()=>{n==="editor"&&d(!0)},R=()=>{f(L=>L+1)},z=L=>{j(L),c("today"),window.__navigateToDate&&window.__navigateToDate(L)};b.useEffect(()=>{const L=V=>{const Y=V.detail;Y!=null&&Y.__replay||c(Q=>(Q!=="today"&&setTimeout(()=>{window.dispatchEvent(new CustomEvent("careable:open-event",{detail:{...Y,__replay:!0}}))},80),"today"))};return window.addEventListener("careable:open-event",L),()=>window.removeEventListener("careable:open-event",L)},[]),b.useEffect(()=>{async function L(){if(t){const{data:V}=await me.rpc("get_calendar_by_access_code",{_access_code:t});V&&V.length>0&&(_(V[0].name),T(V[0].description||void 0))}}L()},[t]);const O=async L=>{if(!a){k(!1),g(!0);return}w(!0),v("");try{const V=await s(L);V.success?(g(!0),k(!1),v("")):V.error==="rate_limit_exceeded"?v(V.message||"Too many failed attempts. Please try again in 15 minutes."):V.error==="invalid_password"?v("Incorrect password. Please try again."):v(V.message||"Failed to verify password. Please try again.")}catch{v("Failed to verify password. Please try again.")}finally{w(!1)}};if(r)return l.jsxs("div",{className:"min-h-screen bg-background",children:[l.jsx("div",{className:"flex items-center justify-center h-16 border-b border-border",children:l.jsx("div",{className:"animate-pulse h-8 w-32 bg-muted rounded"})}),l.jsx("div",{className:"pt-4",children:l.jsxs("div",{className:"max-w-md mx-auto px-3",children:[l.jsxs("div",{className:"text-center mb-6",children:[l.jsx("div",{className:"animate-pulse h-12 w-40 bg-muted rounded mx-auto mb-2"}),l.jsx("div",{className:"animate-pulse h-16 w-32 bg-muted rounded mx-auto"})]}),l.jsx("div",{className:"space-y-3",children:[1,2,3].map(L=>l.jsx("div",{className:"rounded-3xl p-6 bg-muted/50 animate-pulse h-32"},L))})]})})]});if(y&&!p)return l.jsx(I0e,{open:!0,onSubmit:O,error:m,isVerifying:x,linkType:n,requiresPassword:a,calendarName:S,calendarDescription:C});if(i||!e)return l.jsx("div",{className:"min-h-screen flex items-center justify-center",children:l.jsxs("div",{className:"text-center",children:[l.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Access Denied"}),l.jsx("p",{className:"text-muted-foreground",children:i||"Invalid access link"})]})});const A=()=>{switch(o){case"today":return l.jsx(Ch,{calendarId:e,canEdit:n==="editor",onTodayStatusChange:N,onResetToToday:B},h);case"week":return l.jsx(KP,{calendarId:e,canEdit:n==="editor"},h);case"month":return l.jsx(GP,{calendarId:e,canEdit:n==="editor"},h);case"calendar":return l.jsx(YP,{calendarId:e,canEdit:n==="editor"},h);default:return l.jsx(Ch,{calendarId:e,canEdit:n==="editor",onTodayStatusChange:N,onResetToToday:B},h)}};return l.jsxs("div",{className:"min-h-screen bg-background",children:[l.jsx(es,{title:S?`${S} â Shared Calendar`:"Shared Calendar",description:C||"A shared Caréable calendar for coordinating care with family and caregivers."}),l.jsx(Jj,{activeView:o,onViewChange:c,onAddClick:n==="editor"?I:void 0,showBackButton:!1,isViewingToday:U,onTodayClick:B,onThisMonthClick:$,isSidebarCollapsed:P,calendarId:e,accessCode:t}),l.jsxs("div",{className:"flex",children:[l.jsx(wV,{calendarId:e,onDateSelect:z,selectedDate:E,isCollapsed:P,onToggleCollapse:()=>M(!P)}),l.jsx("main",{className:ce("flex-1 pt-2 md:pt-4 transition-all duration-300",P?"lg:ml-0":"lg:ml-72 xl:ml-80"),children:A()})]}),n==="editor"&&e&&l.jsx(tv,{open:u,onOpenChange:d,calendarId:e,onEventCreated:R})]})}function $0e(){const{accessCode:t}=Kg();return l.jsx(KU,{accessCode:t||null,children:l.jsx(L0e,{})})}const F0e=()=>{const t=qg();return b.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",t.pathname)},[t.pathname]),l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:l.jsxs("div",{className:"text-center",children:[l.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),l.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),l.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})};function B0e(){const t=rr();return b.useEffect(()=>{window.scrollTo(0,0)},[]),l.jsxs("div",{className:"min-h-screen bg-background",children:[l.jsx(es,{canonical:"https://careable.co/terms",title:"Terms of Service",description:"Read the Caréable Terms of Service covering accounts, acceptable use, content ownership, sharing, and your rights."}),l.jsx("nav",{className:"border-b border-border/40 backdrop-blur-sm sticky top-0 z-50 bg-background/80",children:l.jsx("div",{className:"container mx-auto px-6 md:px-8",children:l.jsxs("div",{className:"flex justify-between items-center h-16 md:h-20",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("img",{src:"/careable-icon.png?v=11",alt:"Caréable",className:"w-8 h-8 rounded-full"}),l.jsx("h1",{className:"text-xl md:text-2xl font-bold",children:"Caréable"})]}),l.jsxs(de,{onClick:()=>t("/"),variant:"ghost",children:[l.jsx(ci,{className:"w-4 h-4 mr-2"}),"Back to Home"]})]})})}),l.jsx("div",{className:"container mx-auto px-6 md:px-8 py-12 md:py-20",children:l.jsxs("div",{className:"max-w-4xl mx-auto prose prose-slate dark:prose-invert",children:[l.jsx("h1",{className:"text-4xl font-bold mb-8",children:"Terms of Service"}),l.jsx("p",{className:"text-muted-foreground text-lg mb-8",children:"Last updated: December 2025"}),l.jsxs("section",{className:"mb-8",children:[l.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"1. Acceptance of Terms"}),l.jsx("p",{children:"By accessing and using Caréable, you accept and agree to be bound by the terms and provision of this agreement. If you do not agree to these terms, please do not use our service."})]}),l.jsxs("section",{className:"mb-8",children:[l.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"2. Description of Service"}),l.jsx("p",{children:"Caréable provides a family care coordination and scheduling platform that allows users to create, share, and manage care-related events â such as medical appointments, therapy sessions, medication schedules, and caregiver visits â using AI-
876powered natural language processing. The service enables collaboration between family members and professional caregivers through shared calendars."})]}),l.jsxs("section",{className:"mb-8",children:[l.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"3. User Accounts"}),l.jsx("p",{children:"To access certain features of the service, you may be required to create an account. You are responsible for:"}),l.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[l.jsx("li",{children:"Maintaining the confidentiality of your account credentials"}),l.jsx("li",{children:"All activities that occur under your account"}),l.jsx("li",{children:"Notifying us immediately of any unauthorized access"})]})]}),l.jsxs("section",{className:"mb-8",children:[l.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"4. Acceptable Use"}),l.jsx("p",{children:"You agree not to use Caréable to:"}),l.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[l.jsx("li",{children:"Violate any applicable laws or regulations"}),l.jsx("li",{children:"Infringe on the rights of others"}),l.jsx("li",{children:"Distribute harmful or malicious content"}),l.jsx("li",{children:"Interfere with or disrupt the service"}),l.jsx("li",{children:"Attempt unauthorized access to our systems"})]})]}),l.jsxs("section",{className:"mb-8",children:[l.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"5. Content Ownership"}),l.jsx("p",{children:"You retain ownership of all content you create and share through Caréable, including care schedules, medication records, and health-related event data. By using our service, you grant us a limited license to store, process, and display your content solely for the purpose of providing the service to you and those you choose to share with."}),l.jsx("div",{className:"bg-muted/50 p-4 rounded-lg mt-4",children:l.jsxs("p",{className:"text-sm",children:[l.jsx("strong",{children:"Your data is protected:"})," Your care schedules and health-related data are secured by strict access controls and encryption. Only you and the people you explicitly share with can access your calendars and events."]})})]}),l.jsxs("section",{className:"mb-8",children:[l.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"6. Sharing and Permissions"}),l.jsx("p",{children:"When you share care calendars with family members or professional caregivers, you control the level of access (view or edit). You are responsible for managing these permissions and understanding that shared care schedules may be viewed by the recipients you designate."})]}),l.jsxs("section",{className:"mb-8",children:[l.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"7. Service Modifications"}),l.jsx("p",{children:"We reserve the right to modify, suspend, or discontinue any aspect of the service at any time, with or without notice. We will not be liable to you or any third party for any modification, suspension, or discontinuation of the service."})]}),l.jsxs("section",{className:"mb-8",children:[l.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"8. Disclaimers"}),l.jsx("p",{children:'Caréable is provided "as is" and "as available" without warranties of any kind, either express or implied. We do not guarantee that the service will be uninterrupted, secure, or error-free.'})]}),l.jsxs("section",{className:"mb-8",children:[l.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"9. Limitation of Liability"}),l.jsx("p",{children:"To the maximum extent permitted by law, Caréable shall not be liable for any indirect, incidental, special, consequential, or punitive damages resulting from your use or inability to use the service."})]}),l.jsxs("section",{className:"mb-8",children:[l.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"10. Termination"}),l.jsx("p",{children:"We reserve the right to terminate or suspend your account and access to the service at our sole discretion, without notice, for conduct that we believe violates these terms or is harmful to other users, us, or third parties."})]}),l.jsxs("section",{className:"mb-8",children:[l.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"11. Changes to Terms"}),l.jsx("p",{children:'We may update these terms from time to time. We will notify you of any significant changes by posting the new terms on this page and updating the "Last updated" date. Your continued use of the service after such changes constitutes your acceptance of the new terms.'})]}),l.jsxs("section",{className:"mb-8",children:[l.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"12. Contact Information"}),l.jsx("p",{children:"If you have any questions about these Terms of Service, please contact us through our website."})]})]})})]})}function U0e(){const t=rr();return b.useEffect(()=>{window.scrollTo(0,0)},[]),l.jsxs("div",{className:"min-h-screen bg-background",children:[l.jsx(es,{canonical:"https://careable.co/privacy",title:"Privacy Policy",description:"Learn how Caréable protects your privacy and handles your data."}),l.jsx("nav",{className:"border-b border-border/40 backdrop-blur-sm sticky top-0 z-50 bg-background/80",children:l.jsx("div",{className:"container mx-auto px-6 md:px-8",children:l.jsxs("div",{className:"flex justify-between items-center h-16 md:h-20",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("img",{src:"/careable-icon.png?v=11",alt:"Caréable",className:"w-8 h-8 rounded-full"}),l.jsx("h1",{className:"text-xl md:text-2xl font-bold",children:"Caréable"})]}),l.jsxs(de,{onClick:()=>t("/"),variant:"ghost",children:[l.jsx(ci,{className:"w-4 h-4 mr-2"}),"Back to Home"]})]})})}),l.jsx("div",{className:"container mx-auto px-6 md:px-8 py-12 md:py-20",children:l.jsxs("div",{className:"max-w-4xl mx-auto prose prose-slate dark:prose-invert",children:[l.jsx("h1",{className:"text-4xl font-bold mb-8",children:"Privacy Policy"}),l.jsx("p",{className:"text-muted-foreground text-lg mb-8",children:"Last updated: December 2025"}),l.jsxs("section",{className:"mb-8",children:[l.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"1. Introduction"}
876),l.jsx("p",{children:"At Caréable, we take your privacy seriously. This Privacy Policy explains how we collect, use, disclose, and safeguard your information when you use our family care coordination and scheduling service. This policy is designed to comply with the General Data Protection Regulation (GDPR) and other applicable data protection laws."})]}),l.jsxs("section",{className:"mb-8",children:[l.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"2. Data Controller"}),l.jsx("p",{children:"Caréable acts as the data controller for the personal data processed through our service. For questions about data protection or to exercise your rights, please contact us at:"}),l.jsxs("div",{className:"bg-muted/50 p-4 rounded-lg mt-4",children:[l.jsx("p",{className:"mb-2",children:l.jsx("strong",{children:"Data Protection Contact"})}),l.jsx("p",{className:"mb-1",children:"Please contact us through our website for data protection inquiries."}),l.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"We aim to respond to all data protection inquiries within 30 days."})]})]}),l.jsxs("section",{className:"mb-8",children:[l.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"3. Information We Collect"}),l.jsx("h3",{className:"text-xl font-semibold mb-3",children:"Personal Information"}),l.jsx("p",{children:"When you create an account, we collect:"}),l.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[l.jsx("li",{children:"Email address"}),l.jsx("li",{children:"Full name (optional)"}),l.jsx("li",{children:"Password (encrypted using bcrypt hashing)"})]}),l.jsx("h3",{className:"text-xl font-semibold mb-3 mt-6",children:"Calendar and Care Event Data"}),l.jsx("p",{children:"When you use our service, we collect:"}),l.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[l.jsx("li",{children:"Care event titles, descriptions, and locations (e.g. medical appointments, therapy sessions, medication schedules)"}),l.jsx("li",{children:"Event dates and times"}),l.jsx("li",{children:"Participant and caregiver information"}),l.jsx("li",{children:"Calendar names and descriptions"}),l.jsx("li",{children:"Sharing preferences and access permissions"}),l.jsx("li",{children:"Calendar link access codes and password hashes (when password protection is enabled)"})]}),l.jsx("div",{className:"bg-muted/50 p-4 rounded-lg mt-4",children:l.jsxs("p",{className:"text-sm",children:[l.jsx("strong",{children:"How we protect this data:"})," This information is used solely to provide you with our calendar service. Your data is protected by strict access controls â only you and the people you explicitly share your calendar with can view this information. All data is encrypted during transmission and at rest."]})}),l.jsx("h3",{className:"text-xl font-semibold mb-3 mt-6",children:"Health-Related Data (Special Category)"}),l.jsx("p",{children:"If you use Caréable for caregiving purposes, you may choose to store medication schedules and health-related appointments. This constitutes special category data under GDPR Article 9. We process this data only with your explicit consent and apply additional safeguards."}),l.jsx("div",{className:"bg-muted/50 p-4 rounded-lg mt-4",children:l.jsxs("p",{className:"text-sm",children:[l.jsx("strong",{children:"Additional safeguards for health data:"})," Health-related information receives the highest level of protection. This data is never shared with third parties, is protected by the same strict access controls as your calendar data, and can only be accessed by you. We do not use health data for any purpose other than providing you with medication tracking and caregiving scheduling features."]})}),l.jsx("h3",{className:"text-xl font-semibold mb-3 mt-6",children:"Security and Usage Information"}),l.jsx("p",{children:"For security and service integrity, we automatically collect:"}),l.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[l.jsx("li",{children:"Device information (browser type, operating system)"}),l.jsx("li",{children:"IP addresses for security monitoring and rate limiting"}),l.jsx("li",{children:"Password verification attempts (including IP addresses and timestamps)"}),l.jsx("li",{children:"API usage patterns and rate limit data"}),l.jsx("li",{children:"Audit logs of administrative actions and role changes"}),l.jsx("li",{children:"Usage patterns and interactions with the service"})]})]}),l.jsxs("section",{className:"mb-8",children:[l.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"4. Legal Basis for Processing (GDPR Article 6)"}),l.jsx("p",{children:"We process your personal data based on the following legal grounds:"}),l.jsx("h3",{className:"text-xl font-semibold mb-3 mt-6",children:"Contract Performance (Article 6(1)(b))"}),l.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[l.jsx("li",{children:"Processing account information to provide our calendar service"}),l.jsx("li",{children:"Storing and managing your calendar and event data"}),l.jsx("li",{children:"Enabling sharing features you request"})]}),l.jsx("h3",{className:"text-xl font-semibold mb-3 mt-6",children:"Legitimate Interests (Article 6(1)(f))"}),l.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[l.jsx("li",{children:"Security monitoring and fraud prevention"}),l.jsx("li",{children:"Rate limiting to protect service availability"}),l.jsx("li",{children:"Audit logging for security and compliance"}),l.jsx("li",{children:"Service improvement and analytics (aggregated, non-identifying)"})]}),l.jsx("h3",{className:"text-xl font-semibold mb-3 mt-6",children:"Consent (Article 6(1)(a))"}),l.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[l.jsx("li",{children:"AI-powered event processing and illustrations"}),l.jsx("li",{children:"Marketing communications (if applicable)"}),l.jsx("li",{children:"Processing of health-related data for caregiving features"})]}),l.jsx("h3",{className:"text-xl font-semibold mb-3 mt-6",children:"Legal Obligation (Article 6(1)(c))"}),l.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[l.jsx("li",{children:"Responding to valid legal requests from authorities"}),l.jsx("li",{children:"Tax and accounting record requirements"})]})]}),l.jsxs("section",{className:"mb-8",children:[l.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"5. How We Use Your Information"}),l.jsx("p",{children:"We use your information to:"}),l.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[l.jsx("li",{children:"Provide, maintain, and improve our family care coordination service"}),l.jsx("li",{children:"Process your care events and schedules through AI features"}),l.jsx("li",{children:"Enable sharing and collaboration with family members and professional caregivers"}),l.jsx("li",{children:"Communicate with you about your account and service updates"}),l.jsx("li",{children:"Respond to your requests and provide customer support"}),l.jsx("li",{children:"Ensure security and prevent fraud through IP-based monitoring"}),l.jsx("li",{children:"Detect and prevent brute-force attacks and suspicious activity"}),l.jsx("li",{children:"Enforce rate limits to protect service availability and prevent abuse"}),l.jsx("li",{children:"Maintain audit trails for compliance and security purposes"})]})]}),l.jsxs("section",{className:"mb-8",children:[l.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"6. Information Sharing"}),l.jsx("p",{children:"We do not sell your personal information. We may share your information:"}),l.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"With your consent:"})," When you explicitly choose to share calendars or events with others"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Service providers:"})," With trusted third parties who assist in operating our service (under data processing agreements)"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Legal requirements:"})," When required by law or to protect our rights"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Business transfers:"})," In connection with a merger, sale, or acquisition"]})]}),l.jsx("h3",{className:"text-xl font-semibold mb-3 mt-6",children:"Sub-processors"}),l.jsx("p",{children:"We use the following categories of sub-processors:"}),l.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[l.jsx("li",{children:"Cloud infrastru
876cture providers (data hosting)"}),l.jsx("li",{children:"AI service providers (for event parsing and illustration generation)"}),l.jsx("li",{children:"Authentication service providers"})]})]}),l.jsxs("section",{className:"mb-8",children:[l.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"7. Data Security"}),l.jsx("p",{children:"We implement comprehensive technical and organizational security measures to protect your information:"}),l.jsx("h3",{className:"text-xl font-semibold mb-3 mt-6",children:"Technical Security Measures"}),l.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[l.jsx("li",{children:"End-to-end encryption of data in transit using TLS/SSL"}),l.jsx("li",{children:"Encryption of sensitive data at rest"}),l.jsx("li",{children:"Bcrypt password hashing with salt for all user credentials"}),l.jsx("li",{children:"Row-level security (RLS) policies on all database tables"}),l.jsx("li",{children:"Secure session management with automatic timeout"}),l.jsx("li",{children:"Protected API endpoints with role-based access control"})]}),l.jsx("h3",{className:"text-xl font-semibold mb-3 mt-6",children:"Security Monitoring"}),l.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[l.jsx("li",{children:"Real-time IP-based rate limiting to prevent abuse"}),l.jsx("li",{children:"Automated brute-force attack detection and blocking"}),l.jsx("li",{children:"Password verification attempt tracking"}),l.jsx("li",{children:"Comprehensive audit logging of administrative actions"}),l.jsx("li",{children:"Automated security alerts for suspicious patterns"})]})]}),l.jsxs("section",{className:"mb-8",children:[l.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"8. Data Retention"}),l.jsx("p",{children:"We retain your information only as long as necessary for the purposes described in this policy."}),l.jsx("h3",{className:"text-xl font-semibold mb-3 mt-6",children:"Retention Periods"}),l.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Password verification attempts:"})," 30 days"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"API rate limit records:"})," 24 hours"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Audit logs:"})," 90 days"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"User account data:"})," Until you request deletion"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Calendar and event data:"})," Until you delete them or close your account"]})]}),l.jsx("p",{className:"mt-4",children:"When you delete your account, we permanently delete all your personal data within 30 days, except where retention is required by law."})]}),l.jsxs("section",{className:"mb-8",children:[l.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"9. Your Rights Under GDPR"}),l.jsx("p",{children:"If you are in the European Economic Area (EEA), United Kingdom, or Switzerland, you have the following rights:"}),l.jsx("h3",{className:"text-xl font-semibold mb-3 mt-6",children:"Right of Access (Article 15)"}),l.jsx("p",{children:"You can request a copy of all personal data we hold about you."}),l.jsx("h3",{className:"text-xl font-semibold mb-3 mt-6",children:"Right to Rectification (Article 16)"}),l.jsx("p",{children:"You can request correction of inaccurate or incomplete personal data."}),l.jsx("h3",{className:"text-xl font-semibold mb-3 mt-6",children:"Right to Erasure (Article 17)"}),l.jsx("p",{children:"You can request deletion of your personal data. You can delete your account at any time through Settings â Account Management â Delete Account. This will permanently remove all your data."}),l.jsx("h3",{className:"text-xl font-semibold mb-3 mt-6",children:"Right to Restrict Processing (Article 18)"}),l.jsx("p",{children:"You can request that we limit how we use your data in certain circumstances."}),l.jsx("h3",{className:"text-xl font-semibold mb-3 mt-6",children:"Right to Data Portability (Article 20)"}),l.jsx("p",{children:"You can request your data in a structured, commonly used, machine-readable format. Contact us to request a data export."}),l.jsx("h3",{className:"text-xl font-semibold mb-3 mt-6",children:"Right to Object (Article 21)"}),l.jsx("p",{children:"You can object to processing based on legitimate interests or for direct marketing purposes."}),l.jsx("h3",{className:"text-xl font-semibold mb-3 mt-6",children:"Right to Withdraw Consent (Article 7(3))"}),l.jsx("p",{children:"Where we process data based on consent, you can withdraw that consent at any time. Withdrawal does not affect the lawfulness of processing before withdrawal."}),l.jsx("h3",{className:"text-xl font-semibold mb-3 mt-6",children:"Right to Lo
876dge a Complaint"}),l.jsx("p",{children:"You have the right to lodge a complaint with a supervisory authority if you believe our processing of your personal data violates GDPR. You can contact your local data protection authority in the EU/EEA member state where you live or work, or where the alleged infringement occurred."}),l.jsxs("p",{className:"mt-2",children:["A list of EU data protection authorities is available at:"," ",l.jsx("a",{href:"https://edpb.europa.eu/about-edpb/about-edpb/members_en",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"https://edpb.europa.eu/about-edpb/about-edpb/members_en"})]}),l.jsxs("div",{className:"bg-muted/50 p-4 rounded-lg mt-6",children:[l.jsx("p",{className:"font-semibold mb-2",children:"How to Exercise Your Rights"}),l.jsx("p",{children:'To exercise any of these rights, please contact us through our website with the subject "GDPR Rights Request". We will respond within 30 days. We may need to verify your identity before processing your request.'})]})]}),l.jsxs("section",{className:"mb-8",children:[l.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"10. International Data Transfers"}),l.jsx("p",{children:"Your information may be transferred to and processed in countries outside the EEA. When we transfer data internationally, we ensure appropriate safeguards are in place:"}),l.jsxs("ul",{className:"list-disc pl-6 space-y-2 mt-4",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Adequacy decisions:"})," We may transfer data to countries that the European Commission has determined provide adequate data protection."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Standard Contractual Clauses (SCCs):"})," For transfers to other countries, we use EU-approved Standard Contractual Clauses to ensure your data is protected to EU standards."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Additional safeguards:"})," We implement supplementary technical and organizational measures where necessary, including encryption and access controls."]})]}),l.jsx("p",{className:"mt-4",children:"You can request a copy of the safeguards we use for international transfers by contacting us."})]}),l.jsxs("section",{className:"mb-8",children:[l.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"11. Automated Decision-Making"}),l.jsx("p",{children:"We use AI to process natural language care event descriptions (such as medication reminders, therapy sessions, and caregiver visits) and generate event illustrations. This processing:"}),l.jsxs("ul",{className:"list-disc pl-6 space-y-2 mt-4",children:[l.jsx("li",{children:"Is based on your explicit consent when you use these features"}),l.jsx("li",{children:"Does not produce legal or similarly significant effects"}),l.jsx("li",{children:"Can be disabled in your event creation settings"})]}),l.jsx("p",{className:"mt-4",children:"We do not use fully automated decision-making that produces legal effects concerning you."})]}),l.jsxs("section",{className:"mb-8",children:[l.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"12. Browser Storage"}),l.jsx("p",{children:"We use browser storage technologies (primarily localStorage) to provide essential functionality. We do not use third-party tracking cookies."}),l.jsxs("ul",{className:"list-disc pl-6 space-y-2 mt-4",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Authentication Data:"})," Access tokens to keep you signed in"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"User Preferences:"})," Theme settings and application preferences"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Cookie Consent:"})," Your consent choice for this notice"]})]})]}),l.jsxs("section",{className:"mb-8",children:[l.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"13. Children's Privacy"}),l.jsx("p",{children:"Caréable is not intended for children under 16 years of age (or the applicable age of digital consent in your jurisdiction). We do not knowingly collect personal information from children. If you believe we have collected information from a child, please contact us immediately."})]}),l.jsxs("section",{className:"mb-8",children:[l.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"14. Changes to This Policy"}),l.jsx("p",{children:"We may update this Privacy Policy from time to time. For significant changes, we will notify you by email (if you have an account) and by posting a prominent notice on our service at least 30 days before the changes take effect. Your continued use of the service after such changes constitutes your acceptance of the updated policy."})]}),l.jsxs("section",{className:"mb-8",children:[l.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"15. Contact Us"}),l.jsx("p",{children:"If you have any questions about this Privacy Policy, our data practices, or wish to exercise your rights, please contact us:"}),l.jsxs("div",{className:"bg-muted/50 p-4 rounded-lg mt-4",children:[l.jsx("p",{className:"mb-2",children:l.jsx("strong",{children:"Contact Us"})}),l.jsx("p",{className:"mb-1",children:"Please contact us through our website for any inquiries."}),l.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:'For EU residents exercising GDPR rights, please include "GDPR Rights Request" in your message.'})]})]})]})})]})}function z0e(){const t=rr(),[e,n]=b.useState(!1);b.useEffect(()=>{window.scrollTo(0,0)},[]);const r=()=>{navigator.clipboard.writeText("[email protected]"),n(!0),setTimeout(()=>n(!1),2e3)};return l.jsxs("div",{className:"min-h-screen bg-background",children:[l.jsx(es,{canonical:"https://careable.co/about",title:"About Us",description:"Meet the team behind Caréable. We're building a care-able way to plan as one."}),l.jsx("nav",{className:"border-b border-border/40 backdrop-blur-sm sticky top-0 z-50 bg-background/80",children:l.jsx("div",{className:"container mx-auto px-6 md:px-8",children:l.jsxs("div",{className:"flex justify-between items-center h-16 md:h-20",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("img",{src:"/careable-icon.png?v=11",alt:"Caréable",className:"w-8 h-8 rounded-full"}),l.jsx("h1",{className:"text-xl md:text-2xl font-bold",children:"Caréable"})]}),l.jsxs(de,{onClick:()=>t("/"),variant:"ghost",className:"min-h-[44px]",children:[l.jsx(ci,{className:"w-4 h-4 mr-2"}),"Back to Home"]})]})})}),l.jsx("div",{className:"container mx-auto px-6 md:px-8 py-12 md:py-20",children:l.jsxs("div",{className:"max-w-4xl mx-auto",children:[l.jsxs("div",{className:"text-center mb-12 md:mb-16 animate-fade-in",children:[l.jsx("h1",{className:"text-4xl md:text-5xl font-bold mb-4",children:"About Us"}),l.jsx("p",{className:"text-lg md:text-xl text-muted-foreground",children:"Making family care coordination simple and accessible â especially for families supporting loved one
876s with aphasia, disability, or recovering from severe accidents"})]}),l.jsx(rt,{className:"mb-8 md:mb-12 animate-fade-in",style:{animationDelay:"0.1s",animationFillMode:"backwards"},children:l.jsx(ot,{className:"p-6 md:p-8",children:l.jsxs("div",{className:"flex flex-col md:flex-row gap-6 items-start",children:[l.jsx("div",{className:"w-24 h-24 rounded-full bg-gradient-to-br from-calendar-blue via-calendar-coral to-calendar-peach flex items-center justify-center text-white text-3xl font-bold flex-shrink-0",children:"AW"}),l.jsxs("div",{className:"flex-1 space-y-4",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-xl font-semibold mb-2",children:"Amaca Wang"}),l.jsx("p",{className:"text-muted-foreground",children:"UX/Product Designer & Vibe-Coder"})]}),l.jsxs("div",{className:"prose prose-sm max-w-none text-foreground/90 leading-relaxed space-y-3",children:[l.jsx("p",{children:"Hi, I'm a UX/Product Designer â and a little bit of a vibe-coder too. I built Caréable together with my AI partner, Lovable, to help families coordinate care for their loved ones â especially those supporting someone with aphasia, a disability, or recovering from a severe accident. We're currently in beta â a minimum lovable version."}),l.jsx("p",{children:"I'd love to grow this with you."}),l.jsx("p",{children:"Whether you're coordinating post-stroke recovery, managing rehab after a serious accident, navigating daily care for a disability, or organising specialist visits â please share bug reports, feedback, or feature requests. Every note helps shape Caréable into something truly caring and beautiful. I'll follow up closely and improve it with care. ð"})]}),l.jsxs("div",{className:"pt-2",children:[l.jsx("p",{className:"text-sm font-medium mb-3",children:"You can reach me here:"}),l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsxs(de,{variant:"outline",onClick:()=>window.open("https://linkedin.com/in/amacawang","_blank"),className:"w-full sm:w-auto h-10 justify-start",children:[l.jsx(cZ,{className:"w-4 h-4 mr-2"}),"LinkedIn"]}),l.jsxs(de,{variant:"outline",onClick:()=>window.open("https://x.com/Amacaatje","_blank"),className:"w-full sm:w-auto h-10 justify-start",children:[l.jsx("svg",{className:"w-4 h-4 mr-2",viewBox:"0 0 24 24",fill:"currentColor",children:l.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})}),"X (Twitter)"]}),l.jsxs("div",{className:"flex items-center gap-2 px-3 rounded-md border border-border bg-muted/30 h-10",children:[l.jsx(uZ,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),l.jsx("span",{className:"text-sm flex-1 min-w-0",children:"[email protected]"}),l.jsx(de,{variant:"ghost",size:"sm",onClick:r,className:"h-8 w-8 p-0 ml-2 flex-shrink-0",children:e?l.jsx(_s,{className:"w-4 h-4 text-green-600"}):l.jsx(Pd,{className:"w-4 h-4"})})]})]})]})]})]})})}),l.jsx("div",{className:"grid md:grid-cols-3 gap-8 md:gap-10 animate-fade-in",style:{animationDelay:"0.3s",animationFillMode:"backwards"},children:[{title:"Simplicity First",description:"No learning curve. No manual. Just natural, intuitive care scheduling â even when a loved one has aphasia or communication challenges.",radius:"42% 58% 70% 30% / 45% 55% 45% 55%",hoverRadius:"58% 42% 30% 70% / 55% 45% 55% 45%",gradient:"linear-gradient(135deg, hsl(199 89% 78% / 0.35), hsl(199 89% 78% / 0.15))"},{title:"Inclusive by Design",description:"Built for every caregiver â from families navigating disability care to those coordinating recovery after a severe accident.",radius:"60% 40% 35% 65% / 50% 60% 40% 50%",hoverRadius:"40% 60% 65% 35% / 60% 40% 60% 40%",gradient:"linear-gradient(135deg, hsl(11 72% 68% / 0.3), hsl(24 90% 78% / 0.2))"},{title:"Community Focused",description:"Your feedback shapes our features. Built by and for caregiving families.",radius:"35% 65% 55% 45% / 65% 35% 60% 40%",hoverRadius:"65% 35% 45% 55% / 35% 65% 40% 60%",gradient:"linear-gradient(135deg, hsl(168 60% 68% / 0.3), hsl(199 89% 78% / 0.2))"}].map((i,a)=>l.jsxs("div",{className:"relative flex items-center justify-center w-56 h-56 md:w-64 md:h-64 mx-auto",children:[l.jsx("div",{className:"absolute inset-0 backdrop-blur-sm border border-border/30",style:{background:i.gradient,animation:`about-stone-${a} ${6+a*1.3}s ease-in-out infinite`}}),l.jsxs("div",{className:"relative z-10 flex flex-col items-center justify-center text-center px-8",children:[l.jsx("h3",{className:"text-lg md:text-xl font-semibold mb-2 leading-tight",children:i.title}),l.jsx("p",{className:"text-sm text-muted-foreground leading-snug",children:i.description})]}),l.jsx("style",{children:` 877 @keyframes about-stone-${a} { 878 0%, 100% { border-radius: ${i.radius}; transform: scale(1) rotate(0deg); } 879 50% { border-radius: ${i.hoverRadius}; transform: scale(1.04) rotate(${a%2===0?3:-3}deg); } 880 } 881 `})]},a))})]})}),l.jsx("footer",{className:"border-t border-border/40 py-8 md:py-12 mt-12",children:l.jsx("div",{className:"container mx-auto px-6 md:px-8",children:l.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-center gap-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"w-6 h-6 rounded bg-gradient-to-br from-calendar-blue via-calendar-coral to-calendar-peach"}),l.jsx("span",{className:"font-semibold",children:"Caréable"})]}),l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx(de,{variant:"ghost",size:"sm",onClick:()=>t("/updates"),className:"text-sm text-muted-foreground hover:text-foreground",children:"Updates"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"© 2025 Caréable. Care coordination, simplified."})]})]})})})]})}function W0e(t,e){return b.useReducer((n,r)=>e[n][r]??n,t)}var XP="ScrollArea",[SV,bBe]=Yr(XP),[V0e,ua]=SV(XP),kV=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:a=600,...s}=t,[o,c]=b.useState(null),[u,d]=b.useState(null),[h,f]=b.useState(null),[p,g]=b.useState(null),[m,v]=b.useState(null),[x,w]=b.useState(0),[y,k]=b.useState(0),[S,_]=b.useState(!1),[C,T]=b.useState(!1),E=bt(e,P=>c(P)),j=Jg(i);return l.jsx(V0e,{scope:n,type:r,dir:j,scrollHideDelay:a,scrollArea:o,viewport:u,onViewportChange:d,content:h,onContentChange:f,scrollbarX:p,onScrollbarXChange:g,scrollbarXEnabled:S,onScrollbarXEnabledChange:_,scrollbarY:m,onScrollbarYChange:v,scrollbarYEnabled:C,onScrollbarYEnabledChange:T,onCornerWidthChange:w,onCornerHeight
vendor: 6,154 bytes, line 881
881Change:k,children:l.jsx(Ke.div,{dir:j,...s,ref:E,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":y+"px",...t.style}})})});kV.displayName=XP;var _V="ScrollAreaViewport",CV=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:r,nonce:i,...a}=t,s=ua(_V,n),o=b.useRef(null),c=bt(e,o,s.onViewportChange);return l.jsxs(l.Fragment,{children:[l.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:i}),l.jsx(Ke.div,{"data-radix-scroll-area-viewport":"",...a,ref:c,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...t.style},children:l.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});CV.displayName=_V;var Rs="ScrollAreaScrollbar",ZP=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=ua(Rs,t.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:s}=i,o=t.orientation==="horizontal";return b.useEffect(()=>(o?a(!0):s(!0),()=>{o?a(!1):s(!1)}),[o,a,s]),i.type==="hover"?l.jsx(H0e,{...r,ref:e,forceMount:n}):i.type==="scroll"?l.jsx(q0e,{...r,ref:e,forceMount:n}):i.type==="auto"?l.jsx(TV,{...r,ref:e,forceMount:n}):i.type==="always"?l.jsx(QP,{...r,ref:e}):null});ZP.displayName=Rs;var H0e=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=ua(Rs,t.__scopeScrollArea),[a,s]=b.useState(!1);return b.useEffect(()=>{const o=i.scrollArea;let c=0;if(o){const u=()=>{window.clearTimeout(c),s(!0)},d=()=>{c=window.setTimeout(()=>s(!1),i.scrollHideDelay)};return o.addEventListener("pointerenter",u),o.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),o.removeEventListener("pointerenter",u),o.removeEventListener("pointerleave",d)}}},[i.scrollArea,i.scrollHideDelay]),l.jsx(ui,{present:n||a,children:l.jsx(TV,{"data-state":a?"visible":"hidden",...r,ref:e})})}),q0e=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=ua(Rs,t.__scopeScrollArea),a=t.orientation==="horizontal",s=Bw(()=>c("SCROLL_END"),100),[o,c]=W0e("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 b.useEffect(()=>{if(o==="idle"){const u=window.setTimeout(()=>c("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(u)}},[o,i.scrollHideDelay,c]),b.useEffect(()=>{const u=i.viewport,d=a?"scrollLeft":"scrollTop";if(u){let h=u[d];const f=()=>{const p=u[d];h!==p&&(c("SCROLL"),s()),h=p};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[i.viewport,a,c,s]),l.jsx(ui,{present:n||o!=="hidden",children:l.jsx(QP,{"data-state":o==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:Ie(t.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:Ie(t.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),TV=b.forwardRef((t,e)=>{const n=ua(Rs,t.__scopeScrollArea),{forceMount:r,...i}=t,[a,s]=b.useState(!1),o=t.orientation==="horizontal",c=Bw(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;s(o?u:d)}},10);return Oh(n.viewport,c),Oh(n.content,c),l.jsx(ui,{present:r||a,children:l.jsx(QP,{"data-state":a?"visible":"hidden",...i,ref:e})})}),QP=b.forwardRef((t,e)=>{const{orientation:n="vertical",...r}=t,i=ua(Rs,t.__scopeScrollArea),a=b.useRef(null),s=b.useRef(0),[o,c]=b.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=AV(o.viewport,o.content),d={...r,sizes:o,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:f=>a.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function h(f,p){return Z0e(f,s.current,o,p)}return n==="horizontal"?l.jsx(K0e,{...d,ref:e,onThumbPositionChange:()=>{if(i.viewport&&a.current){const f=i.viewport.scrollLeft,p=sM(f,o,i.dir);a.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:f=>{i.viewport&&(i.viewport.scrollLeft=f)},onDragScroll:f=>{i.viewport&&(i.viewport.scrollLeft=h(f,i.dir))}}):n==="vertical"?l.jsx(G0e,{...d,ref:e,onThumbPositionChange:()=>{if(i.viewport&&a.current){const f=i.viewport.scrollTop,p=sM(f,o);a.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:f=>{i.viewport&&(i.viewport.scrollTop=f)},onDragScroll:f=>{i.viewport&&(i.viewport.scrollTop=h(f))}}):null}),K0e=b.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...i}=t,a=ua(Rs,t.__scopeScrollArea),[s,o]=b.useState(),c=b.useRef(null),u=bt(e,c,a.onScrollbarXChange);return b.useEffect(()=>{c.current&&o(getComputedStyle(c.current))},[c]),l.jsx(jV,{"data-orientation":"horizontal",...i,ref:u,sizes:n,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Fw(n)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.x),onDragScroll:d=>t.onDragScroll(d.x),onWheelScroll:(d,h)=>{if(a.viewport){const f=a.viewport.scrollLeft+d.deltaX;t.onWheelScroll(f),RV(f,h)&&d.preventDefault()}},onResize:()=>{c.current&&a.viewport&&s&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:fb(s.paddingLeft),paddingEnd:fb(s.paddingRight)}})}})}),G0e=b.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...i}=t,a=ua(Rs,t.__scopeScrollArea),[s,o]=b.useState(),c=b.useRef(null),u=bt(e,c,a.onScrollbarYChange);return b.useEffect(()=>{c.current&&o(getComputedStyle(c.current))},[c]),l.jsx(jV,{"data-orientation":"vertical",...i,ref:u,sizes:n,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Fw(n)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.y),onDragScroll:d=>t.onDragScroll(d.y),onWheelScroll:(d,h)=>{if(a.viewport){const f=a.viewport.scrollTop+d.deltaY;t.onWheelScroll(f),RV(f,h)&&d.preventDefault()}},onResize:()=>{c.current&&a.viewport&&s&&r({content:a.viewport.scrollHeight,viewport:
881a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:fb(s.paddingTop),paddingEnd:fb(s.paddingBottom)}})}})}),[Y0e,EV]=SV(Rs),jV=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:s,onThumbPointerDown:o,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:h,...f}=t,p=ua(Rs,n),[g,m]=b.useState(null),v=bt(e,E=>m(E)),x=b.useRef(null),w=b.useRef(""),y=p.viewport,k=r.content-r.viewport,S=Wn(d),_=Wn(c),C=Bw(h,10);function T(E){if(x.current){const j=E.clientX-x.current.left,P=E.clientY-x.current.top;u({x:j,y:P})}}return b.useEffect(()=>{const E=j=>{const P=j.target;(g==null?void 0:g.contains(P))&&S(j,k)};return document.addEventListener("wheel",E,{passive:!1}),()=>document.removeEventListener("wheel",E,{passive:!1})},[y,g,k,S]),b.useEffect(_,[r,_]),Oh(g,C),Oh(p.content,C),l.jsx(Y0e,{scope:n,scrollbar:g,hasThumb:i,onThumbChange:Wn(a),onThumbPointerUp:Wn(s),onThumbPositionChange:_,onThumbPointerDown:Wn(o),children:l.jsx(Ke.div,{...f,ref:v,style:{position:"absolute",...f.style},onPointerDown:Ie(t.onPointerDown,E=>{E.button===0&&(E.target.setPointerCapture(E.pointerId),x.current=g.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),T(E))}),onPointerMove:Ie(t.onPointerMove,T),onPointerUp:Ie(t.onPointerUp,E=>{const j=E.target;j.hasPointerCapture(E.pointerId)&&j.releasePointerCapture(E.pointerId),document.body.style.webkitUserSelect=w.current,p.viewport&&(p.viewport.style.scrollBehavior=""),x.current=null})})})}),hb="ScrollAreaThumb",PV=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=EV(hb,t.__scopeScrollArea);return l.jsx(ui,{present:n||i.hasThumb,children:l.jsx(J0e,{ref:e,...r})})}),J0e=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:r,...i}=t,a=ua(hb,n),s=EV(hb,n),{onThumbPositionChange:o}=s,c=bt(e,h=>s.onThumbChange(h)),u=b.useRef(void 0),d=Bw(()=>{u.current&&(u.current(),u.current=void 0)},100);return b.useEffect(()=>{const h=a.viewport;if(h){const f=()=>{if(d(),!u.current){const p=Q0e(h,o);u.current=p,o()}};return o(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[a.viewport,d,o]),l.jsx(Ke.div,{"data-state":s.hasThumb?"visible":"hidden",...i,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ie(t.onPointerDownCapture,h=>{const p=h.target.getBoundingClientRect(),g=h.clientX-p.left,m=h.clientY-p.top;s.onThumbPointerDown({x:g,y:m})}),onPointerUp:Ie(t.onPointerUp,s.onThumbPointerUp)})});PV.displayName=hb;var eN="ScrollAreaCorner",NV=b.forwardRef((t,e)=>{const n=ua(eN,t.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?l.jsx(X0e,{...t,ref:e}):null});NV.displayName=eN;var X0e=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,...r}=t,i=ua(eN,n),[a,s]=b.useState(0),[o,c]=b.useState(0),u=!!(a&&o);return Oh(i.scrollbarX,()=>{var h;const d=((h=i.scrollbarX)==null?void 0:h.offsetHeight)||0;i.onCornerHeightChange(d),c(d)}),Oh(i.scrollbarY,()=>{var h;const d=((h=i.scrollbarY)==null?void 0:h.offsetWidth)||0;i.onCornerWidthChange(d),s(d)}),u?l.jsx(Ke.div,{...r,ref:e,style:{width:a,height:o,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function fb(t){return t?parseInt(t,10):0}function AV(t,e){const n=t/e;return isNaN(n)?0:n}function Fw(t){const e=AV(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function Z0e(t,e,n,r="ltr"){const i=Fw(n),a=i/2,s=e||a,o=i-s,c=n.scrollbar.paddingStart+s,u=n.scrollbar.size-n.scrollbar.paddingEnd-o,d=n.content-n.viewport,h=r==="ltr"?[0,d]:[d*-1,0];return OV([c,u],h)(t)}function sM(t,e,n="ltr"){const r=Fw(e),i=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,a=e.scrollbar.size-i,s=e.content-e.viewport,o=a-r,c=n==="ltr"?[0,s]:[s*-1,0],u=EC(t,c);return OV([0,s],[0,o])(u)}function OV(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function RV(t,e){return t>0&&t<e}var Q0e=(t,e=()=>{})=>{let n={left:t.scrollLeft,top:t.scrollTop},r=0;return function i(){const a={left:t.scrollLeft,top:t.scrollTop},s=n.left!==a.left,o=n.top!==a.top;(s||o)&&e(),n=a,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function Bw(t,e){const n=Wn(t),r=b.useRef(0);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),b.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,e)},[n,e])}function Oh(t,e){const n=Wn(e);Ln(()=>{let r=0;if(t){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(t),()=>{window.cancelAnimationFrame(r),i.unobserve(t)}}},[t,n])}var DV=kV,ebe=CV,tbe=NV;const pb=b.forwardRef(({className:t,children:e,...n},r)=>l.jsxs(DV,{ref:r,className:ce("relative overflow-hidden",t),...n,children:[l.jsx(ebe,{className:"h-full w-full rounded-[inherit]",children:e}),l.jsx(MV,{}),l.jsx(tbe,{})]}));pb.displayName=DV.displayName;const MV=b.forwardRef(({className:t,orientation:e="vertical",...n},r)=>l.jsx(ZP,{ref:r,orientation:e,className:ce("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...n,children:l.jsx(PV,{className:"relative flex-1 rounded-full bg-border"})}));MV.displayName=ZP.displayName;function nbe(){const[t,e]=b.useState([]),[n,r]=b.useState(0),[i,a]=b.useState(!0);b.useEffect(()=>{s(),o()},[]);const s=async()=>{try{const{data:h,error:f}=await me.from("admin_notifications").select("*").order("created_at",{ascending:!1}).limit(50);if(f)throw f;const p=(h||[]).map(g=>({...g,severity:g.severity,metadata:g.metadata}));e(p),r(p.filter(g=>!g.is_read).length)}catch(h){console.error("Error fetching notifications:",h)}finally{a(!1)}},o=()=>{const h=me.channel("admin-notifications").on("postgres_changes",{event:"INSERT",schema:"public",table:"admin_notifications"},f=>{const p=f.new;e(g=>[p,...g]),r(g=>g+1)}).on("postgres_changes",{event:"UPDATE",schema:"public",table:"admin_notifications"},f=>{const p=f.new;e(g=>g.map(m=>m.id===p.id?p:m)),p.is_read&&r(g=>Math.max(0,g-1))}).subscribe();return()=>{me.removeChannel(h)}};return{notifications:t,unreadCount:n,loading:i,markAsRead:async h=>{var f;try{const{error:p}=await me.from("admin_notifications").update({is_read:!0,read_at:new Date().toISOString(),read_by:(f=(await me.auth.getUser()).data.user)==null?void 0:f.id}).eq("id",h);if(p)throw p}catch(p){console.error("Error marking notification as read:",p)}},markAllAsRead:async()=>{var h;try{const{error:f}=await me.from("admin_notifications").update({is_read:!0,read_at:new Date().toISOString(),read_by:(h=(await me.auth.getUser()).data.user)==null?void 0:h.id}).eq("is_read",!1);if(f)throw f;e(p=>p.map(g=>({...g,is_read:!0}))),r(0)}catch(f){console.error("Error marking all as read:",f)}},deleteNotification:async h=>{try{const{error:f}=await me.from("admin_notifications").delete().eq("id",h);if(f)throw f;e(p=>p.filter(g=>g.id!==h))}catch(f){console.error("Error deleting notification:",f)}},refreshNotifications:s}}function rbe(){const{notifications:t,unreadCount:e,loading:n,markAsRead:r,markAllAsRead:i,deleteNotification:a}=nbe(),s=c=>
881{switch(c){case"critical":return l.jsx(f$,{className:"w-4 h-4 text-destructive"});case"warning":return l.jsx(bc,{className:"w-4 h-4 text-yellow-500"});case"info":default:return l.jsx(oZ,{className:"w-4 h-4 text-blue-500"})}},o=c=>{switch(c){case"critical":return"border-l-destructive bg-destructive/5";case"warning":return"border-l-yellow-500 bg-yellow-500/5";case"info":default:return"border-l-blue-500 bg-blue-500/5"}};return n?l.jsx(de,{variant:"ghost",size:"icon",disabled:!0,children:l.jsx(vc,{className:"w-5 h-5"})}):l.jsxs(cV,{children:[l.jsx(lV,{asChild:!0,children:l.jsxs(de,{variant:"ghost",size:"icon",className:"relative",children:[l.jsx(vc,{className:"w-5 h-5"}),e>0&&l.jsx(Rn,{variant:"destructive",className:"absolute -top-1 -right-1 h-5 w-5 p-0 flex items-center justify-center text-xs",children:e>9?"9+":e})]})}),l.jsxs($P,{className:"w-96 p-0",align:"end",children:[l.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[l.jsxs("div",{children:[l.jsx("h4",{className:"font-semibold",children:"Notifications"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:e>0?`${e} unread`:"All caught up!"})]}),e>0&&l.jsxs(de,{variant:"ghost",size:"sm",onClick:i,className:"text-xs",children:[l.jsx(_s,{className:"w-3 h-3 mr-1"}),"Mark all read"]})]}),l.jsx(pb,{className:"h-[400px]",children:t.length===0?l.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[l.jsx(vc,{className:"w-12 h-12 text-muted-foreground mb-2"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"No notifications yet"})]}):l.jsx("div",{className:"divide-y",children:t.map(c=>l.jsx("div",{className:ce("p-4 border-l-4 transition-colors",o(c.severity),!c.is_read&&"bg-muted/50"),children:l.jsxs("div",{className:"flex items-start justify-between gap-2",children:[l.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[s(c.severity),l.jsxs("div",{className:"flex-1 space-y-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("p",{className:"font-semibold text-sm",children:c.title}),!c.is_read&&l.jsx(Rn,{variant:"secondary",className:"text-xs px-1 py-0",children:"New"})]}),l.jsx("p",{className:"text-sm text-muted-foreground",children:c.message}),l.jsx("p",{className:"text-xs text-muted-foreground",children:new Date(c.created_at).toLocaleString()})]})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[!c.is_read&&l.jsx(de,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>r(c.id),title:"Mark as read",children:l.jsx(_s,{className:"w-4 h-4"})}),l.jsx(de,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>a(c.id),title:"Delete notification",children:l.jsx(vo,{className:"w-4 h-4"})})]})]})},c.id))})})]})]})}const Ym=b.forwardRef(({className:t,...e},n)=>l.jsx("div",{className:"relative w-full overflow-auto",children:l.jsx("table",{ref:n,className:ce("w-full caption-bottom text-sm",t),...e})}));Ym.displayName="Table";const Jm=b.forwardRef(({className:t,...e},n)=>l.jsx("thead",{ref:n,className:ce("[&_tr]:border-b",t),...e}));Jm.displayName="TableHeader";const Xm=b.forwardRef(({className:t,...e},n)=>l.jsx("tbody",{ref:n,className:ce("[&_tr:last-child]:border-0",t),...e}));Xm.displayName="TableBody";const ibe=b.forwardRef(({className:t,...e},n)=>l.jsx("tfoot",{ref:n,className:ce("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...e}));ibe.displayName="TableFooter";const ro=b.forwardRef(({className:t,...e},n)=>l.jsx("tr",{ref:n,className:ce("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",t),...e}));ro.displayName="TableRow";const dn=b.forwardRef(({className:t,...e},n)=>l.jsx("th",{ref:n,className:ce("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...e}));dn.displayName="TableHead";const hn=b.forwardRef(({className:t,...e},n)=>l.jsx("td",{ref:n,className:ce("p-4 align-middle [&:has([role=checkbox])]:pr-0",t),...e}));hn.displayName="TableCell";const abe=b.forwardRef(({className:t,...e},n)=>l.jsx("caption",{ref:n,className:ce("mt-4 text-sm text-muted-foreground",t),...e}));abe.displayName="TableCaption";function sbe(){const[t,e]=b.useState([]),[n,r]=b.useState(!0);b.useEffect(()=>{i();const s=me.channel("role-audit-logs").on("postgres_changes",{event:"INSERT",schema:"public",table:"audit_logs",filter:"action_type=eq.role_change"},()=>{i()}).subscribe();return()=>{me.removeChannel(s)}},[]);const i=async()=>{try{const{data:s,error:o}=await me.from("audit_logs").select("*").eq("action_type","role_change").order("created_at",{ascending:!1}).limit(50);if(o)throw o;const c=await Promise.all((s||[]).map(async u=>{const d=me.from("profiles").select("email, full_name").eq("id",u.actor_id).single();let h=null;u.target_user_id&&(h=me.from("profiles").select("email, full_name").eq("id",u.target_user_id
881).single());const[f,p]=await Promise.all([d,h]);return{...u,actor_profile:f.data,target_profile:p==null?void 0:p.data}}));e(c)}catch(s){console.error("Error fetching audit logs:",s)}finally{r(!1)}},a=s=>(s==null?void 0:s.operation)==="INSERT"?"default":(s==null?void 0:s.operation)==="DELETE"?"destructive":"secondary";return n?l.jsx(rt,{children:l.jsxs(ht,{children:[l.jsx(mt,{children:"Role Change Audit Trail"}),l.jsx(tn,{children:"Loading audit logs..."})]})}):l.jsxs(rt,{children:[l.jsxs(ht,{children:[l.jsx(mt,{children:"Role Change Audit Trail"}),l.jsx(tn,{children:"Track all admin role changes, including who made the change and when"})]}),l.jsx(ot,{children:t.length===0?l.jsx("p",{className:"text-muted-foreground text-center py-8",children:"No role changes recorded yet"}):l.jsx("div",{className:"overflow-x-auto",children:l.jsxs(Ym,{children:[l.jsx(Jm,{children:l.jsxs(ro,{children:[l.jsx(dn,{children:"Action"}),l.jsx(dn,{children:"Target User"}),l.jsx(dn,{children:"Changed By"}),l.jsx(dn,{children:"When"}),l.jsx(dn,{children:"Details"})]})}),l.jsx(Xm,{children:t.map(s=>{var o,c,u,d,h,f;return l.jsxs(ro,{children:[l.jsx(hn,{children:l.jsx(Rn,{variant:a(s.metadata),children:((o=s.metadata)==null?void 0:o.operation)||"CHANGE"})}),l.jsx(hn,{children:l.jsxs("div",{children:[l.jsx("div",{className:"font-medium",children:((c=s.target_profile)==null?void 0:c.full_name)||"Unknown User"}),l.jsx("div",{className:"text-sm text-muted-foreground",children:(u=s.target_profile)==null?void 0:u.email})]})}),l.jsx(hn,{children:l.jsxs("div",{children:[l.jsx("div",{className:"font-medium",children:((d=s.actor_profile)==null?void 0:d.full_name)||"System"}),l.jsx("div",{className:"text-sm text-muted-foreground",children:(h=s.actor_profile)==null?void 0:h.email})]})}),l.jsxs(hn,{children:[l.jsx("div",{className:"text-sm",children:Rde(new Date(s.created_at),{addSuffix:!0})}),l.jsx("div",{className:"text-xs text-muted-foreground",children:new Date(s.created_at).toLocaleString()})]}),l.jsxs(hn,{children:[l.jsx("div",{className:"text-sm",children:s.action}),((f=s.metadata)==null?void 0:f.old_role)&&l.jsxs("div",{className:"text-xs text-muted-foreground",children:[s.metadata.old_role," â ",s.metadata.new_role]})]})]},s.id)})})]})})})]})}function obe(){const[t,e]=b.useState([]),[n,r]=b.useState(!0),[i,a]=b.useState({total:0,failed:0,succeeded:0,blocked:0});b.useEffect(()=>{s();const c=me.channel("password_attempts").on("postgres_changes",{event:"INSERT",schema:"public",table:"password_verification_attempts"},u=>{e(d=>[u.new,...d]),o()}).subscribe();return()=>{c.unsubscribe()}},[]);const s=async()=>{try{const{data:c,error:u}=await me.from("password_verification_attempts").select("*").order("attempt_time",{ascending:!1}).limit(100);if(u)throw u;e(c||[]),o()}catch(c){console.error("Error fetching password attempts:",c)}finally{r(!1)}},o=async()=>{try{const{count:c}=await me.from("password_verification_attempts").select("*",{count:"exact",head:!0}),{count:u}=await me.from("password_verification_attempts").select("*",{count:"exact",head:!0}).eq("success",!1),{count:d}=await me.from("password_verification_attempts").select("*",{count:"exact",head:!0}).eq("success",!0),{data:h}=await me.from("password_verification_attempts").select("access_code, ip_address").eq("success",!1).gte("attempt_time",new Date(Date.now()-15*60*1e3).toISOString()),f=(h==null?void 0:h.length)||0;a({total:c||0,failed:u||0,succeeded:d||0,blocked:Math.floor(f/5)})}catch(c){console.error("Error updating stats:",c)}};return n?l.jsx(rt,{children:l.jsxs(ht,{children:[l.jsx(mt,{children:"Password Verification Attempts"}),l.jsx(tn,{children:"Loading attempt history..."})]})}):l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"grid gap-4 md:grid-cols-4",children:[l.jsxs(rt,{children:[l.jsxs(ht,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[l.jsx(mt,{className:"text-sm font-medium",children:"Total Attempts"}),l.jsx(Dx,{className:"h-4 w-4 text-muted-foreground"})]}),l.jsx(ot,{children:l.jsx("div",{className:"text-2xl font-bold",children:i.total})})]}),l.jsxs(rt,{children:[l.jsxs(ht,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[l.jsx(mt,{className:"text-sm font-medium",children:"Successful"}),l.jsx(EO,{className:"h-4 w-4 text-green-500"})]}),l.jsx(ot,{children:l.jsx("div",{className:"text-2xl font-bold text-green-600",children:i.succeeded})})]}),l.jsxs(rt,{children:[l.jsxs(ht,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[l.jsx(mt,{className:"text-sm font-medium",children:"Failed"}),l.jsx(bc,{className:"h-4 w-4 text-orange-500"})]}),l.jsx(ot,{children:l.jsx("div",{className:"text-2xl font-bold text-orange-600",children:i.failed})})]}),l.jsxs(rt,{children:[l.jsxs(ht,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[l.jsx(mt,{className:"text-sm font-medium",children:"Rate Limited"}),l.jsx(wm,{className:"h-4 w-4 text-red-500"})]}),l.jsx(ot,{children:l.jsxs("div",{className:"text-2xl font-bold text-red-600",children:["~",i.blocked]})})]})]}),l.jsxs(rt,{children:[l.jsxs(ht,{children:[l.jsx(mt,{children:"Recent Password Verification Attempts"}),l.jsx(tn,{children:"Monitor password verification activity and detect potential brute-force attacks"})]}),l.jsx(ot,{children:t.length===0?l.jsx(Sc,{children:l.jsx(no,{children:"No password verification attempts recorded yet."})}):l.jsx("div",{className:"rounded-md border",children:l.jsxs(Ym,{children:[l.jsx(Jm,{children:l.jsxs(ro,{children:[l.jsx(dn,{children:"Time"}),l.jsx(dn,{children:"Access Code"}),l.jsx(dn,{children:"IP Address"}),l.jsx(dn,{children:"Result"})]})}),l.jsx(Xm,{children:t.map(c=>l.jsxs(ro,{children:[l.jsx(hn,{className:"font-mono text-xs",children:$e(new Date(c.attempt_time),"MMM dd, HH:mm:ss")}),l.jsxs(hn,{className:"font-mono text-xs",children:[c.access_code.substring(0,20),"..."]}),l.jsx(hn,{className:"font-mono text-xs",children:c.ip_address||"Unknown"}),l.jsx(hn,{children:c.success?l.jsxs(Rn,{variant:"default",className:"bg-green-500",children:[l.jsx(EO,{className:"w-3 h-3 mr-1"}),"Success"]}):l.jsxs(Rn,{variant:"destructive",children:[l.jsx(bc,{className:"w-3 h-3 mr-1"}),"Failed"]})})]},c.id))})]})})})]})]})}
881function cbe(){const{user:t,refreshing:e}=sa(),{isAdmin:n,loading:r}=$j(),i=rr(),[a,s]=b.useState([]),[o,c]=b.useState([]),[u,d]=b.useState([]),[h,f]=b.useState({totalUsers:0,totalCalendars:0,totalEvents:0,recentSignups:0}),[p,g]=b.useState(!0),[m,v]=b.useState(!1),[x,w]=b.useState(null),[y,k]=b.useState("");b.useEffect(()=>{!r&&!n&&i("/dashboard")},[n,r,i]),b.useEffect(()=>{n&&S()},[n]);const S=async()=>{g(!0),await Promise.all([_(),C(),E(),T()]),g(!1)},_=async()=>{const{data:N,error:B}=await me.from("profiles").select("id, email, full_name, created_at, user_status, suspended_at, suspension_reason").order("created_at",{ascending:!1});if(B){console.error("Error fetching users:",B);return}const{data:$,error:I}=await me.from("user_roles").select("user_id, role");if(I){console.error("Error fetching roles:",I);return}const R=(N==null?void 0:N.map(z=>({...z,roles:($==null?void 0:$.filter(O=>O.user_id===z.id).map(O=>O.role))||["user"]})))||[];s(R)},C=async()=>{try{const{data:N,error:B}=await me.rpc("get_admin_analytics");if(B){console.error("Error fetching admin analytics:",B);return}const $=N;f({totalUsers:($==null?void 0:$.total_users)||0,totalCalendars:($==null?void 0:$.total_calendars)||0,totalEvents:($==null?void 0:$.total_events)||0,recentSignups:($==null?void 0:$.recent_signups)||0})}catch(N){console.error("Error fetching admin analytics:",N)}},T=async()=>{try{const{data:N,error:B}=await me.from("api_rate_limits").select(` 882 user_id, 883 endpoint, 884 request_count, 885 window_start, 886 updated_at 887 `).order("updated_at",{ascending:!1});if(B)throw B;const{data:$,error:I}=await me.from("profiles").select("id, email, full_name");if(I)throw I;const R=.001,z=10,O=60,A=new Map;N==null||N.forEach(V=>{const Y=A.get(V.user_id)||{parse_event:0,generate_templates:0,last_request:null,recent_requests:0};V.endpoint==="parse-event"?Y.parse_event+=V.request_count:V.endpoint==="generate-templates"&&(Y.generate_templates+=V.request_count);const Q=new Date(V.window_start);(new Date().getTime()-Q.getTime())/(1e3*60)<O&&(Y.recent_requests+=V.request_count),(!Y.last_request||new Date(V.updated_at)>new Date(Y.last_request))&&(Y.last_request=V.updated_at),A.set(V.user_id,Y)});const L=Array.from(A.entries()).map(([V,Y])=>{const Q=$==null?void 0:$.find(J=>J.id===V),re=Y.parse_event+Y.generate_templates;return{user_id:V,user_email:(Q==null?void 0:Q.email)||"Unknown",user_name:(Q==null?void 0:Q.full_name)||null,parse_event_count:Y.parse_event,generate_templates_count:Y.generate_templates,total_requests:re,last_request:Y.last_request,estimated_cost:re*R,is_rate_limited:Y.recent_requests>=z}});L.sort((V,Y)=>Y.total_requests-V.total_requests),d(L)}catch(N){console.error("Error fetching API usage:",N)}},E=async()=>{const{data:N,error:B}=await me.from("audit_logs").select("*").order("created_at",{ascending:!1}).limit(100);if(B){console.error("Error fetching audit logs:",B);return}const $=new Set;N==null||N.forEach(O=>{$.add(O.actor_id),O.target_user_id&&$.add(O.target_user_id)});const{data:I}=await me.from("profiles").select("id, email").in("id",Array.from($)),R=new Map((I==null?void 0:I.map(O=>[O.id,O.email]))||[]),z=(N==null?void 0:N.map(O=>({...O,metadata:O.metadata,actor_email:R.get(O.actor_id),target_email:O.target_user_id?R.get(O.target_user_id):null})))||[];c(z)},j=async(N,B)=>{await me.from("user_roles").delete().eq("user_id",N);const{error:$}=await me.from("user_roles").insert({user_id:N,role:B});$?console.error("Error assigning role:",$):(_(),E())},P=async(N,B,$)=>{try{const{error:I}=await me.from("profiles").update({user_status:B,suspended_at:B!=="active"?new Date().toISOString():null,suspended_by:B!=="active"?t==null?void 0:t.id:null,suspension_reason:$||null}).eq("id",N);if(I)throw I;_(),E()}catch(I){console.error("Error updating user status:",I)}},M=N=>{w(N),k(""),v(!0)},U=async()=>{x&&(await P(x.id,"suspended",y),v(!1),w(null),k(""))};return r||p?l.jsx("div",{className:"min-h-screen flex items-center justify-center",children:l.jsxs("div",{className:"text-center",children:[l.jsx($p,{className:"w-8 h-8 animate-spin mx-auto mb-4 text-primary"}),l.jsx("p",{className:"text-muted-foreground",children:"Loading admin dashboard..."})]})}):n?l.jsxs("div",{className:"min-h-screen bg-background",children:[l.jsx("header",{className:"border-b bg-card",children:l.jsx("div",{className:"container mx-auto px-4 py-4",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs(de,{variant:"ghost",onClick:()=>i("/dashboard"),size:"sm",children:[l.jsx(ci,{className:"w-4 h-4 mr-2"}),"Back to Dashboard"]}),l.jsxs("div",{children:[l.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[l.jsx(wm,{className:"w-6 h-6 text-primary"}),"Admin Dashboard"]}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"System management and analytics"})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[e&&l.jsx(dh,{className:"h-4 w-4 text-muted-foreground animate-spin"}),l.jsx(rbe,{}),l.jsx(de,{onClick:()=>i("/admin/settings"),variant:"outline",children:"Settings"})]})]})})}),l.jsxs("div",{className:"container mx-auto px-4 py-8",children:[l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5 ga
887p-4 mb-8",children:[l.jsxs(rt,{children:[l.jsx(ht,{className:"pb-3",children:l.jsxs(mt,{className:"text-sm font-medium flex items-center gap-2",children:[l.jsx(Ql,{className:"w-4 h-4 text-calendar-blue"}),"Total Users"]})}),l.jsxs(ot,{children:[l.jsx("div",{className:"text-2xl font-bold",children:h.totalUsers}),l.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["+",h.recentSignups," last 7 days"]})]})]}),l.jsxs(rt,{children:[l.jsx(ht,{className:"pb-3",children:l.jsxs(mt,{className:"text-sm font-medium flex items-center gap-2",children:[l.jsx(yc,{className:"w-4 h-4 text-calendar-coral"}),"Calendars"]})}),l.jsxs(ot,{children:[l.jsx("div",{className:"text-2xl font-bold",children:h.totalCalendars}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Created by users"})]})]}),l.jsxs(rt,{children:[l.jsx(ht,{className:"pb-3",children:l.jsxs(mt,{className:"text-sm font-medium flex items-center gap-2",children:[l.jsx($p,{className:"w-4 h-4 text-calendar-peach"}),"Events"]})}),l.jsxs(ot,{children:[l.jsx("div",{className:"text-2xl font-bold",children:h.totalEvents}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Across all calendars"})]})]}),l.jsxs(rt,{children:[l.jsx(ht,{className:"pb-3",children:l.jsxs(mt,{className:"text-sm font-medium flex items-center gap-2",children:[l.jsx(x$,{className:"w-4 h-4 text-primary"}),"Growth Rate"]})}),l.jsxs(ot,{children:[l.jsxs("div",{className:"text-2xl font-bold",children:[h.totalUsers>0?Math.round(h.recentSignups/h.totalUsers*100):0,"%"]}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Weekly growth"})]})]})]}),l.jsxs(IB,{defaultValue:"users",className:"space-y-6",children:[l.jsxs(Ij,{className:"grid w-full max-w-4xl grid-cols-5",children:[l.jsxs(qo,{value:"users",className:"flex items-center gap-2",children:[l.jsx(Ql,{className:"w-4 h-4"}),"Users"]}),l.jsxs(qo,{value:"security",className:"flex items-center gap-2",children:[l.jsx(wm,{className:"w-4 h-4"}),"Security"]}),l.jsxs(qo,{value:"api-usage",className:"flex items-center gap-2",children:[l.jsx(OO,{className:"w-4 h-4"}),"API Usage"]}),l.jsxs(qo,{value:"analytics",className:"flex items-center gap-2",children:[l.jsx(h$,{className:"w-4 h-4"}),"Analytics"]}),l.jsxs(qo,{value:"audit",className:"flex items-center gap-2",children:[l.jsx($p,{className:"w-4 h-4"}),"Audit Logs"]})]}),l.jsx(Ko,{value:"users",className:"space-y-4",children:l.jsxs(rt,{children:[l.jsxs(ht,{children:[l.jsx(mt,{children:"User Management"}),l.jsx(tn,{children:"View users and manage their roles"})]}),l.jsx(ot,{children:l.jsxs(Ym,{children:[l.jsx(Jm,{children:l.jsxs(ro,{children:[l.jsx(dn,{children:"User"}),l.jsx(dn,{children:"Email"}),l.jsx(dn,{children:"Joined"}),l.jsx(dn,{children:"Status"}),l.jsx(dn,{children:"Current Role"}),l.jsx(dn,{children:"Assign Role"}),l.jsx(dn,{children:"Actions"})]})}),l.jsx(Xm,{children:a.map(N=>l.jsxs(ro,{children:[l.jsx(hn,{className:"font-medium",children:N.full_name||"No name"}),l.jsx(hn,{className:"text-sm text-muted-foreground",children:N.email}),l.jsx(hn,{className:"text-sm",children:new Date(N.created_at).toLocaleDateString()}),l.jsxs(hn,{children:[l.jsx(Rn,{variant:N.user_status==="active"?"default":N.user_status==="suspended"?"secondary":"destructive",children:N.user_status}),N.suspension_reason&&l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:N.suspension_reason})]}),l.jsx(hn,{children:l.jsx("div",{className:"flex gap-1",children:N.roles.length>0?N.roles.map(B=>l.jsx(Rn,{variant:B==="admin"?"default":"secondary",children:B},B)):l.jsx(Rn,{variant:"outline",children:"user"})})}),l.jsx(hn,{children:N.id!==(t==null?void 0:t.id)&&l.jsxs(bh,{onValueChange:B=>j(N.id,B),children:[l.jsx(au,{className:"w-32",children:l.jsx(xh,{placeholder:"Assign role"})}),l.jsxs(su,{children:[l.jsx(Bt,{value:"user",children:"User"}),l.jsx(Bt,{value:"moderator",children:"Moderator"}),l.jsx(Bt,{value:"admin",children:"Admin"})]})]})}),l.jsx(hn,{children:N.id!==(t==null?void 0:t.id)&&l.jsx("div",{className:"flex gap-2",children:N.user_status==="active"?l.jsxs(l.Fragment,{children:[l.jsxs(de,{size:"sm",variant:"outline",onClick:()=>M(N),children:[l.jsx(NO,{className:"w-4 h-4 mr-1"}),"Suspend"]}),l.jsxs(de,{size:"sm",variant:"destructive",onClick:()=>P(N.id,"banned","Banned by admin"),children:[l.jsx(CO,{className:"w-4 h-4 mr-1"}),"Ban"]})]}):l.jsx(de,{size:"sm",variant:"default",onClick:()=>P(N.id,"active"),children:"Reactivate"})})})]},N.id))})]})})]})}),l.jsx(Ko,{value:"security",className:"space-y-4",children:l.jsx(obe,{})}),l.jsxs(Ko,{value:"api-usage",className:"space-y-4",children:[l.jsxs("div",{className:"grid gap-4 md:grid-cols-4 mb-6",children:[l.jsxs(rt,{children:[l.jsx(ht,{className:"pb-3",children:l.jsx(mt,{className:"text-sm font-medium",children:"Total API Calls"})}),l.jsxs(ot,{children:[l.jsx("div",{className:"text-2xl font-bold",children:u.reduce((N,B)=>N+B.total_requests,0)}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Across all users"})]})]}),l.jsxs(rt,{children:[l.jsx(ht,{className:"pb-3",children:l.jsx(mt,{className:"text-sm font-medium",children:"Active Users"})}),l.jsxs(ot,{children:[l.jsx("div",{className:"text-2xl font-bold",children:u.length}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Made API requests"})]})]}),l.jsxs(rt,{children:[l.jsx(ht,{className:"pb-3",children:l.jsx(mt,{className:"text-sm font-medium",children:"Rate Limited"})}),l.jsxs(ot,{children:[l.jsx("div",{className:"text-2xl font-bold text-destructive",children:u.filter(N=>N.is_rate_limited).length}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Currently blocked"})]})]}),l.jsxs(rt,{children:[l.jsx(ht,{className:"pb-3",children:l.jsx(mt,{className:"text-sm font-medium",children:"Est. Total Cost"})}),l.jsxs(ot,{children:[l.jsxs("div",{className:"text-2xl font-bold",children:["$",u.reduce((N,B)=>N+B.estimated_cost,0).toFixed(2)]}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"All-time"})]})]})]}),l.jsxs(rt,{children:[l.jsxs(ht,{children:[l.jsx(mt,{children:"API Usage by User"}),l.jsx(tn,{children:"Detailed breakdown of API calls, rate limits, and estimated costs"})]}),l.jsx(ot,{children:u.length===0?l.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No API usage yet"}):l.jsx(pb,{className:"h-[600px]",children:l.jsxs(Ym,{children:[l.jsx(Jm,{children:l.jsxs(ro,{children:[l.jsx(dn,{children:"User"}),l.jsx(dn,{className:"text-center",children:"Parse Event"}),l.jsx(dn,{className:"text-center",children:"Generate Templates"}),l.jsx(dn,{className:"text-center",children:"Total Requests"}),l.jsx(dn,{className:"text-center",children:"Est. Cost"}),l.jsx(dn,{className:"text-center",children:"Status"}),l.jsx(dn,{children:"Last Request"})]})}),l.jsx(Xm,{children:u.map(N=>l.jsxs(ro,{children:[l.jsx(hn,{children:l.jsxs("div",{children:[l.jsx("div",{className:"font-medium",children:N.user_name||"No name"}),l.jsx("div",{className:"text-sm text-muted-foreground",children:N.user_email})]})}),l.jsx(hn,{className:"text-center",children:l.jsx(Rn,{variant:"outline",children:N.parse_event_count})}),l.jsx(hn,{className:"text-center",children:l.jsx(Rn,{variant:"outline",children:N.generate_templates_count})}),l.jsx(hn,{className:"text-center",children:l.jsx("div",{className:"font-semibold",children:N.total_requests})}),l.jsx(hn,{className:"text-center",children:l.jsxs("div",{className:"font-mono text-sm",children:["$",N.estimated_cost.toFixed(3)]})}),l.jsx(hn,{className:"text-center",children:N.is_rate_limited?l.jsxs(Rn,{variant:"destructive",className:"flex items-center gap-1 w-fit mx-auto",children:[l.jsx(CO,{className:"w-3 h-3"}),"Rate Limited"]}):l.jsxs(Rn,{variant:"default",className:"bg-green-500 flex items-center gap-1 w-fit mx-auto",children:[l.jsx(OO,{className:"w-3 h-3"}),"Active"]})}),l.jsx(hn,{children:l.jsx("div",{className:"text-sm",children:N.last_request?new Date(N.last_request).toLocaleStr
887ing():"Never"})})]},N.user_id))})]})})})]})]}),l.jsx(Ko,{value:"analytics",className:"space-y-4",children:l.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[l.jsxs(rt,{children:[l.jsxs(ht,{children:[l.jsx(mt,{children:"System Health"}),l.jsx(tn,{children:"Overview of system status"})]}),l.jsxs(ot,{className:"space-y-4",children:[l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("span",{className:"text-sm text-muted-foreground",children:"Database Status"}),l.jsx(Rn,{variant:"default",className:"bg-green-500",children:"Healthy"})]}),l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("span",{className:"text-sm text-muted-foreground",children:"API Status"}),l.jsx(Rn,{variant:"default",className:"bg-green-500",children:"Operational"})]}),l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("span",{className:"text-sm text-muted-foreground",children:"Authentication"}),l.jsx(Rn,{variant:"default",className:"bg-green-500",children:"Active"})]})]})]}),l.jsxs(rt,{children:[l.jsxs(ht,{children:[l.jsx(mt,{children:"User Engagement"}),l.jsx(tn,{children:"Activity metrics"})]}),l.jsxs(ot,{className:"space-y-4",children:[l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("span",{className:"text-sm text-muted-foreground",children:"Avg Calendars/User"}),l.jsx("span",{className:"font-semibold",children:h.totalUsers>0?(h.totalCalendars/h.totalUsers).toFixed(1):"0"})]}),l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("span",{className:"text-sm text-muted-foreground",children:"Avg Events/Calendar"}),l.jsx("span",{className:"font-semibold",children:h.totalCalendars>0?(h.totalEvents/h.totalCalendars).toFixed(1):"0"})]})]})]})]})}),l.jsxs(Ko,{value:"audit",className:"space-y-4",children:[l.jsx(sbe,{}),l.jsxs(rt,{children:[l.jsxs(ht,{children:[l.jsx(mt,{children:"Audit Logs"}),l.jsx(tn,{children:"Track all administrative actions and system changes"})]}),l.jsx(ot,{children:o.length===0?l.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No audit logs yet"}):l.jsx(pb,{className:"h-[600px] pr-4",children:l.jsx("div",{className:"space-y-3",children:o.map(N=>l.jsx(rt,{className:"border-l-4",style:{borderLeftColor:N.action_type==="user_ban"?"hsl(var(--destructive))":N.action_type==="user_suspension"?"hsl(var(--warning))":N.action_type==="user_reactivation"?"hsl(var(--success))":N.action_type==="role_change"?"hsl(var(--primary))":"hsl(var(--muted))"},children:l.jsx(ot,{className:"pt-4",children:l.jsx("div",{className:"flex justify-between items-start mb-2",children:l.jsxs("div",{className:"flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx(Rn,{variant:N.action_type==="user_ban"?"destructive":N.action_type==="user_suspension"?"secondary":N.action_type==="user_reactivation"?"default":"outline",children:N.action_type.replace("_"," ")}),l.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(N.created_at).toLocaleString()})]}),l.jsx("p",{className:"font-medium mb-2",children:N.action}),l.jsxs("div",{className:"text-sm text-muted-foreground space-y-1",children:[l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"font-semibold",children:"Admin:"}),l.jsx("span",{children:N.actor_email})]}),N.target_email&&l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"font-semibold",children:"Target:"}),l.jsx("span",{children:N.target_email})]}),N.metadata&&Object.keys(N.metadata).length>0&&l.jsxs("div",{className:"mt-2 p-2 bg-muted rounded text-xs",children:[l.jsx("span",{className:"font-semibold",children:"Details: "}),N.metadata.reason&&l.jsxs("div",{children:["Reason: ",N.metadata.reason]}),N.metadata.old_role&&N.metadata.new_role&&l.jsxs("div",{children:["Changed from ",N.metadata.old_role," to ",N.metadata.new_role]}),N.metadata.role&&!N.metadata.old_role&&l.jsxs("div",{children:["Role: ",N.metadata.role]})]})]})]})})})},N.id))})})})]})]})]})]}),l.jsx(Za,{open:m,onOpenChange:v,children:l.jsxs(Ts,{children:[l.jsxs(na,{children:[l.jsx(ra,{children:"Suspend User"}),l.jsxs(Es,{children:["Suspending ",(x==null?void 0:x.full_name)||(x==null?void 0:x.email)," will immediately block their access to the system."]})]}),l.jsx("div",{className:"space-y-4 py-4",children:l.jsxs("div",{className:"space-y-2",children:[l.jsx(yt,{htmlFor:"suspension-reason",children:"Reason for Suspension"}),l.jsx(cu,{id:"suspension-reason",placeholder:"Enter the reason for suspending this user...",value:y,onChange:N=>k(N.target.value),rows:4}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"This reason will be visible to the user when they try to access the system."})]})}),l.jsxs(Zx,{children:[l.jsx(de,{variant:"outline",onClick:()=>{v(!1),w(null),k("")},children:"Cancel"}),l.jsxs(de,{variant:"destructive",onClick:U,disabled:!y.trim(),children:[l.jsx(NO,{className:"w-4 h-4 mr-2"}),"Suspend User"]})]})]})})]}):null}function lbe(){const t=rr(),{user:e}=sa(),{isAdmin:n,loading:r}=$j(),[i,a]=b.useState(!0),[s,o]=b.useState(!1),[c,u]=b.useState(!1),[d,h]=b.useState(""),[f,p]=b.useState(!0),[g,m]=b.useState({ai_event_parsing:!0,calendar_sharing:!0,demo_mode:!0});b.useEffect(()=>{!r&&!n&&t("/")},[n,r,t]),b.useEffect(()=>{e&&n&&v()},[e,n]);const v=async()=>{try{const{data:y,error:k}=await me.from("app_settings").select("*");if(k)throw k;
887y==null||y.forEach(S=>{const _=S.setting_value;switch(S.setting_key){case"maintenance_mode":u(_.enabled||!1),h(_.message||"");break;case"registration_enabled":p(_.enabled||!1);break;case"feature_flags":m({ai_event_parsing:_.ai_event_parsing??!0,calendar_sharing:_.calendar_sharing??!0,demo_mode:_.demo_mode??!0});break}})}catch(y){console.error("Failed to load settings:",y)}finally{a(!1)}},x=async(y,k)=>{try{const{error:S}=await me.from("app_settings").update({setting_value:k,updated_by:e==null?void 0:e.id}).eq("setting_key",y);if(S)throw S}catch(S){throw S}},w=async()=>{o(!0);try{await Promise.all([x("maintenance_mode",{enabled:c,message:d}),x("registration_enabled",{enabled:f}),x("feature_flags",g)]),await me.rpc("log_audit_event",{_action:"Updated application settings",_action_type:"settings_change",_actor_id:e==null?void 0:e.id,_metadata:{maintenance_mode:c,registration_enabled:f,feature_flags:g}})}catch(y){console.error("Failed to save settings:",y)}finally{o(!1)}};return r||i?l.jsx("div",{className:"flex items-center justify-center min-h-screen",children:l.jsx("div",{className:"text-lg",children:"Loading..."})}):n?l.jsx("div",{className:"min-h-screen bg-background p-6",children:l.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx(de,{variant:"ghost",size:"icon",onClick:()=>t("/admin"),children:l.jsx(ci,{className:"h-5 w-5"})}),l.jsxs("div",{children:[l.jsx("h1",{className:"text-3xl font-bold",children:"Admin Settings"}),l.jsx("p",{className:"text-muted-foreground",children:"Configure app-wide settings and feature flags"})]})]}),l.jsxs(de,{onClick:w,disabled:s,children:[l.jsx(xZ,{className:"h-4 w-4 mr-2"}),s?"Saving...":"Save Changes"]})]}),l.jsxs(rt,{children:[l.jsxs(ht,{children:[l.jsxs(mt,{className:"flex items-center gap-2",children:[l.jsx(bc,{className:"h-5 w-5 text-destructive"}),"Maintenance Mode"]}),l.jsx(tn,{children:"Enable maintenance mode to display a message to users and prevent access"})]}),l.jsxs(ot,{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(yt,{htmlFor:"maintenance-mode",children:"Enable Maintenance Mode"}),l.jsx(yl,{id:"maintenance-mode",checked:c,onCheckedChange:u})]}),c&&l.jsxs("div",{className:"space-y-2",children:[l.jsx(yt,{htmlFor:"maintenance-message",children:"Maintenance Message"}),l.jsx(cu,{id:"maintenance-message",value:d,onChange:y=>h(y.target.value),placeholder:"Enter the message users will see...",rows:3})]})]})]}),l.jsxs(rt,{children:[l.jsxs(ht,{children:[l.jsx(mt,{children:"User Registration"}),l.jsx(tn,{children:"Control whether new users can sign up for accounts"})]}),l.jsx(ot,{children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(yt,{htmlFor:"registration",children:"Allow New Registrations"}),l.jsx(yl,{id:"registration",checked:f,onCheckedChange:p})]})})]}),l.jsxs(rt,{children:[l.jsxs(ht,{children:[l.jsx(mt,{children:"Feature Flags"}),l.jsx(tn,{children:"Enable or disable specific features across the application"})]}),l.jsxs(ot,{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx(yt,{htmlFor:"ai-parsing",children:"AI Event Parsing"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Allow users to create events using natural language"})]}),l.jsx(yl,{id:"ai-parsing",checked:g.ai_event_parsing,onCheckedChange:y=>m({...g,ai_event_parsing:y})})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx(yt,{htmlFor:"calendar-sharing",children:"Calendar Sharing"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Allow users to generate sharing links for calendars"})]}),l.jsx(yl,{id:"calendar-sharing",checked:g.calendar_sharing,onCheckedChange:y=>m({...g,calendar_sharing:y})})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx(yt,{htmlFor:"demo-mode",children:"Demo Mode"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Enable demo calendar and sample data features"})]}),l.jsx(yl,{id:"demo-mode",checked:g.demo_mode,onCheckedChange:y=>m({...g,demo_mode:y})})]})]})]})]})}):null}const ube=tw({newPassword:Ka().min(8,"Password must be at least 8 characters"),confirmPassword:Ka()}).refine(t=>t.newPassword===t.confirmPassword,{message:"Passwords don't match",path:["confirmPassword"]});function dbe(){const{user:t,signOut:e,updatePassword:n}=sa(),r=rr(),[i,a]=b.useState(""),[s,o]=b.useState(!1),[c,u]=b.useState(!1),[d,h]=b.useState(!1),[f,p]=b.useState(""),[g,m]=b.useState(""),[v,x]=b.useState(!1),[w,y]=b.useState(!1),[k,S]=b.useState(!1),[_,C]=b.useState(""),T=async P=>{P.preventDefault(),C("");const M=ube.safeParse({newPassword:f,confirmPassword:g});if(!M.success){C(M.error.errors[0].message);return}S(!0);try{const{error:U}=await n(f);
887if(U)throw U;Ea({title:"Password updated",description:"Your password has been changed successfully."}),p(""),m("")}catch(U){console.error("Error changing password:",U),Ea({title:"Error",description:U.message||"Failed to change password. Please try again.",variant:"destructive"})}finally{S(!1)}},E=async()=>{u(!0);try{const{data:P,error:M}=await me.rpc("export_user_data");if(M)throw M;const U=JSON.stringify(P,null,2),N=new Blob([U],{type:"application/json"}),B=URL.createObjectURL(N),$=document.createElement("a");$.href=B,$.download=`careable-data-export-${new Date().toISOString().split("T")[0]}.json`,document.body.appendChild($),$.click(),document.body.removeChild($),URL.revokeObjectURL(B),Ea({title:"Data exported",description:"Your personal data has been downloaded as a JSON file."})}catch(P){console.error("Error exporting data:",P),Ea({title:"Export failed",description:P.message||"Failed to export data. Please try again.",variant:"destructive"})}finally{u(!1)}},j=async()=>{if(i!=="DELETE"){Ea({title:"Confirmation required",description:"Please type DELETE to confirm account deletion.",variant:"destructive"});return}o(!0);try{const{error:P}=await me.rpc("delete_user_account");if(P)throw P;Ea({title:"Account deleted",description:"Your account and all associated data have been permanently deleted."}),await e(),r("/")}catch(P){console.error("Error deleting account:",P),Ea({title:"Error",description:P.message||"Failed to delete account. Please try again.",variant:"destructive"})}finally{o(!1),h(!1),a("")}};return t?l.jsx("div",{className:"min-h-screen bg-background",children:l.jsxs("div",{className:"container max-w-2xl mx-auto px-4 py-8",children:[l.jsxs(de,{variant:"ghost",onClick:()=>r("/dashboard"),className:"mb-6",children:[l.jsx(ci,{className:"w-4 h-4 mr-2"}),"Back to Dashboard"]}),l.jsx("h1",{className:"text-3xl font-bold mb-8",children:"Account Settings"}),l.jsxs(rt,{className:"mb-6",children:[l.jsxs(ht,{children:[l.jsx(mt,{children:"Account Information"}),l.jsx(tn,{children:"Your account details"})]}),l.jsxs(ot,{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx(yt,{className:"text-muted-foreground",children:"Email"}),l.jsx("p",{className:"text-foreground",children:t.email})]}),l.jsxs("div",{children:[l.jsx(yt,{className:"text-muted-foreground",children:"Account created"}),l.jsx("p",{className:"text-foreground",children:new Date(t.created_at).toLocaleDateString()})]})]})]}),l.jsxs(rt,{className:"mb-6",children:[l.jsxs(ht,{children:[l.jsxs(mt,{className:"flex items-center gap-2",children:[l.jsx(E0,{className:"w-5 h-5"}),"Change Password"]}),l.jsx(tn,{children:"Update your account password"})]}),l.jsx(ot,{children:l.jsxs("form",{onSubmit:T,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(yt,{htmlFor:"new-password",children:"New Password"}),l.jsxs("div",{className:"relative",children:[l.jsx(qt,{id:"new-password",type:v?"text":"password",value:f,onChange:P=>p(P.target.value),placeholder:"Enter new password",className:"pr-10"}),l.jsx("button",{type:"button",onClick:()=>x(!v),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:v?l.jsx(uh,{className:"w-4 h-4"}):l.jsx(go,{className:"w-4 h-4"})})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(yt,{htmlFor:"confirm-password",children:"Confirm New Password"}),l.jsxs("div",{className:"relative",children:[l.jsx(qt,{id:"confirm-password",type:w?"text":"password",value:g,onChange:P=>m(P.target.value),placeholder:"Confirm new password",className:"pr-10"}),l.jsx("button",{type:"button",onClick:()=>y(!w),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:w?l.jsx(uh,{className:"w-4 h-4"}):l.jsx(go,{className:"w-4 h-4"})})]})]}),_&&l.jsx("p",{className:"text-sm text-destructive",children:_}),l.jsx(de,{type:"submit",disabled:k||!f||!g,className:"w-full sm:w-auto",children:k?l.jsxs(l.Fragment,{children:[l.jsx(Er,{className:"w-4 h-4 mr-2 animate-spin"}),"Updating..."]}):"Update Password"})]})})]}),l.jsxs(rt,{className:"mb-6",children:[l.jsxs(ht,{children:[l.jsxs(mt,{className:"flex items-center gap-2",children:[l.jsx(H_,{className:"w-5 h-5"}),"Data Export"]}),l.jsx(tn,{children:"Download a copy of all your personal data (GDPR Right to Data Portability)"})]}),l.jsxs(ot,{children:[l.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Export includes your profile information, calendars, events, calendar sharing links, medications, and medication logs in a machine-readable JSON format."}
887),l.jsx(de,{onClick:E,disabled:c,className:"w-full sm:w-auto",children:c?l.jsxs(l.Fragment,{children:[l.jsx(Er,{className:"w-4 h-4 mr-2 animate-spin"}),"Preparing Export..."]}):l.jsxs(l.Fragment,{children:[l.jsx(H_,{className:"w-4 h-4 mr-2"}),"Download My Data"]})})]})]}),l.jsxs(rt,{className:"border-muted",children:[l.jsxs(ht,{children:[l.jsx(mt,{className:"flex items-center gap-2",children:"Account Management"}),l.jsx(tn,{children:"Manage your account data and preferences"})]}),l.jsx(ot,{children:l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"font-semibold mb-2",children:"Delete Account"}),l.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Permanently delete your account and all associated data including:"}),l.jsxs("ul",{className:"text-sm text-muted-foreground list-disc pl-5 mb-4 space-y-1",children:[l.jsx("li",{children:"All your calendars and events"}),l.jsx("li",{children:"All shared calendar links"}),l.jsx("li",{children:"All medication records"}),l.jsx("li",{children:"Your profile information"})]}),l.jsx("p",{className:"text-sm text-destructive font-medium mb-4",children:"This action cannot be undone."})]}),l.jsxs(Fj,{open:d,onOpenChange:h,children:[l.jsx(lle,{asChild:!0,children:l.jsxs(de,{variant:"destructive",className:"w-full sm:w-auto",children:[l.jsx(q2,{className:"w-4 h-4 mr-2"}
vendor: 4,935 bytes, line 887
887),"Delete My Account"]})}),l.jsxs(nw,{children:[l.jsxs(rw,{children:[l.jsxs(aw,{className:"flex items-center gap-2 text-destructive",children:[l.jsx(bc,{className:"w-5 h-5"}),"Delete Account Permanently"]}),l.jsxs(sw,{className:"space-y-4",children:[l.jsx("p",{children:"This will permanently delete your account and all your data. This action is irreversible and complies with GDPR data deletion requirements."}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs(yt,{htmlFor:"confirm-delete",children:["Type ",l.jsx("span",{className:"font-bold text-foreground",children:"DELETE"})," to confirm:"]}),l.jsx(qt,{id:"confirm-delete",value:i,onChange:P=>a(P.target.value),placeholder:"Type DELETE",className:"font-mono"})]})]})]}),l.jsxs(iw,{children:[l.jsx(cw,{onClick:()=>a(""),children:"Cancel"}),l.jsx(ow,{onClick:j,disabled:i!=="DELETE"||s,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:s?"Deleting...":"Delete Account Forever"})]})]})]})]})})]})]})}):(r("/auth"),null)}var hbe=Array.isArray,di=hbe,fbe=typeof yv=="object"&&yv&&yv.Object===Object&&yv,IV=fbe,pbe=IV,mbe=typeof self=="object"&&self&&self.Object===Object&&self,gbe=pbe||mbe||Function("return this")(),Ds=gbe,vbe=Ds,ybe=vbe.Symbol,sv=ybe,oM=sv,LV=Object.prototype,bbe=LV.hasOwnProperty,xbe=LV.toString,sp=oM?oM.toStringTag:void 0;function wbe(t){var e=bbe.call(t,sp),n=t[sp];try{t[sp]=void 0;var r=!0}catch{}var i=xbe.call(t);return r&&(e?t[sp]=n:delete t[sp]),i}var Sbe=wbe,kbe=Object.prototype,_be=kbe.toString;function Cbe(t){return _be.call(t)}var Tbe=Cbe,cM=sv,Ebe=Sbe,jbe=Tbe,Pbe="[object Null]",Nbe="[object Undefined]",lM=cM?cM.toStringTag:void 0;function Abe(t){return t==null?t===void 0?Nbe:Pbe:lM&&lM in Object(t)?Ebe(t):jbe(t)}var Co=Abe;function Obe(t){return t!=null&&typeof t=="object"}var To=Obe,Rbe=Co,Dbe=To,Mbe="[object Symbol]";function Ibe(t){return typeof t=="symbol"||Dbe(t)&&Rbe(t)==Mbe}var _f=Ibe,Lbe=di,$be=_f,Fbe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Bbe=/^\w*$/;function Ube(t,e){if(Lbe(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||$be(t)?!0:Bbe.test(t)||!Fbe.test(t)||e!=null&&t in Object(e)}var tN=Ube;function zbe(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Yc=zbe;const Cf=Lt(Yc);var Wbe=Co,Vbe=Yc,Hbe="[object AsyncFunction]",qbe="[object Function]",Kbe="[object GeneratorFunction]",Gbe="[object Proxy]";function Ybe(t){if(!Vbe(t))return!1;var e=Wbe(t);return e==qbe||e==Kbe||e==Hbe||e==Gbe}var nN=Ybe;const it=Lt(nN);var Jbe=Ds,Xbe=Jbe["__core-js_shared__"],Zbe=Xbe,yk=Zbe,uM=function(){var t=/[^.]+$/.exec(yk&&yk.keys&&yk.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Qbe(t){return!!uM&&uM in t}var exe=Qbe,txe=Function.prototype,nxe=txe.toString;function rxe(t){if(t!=null){try{return nxe.call(t)}catch{}try{return t+""}catch{}}return""}var $V=rxe,ixe=nN,axe=exe,sxe=Yc,oxe=$V,cxe=/[\\^$.*+?()[\]{}|]/g,lxe=/^\[object .+?Constructor\]$/,uxe=Function.prototype,dxe=Object.prototype,hxe=uxe.toString,fxe=dxe.hasOwnProperty,pxe=RegExp("^"+hxe.call(fxe).replace(cxe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function mxe(t){if(!sxe(t)||axe(t))return!1;var e=ixe(t)?pxe:lxe;return e.test(oxe(t))}var gxe=mxe;function vxe(t,e){return t==null?void 0:t[e]}var yxe=vxe,bxe=gxe,xxe=yxe;function wxe(t,e){var n=xxe(t,e);return bxe(n)?n:void 0}var ku=wxe,Sxe=ku,kxe=Sxe(Object,"create"),Uw=kxe,dM=Uw;function _xe(){this.__data__=dM?dM(null):{},this.size=0}var Cxe=_xe;function Txe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Exe=Txe,jxe=Uw,Pxe="__lodash_hash_undefined__",Nxe=Object.prototype,Axe=Nxe.hasOwnProperty;function Oxe(t){var e=this.__data__;if(jxe){var n=e[t];return n===Pxe?void 0:n}return Axe.call(e,t)?e[t]:void 0}var Rxe=Oxe,Dxe=Uw,Mxe=Object.prototype,Ixe=Mxe.hasOwnProperty;function Lxe(t){var e=this.__data__;return Dxe?e[t]!==void 0:Ixe.call(e,t)}var $xe=Lxe,Fxe=Uw,Bxe="__lodash_hash_undefined__";function Uxe(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Fxe&&e===void 0?Bxe:e,this}var zxe=Uxe,Wxe=Cxe,Vxe=Exe,Hxe=Rxe,qxe=$xe,Kxe=zxe;function Tf(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Tf.prototype.clear=Wxe;Tf.prototype.delete=Vxe;Tf.prototype.get=Hxe;Tf.prototype.has=qxe;Tf.prototype.set=Kxe;var Gxe=Tf;function Yxe(){this.__data__=[],this.size=0}var Jxe=Yxe;function Xxe(t,e){return t===e||t!==t&&e!==e}var rN=Xxe,Zxe=rN;function Qxe(t,e){for(var n=t.length;n--;)if(Zxe(t[n][0],e))return n;return-1}var zw=Qxe,ewe=zw,twe=Array.prototype,nwe=twe.splice;function rwe(t){var e=this.__data__,n=ewe(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():nwe.call(e,n,1),--this.size,!0}var iwe=rwe,awe=zw;function swe(t){var e=this.__data__,n=awe(e,t);return n<0?void 0:e[n][1]}var owe=swe,cwe=zw;function lwe(t){return cwe(this.__data__,t)>-1}
887var uwe=lwe,dwe=zw;function hwe(t,e){var n=this.__data__,r=dwe(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var fwe=hwe,pwe=Jxe,mwe=iwe,gwe=owe,vwe=uwe,ywe=fwe;function Ef(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Ef.prototype.clear=pwe;Ef.prototype.delete=mwe;Ef.prototype.get=gwe;Ef.prototype.has=vwe;Ef.prototype.set=ywe;var Ww=Ef,bwe=ku,xwe=Ds,wwe=bwe(xwe,"Map"),iN=wwe,hM=Gxe,Swe=Ww,kwe=iN;function _we(){this.size=0,this.__data__={hash:new hM,map:new(kwe||Swe),string:new hM}}var Cwe=_we;function Twe(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var Ewe=Twe,jwe=Ewe;function Pwe(t,e){var n=t.__data__;return jwe(e)?n[typeof e=="string"?"string":"hash"]:n.map}var Vw=Pwe,Nwe=Vw;function Awe(t){var e=Nwe(this,t).delete(t);return this.size-=e?1:0,e}var Owe=Awe,Rwe=Vw;function Dwe(t){return Rwe(this,t).get(t)}var Mwe=Dwe,Iwe=Vw;function Lwe(t){return Iwe(this,t).has(t)}var $we=Lwe,Fwe=Vw;function Bwe(t,e){var n=Fwe(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var Uwe=Bwe,zwe=Cwe,Wwe=Owe,Vwe=Mwe,Hwe=$we,qwe=Uwe;function jf(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}jf.prototype.clear=zwe;jf.prototype.delete=Wwe;jf.prototype.get=Vwe;jf.prototype.has=Hwe;jf.prototype.set=qwe;var aN=jf,FV=aN,Kwe="Expected a function";function sN(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Kwe);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var s=t.apply(this,r);return n.cache=a.set(i,s)||a,s};return n.cache=new(sN.Cache||FV),n}sN.Cache=FV;var BV=sN;const Gwe=Lt(BV);var Ywe=BV,Jwe=500;function Xwe(t){var e=Ywe(t,function(r){return n.size===Jwe&&n.clear(),r}),n=e.cache;return e}var Zwe=Xwe,Qwe=Zwe,e1e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t1e=/\\(\\)?/g,n1e=Qwe(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(e1e,function(n,r,i,a){e.push(i?a.replace(t1e,"$1"):r||n)}),e}),r1e=n1e;function i1e(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var oN=i1e,fM=sv,a1e=oN,s1e=di,o1e=_f,c1e=1/0,pM=fM?fM.prototype:void 0,mM=pM?pM.toString:void 0;function UV(t){if(typeof t=="string")return t;if(s1e(t))return a1e(t,UV)+"";if(o1e(t))return mM?mM.call(t):"";var e=t+"";return e=="0"&&1/t==-c1e?"-0":e}var l1e=UV,u1e=l1e;function d1e(t){return t==null?"":u1e(t)}var zV=d1e,h1e=di,f1e=tN,p1e=r1e,m1e=zV;function g1e(t,e){return h1e(t)?t:f1e(t,e)?[t]:p1e(m1e(t))}var WV=g1e,v1e=_f,y1e=1/0;function b1e(t){if(typeof t=="string"||v1e(t))return t;var e=t+"";return e=="0"&&1/t==-y1e?"-0":e}var Hw=b1e,x1e=WV,w1e=Hw;function S1e(t,e){e=x1e(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[w1e(e[n++])];return n&&n==r?t:void 0}var cN=S1e,k1e=cN;function _1e(t,e,n){var r=t==null?void 0:k1e(t,e);return r===void 0?n:r}var VV=_1e;const Pi=Lt(VV);function C1e(t){return t==null}var T1e=C1e;const ut=Lt(T1e);var E1e=Co,j1e=di,P1e=To,N1e="[object String]";function A1e(t){return typeof t=="string"||!j1e(t)&&P1e(t)&&E1e(t)==N1e}var O1e=A1e;const hu=Lt(O1e);var HV={exports:{}},zt={};/** 888 * @license React 889 * react-is.production.min.js 890 * 891 * Copyright (c) Facebook, Inc. and its affiliates. 892 * 893 * This source code is licensed under the MIT license found in the 894 * LICENSE file in the root directory of this source tree. 895 */var lN=Symbol.for("react.element"),uN=Symbol.for("react.portal"),qw=Symbol.for("react.fragment"),Kw=Symbol.for("react.strict_mode"),Gw=Symbol.for("react.profiler"),Yw=Symbol.for("react.provider"),Jw=Symbol.for("react.context"),R1e=Symbol.for("react.server_context"),Xw=Symbol.for("react.forward_ref"),Zw=Symbol.for("react.suspense"),Qw=Symbol.for("react.suspense_list"),e1=Symbol.for("react.memo"),t1=Symbol.for("react.lazy"),D1e=Symbol.for("react.offscreen"),qV;qV=Symbol.for("react.module.reference");function da(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case lN:switch(t=t.type,t){case qw:case Gw:case Kw:case Zw:case Qw:return t;default:switch(t=t&&t.$$typeof,t){case R1e:case Jw:case Xw:case t1:case e1:case Yw:return t;default:return e}}case uN:return e}}}zt.ContextConsumer=Jw;zt.ContextProvider=Yw;zt.Element=lN;zt.ForwardRef=Xw;zt.Fragment=qw;zt.Lazy=t1;zt.Memo=e1;zt.Portal=uN;zt.Profiler=Gw;zt.StrictMode=Kw;zt.Suspense=Zw;zt.SuspenseList=Qw;zt.isAsyncMode=function(){return!1};zt.isConcurrentMode=function(){return!1};zt.isContextConsumer=function(t){return da(t)===Jw};zt.isContextProvider=function(t){return da(t)===Yw};zt.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===lN};zt.isForwardRef=function(t){return da(t)===Xw};zt.isFragment=function(t){return da(t)===qw};zt.isLazy=function(t){return da(t)===t1};zt.isMemo=function(t){return da(t)===e1};zt.isPortal=function(t){return da(t)===uN};zt.isProfiler=function(t){return da(t)===Gw};zt.isStrictMode=function(t){return da(t)===Kw};zt.isSuspense=function(t){return da(t)===Zw};zt.isSuspenseList=function(t){return da(t)===Qw};zt.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===qw||t===Gw||t===Kw||t===Zw||t===Qw||t===D1e||typeof t=="object"&&t!==null&&(t.$$typeof===t1||t.$$typeof===e1||t.$$typeof===Yw||t.$$typeof===Jw||t.$$typeof===Xw||t.$$typeof===qV||t.getModuleId!==void 0)};zt.typeOf=da;HV.exports=zt;var M1e=HV.exports,I1e=Co,L1e=To,$1e="[object Number]";function F1e(t){return typeof t=="number"||L1e(t)&&I1e(t)==$1e}var KV=F1e;const B1e=Lt(KV);var U1e=KV;function z1e(t){return U1e(t)&&t!=+t}var W1e=z1e;const ov=Lt(W1e);var zr=function(e){return e===0?0:e>0?1:-1},Nl=function(e){return hu(e)&&e.indexOf("%")===e.length-1},Ce=function(e){return B1e(e)&&!ov(e)}
vendor: 5,675 bytes, line 895
895,V1e=function(e){return ut(e)},nr=function(e){return Ce(e)||hu(e)},H1e=0,Pf=function(e){var n=++H1e;return"".concat(e||"").concat(n)},Wr=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ce(e)&&!hu(e))return r;var a;if(Nl(e)){var s=e.indexOf("%");a=n*parseFloat(e.slice(0,s))/100}else a=+e;return ov(a)&&(a=r),i&&a>n&&(a=n),a},Yo=function(e){if(!e)return null;var n=Object.keys(e);return n&&n.length?e[n[0]]:null},q1e=function(e){if(!Array.isArray(e))return!1;for(var n=e.length,r={},i=0;i<n;i++)if(!r[e[i]])r[e[i]]=!0;else return!0;return!1},wi=function(e,n){return Ce(e)&&Ce(n)?function(r){return e+r*(n-e)}:function(){return n}};function mb(t,e,n){return!t||!t.length?null:t.find(function(r){return r&&(typeof e=="function"?e(r):Pi(r,e))===n})}var K1e=function(e,n){return Ce(e)&&Ce(n)?e-n:hu(e)&&hu(n)?e.localeCompare(n):e instanceof Date&&n instanceof Date?e.getTime()-n.getTime():String(e).localeCompare(String(n))};function Wd(t,e){for(var n in t)if({}.hasOwnProperty.call(t,n)&&(!{}.hasOwnProperty.call(e,n)||t[n]!==e[n]))return!1;for(var r in e)if({}.hasOwnProperty.call(e,r)&&!{}.hasOwnProperty.call(t,r))return!1;return!0}function yT(t){"@babel/helpers - typeof";return yT=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yT(t)}var G1e=["viewBox","children"],Y1e=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],gM=["points","pathLength"],bk={svg:G1e,polygon:gM,polyline:gM},dN=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onF
895ocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],gb=function(e,n){if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(b.isValidElement(e)&&(r=e.props),!Cf(r))return null;var i={};return Object.keys(r).forEach(function(a){dN.includes(a)&&(i[a]=n||function(s){return r[a](r,s)})}),i},J1e=function(e,n,r){return function(i){return e(n,r,i),null}},fu=function(e,n,r){if(!Cf(e)||yT(e)!=="object")return null;var i=null;return Object.keys(e).forEach(function(a){var s=e[a];dN.includes(a)&&typeof s=="function"&&(i||(i={}),i[a]=J1e(s,n,r))}),i},X1e=["children"],Z1e=["children"];function vM(t,e){if(t==null)return{};var n=Q1e(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Q1e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function bT(t){"@babel/helpers - typeof";return bT=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bT(t)}var yM={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},co=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},bM=null,xk=null,hN=function t(e){if(e===bM&&Array.isArray(xk))return xk;var n=[];
vendor: 1,854 bytes, line 895
895return b.Children.forEach(e,function(r){ut(r)||(M1e.isFragment(r)?n=n.concat(t(r.props.children)):n.push(r))}),xk=n,bM=e,n};function Ni(t,e){var n=[],r=[];return Array.isArray(e)?r=e.map(function(i){return co(i)}):r=[co(e)],hN(t).forEach(function(i){var a=Pi(i,"type.displayName")||Pi(i,"type.name");r.indexOf(a)!==-1&&n.push(i)}),n}function bi(t,e){var n=Ni(t,e);return n&&n[0]}var xM=function(e){if(!e||!e.props)return!1;var n=e.props,r=n.width,i=n.height;return!(!Ce(r)||r<=0||!Ce(i)||i<=0)},eSe=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],tSe=function(e){return e&&e.type&&hu(e.type)&&eSe.indexOf(e.type)>=0},nSe=function(e){return e&&bT(e)==="object"&&"clipDot"in e},rSe=function(e,n,r,i){var a,s=(a=bk==null?void 0:bk[i])!==null&&a!==void 0?a:[];return n.startsWith("data-")||!it(e)&&(i&&s.includes(n)||Y1e.includes(n))||r&&dN.includes(n)},Ye=function(e,n,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var i=e;if(b.isValidElement(e)&&(i=e.props),!Cf(i))return null;var a={};
895return Object.keys(i).forEach(function(s){var o;rSe((o=i)===null||o===void 0?void 0:o[s],s,n,r)&&(a[s]=i[s])}),a},xT=function t(e,n){if(e===n)return!0;var r=b.Children.count(e);if(r!==b.Children.count(n))return!1;if(r===0)return!0;if(r===1)return wM(Array.isArray(e)?e[0]:e,Array.isArray(n)?n[0]:n);for(var i=0;i<r;i++){var a=e[i],s=n[i];if(Array.isArray(a)||Array.isArray(s)){if(!t(a,s))return!1}else if(!wM(a,s))return!1}return!0},wM=function(e,n){if(ut(e)&&ut(n))return!0;if(!ut(e)&&!ut(n)){var r=e.props||{},i=r.children,a=vM(r,X1e),s=n.props||{},o=s.children,c=vM(s,Z1e);return i&&o?Wd(a,c)&&xT(i,o):!i&&!o?Wd(a,c):!1}return!1},SM=function(e,n){var r=[],i={};return hN(e).forEach(function(a,s){if(tSe(a))r.push(a);else if(a){var o=co(a.type),c=n[o]||{},u=c.handler,d=c.once;if(u&&(!d||!i[o])){var h=u(a,o,s);r.push(h),i[o]=!0}}}),r},iSe=function(e){var n=e&&e.type;return n&&yM[n]?yM[n]:null},aSe=function(e,n){return hN(n).indexOf(e)},sSe=["children","width","height","viewBox","className","style","title","desc"];function wT(){return wT=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},wT.apply(this,arguments)}function oSe(t,e){if(t==null)return{};var n=cSe(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function cSe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function ST(t){var e=t.children,n=t.width,r=t.height,i=t.viewBox,a=t.className,s=t.style,o=t.title,c=t.desc,u=oSe(t,sSe),d=i||{width:n,height:r,x:0,y:0},h=pt("recharts-surface",a);return D.createElement("svg",wT({},Ye(u,!0,"svg"),{className:h,width:n,height:r,style:s,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),D.createElement("title",null,o),D.createElement("desc",null,c),e)}var lSe=["children","className"];function kT(){return kT=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},kT.apply(this,arguments)}function uSe(t,e){if(t==null)return{};var n=dSe(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function dSe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var Rt=D.forwardRef(function(t,e){var n=t.children,r=t.className,i=uSe(t,lSe),a=pt("recharts-layer",r);return D.createElement("g",kT({className:a},Ye(i,!0),{ref:e}),n)}),Ga=function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a]};function hSe(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var a=Array(i);++r<i;)a[r]=t[r+e];return a}var fSe=hSe,pSe=fSe;function mSe(t,e,n){var r=t.length;return n=n===void 0?r:n,!e&&n>=r?t:pSe(t,e,n)}var gSe=mSe,vSe="\\ud800-\\udfff",ySe="\\u0300-\\u036f",bSe="\\ufe20-\\ufe2f",xSe="\\u20d0-\\u20ff",wSe=ySe+bSe+xSe,SSe="\\ufe0e\\ufe0f",kSe="\\u200d",_Se=RegExp("["+kSe+vSe+wSe+SSe+"]");function CSe(t){return _Se.test(t)}var GV=CSe;function TSe(t){return t.split("")}var ESe=TSe,YV="\\ud800-\\udfff",jSe="\\u0300-\\u036f",PSe="\\ufe20-\\ufe2f",NSe="\\u20d0-\\u20ff",ASe=jSe+PSe+NSe,OSe="\\ufe0e\\ufe0f",RSe="["+YV+"]",_T="["+ASe+"]",CT="\\ud83c[\\udffb-\\udfff]",DSe="(?:"+_T+"|"+CT+")",JV="[^"+YV+"]",XV="(?:\\ud83c[\\udde6-\\uddff]){2}",ZV="[\\ud800-\\udbff][\\udc00-\\udfff]",MSe="\\u200d",QV=DSe+"?",eH="["+OSe+"]?",ISe="(?:"+MSe+"(?:"+[JV,XV,ZV].join("|")+")"+eH+QV+")*",LSe=eH+QV+ISe,$Se="(?:"+[JV+_T+"?",_T,XV,ZV,RSe].join("|")+")",FSe=RegExp(CT+"(?="+CT+")|"+$Se+LSe,"g");function BSe(t){return t.match(FSe)||[]}var USe=BSe,zSe=ESe,WSe=GV,VSe=USe;function HSe(t){return WSe(t)?VSe(t):zSe(t)}var qSe=HSe,KSe=gSe,GSe=GV,YSe=qSe,JSe=zV;function XSe(t){return function(e){e=JSe(e);var n=GSe(e)?YSe(e):void 0,r=n?n[0]:e.charAt(0),i=n?KSe(n,1).join(""):e.slice(1);return r[t]()+i}}var ZSe=XSe,QSe=ZSe,eke=QSe("toUpperCase"),tke=eke;const n1=Lt(tke);function Qt(t){return function(){return t}}const tH=Math.cos,vb=Math.sin,ns=Math.sqrt,yb=Math.PI,r1=2*yb,TT=Math.PI,ET=2*TT,dl=1e-6,nke=ET-dl;function nH(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function rke(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return nH;const n=10**e;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class ike{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?nH:rke(e)}moveTo(e,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,n){this._append`L${this._x1=+e},${this._y1=+n}`}quadraticCurveTo(e,n,r,i){this._append`Q${+e},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(e,n,r,i,a,s){this._append`C${+e},${+n},${+r},${+i},${this._x1=+a},${this._y1=+s}`}arcTo(e,n,r,i,a){if(e=+e,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let s=this._x1,o=this._y1,c=r-e,u=i-n,d=s-e,h=o-n,f=d*d+h*h;if(this._x1===null)this._append`M${this._x1=e},${this._y1=n}`;else if(f>dl)if(!(Math.abs(h*c-u*d)>dl)||!a)this._append`L${this._x1=e},${this._y1=n}`;else{let p=r-s,g=i-o,m=c*c+u*u,v=p*p+g*g,x=Math.sqrt(m),w=Math.sqrt(f),y=a*M
vendor: 4,694 bytes, line 895
895ath.tan((TT-Math.acos((m+f-v)/(2*x*w)))/2),k=y/w,S=y/x;Math.abs(k-1)>dl&&this._append`L${e+k*d},${n+k*h}`,this._append`A${a},${a},0,0,${+(h*p>d*g)},${this._x1=e+S*c},${this._y1=n+S*u}`}}arc(e,n,r,i,a,s){if(e=+e,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let o=r*Math.cos(i),c=r*Math.sin(i),u=e+o,d=n+c,h=1^s,f=s?i-a:a-i;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>dl||Math.abs(this._y1-d)>dl)&&this._append`L${u},${d}`,r&&(f<0&&(f=f%ET+ET),f>nke?this._append`A${r},${r},0,1,${h},${e-o},${n-c}A${r},${r},0,1,${h},${this._x1=u},${this._y1=d}`:f>dl&&this._append`A${r},${r},0,${+(f>=TT)},${h},${this._x1=e+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function fN(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new ike(e)}function pN(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function rH(t){this._context=t}rH.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function i1(t){return new rH(t)}function iH(t){return t[0]}function aH(t){return t[1]}function sH(t,e){var n=Qt(!0),r=null,i=i1,a=null,s=fN(o);t=typeof t=="function"?t:t===void 0?iH:Qt(t),e=typeof e=="function"?e:e===void 0?aH:Qt(e);function o(c){var u,d=(c=pN(c)).length,h,f=!1,p;for(r==null&&(a=i(p=s())),u=0;u<=d;++u)!(u<d&&n(h=c[u],u,c))===f&&((f=!f)?a.lineStart():a.lineEnd()),f&&a.point(+t(h,u,c),+e(h,u,c));if(p)return a=null,p+""||null}return o.x=function(c){return arguments.length?(t=typeof c=="function"?c:Qt(+c),o):t},o.y=function(c){return arguments.length?(e=typeof c=="function"?c:Qt(+c),o):e},o.defined=function(c){return arguments.length?(n=typeof c=="function"?c:Qt(!!c),o):n},o.curve=function(c){return arguments.length?(i=c,r!=null&&(a=i(r)),o):i},o.context=function(c){return arguments.length?(c==null?r=a=null:a=i(r=c),o):r},o}function cy(t,e,n){var r=null,i=Qt(!0),a=null,s=i1,o=null,c=fN(u);t=typeof t=="function"?t:t===void 0?iH:Qt(+t),e=typeof e=="function"?e:Qt(e===void 0?0:+e),n=typeof n=="function"?n:n===void 0?aH:Qt(+n);function u(h){var f,p,g,m=(h=pN(h)).length,v,x=!1,w,y=new Array(m),k=new Array(m);for(a==null&&(o=s(w=c())),f=0;f<=m;++f){if(!(f<m&&i(v=h[f],f,h))===x)if(x=!x)p=f,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),g=f-1;g>=p;--g)o.point(y[g],k[g]);o.lineEnd(),o.areaEnd()}x&&(y[f]=+t(v,f,h),k[f]=+e(v,f,h),o.point(r?+r(v,f,h):y[f],n?+n(v,f,h):k[f]))}if(w)return o=null,w+""||null}function d(){return sH().defined(i).curve(s).context(a)}return u.x=function(h){return arguments.length?(t=typeof h=="function"?h:Qt(+h),r=null,u):t},u.x0=function(h){return arguments.length?(t=typeof h=="function"?h:Qt(+h),u):t},u.x1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:Qt(+h),u):r},u.y=function(h){return arguments.length?(e=typeof h=="function"?h:Qt(+h),n=null,u):e},u.y0=function(h){return arguments.length?(e=typeof h=="function"?h:Qt(+h),u):e},u.y1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:Qt(+h),u):n},u.lineX0=u.lineY0=function(){return d().x(t).y(e)},u.lineY1=function(){return d().x(t).y(n)},u.lineX1=function(){return d().x(r).y(e)},u.defined=function(h){return arguments.length?(i=typeof h=="function"?h:Qt(!!h),u):i},u.curve=function(h){return arguments.length?(s=h,a!=null&&(o=s(a)),u):s},u.context=function(h){return arguments.length?(h==null?a=o=null:o=s(a=h),u):a},u}class oH{constructor(e,n){this._context=e,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,n){switch(e=+e,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,n,e,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,e,this._y0,e,n);break}}this._x0=e,this._y0=n}}function ake(t){return new oH(t,!0)}function ske(t){return new oH(t,!1)}const mN={draw(t,e){const n=ns(e/yb);t.moveTo(n,0),t.arc(0,0,n,0,r1)}}
vendor: 7,947 bytes, line 895
895,oke={draw(t,e){const n=ns(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},cH=ns(1/3),cke=cH*2,lke={draw(t,e){const n=ns(e/cke),r=n*cH;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},uke={draw(t,e){const n=ns(e),r=-n/2;t.rect(r,r,n,n)}},dke=.8908130915292852,lH=vb(yb/10)/vb(7*yb/10),hke=vb(r1/10)*lH,fke=-tH(r1/10)*lH,pke={draw(t,e){const n=ns(e*dke),r=hke*n,i=fke*n;t.moveTo(0,-n),t.lineTo(r,i);for(let a=1;a<5;++a){const s=r1*a/5,o=tH(s),c=vb(s);t.lineTo(c*n,-o*n),t.lineTo(o*r-c*i,c*r+o*i)}t.closePath()}},wk=ns(3),mke={draw(t,e){const n=-ns(e/(wk*3));t.moveTo(0,n*2),t.lineTo(-wk*n,-n),t.lineTo(wk*n,-n),t.closePath()}},$i=-.5,Fi=ns(3)/2,jT=1/ns(12),gke=(jT/2+1)*3,vke={draw(t,e){const n=ns(e/gke),r=n/2,i=n*jT,a=r,s=n*jT+n,o=-a,c=s;t.moveTo(r,i),t.lineTo(a,s),t.lineTo(o,c),t.lineTo($i*r-Fi*i,Fi*r+$i*i),t.lineTo($i*a-Fi*s,Fi*a+$i*s),t.lineTo($i*o-Fi*c,Fi*o+$i*c),t.lineTo($i*r+Fi*i,$i*i-Fi*r),t.lineTo($i*a+Fi*s,$i*s-Fi*a),t.lineTo($i*o+Fi*c,$i*c-Fi*o),t.closePath()}};function yke(t,e){let n=null,r=fN(i);t=typeof t=="function"?t:Qt(t||mN),e=typeof e=="function"?e:Qt(e===void 0?64:+e);function i(){let a;if(n||(n=a=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(t=typeof a=="function"?a:Qt(a),i):t},i.size=function(a){return arguments.length?(e=typeof a=="function"?a:Qt(+a),i):e},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function bb(){}function xb(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function uH(t){this._context=t}uH.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:xb(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:xb(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function bke(t){return new uH(t)}function dH(t){this._context=t}dH.prototype={areaStart:bb,areaEnd:bb,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:xb(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function xke(t){return new dH(t)}function hH(t){this._context=t}hH.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:xb(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function wke(t){return new hH(t)}function fH(t){this._context=t}fH.prototype={areaStart:bb,areaEnd:bb,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Ske(t){return new fH(t)}function kM(t){return t<0?-1:1}function _M(t,e,n){var r=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(r||i<0&&-0),s=(n-t._y1)/(i||r<0&&-0),o=(a*i+s*r)/(r+i);return(kM(a)+kM(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function CM(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Sk(t,e,n){var r=t._x0,i=t._y0,a=t._x1,s=t._y1,o=(a-r)/3;t._context.bezierCurveTo(r+o,i+o*e,a-o,s-o*n,a,s)}function wb(t){this._context=t}wb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Sk(this,this._t0,CM(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Sk(this,CM(this,n=_M(this,t,e)),n);break;default:Sk(this,this._t0,n=_M(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function pH(t){this._context=new mH(t)}(pH.prototype=Object.create(wb.prototype)).point=function(t,e){wb.prototype.point.call(this,e,t)};function mH(t){this._context=t}mH.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,a){this._context.bezierCurveTo(e,t,r,n,a,i)}};function kke(t){return new wb(t)}function _ke(t){return new pH(t)}function gH(t){this._context=t}gH.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var r=TM(t),i=TM(e),a=0,s=1;s<n;++a,++s)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],t[s],e[s]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function TM(t){var e,n=t.length-1,r,i=new Array(n),a=new Array(n),s=new Array(n);for(i[0]=0,a[0]=2,s[0]=t[0]+2*t[1],e=1;e<n-1;++e)i[e]=1,a[e]=4,s[e]=4*t[e]+2*t[e+1];for(i[n-1]=2,a[n-1]=7,s[n-1]=8*t[n-1]+t[n],e=1;e<n;++e)r=i[e]/a[e-1],a[e]-=r,s[e]-=r*s[e-1];for(i[n-1]=s[n-1]/a[n-1],e=n-2;e>=0;--e)i[e]=(s[e]-i[e+1])/a[e];for(a[n-1]=(t[n]+i[n-1])/2,e=0;e<n-1;++e)a[e]=2*t[e+1]-i[e+1];return[i,a]}function Cke(t){return new gH(t)}function a1(t,e){this._context=t,this._t=e}a1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;
vendor: 9,319 bytes, lines 895-898
895default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function Tke(t){return new a1(t,.5)}function Eke(t){return new a1(t,0)}function jke(t){return new a1(t,1)}function Rh(t,e){if((s=t.length)>1)for(var n=1,r,i,a=t[e[0]],s,o=a.length;n<s;++n)for(i=a,a=t[e[n]],r=0;r<o;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function PT(t){for(var e=t.length,n=new Array(e);--e>=0;)n[e]=e;return n}function Pke(t,e){return t[e]}function Nke(t){const e=[];return e.key=t,e}function Ake(){var t=Qt([]),e=PT,n=Rh,r=Pke;function i(a){var s=Array.from(t.apply(this,arguments),Nke),o,c=s.length,u=-1,d;for(const h of a)for(o=0,++u;o<c;++o)(s[o][u]=[0,+r(h,s[o].key,u,a)]).data=h;for(o=0,d=pN(e(s));o<c;++o)s[d[o]].index=o;return n(s,d),s}return i.keys=function(a){return arguments.length?(t=typeof a=="function"?a:Qt(Array.from(a)),i):t},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:Qt(+a),i):r},i.order=function(a){return arguments.length?(e=a==null?PT:typeof a=="function"?a:Qt(Array.from(a)),i):e},i.offset=function(a){return arguments.length?(n=a??Rh,i):n},i}function Oke(t,e){if((r=t.length)>0){for(var n,r,i=0,a=t[0].length,s;i<a;++i){for(s=n=0;n<r;++n)s+=t[n][i][1]||0;if(s)for(n=0;n<r;++n)t[n][i][1]/=s}Rh(t,e)}}function Rke(t,e){if((i=t.length)>0){for(var n=0,r=t[e[0]],i,a=r.length;n<a;++n){for(var s=0,o=0;s<i;++s)o+=t[s][n][1]||0;r[n][1]+=r[n][0]=-o/2}Rh(t,e)}}function Dke(t,e){if(!(!((s=t.length)>0)||!((a=(i=t[e[0]]).length)>0))){for(var n=0,r=1,i,a,s;r<a;++r){for(var o=0,c=0,u=0;o<s;++o){for(var d=t[e[o]],h=d[r][1]||0,f=d[r-1][1]||0,p=(h-f)/2,g=0;g<o;++g){var m=t[e[g]],v=m[r][1]||0,x=m[r-1][1]||0;p+=v-x}c+=h,u+=p*h}i[r-1][1]+=i[r-1][0]=n,c&&(n-=u/c)}i[r-1][1]+=i[r-1][0]=n,Rh(t,e)}}function Zm(t){"@babel/helpers - typeof";return Zm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zm(t)}var Mke=["type","size","sizeType"];function NT(){return NT=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},NT.apply(this,arguments)}function EM(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function jM(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?EM(Object(n),!0).forEach(function(r){Ike(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):EM(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Ike(t,e,n){return e=Lke(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Lke(t){var e=$ke(t,"string");return Zm(e)=="symbol"?e:e+""}function $ke(t,e){if(Zm(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Zm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Fke(t,e){if(t==null)return{};var n=Bke(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Bke(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var vH={symbolCircle:mN,symbolCross:oke,symbolDiamond:lke,symbolSquare:uke,symbolStar:pke,symbolTriangle:mke,symbolWye:vke},Uke=Math.PI/180,zke=function(e){var n="symbol".concat(n1(e));return vH[n]||mN},Wke=function(e,n,r){if(n==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var i=18*Uke;return 1.25*e*e*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},Vke=function(e,n){vH["symbol".concat(n1(e))]=n},gN=function(e){var n=e.type,r=n===void 0?"circle":n,i=e.size,a=i===void 0?64:i,s=e.sizeType,o=s===void 0?"area":s,c=Fke(e,Mke),u=jM(jM({},c),{},{type:r,size:a,sizeType:o}),d=function(){var v=zke(r),x=yke().type(v).size(Wke(a,o,r));return x()},h=u.className,f=u.cx,p=u.cy,g=Ye(u,!0);return f===+f&&p===+p&&a===+a?D.createElement("path",NT({},g,{className:pt("recharts-symbols",h),transform:"translate(".concat(f,", ").concat(p,")"),d:d()})):null};gN.registerSymbol=Vke;function Dh(t){"@babel/helpers - typeof";return Dh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dh(t)}function AT(){return AT=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},AT.apply(this,arguments)}function PM(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Hke(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?PM(Object(n),!0).forEach(function(r){Qm(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):PM(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function qke(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Kke(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,bH(r.key),r)}}function Gke(t,e,n){return e&&Kke(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Yke(t,e,n){return e=Sb(e),Jke(t,yH()?Reflect.construct(e,n||[],Sb(t).constructor):e.apply(t,n))}function Jke(t,e){if(e&&(Dh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xke(t)}function Xke(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function yH(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yH=function(){return!!t})()}function Sb(t){return Sb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Sb(t)}function Zke(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&OT(t,e)}function OT(t,e){return OT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},OT(t,e)}function Qm(t,e,n){return e=bH(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bH(t){var e=Qke(t,"string");return Dh(e)=="symbol"?e:e+""}function Qke(t,e){if(Dh(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Dh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Bi=32,vN=function(t){function e(){return qke(this,e),Yke(this,e,arguments)}return Zke(e,t),Gke(e,[{key:"renderIcon",value:function(r){var i=this.props.inactiveColor,a=Bi/2,s=Bi/6,o=Bi/3,c=r.inactive?i:r.color;if(r.type==="plainline")return D.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:a,x2:Bi,y2:a,className:"recharts-legend-icon"});if(r.type==="line")return D.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(a,"h").concat(o,` 896 A`).concat(s,",").concat(s,",0,1,1,").concat(2*o,",").concat(a,` 897 H`).concat(Bi,"M").concat(2*o,",").concat(a,` 898 A`).concat(s,",").concat(s,",0,1,1,").concat(o,",").concat(a),className:"recharts-legend-icon"});if(r.type==="rect")return D.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(Bi/8,"h").concat(Bi,"v").concat(Bi*3/4,"h").concat(-Bi,"z"),className:"recharts-legend-icon"});if(D.isValidElement(r.legendIcon)){var u=Hke({},r);return delete u.legendIcon,D.cloneElement(r.legendIcon,u)}return D.createElement(gN,{fill:c,cx:a,cy:a,size:Bi,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,i=this.props,a=i.payload,s=i.iconSize,o=i.layout,c=i.formatter,u=i.inactiveColor,d={x:0,y:0,width:Bi,height:Bi},h={display:o==="horizontal"?"inline-block":"block",marginRight:10},f={display:"inline-block",verticalAlign:"middle",marginRight:4};
vendor: 5,874 bytes, line 898
898return a.map(function(p,g){var m=p.formatter||c,v=pt(Qm(Qm({"recharts-legend-item":!0},"legend-item-".concat(g),!0),"inactive",p.inactive));if(p.type==="none")return null;var x=it(p.value)?null:p.value;Ga(!it(p.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var w=p.inactive?u:p.color;return D.createElement("li",AT({className:v,style:h,key:"legend-item-".concat(g)},fu(r.props,p,g)),D.createElement(ST,{width:s,height:s,viewBox:d,style:f},r.renderIcon(p)),D.createElement("span",{className:"recharts-legend-item-text",style:{color:w}},m?m(x,p,g):x))})}},{key:"render",value:function(){var r=this.props,i=r.payload,a=r.layout,s=r.align;if(!i||!i.length)return null;var o={padding:0,margin:0,textAlign:a==="horizontal"?s:"left"};return D.createElement("ul",{className:"recharts-default-legend",style:o},this.renderItems())}}])}(b.PureComponent);Qm(vN,"displayName","Legend");Qm(vN,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var e_e=Ww;function t_e(){this.__data__=new e_e,this.size=0}var n_e=t_e;function r_e(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var i_e=r_e;function a_e(t){return this.__data__.get(t)}var s_e=a_e;function o_e(t){return this.__data__.has(t)}var c_e=o_e,l_e=Ww,u_e=iN,d_e=aN,h_e=200;function f_e(t,e){var n=this.__data__;if(n instanceof l_e){var r=n.__data__;if(!u_e||r.length<h_e-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new d_e(r)}return n.set(t,e),this.size=n.size,this}var p_e=f_e,m_e=Ww,g_e=n_e,v_e=i_e,y_e=s_e,b_e=c_e,x_e=p_e;function Nf(t){var e=this.__data__=new m_e(t);this.size=e.size}Nf.prototype.clear=g_e;Nf.prototype.delete=v_e;Nf.prototype.get=y_e;Nf.prototype.has=b_e;Nf.prototype.set=x_e;var xH=Nf,w_e="__lodash_hash_undefined__";function S_e(t){return this.__data__.set(t,w_e),this}var k_e=S_e;function __e(t){return this.__data__.has(t)}var C_e=__e,T_e=aN,E_e=k_e,j_e=C_e;function kb(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new T_e;++e<n;)this.add(t[e])}kb.prototype.add=kb.prototype.push=E_e;kb.prototype.has=j_e;var wH=kb;function P_e(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var SH=P_e;function N_e(t,e){return t.has(e)}var kH=N_e,A_e=wH,O_e=SH,R_e=kH,D_e=1,M_e=2;function I_e(t,e,n,r,i,a){var s=n&D_e,o=t.length,c=e.length;if(o!=c&&!(s&&c>o))return!1;var u=a.get(t),d=a.get(e);if(u&&d)return u==e&&d==t;var h=-1,f=!0,p=n&M_e?new A_e:void 0;for(a.set(t,e),a.set(e,t);++h<o;){var g=t[h],m=e[h];if(r)var v=s?r(m,g,h,e,t,a):r(g,m,h,t,e,a);if(v!==void 0){if(v)continue;f=!1;break}if(p){if(!O_e(e,function(x,w){if(!R_e(p,w)&&(g===x||i(g,x,n,r,a)))return p.push(w)})){f=!1;break}}else if(!(g===m||i(g,m,n,r,a))){f=!1;break}}return a.delete(t),a.delete(e),f}var _H=I_e,L_e=Ds,$_e=L_e.Uint8Array,F_e=$_e;function B_e(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}var U_e=B_e;function z_e(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var yN=z_e,NM=sv,AM=F_e,W_e=rN,V_e=_H,H_e=U_e,q_e=yN,K_e=1,G_e=2,Y_e="[object Boolean]",J_e="[object Date]",X_e="[object Error]",Z_e="[object Map]",Q_e="[object Number]",eCe="[object RegExp]",tCe="[object Set]",nCe="[object String]",rCe="[object Symbol]",iCe="[object ArrayBuffer]",aCe="[object DataView]",OM=NM?NM.prototype:void 0,kk=OM?OM.valueOf:void 0;function sCe(t,e,n,r,i,a,s){switch(n){case aCe:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case iCe:return!(t.byteLength!=e.byteLength||!a(new AM(t),new AM(e)));case Y_e:case J_e:case Q_e:return W_e(+t,+e);case X_e:return t.name==e.name&&t.message==e.message;case eCe:case nCe:return t==e+"";case Z_e:var o=H_e;case tCe:var c=r&K_e;if(o||(o=q_e),t.size!=e.size&&!c)return!1;var u=s.get(t);if(u)return u==e;r|=G_e,s.set(t,e);var d=V_e(o(t),o(e),r,i,a,s);return s.delete(t),d;case rCe:if(kk)return kk.call(t)==kk.call(e)}return!1}var oCe=sCe;function cCe(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var CH=cCe,lCe=CH,uCe=di;function dCe(t,e,n){var r=e(t);return uCe(t)?r:lCe(r,n(t))}var hCe=dCe;function fCe(t,e){for(var n=-1,r=t==null?0:t.length,i=0,a=[];++n<r;){var s=t[n];e(s,n,t)&&(a[i++]=s)}return a}var pCe=fCe;function mCe(){return[]}var gCe=mCe,vCe=pCe,yCe=gCe,bCe=Object.prototype,xCe=bCe.propertyIsEnumerable,RM=Object.getOwnPropertySymbols,wCe=RM?function(t){return t==null?[]:(t=Object(t),vCe(RM(t),function(e){return xCe.call(t,e)}))}:yCe,SCe=wCe;function kCe(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var _Ce=kCe,CCe=Co,TCe=To,ECe="[object Arguments]";function jCe(t){return TCe(t)&&CCe(t)==ECe}var PCe=jCe,DM=PCe,NCe=To,TH=Object.prototype,ACe=TH.hasOwnProperty,OCe=TH.propertyIsEnumerable,RCe=DM(function(){return arguments}())?DM:function(t){return NCe(t)&&ACe.call(t,"callee")&&!OCe.call(t,"callee")},bN=RCe,_b={exports:{}};function DCe(){return!1}var MCe=DCe;_b.exports;(function(t,e){var n=Ds,r=MCe,i=e&&!e.nodeType&&e,a=i&&!0&&t&&!t.nodeType&&t,s=a&&a.exports===i,o=s?n.Buffer:void 0,c=o?o.isBuffer:void 0,u=c||r;t.exports=u})(_b,_b.exports);var EH=_b.exports,ICe=9007199254740991,LCe=/^(?:0|[1-9]\d*)$/;function $Ce(t,e){var n=typeof t;return e=e??ICe,!!e&&(n=="number"||n!="symbol"&&LCe.test(t))&&t>-1&&t%1==0&&t<e}var xN=$Ce,FCe=9007199254740991;function BCe(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=FCe}var wN=BCe,UCe=Co,zCe=wN,WCe=To,VCe="[object Arguments]",HCe="[object Array]",qCe="[object Boolean]",KCe="[object Date]",GCe="[object Error]",YCe="[object Function]",JCe="[object Map]",XCe="[object Number]",ZCe="[object Object]",QCe="[object RegExp]",eTe="[object Set]",tTe="[object String]",nTe="[object WeakMap]",rTe="[object ArrayBuffer]",iTe="[object DataView]",aTe="[object Float32Array]",sTe="[object Float64Array
898]",oTe="[object Int8Array]",cTe="[object Int16Array]",lTe="[object Int32Array]",uTe="[object Uint8Array]",dTe="[object Uint8ClampedArray]",hTe="[object Uint16Array]",fTe="[object Uint32Array]",cn={};cn[aTe]=cn[sTe]=cn[oTe]=cn[cTe]=cn[lTe]=cn[uTe]=cn[dTe]=cn[hTe]=cn[fTe]=!0;cn[VCe]=cn[HCe]=cn[rTe]=cn[qCe]=cn[iTe]=cn[KCe]=cn[GCe]=cn[YCe]=cn[JCe]=cn[XCe]=cn[ZCe]=cn[QCe]=cn[eTe]=cn[tTe]=cn[nTe]=!1;function pTe(t){return WCe(t)&&zCe(t.length)&&!!cn[UCe(t)]}var mTe=pTe;function gTe(t){return function(e){return t(e)}}var jH=gTe,Cb={exports:{}};Cb.exports;(function(t,e){var n=IV,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,a=i&&i.exports===r,s=a&&n.process,o=function(){try{var c=i&&i.require&&i.require("util").types;return c||s&&s.binding&&s.binding("util")}catch{}}();t.exports=o})(Cb,Cb.exports);var vTe=Cb.exports,yTe=mTe,bTe=jH,MM=vTe,IM=MM&&MM.isTypedArray,xTe=IM?bTe(IM):yTe,PH=xTe,wTe=_Ce,STe=bN,kTe=di,_Te=EH,CTe=xN,TTe=PH,ETe=Object.prototype,jTe=ETe.hasOwnProperty;function PTe(t,e){var n=kTe(t),r=!n&&STe(t),i=!n&&!r&&_Te(t),a=!n&&!r&&!i&&TTe(t),s=n||r||i||a,o=s?wTe(t.length,String):[],c=o.length;for(var u in t)(e||jTe.call(t,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||CTe(u,c)))&&o.push(u);return o}var NTe=PTe,ATe=Object.prototype;function OTe(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||ATe;return t===n}var RTe=OTe;function DTe(t,e){return function(n){return t(e(n))}}var NH=DTe,MTe=NH,ITe=MTe(Object.keys,Object),LTe=ITe,$Te=RTe,FTe=LTe,BTe=Object.prototype,UTe=BTe.hasOwnProperty;function zTe(t){if(!$Te(t))return FTe(t);var e=[];for(var n in Object(t))UTe.call(t,n)&&n!="constructor"&&e.push(n);return e}var WTe=zTe,VTe=nN,HTe=wN;function qTe(t){return t!=null&&HTe(t.length)&&!VTe(t)}var cv=qTe,KTe=NTe,GTe=WTe,YTe=cv;function JTe(t){return YTe(t)?KTe(t):GTe(t)}var s1=JTe,XTe=hCe,ZTe=SCe,QTe=s1;function eEe(t){return XTe(t,QTe,ZTe)}var tEe=eEe,LM=tEe,nEe=1,rEe=Object.prototype,iEe=rEe.hasOwnProperty;function aEe(t,e,n,r,i,a){var s=n&nEe,o=LM(t),c=o.length,u=LM(e),d=u.length;if(c!=d&&!s)return!1;for(var h=c;h--;){var f=o[h];if(!(s?f in e:iEe.call(e,f)))return!1}var p=a.get(t),g=a.get(e);if(p&&g)return p==e&&g==t;var m=!0;a.set(t,e),a.set(e,t);for(var v=s;++h<c;){f=o[h];var x=t[f],w=e[f];if(r)var y=s?r(w,x,f,e,t,a):r(x,w,f,t,e,a);if(!(y===void 0?x===w||i(x,w,n,r,a):y)){m=!1;break}v||(v=f=="constructor")}if(m&&!v){var k=t.constructor,S=e.constructor;k!=S&&"constructor"in t&&"constructor"in e&&!(typeof k=="function"&&k instanceof k&&typeof S=="function"&&S instanceof S)&&(m=!1)}return a.delete(t),a.delete(e),m}var sEe=aEe,oEe=ku,cEe=Ds,lEe=oEe(cEe,"DataView"),uEe=lEe,dEe=ku,hEe=Ds,fEe=dEe(hEe,"Promise"),pEe=fEe,mEe=ku,gEe=Ds,vEe=mEe(gEe,"Set"),AH=vEe,yEe=ku,bEe=Ds,xEe=yEe(bEe,"WeakMap"),wEe=xEe,RT=uEe,DT=iN,MT=pEe,IT=AH,LT=wEe,OH=Co,Af=$V,$M="[object Map]",SEe="[object Object]",FM="[object Promise]",BM="[object Set]",UM="[object WeakMap]",zM="[object DataView]",kEe=Af(RT),_Ee=Af(DT),CEe=Af(MT),TEe=Af(IT),EEe=Af(LT),hl=OH;(RT&&hl(new RT(new ArrayBuffer(1)))!=zM||DT&&hl(new DT)!=$M||MT&&hl(MT.resolve())!=FM||IT&&hl(new IT)!=BM||LT&&hl(new LT)!=UM)&&(hl=function(t){var e=OH(t),n=e==SEe?t.constructor:void 0,r=n?Af(n):"";if(r)switch(r){case kEe:return zM;case _Ee:return $M;case CEe:return FM;case TEe:return BM;case EEe:return UM}return e});var jEe=hl,_k=xH,PEe=_H,NEe=oCe,AEe=sEe,WM=jEe,VM=di,HM=EH,OEe=PH,REe=1,qM="[object Arguments]",KM="[object Array]",ly="[object Object]",DEe=Object.prototype,GM=DEe.hasOwnProperty;function MEe(t,e,n,r,i,a){var s=VM(t),o=VM(e),c=s?KM:WM(t),u=o?KM:WM(e);c=c==qM?ly:c,u=u==qM?ly:u;var d=c==ly,h=u==ly,f=c==u;if(f&&HM(t)){if(!HM(e))return!1;s=!0,d=!1}if(f&&!d)return a||(a=new _k),s||OEe(t)?PEe(t,e,n,r,i,a):NEe(t,e,c,n,r,i,a);if(!(n&REe)){var p=d&&GM.call(t,"__wrapped__"),g=h&&GM.call(e,"__wrapped__");
vendor: 4,112 bytes, line 898
898if(p||g){var m=p?t.value():t,v=g?e.value():e;return a||(a=new _k),i(m,v,n,r,a)}}return f?(a||(a=new _k),AEe(t,e,n,r,i,a)):!1}var IEe=MEe,LEe=IEe,YM=To;function RH(t,e,n,r,i){return t===e?!0:t==null||e==null||!YM(t)&&!YM(e)?t!==t&&e!==e:LEe(t,e,n,r,RH,i)}var SN=RH,$Ee=xH,FEe=SN,BEe=1,UEe=2;function zEe(t,e,n,r){var i=n.length,a=i,s=!r;if(t==null)return!a;for(t=Object(t);i--;){var o=n[i];if(s&&o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++i<a;){o=n[i];var c=o[0],u=t[c],d=o[1];if(s&&o[2]){if(u===void 0&&!(c in t))return!1}else{var h=new $Ee;if(r)var f=r(u,d,c,t,e,h);if(!(f===void 0?FEe(d,u,BEe|UEe,r,h):f))return!1}}return!0}var WEe=zEe,VEe=Yc;function HEe(t){return t===t&&!VEe(t)}var DH=HEe,qEe=DH,KEe=s1;function GEe(t){for(var e=KEe(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,qEe(i)]}return e}var YEe=GEe;function JEe(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}var MH=JEe,XEe=WEe,ZEe=YEe,QEe=MH;function e2e(t){var e=ZEe(t);return e.length==1&&e[0][2]?QEe(e[0][0],e[0][1]):function(n){return n===t||XEe(n,t,e)}}var t2e=e2e;function n2e(t,e){return t!=null&&e in Object(t)}var r2e=n2e,i2e=WV,a2e=bN,s2e=di,o2e=xN,c2e=wN,l2e=Hw;function u2e(t,e,n){e=i2e(e,t);for(var r=-1,i=e.length,a=!1;++r<i;){var s=l2e(e[r]);if(!(a=t!=null&&n(t,s)))break;t=t[s]}return a||++r!=i?a:(i=t==null?0:t.length,!!i&&c2e(i)&&o2e(s,i)&&(s2e(t)||a2e(t)))}var d2e=u2e,h2e=r2e,f2e=d2e;function p2e(t,e){return t!=null&&f2e(t,e,h2e)}var m2e=p2e,g2e=SN,v2e=VV,y2e=m2e,b2e=tN,x2e=DH,w2e=MH,S2e=Hw,k2e=1,_2e=2;function C2e(t,e){return b2e(t)&&x2e(e)?w2e(S2e(t),e):function(n){var r=v2e(n,t);return r===void 0&&r===e?y2e(n,t):g2e(e,r,k2e|_2e)}}var T2e=C2e;function E2e(t){return t}var Of=E2e;function j2e(t){return function(e){return e==null?void 0:e[t]}}var P2e=j2e,N2e=cN;function A2e(t){return function(e){return N2e(e,t)}}var O2e=A2e,R2e=P2e,D2e=O2e,M2e=tN,I2e=Hw;function L2e(t){return M2e(t)?R2e(I2e(t)):D2e(t)}var $2e=L2e,F2e=t2e,B2e=T2e,U2e=Of,z2e=di,W2e=$2e;function V2e(t){return typeof t=="function"?t:t==null?U2e:typeof t=="object"?z2e(t)?B2e(t[0],t[1]):F2e(t):W2e(t)}var Ms=V2e;function H2e(t,e,n,r){for(var i=t.length,a=n+(r?1:-1);r?a--:++a<i;)if(e(t[a],a,t))return a;return-1}var IH=H2e;function q2e(t){return t!==t}var K2e=q2e;function G2e(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}var Y2e=G2e,J2e=IH,X2e=K2e,Z2e=Y2e;function Q2e(t,e,n){return e===e?Z2e(t,e,n):J2e(t,X2e,n)}var eje=Q2e,tje=eje;function nje(t,e){var n=t==null?0:t.length;return!!n&&tje(t,e,0)>-1}var rje=nje;function ije(t,e,n){for(var r=-1,i=t==null?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}var aje=ije;function sje(){}var oje=sje,Ck=AH,cje=oje,lje=yN,uje=1/0,dje=Ck&&1/lje(new Ck([,-0]))[1]==uje?function(t){return new Ck(t)}:cje,hje=dje,fje=wH,pje=rje,mje=aje,gje=kH,vje=hje,yje=yN,bje=200;function xje(t,e,n){var r=-1,i=pje,a=t.length,s=!0,o=[],c=o;if(n)s=!1,i=mje;else if(a>=bje){var u=e?null:vje(t);if(u)return yje(u);s=!1,i=gje,c=new fje}else c=e?[]:o;e:for(;++r<a;){var d=t[r],h=e?e(d):d;if(d=n||d!==0?d:0,s&&h===h){for(var f=c.length;f--;)if(c[f]===h)continue e;e&&c.push(h),o.push(d)}else i(c,h,n)||(c!==o&&c.push(h),o.push(d))}return o}var wje=xje,Sje=Ms,kje=wje;function _je(t,e){return t&&t.length?kje(t,Sje(e)):[]}var Cje=_je;const JM=Lt(Cje);function LH(t,e,n){return e===!0?JM(t,n):it(e)?JM(t,e):t}function Mh(t){"@babel/helpers - typeof";return Mh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mh(t)}var Tje=["ref"];function XM(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Us(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?XM(Object(n),!0).forEach(function(r){o1(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):XM(Object(n)).forEac
vendor: 4,282 bytes, line 898
898h(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Eje(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ZM(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,FH(r.key),r)}}function jje(t,e,n){return e&&ZM(t.prototype,e),n&&ZM(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Pje(t,e,n){return e=Tb(e),Nje(t,$H()?Reflect.construct(e,n||[],Tb(t).constructor):e.apply(t,n))}function Nje(t,e){if(e&&(Mh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Aje(t)}function Aje(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $H(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($H=function(){return!!t})()}function Tb(t){return Tb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Tb(t)}function Oje(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$T(t,e)}function $T(t,e){return $T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},$T(t,e)}function o1(t,e,n){return e=FH(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function FH(t){var e=Rje(t,"string");return Mh(e)=="symbol"?e:e+""}function Rje(t,e){if(Mh(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Mh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Dje(t,e){if(t==null)return{};var n=Mje(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Mje(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function Ije(t){return t.value}function Lje(t,e){if(D.isValidElement(t))return D.cloneElement(t,e);if(typeof t=="function")return D.createElement(t,e);e.ref;var n=Dje(e,Tje);return D.createElement(vN,n)}var QM=1,Vd=function(t){function e(){var n;Eje(this,e);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=Pje(this,e,[].concat(i)),o1(n,"lastBoundingBox",{width:-1,height:-1}),n}return Oje(e,t),jje(e,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();return r.height=this.wrapperNode.offsetHeight,r.width=this.wrapperNode.offsetWidth,r}return null}},{key:"updateBBox",value:function(){var r=this.props.onBBoxUpdate,i=this.getBBox();i?(Math.abs(i.width-this.lastBoundingBox.width)>QM||Math.abs(i.height-this.lastBoundingBox.height)>QM)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Us({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,a=i.layout,s=i.align,o=i.verticalAlign,c=i.margin,u=i.chartWidth,d=i.chartHeight,h,f;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(s==="center"&&a==="vertical"){var p=this.getBBoxSnapshot();h={left:((u||0)-p.width)/2}}else h=s==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(o==="middle"){var g=this.getBBoxSnapsh
898ot();f={top:((d||0)-g.height)/2}}else f=o==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Us(Us({},h),f)}},{key:"render",value:function(){var r=this,i=this.props,a=i.content,s=i.width,o=i.height,c=i.wrapperStyle,u=i.payloadUniqBy,d=i.payload,h=Us(Us({position:"absolute",width:s||"auto",height:o||"auto"},this.getDefaultPosition(c)),c);return D.createElement("div",{className:"recharts-legend-wrapper",style:h,ref:function(p){r.wrapperNode=p}},Lje(a,Us(Us({},this.props),{},{payload:LH(d,u,Ije)})))}}],[{key:"getWithHeight",value:function(r,i){var a=Us(Us({},this.defaultProps),r.props),s=a.layout;return s==="vertical"&&Ce(r.props.height)?{height:r.props.height}:s==="horizontal"?{width:r.props.width||i}:null}}])}(b.PureComponent);o1(Vd,"displayName","Legend");o1(Vd,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var eI=sv,$je=bN,Fje=di,tI=eI?eI.isConcatSpreadable:void 0;function Bje(t){return Fje(t)||$je(t)||!!(tI&&t&&t[tI])}var Uje=Bje,zje=CH,Wje=Uje;function BH(t,e,n,r,i){var a=-1,s=t.length;for(n||(n=Wje),i||(i=[]);++a<s;){var o=t[a];e>0&&n(o)?e>1?BH(o,e-1,n,r,i):zje(i,o):r||(i[i.length]=o)}return i}var UH=BH;function Vje(t){return function(e,n,r){for(var i=-1,a=Object(e),s=r(e),o=s.length;o--;){var c=s[t?o:++i];if(n(a[c],c,a)===!1)break}return e}}var Hje=Vje,qje=Hje,Kje=qje(),Gje=Kje,Yje=Gje,Jje=s1;function Xje(t,e){return t&&Yje(t,e,Jje)}var zH=Xje,Zje=cv;function Qje(t,e){return function(n,r){if(n==null)return n;if(!Zje(n))return t(n,r);for(var i=n.length,a=e?i:-1,s=Object(n);(e?a--:++a<i)&&r(s[a],a,s)!==!1;);return n}}var ePe=Qje,tPe=zH,nPe=ePe,rPe=nPe(tPe),kN=rPe,iPe=kN,aPe=cv;function sPe(t,e){var n=-1,r=aPe(t)?Array(t.length):[];return iPe(t,function(i,a,s){r[++n]=e(i,a,s)}),r}var WH=sPe;function oPe(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}var cPe=oPe,nI=_f;function lPe(t,e){if(t!==e){var n=t!==void 0,r=t===null,i=t===t,a=nI(t),s=e!==void 0,o=e===null,c=e===e,u=nI(e);if(!o&&!u&&!a&&t>e||a&&s&&c&&!o&&!u||r&&s&&c||!n&&c||!i)return 1;if(!r&&!a&&!u&&t<e||u&&n&&i&&!r&&!a||o&&n&&i||!s&&i||!c)return-1}return 0}var uPe=lPe,dPe=uPe;function hPe(t,e,n){for(var r=-1,i=t.criteria,a=e.criteria,s=i.length,o=n.length;++r<s;){var c=dPe(i[r],a[r]);if(c){if(r>=o)return c;var u=n[r];return c*(u=="desc"?-1:1)}}return t.index-e.index}var fPe=hPe,Tk=oN,pPe=cN,mPe=Ms,gPe=WH,vPe=cPe,yPe=jH,bPe=fPe,xPe=Of,wPe=di;function SPe(t,e,n){e.length?e=Tk(e,function(a){return wPe(a)?function(s){return pPe(s,a.length===1?a[0]:a)}:a}):e=[xPe];var r=-1;e=Tk(e,yPe(mPe));var i=gPe(t,function(a,s,o){var c=Tk(e,function(u){return u(a)});return{criteria:c,index:++r,value:a}});return vPe(i,function(a,s){return bPe(a,s,n)})}var kPe=SPe;function _Pe(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var CPe=_Pe,TPe=CPe,rI=Math.max;function EPe(t,e,n){return e=rI(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,a=rI(r.length-e,0),s=Array(a);++i<a;)s[i]=r[e+i];i=-1;for(var o=Array(e+1);++i<e;)o[i]=r[i];return o[e]=n(s),TPe(t,this,o)}}var jPe=EPe;function PPe(t){return function(){return t}}var NPe=PPe,APe=ku,OPe=function(){try{var t=APe(Object,"defineProperty");return t({},"",{}),t}catch{}}(),VH=OPe,RPe=NPe,iI=VH,DPe=Of,MPe=iI?function(t,e){return iI(t,"toString",{configurable:!0,enumerable:!1,value:RPe(e),writable:!0})}:DPe,IPe=MPe,LPe=800,$Pe=16,FPe=Date.now;function BPe(t){var e=0,n=0;return function(){var r=FPe(),i=$Pe-(r-n);if(n=r,i>0){if(++e>=LPe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var UPe=BPe,zPe=IPe,WPe=UPe,VPe=WPe(zPe),HPe=VPe,qPe=Of,KPe=jPe,GPe=HPe;function YPe(t,e){return GPe(KPe(t,e,qPe),t+"")}var JPe=YPe,XPe=rN,ZPe=cv,QPe=xN,eNe=Yc;function tNe(t,e,n){if(!eNe(n))return!1;var r=typeof e;return(r=="number"?ZPe(n)&&QPe(e,n.length):r=="string"&&e in n)?XPe(n[e],t):!1}var c1=tNe,nNe=UH,rNe=kPe,iNe=JPe,aI=c1,aNe=iNe(function(t,e){if(t==null)return[];var n=e.length;return n>1&&aI(t,e[0],e[1])?e=[]:n>2&&aI(e[0],e[1],e[2])&&(e=[e[0]]),rNe(t,nNe(e,1),[])}),sNe=aNe;const _N=Lt(sNe);function eg(t){"@babel/helpers - typeof";return eg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},eg(t)}function FT(){return FT=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},FT.apply(this,arguments)}function oNe(t,e){return dNe(t)||uNe(t,e)||lNe(t,e)||cNe()}
vendor: 10,738 bytes, lines 898-899
898function cNe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 899In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lNe(t,e){if(t){if(typeof t=="string")return sI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sI(t,e)}}function sI(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function uNe(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,o=[],c=!0,u=!1;try{if(a=(n=n.call(t)).next,e!==0)for(;!(c=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function dNe(t){if(Array.isArray(t))return t}function oI(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Ek(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?oI(Object(n),!0).forEach(function(r){hNe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):oI(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function hNe(t,e,n){return e=fNe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fNe(t){var e=pNe(t,"string");return eg(e)=="symbol"?e:e+""}function pNe(t,e){if(eg(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(eg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function mNe(t){return Array.isArray(t)&&nr(t[0])&&nr(t[1])?t.join(" ~ "):t}var gNe=function(e){var n=e.separator,r=n===void 0?" : ":n,i=e.contentStyle,a=i===void 0?{}:i,s=e.itemStyle,o=s===void 0?{}:s,c=e.labelStyle,u=c===void 0?{}:c,d=e.payload,h=e.formatter,f=e.itemSorter,p=e.wrapperClassName,g=e.labelClassName,m=e.label,v=e.labelFormatter,x=e.accessibilityLayer,w=x===void 0?!1:x,y=function(){if(d&&d.length){var M={padding:0,margin:0},U=(f?_N(d,f):d).map(function(N,B){if(N.type==="none")return null;var $=Ek({display:"block",paddingTop:4,paddingBottom:4,color:N.color||"#000"},o),I=N.formatter||h||mNe,R=N.value,z=N.name,O=R,A=z;if(I&&O!=null&&A!=null){var L=I(R,z,N,B,d);if(Array.isArray(L)){var V=oNe(L,2);O=V[0],A=V[1]}else O=L}return D.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(B),style:$},nr(A)?D.createElement("span",{className:"recharts-tooltip-item-name"},A):null,nr(A)?D.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,D.createElement("span",{className:"recharts-tooltip-item-value"},O),D.createElement("span",{className:"recharts-tooltip-item-unit"},N.unit||""))});return D.createElement("ul",{className:"recharts-tooltip-item-list",style:M},U)}return null},k=Ek({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},a),S=Ek({margin:0},u),_=!ut(m),C=_?m:"",T=pt("recharts-default-tooltip",p),E=pt("recharts-tooltip-label",g);_&&v&&d!==void 0&&d!==null&&(C=v(m,d));var j=w?{role:"status","aria-live":"assertive"}:{};return D.createElement("div",FT({className:T,style:k},j),D.createElement("p",{className:E,style:S},D.isValidElement(C)?C:"".concat(C)),y())};function tg(t){"@babel/helpers - typeof";return tg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tg(t)}function uy(t,e,n){return e=vNe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vNe(t){var e=yNe(t,"string");return tg(e)=="symbol"?e:e+""}function yNe(t,e){if(tg(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(tg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var op="recharts-tooltip-wrapper",bNe={visibility:"hidden"};function xNe(t){var e=t.coordinate,n=t.translateX,r=t.translateY;return pt(op,uy(uy(uy(uy({},"".concat(op,"-right"),Ce(n)&&e&&Ce(e.x)&&n>=e.x),"".concat(op,"-left"),Ce(n)&&e&&Ce(e.x)&&n<e.x),"".concat(op,"-bottom"),Ce(r)&&e&&Ce(e.y)&&r>=e.y),"".concat(op,"-top"),Ce(r)&&e&&Ce(e.y)&&r<e.y))}function cI(t){var e=t.allowEscapeViewBox,n=t.coordinate,r=t.key,i=t.offsetTopLeft,a=t.position,s=t.reverseDirection,o=t.tooltipDimension,c=t.viewBox,u=t.viewBoxDimension;if(a&&Ce(a[r]))return a[r];var d=n[r]-o-i,h=n[r]+i;if(e[r])return s[r]?d:h;if(s[r]){var f=d,p=c[r];return f<p?Math.max(h,c[r]):Math.max(d,c[r])}var g=h+o,m=c[r]+u;return g>m?Math.max(d,c[r]):Math.max(h,c[r])}function wNe(t){var e=t.translateX,n=t.translateY,r=t.useTranslate3d;return{transform:r?"translate3d(".concat(e,"px, ").concat(n,"px, 0)"):"translate(".concat(e,"px, ").concat(n,"px)")}}function SNe(t){var e=t.allowEscapeViewBox,n=t.coordinate,r=t.offsetTopLeft,i=t.position,a=t.reverseDirection,s=t.tooltipBox,o=t.useTranslate3d,c=t.viewBox,u,d,h;return s.height>0&&s.width>0&&n?(d=cI({allowEscapeViewBox:e,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:s.width,viewBox:c,viewBoxDimension:c.width}),h=cI({allowEscapeViewBox:e,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:s.height,viewBox:c,viewBoxDimension:c.height}),u=wNe({translateX:d,translateY:h,useTranslate3d:o})):u=bNe,{cssProperties:u,cssClasses:xNe({translateX:d,translateY:h,coordinate:n})}}function Ih(t){"@babel/helpers - typeof";return Ih=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ih(t)}function lI(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function uI(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?lI(Object(n),!0).forEach(function(r){UT(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):lI(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function kNe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _Ne(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,qH(r.key),r)}}function CNe(t,e,n){return e&&_Ne(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function TNe(t,e,n){return e=Eb(e),ENe(t,HH()?Reflect.construct(e,n||[],Eb(t).constructor):e.apply(t,n))}function ENe(t,e){if(e&&(Ih(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jNe(t)}function jNe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function HH(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(HH=function(){return!!t})()}function Eb(t){return Eb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Eb(t)}function PNe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&BT(t,e)}function BT(t,e){return BT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},BT(t,e)}function UT(t,e,n){return e=qH(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qH(t){var e=NNe(t,"string");return Ih(e)=="symbol"?e:e+""}function NNe(t,e){if(Ih(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Ih(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var dI=1,ANe=function(t){function e(){var n;kNe(this,e);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=TNe(this,e,[].concat(i)),UT(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),UT(n,"handleKeyDown",function(s){if(s.key==="Escape"){var o,c,u,d;n.setState({dismissed:!0,dismissedAtCoordinate:{x:(o=(c=n.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&o!==void 0?o:0,y:(u=(d=n.props.coordinate)===null||d===void 0?void 0:d.y)!==null&&u!==void 0?u:0}})}}),n}return PNe(e,t),CNe(e,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>dI||Math.abs(r.height-this.state.lastBoundingBox.height)>dI)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,a=i.active,s=i.allowEscapeViewBox,o=i.animationDuration,c=i.animationEasing,u=i.children,d=i.coordinate,h=i.hasPayload,f=i.isAnimationActive,p=i.offset,g=i.position,m=i.reverseDirection,v=i.useTranslate3d,x=i.viewBox,w=i.wrapperStyle,y=SNe({allowEscapeViewBox:s,coordinate:d,offsetTopLeft:p,position:g,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:v,viewBox:x}
899),k=y.cssClasses,S=y.cssProperties,_=uI(uI({transition:f&&a?"transform ".concat(o,"ms ").concat(c):void 0},S),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&h?"visible":"hidden",position:"absolute",top:0,left:0},w);return D.createElement("div",{tabIndex:-1,className:k,style:_,ref:function(T){r.wrapperNode=T}},u)}}])}(b.PureComponent),ONe=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},xs={isSsr:ONe(),get:function(e){return xs[e]},set:function(e,n){if(typeof e=="string")xs[e]=n;else{var r=Object.keys(e);r&&r.length&&r.forEach(function(i){xs[i]=e[i]})}}};function Lh(t){"@babel/helpers - typeof";return Lh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lh(t)}function hI(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function fI(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?hI(Object(n),!0).forEach(function(r){CN(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):hI(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function RNe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function DNe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,GH(r.key),r)}}function MNe(t,e,n){return e&&DNe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function INe(t,e,n){return e=jb(e),LNe(t,KH()?Reflect.construct(e,n||[],jb(t).constructor):e.apply(t,n))}function LNe(t,e){if(e&&(Lh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $Ne(t)}function $Ne(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function KH(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(KH=function(){return!!t})()}function jb(t){return jb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},jb(t)}function FNe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&zT(t,e)}function zT(t,e){return zT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},zT(t,e)}function CN(t,e,n){return e=GH(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function GH(t){var e=BNe(t,"string");return Lh(e)=="symbol"?e:e+""}function BNe(t,e){if(Lh(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Lh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function UNe(t){return t.dataKey}function zNe(t,e){return D.isValidElement(t)?D.cloneElement(t,e):typeof t=="function"?D.createElement(t,e):D.createElement(gNe,e)}var Hi=function(t){function e(){return RNe(this,e),INe(this,e,arguments)}return FNe(e,t),MNe(e,[{key:"render",value:function(){var r=this,i=this.props,a=i.active,s=i.allowEscapeViewBox,o=i.animationDuration,c=i.animationEasing,u=i.content,d=i.coordinate,h=i.filterNull,f=i.isAnimationActive,p=i.offset,g=i.payload,m=i.payloadUniqBy,v=i.position,x=i.reverseDirection,w=i.useTranslate3d,y=i.viewBox,k=i.wrapperStyle,S=g??[];h&&S.length&&(S=LH(g.filter(function(C){return C.value!=null&&(C.hide!==!0||r.props.includeHidden)}),m,UNe));var _=S.length>0;return D.createElement(ANe,{allowEscapeViewBox:s,animationDuration:o,animationEasing:c,isAnimationActive:f,active:a,coordinate:d,hasPayload:_,offset:p,position:v,reverseDirection:x,useTranslate3d:w,viewBox:y,wrapperStyle:k},zNe(u,fI(fI({},this.props),{},{payload:S})))}}])}(b.PureComponent);CN(Hi,"displayName","Tooltip");CN(Hi,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!xs.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var WNe=Ds,VNe=function(){return WNe.Date.now()},HNe=VNe,qNe=/\s/;function KNe(t){for(var e=t.length;e--&&qNe.test(t.charAt(e)););return e}
vendor: 13,862 bytes, lines 899-905
899var GNe=KNe,YNe=GNe,JNe=/^\s+/;function XNe(t){return t&&t.slice(0,YNe(t)+1).replace(JNe,"")}var ZNe=XNe,QNe=ZNe,pI=Yc,eAe=_f,mI=NaN,tAe=/^[-+]0x[0-9a-f]+$/i,nAe=/^0b[01]+$/i,rAe=/^0o[0-7]+$/i,iAe=parseInt;function aAe(t){if(typeof t=="number")return t;if(eAe(t))return mI;if(pI(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=pI(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=QNe(t);var n=nAe.test(t);return n||rAe.test(t)?iAe(t.slice(2),n?2:8):tAe.test(t)?mI:+t}var YH=aAe,sAe=Yc,jk=HNe,gI=YH,oAe="Expected a function",cAe=Math.max,lAe=Math.min;function uAe(t,e,n){var r,i,a,s,o,c,u=0,d=!1,h=!1,f=!0;if(typeof t!="function")throw new TypeError(oAe);e=gI(e)||0,sAe(n)&&(d=!!n.leading,h="maxWait"in n,a=h?cAe(gI(n.maxWait)||0,e):a,f="trailing"in n?!!n.trailing:f);function p(_){var C=r,T=i;return r=i=void 0,u=_,s=t.apply(T,C),s}function g(_){return u=_,o=setTimeout(x,e),d?p(_):s}function m(_){var C=_-c,T=_-u,E=e-C;return h?lAe(E,a-T):E}function v(_){var C=_-c,T=_-u;return c===void 0||C>=e||C<0||h&&T>=a}function x(){var _=jk();if(v(_))return w(_);o=setTimeout(x,m(_))}function w(_){return o=void 0,f&&r?p(_):(r=i=void 0,s)}function y(){o!==void 0&&clearTimeout(o),u=0,r=c=i=o=void 0}function k(){return o===void 0?s:w(jk())}function S(){var _=jk(),C=v(_);if(r=arguments,i=this,c=_,C){if(o===void 0)return g(c);if(h)return clearTimeout(o),o=setTimeout(x,e),p(c)}return o===void 0&&(o=setTimeout(x,e)),s}return S.cancel=y,S.flush=k,S}var dAe=uAe,hAe=dAe,fAe=Yc,pAe="Expected a function";function mAe(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(pAe);return fAe(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),hAe(t,e,{leading:r,maxWait:e,trailing:i})}var gAe=mAe;const JH=Lt(gAe);function ng(t){"@babel/helpers - typeof";return ng=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ng(t)}function vI(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function dy(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?vI(Object(n),!0).forEach(function(r){vAe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vI(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function vAe(t,e,n){return e=yAe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yAe(t){var e=bAe(t,"string");return ng(e)=="symbol"?e:e+""}function bAe(t,e){if(ng(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(ng(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function xAe(t,e){return _Ae(t)||kAe(t,e)||SAe(t,e)||wAe()}function wAe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 900In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function SAe(t,e){if(t){if(typeof t=="string")return yI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yI(t,e)}}function yI(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function kAe(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,o=[],c=!0,u=!1;try{if(a=(n=n.call(t)).next,e!==0)for(;!(c=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function _Ae(t){if(Array.isArray(t))return t}var Pk=b.forwardRef(function(t,e){var n=t.aspect,r=t.initialDimension,i=r===void 0?{width:-1,height:-1}:r,a=t.width,s=a===void 0?"100%":a,o=t.height,c=o===void 0?"100%":o,u=t.minWidth,d=u===void 0?0:u,h=t.minHeight,f=t.maxHeight,p=t.children,g=t.debounce,m=g===void 0?0:g,v=t.id,x=t.className,w=t.onResize,y=t.style,k=y===void 0?{}:y,S=b.useRef(null),_=b.useRef();_.current=w,b.useImperativeHandle(e,function(){return Object.defineProperty(S.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),S.current},configurable:!0})});var C=b.useState({containerWidth:i.width,containerHeight:i.height}),T=xAe(C,2),E=T[0],j=T[1],P=b.useCallback(function(U,N){j(function(B){var $=Math.round(U),I=Math.round(N);return B.containerWidth===$&&B.containerHeight===I?B:{containerWidth:$,containerHeight:I}})},[]);b.useEffect(function(){var U=function(z){var O,A=z[0].contentRect,L=A.width,V=A.height;P(L,V),(O=_.current)===null||O===void 0||O.call(_,L,V)};m>0&&(U=JH(U,m,{trailing:!0,leading:!1}));var N=new ResizeObserver(U),B=S.current.getBoundingClientRect(),$=B.width,I=B.height;return P($,I),N.observe(S.current),function(){N.disconnect()}},[P,m]);var M=b.useMemo(function(){var U=E.containerWidth,N=E.containerHeight;if(U<0||N<0)return null;Ga(Nl(s)||Nl(c),`The width(%s) and height(%s) are both fixed numbers, 901 maybe you don't need to use a ResponsiveContainer.`,s,c),Ga(!n||n>0,"The aspect(%s) must be greater than zero.",n);var B=Nl(s)?U:s,$=Nl(c)?N:c;n&&n>0&&(B?$=B/n:$&&(B=$*n),f&&$>f&&($=f)),Ga(B>0||$>0,`The width(%s) and height(%s) of chart should be greater than 0, 902 please check the style of container, or the props width(%s) and height(%s), 903 or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the 904 height and width.`,B,$,s,c,d,h,n);var I=!Array.isArray(p)&&co(p.type).endsWith("Chart");return D.Children.map(p,function(R){return D.isValidElement(R)?b.cloneElement(R,dy({width:B,height:$},I?{style:dy({height:"100%",width:"100%",maxHeight:$,maxWidth:B},R.props.style)}:{})):R})},[n,p,c,f,h,d,E,s]);return D.createElement("div",{id:v?"".concat(v):void 0,className:pt("recharts-responsive-container",x),style:dy(dy({},k),{},{width:s,height:c,minWidth:d,minHeight:h,maxHeight:f}),ref:S},M)}),l1=function(e){return null};l1.displayName="Cell";function rg(t){"@babel/helpers - typeof";return rg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rg(t)}function bI(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function WT(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?bI(Object(n),!0).forEach(function(r){CAe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):bI(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function CAe(t,e,n){return e=TAe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function TAe(t){var e=EAe(t,"string");return rg(e)=="symbol"?e:e+""}function EAe(t,e){if(rg(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(rg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Gu={widthCache:{},cacheCount:0},jAe=2e3,PAe={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},xI="recharts_measurement_span";function NAe(t){var e=WT({},t);return Object.keys(e).forEach(function(n){e[n]||delete e[n]}),e}var Yp=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||xs.isSsr)return{width:0,height:0};var r=NAe(n),i=JSON.stringify({text:e,copyStyle:r});if(Gu.widthCache[i])return Gu.widthCache[i];try{var a=document.getElementById(xI);a||(a=document.createElement("span"),a.setAttribute("id",xI),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var s=WT(WT({},PAe),r);Object.assign(a.style,s),a.textContent="".concat(e);var o=a.getBoundingClientRect(),c={width:o.width,height:o.height};return Gu.widthCache[i]=c,++Gu.cacheCount>jAe&&(Gu.cacheCount=0,Gu.widthCache={}),c}catch{return{width:0,height:0}}},AAe=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function ig(t){"@babel/helpers - typeof";return ig=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ig(t)}function Pb(t,e){return MAe(t)||DAe(t,e)||RAe(t,e)||OAe()}function OAe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 905In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RAe(t,e){if(t){if(typeof t=="string")return wI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wI(t,e)}}function wI(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function DAe(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,o=[],c=!0,u=!1;try{if(a=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function MAe(t){if(Array.isArray(t))return t}function IAe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function SI(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,$Ae(r.key),r)}}function LAe(t,e,n){return e&&SI(t.prototype,e),n&&SI(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function $Ae(t){var e=FAe(t,"string");return ig(e)=="symbol"?e:e+""}function FAe(t,e){if(ig(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(ig(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var kI=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,_I=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,BAe=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,UAe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,XH={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},zAe=Object.keys(XH),yd="NaN";function WAe(t,e){return t*XH[e]}var hy=function(){function t(e,n){IAe(this,t),this.num=e,this.unit=n,this.num=e,this.unit=n,Number.isNaN(e)&&(this.unit=""),n!==""&&!BAe.test(n)&&(this.num=NaN,this.unit=""),zAe.includes(n)&&(this.num=WAe(e,n),this.unit="px")}return LAe(t,[{key:"add",value:function(n){return this.unit!==n.unit?new t(NaN,""):new t(this.num+n.num,this.unit)}},{key:"subtract",value:function(n){return this.unit!==n.unit?new t(NaN,""):new t(this.num-n.num,this.unit)}},{key:"multiply",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new t(NaN,""):new t(this.num*n.num,this.unit||n.unit)}},{key:"divide",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new t(NaN,""):new t(this.num/n.num,this.unit||n.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(n){var r,i=(r=UAe.exec(n))!==null&&r!==void 0?r:[],a=Pb(i,3),s=a[1],o=a[2];return new t(parseFloat(s),o??"")}}])}();function ZH(t){if(t.includes(yd))return yd;for(var e=t;e.includes("*")||e.includes("/");){var n,r=(n=kI.exec(e))!==null&&n!==void 0?n:[],i=Pb(r,4),a=i[1],s=i[2],o=i[3],c=hy.parse(a??""),u=hy.parse(o??""),d=s==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return yd;e=e.replace(kI,d.toString())}for(;e.includes("+")||/.-\d+(?:\.\d+)?/.test(e);){var h,f=(h=_I.exec(e))!==null&&h!==void 0?h:[],p=Pb(f,4),g=p[1],m=p[2],v=p[3],x=hy.parse(g??""),w=hy.parse(v??""),y=m==="+"?x.add(w):x.subtract(w);if(y.isNaN())return yd;e=e.replace(_I,y.toString())}return e}var CI=/\(([^()]*)\)/;function VAe(t){for(var e=t;e.includes("(");){var n=CI.exec(e),r=Pb(n,2),i=r[1];e=e.replace(CI,ZH(i))}return e}function HAe(t){var e=t.replace(/\s+/g,"");return e=VAe(e),e=ZH(e),e}function qAe(t){try{return HAe(t)}catch{return yd}}function Nk(t){var e=qAe(t.slice(5,-1));return e===yd?"":e}var KAe=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],GAe=["dx","dy","angle","className","breakAll"];function VT(){return VT=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},VT.apply(this,arguments)}function TI(t,e){if(t==null)return{};var n=YAe(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function YAe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function EI(t,e){return QAe(t)||ZAe(t,e)||XAe(t,e)||JAe()}
905function JAe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 906In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function XAe(t,e){if(t){if(typeof t=="string")return jI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jI(t,e)}}function jI(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ZAe(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,o=[],c=!0,u=!1;try{if(a=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function QAe(t){if(Array.isArray(t))return t}var QH=/[ \f\n\r\t\v\u2028\u2029]+/,eq=function(e){var n=e.children,r=e.breakAll,i=e.style;try{var a=[];ut(n)||(r?a=n.toString().split(""):a=n.toString().split(QH));var s=a.map(function(c){return{word:c,width:Yp(c,i).width}}),o=r?0:Yp(" ",i).width;return{wordsWithComputedWidth:s,spaceWidth:o}}catch{return null}},eOe=function(e,n,r,i,a){var s=e.maxLines,o=e.children,c=e.style,u=e.breakAll,d=Ce(s),h=o,f=function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return B.reduce(function($,I){var R=I.word,z=I.width,O=$[$.length-1];if(O&&(i==null||a||O.width+z+r<Number(i)))O.words.push(R),O.width+=z+r;else{var A={words:[R],width:z};$.push(A)}return $},[])},p=f(n),g=function(B){return B.reduce(function($,I){return $.width>I.width?$:I})};if(!d)return p;for(var m="â¦",v=function(B){var $=h.slice(0,B),I=eq({breakAll:u,style:c,children:$+m}).wordsWithComputedWidth,R=f(I),z=R.length>s||g(R).width>Number(i);return[z,R]},x=0,w=h.length-1,y=0,k;x<=w&&y<=h.length-1;){var S=Math.floor((x+w)/2),_=S-1,C=v(_),T=EI(C,2),E=T[0],j=T[1],P=v(S),M=EI(P,1),U=M[0];if(!E&&!U&&(x=S+1),E&&U&&(w=S-1),!E&&U){k=j;break}y++}return k||p},PI=function(e){var n=ut(e)?[]:e.toString().split(QH);return[{words:n}]},tOe=function(e){var n=e.width,r=e.scaleToFit,i=e.children,a=e.style,s=e.breakAll,o=e.maxLines;if((n||r)&&!xs.isSsr){var c,u,d=eq({breakAll:s,children:i,style:a});if(d){var h=d.wordsWithComputedWidth,f=d.spaceWidth;c=h,u=f}else return PI(i);return eOe({breakAll:s,children:i,maxLines:o,style:a},c,u,n,r)}return PI(i)},NI="#808080",pu=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,a=i===void 0?0:i,s=e.lineHeight,o=s===void 0?"1em":s,c=e.capHeight,u=c===void 0?"0.71em":c,d=e.scaleToFit,h=d===void 0?!1:d,f=e.textAnchor,p=f===void 0?"start":f,g=e.verticalAnchor,m=g===void 0?"end":g,v=e.fill,x=v===void 0?NI:v,w=TI(e,KAe),y=b.useMemo(function(){return tOe({breakAll:w.breakAll,children:w.children,maxLines:w.maxLines,scaleToFit:h,style:w.style,width:w.width})},[w.breakAll,w.children,w.maxLines,h,w.style,w.width]),k=w.dx,S=w.dy,_=w.angle,C=w.className,T=w.breakAll,E=TI(w,GAe);if(!nr(r)||!nr(a))return null;var j=r+(Ce(k)?k:0),P=a+(Ce(S)?S:0),M;switch(m){case"start":M=Nk("calc(".concat(u,")"));break;case"middle":M=Nk("calc(".concat((y.length-1)/2," * -").concat(o," + (").concat(u," / 2))"));break;default:M=Nk("calc(".concat(y.length-1," * -").concat(o,")"));break}var U=[];if(h){var N=y[0].width,B=w.width;U.push("scale(".concat((Ce(B)?B/N:1)/N,")"))}return _&&U.push("rotate(".concat(_,", ").concat(j,", ").concat(P,")")),U.length&&(E.transform=U.join(" ")),D.createElement("text",VT({},Ye(E,!0),{x:j,y:P,className:pt("recharts-text",C),textAnchor:p,fill:x.includes("url")?NI:x}),y.map(function($,I){var R=$.words.join(T?"":" ");return D.createElement("tspan",{x:j,dy:I===0?M:o,key:"".concat(R,"-").concat(I)},R)}))};function Tc(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function nOe(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function TN(t){let e,n,r;t.length!==2?(e=Tc,n=(o,c)=>Tc(t(o),c),r=(o,c)=>t(o)-c):(e=t===Tc||t===nOe?t:rOe,n=t,r=t);function i(o,c,u=0,d=o.length){if(u<d){if(e(c,c)!==0)return d;do{const h=u+d>>>1;n(o[h],c)<0?u=h+1:d=h}while(u<d)}return u}function a(o,c,u=0,d=o.length){if(u<d){if(e(c,c)!==0)return d;do{const h=u+d>>>1;n(o[h],c)<=0?u=h+1:d=h}while(u<d)}return u}function s(o,c,u=0,d=o.length){const h=i(o,c,u,d-1);return h>u&&r(o[h-1],c)>-r(o[h],c)?h-1:h}return{left:i,center:s,right:a}}function rOe(){return 0}function tq(t){return t===null?NaN:+t}function*iOe(t,e){for(let n of t)n!=null&&(n=+n)>=n&&(yield n)}const aOe=TN(Tc),lv=aOe.right;TN(tq).center;class AI extends Map{constructor(e,n=cOe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,i]of e)this.set(r,i)}get(e){return super.get(OI(this,e))}has(e){return super.has(OI(this,e))}set(e,n){return super.set(sOe(this,e),n)}delete(e){return super.delete(oOe(this,e))}}function OI({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function sOe({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function oOe({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function cOe(t){return t!==null&&typeof t=="object"?t.valueOf():t}
906function lOe(t=Tc){if(t===Tc)return nq;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||r===0?r:(t(n,n)===0)-(t(e,e)===0)}}function nq(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(t<e?-1:t>e?1:0)}const uOe=Math.sqrt(50),dOe=Math.sqrt(10),hOe=Math.sqrt(2);function Nb(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),s=a>=uOe?10:a>=dOe?5:a>=hOe?2:1;let o,c,u;return i<0?(u=Math.pow(10,-i)/s,o=Math.round(t*u),c=Math.round(e*u),o/u<t&&++o,c/u>e&&--c,u=-u):(u=Math.pow(10,i)*s,o=Math.round(t/u),c=Math.round(e/u),o*u<t&&++o,c*u>e&&--c),c<o&&.5<=n&&n<2?Nb(t,e,n*2):[o,c,u]}function HT(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const r=e<t,[i,a,s]=r?Nb(e,t,n):Nb(t,e,n);if(!(a>=i))return[];const o=a-i+1,c=new Array(o);if(r)if(s<0)for(let u=0;u<o;++u)c[u]=(a-u)/-s;else for(let u=0;u<o;++u)c[u]=(a-u)*s;else if(s<0)for(let u=0;u<o;++u)c[u]=(i+u)/-s;else for(let u=0;u<o;++u)c[u]=(i+u)*s;return c}function qT(t,e,n){return e=+e,t=+t,n=+n,Nb(t,e,n)[2]}function KT(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?qT(e,t,n):qT(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function RI(t,e){let n;for(const r of t)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function DI(t,e){let n;for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function rq(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=i===void 0?nq:lOe(i);r>n;){if(r-n>600){const c=r-n+1,u=e-n+1,d=Math.log(c),h=.5*Math.exp(2*d/3),f=.5*Math.sqrt(d*h*(c-h)/c)*(u-c/2<0?-1:1),p=Math.max(n,Math.floor(e-u*h/c+f)),g=Math.min(r,Math.floor(e+(c-u)*h/c+f));rq(t,e,p,g,i)}const a=t[e];let s=n,o=r;for(cp(t,n,e),i(t[r],a)>0&&cp(t,n,r);s<o;){for(cp(t,s,o),++s,--o;i(t[s],a)<0;)++s;for(;i(t[o],a)>0;)--o}i(t[n],a)===0?cp(t,n,o):(++o,cp(t,o,r)),o<=e&&(n=o+1),e<=o&&(r=o-1)}return t}function cp(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function fOe(t,e,n){if(t=Float64Array.from(iOe(t)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return DI(t);if(e>=1)return RI(t);var r,i=(r-1)*e,a=Math.floor(i),s=RI(rq(t,a).subarray(0,a+1)),o=DI(t.subarray(a+1));return s+(o-s)*(i-a)}}function pOe(t,e,n=tq){if(!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,a=Math.floor(i),s=+n(t[a],a,t),o=+n(t[a+1],a+1,t);return s+(o-s)*(i-a)}}function mOe(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,a=new Array(i);++r<i;)a[r]=t+r*n;return a}function ha(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function Eo(t,e){switch(arguments.length){case 0:break;case 1:{typeof t=="function"?this.interpolator(t):this.range(t);break}default:{this.domain(t),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}const GT=Symbol("implicit");function EN(){var t=new AI,e=[],n=[],r=GT;function i(a){let s=t.get(a);if(s===void 0){if(r!==GT)return r;t.set(a,s=e.push(a)-1)}return n[s%n.length]}return i.domain=function(a){if(!arguments.length)return e.slice();e=[],t=new AI;for(const s of a)t.has(s)||t.set(s,e.push(s)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return EN(e,n).unknown(r)},ha.apply(i,arguments),i}function ag(){var t=EN().unknown(void 0),e=t.domain,n=t.range,r=0,i=1,a,s,o=!1,c=0,u=0,d=.5;delete t.unknown;function h(){var f=e().length,p=i<r,g=p?i:r,m=p?r:i;a=(m-g)/Math.max(1,f-c+u*2),o&&(a=Math.floor(a)),g+=(m-g-a*(f-c))*d,s=a*(1-c),o&&(g=Math.round(g),s=Math.round(s));var v=mOe(f).map(function(x){return g+a*x});return n(p?v.reverse():v)}return t.domain=function(f){return arguments.length?(e(f),h()):e()},t.range=function(f){return arguments.length?([r,i]=f,r=+r,i=+i,h()):[r,i]},t.rangeRound=function(f){return[r,i]=f,r=+r,i=+i,o=!0,h()},t.bandwidth=function(){return s},t.step=function(){return a},t.round=function(f){return arguments.length?(o=!!f,h()):o},t.padding=function(f){return arguments.length?(c=Math.min(1,u=+f),h()):c},t.paddingInner=function(f){return arguments.length?(c=Math.min(1,f),h()):c},t.paddingOuter=function(f){return arguments.length?(u=+f,h()):u},t.align=function(f){return arguments.length?(d=Math.max(0,Math.min(1,f)),h()):d},t.copy=function(){return ag(e(),[r,i]).round(o).paddingInner(c).paddingOuter(u).align(d)},ha.apply(h(),arguments)}function iq(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return iq(e())},t}function Jp(){return iq(ag.apply(null,arguments).paddingInner(1))}function jN(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function aq(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function uv(){}var sg=.7,Ab=1/sg,Hd="\\s*([+-]?\\d+)\\s*",og="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ws="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",gOe=/^#([0-9a-f]{3,8})$/,vOe=new RegExp(`^rgb\\(${Hd},${Hd},${Hd}\\)$`),yOe=new RegExp(`^rgb\\(${ws},${ws},${ws}\\)$`),bOe=new RegExp(`^rgba\\(${Hd},${Hd},${Hd},${og}\\)$`),xOe=new RegExp(`^rgba\\(${ws},${ws},${ws},${og}\\)$`),wOe=new RegExp(`^hsl\\(${og},${ws},${ws}\\)$`),SOe=new RegExp(`^hsla\\(${og},${ws},${ws},${og}\\)$`),MI={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};jN(uv,cg,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:II,formatHex:II,formatHex8:kOe,formatHsl:_Oe,formatRgb:LI,toString:LI});function II(){return this.rgb().formatHex()}function kOe(){return this.rgb().formatHex8()}function _Oe(){return sq(this).formatHsl()}function LI(){return this.rgb().formatRgb()}function cg(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=gOe.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?$I(e):n===3?new ri(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?fy(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?fy(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=vOe.exec(t))?new ri(e[1],e[2],e[3],1):(e=yOe.exec(t))?new ri(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=bOe.exec(t))?fy(e[1],e[2],e[3],e[4]):(e=xOe.exec(t))?fy(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=wOe.exec(t))?UI(e[1],e[2]/100,e[3]/100,1):(e=SOe.exec(t))?UI(e[1],e[2]/100,e[3]/100,e[4]):MI.hasOwnProperty(t)?$I(MI[t]):t==="transparent"?new ri(NaN,NaN,NaN,0):null}function $I(t){return new ri(t>>16&255,t>>8&255,t&255,1)}function fy(t,e,n,r){return r<=0&&(t=e=n=NaN),new ri(t,e,n,r)}function COe(t){return t instanceof uv||(t=cg(t)),t?(t=t.rgb(),new ri(t.r,t.g,t.b,t.opacity)):new ri}function YT(t,e,n,r){return arguments.length===1?COe(t):new ri(t,e,n,r??1)}function ri(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}jN(ri,YT,aq(uv,{brighter(t){return t=t==null?Ab:Math.pow(Ab,t),new ri(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?sg:Math.pow(sg,t),new ri(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ri(Hl(this.r),Hl(this.g),Hl(this.b),Ob(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:FI,formatHex:FI,formatHex8:TOe,formatRgb:BI,toString:BI}));function FI(){return`#${Al(this.r)}${Al(this.g)}${Al(this.b)}`}function TOe(){return`#${Al(this.r)}${Al(this.g)}${Al(this.b)}${Al((isNaN(this.opacity)?1:this.opacity)*255)}`}function BI(){const t=Ob(this.opacity);return`${t===1?"rgb(":"rgba("}${Hl(this.r)}, ${Hl(this.g)}, ${Hl(this.b)}${t===1?")":`, ${t})`}`}function Ob(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Hl(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Al(t){return t=Hl(t),(t<16?"0":"")+t.toString(16)}function UI(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Ba(t,e,n,r)}function sq(t){if(t instanceof Ba)return new Ba(t.h,t.s,t.l,t.opacity);if(t instanceof uv||(t=cg(t)),!t)return new Ba;if(t instanceof Ba)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),s=NaN,o=a-i,c=(a+i)/2;return o?(e===a?s=(n-r)/o+(n<r)*6:n===a?s=(r-e)/o+2:s=(e-n)/o+4,o/=c<.5?a+i:2-a-i,s*=60):o=c>0&&c<1?0:s,new Ba(s,o,c,t.opacity)}function EOe(t,e,n,r){return arguments.length===1?sq(t):new Ba(t,e,n,r??1)}function Ba(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}jN(Ba,EOe,aq(uv,{brighter(t){return t=t==null?Ab:Math.pow(Ab,t),new Ba(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?sg:Math.pow(sg,t),new Ba(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new ri(Ak(t>
vendor: 4,184 bytes, line 906
906=240?t-240:t+120,i,r),Ak(t,i,r),Ak(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Ba(zI(this.h),py(this.s),py(this.l),Ob(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Ob(this.opacity);return`${t===1?"hsl(":"hsla("}${zI(this.h)}, ${py(this.s)*100}%, ${py(this.l)*100}%${t===1?")":`, ${t})`}`}}));function zI(t){return t=(t||0)%360,t<0?t+360:t}function py(t){return Math.max(0,Math.min(1,t||0))}function Ak(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const PN=t=>()=>t;function jOe(t,e){return function(n){return t+n*e}}function POe(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function NOe(t){return(t=+t)==1?oq:function(e,n){return n-e?POe(e,n,t):PN(isNaN(e)?n:e)}}function oq(t,e){var n=e-t;return n?jOe(t,n):PN(isNaN(t)?e:t)}const WI=function t(e){var n=NOe(e);function r(i,a){var s=n((i=YT(i)).r,(a=YT(a)).r),o=n(i.g,a.g),c=n(i.b,a.b),u=oq(i.opacity,a.opacity);return function(d){return i.r=s(d),i.g=o(d),i.b=c(d),i.opacity=u(d),i+""}}return r.gamma=t,r}(1);function AOe(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=t[i]*(1-a)+e[i]*a;return r}}function OOe(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function ROe(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),a=new Array(n),s;for(s=0;s<r;++s)i[s]=Rf(t[s],e[s]);for(;s<n;++s)a[s]=e[s];return function(o){for(s=0;s<r;++s)a[s]=i[s](o);return a}}function DOe(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function Rb(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function MOe(t,e){var n={},r={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=Rf(t[i],e[i]):r[i]=e[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var JT=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ok=new RegExp(JT.source,"g");function IOe(t){return function(){return t}}function LOe(t){return function(e){return t(e)+""}}function $Oe(t,e){var n=JT.lastIndex=Ok.lastIndex=0,r,i,a,s=-1,o=[],c=[];for(t=t+"",e=e+"";(r=JT.exec(t))&&(i=Ok.exec(e));)(a=i.index)>n&&(a=e.slice(n,a),o[s]?o[s]+=a:o[++s]=a),(r=r[0])===(i=i[0])?o[s]?o[s]+=i:o[++s]=i:(o[++s]=null,c.push({i:s,x:Rb(r,i)})),n=Ok.lastIndex;return n<e.length&&(a=e.slice(n),o[s]?o[s]+=a:o[++s]=a),o.length<2?c[0]?LOe(c[0].x):IOe(e):(e=c.length,function(u){for(var d=0,h;d<e;++d)o[(h=c[d]).i]=h.x(u);return o.join("")})}function Rf(t,e){var n=typeof e,r;return e==null||n==="boolean"?PN(e):(n==="number"?Rb:n==="string"?(r=cg(e))?(e=r,WI):$Oe:e instanceof cg?WI:e instanceof Date?DOe:OOe(e)?AOe:Array.isArray(e)?ROe:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?MOe:Rb)(t,e)}function NN(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function FOe(t,e){e===void 0&&(e=t,t=Rf);for(var n=0,r=e.length-1,i=e[0],a=new Array(r<0?0:r);n<r;)a[n]=t(i,i=e[++n]);return function(s){var o=Math.max(0,Math.min(r-1,Math.floor(s*=r)));return a[o](s-o)}}function BOe(t){return function(){return t}}function Db(t){return+t}var VI=[0,1];function Vr(t){return t}function XT(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:BOe(isNaN(e)?NaN:.5)}function UOe(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function zOe(t,e,n){var r=t[0],i=t[1],a=e[0],s=e[1];return i<r?(r=XT(i,r),a=n(s,a)):(r=XT(r,i),a=n(a,s)),function(o){return a(r(o))}}function WOe(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),a=new Array(r),s=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<r;)i[s]=XT(t[s],t[s+1]),a[s]=n(e[s],e[s+1]);return function(o){var c=lv(t,o,1,r)-1;return a[c](i[c](o))}}function dv(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function u1(){var t=VI,e=VI,n=Rf,r,i,a,s=Vr,o,c,u;function d(){var f=Math.min(t.length,e.length);return s!==Vr&&(s=UOe(t[0],t[f-1])),o=f>2?WOe:zOe,c=u=null,h}function h(f){return f==null||isNaN(f=+f)?a:(c||(c=o(t.map(r),e,n)))(r(s(f)))}
vendor: 5,793 bytes, line 906
906return h.invert=function(f){return s(i((u||(u=o(e,t.map(r),Rb)))(f)))},h.domain=function(f){return arguments.length?(t=Array.from(f,Db),d()):t.slice()},h.range=function(f){return arguments.length?(e=Array.from(f),d()):e.slice()},h.rangeRound=function(f){return e=Array.from(f),n=NN,d()},h.clamp=function(f){return arguments.length?(s=f?!0:Vr,d()):s!==Vr},h.interpolate=function(f){return arguments.length?(n=f,d()):n},h.unknown=function(f){return arguments.length?(a=f,h):a},function(f,p){return r=f,i=p,d()}}function AN(){return u1()(Vr,Vr)}function VOe(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Mb(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function $h(t){return t=Mb(Math.abs(t)),t?t[1]:NaN}function HOe(t,e){return function(n,r){for(var i=n.length,a=[],s=0,o=t[0],c=0;i>0&&o>0&&(c+o+1>r&&(o=Math.max(1,r-c)),a.push(n.substring(i-=o,i+o)),!((c+=o+1)>r));)o=t[s=(s+1)%t.length];return a.reverse().join(e)}}function qOe(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var KOe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function lg(t){if(!(e=KOe.exec(t)))throw new Error("invalid format: "+t);var e;return new ON({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}lg.prototype=ON.prototype;function ON(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}ON.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function GOe(t){e:for(var e=t.length,n=1,r=-1,i;n<e;++n)switch(t[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+t[n])break e;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var cq;function YOe(t,e){var n=Mb(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(cq=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return a===s?r:a>s?r+new Array(a-s+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Mb(t,Math.max(0,e+a-1))[0]}function HI(t,e){var n=Mb(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const qI={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:VOe,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>HI(t*100,e),r:HI,s:YOe,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function KI(t){return t}var GI=Array.prototype.map,YI=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function JOe(t){var e=t.grouping===void 0||t.thousands===void 0?KI:HOe(GI.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?KI:qOe(GI.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",o=t.minus===void 0?"â":t.minus+"",c=t.nan===void 0?"NaN":t.nan+"";function u(h){h=lg(h);var f=h.fill,p=h.align,g=h.sign,m=h.symbol,v=h.zero,x=h.width,w=h.comma,y=h.precision,k=h.trim,S=h.type;S==="n"?(w=!0,S="g"):qI[S]||(y===void 0&&(y=12),k=!0,S="g"),(v||f==="0"&&p==="=")&&(v=!0,f="0",p="=");var _=m==="$"?n:m==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",C=m==="$"?r:/[%p]/.test(S)?s:"",T=qI[S],E=/[defgprs%]/.test(S);y=y===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y));function j(P){var M=_,U=C,N,B,$;if(S==="c")U=T(P)+U,P="";else{P=+P;var I=P<0||1/P<0;if(P=isNaN(P)?c:T(Math.abs(P),y),k&&(P=GOe(P)),I&&+P==0&&g!=="+"&&(I=!1),M=(I?g==="("?g:o:g==="-"||g==="("?"":g)+M,U=(S==="s"?YI[8+cq/3]:"")+U+(I&&g==="("?")":""),E){for(N=-1,B=P.length;++N<B;)if($=P.charCodeAt(N),48>$||$>57){U=($===46?i+P.slice(N+1):P.slice(N))+U,P=P.slice(0,N);break}}}w&&!v&&(P=e(P,1/0));var R=M.length+P.length+U.length,z=R<x?new Array(x-R+1).join(f):"";switch(w&&v&&(P=e(z+P,z.length?x-U.length:1/0),z=""),p){case"<":P=M+P+U+z;break;case"=":P=M+z+P+U;break;case"^":P=z.slice(0,R=z.length>>1)+M+P+U+z.slice(R);break;default:P=z+M+P+U;break}return a(P)}return j.toString=function(){return h+""},j}function d(h,f){var p=u((h=lg(h),h.type="f",h)),g=Math.max(-8,Math.min(8,Math.floor($h(f)/3)))*3,m=Math.pow(10,-g),v=YI[8+g/3];return function(x){return p(m*x)+v}}return{format:u,formatPrefix:d}}var my,RN,lq;XOe({thousands:",",grouping:[3],currency:["$",""]});function XOe(t){return my=JOe(t),RN=my.format,lq=my.formatPrefix,my}function ZOe(t){return Math.max(0,-$h(Math.abs(t)))}function QOe(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor($h(e)/3)))*3-$h(Math.abs(t)))}function eRe(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,$h(e)-$h(t))+1}function uq(t,e,n,r){var i=KT(t,e,n),a;switch(r=lg(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(a=QOe(i,s))&&(r.precision=a),lq(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=eRe(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=ZOe(i))&&(r.precision=a-(r.type==="%")*2);break}}return RN(r)}
vendor: 4,244 bytes, line 906
906function Jc(t){var e=t.domain;return t.ticks=function(n){var r=e();return HT(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return uq(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,a=r.length-1,s=r[i],o=r[a],c,u,d=10;for(o<s&&(u=s,s=o,o=u,u=i,i=a,a=u);d-- >0;){if(u=qT(s,o,n),u===c)return r[i]=s,r[a]=o,e(r);if(u>0)s=Math.floor(s/u)*u,o=Math.ceil(o/u)*u;else if(u<0)s=Math.ceil(s*u)/u,o=Math.floor(o*u)/u;else break;c=u}return t},t}function Ib(){var t=AN();return t.copy=function(){return dv(t,Ib())},ha.apply(t,arguments),Jc(t)}function dq(t){var e;function n(r){return r==null||isNaN(r=+r)?e:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(t=Array.from(r,Db),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return dq(t).unknown(e)},t=arguments.length?Array.from(t,Db):[0,1],Jc(n)}function hq(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],a=t[r],s;return a<i&&(s=n,n=r,r=s,s=i,i=a,a=s),t[n]=e.floor(i),t[r]=e.ceil(a),t}function JI(t){return Math.log(t)}function XI(t){return Math.exp(t)}function tRe(t){return-Math.log(-t)}function nRe(t){return-Math.exp(-t)}function rRe(t){return isFinite(t)?+("1e"+t):t<0?0:t}function iRe(t){return t===10?rRe:t===Math.E?Math.exp:e=>Math.pow(t,e)}function aRe(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function ZI(t){return(e,n)=>-t(-e,n)}function DN(t){const e=t(JI,XI),n=e.domain;let r=10,i,a;function s(){return i=aRe(r),a=iRe(r),n()[0]<0?(i=ZI(i),a=ZI(a),t(tRe,nRe)):t(JI,XI),e}return e.base=function(o){return arguments.length?(r=+o,s()):r},e.domain=function(o){return arguments.length?(n(o),s()):n()},e.ticks=o=>{const c=n();let u=c[0],d=c[c.length-1];const h=d<u;h&&([u,d]=[d,u]);let f=i(u),p=i(d),g,m;const v=o==null?10:+o;let x=[];if(!(r%1)&&p-f<v){if(f=Math.floor(f),p=Math.ceil(p),u>0){for(;f<=p;++f)for(g=1;g<r;++g)if(m=f<0?g/a(-f):g*a(f),!(m<u)){if(m>d)break;x.push(m)}}else for(;f<=p;++f)for(g=r-1;g>=1;--g)if(m=f>0?g/a(-f):g*a(f),!(m<u)){if(m>d)break;x.push(m)}x.length*2<v&&(x=HT(u,d,v))}else x=HT(f,p,Math.min(p-f,v)).map(a);return h?x.reverse():x},e.tickFormat=(o,c)=>{if(o==null&&(o=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=lg(c)).precision==null&&(c.trim=!0),c=RN(c)),o===1/0)return c;const u=Math.max(1,r*o/e.ticks().length);return d=>{let h=d/a(Math.round(i(d)));return h*r<r-.5&&(h*=r),h<=u?c(d):""}},e.nice=()=>n(hq(n(),{floor:o=>a(Math.floor(i(o))),ceil:o=>a(Math.ceil(i(o)))})),e}function fq(){const t=DN(u1()).domain([1,10]);return t.copy=()=>dv(t,fq()).base(t.base()),ha.apply(t,arguments),t}function QI(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function e3(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function MN(t){var e=1,n=t(QI(e),e3(e));return n.constant=function(r){return arguments.length?t(QI(e=+r),e3(e)):e},Jc(n)}function pq(){var t=MN(u1());return t.copy=function(){return dv(t,pq()).constant(t.constant())},ha.apply(t,arguments)}function t3(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function sRe(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function oRe(t){return t<0?-t*t:t*t}function IN(t){var e=t(Vr,Vr),n=1;function r(){return n===1?t(Vr,Vr):n===.5?t(sRe,oRe):t(t3(n),t3(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},Jc(e)}function LN(){var t=IN(u1());return t.copy=function(){return dv(t,LN()).exponent(t.exponent())},ha.apply(t,arguments),t}function cRe(){return LN.apply(null,arguments).exponent(.5)}function n3(t){return Math.sign(t)*t*t}function lRe(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function mq(){var t=AN(),e=[0,1],n=!1,r;function i(a){var s=lRe(t(a));return isNaN(s)?r:n?Math.round(s):s}return i.invert=function(a){return t.invert(n3(a))},i.domain=function(a){return arguments.length?(t.domain(a),i):t.domain()},i.range=function(a){return arguments.length?(t.range((e=Array.from(a,Db)).map(n3)),i):e.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(n=!!a,i):n},i.clamp=function(a){return arguments.length?(t.clamp(a),i):t.clamp()},i.unknown=function(a){return arguments.length?(r=a,i):r}
906,i.copy=function(){return mq(t.domain(),e).round(n).clamp(t.clamp()).unknown(r)},ha.apply(i,arguments),Jc(i)}function gq(){var t=[],e=[],n=[],r;function i(){var s=0,o=Math.max(1,e.length);for(n=new Array(o-1);++s<o;)n[s-1]=pOe(t,s/o);return a}function a(s){return s==null||isNaN(s=+s)?r:e[lv(n,s)]}return a.invertExtent=function(s){var o=e.indexOf(s);return o<0?[NaN,NaN]:[o>0?n[o-1]:t[0],o<n.length?n[o]:t[t.length-1]]},a.domain=function(s){if(!arguments.length)return t.slice();t=[];for(let o of s)o!=null&&!isNaN(o=+o)&&t.push(o);return t.sort(Tc),i()},a.range=function(s){return arguments.length?(e=Array.from(s),i()):e.slice()},a.unknown=function(s){return arguments.length?(r=s,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return gq().domain(t).range(e).unknown(r)},ha.apply(a,arguments)}function vq(){var t=0,e=1,n=1,r=[.5],i=[0,1],a;function s(c){return c!=null&&c<=c?i[lv(r,c,0,n)]:a}function o(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*e-(c-n)*t)/(n+1);return s}return s.domain=function(c){return arguments.length?([t,e]=c,t=+t,e=+e,o()):[t,e]},s.range=function(c){return arguments.length?(n=(i=Array.from(c)).length-1,o()):i.slice()},s.invertExtent=function(c){var u=i.indexOf(c);return u<0?[NaN,NaN]:u<1?[t,r[0]]:u>=n?[r[n-1],e]:[r[u-1],r[u]]},s.unknown=function(c){return arguments.length&&(a=c),s},s.thresholds=function(){return r.slice()},s.copy=function(){return vq().domain([t,e]).range(i).unknown(a)},ha.apply(Jc(s),arguments)}function yq(){var t=[.5],e=[0,1],n,r=1;function i(a){return a!=null&&a<=a?e[lv(t,a,0,r)]:n}return i.domain=function(a){return arguments.length?(t=Array.from(a),r=Math.min(t.length,e.length-1),i):t.slice()},i.range=function(a){return arguments.length?(e=Array.from(a),r=Math.min(t.length,e.length-1),i):e.slice()},i.invertExtent=function(a){var s=e.indexOf(a);return[t[s-1],t[s]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return yq().domain(t).range(e).unknown(n)},ha.apply(i,arguments)}const Rk=new Date,Dk=new Date;function ir(t,e,n,r){function i(a){return t(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{const s=i(a),o=i.ceil(a);return a-s<o-a?s:o},i.offset=(a,s)=>(e(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,o)=>{const c=[];if(a=i.ceil(a),o=o==null?1:Math.floor(o),!(a<s)||!(o>0))return c;let u;do c.push(u=new Date(+a)),e(a,o),t(a);while(u<a&&a<s);return c},i.filter=a=>ir(s=>{if(s>=s)for(;t(s),!a(s);)s.setTime(s-1)},(s,o)=>{if(s>=s)if(o<0)for(;++o<=0;)for(;e(s,-1),!a(s););else for(;--o>=0;)for(;e(s,1),!a(s););}),n&&(i.count=(a,s)=>(Rk.setTime(+a),Dk.setTime(+s),t(Rk),t(Dk),Math.floor(n(Rk,Dk))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?s=>r(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const Lb=ir(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Lb.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?ir(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Lb);Lb.range;const io=1e3,Xi=io*60,ao=Xi*60,xo=ao*24,$N=xo*7,r3=xo*30,Mk=xo*365,Ol=ir(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*io)},(t,e)=>(e-t)/io,t=>t.getUTCSeconds());Ol.range;const FN=ir(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*io)},(t,e)=>{t.setTime(+t+e*Xi)},(t,e)=>(e-t)/Xi,t=>t.getMinutes());FN.range;const BN=ir(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Xi)},(t,e)=>(e-t)/Xi,t=>t.getUTCMinutes());BN.range;const UN=ir(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*io-t.getMinutes()*Xi)},(t,e)=>{t.setTime(+t+e*ao)},(t,e)=>(e-t)/ao,t=>t.getHours());UN.range;const zN=ir(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*ao)},(t,e)=>(e-t)/ao,t=>t.getUTCHours());zN.range;const hv=ir(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Xi)/xo,t=>t.getDate()-1);hv.range;const d1=ir(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/xo,t=>t.getUTCDate()-1);d1.range;const bq=ir(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/xo,t=>Math.floor(t/xo));bq.range;function _u(t){return ir(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*Xi)/$N)}const h1=_u(0),$b=_u(1),uRe=_u(2),dRe=_u(3),Fh=_u(4),hRe=_u(5),fRe=_u(6);h1.range;$b.range;uRe.range;dRe.range;Fh.range;hRe.range;fRe.range;function Cu(t){return ir(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/$N)}const f1=Cu(0),Fb=Cu(1),pRe=Cu(2),mRe=Cu(3),Bh=Cu(4),gRe=Cu(5),vRe=Cu(6);f1.range;Fb.range;pRe.range;mRe.range;Bh.range;gRe.range;vRe.range;const WN=ir(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());WN.range;const VN=ir(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());VN.range;const wo=ir(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());wo.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ir(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});wo.range;const So=ir(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());So.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ir(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});So.range;function xq(t,e,n,r,i,a){const s=[[Ol,1,io],[Ol,5,5*io],[Ol,15,15*io],[Ol,30,30*io],[a,1,Xi],[a,5,5*Xi],[a,15,15*Xi],[a,30,30*Xi],[i,1,ao],[i,3,3*ao],[i,6,6*ao],[i,12,12*ao],[r,1,xo],[r,2,2*xo],[n,1,$N],[e,1,r3],[e,3,3*r3],[t,1,Mk]];function o(u,d,h){const f=d<u;f&&([u,d]=[d,u]);const p=h&&typeof h.range=="function"?h:c(u,d,h),g=p?p.range(u,+d+1):[];return f?g.reverse():g}function c(u,d,h){const f=Math.abs(d-u)/h,p=TN(([,,v])=>v).right(s,f);if(p===s.length)return t.every(KT(u/Mk,d/Mk,h));if(p===0)return Lb.every(Math.max(KT(u,d,h),1));const[g,m]=s[f/s[p-1][2]<s[p][2]/f?p-1:p];return g.every(m)}return[o,c]}const[yRe,bRe]=xq(So,VN,f1,bq,zN,BN),[xRe,wRe]=xq(wo,WN,h1,hv,UN,FN);function Ik(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Lk(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function lp(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function SRe(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,a=t.days,s=t.shortDays,o=t.months,c=t.shortMonths,u=up(i),d=dp(i),h=up(a),f=dp(a),p=up(s),g=dp(s),m=up(o),v=dp(o),x=up(c),w=dp(c),y={a:I,A:R,b:z,B:O,c:null,d:l3,e:l3,f:HRe,g:tDe,G:rDe,H:zRe,I:WRe,j:VRe,L:wq,m:qRe,M:KRe,p:A,q:L,Q:h3,s:f3,S:GRe,u:YRe,U:JRe,V:XRe,w:ZRe,W:QRe,x:null,X:null,y:eDe,Y:nDe,Z:iDe,"%":d3},k={a:V,A:Y,b:Q,B:re,c:null,d:u3,e:u3,f:cDe,g:yDe,G:xDe,H:aDe,I:sDe,j:oDe,L:kq,m:lDe,M:uDe,p:J,q:ne,Q:h3,s:f3,S:dDe,u:hDe,U:fDe,V:pDe,w:mDe,W:gDe,x:null,X:null,y:vDe,Y:bDe,Z:wDe,"%":d3},S={a:j,A:P,b:M,B:U,c:N,d:o3,e:o3,f:$Re,g:s3,G:a3,H:c3,I:c3,j:DRe,L:LRe,m:RRe,M:MRe,p:E,q:ORe,Q:BRe,s:URe,S:IRe,u:ERe,U:jRe,V:PRe,w:TRe,W:NRe,x:B,X:$,y:s3,Y:a3,Z:ARe,"%":FRe};y.x=_(n,y),y.X=_(r,y),y.c=_(e,y),k.x=_(n,k),k.X=_(r,k),k.c=_(e,k);function _(G,Z){return function(ee){var K=[],oe=-1,W=0,H=G.length,q,te,he;for(ee instanceof Date||(ee=new Date(+ee));++oe<H;)G.charCodeAt(oe)===37&&(K.push(G.slice(W,oe)),(te=i3[q=G.charAt(++oe)])!=null?q=G.charAt(++oe):te=q==="e"?" ":"0",(he=Z[q])&&(q=he(ee,te)),K.push(q),W=oe+1);return K.push(G.slice(W,oe)),K.join("")}}function C(G,Z){return function(ee){var K=lp(1900,void 0,1),oe=T(K,G,ee+="",0),W,H;
vendor: 7,207 bytes, line 906
906if(oe!=ee.length)return null;if("Q"in K)return new Date(K.Q);if("s"in K)return new Date(K.s*1e3+("L"in K?K.L:0));if(Z&&!("Z"in K)&&(K.Z=0),"p"in K&&(K.H=K.H%12+K.p*12),K.m===void 0&&(K.m="q"in K?K.q:0),"V"in K){if(K.V<1||K.V>53)return null;"w"in K||(K.w=1),"Z"in K?(W=Lk(lp(K.y,0,1)),H=W.getUTCDay(),W=H>4||H===0?Fb.ceil(W):Fb(W),W=d1.offset(W,(K.V-1)*7),K.y=W.getUTCFullYear(),K.m=W.getUTCMonth(),K.d=W.getUTCDate()+(K.w+6)%7):(W=Ik(lp(K.y,0,1)),H=W.getDay(),W=H>4||H===0?$b.ceil(W):$b(W),W=hv.offset(W,(K.V-1)*7),K.y=W.getFullYear(),K.m=W.getMonth(),K.d=W.getDate()+(K.w+6)%7)}else("W"in K||"U"in K)&&("w"in K||(K.w="u"in K?K.u%7:"W"in K?1:0),H="Z"in K?Lk(lp(K.y,0,1)).getUTCDay():Ik(lp(K.y,0,1)).getDay(),K.m=0,K.d="W"in K?(K.w+6)%7+K.W*7-(H+5)%7:K.w+K.U*7-(H+6)%7);return"Z"in K?(K.H+=K.Z/100|0,K.M+=K.Z%100,Lk(K)):Ik(K)}}function T(G,Z,ee,K){for(var oe=0,W=Z.length,H=ee.length,q,te;oe<W;){if(K>=H)return-1;if(q=Z.charCodeAt(oe++),q===37){if(q=Z.charAt(oe++),te=S[q in i3?Z.charAt(oe++):q],!te||(K=te(G,ee,K))<0)return-1}else if(q!=ee.charCodeAt(K++))return-1}return K}function E(G,Z,ee){var K=u.exec(Z.slice(ee));return K?(G.p=d.get(K[0].toLowerCase()),ee+K[0].length):-1}function j(G,Z,ee){var K=p.exec(Z.slice(ee));return K?(G.w=g.get(K[0].toLowerCase()),ee+K[0].length):-1}function P(G,Z,ee){var K=h.exec(Z.slice(ee));return K?(G.w=f.get(K[0].toLowerCase()),ee+K[0].length):-1}function M(G,Z,ee){var K=x.exec(Z.slice(ee));return K?(G.m=w.get(K[0].toLowerCase()),ee+K[0].length):-1}function U(G,Z,ee){var K=m.exec(Z.slice(ee));return K?(G.m=v.get(K[0].toLowerCase()),ee+K[0].length):-1}function N(G,Z,ee){return T(G,e,Z,ee)}function B(G,Z,ee){return T(G,n,Z,ee)}function $(G,Z,ee){return T(G,r,Z,ee)}function I(G){return s[G.getDay()]}function R(G){return a[G.getDay()]}function z(G){return c[G.getMonth()]}function O(G){return o[G.getMonth()]}function A(G){return i[+(G.getHours()>=12)]}function L(G){return 1+~~(G.getMonth()/3)}function V(G){return s[G.getUTCDay()]}function Y(G){return a[G.getUTCDay()]}function Q(G){return c[G.getUTCMonth()]}function re(G){return o[G.getUTCMonth()]}function J(G){return i[+(G.getUTCHours()>=12)]}function ne(G){return 1+~~(G.getUTCMonth()/3)}return{format:function(G){var Z=_(G+="",y);return Z.toString=function(){return G},Z},parse:function(G){var Z=C(G+="",!1);return Z.toString=function(){return G},Z},utcFormat:function(G){var Z=_(G+="",k);return Z.toString=function(){return G},Z},utcParse:function(G){var Z=C(G+="",!0);return Z.toString=function(){return G},Z}}}var i3={"-":"",_:" ",0:"0"},dr=/^\s*\d+/,kRe=/^%/,_Re=/[\\^$*+?|[\]().{}]/g;function Dt(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(e)+i:i)}function CRe(t){return t.replace(_Re,"\\$&")}function up(t){return new RegExp("^(?:"+t.map(CRe).join("|")+")","i")}function dp(t){return new Map(t.map((e,n)=>[e.toLowerCase(),n]))}function TRe(t,e,n){var r=dr.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function ERe(t,e,n){var r=dr.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function jRe(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function PRe(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function NRe(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function a3(t,e,n){var r=dr.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function s3(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function ARe(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function ORe(t,e,n){var r=dr.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function RRe(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function o3(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function DRe(t,e,n){var r=dr.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function c3(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function MRe(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function IRe(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function LRe(t,e,n){var r=dr.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function $Re(t,e,n){var r=dr.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function FRe(t,e,n){var r=kRe.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function BRe(t,e,n){var r=dr.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function URe(t,e,n){var r=dr.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function l3(t,e){return Dt(t.getDate(),e,2)}function zRe(t,e){return Dt(t.getHours(),e,2)}function WRe(t,e){return Dt(t.getHours()%12||12,e,2)}function VRe(t,e){return Dt(1+hv.count(wo(t),t),e,3)}function wq(t,e){return Dt(t.getMilliseconds(),e,3)}function HRe(t,e){return wq(t,e)+"000"}function qRe(t,e){return Dt(t.getMonth()+1,e,2)}function KRe(t,e){return Dt(t.getMinutes(),e,2)}function GRe(t,e){return Dt(t.getSeconds(),e,2)}function YRe(t){var e=t.getDay();return e===0?7:e}function JRe(t,e){return Dt(h1.count(wo(t)-1,t),e,2)}function Sq(t){var e=t.getDay();return e>=4||e===0?Fh(t):Fh.ceil(t)}function XRe(t,e){return t=Sq(t),Dt(Fh.count(wo(t),t)+(wo(t).getDay()===4),e,2)}function ZRe(t){return t.getDay()}function QRe(t,e){return Dt($b.count(wo(t)-1,t),e,2)}function eDe(t,e){return Dt(t.getFullYear()%100,e,2)}function tDe(t,e){return t=Sq(t),Dt(t.getFullYear()%100,e,2)}function nDe(t,e){return Dt(t.getFullYear()%1e4,e,4)}function rDe(t,e){var n=t.getDay();return t=n>=4||n===0?Fh(t):Fh.ceil(t),Dt(t.getFullYear()%1e4,e,4)}function iDe(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Dt(e/60|0,"0",2)+Dt(e%60,"0",2)}function u3(t,e){return Dt(t.getUTCDate(),e,2)}function aDe(t,e){return Dt(t.getUTCHours(),e,2)}function sDe(t,e){return Dt(t.getUTCHours()%12||12,e,2)}function oDe(t,e){return Dt(1+d1.count(So(t),t),e,3)}function kq(t,e){return Dt(t.getUTCMilliseconds(),e,3)}function cDe(t,e){return kq(t,e)+"000"}function lDe(t,e){return Dt(t.getUTCMonth()+1,e,2)}function uDe(t,e){return Dt(t.getUTCMinutes(),e,2)}function dDe(t,e){return Dt(t.getUTCSeconds(),e,2)}function hDe(t){var e=t.getUTCDay();return e===0?7:e}function fDe(t,e){return Dt(f1.count(So(t)-1,t),e,2)}function _q(t){var e=t.getUTCDay();return e>=4||e===0?Bh(t):Bh.ceil(t)}function pDe(t,e){return t=_q(t),Dt(Bh.count(So(t),t)+(So(t).getUTCDay()===4),e,2)}function mDe(t){return t.getUTCDay()}function gDe(t,e){return Dt(Fb.count(So(t)-1,t),e,2)}function vDe(t,e){return Dt(t.getUTCFullYear()%100,e,2)}function yDe(t,e){return t=_q(t),Dt(t.getUTCFullYear()%100,e,2)}function bDe(t,e){return Dt(t.getUTCFullYear()%1e4,e,4)}function xDe(t,e){var n=t.getUTCDay();return t=n>=4||n===0?Bh(t):Bh.ceil(t),Dt(t.getUTCFullYear()%1e4,e,4)}function wDe(){return"+0000"}function d3(){return"%"}function h3(t){return+t}function f3(t){return Math.floor(+t/1e3)}var Yu,Cq,Tq;SDe({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
906ay","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function SDe(t){return Yu=SRe(t),Cq=Yu.format,Yu.parse,Tq=Yu.utcFormat,Yu.utcParse,Yu}function kDe(t){return new Date(t)}function _De(t){return t instanceof Date?+t:+new Date(+t)}function HN(t,e,n,r,i,a,s,o,c,u){var d=AN(),h=d.invert,f=d.domain,p=u(".%L"),g=u(":%S"),m=u("%I:%M"),v=u("%I %p"),x=u("%a %d"),w=u("%b %d"),y=u("%B"),k=u("%Y");function S(_){return(c(_)<_?p:o(_)<_?g:s(_)<_?m:a(_)<_?v:r(_)<_?i(_)<_?x:w:n(_)<_?y:k)(_)}return d.invert=function(_){return new Date(h(_))},d.domain=function(_){return arguments.length?f(Array.from(_,_De)):f().map(kDe)},d.ticks=function(_){var C=f();return t(C[0],C[C.length-1],_??10)},d.tickFormat=function(_,C){return C==null?S:u(C)},d.nice=function(_){var C=f();return(!_||typeof _.range!="function")&&(_=e(C[0],C[C.length-1],_??10)),_?f(hq(C,_)):d},d.copy=function(){return dv(d,HN(t,e,n,r,i,a,s,o,c,u))},d}function CDe(){return ha.apply(HN(xRe,wRe,wo,WN,h1,hv,UN,FN,Ol,Cq).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function TDe(){return ha.apply(HN(yRe,bRe,So,VN,f1,d1,zN,BN,Ol,Tq).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function p1(){var t=0,e=1,n,r,i,a,s=Vr,o=!1,c;function u(h){return h==null||isNaN(h=+h)?c:s(i===0?.5:(h=(a(h)-n)*i,o?Math.max(0,Math.min(1,h)):h))}u.domain=function(h){return arguments.length?([t,e]=h,n=a(t=+t),r=a(e=+e),i=n===r?0:1/(r-n),u):[t,e]},u.clamp=function(h){return arguments.length?(o=!!h,u):o},u.interpolator=function(h){return arguments.length?(s=h,u):s};function d(h){return function(f){var p,g;return arguments.length?([p,g]=f,s=h(p,g),u):[s(0),s(1)]}}return u.range=d(Rf),u.rangeRound=d(NN),u.unknown=function(h){return arguments.length?(c=h,u):c},function(h){return a=h,n=h(t),r=h(e),i=n===r?0:1/(r-n),u}}function Xc(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function Eq(){var t=Jc(p1()(Vr));return t.copy=function(){return Xc(t,Eq())},Eo.apply(t,arguments)}function jq(){var t=DN(p1()).domain([1,10]);return t.copy=function(){return Xc(t,jq()).base(t.base())},Eo.apply(t,arguments)}function Pq(){var t=MN(p1());return t.copy=function(){return Xc(t,Pq()).constant(t.constant())},Eo.apply(t,arguments)}function qN(){var t=IN(p1());return t.copy=function(){return Xc(t,qN()).exponent(t.exponent())},Eo.apply(t,arguments)}function EDe(){return qN.apply(null,arguments).exponent(.5)}function Nq(){var t=[],e=Vr;function n(r){if(r!=null&&!isNaN(r=+r))return e((lv(t,r,1)-1)/(t.length-1))}return n.domain=function(r){if(!arguments.length)return t.slice();t=[];for(let i of r)i!=null&&!isNaN(i=+i)&&t.push(i);return t.sort(Tc),n},n.interpolator=function(r){return arguments.length?(e=r,n):e},n.range=function(){return t.map((r,i)=>e(i/(t.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,a)=>fOe(t,a/r))},n.copy=function(){return Nq(e).domain(t)},Eo.apply(n,arguments)}function m1(){var t=0,e=.5,n=1,r=1,i,a,s,o,c,u=Vr,d,h=!1,f;function p(m){return isNaN(m=+m)?f:(m=.5+((m=+d(m))-a)*(r*m<r*a?o:c),u(h?Math.max(0,Math.min(1,m)):m))}p.domain=function(m){return arguments.length?([t,e,n]=m,i=d(t=+t),a=d(e=+e),s=d(n=+n),o=i===a?0:.5/(a-i),c=a===s?0:.5/(s-a),r=a<i?-1:1,p):[t,e,n]},p.clamp=function(m){return arguments.length?(h=!!m,p):h},p.interpolator=function(m){return arguments.length?(u=m,p):u};function g(m){return function(v){var x,w,y;return arguments.length?([x,w,y]=v,u=FOe(m,[x,w,y]),p):[u(0),u(.5),u(1)]}}return p.range=g(Rf),p.rangeRound=g(NN),p.unknown=function(m){return arguments.length?(f=m,p):f},function(m){return d=m,i=m(t),a=m(e),s=m(n),o=i===a?0:.5/(a-i),c=a===s?0:.5/(s-a),r=a<i?-1:1,p}}function Aq(){var t=Jc(m1()(Vr));return t.copy=function(){return Xc(t,Aq())},Eo.apply(t,arguments)}function Oq(){var t=DN(m1()).domain([.1,1,10]);return t.copy=function(){return Xc(t,Oq()).base(t.base())},Eo.apply(t,arguments)}function Rq(){var t=MN(m1());return t.copy=function(){return Xc(t,Rq()).constant(t.constant())},Eo.apply(t,arguments)}function KN(){var t=IN(m1());return t.copy=function(){return Xc(t,KN()).exponent(t.exponent())},Eo.apply(t,arguments)}function jDe(){return KN.apply(null,arguments).exponent(.5)}const p3=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:ag,scaleDiverging:Aq,scaleDivergingLog:Oq,scaleDivergingPow:KN,scaleDivergingSqrt:jDe,scaleDivergingSymlog:Rq,scaleIdentity:dq,scaleImplicit:GT,scaleLinear:Ib,scaleLog:fq,scaleOrdinal:EN,scalePoint:Jp,scalePow:LN,scaleQuantile:gq,scaleQuantize:vq,scaleRadial:mq,scaleSequential:Eq,scaleSequentialLog:jq,scaleSequentialPow:qN,scaleSequentialQuantile:Nq,scaleSequentialSqrt:EDe,scaleSequentialSymlog:Pq,scaleSqrt:cRe,scaleSymlog:pq,scaleThreshold:yq,scaleTime:CDe,scaleUtc:TDe,tickFormat:uq},Symbol.toStringTag,{value:"Module"}));var PDe=_f;function NDe(t,e,n){for(var r=-1,i=t.length;++r<i;){var a=t[r],s=e(a);if(s!=null&&(o===void 0?s===s&&!PDe(s):n(s,o)))var o=s,c=a}return c}var g1=NDe;function ADe(t,e){return t>e}var Dq=ADe,ODe=g1,RDe=Dq,DDe=Of;function MDe(t){return t&&t.length?ODe(t,DDe,RDe):void 0}var IDe=MDe;const v1=Lt(IDe);function LDe(t,e){return t<e}var Mq=LDe,$De=g1,FDe=Mq,BDe=Of;function UDe(t){return t&&t.length?$De(t,BDe,FDe):void 0}var zDe=UDe;const y1=Lt(zDe);var WDe=oN,VDe=Ms,HDe=WH,qDe=di;function KDe(t,e){var n=qDe(t)?WDe:HDe;return n(t,VDe(e))}var GDe=KDe,YDe=UH,JDe=GDe;function XDe(t,e){return YDe(JDe(t,e),1)}var ZDe=XDe;const QDe=Lt(ZDe);var e4e=SN;function t4e(t,e){return e4e(t,e)}var n4e=t4e;const fv=Lt(n4e);
vendor: 67,324 bytes, lines 906-933
906var Df=1e9,r4e={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},YN,vn=!0,aa="[DecimalError] ",ql=aa+"Invalid argument: ",GN=aa+"Exponent out of range: ",Mf=Math.floor,fl=Math.pow,i4e=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,_i,ar=1e7,ln=7,Iq=9007199254740991,Bb=Mf(Iq/ln),Fe={};Fe.absoluteValue=Fe.abs=function(){var t=new this.constructor(this);return t.s&&(t.s=1),t};Fe.comparedTo=Fe.cmp=function(t){var e,n,r,i,a=this;if(t=new a.constructor(t),a.s!==t.s)return a.s||-t.s;if(a.e!==t.e)return a.e>t.e^a.s<0?1:-1;for(r=a.d.length,i=t.d.length,e=0,n=r<i?r:i;e<n;++e)if(a.d[e]!==t.d[e])return a.d[e]>t.d[e]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};Fe.decimalPlaces=Fe.dp=function(){var t=this,e=t.d.length-1,n=(e-t.e)*ln;if(e=t.d[e],e)for(;e%10==0;e/=10)n--;return n<0?0:n};Fe.dividedBy=Fe.div=function(t){return lo(this,new this.constructor(t))};Fe.dividedToIntegerBy=Fe.idiv=function(t){var e=this,n=e.constructor;return Jt(lo(e,new n(t),0,1),n.precision)};Fe.equals=Fe.eq=function(t){return!this.cmp(t)};Fe.exponent=function(){return qn(this)};Fe.greaterThan=Fe.gt=function(t){return this.cmp(t)>0};Fe.greaterThanOrEqualTo=Fe.gte=function(t){return this.cmp(t)>=0};Fe.isInteger=Fe.isint=function(){return this.e>this.d.length-2};Fe.isNegative=Fe.isneg=function(){return this.s<0};Fe.isPositive=Fe.ispos=function(){return this.s>0};Fe.isZero=function(){return this.s===0};Fe.lessThan=Fe.lt=function(t){return this.cmp(t)<0};Fe.lessThanOrEqualTo=Fe.lte=function(t){return this.cmp(t)<1};Fe.logarithm=Fe.log=function(t){var e,n=this,r=n.constructor,i=r.precision,a=i+5;if(t===void 0)t=new r(10);else if(t=new r(t),t.s<1||t.eq(_i))throw Error(aa+"NaN");if(n.s<1)throw Error(aa+(n.s?"NaN":"-Infinity"));return n.eq(_i)?new r(0):(vn=!1,e=lo(ug(n,a),ug(t,a),a),vn=!0,Jt(e,i))};Fe.minus=Fe.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?Fq(e,t):Lq(e,(t.s=-t.s,t))};Fe.modulo=Fe.mod=function(t){var e,n=this,r=n.constructor,i=r.precision;if(t=new r(t),!t.s)throw Error(aa+"NaN");return n.s?(vn=!1,e=lo(n,t,0,1).times(t),vn=!0,n.minus(e)):Jt(new r(n),i)};Fe.naturalExponential=Fe.exp=function(){return $q(this)};Fe.naturalLogarithm=Fe.ln=function(){return ug(this)};Fe.negated=Fe.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};Fe.plus=Fe.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?Lq(e,t):Fq(e,(t.s=-t.s,t))};Fe.precision=Fe.sd=function(t){var e,n,r,i=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(ql+t);if(e=qn(i)+1,r=i.d.length-1,n=r*ln+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return t&&e>n?e:n};Fe.squareRoot=Fe.sqrt=function(){var t,e,n,r,i,a,s,o=this,c=o.constructor;if(o.s<1){if(!o.s)return new c(0);throw Error(aa+"NaN")}for(t=qn(o),vn=!1,i=Math.sqrt(+o),i==0||i==1/0?(e=fs(o.d),(e.length+t)%2==0&&(e+="0"),i=Math.sqrt(e),t=Mf((t+1)/2)-(t<0||t%2),i==1/0?e="5e"+t:(e=i.toExponential(),e=e.slice(0,e.indexOf("e")+1)+t),r=new c(e)):r=new c(i.toString()),n=c.precision,i=s=n+3;;)if(a=r,r=a.plus(lo(o,a,s+2)).times(.5),fs(a.d).slice(0,s)===(e=fs(r.d)).slice(0,s)){if(e=e.slice(s-3,s+1),i==s&&e=="4999"){if(Jt(a,n+1,0),a.times(a).eq(o)){r=a;break}}else if(e!="9999")break;s+=4}return vn=!0,Jt(r,n)};Fe.times=Fe.mul=function(t){var e,n,r,i,a,s,o,c,u,d=this,h=d.constructor,f=d.d,p=(t=new h(t)).d;if(!d.s||!t.s)return new h(0);for(t.s*=d.s,n=d.e+t.e,c=f.length,u=p.length,c<u&&(a=f,f=p,p=a,s=c,c=u,u=s),a=[],s=c+u,r=s;r--;)a.push(0);for(r=u;--r>=0;){for(e=0,i=c+r;i>r;)o=a[i]+p[r]*f[i-r-1]+e,a[i--]=o%ar|0,e=o/ar|0;a[i]=(a[i]+e)%ar|0}for(;!a[--s];)a.pop();return e?++n:a.shift(),t.d=a,t.e=n,vn?Jt(t,h.precision):t};Fe.toDecimalPlaces=Fe.todp=function(t,e){var n=this,r=n.constructor;return n=new r(n),t===void 0?n:(Ns(t,0,Df),e===void 0?e=r.rounding:Ns(e,0,8),Jt(n,t+qn(n)+1,e))};Fe.toExponential=function(t,e){var n,r=this,i=r.constructor;return t===void 0?n=mu(r,!0):(Ns(t,0,Df),e===void 0?e=i.rounding:Ns(e,0,8),r=Jt(new i(r),t+1,e),n=mu(r,!0,t+1)),n};Fe.toFixed=function(t,e){var n,r,i=this,a=i.constructor;return t===void 0?mu(i):(Ns(t,0,Df),e===void 0?e=a.rounding:Ns(e,0,8),r=Jt(new a(i),t+qn(i)+1,e),n=mu(r.abs(),!1,t+qn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Fe.toInteger=Fe.toint=function(){var t=this,e=t.constructor;return Jt(new e(t),qn(t)+1,e.rounding)};Fe.toNumber=function(){return+this};Fe.toPower=Fe.pow=function(t){var e,n,r,i,a,s,o=this,c=o.constructor,u=12,d=+(t=new c(t));if(!t.s)return new c(_i);if(o=new c(o),!o.s){if(t.s<1)throw Error(aa+"Infinity");return o}if(o.eq(_i))return o;if(r=c.precision,t.eq(_i))return Jt(o,r);if(e=t.e,n=t.d.length-1,s=e>=n,a=o.s,s){if((n=d<0?-d:d)<=Iq){for(i=new c(_i),e=Math.ceil(r/ln+4),vn=!1;n%2&&(i=i.times(o),g3(i.d,e)),n=Mf(n/2),n!==0;)o=o.times(o),g3(o.d,e);return vn=!0,t.s<0?new c(_i).div(i):Jt(i,r)}}else if(a<0)throw Error(aa+"NaN");return a=a<0&&t.d[Math.max(e,n)]&1?-1:1,o.s=1,vn=!1,i=t.times(ug(o,r+u)),vn=!0,i=$q(i),i.s=a,i};Fe.toPrecision=function(t,e){var n,r,i=this,a=i.constructor;return t===void 0?(n=qn(i),r=mu(i,n<=a.toExpNeg||n>=a.toExpPos)):(Ns(t,1,Df),e===void 0?e=a.rounding:Ns(e,0,8),i=Jt(new a(i),t,e),n=qn(i),r=mu(i,t<=n||n<=a.toExpNeg,t)),r};Fe.toSignificantDigits=Fe.tosd=function(t,e){var n=this,r=n.constructor;return t===void 0?(t=r.precision,e=r.rounding):(Ns(t,1,Df),e===void 0?e=r.rounding:Ns(e,0,8)),Jt(new r(n),t,e)};Fe.toString=Fe.valueOf=Fe.val=Fe.toJSON=Fe[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=qn(t),n=t.constructor;return mu(t,e<=n.toExpNeg||e>=n.toExpPos)};function Lq(t,e){var n,r,i,a,s,o,c,u,d=t.constructor,h=d.precision;if(!t.s||!e.s)return e.s||(e=new d(t)),vn?Jt(e,h):e;if(c=t.d,u=e.d,s=t.e,i=e.e,c=c.slice(),a=s-i,a){for(a<0?(r=c,a=-a,o=u.length):(r=u,i=s,o=c.length),s=Math.ceil(h/ln),o=s>o?s+1:o+1,a>o&&(a=o,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(o=c.length,a=u.length,o-a<0&&(a=o,r=u,u=c,c=r),n=0;a;)n=(c[--a]=c[a]+u[a]+n)/ar|0,c[a]%=ar;for(n&&(c.unshift(n),++i),o=c.length;c[--o]==0;)c.pop();return e.d=c,e.e=i,vn?Jt(e,h):e}function Ns(t,e,n){if(t!==~~t||t<e||t>n)throw Error(ql+t)}function fs(t){var e,n,r,i=t.length-1,a="",s=t[0];if(i>0){for(a+=s,e=1;e<i;e++)r=t[e]+"",n=ln-r.length,n&&(a+=zo(n)),a+=r;s=t[e],r=s+"",n=ln-r.length,n&&(a+=zo(n))}else if(s===0)return"0";for(;s%10===0;)s/=10;return a+s}var lo=function(){function t(r,i){var a,s=0,o=r.length;for(r=r.slice();o--;)a=r[o]*i+s,r[o]=a%ar|0,s=a/ar|0;return s&&r.unshift(s),r}function e(r,i,a,s){var o,c;if(a!=s)c=a>s?1:-1;else for(o=c=0;o<a;o++)if(r[o]!=i[o]){c=r[o]>i[o]?1:-1;break}return c}function n(r,i,a){for(var s=0;a--;)r[a]-=s,s=r[a]<i[a]?1:0,r[a]=s*ar+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,s){var o,c,u,d,h,f,p,g,m,v,x,w,y,k,S,_,C,T,E=r.constructor,j=r.s==i.s?1:-1,P=r.d,M=i.d;if(!r.s)return new E(r);if(!i.s)throw Error(aa+"Division by zero");for(c=r.e-i.e,C=M.length,S=P.length,p=new E(j),g=p.d=[],u=0;M[u]==(P[u]||0);)++u;if(M[u]>(P[u]||0)&&--c,a==null?w=a=E.precision:s?w=a+(qn(r)-qn(i))+1:w=a,w<0)return new E(0);if(w=w/ln+2|0,u=0,C==1)for(d=0,M=M[0],w++;(u<S||d)&&w--;u++)y=d*ar+(P[u]||0),g[u]=y/M|0,d=y%M|0;else{for(d=ar/(M[0]+1)|0,d>1&&(M=t(M,d),P=t(P,d),C=M.length,S=P.length),k=C,m=P.slice(0,C),v=m.length;v<C;)m[v++]=0;T=M.slice(),T.unshift(0),_=M[0],M[1]>=ar/2&&++_;do d=0,o=e(M,m,C,v),o<0?(x=m[0],C!=v&&(x=x*ar+(m[1]||0)),d=x/_|0,d>1?(d>=ar&&(d=ar-1),h=t(M,d),f=h.length,v=m.length,o=e(h,m,f,v),o==1&&(d--,n(h,C<f?T:M,f))):(d==0&&(o=d=1),h=M.slice()),f=h.length,f<v&&h.unshift(0),n(m,h,v),o==-1&&(v=m.length,o=e(M,m,C,v),o<1&&(d++,n(m,C<v?T:M,v))),v=m.length):o===0&&(d++,m=[0]),g[u++]=d,o&&m[0]?m[v++]=P[k]||0:(m=[P[k]],v=1);while((k++<S||m[0]!==void 0)&&w--)}return g[0]||g.shift(),p.e=c,Jt(p,s?a+qn(p)+1:a)}}();function $q(t,e){var n,r,i,a,s,o,c=0,u=0,d=t.constructor,h=d.precision;if(qn(t)>16)throw Error(GN+qn(t));if(!t.s)return new d(_i);for(e==null?(vn=!1,o=h):o=e,s=new d(.03125);t.abs().gte(.1);)t=t.times(s),u+=5;for(r=Math.log(fl(2,u))/Math.LN10*2+5|0,o+=r,n=i=a=new d(_i),d.precision=o;;){if(i=Jt(i.times(t),o),n=n.times(++c),s=a.plus(lo(i,n,o)),fs(s.d).slice(0,o)===fs(a.d).slice(0,o)){for(;u--;)a=Jt(a.times(a),o);return d.precision=h,e==null?(vn=!0,Jt(a,h)):a}a=s}}function qn(t){for(var e=t.e*ln,n=t.d[0];n>=10;n/=10)e++;return e}function $k(t,e,n){if(e>t.LN10.sd())throw vn=!0,n&&(t.precision=n),Error(aa+"LN10 precision limit exceeded");return Jt(new t(t.LN10),e)}function zo(t){for(var e="";t--;)e+="0";return e}function ug(t,e){var n,r,i,a,s,o,c,u,d,h=1,f=10,p=t,g=p.d,m=p.constructor,v=m.precision;if(p.s<1)throw Error(aa+(p.s?"NaN":"-Infinity"));if(p.eq(_i))return new m(0);if(e==null?(vn=!1,u=v):u=e,p.eq(10))return e==null&&(vn=!0),$k(m,u);if(u+=f,m.precision=u,n=fs(g),r=n.charAt(0),a=qn(p),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)p=p.times(t),n=fs(p.d),r=n.charAt(0),h++;a=qn(p),r>1?(p=new m("0."+n),a++):p=new m(r+"."+n.slice(1))}else return c=$k(m,u+2,v).times(a+""),p=ug(new m(r+"."+n.slice(1)),u-f).plus(c),m.precision=v,e==null?(vn=!0,Jt(p,v)):p;for(o=s=p=lo(p.minus(_i),p.plus(_i),u),d=Jt(p.times(p),u),i=3;;){if(s=Jt(s.times(d),u),c=o.plus(lo(s,new m(i),u)),fs(c.d).slice(0,u)===fs(o.d).slice(0,u))return o=o.times(2),a!==0&&(o=o.plus($k(m,u+2,v).times(a+""))),o=lo(o,new m(h),u),m.precision=v,e==null?(vn=!0,Jt(o,v)):o;o=c,i+=2}}function m3(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;e.charCodeAt(r)===48;)++r;for(i=e.length;e.charCodeAt(i-1)===48;)--i;if(e=e.slice(r,i),e){if(i-=r,n=n-r-1,t.e=Mf(n/ln),t.d=[],r=(n+1)%ln,n<0&&(r+=ln),r<i){for(r&&t.d.push(+e.slice(0,r)),i-=ln;r<i;)t.d.push(+e.slice(r,r+=ln));e=e.slice(r),r=ln-e.length}else r-=i;for(;r--;)e+="0";if(t.d.push(+e),vn&&(t.e>Bb||t.e<-Bb))throw Error(GN+n)}else t.s=0,t.e=0,t.d=[0];return t}function Jt(t,e,n){var r,i,a,s,o,c,u,d,h=t.d;for(s=1,a=h[0];a>=10;a/=10)s++;if(r=e-s,r<0)r+=ln,i=e,u=h[d=0];else{if(d=Math.ceil((r+1)/ln),a=h.length,d>=a)return t;for(u=a=h[d],s=1;a>=10;a/=10)s++;r%=ln,i=r-ln+s}if(n!==void 0&&(a=fl(10,s-i-1),o=u/a%10|0,c=e<0||h[d+1]!==void 0||u%a,c=n<4?(o||c)&&(n==0||n==(t.s<0?3:2)):o>5||o==5&&(n==4||c||n==6&&(r>0?i>0?u/fl(10,s-i):0:h[d-1])%10&1||n==(t.s<0?8:7))),e<1||!h[0])return c?(a=qn(t),h.length=1,e=e-a-1,h[0]=fl(10,(ln-e%ln)%ln),t.e=Mf(-e/ln)||0):(h.length=1,h[0]=t.e=t.s=0),t;if(r==0?(h.length=d,a=1,d--):(h.length=d+1,a=fl(10,ln-r),h[d]=i>0?(u/fl(10,s-i)%fl(10,i)|0)*a:0),c)for(;;)if(d==0){(h[0]+=a)==ar&&(h[0]=1,++t.e);break}else{if(h[d]+=a,h[d]!=ar)break;h[d--]=0,a=1}for(r=h.length;h[--r]===0;)h.pop();if(vn&&(t.e>Bb||t.e<-Bb))throw Error(GN+qn(t));return t}function Fq(t,e){var n,r,i,a,s,o,c,u,d,h,f=t.constructor,p=f.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new f(t),vn?Jt(e,p):e;if(c=t.d,h=e.d,r=e.e,u=t.e,c=c.slice(),s=u-r,s){for(d=s<0,d?(n=c,s=-s,o=h.length):(n=h,r=u,o=c.length),i=Math.max(Math.ceil(p/ln),o)+2,s>i&&(s=i,n.length=1),n.reverse(),i=s;i--;)n.push(0);n.reverse()}else{for(i=c.length,o=h.length,d=i<o,d&&(o=i),i=0;i<o;i++)if(c[i]!=h[i]){d=c[i]<h[i];break}s=0}for(d&&(n=c,c=h,h=n,e.s=-e.s),o=c.length,i=h.length-o;i>0;--i)c[o++]=0;for(i=h.length;i>s;){if(c[--i]<h[i]){for(a=i;a&&c[--a]===0;)c[a]=ar-1;--c[a],c[i]+=ar}c[i]-=h[i]}for(;c[--o]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(e.d=c,e.e=r,vn?Jt(e,p):e):new f(0)}function mu(t,e,n){var r,i=qn(t),a=fs(t.d),s=a.length;return e?(n&&(r=n-s)>0?a=a.charAt(0)+"."+a.slice(1)+zo(r):s>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+zo(-i-1)+a,n&&(r=n-s)>0&&(a+=zo(r))):i>=s?(a+=zo(i+1-s),n&&(r=n-i-1)>0&&(a=a+"."+zo(r))):((r=i+1)<s&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-s)>0&&(i+1===s&&(a+="."),a+=zo(r))),t.s<0?"-"+a:a}function g3(t,e){if(t.length>e)return t.length=e,!0}function Bq(t){var e,n,r;function i(a){var s=this;if(!(s instanceof i))return new i(a);if(s.constructor=i,a instanceof i){s.s=a.s,s.e=a.e,s.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(ql+a);if(a>0)s.s=1;else if(a<0)a=-a,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(a===~~a&&a<1e7){s.e=0,s.d=[a];return}return m3(s,a.toString())}else if(typeof a!="string")throw Error(ql+a);if(a.charCodeAt(0)===45?(a=a.slice(1),s.s=-1):s.s=1,i4e.test(a))m3(s,a);else throw Error(ql+a)}if(i.prototype=Fe,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=Bq,i.config=i.set=a4e,t===void 0&&(t={}),t)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],e=0;e<r.length;)t.hasOwnProperty(n=r[e++])||(t[n]=this[n]);return i.config(t),i}function a4e(t){if(!t||typeof t!="object")throw Error(aa+"Object expected");var e,n,r,i=["precision",1,Df,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(e=0;e<i.length;e+=3)if((r=t[n=i[e]])!==void 0)if(Mf(r)===r&&r>=i[e+1]&&r<=i[e+2])this[n]=r;else throw Error(ql+n+": "+r);if((r=t[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(ql+n+": "+r);return this}var YN=Bq(r4e);_i=new YN(1);const Vt=YN;function s4e(t){return u4e(t)||l4e(t)||c4e(t)||o4e()}function o4e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 907In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function c4e(t,e){if(t){if(typeof t=="string")return ZT(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ZT(t,e)}}function l4e(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function u4e(t){if(Array.isArray(t))return ZT(t)}function ZT(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var d4e=function(e){return e},Uq={"@@functional/placeholder":!0},zq=function(e){return e===Uq},v3=function(e){return function n(){return arguments.length===0||arguments.length===1&&zq(arguments.length<=0?void 0:arguments[0])?n:e.apply(void 0,arguments)}},h4e=function t(e,n){return e===1?n:v3(function(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];var s=i.filter(function(o){return o!==Uq}).length;return s>=e?n.apply(void 0,i):t(e-s,v3(function(){for(var o=arguments.length,c=new Array(o),u=0;u<o;u++)c[u]=arguments[u];var d=i.map(function(h){return zq(h)?c.shift():h});return n.apply(void 0,s4e(d).concat(c))}))})},b1=function(e){return h4e(e.length,e)},QT=function(e,n){for(var r=[],i=e;i<n;++i)r[i-e]=i;return r},f4e=b1(function(t,e){return Array.isArray(e)?e.map(t):Object.keys(e).map(function(n){return e[n]}).map(t)}),p4e=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if(!n.length)return d4e;var i=n.reverse(),a=i[0],s=i.slice(1);return function(){return s.reduce(function(o,c){return c(o)},a.apply(void 0,arguments))}},eE=function(e){return Array.isArray(e)?e.reverse():e.split("").reverse.join("")},Wq=function(e){var n=null,r=null;return function(){for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n&&a.every(function(o,c){return o===n[c]})||(n=a,r=e.apply(void 0,a)),r}};function m4e(t){var e;return t===0?e=1:e=Math.floor(new Vt(t).abs().log(10).toNumber())+1,e}function g4e(t,e,n){for(var r=new Vt(t),i=0,a=[];r.lt(e)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var v4e=b1(function(t,e,n){var r=+t,i=+e;return r+n*(i-r)}),y4e=b1(function(t,e,n){var r=e-+t;return r=r||1/0,(n-t)/r}),b4e=b1(function(t,e,n){var r=e-+t;return r=r||1/0,Math.max(0,Math.min(1,(n-t)/r))});const x1={rangeStep:g4e,getDigitCount:m4e,interpolateNumber:v4e,uninterpolateNumber:y4e,uninterpolateTruncation:b4e};function tE(t){return S4e(t)||w4e(t)||Vq(t)||x4e()}function x4e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 908In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function w4e(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function S4e(t){if(Array.isArray(t))return nE(t)}function dg(t,e){return C4e(t)||_4e(t,e)||Vq(t,e)||k4e()}function k4e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 909In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vq(t,e){if(t){if(typeof t=="string")return nE(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nE(t,e)}}function nE(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function _4e(t,e){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(t)))){var n=[],r=!0,i=!1,a=void 0;try{for(var s=t[Symbol.iterator](),o;!(r=(o=s.next()).done)&&(n.push(o.value),!(e&&n.length===e));r=!0);}catch(c){i=!0,a=c}finally{try{!r&&s.return!=null&&s.return()}finally{if(i)throw a}}return n}}function C4e(t){if(Array.isArray(t))return t}function Hq(t){var e=dg(t,2),n=e[0],r=e[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]}function qq(t,e,n){if(t.lte(0))return new Vt(0);var r=x1.getDigitCount(t.toNumber()),i=new Vt(10).pow(r),a=t.div(i),s=r!==1?.05:.1,o=new Vt(Math.ceil(a.div(s).toNumber())).add(n).mul(s),c=o.mul(i);return e?c:new Vt(Math.ceil(c))}function T4e(t,e,n){var r=1,i=new Vt(t);if(!i.isint()&&n){var a=Math.abs(t);a<1?(r=new Vt(10).pow(x1.getDigitCount(t)-1),i=new Vt(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new Vt(Math.floor(t)))}else t===0?i=new Vt(Math.floor((e-1)/2)):n||(i=new Vt(Math.floor(t)));var s=Math.floor((e-1)/2),o=p4e(f4e(function(c){return i.add(new Vt(c-s).mul(r)).toNumber()}),QT);return o(0,e)}function Kq(t,e,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((e-t)/(n-1)))return{step:new Vt(0),tickMin:new Vt(0),tickMax:new Vt(0)};var a=qq(new Vt(e).sub(t).div(n-1),r,i),s;t<=0&&e>=0?s=new Vt(0):(s=new Vt(t).add(e).div(2),s=s.sub(new Vt(s).mod(a)));var o=Math.ceil(s.sub(t).div(a).toNumber()),c=Math.ceil(new Vt(e).sub(s).div(a).toNumber()),u=o+c+1;return u>n?Kq(t,e,n,r,i+1):(u<n&&(c=e>0?c+(n-u):c,o=e>0?o:o+(n-u)),{step:a,tickMin:s.sub(new Vt(o).mul(a)),tickMax:s.add(new Vt(c).mul(a))})}function E4e(t){var e=dg(t,2),n=e[0],r=e[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=Math.max(i,2),o=Hq([n,r]),c=dg(o,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var h=d===1/0?[u].concat(tE(QT(0,i-1).map(function(){return 1/0}))):[].concat(tE(QT(0,i-1).map(function(){return-1/0})),[d]);return n>r?eE(h):h}if(u===d)return T4e(u,i,a);var f=Kq(u,d,s,a),p=f.step,g=f.tickMin,m=f.tickMax,v=x1.rangeStep(g,m.add(new Vt(.1).mul(p)),p);return n>r?eE(v):v}function j4e(t,e){var n=dg(t,2),r=n[0],i=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=Hq([r,i]),o=dg(s,2),c=o[0],u=o[1];if(c===-1/0||u===1/0)return[r,i];if(c===u)return[c];var d=Math.max(e,2),h=qq(new Vt(u).sub(c).div(d-1),a,0),f=[].concat(tE(x1.rangeStep(new Vt(c),new Vt(u).sub(new Vt(.99).mul(h)),h)),[u]);return r>i?eE(f):f}var P4e=Wq(E4e),N4e=Wq(j4e),A4e="Invariant failed";function gu(t,e){throw new Error(A4e)}var O4e=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Uh(t){"@babel/helpers - typeof";return Uh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Uh(t)}function Ub(){return Ub=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ub.apply(this,arguments)}function R4e(t,e){return L4e(t)||I4e(t,e)||M4e(t,e)||D4e()}function D4e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 910In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function M4e(t,e){if(t){if(typeof t=="string")return y3(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y3(t,e)}}function y3(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function I4e(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,o=[],c=!0,u=!1;try{if(a=(n=n.call(t)).next,e!==0)for(;!(c=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function L4e(t){if(Array.isArray(t))return t}function $4e(t,e){if(t==null)return{};var n=F4e(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function F4e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function B4e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function U4e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Jq(r.key),r)}}function z4e(t,e,n){return e&&U4e(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function W4e(t,e,n){return e=zb(e),V4e(t,Gq()?Reflect.construct(e,n||[],zb(t).constructor):e.apply(t,n))}function V4e(t,e){if(e&&(Uh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return H4e(t)}function H4e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Gq(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Gq=function(){return!!t})()}function zb(t){return zb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},zb(t)}function q4e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&rE(t,e)}function rE(t,e){return rE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},rE(t,e)}function Yq(t,e,n){return e=Jq(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Jq(t){var e=K4e(t,"string");return Uh(e)=="symbol"?e:e+""}function K4e(t,e){if(Uh(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Uh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var pv=function(t){function e(){return B4e(this,e),W4e(this,e,arguments)}return q4e(e,t),z4e(e,[{key:"render",value:function(){var r=this.props,i=r.offset,a=r.layout,s=r.width,o=r.dataKey,c=r.data,u=r.dataPointFormatter,d=r.xAxis,h=r.yAxis,f=$4e(r,O4e),p=Ye(f,!1);this.props.direction==="x"&&d.type!=="number"&&gu();var g=c.map(function(m){var v=u(m,o),x=v.x,w=v.y,y=v.value,k=v.errorVal;if(!k)return null;var S=[],_,C;if(Array.isArray(k)){var T=R4e(k,2);_=T[0],C=T[1]}else _=C=k;if(a==="vertical"){var E=d.scale,j=w+i,P=j+s,M=j-s,U=E(y-_),N=E(y+C);S.push({x1:N,y1:P,x2:N,y2:M}),S.push({x1:U,y1:j,x2:N,y2:j}),S.push({x1:U,y1:P,x2:U,y2:M})}else if(a==="horizontal"){var B=h.scale,$=x+i,I=$-s,R=$+s,z=B(y-_),O=B(y+C);S.push({x1:I,y1:O,x2:R,y2:O}),S.push({x1:$,y1:z,x2:$,y2:O}),S.push({x1:I,y1:z,x2:R,y2:z})}return D.createElement(Rt,Ub({className:"recharts-errorBar",key:"bar-".concat(S.map(function(A){return"".concat(A.x1,"-").concat(A.x2,"-").concat(A.y1,"-").concat(A.y2)}))},p),S.map(function(A){return D.createElement("line",Ub({},A,{key:"line-".concat(A.x1,"-").concat(A.x2,"-").concat(A.y1,"-").concat(A.y2)}))}))});return D.createElement(Rt,{className:"recharts-errorBars"},g)}}])}(D.Component);Yq(pv,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});Yq(pv,"displayName","ErrorBar");function hg(t){"@babel/helpers - typeof";return hg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hg(t)}function b3(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function nl(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?b3(Object(n),!0).forEach(function(r){G4e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):b3(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function G4e(t,e,n){return e=Y4e(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Y4e(t){var e=J4e(t,"string");return hg(e)=="symbol"?e:e+""}function J4e(t,e){if(hg(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(hg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Xq=function(e){var n=e.children,r=e.formattedGraphicalItems,i=e.legendWidth,a=e.legendContent,s=bi(n,Vd);if(!s)return null;var o=Vd.defaultProps,c=o!==void 0?nl(nl({},o),s.props):{},u;return s.props&&s.props.payload?u=s.props&&s.props.payload:a==="children"?u=(r||[]).reduce(function(d,h){var f=h.item,p=h.props,g=p.sectors||p.data||[];return d.concat(g.map(function(m){return{type:s.props.iconType||f.props.legendType,value:m.name,color:m.fill,payload:m}}))},[]):u=(r||[]).map(function(d){var h=d.item,f=h.type.defaultProps,p=f!==void 0?nl(nl({},f),h.props):{},g=p.dataKey,m=p.name,v=p.legendType,x=p.hide;return{inactive:x,dataKey:g,type:c.iconType||v||"square",color:JN(h),value:m||g,payload:p}}),nl(nl(nl({},c),Vd.getWithHeight(s,i)),{},{payload:u,item:s})};function fg(t){"@babel/helpers - typeof";return fg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fg(t)}function x3(t){return eMe(t)||Q4e(t)||Z4e(t)||X4e()}function X4e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 911In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Z4e(t,e){if(t){if(typeof t=="string")return iE(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return iE(t,e)}}function Q4e(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function eMe(t){if(Array.isArray(t))return iE(t)}function iE(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function w3(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Pn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?w3(Object(n),!0).forEach(function(r){qd(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):w3(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function qd(t,e,n){return e=tMe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function tMe(t){var e=nMe(t,"string");return fg(e)=="symbol"?e:e+""}function nMe(t,e){if(fg(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(fg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function er(t,e,n){return ut(t)||ut(e)?n:nr(e)?Pi(t,e,n):it(e)?e(t):n}function Xp(t,e,n,r){var i=QDe(t,function(o){return er(o,e)});if(n==="number"){var a=i.filter(function(o){return Ce(o)||parseFloat(o)});return a.length?[y1(a),v1(a)]:[1/0,-1/0]}var s=r?i.filter(function(o){return!ut(o)}):i;return s.map(function(o){return nr(o)||o instanceof Date?o:""})}var rMe=function(e){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,s=-1,o=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(o<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var c=a.range,u=0;u<o;u++){var d=u>0?i[u-1].coordinate:i[o-1].coordinate,h=i[u].coordinate,f=u>=o-1?i[0].coordinate:i[u+1].coordinate,p=void 0;if(zr(h-d)!==zr(f-h)){var g=[];if(zr(f-h)===zr(c[1]-c[0])){p=f;var m=h+c[1]-c[0];g[0]=Math.min(m,(m+d)/2),g[1]=Math.max(m,(m+d)/2)}else{p=d;var v=f+c[1]-c[0];g[0]=Math.min(h,(v+h)/2),g[1]=Math.max(h,(v+h)/2)}var x=[Math.min(h,(p+h)/2),Math.max(h,(p+h)/2)];if(e>x[0]&&e<=x[1]||e>=g[0]&&e<=g[1]){s=i[u].index;break}}else{var w=Math.min(d,f),y=Math.max(d,f);if(e>(w+h)/2&&e<=(y+h)/2){s=i[u].index;break}}}else for(var k=0;k<o;k++)if(k===0&&e<=(r[k].coordinate+r[k+1].coordinate)/2||k>0&&k<o-1&&e>(r[k].coordinate+r[k-1].coordinate)/2&&e<=(r[k].coordinate+r[k+1].coordinate)/2||k===o-1&&e>(r[k].coordinate+r[k-1].coordinate)/2){s=r[k].index;break}return s},JN=function(e){var n,r=e,i=r.type.displayName,a=(n=e.type)!==null&&n!==void 0&&n.defaultProps?Pn(Pn({},e.type.defaultProps),e.props):e.props,s=a.stroke,o=a.fill,c;switch(i){case"Line":c=s;break;case"Area":case"Radar":c=s&&s!=="none"?s:o;break;default:c=o;break}return c},iMe=function(e){var n=e.barSize,r=e.totalSize,i=e.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var s={},o=Object.keys(a),c=0,u=o.length;c<u;c++)for(var d=a[o[c]].stackGroups,h=Object.keys(d),f=0,p=h.length;f<p;f++){var g=d[h[f]],m=g.items,v=g.cateAxisId,x=m.filter(function(C){return co(C.type).indexOf("Bar")>=0});if(x&&x.length){var w=x[0].type.defaultProps,y=w!==void 0?Pn(Pn({},w),x[0].props):x[0].props,k=y.barSize,S=y[v];s[S]||(s[S]=[]);var _=ut(k)?n:k;s[S].push({item:x[0],stackList:x.slice(1),barSize:ut(_)?void 0:Wr(_,r,0)})}}return s},aMe=function(e){var n=e.barGap,r=e.barCategoryGap,i=e.bandSize,a=e.sizeList,s=a===void 0?[]:a,o=e.maxBarSize,c=s.length;if(c<1)return null;var u=Wr(n,i,0,!0),d,h=[];if(s[0].barSize===+s[0].barSize){var f=!1,p=i/c,g=s.reduce(function(k,S){return k+S.barSize||0},0);g+=(c-1)*u,g>=i&&(g-=(c-1)*u,u=0),g>=i&&p>0&&(f=!0,p*=.9,g=c*p);var m=(i-g)/2>>0,v={offset:m-u,size:0};d=s.reduce(function(k,S){var _={item:S.item,position:{offset:v.offset+v.size+u,size:f?p:S.barSize}},C=[].concat(x3(k),[_]);return v=C[C.length-1].position,S.stackList&&S.stackList.length&&S.stackList.forEach(function(T){C.push({item:T,position:v})}),C},h)}else{var x=Wr(r,i,0,!0);i-2*x-(c-1)*u<=0&&(u=0);var w=(i-2*x-(c-1)*u)/c;w>1&&(w>>=0);var y=o===+o?Math.min(w,o):w;d=s.reduce(function(k,S,_){var C=[].concat(x3(k),[{item:S.item,position:{offset:x+(w+u)*_+(w-y)/2,size:y}}]);return S.stackList&&S.stackList.length&&S.stackList.forEach(function(T){C.push({item:T,position:C[C.length-1].position})}),C},h)}return d},sMe=function(e,n,r,i){var a=r.children,s=r.width,o=r.margin,c=s-(o.left||0)-(o.right||0),u=Xq({children:a,legendWidth:c});if(u){var d=i||{},h=d.width,f=d.height,p=u.align,g=u.verticalAlign,m=u.layout;if((m==="vertical"||m==="horizontal"&&g==="middle")&&p!=="center"&&Ce(e[p]))return Pn(Pn({},e),{},qd({},p,e[p]+(h||0)));if((m==="horizontal"||m==="vertical"&&p==="center")&&g!=="middle"&&Ce(e[g]))return Pn(Pn({},e),{},qd({},g,e[g]+(f||0)))}return e},oMe=function(e,n,r){return ut(n)?!0:e==="horizontal"?n==="yAxis":e==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},Zq=function(e,n,r,i,a){var s=n.props.children,o=Ni(s,pv).filter(function(u){return oMe(i,a,u.props.direction)});if(o&&o.length){var c=o.map(function(u){return u.props.dataKey});return e.reduce(function(u,d){var h=er(d,r);if(ut(h))return u;var f=Array.isArray(h)?[y1(h),v1(h)]:[h,h],p=c.reduce(function(g,m){var v=er(d,m,0),x=f[0]-Math.abs(Array.isArray(v)?v[0]:v),w=f[1]+Math.abs(Array.isArray(v)?v[1]:v);return[Math.min(x,g[0]),Math.max(w,g[1])]},[1/0,-1/0]);return[Math.min(p[0],u[0]),Math.max(p[1],u[1])]},[1/0,-1/0])}return null},cMe=function(e,n,r,i,a){var s=n.map(function(o){return Zq(e,o,r,a,i)}).filter(function(o){return!ut(o)});return s&&s.length?s.reduce(function(o,c){return[Math.min(o[0],c[0]),Math.max(o[1],c[1])]},[1/0,-1/0]):null},Qq=function(e,n,r,i,a){var s=n.map(function(c){var u=c.props.dataKey;return r==="number"&&u&&Zq(e,c,u,i)||Xp(e,u,r,a)});if(r==="number")return s.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var o={};return s.reduce(function(c,u){for(var d=0,h=u.length;d<h;d++)o[u[d]]||(o[u[d]]=!0,c.push(u[d]));return c},[])},eK=function(e,n){return e==="horizontal"&&n==="xAxis"||e==="vertical"&&n==="yAxis"||e==="centric"&&n==="angleAxis"||e==="radial"&&n==="radiusAxis"},tK=function(e,n,r,i){if(i)return e.map(function(c){return c.coordinate});var a,s,o=e.map(function(c){return c.coordinate===n&&(a=!0),c.coordinate===r&&(s=!0),c.coordinate});return a||o.push(n),s||o.push(r),o},so=function(e,n,r){if(!e)return null;var i=e.scale,a=e.duplicateDomain,s=e.type,o=e.range,c=e.realScaleType==="scaleBand"?i.bandwidth()/2:2,u=(n||r)&&s==="category"&&i.bandwidth?i.bandwidth()/c:0;if(u=e.axisType==="angleAxis"&&(o==null?void 0:o.length)>=2?zr(o[0]-o[1])*2*u:u,n&&(e.ticks||e.niceTicks)){var d=(e.ticks||e.niceTicks).map(function(h){var f=a?a.indexOf(h):h;return{coordinate:i(f)+u,value:h,offset:u}});return d.filter(function(h){return!ov(h.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(h,f){return{coordinate:i(h)+u,value:h,index:f,offset:u}}):i.ticks&&!r?i.ticks(e.tickCount).map(function(h){return{coordinate:i(h)+u,value:h,offset:u}}):i.domain().map(function(h,f){return{coordinate:i(h)+u,value:a?a[h]:h,index:f,offset:u}})},Fk=new WeakMap,gy=function(e,n){if(typeof n!="function")return e;Fk.has(e)||Fk.set(e,new WeakMap);var r=Fk.get(e);if(r.has(n))return r.get(n);var i=function(){e.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},nK=function(e,n,r){var i=e.scale,a=e.type,s=e.layout,o=e.axisType;if(i==="auto")return s==="radial"&&o==="radiusAxis"?{scale:ag(),realScaleType:"band"}:s==="radial"&&o==="angleAxis"?{scale:Ib(),realScaleType:"linear"}:a==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:Jp(),realScaleType:"point"}:a==="category"?{scale:ag(),realScaleType:"band"}:{scale:Ib(),realScaleType:"linear"};if(hu(i)){var c="scale".concat(n1(i));return{scale:(p3[c]||Jp)(),realScaleType:p3[c]?c:"point"}}return it(i)?{scale:i}:{scale:Jp(),realScaleType:"point"}},S3=1e-4,rK=function(e){var n=e.domain();if(!(!n||n.length<=2)){var r=n.length,i=e.range(),a=Math.min(i[0],i[1])-S3,s=Math.max(i[0],i[1])+S3,o=e(n[0]),c=e(n[r-1]);(o<a||o>s||c<a||c>s)&&e.domain([n[0],n[r-1]])}},lMe=function(e,n){if(!e)return null;for(var r=0,i=e.length;r<i;r++)if(e[r].item===n)return e[r].position;return null},uMe=function(e,n){if(!n||n.length!==2||!Ce(n[0])||!Ce(n[1]))return e;var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]),a=[e[0],e[1]];return(!Ce(e[0])||e[0]<r)&&(a[0]=r),(!Ce(e[1])||e[1]>i)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]<r&&(a[1]=r),a},dMe=function(e){var n=e.length;if(!(n<=0))for(var r=0,i=e[0].length;r<i;++r)for(var a=0,s=0,o=0;o<n;++o){var c=ov(e[o][r][1])?e[o][r][0]:e[o][r][1];c>=0?(e[o][r][0]=a,e[o][r][1]=a+c,a=e[o][r][1]):(e[o][r][0]=s,e[o][r][1]=s+c,s=e[o][r][1])}},hMe=function(e){var n=e.length;if(!(n<=0))for(var r=0,i=e[0].length;r<i;++r)for(var a=0,s=0;s<n;++s){var o=ov(e[s][r][1])?e[s][r][0]:e[s][r][1];o>=0?(e[s][r][0]=a,e[s][r][1]=a+o,a=e[s][r][1]):(e[s][r][0]=0,e[s][r][1]=0)}},fMe={sign:dMe,expand:Oke,none:Rh,silhouette:Rke,wiggle:Dke,positive:hMe},pMe=function(e,n,r){var i=n.map(function(o){return o.props.dataKey}),a=fMe[r],s=Ake().keys(i).value(function(o,c){return+er(o,c,0)}).order(PT).offset(a);return s(e)},mMe=function(e,n,r,i,a,s){if(!e)return null;var o=s?n.reverse():n,c={},u=o.reduce(function(h,f){var p,g=(p=f.type)!==null&&p!==void 0&&p.defaultProps?Pn(Pn({},f.type.defaultProps),f.props):f.props,m=g.stackId,v=g.hide;if(v)return h;var x=g[r],w=h[x]||{hasStack:!1,stackGroups:{}};if(nr(m)){var y=w.stackGroups[m]||{numericAxisId:r,cateAxisId:i,items:[]};y.items.push(f),w.hasStack=!0,w.stackGroups[m]=y}else w.stackGroups[Pf("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[f]};return Pn(Pn({},h),{},qd({},x,w))},c),d={};return Object.keys(u).reduce(function(h,f){var p=u[f];if(p.hasStack){var g={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(m,v){var x=p.stackGroups[v];return Pn(Pn({},m),{},qd({},v,{numericAxisId:r,cateAxisId:i,items:x.items,stackedData:pMe(e,x.items,a)}))},g)}return Pn(Pn({},h),{},qd({},f,p))},d)},iK=function(e,n){var r=n.realScaleType,i=n.type,a=n.tickCount,s=n.originalDomain,o=n.allowDecimals,c=r||n.scale;if(c!=="auto"&&c!=="linear")return null;if(a&&i==="number"&&s&&(s[0]==="auto"||s[1]==="auto")){var u=e.domain();if(!u.length)return null;var d=P4e(u,a,o);return e.domain([y1(d),v1(d)]),{niceTicks:d}}if(a&&i==="number"){var h=e.domain(),f=N4e(h,a,o);return{niceTicks:f}}return null};function k3(t){var e=t.axis,n=t.ticks,r=t.bandSize,i=t.entry,a=t.index,s=t.dataKey;if(e.type==="category"){if(!e.allowDuplicatedCategory&&e.dataKey&&!ut(i[e.dataKey])){var o=mb(n,"value",i[e.dataKey]);if(o)return o.coordinate+r/2}return n[a]?n[a].coordinate+r/2:null}var c=er(i,ut(s)?e.dataKey:s);return ut(c)?null:e.scale(c)}var _3=function(e){var n=e.axis,r=e.ticks,i=e.offset,a=e.bandSize,s=e.entry,o=e.index;if(n.type==="category")return r[o]?r[o].coordinate+i:null;var c=er(s,n.dataKey,n.domain[o]);return ut(c)?null:n.scale(c)-a/2+i},gMe=function(e){var n=e.numericAxis,r=n.scale.domain();if(n.type==="number"){var i=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);return i<=0&&a>=0?0:a<0?a:i}return r[0]},vMe=function(e,n){var r,i=(r=e.type)!==null&&r!==void 0&&r.defaultProps?Pn(Pn({},e.type.defaultProps),e.props):e.props,a=i.stackId;if(nr(a)){var s=n[a];if(s){var o=s.items.indexOf(e);return o>=0?s.stackedData[o]:null}}return null},yMe=function(e){return e.reduce(function(n,r){return[y1(r.concat([n[0]]).filter(Ce)),v1(r.concat([n[1]]).filter(Ce))]},[1/0,-1/0])},aK=function(e,n,r){return Object.keys(e).reduce(function(i,a){var s=e[a],o=s.stackedData,c=o.reduce(function(u,d){var h=yMe(d.slice(n,r+1));return[Math.min(u[0],h[0]),Math.max(u[1],h[1])]},[1/0,-1/0]);return[Math.min(c[0],i[0]),Math.max(c[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},C3=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,T3=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,aE=function(e,n,r){if(it(e))return e(n,r);if(!Array.isArray(e))return n;var i=[];if(Ce(e[0]))i[0]=r?e[0]:Math.min(e[0],n[0]);else if(C3.test(e[0])){var a=+C3.exec(e[0])[1];i[0]=n[0]-a}else it(e[0])?i[0]=e[0](n[0]):i[0]=n[0];if(Ce(e[1]))i[1]=r?e[1]:Math.max(e[1],n[1]);else if(T3.test(e[1])){var s=+T3.exec(e[1])[1];i[1]=n[1]+s}else it(e[1])?i[1]=e[1](n[1]):i[1]=n[1];return i},Wb=function(e,n,r){if(e&&e.scale&&e.scale.bandwidth){var i=e.scale.bandwidth();if(!r||i>0)return i}if(e&&n&&n.length>=2){for(var a=_N(n,function(h){return h.coordinate}),s=1/0,o=1,c=a.length;o<c;o++){var u=a[o],d=a[o-1];s=Math.min((u.coordinate||0)-(d.coordinate||0),s)}return s===1/0?0:s}return r?void 0:0},E3=function(e,n,r){return!e||!e.length||fv(e,Pi(r,"type.defaultProps.domain"))?n:e},sK=function(e,n){var r=e.type.defaultProps?Pn(Pn({},e.type.defaultProps),e.props):e.props,i=r.dataKey,a=r.name,s=r.unit,o=r.formatter,c=r.tooltipType,u=r.chartType,d=r.hide;return Pn(Pn({},Ye(e,!1)),{},{dataKey:i,unit:s,formatter:o,name:a||i,color:JN(e),value:er(n,i),type:c,payload:n,chartType:u,hide:d})};function pg(t){"@babel/helpers - typeof";return pg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pg(t)}function j3(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Ks(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?j3(Object(n),!0).forEach(function(r){oK(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):j3(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function oK(t,e,n){return e=bMe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bMe(t){var e=xMe(t,"string");return pg(e)=="symbol"?e:e+""}function xMe(t,e){if(pg(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(pg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function wMe(t,e){return CMe(t)||_Me(t,e)||kMe(t,e)||SMe()}function SMe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 912In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kMe(t,e){if(t){if(typeof t=="string")return P3(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return P3(t,e)}}function P3(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function _Me(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,o=[],c=!0,u=!1;try{if(a=(n=n.call(t)).next,e!==0)for(;!(c=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function CMe(t){if(Array.isArray(t))return t}var Vb=Math.PI/180,TMe=function(e){return e*180/Math.PI},nn=function(e,n,r,i){return{x:e+Math.cos(-Vb*i)*r,y:n+Math.sin(-Vb*i)*r}},cK=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(e-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},EMe=function(e,n,r,i,a){var s=e.width,o=e.height,c=e.startAngle,u=e.endAngle,d=Wr(e.cx,s,s/2),h=Wr(e.cy,o,o/2),f=cK(s,o,r),p=Wr(e.innerRadius,f,0),g=Wr(e.outerRadius,f,f*.8),m=Object.keys(n);return m.reduce(function(v,x){var w=n[x],y=w.domain,k=w.reversed,S;if(ut(w.range))i==="angleAxis"?S=[c,u]:i==="radiusAxis"&&(S=[p,g]),k&&(S=[S[1],S[0]]);else{S=w.range;var _=S,C=wMe(_,2);c=C[0],u=C[1]}var T=nK(w,a),E=T.realScaleType,j=T.scale;j.domain(y).range(S),rK(j);var P=iK(j,Ks(Ks({},w),{},{realScaleType:E})),M=Ks(Ks(Ks({},w),P),{},{range:S,radius:g,realScaleType:E,scale:j,cx:d,cy:h,innerRadius:p,outerRadius:g,startAngle:c,endAngle:u});return Ks(Ks({},v),{},oK({},x,M))},{})},jMe=function(e,n){var r=e.x,i=e.y,a=n.x,s=n.y;return Math.sqrt(Math.pow(r-a,2)+Math.pow(i-s,2))},PMe=function(e,n){var r=e.x,i=e.y,a=n.cx,s=n.cy,o=jMe({x:r,y:i},{x:a,y:s});if(o<=0)return{radius:o};var c=(r-a)/o,u=Math.acos(c);return i>s&&(u=2*Math.PI-u),{radius:o,angle:TMe(u),angleInRadian:u}},NMe=function(e){var n=e.startAngle,r=e.endAngle,i=Math.floor(n/360),a=Math.floor(r/360),s=Math.min(i,a);return{startAngle:n-s*360,endAngle:r-s*360}},AMe=function(e,n){var r=n.startAngle,i=n.endAngle,a=Math.floor(r/360),s=Math.floor(i/360),o=Math.min(a,s);return e+o*360},N3=function(e,n){var r=e.x,i=e.y,a=PMe({x:r,y:i},n),s=a.radius,o=a.angle,c=n.innerRadius,u=n.outerRadius;if(s<c||s>u)return!1;if(s===0)return!0;var d=NMe(n),h=d.startAngle,f=d.endAngle,p=o,g;if(h<=f){for(;p>f;)p-=360;for(;p<h;)p+=360;g=p>=h&&p<=f}else{for(;p>h;)p-=360;for(;p<f;)p+=360;g=p>=f&&p<=h}return g?Ks(Ks({},n),{},{radius:s,angle:AMe(p,n)}):null},lK=function(e){return!b.isValidElement(e)&&!it(e)&&typeof e!="boolean"?e.className:""};function mg(t){"@babel/helpers - typeof";return mg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mg(t)}var OMe=["offset"];function RMe(t){return LMe(t)||IMe(t)||MMe(t)||DMe()}function DMe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 913In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function MMe(t,e){if(t){if(typeof t=="string")return sE(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sE(t,e)}}function IMe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function LMe(t){if(Array.isArray(t))return sE(t)}function sE(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function $Me(t,e){if(t==null)return{};var n=FMe(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function FMe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function A3(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Yn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?A3(Object(n),!0).forEach(function(r){BMe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):A3(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function BMe(t,e,n){return e=UMe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function UMe(t){var e=zMe(t,"string");return mg(e)=="symbol"?e:e+""}function zMe(t,e){if(mg(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(mg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function gg(){return gg=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},gg.apply(this,arguments)}var WMe=function(e){var n=e.value,r=e.formatter,i=ut(e.children)?n:e.children;return it(r)?r(i):i},VMe=function(e,n){var r=zr(n-e),i=Math.min(Math.abs(n-e),360);return r*i},HMe=function(e,n,r){var i=e.position,a=e.viewBox,s=e.offset,o=e.className,c=a,u=c.cx,d=c.cy,h=c.innerRadius,f=c.outerRadius,p=c.startAngle,g=c.endAngle,m=c.clockWise,v=(h+f)/2,x=VMe(p,g),w=x>=0?1:-1,y,k;i==="insideStart"?(y=p+w*s,k=m):i==="insideEnd"?(y=g-w*s,k=!m):i==="end"&&(y=g+w*s,k=m),k=x<=0?k:!k;var S=nn(u,d,v,y),_=nn(u,d,v,y+(k?1:-1)*359),C="M".concat(S.x,",").concat(S.y,` 914 A`).concat(v,",").concat(v,",0,1,").concat(k?0:1,`, 915 `).concat(_.x,",").concat(_.y),T=ut(e.id)?Pf("recharts-radial-line-"):e.id;return D.createElement("text",gg({},r,{dominantBaseline:"central",className:pt("recharts-radial-bar-label",o)}),D.createElement("defs",null,D.createElement("path",{id:T,d:C})),D.createElement("textPath",{xlinkHref:"#".concat(T)},n))},qMe=function(e){var n=e.viewBox,r=e.offset,i=e.position,a=n,s=a.cx,o=a.cy,c=a.innerRadius,u=a.outerRadius,d=a.startAngle,h=a.endAngle,f=(d+h)/2;if(i==="outside"){var p=nn(s,o,u+r,f),g=p.x,m=p.y;return{x:g,y:m,textAnchor:g>=s?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:s,y:o,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:s,y:o,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:s,y:o,textAnchor:"middle",verticalAnchor:"end"};var v=(c+u)/2,x=nn(s,o,v,f),w=x.x,y=x.y;return{x:w,y,textAnchor:"middle",verticalAnchor:"middle"}},KMe=function(e){var n=e.viewBox,r=e.parentViewBox,i=e.offset,a=e.position,s=n,o=s.x,c=s.y,u=s.width,d=s.height,h=d>=0?1:-1,f=h*i,p=h>0?"end":"start",g=h>0?"start":"end",m=u>=0?1:-1,v=m*i,x=m>0?"end":"start",w=m>0?"start":"end";if(a==="top"){var y={x:o+u/2,y:c-h*i,textAnchor:"middle",verticalAnchor:p};return Yn(Yn({},y),r?{height:Math.max(c-r.y,0),width:u}:{})}if(a==="bottom"){var k={x:o+u/2,y:c+d+f,textAnchor:"middle",verticalAnchor:g};return Yn(Yn({},k),r?{height:Math.max(r.y+r.height-(c+d),0),width:u}:{})}if(a==="left"){var S={x:o-v,y:c+d/2,textAnchor:x,verticalAnchor:"middle"};return Yn(Yn({},S),r?{width:Math.max(S.x-r.x,0),height:d}:{})}if(a==="right"){var _={x:o+u+v,y:c+d/2,textAnchor:w,verticalAnchor:"middle"};return Yn(Yn({},_),r?{width:Math.max(r.x+r.width-_.x,0),height:d}:{})}var C=r?{width:u,height:d}:{};return a==="insideLeft"?Yn({x:o+v,y:c+d/2,textAnchor:w,verticalAnchor:"middle"},C):a==="insideRight"?Yn({x:o+u-v,y:c+d/2,textAnchor:x,verticalAnchor:"middle"},C):a==="insideTop"?Yn({x:o+u/2,y:c+f,textAnchor:"middle",verticalAnchor:g},C):a==="insideBottom"?Yn({x:o+u/2,y:c+d-f,textAnchor:"middle",verticalAnchor:p},C):a==="insideTopLeft"?Yn({x:o+v,y:c+f,textAnchor:w,verticalAnchor:g},C):a==="insideTopRight"?Yn({x:o+u-v,y:c+f,textAnchor:x,verticalAnchor:g},C):a==="insideBottomLeft"?Yn({x:o+v,y:c+d-f,textAnchor:w,verticalAnchor:p},C):a==="insideBottomRight"?Yn({x:o+u-v,y:c+d-f,textAnchor:x,verticalAnchor:p},C):Cf(a)&&(Ce(a.x)||Nl(a.x))&&(Ce(a.y)||Nl(a.y))?Yn({x:o+Wr(a.x,u),y:c+Wr(a.y,d),textAnchor:"end",verticalAnchor:"end"},C):Yn({x:o+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},C)},GMe=function(e){return"cx"in e&&Ce(e.cx)};function lr(t){var e=t.offset,n=e===void 0?5:e,r=$Me(t,OMe),i=Yn({offset:n},r),a=i.viewBox,s=i.position,o=i.value,c=i.children,u=i.content,d=i.className,h=d===void 0?"":d,f=i.textBreakAll;if(!a||ut(o)&&ut(c)&&!b.isValidElement(u)&&!it(u))return null;if(b.isValidElement(u))return b.cloneElement(u,i);var p;if(it(u)){if(p=b.createElement(u,i),b.isValidElement(p))return p}else p=WMe(i);var g=GMe(a),m=Ye(i,!0);if(g&&(s==="insideStart"||s==="insideEnd"||s==="end"))return HMe(i,p,m);var v=g?qMe(i):KMe(i);return D.createElement(pu,gg({className:pt("recharts-label",h)},m,v,{breakAll:f}),p)}lr.displayName="Label";var uK=function(e){var n=e.cx,r=e.cy,i=e.angle,a=e.startAngle,s=e.endAngle,o=e.r,c=e.radius,u=e.innerRadius,d=e.outerRadius,h=e.x,f=e.y,p=e.top,g=e.left,m=e.width,v=e.height,x=e.clockWise,w=e.labelViewBox;if(w)return w;if(Ce(m)&&Ce(v)){if(Ce(h)&&Ce(f))return{x:h,y:f,width:m,height:v};if(Ce(p)&&Ce(g))return{x:p,y:g,width:m,height:v}}return Ce(h)&&Ce(f)?{x:h,y:f,width:0,height:0}:Ce(n)&&Ce(r)?{cx:n,cy:r,startAngle:a||i||0,endAngle:s||i||0,innerRadius:u||0,outerRadius:d||c||o||0,clockWise:x}:e.viewBox?e.viewBox:{}},YMe=function(e,n){return e?e===!0?D.createElement(lr,{key:"label-implicit",viewBox:n}):nr(e)?D.createElement(lr,{key:"label-implicit",viewBox:n,value:e}):b.isValidElement(e)?e.type===lr?b.cloneElement(e,{key:"label-implicit",viewBox:n}):D.createElement(lr,{key:"label-implicit",content:e,viewBox:n}):it(e)?D.createElement(lr,{key:"label-implicit",content:e,viewBox:n}):Cf(e)?D.createElement(lr,gg({viewBox:n},e,{key:"label-implicit"})):null:null},JMe=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var i=e.children,a=uK(e),s=Ni(i,lr).map(function(c,u){return b.cloneElement(c,{viewBox:n||a,key:"label-".concat(u)})});if(!r)return s;var o=YMe(e.label,n||a);return[o].concat(RMe(s))};lr.parseViewBox=uK;lr.renderCallByParent=JMe;function XMe(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var ZMe=XMe;const QMe=Lt(ZMe);function vg(t){"@babel/helpers - typeof";return vg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vg(t)}var eIe=["valueAccessor"],tIe=["data","dataKey","clockWise","id","textBreakAll"];function nIe(t){return sIe(t)||aIe(t)||iIe(t)||rIe()}function rIe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 916In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iIe(t,e){if(t){if(typeof t=="string")return oE(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oE(t,e)}}function aIe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function sIe(t){if(Array.isArray(t))return oE(t)}function oE(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Hb(){return Hb=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Hb.apply(this,arguments)}function O3(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function R3(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?O3(Object(n),!0).forEach(function(r){oIe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):O3(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function oIe(t,e,n){return e=cIe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cIe(t){var e=lIe(t,"string");return vg(e)=="symbol"?e:e+""}function lIe(t,e){if(vg(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(vg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function D3(t,e){if(t==null)return{};var n=uIe(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function uIe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var dIe=function(e){return Array.isArray(e.value)?QMe(e.value):e.value};function uo(t){var e=t.valueAccessor,n=e===void 0?dIe:e,r=D3(t,eIe),i=r.data,a=r.dataKey,s=r.clockWise,o=r.id,c=r.textBreakAll,u=D3(r,tIe);return!i||!i.length?null:D.createElement(Rt,{className:"recharts-label-list"},i.map(function(d,h){var f=ut(a)?n(d,h):er(d&&d.payload,a),p=ut(o)?{}:{id:"".concat(o,"-").concat(h)};return D.createElement(lr,Hb({},Ye(d,!0),u,p,{parentViewBox:d.parentViewBox,value:f,textBreakAll:c,viewBox:lr.parseViewBox(ut(s)?d:R3(R3({},d),{},{clockWise:s})),key:"label-".concat(h),index:h}))}))}uo.displayName="LabelList";function hIe(t,e){return t?t===!0?D.createElement(uo,{key:"labelList-implicit",data:e}):D.isValidElement(t)||it(t)?D.createElement(uo,{key:"labelList-implicit",data:e,content:t}):Cf(t)?D.createElement(uo,Hb({data:e},t,{key:"labelList-implicit"})):null:null}function fIe(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var r=t.children,i=Ni(r,uo).map(function(s,o){return b.cloneElement(s,{data:e,key:"labelList-".concat(o)})});if(!n)return i;var a=hIe(t.label,e);return[a].concat(nIe(i))}uo.renderCallByParent=fIe;function yg(t){"@babel/helpers - typeof";return yg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yg(t)}function cE(){return cE=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},cE.apply(this,arguments)}function M3(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function I3(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?M3(Object(n),!0).forEach(function(r){pIe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):M3(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function pIe(t,e,n){return e=mIe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function mIe(t){var e=gIe(t,"string");return yg(e)=="symbol"?e:e+""}function gIe(t,e){if(yg(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(yg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var vIe=function(e,n){var r=zr(n-e),i=Math.min(Math.abs(n-e),359.999);return r*i},vy=function(e){var n=e.cx,r=e.cy,i=e.radius,a=e.angle,s=e.sign,o=e.isExternal,c=e.cornerRadius,u=e.cornerIsExternal,d=c*(o?1:-1)+i,h=Math.asin(c/d)/Vb,f=u?a:a+s*h,p=nn(n,r,d,f),g=nn(n,r,i,f),m=u?a-s*h:a,v=nn(n,r,d*Math.cos(h*Vb),m);return{center:p,circleTangency:g,lineTangency:v,theta:h}},dK=function(e){var n=e.cx,r=e.cy,i=e.innerRadius,a=e.outerRadius,s=e.startAngle,o=e.endAngle,c=vIe(s,o),u=s+c,d=nn(n,r,a,s),h=nn(n,r,a,u),f="M ".concat(d.x,",").concat(d.y,` 917 A `).concat(a,",").concat(a,`,0, 918 `).concat(+(Math.abs(c)>180),",").concat(+(s>u),`, 919 `).concat(h.x,",").concat(h.y,` 920 `);if(i>0){var p=nn(n,r,i,s),g=nn(n,r,i,u);f+="L ".concat(g.x,",").concat(g.y,` 921 A `).concat(i,",").concat(i,`,0, 922 `).concat(+(Math.abs(c)>180),",").concat(+(s<=u),`, 923 `).concat(p.x,",").concat(p.y," Z")}else f+="L ".concat(n,",").concat(r," Z");return f},yIe=function(e){var n=e.cx,r=e.cy,i=e.innerRadius,a=e.outerRadius,s=e.cornerRadius,o=e.forceCornerRadius,c=e.cornerIsExternal,u=e.startAngle,d=e.endAngle,h=zr(d-u),f=vy({cx:n,cy:r,radius:a,angle:u,sign:h,cornerRadius:s,cornerIsExternal:c}),p=f.circleTangency,g=f.lineTangency,m=f.theta,v=vy({cx:n,cy:r,radius:a,angle:d,sign:-h,cornerRadius:s,cornerIsExternal:c}),x=v.circleTangency,w=v.lineTangency,y=v.theta,k=c?Math.abs(u-d):Math.abs(u-d)-m-y;if(k<0)return o?"M ".concat(g.x,",").concat(g.y,` 924 a`).concat(s,",").concat(s,",0,0,1,").concat(s*2,`,0 925 a`).concat(s,",").concat(s,",0,0,1,").concat(-s*2,`,0 926 `):dK({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:u,endAngle:d});var S="M ".concat(g.x,",").concat(g.y,` 927 A`).concat(s,",").concat(s,",0,0,").concat(+(h<0),",").concat(p.x,",").concat(p.y,` 928 A`).concat(a,",").concat(a,",0,").concat(+(k>180),",").concat(+(h<0),",").concat(x.x,",").concat(x.y,` 929 A`).concat(s,",").concat(s,",0,0,").concat(+(h<0),",").concat(w.x,",").concat(w.y,` 930 `);if(i>0){var _=vy({cx:n,cy:r,radius:i,angle:u,sign:h,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),C=_.circleTangency,T=_.lineTangency,E=_.theta,j=vy({cx:n,cy:r,radius:i,angle:d,sign:-h,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),P=j.circleTangency,M=j.lineTangency,U=j.theta,N=c?Math.abs(u-d):Math.abs(u-d)-E-U;if(N<0&&s===0)return"".concat(S,"L").concat(n,",").concat(r,"Z");S+="L".concat(M.x,",").concat(M.y,` 931 A`).concat(s,",").concat(s,",0,0,").concat(+(h<0),",").concat(P.x,",").concat(P.y,` 932 A`).concat(i,",").concat(i,",0,").concat(+(N>180),",").concat(+(h>0),",").concat(C.x,",").concat(C.y,` 933 A`).concat(s,",").concat(s,",0,0,").concat(+(h<0),",").concat(T.x,",").concat(T.y,"Z")}else S+="L".concat(n,",").concat(r,"Z");return S},bIe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},hK=function(e){var n=I3(I3({},bIe),e),r=n.cx,i=n.cy,a=n.innerRadius,s=n.outerRadius,o=n.cornerRadius,c=n.forceCornerRadius,u=n.cornerIsExternal,d=n.startAngle,h=n.endAngle,f=n.className;if(s<a||d===h)return null;var p=pt("recharts-sector",f),g=s-a,m=Wr(o,g,0,!0),v;return m>0&&Math.abs(d-h)<360?v=yIe({cx:r,cy:i,innerRadius:a,outerRadius:s,cornerRadius:Math.min(m,g/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:h}):v=dK({cx:r,cy:i,innerRadius:a,outerRadius:s,startAngle:d,endAngle:h}),D.createElement("path",cE({},Ye(n,!0),{className:p,d:v,role:"img"}))};function bg(t){"@babel/helpers - typeof";return bg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bg(t)}function lE(){return lE=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},lE.apply(this,arguments)}function L3(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function $3(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?L3(Object(n),!0).forEach(function(r){xIe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):L3(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function xIe(t,e,n){return e=wIe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wIe(t){var e=SIe(t,"string");return bg(e)=="symbol"?e:e+""}function SIe(t,e){if(bg(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(bg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var F3={curveBasisClosed:xke,curveBasisOpen:wke,curveBasis:bke,curveBumpX:ake,curveBumpY:ske,curveLinearClosed:Ske,curveLinear:i1,curveMonotoneX:kke,curveMonotoneY:_ke,curveNatural:Cke,curveStep:Tke,curveStepAfter:jke,curveStepBefore:Eke},yy=function(e){return e.x===+e.x&&e.y===+e.y},hp=function(e){return e.x},fp=function(e){return e.y},kIe=function(e,n){if(it(e))return e;var r="curve".concat(n1(e));return(r==="curveMonotone"||r==="curveBump")&&n?F3["".concat(r).concat(n==="vertical"?"Y":"X")]:F3[r]||i1},_Ie=function(e){var n=e.type,r=n===void 0?"linear":n,i=e.points,a=i===void 0?[]:i,s=e.baseLine,o=e.layout,c=e.connectNulls,u=c===void 0?!1:c,d=kIe(r,o),h=u?a.filter(function(m){return yy(m)}):a,f;if(Array.isArray(s)){var p=u?s.filter(function(m){return yy(m)}):s,g=h.map(function(m,v){return $3($3({},m),{},{base:p[v]})});return o==="vertical"?f=cy().y(fp).x1(hp).x0(function(m){return m.base.x}):f=cy().x(hp).y1(fp).y0(function(m){return m.base.y}),f.defined(yy).curve(d),f(g)}return o==="vertical"&&Ce(s)?f=cy().y(fp).x1(hp).x0(s):Ce(s)?f=cy().x(hp).y1(fp).y0(s):f=sH().x(hp).y(fp),f.defined(yy).curve(d),f(h)},qb=function(e){var n=e.className,r=e.points,i=e.path,a=e.pathRef;if((!r||!r.length)&&!i)return null;var s=r&&r.length?_Ie(e):i;return b.createElement("path",lE({},Ye(e,!1),gb(e),{className:pt("recharts-curve",n),d:s,ref:a}))},CIe=Object.getOwnPropertyNames,TIe=Object.getOwnPropertySymbols,EIe=Object.prototype.hasOwnProperty;function B3(t,e){return function(r,i,a){return t(r,i,a)&&e(r,i,a)}}function by(t){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,i);var a=i.cache,s=a.get(n),o=a.get(r);if(s&&o)return s===r&&o===n;a.set(n,r),a.set(r,n);var c=t(n,r,i);return a.delete(n),a.delete(r),c}}function U3(t){return CIe(t).concat(TIe(t))}var jIe=Object.hasOwn||function(t,e){return EIe.call(t,e)};function Tu(t,e){return t===e||!t&&!e&&t!==t&&e!==e}var PIe="__v",NIe="__o",AIe="_owner",z3=Object.getOwnPropertyDescriptor,W3=Object.keys;function OIe(t,e,n){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function RIe(t,e){return Tu(t.getTime(),e.getTime())}function DIe(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function MIe(t,e){return t===e}function V3(t,e,n){var r=t.size;if(r!==e.size)return!1;if(!r)return!0;for(var i=new Array(r),a=t.entries(),s,o,c=0;(s=a.next())&&!s.done;){for(var u=e.entries(),d=!1,h=0;(o=u.next())&&!o.done;){if(i[h]){h++;continue}var f=s.value,p=o.value;if(n.equals(f[0],p[0],c,h,t,e,n)&&n.equals(f[1],p[1],f[0],p[0],t,e,n)){d=i[h]=!0;break}h++}if(!d)return!1;c++}return!0}var IIe=Tu;function LIe(t,e,n){var r=W3(t),i=r.length;if(W3(e).length!==i)return!1;for(;i-- >0;)if(!fK(t,e,n,r[i]))return!1;return!0}function pp(t,e,n){var r=U3(t),i=r.length;if(U3(e).length!==i)return!1;for(var a,s,o;i-- >0;)if(a=r[i],!fK(t,e,n,a)||(s=z3(t,a),o=z3(e,a),(s||o)&&(!s||!o||s.configurable!==o.configurable||s.enumerable!==o.enumerable||s.writable!==o.writable)))return!1;return!0}function $Ie(t,e){return Tu(t.valueOf(),e.valueOf())}function FIe(t,e){return t.source===e.source&&t.flags===e.flags}function H3(t,e,n){var r=t.size;if(r!==e.size)return!1;if(!r)return!0;for(var i=new Array(r),a=t.values(),s,o;(s=a.next())&&!s.done;){for(var c=e.values(),u=!1,d=0;(o=c.next())&&!o.done;){if(!i[d]&&n.equals(s.value,o.value,s.value,o.value,t,e,n)){u=i[d]=!0;break}d++}if(!u)return!1}return!0}function BIe(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function UIe(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function fK(t,e,n,r){return(r===AIe||r===NIe||r===PIe)&&(t.$$typeof||e.$$typeof)?!0:jIe(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}
933var zIe="[object Arguments]",WIe="[object Boolean]",VIe="[object Date]",HIe="[object Error]",qIe="[object Map]",KIe="[object Number]",GIe="[object Object]",YIe="[object RegExp]",JIe="[object Set]",XIe="[object String]",ZIe="[object URL]",QIe=Array.isArray,q3=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,K3=Object.assign,e3e=Object.prototype.toString.call.bind(Object.prototype.toString);function t3e(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areErrorsEqual,i=t.areFunctionsEqual,a=t.areMapsEqual,s=t.areNumbersEqual,o=t.areObjectsEqual,c=t.arePrimitiveWrappersEqual,u=t.areRegExpsEqual,d=t.areSetsEqual,h=t.areTypedArraysEqual,f=t.areUrlsEqual;return function(g,m,v){if(g===m)return!0;if(g==null||m==null)return!1;var x=typeof g;if(x!==typeof m)return!1;if(x!=="object")return x==="number"?s(g,m,v):x==="function"?i(g,m,v):!1;var w=g.constructor;if(w!==m.constructor)return!1;if(w===Object)return o(g,m,v);if(QIe(g))return e(g,m,v);if(q3!=null&&q3(g))return h(g,m,v);if(w===Date)return n(g,m,v);if(w===RegExp)return u(g,m,v);if(w===Map)return a(g,m,v);if(w===Set)return d(g,m,v);var y=e3e(g);return y===VIe?n(g,m,v):y===YIe?u(g,m,v):y===qIe?a(g,m,v):y===JIe?d(g,m,v):y===GIe?typeof g.then!="function"&&typeof m.then!="function"&&o(g,m,v):y===ZIe?f(g,m,v):y===HIe?r(g,m,v):y===zIe?o(g,m,v):y===WIe||y===KIe||y===XIe?c(g,m,v):!1}}function n3e(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?pp:OIe,areDatesEqual:RIe,areErrorsEqual:DIe,areFunctionsEqual:MIe,areMapsEqual:r?B3(V3,pp):V3,areNumbersEqual:IIe,areObjectsEqual:r?pp:LIe,arePrimitiveWrappersEqual:$Ie,areRegExpsEqual:FIe,areSetsEqual:r?B3(H3,pp):H3,areTypedArraysEqual:r?pp:BIe,areUrlsEqual:UIe};if(n&&(i=K3({},i,n(i))),e){var a=by(i.areArraysEqual),s=by(i.areMapsEqual),o=by(i.areObjectsEqual),c=by(i.areSetsEqual);i=K3({},i,{areArraysEqual:a,areMapsEqual:s,areObjectsEqual:o,areSetsEqual:c})}return i}function r3e(t){return function(e,n,r,i,a,s,o){return t(e,n,o)}}function i3e(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,a=t.strict;if(r)return function(c,u){var d=r(),h=d.cache,f=h===void 0?e?new WeakMap:void 0:h,p=d.meta;return n(c,u,{cache:f,equals:i,meta:p,strict:a})};if(e)return function(c,u){return n(c,u,{cache:new WeakMap,equals:i,meta:void 0,strict:a})};var s={cache:void 0,equals:i,meta:void 0,strict:a};return function(c,u){return n(c,u,s)}}var a3e=Zc();Zc({strict:!0});Zc({circular:!0});Zc({circular:!0,strict:!0});Zc({createInternalComparator:function(){return Tu}});Zc({strict:!0,createInternalComparator:function(){return Tu}});Zc({circular:!0,createInternalComparator:function(){return Tu}});Zc({circular:!0,createInternalComparator:function(){return Tu},strict:!0});function Zc(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,a=t.strict,s=a===void 0?!1:a,o=n3e(t),c=t3e(o),u=r?r(c):r3e(c);return i3e({circular:n,comparator:c,createState:i,equals:u,strict:s})}function s3e(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function G3(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(a){n<0&&(n=a),a-n>e?(t(a),n=-1):s3e(i)};requestAnimationFrame(r)}function uE(t){"@babel/helpers - typeof";return uE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},uE(t)}function o3e(t){return d3e(t)||u3e(t)||l3e(t)||c3e()}function c3e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 934In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function l3e(t,e){if(t){if(typeof t=="string")return Y3(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Y3(t,e)}}function Y3(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function u3e(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function d3e(t){if(Array.isArray(t))return t}function h3e(){var t={},e=function(){return null}
vendor: 59,651 bytes, lines 934-952
934,n=!1,r=function i(a){if(!n){if(Array.isArray(a)){if(!a.length)return;var s=a,o=o3e(s),c=o[0],u=o.slice(1);if(typeof c=="number"){G3(i.bind(null,u),c);return}i(c),G3(i.bind(null,u));return}uE(a)==="object"&&(t=a,e(t)),typeof a=="function"&&a()}};return{stop:function(){n=!0},start:function(a){n=!1,r(a)},subscribe:function(a){return e=a,function(){e=function(){return null}}}}}function xg(t){"@babel/helpers - typeof";return xg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xg(t)}function J3(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function X3(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?J3(Object(n),!0).forEach(function(r){pK(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):J3(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function pK(t,e,n){return e=f3e(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function f3e(t){var e=p3e(t,"string");return xg(e)==="symbol"?e:String(e)}function p3e(t,e){if(xg(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(xg(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var m3e=function(e,n){return[Object.keys(e),Object.keys(n)].reduce(function(r,i){return r.filter(function(a){return i.includes(a)})})},g3e=function(e){return e},v3e=function(e){return e.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},Zp=function(e,n){return Object.keys(n).reduce(function(r,i){return X3(X3({},r),{},pK({},i,e(i,n[i])))},{})},Z3=function(e,n,r){return e.map(function(i){return"".concat(v3e(i)," ").concat(n,"ms ").concat(r)}).join(",")};function y3e(t,e){return w3e(t)||x3e(t,e)||mK(t,e)||b3e()}function b3e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 935In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function x3e(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,o=[],c=!0,u=!1;try{if(a=(n=n.call(t)).next,e!==0)for(;!(c=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function w3e(t){if(Array.isArray(t))return t}function S3e(t){return C3e(t)||_3e(t)||mK(t)||k3e()}function k3e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 936In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mK(t,e){if(t){if(typeof t=="string")return dE(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dE(t,e)}}function _3e(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function C3e(t){if(Array.isArray(t))return dE(t)}function dE(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Kb=1e-4,gK=function(e,n){return[0,3*e,3*n-6*e,3*e-3*n+1]},vK=function(e,n){return e.map(function(r,i){return r*Math.pow(n,i)}).reduce(function(r,i){return r+i})},Q3=function(e,n){return function(r){var i=gK(e,n);return vK(i,r)}},T3e=function(e,n){return function(r){var i=gK(e,n),a=[].concat(S3e(i.map(function(s,o){return s*o}).slice(1)),[0]);return vK(a,r)}},e5=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n[0],a=n[1],s=n[2],o=n[3];if(n.length===1)switch(n[0]){case"linear":i=0,a=0,s=1,o=1;break;case"ease":i=.25,a=.1,s=.25,o=1;break;case"ease-in":i=.42,a=0,s=1,o=1;break;case"ease-out":i=.42,a=0,s=.58,o=1;break;case"ease-in-out":i=0,a=0,s=.58,o=1;break;default:{var c=n[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var u=c[1].split(")")[0].split(",").map(function(v){return parseFloat(v)}),d=y3e(u,4);i=d[0],a=d[1],s=d[2],o=d[3]}}}var h=Q3(i,s),f=Q3(a,o),p=T3e(i,s),g=function(x){return x>1?1:x<0?0:x},m=function(x){for(var w=x>1?1:x,y=w,k=0;k<8;++k){var S=h(y)-w,_=p(y);if(Math.abs(S-w)<Kb||_<Kb)return f(y);y=g(y-S/_)}return f(y)};return m.isStepper=!1,m},E3e=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.stiff,r=n===void 0?100:n,i=e.damping,a=i===void 0?8:i,s=e.dt,o=s===void 0?17:s,c=function(d,h,f){var p=-(d-h)*r,g=f*a,m=f+(p-g)*o/1e3,v=f*o/1e3+d;return Math.abs(v-h)<Kb&&Math.abs(m)<Kb?[h,0]:[v,m]};return c.isStepper=!0,c.dt=o,c},j3e=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n[0];if(typeof i=="string")switch(i){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return e5(i);case"spring":return E3e();default:if(i.split("(")[0]==="cubic-bezier")return e5(i)}return typeof i=="function"?i:null};function wg(t){"@babel/helpers - typeof";return wg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wg(t)}function t5(t){return A3e(t)||N3e(t)||yK(t)||P3e()}function P3e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 937In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function N3e(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function A3e(t){if(Array.isArray(t))return fE(t)}function n5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function fr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?n5(Object(n),!0).forEach(function(r){hE(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):n5(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function hE(t,e,n){return e=O3e(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function O3e(t){var e=R3e(t,"string");return wg(e)==="symbol"?e:String(e)}function R3e(t,e){if(wg(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(wg(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function D3e(t,e){return L3e(t)||I3e(t,e)||yK(t,e)||M3e()}function M3e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 938In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yK(t,e){if(t){if(typeof t=="string")return fE(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fE(t,e)}}function fE(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function I3e(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,o=[],c=!0,u=!1;try{if(a=(n=n.call(t)).next,e!==0)for(;!(c=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function L3e(t){if(Array.isArray(t))return t}var Gb=function(e,n,r){return e+(n-e)*r},pE=function(e){var n=e.from,r=e.to;return n!==r},$3e=function t(e,n,r){var i=Zp(function(a,s){if(pE(s)){var o=e(s.from,s.to,s.velocity),c=D3e(o,2),u=c[0],d=c[1];return fr(fr({},s),{},{from:u,velocity:d})}return s},n);return r<1?Zp(function(a,s){return pE(s)?fr(fr({},s),{},{velocity:Gb(s.velocity,i[a].velocity,r),from:Gb(s.from,i[a].from,r)}):s},n):t(e,i,r-1)};const F3e=function(t,e,n,r,i){var a=m3e(t,e),s=a.reduce(function(v,x){return fr(fr({},v),{},hE({},x,[t[x],e[x]]))},{}),o=a.reduce(function(v,x){return fr(fr({},v),{},hE({},x,{from:t[x],velocity:0,to:e[x]}))},{}),c=-1,u,d,h=function(){return null},f=function(){return Zp(function(x,w){return w.from},o)},p=function(){return!Object.values(o).filter(pE).length},g=function(x){u||(u=x);var w=x-u,y=w/n.dt;o=$3e(n,o,y),i(fr(fr(fr({},t),e),f())),u=x,p()||(c=requestAnimationFrame(h))},m=function(x){d||(d=x);var w=(x-d)/r,y=Zp(function(S,_){return Gb.apply(void 0,t5(_).concat([n(w)]))},s);if(i(fr(fr(fr({},t),e),y)),w<1)c=requestAnimationFrame(h);else{var k=Zp(function(S,_){return Gb.apply(void 0,t5(_).concat([n(1)]))},s);i(fr(fr(fr({},t),e),k))}};return h=n.isStepper?g:m,function(){return requestAnimationFrame(h),function(){cancelAnimationFrame(c)}}};function zh(t){"@babel/helpers - typeof";return zh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zh(t)}var B3e=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function U3e(t,e){if(t==null)return{};var n=z3e(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function z3e(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function Bk(t){return q3e(t)||H3e(t)||V3e(t)||W3e()}function W3e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 939In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function V3e(t,e){if(t){if(typeof t=="string")return mE(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mE(t,e)}}function H3e(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function q3e(t){if(Array.isArray(t))return mE(t)}function mE(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function r5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function va(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?r5(Object(n),!0).forEach(function(r){Ep(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r5(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Ep(t,e,n){return e=bK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function K3e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function G3e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,bK(r.key),r)}}function Y3e(t,e,n){return e&&G3e(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function bK(t){var e=J3e(t,"string");return zh(e)==="symbol"?e:String(e)}function J3e(t,e){if(zh(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(zh(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function X3e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&gE(t,e)}function gE(t,e){return gE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},gE(t,e)}function Z3e(t){var e=Q3e();return function(){var r=Yb(t),i;if(e){var a=Yb(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return vE(this,i)}}function vE(t,e){if(e&&(zh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yE(t)}function yE(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Q3e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Yb(t){return Yb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Yb(t)}var As=function(t){X3e(n,t);var e=Z3e(n);function n(r,i){var a;K3e(this,n),a=e.call(this,r,i);var s=a.props,o=s.isActive,c=s.attributeName,u=s.from,d=s.to,h=s.steps,f=s.children,p=s.duration;if(a.handleStyleChange=a.handleStyleChange.bind(yE(a)),a.changeStyle=a.changeStyle.bind(yE(a)),!o||p<=0)return a.state={style:{}},typeof f=="function"&&(a.state={style:d}),vE(a);if(h&&h.length)a.state={style:h[0].style};else if(u){if(typeof f=="function")return a.state={style:u},vE(a);a.state={style:c?Ep({},c,u):u}}else a.state={style:{}};return a}return Y3e(n,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,s=i.canBegin;this.mounted=!0,!(!a||!s)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,s=a.isActive,o=a.canBegin,c=a.attributeName,u=a.shouldReAnimate,d=a.to,h=a.from,f=this.state.style;if(o){if(!s){var p={style:c?Ep({},c,d):d};this.state&&f&&(c&&f[c]!==d||!c&&f!==d)&&this.setState(p);return}if(!(a3e(i.to,d)&&i.canBegin&&i.isActive)){var g=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var m=g||u?h:i.to;if(this.state&&f){var v={style:c?Ep({},c,m):m};(c&&f[c]!==m||!c&&f!==m)&&this.setState(v)}this.runAnimation(va(va({},this.props),{},{from:m,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,s=i.from,o=i.to,c=i.duration,u=i.easing,d=i.begin,h=i.onAnimationEnd,f=i.onAnimationStart,p=F3e(s,o,j3e(u),c,this.changeStyle),g=function(){a.stopJSAnimation=p()};this.manager.start([f,d,g,c,h])}},{key:"runStepAnimation",value:function(i){var a=this,s=i.steps,o=i.begin,c=i.onAnimationStart,u=s[0],d=u.style,h=u.duration,f=h===void 0?0:h,p=function(m,v,x){if(x===0)return m;var w=v.duration,y=v.easing,k=y===void 0?"ease":y,S=v.style,_=v.properties,C=v.onAnimationEnd,T=x>0?s[x-1]:v,E=_||Object.keys(S);if(typeof k=="function"||k==="spring")return[].concat(Bk(m),[a.runJSAnimation.bind(a,{from:T.style,to:S,duration:w,easing:k}),w]);var j=Z3(E,w,k),P=va(va(va({},T.style),S),{},{transition:j});return[].concat(Bk(m),[P,w,C]).filter(g3e)};return this.manager.start([c].concat(Bk(s.reduce(p,[d,Math.max(f,o)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=h3e());var a=i.begin,s=i.duration,o=i.attributeName,c=i.to,u=i.easing,d=i.onAnimationStart,h=i.onAnimationEnd,f=i.steps,p=i.children,g=this.manager;if(this.unSubscribe=g.subscribe(this.handleStyleChange),typeof u=="function"||typeof p=="function"||u==="spring"){this.runJSAnimation(i);return}if(f.length>1){this.runStepAnimation(i);return}var m=o?Ep({},o,c):c,v=Z3(Object.keys(m),s,u);g.start([d,a,va(va({},m),{},{transition:v}),s,h])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var s=i.duration;i.attributeName,i.easing;var o=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var c=U3e(i,B3e),u=b.Children.count(a),d=this.state.style;if(typeof a=="function")return a(d);if(!o||u===0||s<=0)return a;var h=function(p){var g=p.props,m=g.style,v=m===void 0?{}:m,x=g.className,w=b.cloneElement(p,va(va({},c),{},{style:va(va({},v),d),className:x}));return w};return u===1?h(b.Children.only(a)):D.createElement("div",null,b.Children.map(a,function(f){return h(f)}))}}]),n}(b.PureComponent);As.displayName="Animate";As.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};As.propTypes={from:et.oneOfType([et.object,et.string]),to:et.oneOfType([et.object,et.string]),attributeName:et.string,duration:et.number,begin:et.number,easing:et.oneOfType([et.string,et.func]),steps:et.arrayOf(et.shape({duration:et.number.isRequired,style:et.object.isRequired,easing:et.oneOfType([et.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),et.func]),properties:et.arrayOf("string"),onAnimationEnd:et.func})),children:et.oneOfType([et.node,et.func]),isActive:et.bool,canBegin:et.bool,onAnimationEnd:et.func,shouldReAnimate:et.bool,onAnimationStart:et.func,onAnimationReStart:et.func};function Sg(t){"@babel/helpers - typeof";return Sg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sg(t)}function Jb(){return Jb=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Jb.apply(this,arguments)}function e5e(t,e){return i5e(t)||r5e(t,e)||n5e(t,e)||t5e()}function t5e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 940In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function n5e(t,e){if(t){if(typeof t=="string")return i5(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i5(t,e)}}function i5(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function r5e(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,o=[],c=!0,u=!1;try{if(a=(n=n.call(t)).next,e!==0)for(;!(c=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function i5e(t){if(Array.isArray(t))return t}function a5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function s5(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?a5(Object(n),!0).forEach(function(r){a5e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a5(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function a5e(t,e,n){return e=s5e(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s5e(t){var e=o5e(t,"string");return Sg(e)=="symbol"?e:e+""}function o5e(t,e){if(Sg(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Sg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var o5=function(e,n,r,i,a){var s=Math.min(Math.abs(r)/2,Math.abs(i)/2),o=i>=0?1:-1,c=r>=0?1:-1,u=i>=0&&r>=0||i<0&&r<0?1:0,d;if(s>0&&a instanceof Array){for(var h=[0,0,0,0],f=0,p=4;f<p;f++)h[f]=a[f]>s?s:a[f];d="M".concat(e,",").concat(n+o*h[0]),h[0]>0&&(d+="A ".concat(h[0],",").concat(h[0],",0,0,").concat(u,",").concat(e+c*h[0],",").concat(n)),d+="L ".concat(e+r-c*h[1],",").concat(n),h[1]>0&&(d+="A ".concat(h[1],",").concat(h[1],",0,0,").concat(u,`, 941 `).concat(e+r,",").concat(n+o*h[1])),d+="L ".concat(e+r,",").concat(n+i-o*h[2]),h[2]>0&&(d+="A ".concat(h[2],",").concat(h[2],",0,0,").concat(u,`, 942 `).concat(e+r-c*h[2],",").concat(n+i)),d+="L ".concat(e+c*h[3],",").concat(n+i),h[3]>0&&(d+="A ".concat(h[3],",").concat(h[3],",0,0,").concat(u,`, 943 `).concat(e,",").concat(n+i-o*h[3])),d+="Z"}else if(s>0&&a===+a&&a>0){var g=Math.min(s,a);d="M ".concat(e,",").concat(n+o*g,` 944 A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(e+c*g,",").concat(n,` 945 L `).concat(e+r-c*g,",").concat(n,` 946 A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(e+r,",").concat(n+o*g,` 947 L `).concat(e+r,",").concat(n+i-o*g,` 948 A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(e+r-c*g,",").concat(n+i,` 949 L `).concat(e+c*g,",").concat(n+i,` 950 A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(e,",").concat(n+i-o*g," Z")}else d="M ".concat(e,",").concat(n," h ").concat(r," v ").concat(i," h ").concat(-r," Z");return d},c5e=function(e,n){if(!e||!n)return!1;var r=e.x,i=e.y,a=n.x,s=n.y,o=n.width,c=n.height;if(Math.abs(o)>0&&Math.abs(c)>0){var u=Math.min(a,a+o),d=Math.max(a,a+o),h=Math.min(s,s+c),f=Math.max(s,s+c);return r>=u&&r<=d&&i>=h&&i<=f}return!1},l5e={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},XN=function(e){var n=s5(s5({},l5e),e),r=b.useRef(),i=b.useState(-1),a=e5e(i,2),s=a[0],o=a[1];b.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var k=r.current.getTotalLength();k&&o(k)}catch{}},[]);var c=n.x,u=n.y,d=n.width,h=n.height,f=n.radius,p=n.className,g=n.animationEasing,m=n.animationDuration,v=n.animationBegin,x=n.isAnimationActive,w=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||h!==+h||d===0||h===0)return null;var y=pt("recharts-rectangle",p);return w?D.createElement(As,{canBegin:s>0,from:{width:d,height:h,x:c,y:u},to:{width:d,height:h,x:c,y:u},duration:m,animationEasing:g,isActive:w},function(k){var S=k.width,_=k.height,C=k.x,T=k.y;return D.createElement(As,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:m,isActive:x,easing:g},D.createElement("path",Jb({},Ye(n,!0),{className:y,d:o5(C,T,S,_,f),ref:r})))}):D.createElement("path",Jb({},Ye(n,!0),{className:y,d:o5(c,u,d,h,f)}))},u5e=["points","className","baseLinePoints","connectNulls"];function bd(){return bd=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},bd.apply(this,arguments)}function d5e(t,e){if(t==null)return{};var n=h5e(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function h5e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function c5(t){return g5e(t)||m5e(t)||p5e(t)||f5e()}function f5e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 951In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function p5e(t,e){if(t){if(typeof t=="string")return bE(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bE(t,e)}}function m5e(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function g5e(t){if(Array.isArray(t))return bE(t)}function bE(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var l5=function(e){return e&&e.x===+e.x&&e.y===+e.y},v5e=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return e.forEach(function(r){l5(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),l5(e[0])&&n[n.length-1].push(e[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},Qp=function(e,n){var r=v5e(e);n&&(r=[r.reduce(function(a,s){return[].concat(c5(a),c5(s))},[])]);var i=r.map(function(a){return a.reduce(function(s,o,c){return"".concat(s).concat(c===0?"M":"L").concat(o.x,",").concat(o.y)},"")}).join("");return r.length===1?"".concat(i,"Z"):i},y5e=function(e,n,r){var i=Qp(e,r);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(Qp(n.reverse(),r).slice(1))},b5e=function(e){var n=e.points,r=e.className,i=e.baseLinePoints,a=e.connectNulls,s=d5e(e,u5e);if(!n||!n.length)return null;var o=pt("recharts-polygon",r);if(i&&i.length){var c=s.stroke&&s.stroke!=="none",u=y5e(n,i,a);return D.createElement("g",{className:o},D.createElement("path",bd({},Ye(s,!0),{fill:u.slice(-1)==="Z"?s.fill:"none",stroke:"none",d:u})),c?D.createElement("path",bd({},Ye(s,!0),{fill:"none",d:Qp(n,a)})):null,c?D.createElement("path",bd({},Ye(s,!0),{fill:"none",d:Qp(i,a)})):null)}var d=Qp(n,a);return D.createElement("path",bd({},Ye(s,!0),{fill:d.slice(-1)==="Z"?s.fill:"none",className:o,d}))};function xE(){return xE=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},xE.apply(this,arguments)}var w1=function(e){var n=e.cx,r=e.cy,i=e.r,a=e.className,s=pt("recharts-dot",a);return n===+n&&r===+r&&i===+i?b.createElement("circle",xE({},Ye(e,!1),gb(e),{className:s,cx:n,cy:r,r:i})):null};function kg(t){"@babel/helpers - typeof";return kg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kg(t)}var x5e=["x","y","top","left","width","height","className"];function wE(){return wE=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},wE.apply(this,arguments)}function u5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function w5e(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?u5(Object(n),!0).forEach(function(r){S5e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):u5(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function S5e(t,e,n){return e=k5e(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function k5e(t){var e=_5e(t,"string");return kg(e)=="symbol"?e:e+""}function _5e(t,e){if(kg(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(kg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function C5e(t,e){if(t==null)return{};var n=T5e(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function T5e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var E5e=function(e,n,r,i,a,s){return"M".concat(e,",").concat(a,"v").concat(i,"M").concat(s,",").concat(n,"h").concat(r)},j5e=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,a=i===void 0?0:i,s=e.top,o=s===void 0?0:s,c=e.left,u=c===void 0?0:c,d=e.width,h=d===void 0?0:d,f=e.height,p=f===void 0?0:f,g=e.className,m=C5e(e,x5e),v=w5e({x:r,y:a,top:o,left:u,width:h,height:p},m);return!Ce(r)||!Ce(a)||!Ce(h)||!Ce(p)||!Ce(o)||!Ce(u)?null:D.createElement("path",wE({},Ye(v,!0),{className:pt("recharts-cross",g),d:E5e(r,a,h,p,o,u)}))},P5e=g1,N5e=Dq,A5e=Ms;function O5e(t,e){return t&&t.length?P5e(t,A5e(e),N5e):void 0}var R5e=O5e;const D5e=Lt(R5e);var M5e=g1,I5e=Ms,L5e=Mq;function $5e(t,e){return t&&t.length?M5e(t,I5e(e),L5e):void 0}var F5e=$5e;const B5e=Lt(F5e);var U5e=["cx","cy","angle","ticks","axisLine"],z5e=["ticks","tick","angle","tickFormatter","stroke"];function Wh(t){"@babel/helpers - typeof";return Wh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wh(t)}function em(){return em=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},em.apply(this,arguments)}function d5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function rl(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?d5(Object(n),!0).forEach(function(r){S1(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):d5(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function h5(t,e){if(t==null)return{};var n=W5e(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function W5e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function V5e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f5(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,wK(r.key),r)}}function H5e(t,e,n){return e&&f5(t.prototype,e),n&&f5(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function q5e(t,e,n){return e=Xb(e),K5e(t,xK()?Reflect.construct(e,n||[],Xb(t).constructor):e.apply(t,n))}function K5e(t,e){if(e&&(Wh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return G5e(t)}function G5e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function xK(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(xK=function(){return!!t})()}function Xb(t){return Xb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Xb(t)}function Y5e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&SE(t,e)}function SE(t,e){return SE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},SE(t,e)}function S1(t,e,n){return e=wK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wK(t){var e=J5e(t,"string");return Wh(e)=="symbol"?e:e+""}function J5e(t,e){if(Wh(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Wh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var k1=function(t){function e(){return V5e(this,e),q5e(this,e,arguments)}return Y5e(e,t),H5e(e,[{key:"getTickValueCoord",value:function(r){var i=r.coordinate,a=this.props,s=a.angle,o=a.cx,c=a.cy;return nn(o,c,i,s)}},{key:"getTickTextAnchor",value:function(){var r=this.props.orientation,i;switch(r){case"left":i="end";break;case"right":i="start";break;default:i="middle";break}return i}},{key:"getViewBox",value:function(){var r=this.props,i=r.cx,a=r.cy,s=r.angle,o=r.ticks,c=D5e(o,function(d){return d.coordinate||0}),u=B5e(o,function(d){return d.coordinate||0});return{cx:i,cy:a,startAngle:s,endAngle:s,innerRadius:u.coordinate||0,outerRadius:c.coordinate||0}}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.cx,a=r.cy,s=r.angle,o=r.ticks,c=r.axisLine,u=h5(r,U5e),d=o.reduce(function(g,m){return[Math.min(g[0],m.coordinate),Math.max(g[1],m.coordinate)]},[1/0,-1/0]),h=nn(i,a,d[0],s),f=nn(i,a,d[1],s),p=rl(rl(rl({},Ye(u,!1)),{},{fill:"none"},Ye(c,!1)),{},{x1:h.x,y1:h.y,x2:f.x,y2:f.y});return D.createElement("line",em({className:"recharts-polar-radius-axis-line"},p))}},{key:"renderTicks",value:function(){var r=this,i=this.props,a=i.ticks,s=i.tick,o=i.angle,c=i.tickFormatter,u=i.stroke,d=h5(i,z5e),h=this.getTickTextAnchor(),f=Ye(d,!1),p=Ye(s,!1),g=a.map(function(m,v){var x=r.getTickValueCoord(m),w=rl(rl(rl(rl({textAnchor:h,transform:"rotate(".concat(90-o,", ").concat(x.x,", ").concat(x.y,")")},f),{},{stroke:"none",fill:u},p),{},{index:v},x),{},{payload:m});return D.createElement(Rt,em({className:pt("recharts-polar-radius-axis-tick",lK(s)),key:"tick-".concat(m.coordinate)},fu(r.props,m,v)),e.renderTickItem(s,w,c?c(m.value,v):m.value))});return D.createElement(Rt,{className:"recharts-polar-radius-axis-ticks"},g)}},{key:"render",value:function(){var r=this.props,i=r.ticks,a=r.axisLine,s=r.tick;return!i||!i.length?null:D.createElement(Rt,{className:pt("recharts-polar-radius-axis",this.props.className)},a&&this.renderAxisLine(),s&&this.renderTicks(),lr.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(r,i,a){var s;return D.isValidElement(r)?s=D.cloneElement(r,i):it(r)?s=r(i):s=D.createElement(pu,em({},i,{className:"recharts-polar-radius-axis-tick-value"}),a),s}}])}(b.PureComponent);S1(k1,"displayName","PolarRadiusAxis");S1(k1,"axisType","radiusAxis");S1(k1,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function Vh(t){"@babel/helpers - typeof";return Vh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vh(t)}function _l(){return _l=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},_l.apply(this,arguments)}function p5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function il(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?p5(Object(n),!0).forEach(function(r){_1(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p5(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function X5e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function m5(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,kK(r.key),r)}}function Z5e(t,e,n){return e&&m5(t.prototype,e),n&&m5(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Q5e(t,e,n){return e=Zb(e),e8e(t,SK()?Reflect.construct(e,n||[],Zb(t).constructor):e.apply(t,n))}function e8e(t,e){if(e&&(Vh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return t8e(t)}function t8e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function SK(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(SK=function(){return!!t})()}function Zb(t){return Zb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Zb(t)}function n8e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&kE(t,e)}function kE(t,e){return kE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},kE(t,e)}function _1(t,e,n){return e=kK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function kK(t){var e=r8e(t,"string");return Vh(e)=="symbol"?e:e+""}function r8e(t,e){if(Vh(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Vh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var i8e=Math.PI/180,g5=1e-5,C1=function(t){function e(){return X5e(this,e),Q5e(this,e,arguments)}return n8e(e,t),Z5e(e,[{key:"getTickLineCoord",value:function(r){var i=this.props,a=i.cx,s=i.cy,o=i.radius,c=i.orientation,u=i.tickSize,d=u||8,h=nn(a,s,o,r.coordinate),f=nn(a,s,o+(c==="inner"?-1:1)*d,r.coordinate);return{x1:h.x,y1:h.y,x2:f.x,y2:f.y}}},{key:"getTickTextAnchor",value:function(r){var i=this.props.orientation,a=Math.cos(-r.coordinate*i8e),s;return a>g5?s=i==="outer"?"start":"end":a<-g5?s=i==="outer"?"end":"start":s="middle",s}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.cx,a=r.cy,s=r.radius,o=r.axisLine,c=r.axisLineType,u=il(il({},Ye(this.props,!1)),{},{fill:"none"},Ye(o,!1));if(c==="circle")return D.createElement(w1,_l({className:"recharts-polar-angle-axis-line"},u,{cx:i,cy:a,r:s}));var d=this.props.ticks,h=d.map(function(f){return nn(i,a,s,f.coordinate)});return D.createElement(b5e,_l({className:"recharts-polar-angle-axis-line"},u,{points:h}))}},{key:"renderTicks",value:function(){var r=this,i=this.props,a=i.ticks,s=i.tick,o=i.tickLine,c=i.tickFormatter,u=i.stroke,d=Ye(this.props,!1),h=Ye(s,!1),f=il(il({},d),{},{fill:"none"},Ye(o,!1)),p=a.map(function(g,m){var v=r.getTickLineCoord(g),x=r.getTickTextAnchor(g),w=il(il(il({textAnchor:x},d),{},{stroke:"none",fill:u},h),{},{index:m,payload:g,x:v.x2,y:v.y2});return D.createElement(Rt,_l({className:pt("recharts-polar-angle-axis-tick",lK(s)),key:"tick-".concat(g.coordinate)},fu(r.props,g,m)),o&&D.createElement("line",_l({className:"recharts-polar-angle-axis-tick-line"},f,v)),s&&e.renderTickItem(s,w,c?c(g.value,m):g.value))});return D.createElement(Rt,{className:"recharts-polar-angle-axis-ticks"},p)}},{key:"render",value:function(){var r=this.props,i=r.ticks,a=r.radius,s=r.axisLine;return a<=0||!i||!i.length?null:D.createElement(Rt,{className:pt("recharts-polar-angle-axis",this.props.className)},s&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,i,a){var s;return D.isValidElement(r)?s=D.cloneElement(r,i):it(r)?s=r(i):s=D.createElement(pu,_l({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),s}}])}(b.PureComponent);_1(C1,"displayName","PolarAngleAxis");_1(C1,"axisType","angleAxis");_1(C1,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var a8e=NH,s8e=a8e(Object.getPrototypeOf,Object),o8e=s8e,c8e=Co,l8e=o8e,u8e=To,d8e="[object Object]",h8e=Function.prototype,f8e=Object.prototype,_K=h8e.toString,p8e=f8e.hasOwnProperty,m8e=_K.call(Object);function g8e(t){if(!u8e(t)||c8e(t)!=d8e)return!1;var e=l8e(t);if(e===null)return!0;var n=p8e.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&_K.call(n)==m8e}var v8e=g8e;const y8e=Lt(v8e);var b8e=Co,x8e=To,w8e="[object Boolean]";function S8e(t){return t===!0||t===!1||x8e(t)&&b8e(t)==w8e}var k8e=S8e;const _8e=Lt(k8e);function _g(t){"@babel/helpers - typeof";return _g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_g(t)}function Qb(){return Qb=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Qb.apply(this,arguments)}function C8e(t,e){return P8e(t)||j8e(t,e)||E8e(t,e)||T8e()}function T8e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 952In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function E8e(t,e){if(t){if(typeof t=="string")return v5(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v5(t,e)}}function v5(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function j8e(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,o=[],c=!0,u=!1;try{if(a=(n=n.call(t)).next,e!==0)for(;!(c=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function P8e(t){if(Array.isArray(t))return t}function y5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function b5(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?y5(Object(n),!0).forEach(function(r){N8e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):y5(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function N8e(t,e,n){return e=A8e(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function A8e(t){var e=O8e(t,"string");return _g(e)=="symbol"?e:e+""}function O8e(t,e){if(_g(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(_g(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var x5=function(e,n,r,i,a){var s=r-i,o;return o="M ".concat(e,",").concat(n),o+="L ".concat(e+r,",").concat(n),o+="L ".concat(e+r-s/2,",").concat(n+a),o+="L ".concat(e+r-s/2-i,",").concat(n+a),o+="L ".concat(e,",").concat(n," Z"),o},R8e={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},D8e=function(e){var n=b5(b5({},R8e),e),r=b.useRef(),i=b.useState(-1),a=C8e(i,2),s=a[0],o=a[1];b.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var y=r.current.getTotalLength();y&&o(y)}catch{}},[]);var c=n.x,u=n.y,d=n.upperWidth,h=n.lowerWidth,f=n.height,p=n.className,g=n.animationEasing,m=n.animationDuration,v=n.animationBegin,x=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||h!==+h||f!==+f||d===0&&h===0||f===0)return null;var w=pt("recharts-trapezoid",p);return x?D.createElement(As,{canBegin:s>0,from:{upperWidth:0,lowerWidth:0,height:f,x:c,y:u},to:{upperWidth:d,lowerWidth:h,height:f,x:c,y:u},duration:m,animationEasing:g,isActive:x},function(y){var k=y.upperWidth,S=y.lowerWidth,_=y.height,C=y.x,T=y.y;return D.createElement(As,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:m,easing:g},D.createElement("path",Qb({},Ye(n,!0),{className:w,d:x5(C,T,k,S,_),ref:r})))}):D.createElement("g",null,D.createElement("path",Qb({},Ye(n,!0),{className:w,d:x5(c,u,d,h,f)})))},M8e=["option","shapeType","propTransformer","activeClassName","isActive"];function Cg(t){"@babel/helpers - typeof";return Cg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cg(t)}function I8e(t,e){if(t==null)return{};var n=L8e(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function L8e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function w5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ex(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?w5(Object(n),!0).forEach(function(r){$8e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):w5(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function $8e(t,e,n){return e=F8e(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function F8e(t){var e=B8e(t,"string");return Cg(e)=="symbol"?e:e+""}function B8e(t,e){if(Cg(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Cg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function U8e(t,e){return ex(ex({},e),t)}function z8e(t,e){return t==="symbols"}function S5(t){var e=t.shapeType,n=t.elementProps;switch(e){case"rectangle":return D.createElement(XN,n);case"trapezoid":return D.createElement(D8e,n);case"sector":return D.createElement(hK,n);case"symbols":if(z8e(e))return D.createElement(gN,n);break;default:return null}}function W8e(t){return b.isValidElement(t)?t.props:t}function CK(t){var e=t.option,n=t.shapeType,r=t.propTransformer,i=r===void 0?U8e:r,a=t.activeClassName,s=a===void 0?"recharts-active-shape":a,o=t.isActive,c=I8e(t,M8e),u;if(b.isValidElement(e))u=b.cloneElement(e,ex(ex({},c),W8e(e)));else if(it(e))u=e(c);else if(y8e(e)&&!_8e(e)){var d=i(e,c);u=D.createElement(S5,{shapeType:n,elementProps:d})}else{var h=c;u=D.createElement(S5,{shapeType:n,elementProps:h})}return o?D.createElement(Rt,{className:s},u):u}function T1(t,e){return e!=null&&"trapezoids"in t.props}function E1(t,e){return e!=null&&"sectors"in t.props}function Tg(t,e){return e!=null&&"points"in t.props}function V8e(t,e){var n,r,i=t.x===(e==null||(n=e.labelViewBox)===null||n===void 0?void 0:n.x)||t.x===e.x,a=t.y===(e==null||(r=e.labelViewBox)===null||r===void 0?void 0:r.y)||t.y===e.y;return i&&a}function H8e(t,e){var n=t.endAngle===e.endAngle,r=t.startAngle===e.startAngle;return n&&r}function q8e(t,e){var n=t.x===e.x,r=t.y===e.y,i=t.z===e.z;return n&&r&&i}function K8e(t,e){var n;return T1(t,e)?n=V8e:E1(t,e)?n=H8e:Tg(t,e)&&(n=q8e),n}function G8e(t,e){var n;return T1(t,e)?n="trapezoids":E1(t,e)?n="sectors":Tg(t,e)&&(n="points"),n}function Y8e(t,e){if(T1(t,e)){var n;return(n=e.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}if(E1(t,e)){var r;return(r=e.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}return Tg(t,e)?e.payload:{}}function J8e(t){var e=t.activeTooltipItem,n=t.graphicalItem,r=t.itemData,i=G8e(n,e),a=Y8e(n,e),s=r.filter(function(c,u){var d=fv(a,c),h=n.props[i].filter(function(g){var m=K8e(n,e);return m(g,e)}),f=n.props[i].indexOf(h[h.length-1]),p=u===f;return d&&p}),o=r.indexOf(s[s.length-1]);return o}var t0;function Hh(t){"@babel/helpers - typeof";return Hh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hh(t)}function xd(){return xd=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},xd.apply(this,arguments)}function k5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Zt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?k5(Object(n),!0).forEach(function(r){Yi(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):k5(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function X8e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _5(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,EK(r.key),r)}}function Z8e(t,e,n){return e&&_5(t.prototype,e),n&&_5(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Q8e(t,e,n){return e=tx(e),e6e(t,TK()?Reflect.construct(e,n||[],tx(t).constructor):e.apply(t,n))}function e6e(t,e){if(e&&(Hh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return t6e(t)}function t6e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function TK(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(TK=function(){return!!t})()}function tx(t){return tx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},tx(t)}function n6e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_E(t,e)}function _E(t,e){return _E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},_E(t,e)}function Yi(t,e,n){return e=EK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function EK(t){var e=r6e(t,"string");return Hh(e)=="symbol"?e:e+""}function r6e(t,e){if(Hh(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Hh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var jo=function(t){function e(n){var r;return X8e(this,e),r=Q8e(this,e,[n]),Yi(r,"pieRef",null),Yi(r,"sectorRefs",[]),Yi(r,"id",Pf("recharts-pie-")),Yi(r,"handleAnimationEnd",function(){var i=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),it(i)&&i()}),Yi(r,"handleAnimationStart",function(){var i=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),it(i)&&i()}),r.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},r}return n6e(e,t),Z8e(e,[{key:"isActiveIndex",value:function(r){var i=this.props.activeIndex;return Array.isArray(i)?i.indexOf(r)!==-1:r===i}},{key:"hasActiveIndex",value:function(){var r=this.props.activeIndex;return Array.isArray(r)?r.length!==0:r||r===0}},{key:"renderLabels",value:function(r){var i=this.props.isAnimationActive;if(i&&!this.state.isAnimationFinished)return null;var a=this.props,s=a.label,o=a.labelLine,c=a.dataKey,u=a.valueKey,d=Ye(this.props,!1),h=Ye(s,!1),f=Ye(o,!1),p=s&&s.offsetRadius||20,g=r.map(function(m,v){var x=(m.startAngle+m.endAngle)/2,w=nn(m.cx,m.cy,m.outerRadius+p,x),y=Zt(Zt(Zt(Zt({},d),m),{},{stroke:"none"},h),{},{index:v,textAnchor:e.getTextAnchor(w.x,m.cx)},w),k=Zt(Zt(Zt(Zt({},d),m),{},{fill:"none",stroke:m.fill},f),{},{index:v,points:[nn(m.cx,m.cy,m.outerRadius,x),w]}),S=c;return ut(c)&&ut(u)?S="value":ut(c)&&(S=u),D.createElement(Rt,{key:"label-".concat(m.startAngle,"-").concat(m.endAngle,"-").concat(m.midAngle,"-").concat(v)},o&&e.renderLabelLineItem(o,k,"line"),e.renderLabelItem(s,y,er(m,S)))});return D.createElement(Rt,{className:"recharts-pie-labels"},g)}},{key:"renderSectorsStatically",value:function(r){var i=this,a=this.props,s=a.activeShape,o=a.blendStroke,c=a.inactiveShape;return r.map(function(u,d){if((u==null?void 0:u.startAngle)===0&&(u==null?void 0:u.endAngle)===0&&r.length!==1)return null;var h=i.isActiveIndex(d),f=c&&i.hasActiveIndex()?c:null,p=h?s:f,g=Zt(Zt({},u),{},{stroke:o?u.fill:u.stroke,tabIndex:-1});return D.createElement(Rt,xd({ref:function(v){v&&!i.sectorRefs.includes(v)&&i.sectorRefs.push(v)},tabIndex:-1,className:"recharts-pie-sector"},fu(i.props,u,d),{key:"sector-".concat(u==null?void 0:u.startAngle,"-").concat(u==null?void 0:u.endAngle,"-").concat(u.midAngle,"-").concat(d)}),D.createElement(CK,xd({option:p,isActive:h,shapeType:"sector"},g)))})}},{key:"renderSectorsWithAnimation",value:function(){var r=this,i=this.props,a=i.sectors,s=i.isAnimationActive,o=i.animationBegin,c=i.animationDuration,u=i.animationEasing,d=i.animationId,h=this.state,f=h.prevSectors,p=h.prevIsAnimationActive;return D.createElement(As,{begin:o,duration:c,isActive:s,easing:u,from:{t:0},to:{t:1},key:"pie-".concat(d,"-").concat(p),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(g){var m=g.t,v=[],x=a&&a[0],w=x.startAngle;return a.forEach(function(y,k){var S=f&&f[k],_=k>0?Pi(y,"paddingAngle",0):0;if(S){var C=wi(S.endAngle-S.startAngle,y.endAngle-y.startAngle),T=Zt(Zt({},y),{},{startAngle:w+_,endAngle:w+C(m)+_});v.push(T),w=T.endAngle}else{var E=y.endAngle,j=y.startAngle,P=wi(0,E-j),M=P(m),U=Zt(Zt({},y),{},{startAngle:w+_,endAngle:w+M+_});v.push(U),w=U.endAngle}}),D.createElement(Rt,null,r.renderSectorsStatically(v))})}},{key:"attachKeyboardHandlers",value:function(r){var i=this;r.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var s=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[s].focus(),i.setState({sectorToFocus:s});break}case"ArrowRight":{var o=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[o].focus(),i.setState({sectorToFocus:o});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,i=r.sectors,a=r.isAnimationActive,s=this.state.prevSectors;return a&&i&&i.length&&(!s||!fv(s,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,i=this.props,a=i.hide,s=i.sectors,o=i.className,c=i.label,u=i.cx,d=i.cy,h=i.innerRadius,f=i.outerRadius,p=i.isAnimationActive,g=this.state.isAnimationFinished;if(a||!s||!s.length||!Ce(u)||!Ce(d)||!Ce(h)||!Ce(f))return null;var m=pt("recharts-pie",o);return D.createElement(Rt,{tabIndex:this.props.rootTabIndex,className:m,ref:function(x){r.pieRef=x}},this.renderSectors(),c&&this.renderLabels(s),lr.renderCallByParent(this.props,null,!1),(!p||g)&&uo.renderCallByParent(this.props,s,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return i.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:r.sectors!==i.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,i){return r>i?"start":r<i?"end":"middle"}},{key:"renderLabelLineItem",value:function(r,i,a){if(D.isValidElement(r))return D.cloneElement(r,i);if(it(r))return r(i);var s=pt("recharts-pie-label-line",typeof r!="boolean"?r.className:"");return D.createElement(qb,xd({},i,{key:a,type:"linear",className:s}))}},{key:"renderLabelItem",value:function(r,i,a){if(D.isValidElement(r))return D.cloneElement(r,i);var s=a;if(it(r)&&(s=r(i),D.isValidElement(s)))return s;var o=pt("recharts-pie-label-text",typeof r!="boolean"&&!it(r)?r.className:"");return D.createElement(pu,xd({},i,{alignmentBaseline:"middle",className:o}),s)}}])}(b.PureComponent);t0=jo;Yi(jo,"displayName","Pie");Yi(jo,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!xs.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});Yi(jo,"parseDeltaAngle",function(t,e){var n=zr(e-t),r=Math.min(Math.abs(e-t),360);return n*r});Yi(jo,"getRealPieData",function(t){var e=t.data,n=t.children,r=Ye(t,!1),i=Ni(n,l1);return e&&e.length?e.map(function(a,s){return Zt(Zt(Zt({payload:a},r),a),i&&i[s]&&i[s].props)}):i&&i.length?i.map(function(a){return Zt(Zt({},r),a.props)}):[]});Yi(jo,"parseCoordinateOfPie",function(t,e){var n=e.top,r=e.left,i=e.width,a=e.height,s=cK(i,a),o=r+Wr(t.cx,i,i/2),c=n+Wr(t.cy,a,a/2),u=Wr(t.innerRadius,s,0),d=Wr(t.outerRadius,s,s*.8),h=t.maxRadius||Math.sqrt(i*i+a*a)/2;return{cx:o,cy:c,innerRadius:u,outerRadius:d,maxRadius:h}});Yi(jo,"getComposedData",function(t){var e=t.item,n=t.offset,r=e.type.defaultProps!==void 0?Zt(Zt({},e.type.defaultProps),e.props):e.props,i=t0.getRealPieData(r);if(!i||!i.length)return null;var a=r.cornerRadius,s=r.startAngle,o=r.endAngle,c=r.paddingAngle,u=r.dataKey,d=r.nameKey,h=r.valueKey,f=r.tooltipType,p=Math.abs(r.minAngle),g=t0.parseCoordinateOfPie(r,n),m=t0.parseDeltaAngle(s,o),v=Math.abs(m),x=u;ut(u)&&ut(h)?(Ga(!1,`Use "dataKey" to specify the value of pie,
953 the props "valueKey" will be deprecated in 1.1.0`),x="value"):ut(u)&&(Ga(!1,`Use "dataKey" to specify the value of pie, 954 the props "valueKey" will be deprecated in 1.1.0`),x=h);var w=i.filter(function(T){return er(T,x,0)!==0}).length,y=(v>=360?w:w-1)*c,k=v-w*p-y,S=i.reduce(function(T,E){var j=er(E,x,0);return T+(Ce(j)?j:0)},0),_;if(S>0){var C;_=i.map(function(T,E){var j=er(T,x,0),P=er(T,d,E),M=(Ce(j)?j:0)/S,U;E?U=C.endAngle+zr(m)*c*(j!==0?1:0):U=s;var N=U+zr(m)*((j!==0?p:0)+M*k),B=(U+N)/2,$=(g.innerRadius+g.outerRadius)/2,I=[{name:P,value:j,payload:T,dataKey:x,type:f}],R=nn(g.cx,g.cy,$,B);return C=Zt(Zt(Zt({percent:M,cornerRadius:a,name:P,tooltipPayload:I,midAngle:B,middleRadius:$,tooltipPosition:R},T),g),{},{value:er(T,x),startAngle:U,endAngle:N,payload:T,paddingAngle:zr(m)*c}),C})}return Zt(Zt({},g),{},{sectors:_,data:i})});var i6e=Math.ceil,a6e=Math.max;function s6e(t,e,n,r){for(var i=-1,a=a6e(i6e((e-t)/(n||1)),0),s=Array(a);a--;)s[r?a:++i]=t,t+=n;return s}var o6e=s6e,c6e=YH,C5=1/0,l6e=17976931348623157e292;function u6e(t){if(!t)return t===0?t:0;if(t=c6e(t),t===C5||t===-C5){var e=t<0?-1:1;return e*l6e}return t===t?t:0}var jK=u6e,d6e=o6e,h6e=c1,Uk=jK;function f6e(t){return function(e,n,r){return r&&typeof r!="number"&&h6e(e,n,r)&&(n=r=void 0),e=Uk(e),n===void 0?(n=e,e=0):n=Uk(n),r=r===void 0?e<n?1:-1:Uk(r),d6e(e,n,r,t)}}var p6e=f6e,m6e=p6e,g6e=m6e(),v6e=g6e;const nx=Lt(v6e);function Eg(t){"@babel/helpers - typeof";return Eg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Eg(t)}function T5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function E5(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?T5(Object(n),!0).forEach(function(r){PK(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T5(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function PK(t,e,n){return e=y6e(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function y6e(t){var e=b6e(t,"string");return Eg(e)=="symbol"?e:e+""}function b6e(t,e){if(Eg(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Eg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var x6e=["Webkit","Moz","O","ms"],w6e=function(e,n){var r=e.replace(/(\w)/,function(a){return a.toUpperCase()}),i=x6e.reduce(function(a,s){return E5(E5({},a),{},PK({},s+r,n))},{});return i[e]=n,i};function qh(t){"@babel/helpers - typeof";return qh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qh(t)}function rx(){return rx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},rx.apply(this,arguments)}function j5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function zk(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?j5(Object(n),!0).forEach(function(r){vi(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):j5(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function S6e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function P5(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,AK(r.key),r)}}function k6e(t,e,n){return e&&P5(t.prototype,e),n&&P5(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function _6e(t,e,n){return e=ix(e),C6e(t,NK()?Reflect.construct(e,n||[],ix(t).constructor):e.apply(t,n))}function C6e(t,e){if(e&&(qh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return T6e(t)}function T6e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function NK(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(NK=function(){return!!t})()}
vendor: 122,872 bytes, lines 954-959
954function ix(t){return ix=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ix(t)}function E6e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&CE(t,e)}function CE(t,e){return CE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},CE(t,e)}function vi(t,e,n){return e=AK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function AK(t){var e=j6e(t,"string");return qh(e)=="symbol"?e:e+""}function j6e(t,e){if(qh(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(qh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var P6e=function(e){var n=e.data,r=e.startIndex,i=e.endIndex,a=e.x,s=e.width,o=e.travellerWidth;if(!n||!n.length)return{};var c=n.length,u=Jp().domain(nx(0,c)).range([a,a+s-o]),d=u.domain().map(function(h){return u(h)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(r),endX:u(i),scale:u,scaleValues:d}},N5=function(e){return e.changedTouches&&!!e.changedTouches.length},Kh=function(t){function e(n){var r;return S6e(this,e),r=_6e(this,e,[n]),vi(r,"handleDrag",function(i){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(i):r.state.isSlideMoving&&r.handleSlideDrag(i)}),vi(r,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&r.handleDrag(i.changedTouches[0])}),vi(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,a=i.endIndex,s=i.onDragEnd,o=i.startIndex;s==null||s({endIndex:a,startIndex:o})}),r.detachDragEndListener()}),vi(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),vi(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),vi(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),vi(r,"handleSlideDragStart",function(i){var a=N5(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return E6e(e,t),k6e(e,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,a=r.endX,s=this.state.scaleValues,o=this.props,c=o.gap,u=o.data,d=u.length-1,h=Math.min(i,a),f=Math.max(i,a),p=e.getIndexInRange(s,h),g=e.getIndexInRange(s,f);return{startIndex:p-p%c,endIndex:g===d?d:g-g%c}}},{key:"getTextOfTick",value:function(r){var i=this.props,a=i.data,s=i.tickFormatter,o=i.dataKey,c=er(a[r],o,r);return it(s)?s(c,r):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var i=this.state,a=i.slideMoveStartX,s=i.startX,o=i.endX,c=this.props,u=c.x,d=c.width,h=c.travellerWidth,f=c.startIndex,p=c.endIndex,g=c.onChange,m=r.pageX-a;m>0?m=Math.min(m,u+d-h-o,u+d-h-s):m<0&&(m=Math.max(m,u-s,u-o));var v=this.getIndex({startX:s+m,endX:o+m});(v.startIndex!==f||v.endIndex!==p)&&g&&g(v),this.setState({startX:s+m,endX:o+m,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var a=N5(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,a=i.brushMoveStartX,s=i.movingTravellerId,o=i.endX,c=i.startX,u=this.state[s],d=this.props,h=d.x,f=d.width,p=d.travellerWidth,g=d.onChange,m=d.gap,v=d.data,x={startX:this.state.startX,endX:this.state.endX},w=r.pageX-a;w>0?w=Math.min(w,h+f-p-u):w<0&&(w=Math.max(w,h-u)),x[s]=u+w;var y=this.getIndex(x),k=y.startIndex,S=y.endIndex,_=function(){var T=v.length-1;return s==="startX"&&(o>c?k%m===0:S%m===0)||o<c&&S===T||s==="endX"&&(o>c?S%m===0:k%m===0)||o>c&&S===T};this.setState(vi(vi({},s,u+w),"brushMoveStartX",r.pageX),function(){g&&_()&&g(y)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var a=this,s=this.state,o=s.scaleValues,c=s.startX,u=s.endX,d=this.state[i],h=o.indexOf(d);if(h!==-1){var f=h+r;if(!(f===-1||f>=o.length)){var p=o[f];i==="startX"&&p>=u||i==="endX"&&p<=c||this.setState(vi({},i,p),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,a=r.y,s=r.width,o=r.height,c=r.fill,u=r.stroke;return D.createElement("rect",{stroke:u,fill:c,x:i,y:a,width:s,height:o})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,a=r.y,s=r.width,o=r.height,c=r.data,u=r.children,d=r.padding,h=b.Children.only(u);return h?D.cloneElement(h,{x:i,y:a,width:s,height:o,margin:d,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(r,i){var a,s,o=this,c=this.props,u=c.y,d=c.travellerWidth,h=c.height,f=c.traveller,p=c.ariaLabel,g=c.data,m=c.startIndex,v=c.endIndex,x=Math.max(r,this.props.x),w=zk(zk({},Ye(this.props,!1)),{},{x,y:u,width:d,height:h}),y=p||"Min value: ".concat((a=g[m])===null||a===void 0?void 0:a.name,", Max value: ").concat((s=g[v])===null||s===void 0?void 0:s.name);return D.createElement(Rt,{tabIndex:0,role:"slider","aria-label":y,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(S){["ArrowLeft","ArrowRight"].includes(S.key)&&(S.preventDefault(),S.stopPropagation(),o.handleTravellerMoveKeyboard(S.key==="ArrowRight"?1:-1,i))},onFocus:function(){o.setState({isTravellerFocused:!0})},onBlur:function(){o.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(f,w))}},{key:"renderSlide",value:function(r,i){var a=this.props,s=a.y,o=a.height,c=a.stroke,u=a.travellerWidth,d=Math.min(r,i)+u,h=Math.max(Math.abs(i-r)-u,0);return D.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:d,y:s,width:h,height:o})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,a=r.endIndex,s=r.y,o=r.height,c=r.travellerWidth,u=r.stroke,d=this.state,h=d.startX,f=d.endX,p=5,g={pointerEvents:"none",fill:u};return D.createElement(Rt,{className:"recharts-brush-texts"},D.createElement(pu,rx({textAnchor:"end",verticalAnchor:"middle",x:Math.min(h,f)-p,y:s+o/2},g),this.getTextOfTick(i)),D.createElement(pu,rx({textAnchor:"start",verticalAnchor:"middle",x:Math.max(h,f)+c+p,y:s+o/2},g),this.getTextOfTick(a)))}},{key:"render",value:function(){var r=this.props,i=r.data,a=r.className,s=r.children,o=r.x,c=r.y,u=r.width,d=r.height,h=r.alwaysShowText,f=this.state,p=f.startX,g=f.endX,m=f.isTextActive,v=f.isSlideMoving,x=f.isTravellerMoving,w=f.isTravellerFocused;if(!i||!i.length||!Ce(o)||!Ce(c)||!Ce(u)||!Ce(d)||u<=0||d<=0)return null;var y=pt("recharts-brush",a),k=D.Children.count(s)===1,S=w6e("userSelect","none");return D.createElement(Rt,{className:y,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:S},this.renderBackground(),k&&this.renderPanorama(),this.renderSlide(p,g),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(g,"endX"),(m||v||x||w||h)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,a=r.y,s=r.width,o=r.height,c=r.stroke,u=Math.floor(a+o/2)-1;return D.createElement(D.Fragment,null,D.createElement("rect",{x:i,y:a,width:s,height:o,fill:c,stroke:"none"}),D.createElement("line",{x1:i+1,y1:u,x2:i+s-1,y2:u,fill:"none",stroke:"#fff"}),D.createElement("line",{x1:i+1,y1:u+2,x2:i+s-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var a;return D.isValidElement(r)?a=D.cloneElement(r,i):it(r)?a=r(i):a=e.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(r,i){var a=r.data,s=r.width,o=r.x,c=r.travellerWidth,u=r.updateId,d=r.startIndex,h=r.endIndex;if(a!==i.prevData||u!==i.prevUpdateId)return zk({prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:o,prevWidth:s},a&&a.length?P6e({data:a,width:s,x:o,travellerWidth:c,startIndex:d,endIndex:h}):{scale:null,scaleValues:null});if(i.scale&&(s!==i.prevWidth||o!==i.prevX||c!==i.prevTravellerWidth)){i.scale.range([o,o+s-c]);var f=i.scale.domain().map(function(p){return i.scale(p)});return{prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:o,prevWidth:s,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:f}}return null}},{key:"getIndexInRange",value:function(r,i){for(var a=r.length,s=0,o=a-1;o-s>1;){var c=Math.floor((s+o)/2);r[c]>i?o=c:s=c}return i>=r[o]?o:s}}])}(b.PureComponent);vi(Kh,"displayName","Brush");vi(Kh,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var N6e=kN;function A6e(t,e){var n;return N6e(t,function(r,i,a){return n=e(r,i,a),!n}),!!n}var O6e=A6e,R6e=SH,D6e=Ms,M6e=O6e,I6e=di,L6e=c1;function $6e(t,e,n){var r=I6e(t)?R6e:M6e;return n&&L6e(t,e,n)&&(e=void 0),r(t,D6e(e))}var F6e=$6e;const B6e=Lt(F6e);var Ss=function(e,n){var r=e.alwaysShow,i=e.ifOverflow;return r&&(i="extendDomain"),i===n},A5=VH;function U6e(t,e,n){e=="__proto__"&&A5?A5(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var z6e=U6e,W6e=z6e,V6e=zH,H6e=Ms;function q6e(t,e){var n={};return e=H6e(e),V6e(t,function(r,i,a){W6e(n,i,e(r,i,a))}),n}var K6e=q6e;const G6e=Lt(K6e);function Y6e(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}var J6e=Y6e,X6e=kN;function Z6e(t,e){var n=!0;return X6e(t,function(r,i,a){return n=!!e(r,i,a),n}),n}var Q6e=Z6e,eLe=J6e,tLe=Q6e,nLe=Ms,rLe=di,iLe=c1;function aLe(t,e,n){var r=rLe(t)?eLe:tLe;return n&&iLe(t,e,n)&&(e=void 0),r(t,nLe(e))}var sLe=aLe;const OK=Lt(sLe);var oLe=["x","y"];function jg(t){"@babel/helpers - typeof";return jg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jg(t)}function TE(){return TE=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},TE.apply(this,arguments)}function O5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function mp(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?O5(Object(n),!0).forEach(function(r){cLe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):O5(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function cLe(t,e,n){return e=lLe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function lLe(t){var e=uLe(t,"string");return jg(e)=="symbol"?e:e+""}function uLe(t,e){if(jg(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(jg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function dLe(t,e){if(t==null)return{};var n=hLe(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function hLe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function fLe(t,e){var n=t.x,r=t.y,i=dLe(t,oLe),a="".concat(n),s=parseInt(a,10),o="".concat(r),c=parseInt(o,10),u="".concat(e.height||i.height),d=parseInt(u,10),h="".concat(e.width||i.width),f=parseInt(h,10);return mp(mp(mp(mp(mp({},e),i),s?{x:s}:{}),c?{y:c}:{}),{},{height:d,width:f,name:e.name,radius:e.radius})}function R5(t){return D.createElement(CK,TE({shapeType:"rectangle",propTransformer:fLe,activeClassName:"recharts-active-bar"},t))}var pLe=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof e=="number")return e;var a=Ce(r)||V1e(r);return a?e(r,i):(a||gu(),n)}},mLe=["value","background"],RK;function Gh(t){"@babel/helpers - typeof";return Gh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gh(t)}function gLe(t,e){if(t==null)return{};var n=vLe(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function vLe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function ax(){return ax=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ax.apply(this,arguments)}function D5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Fn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?D5(Object(n),!0).forEach(function(r){cc(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):D5(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function yLe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function M5(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,MK(r.key),r)}}function bLe(t,e,n){return e&&M5(t.prototype,e),n&&M5(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function xLe(t,e,n){return e=sx(e),wLe(t,DK()?Reflect.construct(e,n||[],sx(t).constructor):e.apply(t,n))}function wLe(t,e){if(e&&(Gh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return SLe(t)}function SLe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function DK(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(DK=function(){return!!t})()}function sx(t){return sx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},sx(t)}function kLe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&EE(t,e)}function EE(t,e){return EE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},EE(t,e)}function cc(t,e,n){return e=MK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function MK(t){var e=_Le(t,"string");return Gh(e)=="symbol"?e:e+""}function _Le(t,e){if(Gh(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Gh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Eu=function(t){function e(){var n;yLe(this,e);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=xLe(this,e,[].concat(i)),cc(n,"state",{isAnimationFinished:!1}),cc(n,"id",Pf("recharts-bar-")),cc(n,"handleAnimationEnd",function(){var s=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),s&&s()}),cc(n,"handleAnimationStart",function(){var s=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),s&&s()}),n}return kLe(e,t),bLe(e,[{key:"renderRectanglesStatically",value:function(r){var i=this,a=this.props,s=a.shape,o=a.dataKey,c=a.activeIndex,u=a.activeBar,d=Ye(this.props,!1);return r&&r.map(function(h,f){var p=f===c,g=p?u:s,m=Fn(Fn(Fn({},d),h),{},{isActive:p,option:g,index:f,dataKey:o,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return D.createElement(Rt,ax({className:"recharts-bar-rectangle"},fu(i.props,h,f),{key:"rectangle-".concat(h==null?void 0:h.x,"-").concat(h==null?void 0:h.y,"-").concat(h==null?void 0:h.value,"-").concat(f)}),D.createElement(R5,m))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,i=this.props,a=i.data,s=i.layout,o=i.isAnimationActive,c=i.animationBegin,u=i.animationDuration,d=i.animationEasing,h=i.animationId,f=this.state.prevData;return D.createElement(As,{begin:c,duration:u,isActive:o,easing:d,from:{t:0},to:{t:1},key:"bar-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(p){var g=p.t,m=a.map(function(v,x){var w=f&&f[x];if(w){var y=wi(w.x,v.x),k=wi(w.y,v.y),S=wi(w.width,v.width),_=wi(w.height,v.height);return Fn(Fn({},v),{},{x:y(g),y:k(g),width:S(g),height:_(g)})}if(s==="horizontal"){var C=wi(0,v.height),T=C(g);return Fn(Fn({},v),{},{y:v.y+v.height-T,height:T})}var E=wi(0,v.width),j=E(g);return Fn(Fn({},v),{},{width:j})});return D.createElement(Rt,null,r.renderRectanglesStatically(m))})}},{key:"renderRectangles",value:function(){var r=this.props,i=r.data,a=r.isAnimationActive,s=this.state.prevData;return a&&i&&i.length&&(!s||!fv(s,i))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(i)}},{key:"renderBackground",value:function(){var r=this,i=this.props,a=i.data,s=i.dataKey,o=i.activeIndex,c=Ye(this.props.background,!1);return a.map(function(u,d){u.value;var h=u.background,f=gLe(u,mLe);if(!h)return null;var p=Fn(Fn(Fn(Fn(Fn({},f),{},{fill:"#eee"},h),c),fu(r.props,u,d)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:s,index:d,className:"recharts-bar-background-rectangle"});return D.createElement(R5,ax({key:"background-bar-".concat(d),option:r.props.background,isActive:d===o},p))})}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,s=a.data,o=a.xAxis,c=a.yAxis,u=a.layout,d=a.children,h=Ni(d,pv);if(!h)return null;var f=u==="vertical"?s[0].height/2:s[0].width/2,p=function(v,x){var w=Array.isArray(v.value)?v.value[1]:v.value;return{x:v.x,y:v.y,value:w,errorVal:er(v,x)}},g={clipPath:r?"url(#clipPath-".concat(i,")"):null};return D.createElement(Rt,g,h.map(function(m){return D.cloneElement(m,{key:"error-bar-".concat(i,"-").concat(m.props.dataKey),data:s,xAxis:o,yAxis:c,layout:u,offset:f,dataPointFormatter:p})}))}},{key:"render",value:function(){var r=this.props,i=r.hide,a=r.data,s=r.className,o=r.xAxis,c=r.yAxis,u=r.left,d=r.top,h=r.width,f=r.height,p=r.isAnimationActive,g=r.background,m=r.id;if(i||!a||!a.length)return null;var v=this.state.isAnimationFinished,x=pt("recharts-bar",s),w=o&&o.allowDataOverflow,y=c&&c.allowDataOverflow,k=w||y,S=ut(m)?this.id:m;return D.createElement(Rt,{className:x},w||y?D.createElement("defs",null,D.createElement("clipPath",{id:"clipPath-".concat(S)},D.createElement("rect",{x:w?u:u-h/2,y:y?d:d-f/2,width:w?h:h*2,height:y?f:f*2}))):null,D.createElement(Rt,{className:"recharts-bar-rectangles",clipPath:k?"url(#clipPath-".concat(S,")"):null},g?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(k,S),(!p||v)&&uo.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:i.curData}:r.data!==i.curData?{curData:r.data}:null}}])}(b.PureComponent);RK=Eu;cc(Eu,"displayName","Bar");cc(Eu,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!xs.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});cc(Eu,"getComposedData",function(t){var e=t.props,n=t.item,r=t.barPosition,i=t.bandSize,a=t.xAxis,s=t.yAxis,o=t.xAxisTicks,c=t.yAxisTicks,u=t.stackedData,d=t.dataStartIndex,h=t.displayedData,f=t.offset,p=lMe(r,n);if(!p)return null;var g=e.layout,m=n.type.defaultProps,v=m!==void 0?Fn(Fn({},m),n.props):n.props,x=v.dataKey,w=v.children,y=v.minPointSize,k=g==="horizontal"?s:a,S=u?k.scale.domain():null,_=gMe({numericAxis:k}),C=Ni(w,l1),T=h.map(function(E,j){var P,M,U,N,B,$;u?P=uMe(u[d+j],S):(P=er(E,x),Array.isArray(P)||(P=[_,P]));var I=pLe(y,RK.defaultProps.minPointSize)(P[1],j);if(g==="horizontal"){var R,z=[s.scale(P[0]),s.scale(P[1])],O=z[0],A=z[1];M=_3({axis:a,ticks:o,bandSize:i,offset:p.offset,entry:E,index:j}),U=(R=A??O)!==null&&R!==void 0?R:void 0,N=p.size;var L=O-A;if(B=Number.isNaN(L)?0:L,$={x:M,y:s.y,width:N,height:s.height},Math.abs(I)>0&&Math.abs(B)<Math.abs(I)){var V=zr(B||I)*(Math.abs(I)-Math.abs(B));U-=V,B+=V}}else{var Y=[a.scale(P[0]),a.scale(P[1])],Q=Y[0],re=Y[1];if(M=Q,U=_3({axis:s,ticks:c,bandSize:i,offset:p.offset,entry:E,index:j}),N=re-Q,B=p.size,$={x:a.x,y:U,width:a.width,height:B},Math.abs(I)>0&&Math.abs(N)<Math.abs(I)){var J=zr(N||I)*(Math.abs(I)-Math.abs(N));N+=J}}return Fn(Fn(Fn({},E),{},{x:M,y:U,width:N,height:B,value:u?P:P[1],payload:E,background:$},C&&C[j]&&C[j].props),{},{tooltipPayload:[sK(n,E)],tooltipPosition:{x:M+N/2,y:U+B/2}})});return Fn({data:T,layout:g},f)});function Pg(t){"@babel/helpers - typeof";return Pg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pg(t)}function CLe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function I5(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,IK(r.key),r)}}function TLe(t,e,n){return e&&I5(t.prototype,e),n&&I5(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function L5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Na(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?L5(Object(n),!0).forEach(function(r){j1(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):L5(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function j1(t,e,n){return e=IK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function IK(t){var e=ELe(t,"string");return Pg(e)=="symbol"?e:e+""}function ELe(t,e){if(Pg(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Pg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var LK=function(e,n,r,i,a){var s=e.width,o=e.height,c=e.layout,u=e.children,d=Object.keys(n),h={left:r.left,leftMirror:r.left,right:s-r.right,rightMirror:s-r.right,top:r.top,topMirror:r.top,bottom:o-r.bottom,bottomMirror:o-r.bottom},f=!!bi(u,Eu);return d.reduce(function(p,g){var m=n[g],v=m.orientation,x=m.domain,w=m.padding,y=w===void 0?{}:w,k=m.mirror,S=m.reversed,_="".concat(v).concat(k?"Mirror":""),C,T,E,j,P;if(m.type==="number"&&(m.padding==="gap"||m.padding==="no-gap")){var M=x[1]-x[0],U=1/0,N=m.categoricalDomain.sort(K1e);if(N.forEach(function(Y,Q){Q>0&&(U=Math.min((Y||0)-(N[Q-1]||0),U))}),Number.isFinite(U)){var B=U/M,$=m.layout==="vertical"?r.height:r.width;if(m.padding==="gap"&&(C=B*$/2),m.padding==="no-gap"){var I=Wr(e.barCategoryGap,B*$),R=B*$/2;C=R-I-(R-I)/$*I}}}i==="xAxis"?T=[r.left+(y.left||0)+(C||0),r.left+r.width-(y.right||0)-(C||0)]:i==="yAxis"?T=c==="horizontal"?[r.top+r.height-(y.bottom||0),r.top+(y.top||0)]:[r.top+(y.top||0)+(C||0),r.top+r.height-(y.bottom||0)-(C||0)]:T=m.range,S&&(T=[T[1],T[0]]);var z=nK(m,a,f),O=z.scale,A=z.realScaleType;O.domain(x).range(T),rK(O);var L=iK(O,Na(Na({},m),{},{realScaleType:A}));i==="xAxis"?(P=v==="top"&&!k||v==="bottom"&&k,E=r.left,j=h[_]-P*m.height):i==="yAxis"&&(P=v==="left"&&!k||v==="right"&&k,E=h[_]-P*m.width,j=r.top);var V=Na(Na(Na({},m),L),{},{realScaleType:A,x:E,y:j,scale:O,width:i==="xAxis"?r.width:m.width,height:i==="yAxis"?r.height:m.height});return V.bandSize=Wb(V,L),!m.hide&&i==="xAxis"?h[_]+=(P?-1:1)*V.height:m.hide||(h[_]+=(P?-1:1)*V.width),Na(Na({},p),{},j1({},g,V))},{})},$K=function(e,n){var r=e.x,i=e.y,a=n.x,s=n.y;return{x:Math.min(r,a),y:Math.min(i,s),width:Math.abs(a-r),height:Math.abs(s-i)}},jLe=function(e){var n=e.x1,r=e.y1,i=e.x2,a=e.y2;return $K({x:n,y:r},{x:i,y:a})},FK=function(){function t(e){CLe(this,t),this.scale=e}return TLe(t,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,a=r.position;if(n!==void 0){if(a)switch(a){case"start":return this.scale(n);case"middle":{var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+s}case"end":{var o=this.bandwidth?this.bandwidth():0;return this.scale(n)+o}default:return this.scale(n)}if(i){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+c}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],a=r[r.length-1];return i<=a?n>=i&&n<=a:n>=a&&n<=i}}],[{key:"create",value:function(n){return new t(n)}}])}();j1(FK,"EPS",1e-4);var ZN=function(e){var n=Object.keys(e).reduce(function(r,i){return Na(Na({},r),{},j1({},i,FK.create(e[i])))},{});return Na(Na({},n),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=a.bandAware,o=a.position;return G6e(i,function(c,u){return n[u].apply(c,{bandAware:s,position:o})})},isInRange:function(i){return OK(i,function(a,s){return n[s].isInRange(a)})}})};function PLe(t){return(t%180+180)%180}var NLe=function(e){var n=e.width,r=e.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=PLe(i),s=a*Math.PI/180,o=Math.atan(r/n),c=s>o&&s<Math.PI-o?r/Math.sin(s):n/Math.cos(s);return Math.abs(c)},ALe=Ms,OLe=cv,RLe=s1;function DLe(t){return function(e,n,r){var i=Object(e);if(!OLe(e)){var a=ALe(n);e=RLe(e),n=function(o){return a(i[o],o,i)}}var s=t(e,n,r);return s>-1?i[a?e[s]:s]:void 0}}var MLe=DLe,ILe=jK;function LLe(t){var e=ILe(t),n=e%1;return e===e?n?e-n:e:0}var $Le=LLe,FLe=IH,BLe=Ms,ULe=$Le,zLe=Math.max;function WLe(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:ULe(n);return i<0&&(i=zLe(r+i,0)),FLe(t,BLe(e),i)}var VLe=WLe,HLe=MLe,qLe=VLe,KLe=HLe(qLe),GLe=KLe;const YLe=Lt(GLe);var JLe=Gwe(function(t){return{x:t.left,y:t.top,width:t.width,height:t.height}},function(t){return["l",t.left,"t",t.top,"w",t.width,"h",t.height].join("")}),QN=b.createContext(void 0),eA=b.createContext(void 0),BK=b.createContext(void 0),UK=b.createContext({}),zK=b.createContext(void 0),WK=b.createContext(0),VK=b.createContext(0),$5=function(e){var n=e.state,r=n.xAxisMap,i=n.yAxisMap,a=n.offset,s=e.clipPathId,o=e.children,c=e.width,u=e.height,d=JLe(a);return D.createElement(QN.Provider,{value:r},D.createElement(eA.Provider,{value:i},D.createElement(UK.Provider,{value:a},D.createElement(BK.Provider,{value:d},D.createElement(zK.Provider,{value:s},D.createElement(WK.Provider,{value:u},D.createElement(VK.Provider,{value:c},o)))))))},XLe=function(){return b.useContext(zK)},HK=function(e){var n=b.useContext(QN);n==null&&gu();var r=n[e];return r==null&&gu(),r},ZLe=function(){var e=b.useContext(QN);return Yo(e)},QLe=function(){var e=b.useContext(eA),n=YLe(e,function(r){return OK(r.domain,Number.isFinite)});return n||Yo(e)},qK=function(e){var n=b.useContext(eA);n==null&&gu();var r=n[e];return r==null&&gu(),r},e$e=function(){var e=b.useContext(BK);return e},t$e=function(){return b.useContext(UK)},tA=function(){return b.useContext(VK)},nA=function(){return b.useContext(WK)};function Yh(t){"@babel/helpers - typeof";return Yh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yh(t)}function n$e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r$e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,GK(r.key),r)}}function i$e(t,e,n){return e&&r$e(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function a$e(t,e,n){return e=ox(e),s$e(t,KK()?Reflect.construct(e,n||[],ox(t).constructor):e.apply(t,n))}function s$e(t,e){if(e&&(Yh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return o$e(t)}function o$e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function KK(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(KK=function(){return!!t})()}function ox(t){return ox=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ox(t)}function c$e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&jE(t,e)}function jE(t,e){return jE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},jE(t,e)}function F5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function B5(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?F5(Object(n),!0).forEach(function(r){rA(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):F5(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function rA(t,e,n){return e=GK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function GK(t){var e=l$e(t,"string");return Yh(e)=="symbol"?e:e+""}function l$e(t,e){if(Yh(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Yh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function u$e(t,e){return p$e(t)||f$e(t,e)||h$e(t,e)||d$e()}function d$e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 955In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function h$e(t,e){if(t){if(typeof t=="string")return U5(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return U5(t,e)}}function U5(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function f$e(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,o=[],c=!0,u=!1;try{if(a=(n=n.call(t)).next,e!==0)for(;!(c=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function p$e(t){if(Array.isArray(t))return t}function PE(){return PE=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},PE.apply(this,arguments)}var m$e=function(e,n){var r;return D.isValidElement(e)?r=D.cloneElement(e,n):it(e)?r=e(n):r=D.createElement("line",PE({},n,{className:"recharts-reference-line-line"})),r},g$e=function(e,n,r,i,a,s,o,c,u){var d=a.x,h=a.y,f=a.width,p=a.height;if(r){var g=u.y,m=e.y.apply(g,{position:s});if(Ss(u,"discard")&&!e.y.isInRange(m))return null;var v=[{x:d+f,y:m},{x:d,y:m}];return c==="left"?v.reverse():v}if(n){var x=u.x,w=e.x.apply(x,{position:s});if(Ss(u,"discard")&&!e.x.isInRange(w))return null;var y=[{x:w,y:h+p},{x:w,y:h}];return o==="top"?y.reverse():y}if(i){var k=u.segment,S=k.map(function(_){return e.apply(_,{position:s})});return Ss(u,"discard")&&B6e(S,function(_){return!e.isInRange(_)})?null:S}return null};function v$e(t){var e=t.x,n=t.y,r=t.segment,i=t.xAxisId,a=t.yAxisId,s=t.shape,o=t.className,c=t.alwaysShow,u=XLe(),d=HK(i),h=qK(a),f=e$e();if(!u||!f)return null;Ga(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=ZN({x:d.scale,y:h.scale}),g=nr(e),m=nr(n),v=r&&r.length===2,x=g$e(p,g,m,v,f,t.position,d.orientation,h.orientation,t);if(!x)return null;var w=u$e(x,2),y=w[0],k=y.x,S=y.y,_=w[1],C=_.x,T=_.y,E=Ss(t,"hidden")?"url(#".concat(u,")"):void 0,j=B5(B5({clipPath:E},Ye(t,!0)),{},{x1:k,y1:S,x2:C,y2:T});return D.createElement(Rt,{className:pt("recharts-reference-line",o)},m$e(s,j),lr.renderCallByParent(t,jLe({x1:k,y1:S,x2:C,y2:T})))}var iA=function(t){function e(){return n$e(this,e),a$e(this,e,arguments)}return c$e(e,t),i$e(e,[{key:"render",value:function(){return D.createElement(v$e,this.props)}}])}(D.Component);rA(iA,"displayName","ReferenceLine");rA(iA,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function NE(){return NE=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},NE.apply(this,arguments)}function Jh(t){"@babel/helpers - typeof";return Jh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jh(t)}function z5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function W5(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?z5(Object(n),!0).forEach(function(r){P1(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):z5(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function y$e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function b$e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,JK(r.key),r)}}function x$e(t,e,n){return e&&b$e(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function w$e(t,e,n){return e=cx(e),S$e(t,YK()?Reflect.construct(e,n||[],cx(t).constructor):e.apply(t,n))}function S$e(t,e){if(e&&(Jh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return k$e(t)}function k$e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function YK(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(YK=function(){return!!t})()}function cx(t){return cx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},cx(t)}function _$e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&AE(t,e)}function AE(t,e){return AE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},AE(t,e)}function P1(t,e,n){return e=JK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function JK(t){var e=C$e(t,"string");return Jh(e)=="symbol"?e:e+""}function C$e(t,e){if(Jh(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Jh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var T$e=function(e){var n=e.x,r=e.y,i=e.xAxis,a=e.yAxis,s=ZN({x:i.scale,y:a.scale}),o=s.apply({x:n,y:r},{bandAware:!0});return Ss(e,"discard")&&!s.isInRange(o)?null:o},N1=function(t){function e(){return y$e(this,e),w$e(this,e,arguments)}return _$e(e,t),x$e(e,[{key:"render",value:function(){var r=this.props,i=r.x,a=r.y,s=r.r,o=r.alwaysShow,c=r.clipPathId,u=nr(i),d=nr(a);if(Ga(o===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!d)return null;var h=T$e(this.props);if(!h)return null;var f=h.x,p=h.y,g=this.props,m=g.shape,v=g.className,x=Ss(this.props,"hidden")?"url(#".concat(c,")"):void 0,w=W5(W5({clipPath:x},Ye(this.props,!0)),{},{cx:f,cy:p});return D.createElement(Rt,{className:pt("recharts-reference-dot",v)},e.renderDot(m,w),lr.renderCallByParent(this.props,{x:f-s,y:p-s,width:2*s,height:2*s}))}}])}(D.Component);P1(N1,"displayName","ReferenceDot");P1(N1,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});P1(N1,"renderDot",function(t,e){var n;return D.isValidElement(t)?n=D.cloneElement(t,e):it(t)?n=t(e):n=D.createElement(w1,NE({},e,{cx:e.cx,cy:e.cy,className:"recharts-reference-dot-dot"})),n});function OE(){return OE=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},OE.apply(this,arguments)}function Xh(t){"@babel/helpers - typeof";return Xh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xh(t)}function V5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function H5(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?V5(Object(n),!0).forEach(function(r){A1(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):V5(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function E$e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function j$e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ZK(r.key),r)}}function P$e(t,e,n){return e&&j$e(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function N$e(t,e,n){return e=lx(e),A$e(t,XK()?Reflect.construct(e,n||[],lx(t).constructor):e.apply(t,n))}function A$e(t,e){if(e&&(Xh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return O$e(t)}function O$e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function XK(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(XK=function(){return!!t})()}function lx(t){return lx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},lx(t)}function R$e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&RE(t,e)}function RE(t,e){return RE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},RE(t,e)}function A1(t,e,n){return e=ZK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ZK(t){var e=D$e(t,"string");return Xh(e)=="symbol"?e:e+""}function D$e(t,e){if(Xh(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Xh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var M$e=function(e,n,r,i,a){var s=a.x1,o=a.x2,c=a.y1,u=a.y2,d=a.xAxis,h=a.yAxis;if(!d||!h)return null;var f=ZN({x:d.scale,y:h.scale}),p={x:e?f.x.apply(s,{position:"start"}):f.x.rangeMin,y:r?f.y.apply(c,{position:"start"}):f.y.rangeMin},g={x:n?f.x.apply(o,{position:"end"}):f.x.rangeMax,y:i?f.y.apply(u,{position:"end"}):f.y.rangeMax};return Ss(a,"discard")&&(!f.isInRange(p)||!f.isInRange(g))?null:$K(p,g)},O1=function(t){function e(){return E$e(this,e),N$e(this,e,arguments)}return R$e(e,t),P$e(e,[{key:"render",value:function(){var r=this.props,i=r.x1,a=r.x2,s=r.y1,o=r.y2,c=r.className,u=r.alwaysShow,d=r.clipPathId;Ga(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var h=nr(i),f=nr(a),p=nr(s),g=nr(o),m=this.props.shape;if(!h&&!f&&!p&&!g&&!m)return null;var v=M$e(h,f,p,g,this.props);if(!v&&!m)return null;var x=Ss(this.props,"hidden")?"url(#".concat(d,")"):void 0;return D.createElement(Rt,{className:pt("recharts-reference-area",c)},e.renderRect(m,H5(H5({clipPath:x},Ye(this.props,!0)),v)),lr.renderCallByParent(this.props,v))}}])}(D.Component);A1(O1,"displayName","ReferenceArea");A1(O1,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});A1(O1,"renderRect",function(t,e){var n;return D.isValidElement(t)?n=D.cloneElement(t,e):it(t)?n=t(e):n=D.createElement(XN,OE({},e,{className:"recharts-reference-area-rect"})),n});function QK(t,e,n){if(e<1)return[];if(e===1&&n===void 0)return t;for(var r=[],i=0;i<t.length;i+=e)r.push(t[i]);return r}function I$e(t,e,n){var r={width:t.width+e.width,height:t.height+e.height};return NLe(r,n)}function L$e(t,e,n){var r=n==="width",i=t.x,a=t.y,s=t.width,o=t.height;return e===1?{start:r?i:a,end:r?i+s:a+o}:{start:r?i+s:a+o,end:r?i:a}}function ux(t,e,n,r,i){if(t*e<t*r||t*e>t*i)return!1;var a=n();return t*(e-t*a/2-r)>=0&&t*(e+t*a/2-i)<=0}function $$e(t,e){return QK(t,e+1)}function F$e(t,e,n,r,i){for(var a=(r||[]).slice(),s=e.start,o=e.end,c=0,u=1,d=s,h=function(){var g=r==null?void 0:r[c];if(g===void 0)return{v:QK(r,u)};var m=c,v,x=function(){return v===void 0&&(v=n(g,m)),v},w=g.coordinate,y=c===0||ux(t,w,x,d,o);y||(c=0,d=s,u+=1),y&&(d=w+t*(x()/2+i),c+=u)},f;u<=a.length;)if(f=h(),f)return f.v;return[]}function Ng(t){"@babel/helpers - typeof";return Ng=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ng(t)}function q5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function _r(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?q5(Object(n),!0).forEach(function(r){B$e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):q5(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function B$e(t,e,n){return e=U$e(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function U$e(t){var e=z$e(t,"string");return Ng(e)=="symbol"?e:e+""}function z$e(t,e){if(Ng(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Ng(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function W$e(t,e,n,r,i){for(var a=(r||[]).slice(),s=a.length,o=e.start,c=e.end,u=function(f){var p=a[f],g,m=function(){return g===void 0&&(g=n(p,f)),g};if(f===s-1){var v=t*(p.coordinate+t*m()/2-c);a[f]=p=_r(_r({},p),{},{tickCoord:v>0?p.coordinate-v*t:p.coordinate})}else a[f]=p=_r(_r({},p),{},{tickCoord:p.coordinate});var x=ux(t,p.tickCoord,m,o,c);x&&(c=p.tickCoord-t*(m()/2+i),a[f]=_r(_r({},p),{},{isShow:!0}))},d=s-1;d>=0;d--)u(d);return a}function V$e(t,e,n,r,i,a){var s=(r||[]).slice(),o=s.length,c=e.start,u=e.end;if(a){var d=r[o-1],h=n(d,o-1),f=t*(d.coordinate+t*h/2-u);s[o-1]=d=_r(_r({},d),{},{tickCoord:f>0?d.coordinate-f*t:d.coordinate});var p=ux(t,d.tickCoord,function(){return h},c,u);p&&(u=d.tickCoord-t*(h/2+i),s[o-1]=_r(_r({},d),{},{isShow:!0}))}for(var g=a?o-1:o,m=function(w){var y=s[w],k,S=function(){return k===void 0&&(k=n(y,w)),k};if(w===0){var _=t*(y.coordinate-t*S()/2-c);s[w]=y=_r(_r({},y),{},{tickCoord:_<0?y.coordinate-_*t:y.coordinate})}else s[w]=y=_r(_r({},y),{},{tickCoord:y.coordinate});var C=ux(t,y.tickCoord,S,c,u);C&&(c=y.tickCoord+t*(S()/2+i),s[w]=_r(_r({},y),{},{isShow:!0}))},v=0;v<g;v++)m(v);return s}function aA(t,e,n){var r=t.tick,i=t.ticks,a=t.viewBox,s=t.minTickGap,o=t.orientation,c=t.interval,u=t.tickFormatter,d=t.unit,h=t.angle;if(!i||!i.length||!r)return[];if(Ce(c)||xs.isSsr)return $$e(i,typeof c=="number"&&Ce(c)?c:0);var f=[],p=o==="top"||o==="bottom"?"width":"height",g=d&&p==="width"?Yp(d,{fontSize:e,letterSpacing:n}):{width:0,height:0},m=function(y,k){var S=it(u)?u(y.value,k):y.value;return p==="width"?I$e(Yp(S,{fontSize:e,letterSpacing:n}),g,h):Yp(S,{fontSize:e,letterSpacing:n})[p]},v=i.length>=2?zr(i[1].coordinate-i[0].coordinate):1,x=L$e(a,v,p);return c==="equidistantPreserveStart"?F$e(v,x,m,i,s):(c==="preserveStart"||c==="preserveStartEnd"?f=V$e(v,x,m,i,s,c==="preserveStartEnd"):f=W$e(v,x,m,i,s),f.filter(function(w){return w.isShow}))}var H$e=["viewBox"],q$e=["viewBox"],K$e=["ticks"];function Zh(t){"@babel/helpers - typeof";return Zh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zh(t)}function wd(){return wd=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},wd.apply(this,arguments)}function K5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Gn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?K5(Object(n),!0).forEach(function(r){sA(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):K5(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Wk(t,e){if(t==null)return{};var n=G$e(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function G$e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function Y$e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function G5(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,tG(r.key),r)}}function J$e(t,e,n){return e&&G5(t.prototype,e),n&&G5(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function X$e(t,e,n){return e=dx(e),Z$e(t,eG()?Reflect.construct(e,n||[],dx(t).constructor):e.apply(t,n))}function Z$e(t,e){if(e&&(Zh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Q$e(t)}function Q$e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function eG(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(eG=function(){return!!t})()}function dx(t){return dx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},dx(t)}function e9e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&DE(t,e)}function DE(t,e){return DE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},DE(t,e)}function sA(t,e,n){return e=tG(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function tG(t){var e=t9e(t,"string");return Zh(e)=="symbol"?e:e+""}function t9e(t,e){if(Zh(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Zh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var If=function(t){function e(n){var r;return Y$e(this,e),r=X$e(this,e,[n]),r.state={fontSize:"",letterSpacing:""},r}return e9e(e,t),J$e(e,[{key:"shouldComponentUpdate",value:function(r,i){var a=r.viewBox,s=Wk(r,H$e),o=this.props,c=o.viewBox,u=Wk(o,q$e);return!Wd(a,c)||!Wd(s,u)||!Wd(i,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var i=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];i&&this.setState({fontSize:window.getComputedStyle(i).fontSize,letterSpacing:window.getComputedStyle(i).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var i=this.props,a=i.x,s=i.y,o=i.width,c=i.height,u=i.orientation,d=i.tickSize,h=i.mirror,f=i.tickMargin,p,g,m,v,x,w,y=h?-1:1,k=r.tickSize||d,S=Ce(r.tickCoord)?r.tickCoord:r.coordinate;switch(u){case"top":p=g=r.coordinate,v=s+ +!h*c,m=v-y*k,w=m-y*f,x=S;break;case"left":m=v=r.coordinate,g=a+ +!h*o,p=g-y*k,x=p-y*f,w=S;break;case"right":m=v=r.coordinate,g=a+ +h*o,p=g+y*k,x=p+y*f,w=S;break;default:p=g=r.coordinate,v=s+ +h*c,m=v+y*k,w=m+y*f,x=S;break}return{line:{x1:p,y1:m,x2:g,y2:v},tick:{x,y:w}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,i=r.orientation,a=r.mirror,s;switch(i){case"left":s=a?"start":"end";break;case"right":s=a?"end":"start";break;default:s="middle";break}return s}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,i=r.orientation,a=r.mirror,s="end";switch(i){case"left":case"right":s="middle";break;case"top":s=a?"start":"end";break;default:s=a?"end":"start";break}return s}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.x,a=r.y,s=r.width,o=r.height,c=r.orientation,u=r.mirror,d=r.axisLine,h=Gn(Gn(Gn({},Ye(this.props,!1)),Ye(d,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var f=+(c==="top"&&!u||c==="bottom"&&u);h=Gn(Gn({},h),{},{x1:i,y1:a+f*o,x2:i+s,y2:a+f*o})}else{var p=+(c==="left"&&!u||c==="right"&&u);h=Gn(Gn({},h),{},{x1:i+p*s,y1:a,x2:i+p*s,y2:a+o})}return D.createElement("line",wd({},h,{className:pt("recharts-cartesian-axis-line",Pi(d,"className"))}))}},{key:"renderTicks",value:function(r,i,a){var s=this,o=this.props,c=o.tickLine,u=o.stroke,d=o.tick,h=o.tickFormatter,f=o.unit,p=aA(Gn(Gn({},this.props),{},{ticks:r}),i,a),g=this.getTickTextAnchor(),m=this.getTickVerticalAnchor(),v=Ye(this.props,!1),x=Ye(d,!1),w=Gn(Gn({},v),{},{fill:"none"},Ye(c,!1)),y=p.map(function(k,S){var _=s.getTickLineCoord(k),C=_.line,T=_.tick,E=Gn(Gn(Gn(Gn({textAnchor:g,verticalAnchor:m},v),{},{stroke:"none",fill:u},x),T),{},{index:S,payload:k,visibleTicksCount:p.length,tickFormatter:h});return D.createElement(Rt,wd({className:"recharts-cartesian-axis-tick",key:"tick-".concat(k.value,"-").concat(k.coordinate,"-").concat(k.tickCoord)},fu(s.props,k,S)),c&&D.createElement("line",wd({},w,C,{className:pt("recharts-cartesian-axis-tick-line",Pi(c,"className"))})),d&&e.renderTickItem(d,E,"".concat(it(h)?h(k.value,S):k.value).concat(f||"")))});return D.createElement("g",{className:"recharts-cartesian-axis-ticks"},y)}},{key:"render",value:function(){var r=this,i=this.props,a=i.axisLine,s=i.width,o=i.height,c=i.ticksGenerator,u=i.className,d=i.hide;if(d)return null;var h=this.props,f=h.ticks,p=Wk(h,K$e),g=f;return it(c)&&(g=f&&f.length>0?c(this.props):c(p)),s<=0||o<=0||!g||!g.length?null:D.createElement(Rt,{className:pt("recharts-cartesian-axis",u),ref:function(v){r.layerReference=v}},a&&this.renderAxisLine(),this.renderTicks(g,this.state.fontSize,this.state.letterSpacing),lr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,a){var s,o=pt(i.className,"recharts-cartesian-axis-tick-value");return D.isValidElement(r)?s=D.cloneElement(r,Gn(Gn({},i),{},{className:o})):it(r)?s=r(Gn(Gn({},i),{},{className:o})):s=D.createElement(pu,wd({},i,{className:"recharts-cartesian-axis-tick-value"}),a),s}}])}(b.Component);sA(If,"displayName","CartesianAxis");sA(If,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var n9e=["x1","y1","x2","y2","key"],r9e=["offset"];function vu(t){"@babel/helpers - typeof";return vu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vu(t)}function Y5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Tr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Y5(Object(n),!0).forEach(function(r){i9e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Y5(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function i9e(t,e,n){return e=a9e(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function a9e(t){var e=s9e(t,"string");return vu(e)=="symbol"?e:e+""}function s9e(t,e){if(vu(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(vu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Rl(){return Rl=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Rl.apply(this,arguments)}function J5(t,e){if(t==null)return{};var n=o9e(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function o9e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var c9e=function(e){var n=e.fill;if(!n||n==="none")return null;var r=e.fillOpacity,i=e.x,a=e.y,s=e.width,o=e.height,c=e.ry;return D.createElement("rect",{x:i,y:a,ry:c,width:s,height:o,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function nG(t,e){var n;if(D.isValidElement(t))n=D.cloneElement(t,e);else if(it(t))n=t(e);else{var r=e.x1,i=e.y1,a=e.x2,s=e.y2,o=e.key,c=J5(e,n9e),u=Ye(c,!1);u.offset;var d=J5(u,r9e);n=D.createElement("line",Rl({},d,{x1:r,y1:i,x2:a,y2:s,fill:"none",key:o}))}return n}function l9e(t){var e=t.x,n=t.width,r=t.horizontal,i=r===void 0?!0:r,a=t.horizontalPoints;if(!i||!a||!a.length)return null;var s=a.map(function(o,c){var u=Tr(Tr({},t),{},{x1:e,y1:o,x2:e+n,y2:o,key:"line-".concat(c),index:c});return nG(i,u)});return D.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function u9e(t){var e=t.y,n=t.height,r=t.vertical,i=r===void 0?!0:r,a=t.verticalPoints;if(!i||!a||!a.length)return null;var s=a.map(function(o,c){var u=Tr(Tr({},t),{},{x1:o,y1:e,x2:o,y2:e+n,key:"line-".concat(c),index:c});return nG(i,u)});return D.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function d9e(t){var e=t.horizontalFill,n=t.fillOpacity,r=t.x,i=t.y,a=t.width,s=t.height,o=t.horizontalPoints,c=t.horizontal,u=c===void 0?!0:c;if(!u||!e||!e.length)return null;var d=o.map(function(f){return Math.round(f+i-i)}).sort(function(f,p){return f-p});i!==d[0]&&d.unshift(0);var h=d.map(function(f,p){var g=!d[p+1],m=g?i+s-f:d[p+1]-f;if(m<=0)return null;var v=p%e.length;return D.createElement("rect",{key:"react-".concat(p),y:f,x:r,height:m,width:a,stroke:"none",fill:e[v],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return D.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},h)}function h9e(t){var e=t.vertical,n=e===void 0?!0:e,r=t.verticalFill,i=t.fillOpacity,a=t.x,s=t.y,o=t.width,c=t.height,u=t.verticalPoints;if(!n||!r||!r.length)return null;var d=u.map(function(f){return Math.round(f+a-a)}).sort(function(f,p){return f-p});a!==d[0]&&d.unshift(0);var h=d.map(function(f,p){var g=!d[p+1],m=g?a+o-f:d[p+1]-f;if(m<=0)return null;var v=p%r.length;return D.createElement("rect",{key:"react-".concat(p),x:f,y:s,width:m,height:c,stroke:"none",fill:r[v],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return D.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},h)}var f9e=function(e,n){var r=e.xAxis,i=e.width,a=e.height,s=e.offset;return tK(aA(Tr(Tr(Tr({},If.defaultProps),r),{},{ticks:so(r,!0),viewBox:{x:0,y:0,width:i,height:a}})),s.left,s.left+s.width,n)},p9e=function(e,n){var r=e.yAxis,i=e.width,a=e.height,s=e.offset;return tK(aA(Tr(Tr(Tr({},If.defaultProps),r),{},{ticks:so(r,!0),viewBox:{x:0,y:0,width:i,height:a}})),s.top,s.top+s.height,n)},Ju={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function ME(t){var e,n,r,i,a,s,o=tA(),c=nA(),u=t$e(),d=Tr(Tr({},t),{},{stroke:(e=t.stroke)!==null&&e!==void 0?e:Ju.stroke,fill:(n=t.fill)!==null&&n!==void 0?n:Ju.fill,horizontal:(r=t.horizontal)!==null&&r!==void 0?r:Ju.horizontal,horizontalFill:(i=t.horizontalFill)!==null&&i!==void 0?i:Ju.horizontalFill,vertical:(a=t.vertical)!==null&&a!==void 0?a:Ju.vertical,verticalFill:(s=t.verticalFill)!==null&&s!==void 0?s:Ju.verticalFill,x:Ce(t.x)?t.x:u.left,y:Ce(t.y)?t.y:u.top,width:Ce(t.width)?t.width:u.width,height:Ce(t.height)?t.height:u.height}),h=d.x,f=d.y,p=d.width,g=d.height,m=d.syncWithTicks,v=d.horizontalValues,x=d.verticalValues,w=ZLe(),y=QLe();if(!Ce(p)||p<=0||!Ce(g)||g<=0||!Ce(h)||h!==+h||!Ce(f)||f!==+f)return null;var k=d.verticalCoordinatesGenerator||f9e,S=d.horizontalCoordinatesGenerator||p9e,_=d.horizontalPoints,C=d.verticalPoints;if((!_||!_.length)&&it(S)){var T=v&&v.length,E=S({yAxis:y?Tr(Tr({},y),{},{ticks:T?v:y.ticks}):void 0,width:o,height:c,offset:u},T?!0:m);Ga(Array.isArray(E),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(vu(E),"]")),Array.isArray(E)&&(_=E)}if((!C||!C.length)&&it(k)){var j=x&&x.length,P=k({xAxis:w?Tr(Tr({},w),{},{ticks:j?x:w.ticks}):void 0,width:o,height:c,offset:u},j?!0:m);Ga(Array.isArray(P),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(vu(P),"]")),Array.isArray(P)&&(C=P)}return D.createElement("g",{className:"recharts-cartesian-grid"},D.createElement(c9e,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),D.createElement(l9e,Rl({},d,{offset:u,horizontalPoints:_,xAxis:w,yAxis:y})),D.createElement(u9e,Rl({},d,{offset:u,verticalPoints:C,xAxis:w,yAxis:y})),D.createElement(d9e,Rl({},d,{horizontalPoints:_})),D.createElement(h9e,Rl({},d,{verticalPoints:C})))}ME.displayName="CartesianGrid";var m9e=["type","layout","connectNulls","ref"],g9e=["key"];function Qh(t){"@babel/helpers - typeof";return Qh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qh(t)}function X5(t,e){if(t==null)return{};var n=v9e(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function v9e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function tm(){return tm=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},tm.apply(this,arguments)}function Z5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function gi(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Z5(Object(n),!0).forEach(function(r){Aa(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Z5(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Xu(t){return w9e(t)||x9e(t)||b9e(t)||y9e()}function y9e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 956In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function b9e(t,e){if(t){if(typeof t=="string")return IE(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return IE(t,e)}}function x9e(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function w9e(t){if(Array.isArray(t))return IE(t)}function IE(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function S9e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Q5(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,iG(r.key),r)}}function k9e(t,e,n){return e&&Q5(t.prototype,e),n&&Q5(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function _9e(t,e,n){return e=hx(e),C9e(t,rG()?Reflect.construct(e,n||[],hx(t).constructor):e.apply(t,n))}function C9e(t,e){if(e&&(Qh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return T9e(t)}function T9e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function rG(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rG=function(){return!!t})()}function hx(t){return hx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},hx(t)}function E9e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&LE(t,e)}function LE(t,e){return LE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},LE(t,e)}function Aa(t,e,n){return e=iG(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function iG(t){var e=j9e(t,"string");return Qh(e)=="symbol"?e:e+""}function j9e(t,e){if(Qh(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Qh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var mv=function(t){function e(){var n;S9e(this,e);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=_9e(this,e,[].concat(i)),Aa(n,"state",{isAnimationFinished:!0,totalLength:0}),Aa(n,"generateSimpleStrokeDasharray",function(s,o){return"".concat(o,"px ").concat(s-o,"px")}),Aa(n,"getStrokeDasharray",function(s,o,c){var u=c.reduce(function(x,w){return x+w});if(!u)return n.generateSimpleStrokeDasharray(o,s);for(var d=Math.floor(s/u),h=s%u,f=o-s,p=[],g=0,m=0;g<c.length;m+=c[g],++g)if(m+c[g]>h){p=[].concat(Xu(c.slice(0,g)),[h-m]);break}var v=p.length%2===0?[0,f]:[f];return[].concat(Xu(e.repeat(c,d)),Xu(p),v).map(function(x){return"".concat(x,"px")}).join(", ")}),Aa(n,"id",Pf("recharts-line-")),Aa(n,"pathRef",function(s){n.mainCurve=s}),Aa(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Aa(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return E9e(e,t),k9e(e,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,s=a.points,o=a.xAxis,c=a.yAxis,u=a.layout,d=a.children,h=Ni(d,pv);if(!h)return null;var f=function(m,v){return{x:m.x,y:m.y,value:m.value,errorVal:er(m.payload,v)}},p={clipPath:r?"url(#clipPath-".concat(i,")"):null};return D.createElement(Rt,p,h.map(function(g){return D.cloneElement(g,{key:"bar-".concat(g.props.dataKey),data:s,xAxis:o,yAxis:c,layout:u,dataPointFormatter:f})}))}},{key:"renderDots",value:function(r,i,a){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var o=this.props,c=o.dot,u=o.points,d=o.dataKey,h=Ye(this.props,!1),f=Ye(c,!0),p=u.map(function(m,v){var x=gi(gi(gi({key:"dot-".concat(v),r:3},h),f),{},{index:v,cx:m.x,cy:m.y,value:m.value,dataKey:d,payload:m.payload,points:u});return e.renderDotItem(c,x)}),g={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return D.createElement(Rt,tm({className:"recharts-line-dots",key:"dots"},g),p)}},{key:"renderCurveStatically",value:function(r,i,a,s){var o=this.props,c=o.type,u=o.layout,d=o.connectNulls;o.ref;var h=X5(o,m9e),f=gi(gi(gi({},Ye(h,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:r},s),{},{type:c,layout:u,connectNulls:d});return D.createElement(qb,tm({},f,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,i){var a=this,s=this.props,o=s.points,c=s.strokeDasharray,u=s.isAnimationActive,d=s.animationBegin,h=s.animationDuration,f=s.animationEasing,p=s.animationId,g=s.animateNewValues,m=s.width,v=s.height,x=this.state,w=x.prevPoints,y=x.totalLength;return D.createElement(As,{begin:d,duration:h,isActive:u,easing:f,from:{t:0},to:{t:1},key:"line-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(k){var S=k.t;if(w){var _=w.length/o.length,C=o.map(function(M,U){var N=Math.floor(U*_);if(w[N]){var B=w[N],$=wi(B.x,M.x),I=wi(B.y,M.y);return gi(gi({},M),{},{x:$(S),y:I(S)})}if(g){var R=wi(m*2,M.x),z=wi(v/2,M.y);return gi(gi({},M),{},{x:R(S),y:z(S)})}return gi(gi({},M),{},{x:M.x,y:M.y})});return a.renderCurveStatically(C,r,i)}var T=wi(0,y),E=T(S),j;if(c){var P="".concat(c).split(/[,\s]+/gim).map(function(M){return parseFloat(M)});j=a.getStrokeDasharray(E,y,P)}else j=a.generateSimpleStrokeDasharray(y,E);return a.renderCurveStatically(o,r,i,{strokeDasharray:j})})}},{key:"renderCurve",value:function(r,i){var a=this.props,s=a.points,o=a.isAnimationActive,c=this.state,u=c.prevPoints,d=c.totalLength;return o&&s&&s.length&&(!u&&d>0||!fv(u,s))?this.renderCurveWithAnimation(r,i):this.renderCurveStatically(s,r,i)}},{key:"render",value:function(){var r,i=this.props,a=i.hide,s=i.dot,o=i.points,c=i.className,u=i.xAxis,d=i.yAxis,h=i.top,f=i.left,p=i.width,g=i.height,m=i.isAnimationActive,v=i.id;if(a||!o||!o.length)return null;var x=this.state.isAnimationFinished,w=o.length===1,y=pt("recharts-line",c),k=u&&u.allowDataOverflow,S=d&&d.allowDataOverflow,_=k||S,C=ut(v)?this.id:v,T=(r=Ye(s,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},E=T.r,j=E===void 0?3:E,P=T.strokeWidth,M=P===void 0?2:P,U=nSe(s)?s:{},N=U.clipDot,B=N===void 0?!0:N,$=j*2+M;return D.createElement(Rt,{className:y},k||S?D.createElement("defs",null,D.createElement("clipPath",{id:"clipPath-".concat(C)},D.createElement("rect",{x:k?f:f-p/2,y:S?h:h-g/2,width:k?p:p*2,height:S?g:g*2})),!B&&D.createElement("clipPath",{id:"clipPath-dots-".concat(C)},D.createElement("rect",{x:f-$/2,y:h-$/2,width:p+$,height:g+$}))):null,!w&&this.renderCurve(_,C),this.renderErrorBar(_,C),(w||s)&&this.renderDots(_,B,C),(!m||x)&&uo.renderCallByParent(this.props,o))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,i){for(var a=r.length%2!==0?[].concat(Xu(r),[0]):r,s=[],o=0;o<i;++o)s=[].concat(Xu(s),Xu(a));return s}},{key:"renderDotItem",value:function(r,i){var a;if(D.isValidElement(r))a=D.cloneElement(r,i);else if(it(r))a=r(i);else{var s=i.key,o=X5(i,g9e),c=pt("recharts-line-dot",typeof r!="boolean"?r.className:"");a=D.createElement(w1,tm({key:s},o,{className:c}))}return a}}])}(b.PureComponent);Aa(mv,"displayName","Line");Aa(mv,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!xs.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Aa(mv,"getComposedData",function(t){var e=t.props,n=t.xAxis,r=t.yAxis,i=t.xAxisTicks,a=t.yAxisTicks,s=t.dataKey,o=t.bandSize,c=t.displayedData,u=t.offset,d=e.layout,h=c.map(function(f,p){var g=er(f,s);return d==="horizontal"?{x:k3({axis:n,ticks:i,bandSize:o,entry:f,index:p}),y:ut(g)?null:r.scale(g),value:g,payload:f}:{x:ut(g)?null:n.scale(g),y:k3({axis:r,ticks:a,bandSize:o,entry:f,index:p}),value:g,payload:f}});return gi({points:h,layout:d},u)});function ef(t){"@babel/helpers - typeof";return ef=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ef(t)}function P9e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function N9e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,oG(r.key),r)}}function A9e(t,e,n){return e&&N9e(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function O9e(t,e,n){return e=fx(e),R9e(t,aG()?Reflect.construct(e,n||[],fx(t).constructor):e.apply(t,n))}function R9e(t,e){if(e&&(ef(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return D9e(t)}function D9e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function aG(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(aG=function(){return!!t})()}function fx(t){return fx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},fx(t)}function M9e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$E(t,e)}function $E(t,e){return $E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},$E(t,e)}function sG(t,e,n){return e=oG(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function oG(t){var e=I9e(t,"string");return ef(e)=="symbol"?e:e+""}function I9e(t,e){if(ef(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(ef(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function FE(){return FE=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},FE.apply(this,arguments)}function L9e(t){var e=t.xAxisId,n=tA(),r=nA(),i=HK(e);return i==null?null:b.createElement(If,FE({},i,{className:pt("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(s){return so(s,!0)}}))}var tf=function(t){function e(){return P9e(this,e),O9e(this,e,arguments)}return M9e(e,t),A9e(e,[{key:"render",value:function(){return b.createElement(L9e,this.props)}}])}(b.Component);sG(tf,"displayName","XAxis");sG(tf,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function nf(t){"@babel/helpers - typeof";return nf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nf(t)}function $9e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function F9e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,uG(r.key),r)}}function B9e(t,e,n){return e&&F9e(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function U9e(t,e,n){return e=px(e),z9e(t,cG()?Reflect.construct(e,n||[],px(t).constructor):e.apply(t,n))}function z9e(t,e){if(e&&(nf(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return W9e(t)}function W9e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function cG(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(cG=function(){return!!t})()}function px(t){return px=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},px(t)}function V9e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&BE(t,e)}function BE(t,e){return BE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},BE(t,e)}function lG(t,e,n){return e=uG(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function uG(t){var e=H9e(t,"string");return nf(e)=="symbol"?e:e+""}function H9e(t,e){if(nf(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(nf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function UE(){return UE=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},UE.apply(this,arguments)}var q9e=function(e){var n=e.yAxisId,r=tA(),i=nA(),a=qK(n);return a==null?null:b.createElement(If,UE({},a,{className:pt("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:r,height:i},ticksGenerator:function(o){return so(o,!0)}}))},rf=function(t){function e(){return $9e(this,e),U9e(this,e,arguments)}return V9e(e,t),B9e(e,[{key:"render",value:function(){return b.createElement(q9e,this.props)}}])}(b.Component);lG(rf,"displayName","YAxis");lG(rf,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function e8(t){return J9e(t)||Y9e(t)||G9e(t)||K9e()}function K9e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 957In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function G9e(t,e){if(t){if(typeof t=="string")return zE(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zE(t,e)}}function Y9e(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function J9e(t){if(Array.isArray(t))return zE(t)}function zE(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var WE=function(e,n,r,i,a){var s=Ni(e,iA),o=Ni(e,N1),c=[].concat(e8(s),e8(o)),u=Ni(e,O1),d="".concat(i,"Id"),h=i[0],f=n;if(c.length&&(f=c.reduce(function(m,v){if(v.props[d]===r&&Ss(v.props,"extendDomain")&&Ce(v.props[h])){var x=v.props[h];return[Math.min(m[0],x),Math.max(m[1],x)]}return m},f)),u.length){var p="".concat(h,"1"),g="".concat(h,"2");f=u.reduce(function(m,v){if(v.props[d]===r&&Ss(v.props,"extendDomain")&&Ce(v.props[p])&&Ce(v.props[g])){var x=v.props[p],w=v.props[g];return[Math.min(m[0],x,w),Math.max(m[1],x,w)]}return m},f)}return a&&a.length&&(f=a.reduce(function(m,v){return Ce(v)?[Math.min(m[0],v),Math.max(m[1],v)]:m},f)),f},dG={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function a(c,u,d,h,f){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new i(d,h||c,f),g=n?n+u:u;return c._events[g]?c._events[g].fn?c._events[g]=[c._events[g],p]:c._events[g].push(p):(c._events[g]=p,c._eventsCount++),c}function s(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function o(){this._events=new r,this._eventsCount=0}o.prototype.eventNames=function(){var u=[],d,h;if(this._eventsCount===0)return u;for(h in d=this._events)e.call(d,h)&&u.push(n?h.slice(1):h);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},o.prototype.listeners=function(u){var d=n?n+u:u,h=this._events[d];if(!h)return[];if(h.fn)return[h.fn];for(var f=0,p=h.length,g=new Array(p);f<p;f++)g[f]=h[f].fn;return g},o.prototype.listenerCount=function(u){var d=n?n+u:u,h=this._events[d];return h?h.fn?1:h.length:0},o.prototype.emit=function(u,d,h,f,p,g){var m=n?n+u:u;if(!this._events[m])return!1;var v=this._events[m],x=arguments.length,w,y;if(v.fn){switch(v.once&&this.removeListener(u,v.fn,void 0,!0),x){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,d),!0;case 3:return v.fn.call(v.context,d,h),!0;case 4:return v.fn.call(v.context,d,h,f),!0;case 5:return v.fn.call(v.context,d,h,f,p),!0;case 6:return v.fn.call(v.context,d,h,f,p,g),!0}for(y=1,w=new Array(x-1);y<x;y++)w[y-1]=arguments[y];v.fn.apply(v.context,w)}else{var k=v.length,S;for(y=0;y<k;y++)switch(v[y].once&&this.removeListener(u,v[y].fn,void 0,!0),x){case 1:v[y].fn.call(v[y].context);break;case 2:v[y].fn.call(v[y].context,d);break;case 3:v[y].fn.call(v[y].context,d,h);break;case 4:v[y].fn.call(v[y].context,d,h,f);break;default:if(!w)for(S=1,w=new Array(x-1);S<x;S++)w[S-1]=arguments[S];v[y].fn.apply(v[y].context,w)}}return!0},o.prototype.on=function(u,d,h){return a(this,u,d,h,!1)},o.prototype.once=function(u,d,h){return a(this,u,d,h,!0)},o.prototype.removeListener=function(u,d,h,f){var p=n?n+u:u;if(!this._events[p])return this;if(!d)return s(this,p),this;var g=this._events[p];if(g.fn)g.fn===d&&(!f||g.once)&&(!h||g.context===h)&&s(this,p);else{for(var m=0,v=[],x=g.length;m<x;m++)(g[m].fn!==d||f&&!g[m].once||h&&g[m].context!==h)&&v.push(g[m]);v.length?this._events[p]=v.length===1?v[0]:v:s(this,p)}return this},o.prototype.removeAllListeners=function(u){var d;return u?(d=n?n+u:u,this._events[d]&&s(this,d)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,t.exports=o})(dG);var X9e=dG.exports;const Z9e=Lt(X9e);var Vk=new Z9e,Hk="recharts.syncMouseEvents";function Ag(t){"@babel/helpers - typeof";return Ag=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ag(t)}function Q9e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function eFe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,hG(r.key),r)}}function tFe(t,e,n){return e&&eFe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function qk(t,e,n){return e=hG(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function hG(t){var e=nFe(t,"string");return Ag(e)=="symbol"?e:e+""}function nFe(t,e){if(Ag(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Ag(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var rFe=function(){function t(){Q9e(this,t),qk(this,"activeIndex",0),qk(this,"coordinateList",[]),qk(this,"layout","horizontal")}return tFe(t,[{key:"setDetails",value:function(n){var r,i=n.coordinateList,a=i===void 0?null:i,s=n.container,o=s===void 0?null:s,c=n.layout,u=c===void 0?null:c,d=n.offset,h=d===void 0?null:d,f=n.mouseHandlerCallback,p=f===void 0?null:f;this.coordinateList=(r=a??this.coordinateList)!==null&&r!==void 0?r:[],this.container=o??this.container,this.layout=u??this.layout,this.offset=h??this.offset,this.mouseHandlerCallback=p??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var i=this.container.getBoundingClientRect(),a=i.x,s=i.y,o=i.height,c=this.coordinateList[this.activeIndex].coordinate,u=((n=window)===null||n===void 0?void 0:n.scrollX)||0,d=((r=window)===null||r===void 0?void 0:r.scrollY)||0,h=a+c+u,f=s+this.offset.top+o/2+d;this.mouseHandlerCallback({pageX:h,pageY:f})}}}])}();function iFe(t,e,n){if(n==="number"&&e===!0&&Array.isArray(t)){var r=t==null?void 0:t[0],i=t==null?void 0:t[1];if(r&&i&&Ce(r)&&Ce(i))return!0}return!1}function aFe(t,e,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:t==="horizontal"?e.x-i:n.left+.5,y:t==="horizontal"?n.top+.5:e.y-i,width:t==="horizontal"?r:n.width-1,height:t==="horizontal"?n.height-1:r}}function fG(t){var e=t.cx,n=t.cy,r=t.radius,i=t.startAngle,a=t.endAngle,s=nn(e,n,r,i),o=nn(e,n,r,a);return{points:[s,o],cx:e,cy:n,radius:r,startAngle:i,endAngle:a}}function sFe(t,e,n){var r,i,a,s;if(t==="horizontal")r=e.x,a=r,i=n.top,s=n.top+n.height;else if(t==="vertical")i=e.y,s=i,r=n.left,a=n.left+n.width;else if(e.cx!=null&&e.cy!=null)if(t==="centric"){var o=e.cx,c=e.cy,u=e.innerRadius,d=e.outerRadius,h=e.angle,f=nn(o,c,u,h),p=nn(o,c,d,h);r=f.x,i=f.y,a=p.x,s=p.y}else return fG(e);return[{x:r,y:i},{x:a,y:s}]}function Og(t){"@babel/helpers - typeof";return Og=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Og(t)}function t8(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function xy(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?t8(Object(n),!0).forEach(function(r){oFe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):t8(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function oFe(t,e,n){return e=cFe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cFe(t){var e=lFe(t,"string");return Og(e)=="symbol"?e:e+""}function lFe(t,e){if(Og(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Og(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function uFe(t){var e,n,r=t.element,i=t.tooltipEventType,a=t.isActive,s=t.activeCoordinate,o=t.activePayload,c=t.offset,u=t.activeTooltipIndex,d=t.tooltipAxisBandSize,h=t.layout,f=t.chartName,p=(e=r.props.cursor)!==null&&e!==void 0?e:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!p||!a||!s||f!=="ScatterChart"&&i!=="axis")return null;var g,m=qb;if(f==="ScatterChart")g=s,m=j5e;else if(f==="BarChart")g=aFe(h,s,c,d),m=XN;else if(h==="radial"){var v=fG(s),x=v.cx,w=v.cy,y=v.radius,k=v.startAngle,S=v.endAngle;g={cx:x,cy:w,startAngle:k,endAngle:S,innerRadius:y,outerRadius:y},m=hK}else g={points:sFe(h,s,c)},m=qb;var _=xy(xy(xy(xy({stroke:"#ccc",pointerEvents:"none"},c),g),Ye(p,!1)),{},{payload:o,payloadIndex:u,className:pt("recharts-tooltip-cursor",p.className)});return b.isValidElement(p)?b.cloneElement(p,_):b.createElement(m,_)}var dFe=["item"],hFe=["children","className","width","height","style","compact","title","desc"];function af(t){"@babel/helpers - typeof";return af=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},af(t)}function Sd(){return Sd=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Sd.apply(this,arguments)}function n8(t,e){return mFe(t)||pFe(t,e)||mG(t,e)||fFe()}function fFe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 958In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pFe(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,o=[],c=!0,u=!1;try{if(a=(n=n.call(t)).next,e!==0)for(;!(c=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function mFe(t){if(Array.isArray(t))return t}function r8(t,e){if(t==null)return{};var n=gFe(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function gFe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function vFe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yFe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,gG(r.key),r)}}function bFe(t,e,n){return e&&yFe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function xFe(t,e,n){return e=mx(e),wFe(t,pG()?Reflect.construct(e,n||[],mx(t).constructor):e.apply(t,n))}function wFe(t,e){if(e&&(af(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return SFe(t)}function SFe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function pG(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(pG=function(){return!!t})()}function mx(t){return mx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},mx(t)}function kFe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&VE(t,e)}function VE(t,e){return VE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},VE(t,e)}function sf(t){return TFe(t)||CFe(t)||mG(t)||_Fe()}function _Fe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 959In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mG(t,e){if(t){if(typeof t=="string")return HE(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return HE(t,e)}}function CFe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function TFe(t){if(Array.isArray(t))return HE(t)}function HE(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function i8(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ae(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?i8(Object(n),!0).forEach(function(r){Xe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i8(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Xe(t,e,n){return e=gG(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function gG(t){var e=EFe(t,"string");return af(e)=="symbol"?e:e+""}function EFe(t,e){if(af(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(af(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var jFe={xAxis:["bottom","top"],yAxis:["left","right"]},PFe={width:"100%",height:"100%"},vG={x:0,y:0};function wy(t){return t}var NFe=function(e,n){return n==="horizontal"?e.x:n==="vertical"?e.y:n==="centric"?e.angle:e.radius},AFe=function(e,n,r,i){var a=n.find(function(d){return d&&d.index===r});if(a){if(e==="horizontal")return{x:a.coordinate,y:i.y};if(e==="vertical")return{x:i.x,y:a.coordinate};if(e==="centric"){var s=a.coordinate,o=i.radius;return ae(ae(ae({},i),nn(i.cx,i.cy,o,s)),{},{angle:s,radius:o})}var c=a.coordinate,u=i.angle;return ae(ae(ae({},i),nn(i.cx,i.cy,c,u)),{},{angle:u,radius:c})}return vG},R1=function(e,n){var r=n.graphicalItems,i=n.dataStartIndex,a=n.dataEndIndex,s=(r??[]).reduce(function(o,c){var u=c.props.data;return u&&u.length?[].concat(sf(o),sf(u)):o},[]);return s.length>0?s:e&&e.length&&Ce(i)&&Ce(a)?e.slice(i,a+1):[]};function yG(t){return t==="number"?[0,"auto"]:void 0}var qE=function(e,n,r,i){var a=e.graphicalItems,s=e.tooltipAxis,o=R1(n,e);return r<0||!a||!a.length||r>=o.length?null:a.reduce(function(c,u){var d,h=(d=u.props.data)!==null&&d!==void 0?d:n;h&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=r&&(h=h.slice(e.dataStartIndex,e.dataEndIndex+1));var f;if(s.dataKey&&!s.allowDuplicatedCategory){var p=h===void 0?o:h;f=mb(p,s.dataKey,i)}else f=h&&h[r]||o[r];return f?[].concat(sf(c),[sK(u,f)]):c},[])},a8=function(e,n,r,i){var a=i||{x:e.chartX,y:e.chartY},s=NFe(a,r),o=e.orderedTooltipTicks,c=e.tooltipAxis,u=e.tooltipTicks,d=rMe(s,o,u,c);if(d>=0&&u){var h=u[d]&&u[d].value,f=qE(e,n,d,h),p=AFe(r,o,d,a);return{activeTooltipIndex:d,activeLabel:h,activePayload:f,activeCoordinate:p}}return null},OFe=function(e,n){var r=n.axes,i=n.graphicalItems,a=n.axisType,s=n.axisIdKey,o=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=e.layout,h=e.children,f=e.stackOffset,p=eK(d,a);return r.reduce(function(g,m){var v,x=m.type.defaultProps!==void 0?ae(ae({},m.type.defaultProps),m.props):m.props,w=x.type,y=x.dataKey,k=x.allowDataOverflow,S=x.allowDuplicatedCategory,_=x.scale,C=x.ticks,T=x.includeHidden,E=x[s];if(g[E])return g;var j=R1(e.data,{graphicalItems:i.filter(function(L){var V,Y=s in L.props?L.props[s]:(V=L.type.defaultProps)===null||V===void 0?void 0:V[s];return Y===E}),dataStartIndex:c,dataEndIndex:u}),P=j.length,M,U,N;iFe(x.domain,k,w)&&(M=aE(x.domain,null,k),p&&(w==="number"||_!=="auto")&&(N=Xp(j,y,"category")));var B=yG(w);if(!M||M.length===0){var $,I=($=x.domain)!==null&&$!==void 0?$:B;if(y){if(M=Xp(j,y,w),w==="category"&&p){var R=q1e(M);S&&R?(U=M,M=nx(0,P)):S||(M=E3(I,M,m).reduce(function(L,V){return L.indexOf(V)>=0?L:[].concat(sf(L),[V])},[]))}else if(w==="category")S?M=M.filter(function(L){return L!==""&&!ut(L)}):M=E3(I,M,m).reduce(function(L,V){return L.indexOf(V)>=0||V===""||ut(V)?L:[].concat(sf(L),[V])},[]);else if(w==="number"){var z=cMe(j,i.filter(function(L){var V,Y,Q=s in L.props?L.props[s]:(V=L.type.defaultProps)===null||V===void 0?void 0:V[s],re="hide"in L.props?L.props.hide:(Y=L.type.defaultProps)===null||Y===void 0?void 0:Y.hide;return Q===E&&(T||!re)}),y,a,d);z&&(M=z)}p&&(w==="number"||_!=="auto")&&(N=Xp(j,y,"category"))}else p?M=nx(0,P):o&&o[E]&&o[E].hasStack&&w==="number"?M=f==="expand"?[0,1]:aK(o[E].stackGroups,c,u):M=Qq(j,i.filter(function(L){var V=s in L.props?L.props[s]:L.type.defaultProps[s],Y="hide"in L.props?L.props.hide:L.type.defaultProps.hide;return V===E&&(T||!Y)}),w,d,!0);if(w==="number")M=WE(h,M,E,a,C),I&&(M=aE(I,M,k));else if(w==="category"&&I){var O=I,A=M.every(function(L){return O.indexOf(L)>=0});A&&(M=O)}}return ae(ae({},g),{},Xe({},E,ae(ae({},x),{},{axisType:a,domain:M,categoricalDomain:N,duplicateDomain:U,originalDomain:(v=x.domain)!==null&&v!==void 0?v:B,isCategorical:p,layout:d})))},{})},RFe=function(e,n){var r=n.graphicalItems,i=n.Axis,a=n.axisType,s=n.axisIdKey,o=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=e.layout,h=e.children,f=R1(e.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:u}),p=f.length,g=eK(d,a),m=-1;return r.reduce(function(v,x){var w=x.type.defaultProps!==void 0?ae(ae({},x.type.defaultProps),x.props):x.props,y=w[s],k=yG("number");if(!v[y]){m++;var S;return g?S=nx(0,p):o&&o[y]&&o[y].hasStack?(S=aK(o[y].stackGroups,c,u),S=WE(h,S,y,a)):(S=aE(k,Qq(f,r.filter(function(_){var C,T,E=s in _.props?_.props[s]:(C=_.type.defaultProps)===null||C===void 0?void 0:C[s],j="hide"in _.props?_.props.hide:(T=_.type.defaultProps)===null||T===void 0?void 0:T.hide;return E===y&&!j}),"number",d),i.defaultProps.allowDataOverflow),S=WE(h,S,y,a)),ae(ae({},v),{},Xe({},y,ae(ae({axisType:a},i.defaultProps),{},{hide:!0,orientation:Pi(jFe,"".concat(a,".").concat(m%2),null),domain:S,originalDomain:k,isCategorical:g,layout:d})))}return v},{})},DFe=function(e,n){var r=n.axisType,i=r===void 0?"xAxis":r,a=n.AxisComp,s=n.graphicalItems,o=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=e.children,h="".concat(i,"Id"),f=Ni(d,a),p={};return f&&f.length?p=OFe(e,{axes:f,graphicalItems:s,axisType:i,axisIdKey:h,stackGroups:o,dataStartIndex:c,dataEndIndex:u}):s&&s.length&&(p=RFe(e,{Axis:a,graphicalItems:s,axisType:i,axisIdKey:h,stackGroups:o,dataStartIndex:c,dataEndIndex:u})),p},MFe=function(e){var n=Yo(e),r=so(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:_N(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:Wb(n,r)}},s8=function(e){var n=e.children,r=e.defaultShowTooltip,i=bi(n,Kh),a=0,s=0;return e.data&&e.data.length!==0&&(s=e.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(s=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!r}},IFe=function(e){return!e||!e.length?!1:e.some(function(n){var r=co(n&&n.type);return r&&r.indexOf("Bar")>=0})},o8=function(e){return e==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:e==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:e==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},LFe=function(e,n){var r=e.props,i=e.graphicalItems,a=e.xAxisMap,s=a===void 0?{}:a,o=e.yAxisMap,c=o===void 0?{}:o,u=r.width,d=r.height,h=r.children,f=r.margin||{},p=bi(h,Kh),g=bi(h,Vd),m=Object.keys(c).reduce(function(S,_){var C=c[_],T=C.orientation;return!C.mirror&&!C.hide?ae(ae({},S),{},Xe({},T,S[T]+C.width)):S},{left:f.left||0,right:f.right||0}),v=Object.keys(s).reduce(function(S,_){var C=s[_],T=C.orientation;return!C.mirror&&!C.hide?ae(ae({},S),{},Xe({},T,Pi(S,"".concat(T))+C.height)):S},{top:f.top||0,bottom:f.bottom||0}),x=ae(ae({},v),m),w=x.bottom;p&&(x.bottom+=p.props.height||Kh.defaultProps.height),g&&n&&(x=sMe(x,i,r,n));var y=u-x.left-x.right,k=d-x.top-x.bottom;return ae(ae({brushBottom:w},x),{},{width:Math.max(y,0),height:Math.max(k,0)})},$Fe=function(e,n){if(n==="xAxis")return e[n].width;if(n==="yAxis")return e[n].height},oA=function(e){var n=e.chartName,r=e.GraphicalChild,i=e.defaultTooltipEventType,a=i===void 0?"axis":i,s=e.validateTooltipEventTypes,o=s===void 0?["axis"]:s,c=e.axisComponents,u=e.legendContent,d=e.formatAxisMap,h=e.defaultProps,f=function(x,w){var y=w.graphicalItems,k=w.stackGroups,S=w.offset,_=w.updateId,C=w.dataStartIndex,T=w.dataEndIndex,E=x.barSize,j=x.layout,P=x.barGap,M=x.barCategoryGap,U=x.maxBarSize,N=o8(j),B=N.numericAxisName,$=N.cateAxisName,I=IFe(y),R=[];return y.forEach(function(z,O){var A=R1(x.data,{graphicalItems:[z],dataStartIndex:C,dataEndIndex:T}),L=z.type.defaultProps!==void 0?ae(ae({},z.type.defaultProps),z.props):z.props,V=L.dataKey,Y=L.maxBarSize,Q=L["".concat(B,"Id")],re=L["".concat($,"Id")],J={},ne=c.reduce(function(ge,Re){var Oe=w["".concat(Re.axisType,"Map")],ye=L["".concat(Re.axisType,"Id")];Oe&&Oe[ye]||Re.axisType==="zAxis"||gu();var Ct=Oe[ye];return ae(ae({},ge),{},Xe(Xe({},Re.axisType,Ct),"".concat(Re.axisType,"Ticks"),so(Ct)))},J),G=ne[$],Z=ne["".concat($,"Ticks")],ee=k&&k[Q]&&k[Q].hasStack&&vMe(z,k[Q].stackGroups),K=co(z.type).indexOf("Bar")>=0,oe=Wb(G,Z),W=[],H=I&&iMe({barSize:E,stackGroups:k,totalSize:$Fe(ne,$)});if(K){var q,te,he=ut(Y)?U:Y,xe=(q=(te=Wb(G,Z,!0))!==null&&te!==void 0?te:he)!==null&&q!==void 0?q:0;W=aMe({barGap:P,barCategoryGap:M,bandSize:xe!==oe?xe:oe,sizeList:H[re],maxBarSize:he}),xe!==oe&&(W=W.map(function(ge){return ae(ae({},ge),{},{position:ae(ae({},ge.position),{},{offset:ge.position.offset-xe/2})})}))}var De=z&&z.type&&z.type.getComposedData;De&&R.push({props:ae(ae({},De(ae(ae({},ne),{},{displayedData:A,props:x,dataKey:V,item:z,bandSize:oe,barPosition:W,offset:S,stackedData:ee,layout:j,dataStartIndex:C,dataEndIndex:T}))),{},Xe(Xe(Xe({key:z.key||"item-".concat(O)},B,ne[B]),$,ne[$]),"animationId",_)),childIndex:aSe(z,x.children),item:z})}),R},p=function(x,w){var y=x.props,k=x.dataStartIndex,S=x.dataEndIndex,_=x.updateId;if(!xM({props:y}))return null;var C=y.children,T=y.layout,E=y.stackOffset,j=y.data,P=y.reverseStackOrder,M=o8(T),U=M.numericAxisName,N=M.cateAxisName,B=Ni(C,r),$=mMe(j,B,"".concat(U,"Id"),"".concat(N,"Id"),E,P),I=c.reduce(function(L,V){var Y="".concat(V.axisType,"Map");return ae(ae({},L),{},Xe({},Y,DFe(y,ae(ae({},V),{},{graphicalItems:B,stackGroups:V.axisType===U&&$,dataStartIndex:k,dataEndIndex:S}))))},{}),R=LFe(ae(ae({},I),{},{props:y,graphicalItems:B}),w==null?void 0:w.legendBBox);Object.keys(I).forEach(function(L){I[L]=d(y,I[L],R,L.replace("Map",""),n)});var z=I["".concat(N,"Map")],O=MFe(z),A=f(y,ae(ae({},I),{},{dataStartIndex:k,dataEndIndex:S,updateId:_,graphicalItems:B,stackGroups:$,offset:R}));return ae(ae({formattedGraphicalItems:A,graphicalItems:B,offset:R,stackGroups:$},O),I)},g=function(v){function x(w){var y,k,S;return vFe(this,x),S=xFe(this,x,[w]),Xe(S,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Xe(S,"accessibilityManager",new rFe),Xe(S,"handleLegendBBoxUpdate",function(_){if(_){var C=S.state,T=C.dataStartIndex,E=C.dataEndIndex,j=C.updateId;S.setState(ae({legendBBox:_},p({props:S.props,dataStartIndex:T,dataEndIndex:E,updateId:j},ae(ae({},S.state),{},{legendBBox:_}))))}}),Xe(S,"handleReceiveSyncEvent",function(_,C,T){if(S.props.syncId===_){if(T===S.eventEmitterSymbol&&typeof S.props.syncMethod!="function")return;S.applySyncEvent(C)}}),Xe(S,"handleBrushChange",function(_){var C=_.startIndex,T=_.endIndex;if(C!==S.state.dataStartIndex||T!==S.state.dataEndIndex){var E=S.state.updateId;S.setState(function(){return ae({dataStartIndex:C,dataEndIndex:T},p({props:S.props,dataStartIndex:C,dataEndIndex:T,updateId:E},S.state))}),S.triggerSyncEvent({dataStartIndex:C,dataEndIndex:T})}}),Xe(S,"handleMouseEnter",function(_){var C=S.getMouseInfo(_);if(C){var T=ae(ae({},C),{},{isTooltipActive:!0});S.setState(T),S.triggerSyncEvent(T);var E=S.props.onMouseEnter;it(E)&&E(T,_)}}),Xe(S,"triggeredAfterMouseMove",function(_){var C=S.getMouseInfo(_),T=C?ae(ae({},C),{},{isTooltipActive:!0}):{isTooltipActive:!1};S.setState(T),S.triggerSyncEvent(T);var E=S.props.onMouseMove;it(E)&&E(T,_)}),Xe(S,"handleItemMouseEnter",function(_){S.setState(function(){return{isTooltipActive:!0,activeItem:_,activePayload:_.tooltipPayload,activeCoordinate:_.tooltipPosition||{x:_.cx,y:_.cy}}})}),Xe(S,"handleItemMouseLeave",function(){S.setState(function(){return{isTooltipActive:!1}})}),Xe(S,"handleMouseMove",function(_){_.persist(),S.throttleTriggeredAfterMouseMove(_)}),Xe(S,"handleMouseLeave",function(_){S.throttleTriggeredAfterMouseMove.cancel();var C={isTooltipActive:!1};S.setState(C),S.triggerSyncEvent(C);var T=S.props.onMouseLeave;it(T)&&T(C,_)}),Xe(S,"handleOuterEvent",function(_){var C=iSe(_),T=Pi(S.props,"".concat(C));if(C&&it(T)){var E,j;/.*touch.*/i.test(C)?j=S.getMouseInfo(_.changedTouches[0]):j=S.getMouseInfo(_),T((E=j)!==null&&E!==void 0?E:{},_)}}),Xe(S,"handleClick",function(_){var C=S.getMouseInfo(_);if(C){var T=ae(ae({},C),{},{isTooltipActive:!0});S.setState(T),S.triggerSyncEvent(T);var E=S.props.onClick;it(E)&&E(T,_)}}),Xe(S,"handleMouseDown",function(_){var C=S.props.onMouseDown;if(it(C)){var T=S.getMouseInfo(_);C(T,_)}}),Xe(S,"handleMouseUp",function(_){var C=S.props.onMouseUp;if(it(C)){var T=S.getMouseInfo(_);C(T,_)}}),Xe(S,"handleTouchMove",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&S.throttleTriggeredAfterMouseMove(_.changedTouches[0])}),Xe(S,"handleTouchStart",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&S.handleMouseDown(_.changedTouches[0])}),Xe(S,"handleTouchEnd",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&S.handleMouseUp(_.changedTouches[0])}),Xe(S,"handleDoubleClick",function(_){var C=S.props.onDoubleClick;if(it(C)){var T=S.getMouseInfo(_);C(T,_)}}),Xe(S,"handleContextMenu",function(_){var C=S.props.onContextMenu;if(it(C)){var T=S.getMouseInfo(_);C(T,_)}}),Xe(S,"triggerSyncEvent",function(_){S.props.syncId!==void 0&&Vk.emit(Hk,S.props.syncId,_,S.eventEmitterSymbol)}),Xe(S,"applySyncEvent",function(_){var C=S.props,T=C.layout,E=C.syncMethod,j=S.state.updateId,P=_.dataStartIndex,M=_.dataEndIndex;if(_.dataStartIndex!==void 0||_.dataEndIndex!==void 0)S.setState(ae({dataStartIndex:P,dataEndIndex:M},p({props:S.props,dataStartIndex:P,dataEndIndex:M,updateId:j},S.state)));else if(_.activeTooltipIndex!==void 0){var U=_.chartX,N=_.chartY,B=_.activeTooltipIndex,$=S.state,I=$.offset,R=$.tooltipTicks;if(!I)return;if(typeof E=="function")B=E(R,_);else if(E==="value"){B=-1;for(var z=0;z<R.length;z++)if(R[z].value===_.activeLabel){B=z;break}}var O=ae(ae({},I),{},{x:I.left,y:I.top}),A=Math.min(U,O.x+O.width),L=Math.min(N,O.y+O.height),V=R[B]&&R[B].value,Y=qE(S.state,S.props.data,B),Q=R[B]?{x:T==="horizontal"?R[B].coordinate:A,y:T==="horizontal"?L:R[B].coordinate}:vG;S.setState(ae(ae({},_),{},{activeLabel:V,activeCoordinate:Q,activePayload:Y,activeTooltipIndex:B}))}else S.setState(_)}),Xe(S,"renderCursor",function(_){var C,T=S.state,E=T.isTooltipActive,j=T.activeCoordinate,P=T.activePayload,M=T.offset,U=T.activeTooltipIndex,N=T.tooltipAxisBandSize,B=S.getTooltipEventType(),$=(C=_.props.active)!==null&&C!==void 0?C:E,I=S.props.layout,R=_.key||"_recharts-cursor";return D.createElement(uFe,{key:R,activeCoordinate:j,activePayload:P,activeTooltipIndex:U,chartName:n,element:_,isActive:$,layout:I,offset:M,tooltipAxisBandSize:N,tooltipEventType:B})}),Xe(S,"renderPolarAxis",function(_,C,T){var E=Pi(_,"type.axisType"),j=Pi(S.state,"".concat(E,"Map")),P=_.type.defaultProps,M=P!==void 0?ae(ae({},P),_.props):_.props,U=j&&j[M["".concat(E,"Id")]];return b.cloneElement(_,ae(ae({},U),{},{className:pt(E,U.className),key:_.key||"".concat(C,"-").concat(T),ticks:so(U,!0)}))}),Xe(S,"renderPolarGrid",function(_){var C=_.props,T=C.radialLines,E=C.polarAngles,j=C.polarRadius,P=S.state,M=P.radiusAxisMap,U=P.angleAxisMap,N=Yo(M),B=Yo(U),$=B.cx,I=B.cy,R=B.innerRadius,z=B.outerRadius;return b.cloneElement(_,{polarAngles:Array.isArray(E)?E:so(B,!0).map(function(O){return O.coordinate}),polarRadius:Array.isArray(j)?j:so(N,!0).map(function(O){return O.coordinate}),cx:$,cy:I,innerRadius:R,outerRadius:z,key:_.key||"polar-grid",radialLines:T})}),Xe(S,"renderLegend",function(){var _=S.state.formattedGraphicalItems,C=S.props,T=C.children,E=C.width,j=C.height,P=S.props.margin||{},M=E-(P.left||0)-(P.right||0),U=Xq({children:T,formattedGraphicalItems:_,legendWidth:M,legendContent:u});if(!U)return null;var N=U.item,B=r8(U,dFe);return b.cloneElement(N,ae(ae({},B),{},{chartWidth:E,chartHeight:j,margin:P,onBBoxUpdate:S.handleLegendBBoxUpdate}))}),Xe(S,"renderTooltip",function(){var _,C=S.props,T=C.children,E=C.accessibilityLayer,j=bi(T,Hi);if(!j)return null;var P=S.state,M=P.isTooltipActive,U=P.activeCoordinate,N=P.activePayload,B=P.activeLabel,$=P.offset,I=(_=j.props.active)!==null&&_!==void 0?_:M;return b.cloneElement(j,{viewBox:ae(ae({},$),{},{x:$.left,y:$.top}),active:I,label:B,payload:I?N:[],coordinate:U,accessibilityLayer:E})}),Xe(S,"renderBrush",function(_){var C=S.props,T=C.margin,E=C.data,j=S.state,P=j.offset,M=j.dataStartIndex,U=j.dataEndIndex,N=j.updateId;return b.cloneElement(_,{key:_.key||"_recharts-brush",onChange:gy(S.handleBrushChange,_.props.onChange),data:E,x:Ce(_.props.x)?_.props.x:P.left,y:Ce(_.props.y)?_.props.y:P.top+P.height+P.brushBottom-(T.bottom||0),width:Ce(_.props.width)?_.props.width:P.width,startIndex:M,endIndex:U,updateId:"brush-".concat(N)})}),Xe(S,"renderReferenceElement",function(_,C,T){if(!_)return null;var E=S,j=E.clipPathId,P=S.state,M=P.xAxisMap,U=P.yAxisMap,N=P.offset,B=_.type.defaultProps||{},$=_.props,I=$.xAxisId,R=I===void 0?B.xAxisId:I,z=$.yAxisId,O=z===void 0?B.yAxisId:z;return b.cloneElement(_,{key:_.key||"".concat(C,"-").concat(T),xAxis:M[R],yAxis:U[O],viewBox:{x:N.left,y:N.top,width:N.width,height:N.height},clipPathId:j})}),Xe(S,"renderActivePoints",function(_){var C=_.item,T=_.activePoint,E=_.basePoint,j=_.childIndex,P=_.isRange,M=[],U=C.props.key,N=C.item.type.defaultProps!==void 0?ae(ae({},C.item.type.defaultProps),C.item.props):C.item.props,B=N.activeDot,$=N.dataKey,I=ae(ae({index:j,dataKey:$,cx:T.x,cy:T.y,r:4,fill:JN(C.item),strokeWidth:2,stroke:"#fff",payload:T.payload,value:T.value},Ye(B,!1)),gb(B));return M.push(x.renderActiveDot(B,I,"".concat(U,"-activePoint-").concat(j))),E?M.push(x.renderActiveDot(B,ae(ae({},I),{},{cx:E.x,cy:E.y}),"".concat(U,"-basePoint-").concat(j))):P&&M.push(null),M}),Xe(S,"renderGraphicChild",function(_,C,T){var E=S.filterFormatItem(_,C,T);if(!E)return null;var j=S.getTooltipEventType(),P=S.state,M=P.isTooltipActive,U=P.tooltipAxis,N=P.activeTooltipIndex,B=P.activeLabel,$=S.props.children,I=bi($,Hi),R=E.props,z=R.points,O=R.isRange,A=R.baseLine,L=E.item.type.defaultProps!==void 0?ae(ae({},E.item.type.defaultProps),E.item.props):E.item.props,V=L.activeDot,Y=L.hide,Q=L.activeBar,re=L.activeShape,J=!!(!Y&&M&&I&&(V||Q||re)),ne={};j!=="axis"&&I&&I.props.trigger==="click"?ne={onClick:gy(S.handleItemMouseEnter,_.props.onClick)}:j!=="axis"&&(ne={onMouseLeave:gy(S.handleItemMouseLeave,_.props.onMouseLeave),onMouseEnter:gy(S.handleItemMouseEnter,_.props.onMouseEnter)});var G=b.cloneElement(_,ae(ae({},E.props),ne));function Z(Re){return typeof U.dataKey=="function"?U.dataKey(Re.payload):null}if(J)if(N>=0){var ee,K;if(U.dataKey&&!U.allowDuplicatedCategory){var oe=typeof U.dataKey=="function"?Z:"payload.".concat(U.dataKey.toString());ee=mb(z,oe,B),K=O&&A&&mb(A,oe,B)}else ee=z==null?void 0:z[N],K=O&&A&&A[N];if(re||Q){var W=_.props.activeIndex!==void 0?_.props.activeIndex:N;return[b.cloneElement(_,ae(ae(ae({},E.props),ne),{},{activeIndex:W})),null,null]}if(!ut(ee))return[G].concat(sf(S.renderActivePoints({item:E,activePoint:ee,basePoint:K,childIndex:N,isRange:O})))}else{var H,q=(H=S.getItemByXY(S.state.activeCoordinate))!==null&&H!==void 0?H:{graphicalItem:G},te=q.graphicalItem,he=te.item,xe=he===void 0?_:he,De=te.childIndex,ge=ae(ae(ae({},E.props),ne),{},{activeIndex:De});return[b.cloneElement(xe,ge),null,null]}return O?[G,null,null]:[G,null]}),Xe(S,"renderCustomized",function(_,C,T){return b.cloneElement(_,ae(ae({key:"recharts-customized-".concat(T)},S.props),S.state))}),Xe(S,"renderMap",{CartesianGrid:{handler:wy,once:!0},ReferenceArea:{handler:S.renderReferenceElement},ReferenceLine:{handler:wy},ReferenceDot:{handler:S.renderReferenceElement},XAxis:{handler:wy},YAxis:{handler:wy},Brush:{handler:S.renderBrush,once:!0},Bar:{handler:S.renderGraphicChild},Line:{handler:S.renderGraphicChild},Area:{handler:S.renderGraphicChild},Radar:{handler:S.renderGraphicChild},RadialBar:{handler:S.renderGraphicChild},Scatter:{handler:S.renderGraphicChild},Pie:{handler:S.renderGraphicChild},Funnel:{handler:S.renderGraphicChild},Tooltip:{handler:S.renderCursor,once:!0},PolarGrid:{handler:S.renderPolarGrid,once:!0},PolarAngleAxis:{handler:S.renderPolarAxis},PolarRadiusAxis:{handler:S.renderPolarAxis},Customized:{handler:S.renderCustomized}}),S.clipPathId="".concat((y=w.id)!==null&&y!==void 0?y:Pf("recharts"),"-clip"),S.throttleTriggeredAfterMouseMove=JH(S.triggeredAfterMouseMove,(k=w.throttleDelay)!==null&&k!==void 0?k:1e3/60),S.state={},S}return kFe(x,v),bFe(x,[{key:"componentDidMount",value:function(){var y,k;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(y=this.props.margin.left)!==null&&y!==void 0?y:0,top:(k=this.props.margin.top)!==null&&k!==void 0?k:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var y=this.props,k=y.children,S=y.data,_=y.height,C=y.layout,T=bi(k,Hi);if(T){var E=T.props.defaultIndex;if(!(typeof E!="number"||E<0||E>this.state.tooltipTicks.length-1)){var j=this.state.tooltipTicks[E]&&this.state.tooltipTicks[E].value,P=qE(this.state,S,E,j),M=this.state.tooltipTicks[E].coordinate,U=(this.state.offset.top+_)/2,N=C==="horizontal",B=N?{x:M,y:U}:{y:M,x:U},$=this.state.formattedGraphicalItems.find(function(R){var z=R.item;return z.type.name==="Scatter"});$&&(B=ae(ae({},B),$.props.points[E].tooltipPosition),P=$.props.points[E].tooltipPayload);var I={activeTooltipIndex:E,isTooltipActive:!0,activeLabel:j,activePayload:P,activeCoordinate:B};this.setState(I),this.renderCursor(T),this.accessibilityManager.setIndex(E)}}}},{key:"getSnapshotBeforeUpdate",value:function(y,k){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==k.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==y.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==y.margin){var S,_;this.accessibilityManager.setDetails({offset:{left:(S=this.props.margin.left)!==null&&S!==void 0?S:0,top:(_=this.props.margin.top)!==null&&_!==void 0?_:0}})}return null}},{key:"componentDidUpdate",value:function(y){xT([bi(y.children,Hi)],[bi(this.props.children,Hi)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var y=bi(this.props.children,Hi);if(y&&typeof y.props.shared=="boolean"){var k=y.props.shared?"axis":"item";return o.indexOf(k)>=0?k:a}return a}},{key:"getMouseInfo",value:function(y){if(!this.container)return null;var k=this.container,S=k.getBoundingClientRect(),_=AAe(S),C={chartX:Math.round(y.pageX-_.left),chartY:Math.round(y.pageY-_.top)},T=S.width/k.offsetWidth||1,E=this.inRange(C.chartX,C.chartY,T);if(!E)return null;var j=this.state,P=j.xAxisMap,M=j.yAxisMap,U=this.getTooltipEventType(),N=a8(this.state,this.props.data,this.props.layout,E);if(U!=="axis"&&P&&M){var B=Yo(P).scale,$=Yo(M).scale,I=B&&B.invert?B.invert(C.chartX):null,R=$&&$.invert?$.invert(C.chartY):null;return ae(ae({},C),{},{xValue:I,yValue:R},N)}return N?ae(ae({},C),N):null}},{key:"inRange",value:function(y,k){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,_=this.props.layout,C=y/S,T=k/S;if(_==="horizontal"||_==="vertical"){var E=this.state.offset,j=C>=E.left&&C<=E.left+E.width&&T>=E.top&&T<=E.top+E.height;return j?{x:C,y:T}:null}var P=this.state,M=P.angleAxisMap,U=P.radiusAxisMap;if(M&&U){var N=Yo(M);return N3({x:C,y:T},N)}return null}},{key:"parseEventsOfWrapper",value:function(){var y=this.props.children,k=this.getTooltipEventType(),S=bi(y,Hi),_={};S&&k==="axis"&&(S.props.trigger==="click"?_={onClick:this.handleClick}:_={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var C=gb(this.props,this.handleOuterEvent);return ae(ae({},C),_)}},{key:"addListener",value:function(){Vk.on(Hk,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Vk.removeListener(Hk,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(y,k,S){for(var _=this.state.formattedGraphicalItems,C=0,T=_.length;C<T;C++){var E=_[C];if(E.item===y||E.props.key===y.key||k===co(E.item.type)&&S===E.childIndex)return E}return null}},{key:"renderClipPath",value:function(){var y=this.clipPathId,k=this.state.offset,S=k.left,_=k.top,C=k.height,T=k.width;return D.createElement("defs",null,D.createElement("clipPath",{id:y},D.createElement("rect",{x:S,y:_,height:C,width:T})))}},{key:"getXScales",value:function(){var y=this.state.xAxisMap;return y?Object.entries(y).reduce(function(k,S){var _=n8(S,2),C=_[0],T=_[1];return ae(ae({},k),{},Xe({},C,T.scale))},{}):null}},{key:"getYScales",value:function(){var y=this.state.yAxisMap;return y?Object.entries(y).reduce(function(k,S){var _=n8(S,2),C=_[0],T=_[1];return ae(ae({},k),{},Xe({},C,T.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(y){var k;return(k=this.state.xAxisMap)===null||k===void 0||(k=k[y])===null||k===void 0?void 0:k.scale}},{key:"getYScaleByAxisId",value:function(y){var k;return(k=this.state.yAxisMap)===null||k===void 0||(k=k[y])===null||k===void 0?void 0:k.scale}},{key:"getItemByXY",value:function(y){var k=this.state,S=k.formattedGraphicalItems,_=k.activeItem;if(S&&S.length)for(var C=0,T=S.length;C<T;C++){var E=S[C],j=E.props,P=E.item,M=P.type.defaultProps!==void 0?ae(ae({},P.type.defaultProps),P.props):P.props,U=co(P.type);if(U==="Bar"){var N=(j.data||[]).find(function(R){return c5e(y,R)});if(N)return{graphicalItem:E,payload:N}}else if(U==="RadialBar"){var B=(j.data||[]).find(function(R){return N3(y,R)});if(B)return{graphicalItem:E,payload:B}}else if(T1(E,_)||E1(E,_)||Tg(E,_)){var $=J8e({graphicalItem:E,activeTooltipItem:_,itemData:M.data}),I=M.activeIndex===void 0?$:M.activeIndex;return{graphicalItem:ae(ae({},E),{},{childIndex:I}),payload:Tg(E,_)?M.data[$]:E.props.data[$]}}}return null}},{key:"render",value:function(){var y=this;if(!xM(this))return null;var k=this.props,S=k.children,_=k.className,C=k.width,T=k.height,E=k.style,j=k.compact,P=k.title,M=k.desc,U=r8(k,hFe),N=Ye(U,!1);if(j)return D.createElement($5,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},D.createElement(ST,Sd({},N,{width:C,height:T,title:P,desc:M}),this.renderClipPath(),SM(S,this.renderMap)));if(this.props.accessibilityLayer){var B,$;N.tabIndex=(B=this.props.tabIndex)!==null&&B!==void 0?B:0,N.role=($=this.props.role)!==null&&$!==void 0?$:"application",N.onKeyDown=function(R){y.accessibilityManager.keyboardEvent(R)},N.onFocus=function(){y.accessibilityManager.focus()}}var I=this.parseEventsOfWrapper();return D.createElement($5,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},D.createElement("div",Sd({className:pt("recharts-wrapper",_),style:ae({position:"relative",cursor:"default",width:C,height:T},E)},I,{ref:function(z){y.container=z}}),D.createElement(ST,Sd({},N,{width:C,height:T,title:P,desc:M,style:PFe}),this.renderClipPath(),SM(S,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(b.Component);Xe(g,"displayName",n),Xe(g,"defaultProps",ae({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},h)),Xe(g,"getDerivedStateFromProps",function(v,x){var w=v.dataKey,y=v.data,k=v.children,S=v.width,_=v.height,C=v.layout,T=v.stackOffset,E=v.margin,j=x.dataStartIndex,P=x.dataEndIndex;if(x.updateId===void 0){var M=s8(v);return ae(ae(ae({},M),{},{updateId:0},p(ae(ae({props:v},M),{},{updateId:0}),x)),{},{prevDataKey:w,prevData:y,prevWidth:S,prevHeight:_,prevLayout:C,prevStackOffset:T,prevMargin:E,prevChildren:k})}if(w!==x.prevDataKey||y!==x.prevData||S!==x.prevWidth||_!==x.prevHeight||C!==x.prevLayout||T!==x.prevStackOffset||!Wd(E,x.prevMargin)){var U=s8(v),N={chartX:x.chartX,chartY:x.chartY,isTooltipActive:x.isTooltipActive},B=ae(ae({},a8(x,y,C)),{},{updateId:x.updateId+1}),$=ae(ae(ae({},U),N),B);return ae(ae(ae({},$),p(ae({props:v},$),x)),{},{prevDataKey:w,prevData:y,prevWidth:S,prevHeight:_,prevLayout:C,prevStackOffset:T,prevMargin:E,prevChildren:k})}if(!xT(k,x.prevChildren)){var I,R,z,O,A=bi(k,Kh),L=A&&(I=(R=A.props)===null||R===void 0?void 0:R.startIndex)!==null&&I!==void 0?I:j,V=A&&(z=(O=A.props)===null||O===void 0?void 0:O.endIndex)!==null&&z!==void 0?z:P,Y=L!==j||V!==P,Q=!ut(y),re=Q&&!Y?x.updateId:x.updateId+1;return ae(ae({updateId:re},p(ae(ae({props:v},x),{},{updateId:re,dataStartIndex:L,dataEndIndex:V}),x)),{},{prevChildren:k,dataStartIndex:L,dataEndIndex:V})}return null}),Xe(g,"renderActiveDot",function(v,x,w){var y;return b.isValidElement(v)?y=b.cloneElement(v,x):it(v)?y=v(x):y=D.createElement(w1,x),D.createElement(Rt,{className:"recharts-active-dot",ke
959y:w},y)});var m=b.forwardRef(function(x,w){return D.createElement(g,Sd({},x,{ref:w}))});return m.displayName=g.displayName,m},FFe=oA({chartName:"LineChart",GraphicalChild:mv,axisComponents:[{axisType:"xAxis",AxisComp:tf},{axisType:"yAxis",AxisComp:rf}],formatAxisMap:LK}),BFe=oA({chartName:"BarChart",GraphicalChild:Eu,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:tf},{axisType:"yAxis",AxisComp:rf}],formatAxisMap:LK}),UFe=oA({chartName:"PieChart",GraphicalChild:jo,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:C1},{axisType:"radiusAxis",AxisComp:k1}],formatAxisMap:EMe,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const c8=["#0088FE","#00C49F","#FFBB28","#FF8042","#8884D8","#82CA9D","#FFC658","#FF6B9D"],zFe=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function WFe(){const{calendarId:t}=Kg(),e=rr(),[n,r]=b.useState(!0),[i,a]=b.useState(""),[s,o]=b.useState({totalEvents:0,recurringEvents:0,oneTimeEvents:0,activeLinks:0,viewerLinks:0,editorLinks:0,eventsByColor:[],eventsByHour:[],eventsByDay:[]});b.useEffect(()=>{t&&c()},[t]);const c=async()=>{try{r(!0);const{data:u}=await me.from("calendars").select("name").eq("id",t).single();u&&a(u.name);const{data:d,error:h}=await me.from("events").select("*").eq("calendar_id",t);if(h)throw h;const{data:f,error:p}=await me.from("calendar_links").select("id, link_type, access_code, is_active, created_at, calendar_id, expires_at").eq("calendar_id",t);if(p)throw p;const g=(d==null?void 0:d.length)||0,m=(d==null?void 0:d.filter(j=>j.is_recurring).length)||0,v=g-m,x={};d==null||d.forEach(j=>{x[j.color]=(x[j.color]||0)+1});const w=Object.entries(x).map(([j,P])=>({name:j.charAt(0).toUpperCase()+j.slice(1),value:P,color:j})),y={};d==null||d.forEach(j=>{const P=Ide(ND(j.start_time));y[P]=(y[P]||0)+1});const k=Object.entries(y).sort(([j],[P])=>Number(j)-Number(P)).map(([j,P])=>({hour:`${j}:00`,count:P})),S={};d==null||d.forEach(j=>{const P=Dde(ND(j.start_time));S[P]=(S[P]||0)+1});const _=Object.entries(S).sort(([j],[P])=>Number(j)-Number(P)).map(([j,P])=>({day:zFe[Number(j)].slice(0,3),count:P})),C=(f==null?void 0:f.filter(j=>j.is_active).length)||0,T=(f==null?void 0:f.filter(j=>j.is_active&&j.link_type==="viewer").length)||0,E=(f==null?void 0:f.filter(j=>j.is_active&&j.link_type==="editor").length)||0;o({totalEvents:g,recurringEvents:m,oneTimeEvents:v,activeLinks:C,viewerLinks:T,editorLinks:E,eventsByColor:w,eventsByHour:k,eventsByDay:_})}catch(u){console.error("Error fetching analytics:",u)}finally{r(!1)}};return n?l.jsx("div",{className:"min-h-screen flex items-center justify-center",children:l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"}),l.jsx("p",{className:"text-muted-foreground",children:"Loading analytics..."})]})}):l.jsx("div",{className:"min-h-screen bg-background",children:l.jsxs("div",{className:"container mx-auto px-4 py-8 max-w-7xl",children:[l.jsxs("div",{className:"flex items-center gap-4 mb-8",children:[l.jsx(de,{variant:"ghost",size:"icon",onClick:()=>e(`/calendar/owner/${t}`),className:"touch-manipulation",children:l.jsx(ci,{className:"w-5 h-5"})}),l.jsxs("div",{children:[l.jsx("h1",{className:"text-3xl font-bold",children:"Calendar Analytics"}),l.jsx("p",{className:"text-muted-foreground",children:i})]})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-8",children:[l.jsxs(rt,{children:[l.jsxs(ht,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[l.jsx(mt,{className:"text-sm font-medium",children:"Total Events"}),l.jsx(yc,{className:"h-4 w-4 text-muted-foreground"})]}),l.jsxs(ot,{children:[l.jsx("div",{className:"text-2xl font-bold",children:s.totalEvents}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:[s.recurringEvents," recurring, ",s.oneTimeEvents," one-time"]})]})]}),l.jsxs(rt,{children:[l.jsxs(ht,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[l.jsx(mt,{className:"text-sm font-medium",children:"Active Links"}),l.jsx(bm,{className:"h-4 w-4 text-muted-foreground"})]}),l.jsxs(ot,{children:[l.jsx("div",{className:"text-2xl font-bold",children:s.activeLinks}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:[s.viewerLinks," viewers, ",s.editorLinks," editors"]})]})]}),l.jsxs(rt,{children:[l.jsxs(ht,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[l.jsx(mt,{className:"text-sm font-medium",children:"Viewer Access"}),l.jsx(x$,{className:"h-4 w-4 text-muted-foreground"})]}),l.jsxs(ot,{children:[l.jsx("div",{className:"text-2xl font-bold",children:s.viewerLinks}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Read-only links"})]})]}),l.jsxs(rt,{children:[l.jsxs(ht,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[l.jsx(mt,{className:"text-sm font-medium",children:"Editor Access"}),l.jsx(XX,{className:"h-4 w-4 text-muted-foreground"})]}),l.jsxs(ot,{children:[l.jsx("div",{className:"text-2xl font-bold",children:s.editorLinks}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Full edit access"})]})]})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 mb-6",children:[l.jsxs(rt,{children:[l.jsxs(ht,{children:[l.jsx(mt,{children:"Events by Category"}),l.jsx(tn,{children:"Distribution of events by color/category"})]}),l.jsx(ot,{children:l.jsx(Pk,{width:"100%",height:300,children:l.jsxs(UFe,{children:[l.jsx(jo,{data:s.eventsByColor,cx:"50%",cy:"50%",labelLine:!1,label:({name:u,percent:d})=>`${u} ${(d*100).toFixed(0)}%`,outerRadius:80,fill:"#8884d8",dataKey:"value",children:s.eventsByColor.map((u,d)=>l.jsx(l1,{fill:c8[d%c8.length]},`cell-${d}`))}),l.jsx(Hi,{})]})})})]}),l.jsxs(rt,{children:[l.jsxs(ht,{children:[l.jsx(mt,{children:"Activity by Hour"}),l.jsx(tn,{children:"When events typically occur"})]}),l.jsx(ot,{children:l.jsx(Pk,{width:"100%",height:300,children:l.jsxs(BFe,{data:s.eventsByHour,children:[l.jsx(ME,{strokeDasharray:"3 3"}),l.jsx(tf,{dataKey:"hour"}),l.jsx(rf,{}),l.jsx(Hi,{}),l.jsx(Eu,{dataKey:"count",fill:"hsl(var(--primary))"})]})})})]})]}),l.jsxs(rt,{children:[l.jsxs(ht,{children:[l.jsx(mt,{children:"Activity by Day of Week"}),l.jsx(tn,{children:"Event distribution throughout the week"})]}),l.jsx(ot,{children:l.jsx(Pk,{width:"100%",height:300,children:l.jsxs(FFe,{data:s.eventsByDay,
959children:[l.jsx(ME,{strokeDasharray:"3 3"}),l.jsx(tf,{dataKey:"day"}),l.jsx(rf,{}),l.jsx(Hi,{}),l.jsx(mv,{type:"monotone",dataKey:"count",stroke:"hsl(var(--primary))",strokeWidth:2})]})})})]})]})})}function VFe(){const[t,e]=b.useState(!1),[n,r]=b.useState(null),[i,a]=b.useState(null),s=rr(),o=async()=>{e(!0),a(null);try{const{data:u,error:d}=await me.functions.invoke("generate-favicon",{method:"POST"});if(d)throw d;if(u.success&&u.imageData)r(u.imageData);else throw new Error(u.error||"Failed to generate favicon")}catch(u){console.error("Error:",u),a(u.message||"Failed to generate favicon")}finally{e(!1)}},c=()=>{if(!n)return;const u=document.createElement("a");u.href=`data:image/png;base64,${n}`,u.download="favicon.png",document.body.appendChild(u),u.click(),document.body.removeChild(u)};return l.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:l.jsxs(rt,{className:"w-full max-w-2xl",children:[l.jsxs(ht,{children:[l.jsxs(mt,{className:"flex items-center gap-2",children:[l.jsx(ta,{className:"w-6 h-6 text-primary"}),"Generate Caréable Favicon"]}),l.jsx(tn,{children:"Create a custom favicon with Caréable's gradient colors"})]}),l.jsxs(ot,{className:"space-y-6",children:[!n&&l.jsx(de,{onClick:o,disabled:t,className:"w-full",size:"lg",children:t?l.jsxs(l.Fragment,{children:[l.jsx(Er,{className:"w-4 h-4 mr-2 animate-spin"}),"Generating..."]}):l.jsxs(l.Fragment,{children:[l.jsx(ta,{className:"w-4 h-4 mr-2"}),"Generate Favicon"]})}),i&&l.jsx("div",{className:"p-4 bg-destructive/10 border border-destructive/20 rounded-lg text-destructive",children:i}),n&&l.jsxs("div",{className:"space-y-4",children:[l.jsx("div",{className:"flex justify-center p-8 bg-muted rounded-lg",children:l.jsx("img",{src:`data:image/png;base64,${n}`,alt:"Generated Favicon",className:"w-32 h-32 rounded-lg shadow-lg"})}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs(de,{onClick:c,className:"flex-1",children:[l.jsx(H_,{className:"w-4 h-4 mr-2"}),"Download Favicon"]}),l.jsx(de,{onClick:()=>r(null),variant:"outline",className:"flex-1",children:"Generate New"})]}),l.jsxs("div",{className:"p-4 bg-muted rounded-lg space-y-2",children:[l.jsx("p",{className:"text-sm font-medium",children:"Next Steps:"}),l.jsxs("ol",{className:"text-sm text-muted-foreground space-y-1 list-decimal list-inside",children:[l.jsx("li",{children:"Download the favicon image"}),l.jsx("li",{children:`Upload it to your project's public folder as "favicon.png"`}),l.jsx("li",{children:"Update index.html to reference the new favicon"})]})]})]}),l.jsx(de,{variant:"ghost",onClick:()=>s("/dashboard"),className:"w-full",children:"Back to Dashboard"})]})]})})}const l8=[{version:"0.5.0",date:"2026-03-19",title:"Visual Redesign & About Us Refresh",type:"improvement",description:"Major visual overhaul with organic stone aesthetics, fluid backgrounds, and a refreshed About Us page.",items:["New fluid underwater background with animated color blobs on the landing page","Organic stone-shaped feature cards with morphing border animations","Redesigned About Us page with stone-style value tiles and gradient fills","Refined hero section with stacked text animation and HeroBubbles component","New horizontal-scroll mission section on the landing page","Updated landing page fonts and typography for a bolder look","Dashboard calendar card redesigned with logo-aligned gradient colors","Polished sign-in page colors and button styles"]},{version:"0.4.2",date:"2026-03-14",title:"Multi-Language Voice Input",type:"feature",description:"Added Dutch language support and improved multi-language voice recognition.",items:["Dutch language support for voice input via ElevenLabs Scribe","Auto-detect language from voice input for seamless multilingual use","Language toggle in the event creation dialog","Improved multilingual event parsing for dates, times, and descriptions"]},{version:"0.4.1",date:"2026-03-11",title:"Multi-Day Events & Mobile Fixes",type:"fix",description:"Fixed multi-day event handling and resolved numerous mobile form issues.",items:["Multi-day events now correctly spread across all days in calendar views","Fixed recurrence parsing for multi-day recurring events","Fixed mobile input overflow in event creation dialog","Title field now supports multiline on mobile for longer event names",'Fixed date input alignment and "Until" field overflow on mobile',"Improved Android form layout for event creation","Fixed dialog open/close animation flicker on desktop"]},{version:"0.4.0",date:"2026-03-07",title:"Family Care Focus & Demo Improvements",type:"feature",description:"Refocused the app on family caregiving and improved the demo experience.",items:["Refocused landing page messaging around family care coordination","New care scenario showcase section highlighting real-world use cases","Expanded AI event templates for caregiving situations","Editable parsed event details before saving","Dynamic demo events that stay relevant year-round","Fixed demo event creation flow and edge function imports","Added comprehensive Vitest test suite for core utilities"]},{version:"0.3.5",date:"2025-12-30",title:"Accessibility & UI Polish",type:"feature",description:"Added simplified view mode for easier comprehension and refined input styling.",items:["New Simplified View mode with larger text, clearer icons, and reduced visual complexity","Toggle accessibility mode via the eye icon in calendar navigation","Audio read-aloud feature to hear event details spoken aloud","Auto-play preference for hands-free event announcements","Preference persists across sessions via local storage","Fixed ugly rounded corners on input fields in event creation and editing","Eliminated border flash when focu
959sing on title inputs"]},{version:"0.3.4",date:"2025-12-07",title:"Mobile UX Fixes",type:"fix",description:"Fixed mobile display issues and shared calendar navigation.",items:['Fixed "Event Created!" confirmation being cut off on mobile devices',"Success overlay now properly covers full screen on all devices","Fixed Today button in shared calendars not navigating back to current day after swiping"]},{version:"0.3.3",date:"2025-12-04",title:"iOS Session Persistence",type:"fix",description:"Fixed session handling for iOS users switching between apps.",items:["Fixed iOS Safari session persistence - no more unexpected logouts when switching apps","Added visual refresh indicator showing sync status when returning to the app","Improved session refresh handling during background/foreground transitions","Dashboard and Calendar pages now properly wait for session refresh before redirecting"]},{version:"0.3.2",date:"2025-12-04",title:"Event Display Improvements",type:"improvement",description:"Enhanced event cards and detail views for better readability.",items:["Added location display with MapPin icon on Today view event cards","Moved timezone and recurrence indicators from Week view to detail view for cleaner event boxes","Fixed edit event dialog scrolling on mobile - buttons no longer cut off","Refined duration timeline with thinner, lighter stroke styling"]},{version:"0.3.1",date:"2025-12-03",title:"Mobile Week View Fix",type:"fix",description:"Fixed critical scrolling issues in the mobile week view.",items:["Eliminated dual scrollbar problem in week view","Fixed sticky time column and day headers during scroll","Ensured all navigation elements fit within mobile viewport","Removed page-level horizontal scrollbar interference"]},{version:"0.3.0",date:"2025-12-02",title:"Desktop Optimization",type:"improvement",description:"Enhanced desktop experience with optimized layouts and modals.",items:["Event detail dialog now displays as a centered modal on desktop","Today view optimized for 3-column layout on large screens","Improved responsive design across all calendar views"]},{version:"0.2.0",date:"2025-12-01",title:"Advanced Recurrence & Analytics",type:"feature",description:"Powerful new features for managing recurring events and tracking calendar usage.",items:["Custom recurrence patterns (daily, weekly, bi-weekly, monthly, yearly)","Day-of-week selection for weekly/bi-weekly events","Recurrence preview showing next 5 occurrences","Calendar analytics dashboard with event statistics","Event distribution charts by color, hour, and day"]},{version:"0.1.0",date:"2025-11-28",title:"Initial Beta Release",type:"release",description:"First public beta of Caréable - the care-able way to plan as one.",items:["AI-powered event creation with voice input","Multi-persona calendar sharing (Creator, Viewer, Editor)","Beautiful mobile-first design with 8-color palette","Secure shareable links with optional password protection","Real-time calendar synchronization"]}],HFe=t=>{switch(t){case"feature":return l.jsx(ta,{className:"w-4 h-4"});case"fix":return l.jsx(d$,{className:"w-4 h-4"});case"improvement":return l.jsx(w$,{className:"w-4 h-4"});case"release":return l.jsx(yZ,{className:"w-4 h-4"})}},qFe=t=>{switch(t){case"feature":return"bg-calendar-blue/20 text-calendar-blue border-calendar-blue/30";case"fix":return"bg-calendar-coral/20 text-calendar-coral border-calendar-coral/30";case"improvement":return"bg-calendar-mint/20 text-calendar-mint border-calendar-mint/30";case"release":return"bg-calendar-peach/20 text-calendar-peach border-calendar-peach/30"}},KFe=t=>new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"});function GFe(){const t=rr();return b.useEffect(()=>{window.scrollTo(0,0)},[]),l.jsxs("div",{className:"min-h-screen bg-background",children:[l.jsx(es,{canonical:"https://careable.co/updates",title:"Updates",description:"See the latest features, improvements, and bug fixes in Caréable."}),l.jsx("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify({"@context":"https://schema.org","@type":"ItemList",name:"Caréable Updates",url:"https://careable.co/updates",itemListElement:l8.map((e,n)=>({"@type":"ListItem",position:n+1,item:{"@type":"Article",headline:`${e.title}
959 (v${e.version})`,description:e.description,datePublished:e.date,author:{"@type":"Organization",name:"Caréable"},publisher:{"@type":"Organization",name:"Caréable",logo:{"@type":"ImageObject",url:"https://careable.co/careable-icon.png"}},url:`https://careable.co/updates#v${e.version}`}}))})}}),l.jsx("nav",{className:"border-b border-border/40 backdrop-blur-sm sticky top-0 z-50 bg-background/80",children:l.jsx("div",{className:"container mx-auto px-6 md:px-8",children:l.jsxs("div",{className:"flex justify-between items-center h-16 md:h-20",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("img",{src:"/careable-icon.png?v=11",alt:"Caréable",className:"w-8 h-8 rounded-full"}),l.jsx("h1",{className:"text-xl md:text-2xl font-bold",children:"Caréable"})]}),l.jsxs(de,{onClick:()=>t("/"),variant:"ghost",className:"min-h-[44px]",children:[l.jsx(ci,{className:"w-4 h-4 mr-2"}),"Back to Home"]})]})})}),l.jsx("div",{className:"container mx-auto px-6 md:px-8 py-12 md:py-20",children:l.jsxs("div",{className:"max-w-3xl mx-auto",children:[l.jsxs("div",{className:"text-center mb-12 md:mb-16 animate-fade-in",children:[l.jsx("h1",{className:"text-4xl md:text-5xl font-bold mb-4",children:"Updates"}),l.jsx("p",{className:"text-lg md:text-xl text-muted-foreground",children:"What's new in Caréable"})]}),l.jsx("div",{className:"space-y-6",children:l8.map((e,n)=>l.jsx(rt,{id:`v${e.version}`,className:"animate-fade-in overflow-hidden",style:{animationDelay:`${n*.1}s`,animationFillMode:"backwards"},children:l.jsxs(ot,{className:"p-6 md:p-8",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3 mb-4",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs(Rn,{variant:"outline",className:`${qFe(e.type)} flex items-center gap-1.5 capitalize`,children:[HFe(e.type),e.type]}),l.jsxs("span",{className:"text-sm font-mono text-muted-foreground",children:["v",e.version]})]}),l.jsx("span",{className:"text-sm text-muted-foreground",children:KFe(e.date)})]}),l.jsx("h2",{className:"text-xl md:text-2xl font-semibold mb-2",children:e.title}),l.jsx("p",{className:"text-muted-foreground mb-4",children:e.description}),e.items&&e.items.length>0&&l.jsx("ul",{className:"space-y-2",children:e.items.map((r,i)=>l.jsxs("li",{className:"flex items-start gap-2 text-sm",children:[l.jsx("span",{className:"text-calendar-blue mt-1",children:"â¢"}),l.jsx("span",{children:r})]},i))})]})},e.version))})]})}),l.jsx("footer",{className:"border-t border-border/40 py-8 md:py-12 mt-12",children:l.jsx("div",{className:"container mx-auto px-6 md:px-8",children:l.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-center gap-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"w-6 h-6 rounded bg-gradient-to-br from-calendar-blue via-calendar-coral to-calendar-peach"}),l.jsx("span",{className:"font-semibold",children:"Caréable"})]}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"© 2025 Caréable. Chat to schedule."})]})})})]})}const Kk="https://brmeiebxvvelfkihfbxb.supabase.co/functions/v1/send-push-test",Io=(t,e)=>({state:"idle",label:t,message:e,details:[]});function Zu(t,e=[]){return t instanceof Error?[`Error name: ${t.name||"Error"}`,`Error message: ${t.message||"Unknown error"}`,...t.stack?[`Stack: ${t.stack.split(` 960`).slice(0,3).join(" | ")}`]:[],...e]:[`Error message: ${String(t)}`,...e]}function u8(t){return t?[`Service worker scope: ${t.scope}`,`Service worker active: ${t.active?"yes":"no"}`,...t.active?[`Active script: ${t.active.scriptURL}`,`Active state: ${t.active.state}`]:[],...t.waiting?[`Waiting state: ${t.waiting.state}`]:[],...t.installing?[`Installing state: ${t.installing.state}`]:[]]:["Service worker registration: not found"]}function YFe({step:t}){const e=t.state==="yes"?"YES":t.state==="no"?"NO":t.state==="running"?"CHECKING":"PENDING";return l.jsxs(rt,{children:[l.jsx(ht,{className:"pb-3",children:l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx(mt,{className:"text-base",children:t.label}),l.jsx(tn,{children:t.message})]}),l.jsx(Rn,{variant:"outline",className:ce(t.state==="yes"&&"border-primary/30 text-primary",t.state==="no"&&"border-destructive/30 text-destructive",t.state==="running"&&"border-primary/30 text-primary"),children:e})]})}),t.details.length>0&&l.jsx(ot,{className:"pt-0",children:l.jsx("ul",{className:"space-y-1 text-sm text-muted-foreground break-all",children:t.details.map(n=>l.jsx("li",{children:n},n))})})]})}function d8(){const t=rr(),{calendarId:e,accessCode:n}=Kg(),{user:r,session:i,loading:a,refreshing:s}=sa(),{calendarId:o,loading:c,error:u}=JP(n,e),[d,h]=b.useState(()=>
960Io("1. PushSubscription exists","Check whether Android Chrome has a current PushSubscription.")),[f,p]=b.useState(()=>Io("2. Saved in push_subscriptions","Check whether the exact current endpoint exists in the database.")),[g,m]=b.useState(()=>Io("3. Endpoint is Android-compatible and current","Check endpoint host and whether the saved row matches this browser.")),[v,x]=b.useState(()=>Io("4. Test send to this exact subscription","Call the backend function with the exact browser endpoint.")),[w,y]=b.useState(()=>Io("5. /sw.js receives the push event","Wait for the service worker to report that a push event arrived.")),[k,S]=b.useState(()=>Io("6. /sw.js showNotification() succeeds","Wait for the service worker to report the showNotification result.")),[_,C]=b.useState("Run diagnosis on the Android recipient device, then use Send test push to this device only."),[T,E]=b.useState(null),j=b.useRef(null),P=b.useRef(null),M=n?`/calendar/${n}`:o?`/calendar/owner/${o}`:"/dashboard",U=b.useCallback(()=>{j.current&&(clearTimeout(j.current),j.current=null),P.current&&(clearTimeout(P.current),P.current=null)},[]),N=b.useCallback(()=>{U(),y({state:"running",label:"5. /sw.js receives the push event",message:"Waiting for a push event from the service workerâ¦",details:[]}),S({state:"running",label:"6. /sw.js showNotification() succeeds",message:"Waiting for showNotification() result from the service workerâ¦",details:[]}),j.current=setTimeout(()=>{y(A=>A.state==="running"?{state:"no",label:A.label,message:"No push event message came back from /sw.js.",details:["No service-worker debug message was received within 10 seconds after test send."]}:A)},1e4),P.current=setTimeout(()=>{S(A=>A.state==="running"?{state:"no",label:A.label,message:"No showNotification() result came back from /sw.js.",details:["No showNotification debug message was received within 10 seconds after test send."]}:A)},1e4)},[U]);b.useEffect(()=>{if(!("serviceWorker"in navigator))return;const A=L=>{var V;((V=L.data)==null?void 0:V.source)==="careable-sw-debug"&&(L.data.type==="push-received"&&(j.current&&(clearTimeout(j.current),j.current=null),y({state:L.data.ok?"yes":"no",label:"5. /sw.js receives the push event",message:L.data.ok?"Service worker reported a push event.":"Service worker reported a push-event failure.",details:[`Payload: ${JSON.stringify(L.data.payload??null)}`,...L.data.error?[`Error: ${L.data.error}`]:[]]})),L.data.type==="show-notification"&&(P.current&&(clearTimeout(P.current),P.current=null),S({state:L.data.ok?"yes":"no",label:"6. /sw.js showNotification() succeeds",message:L.data.ok?"showNotification() completed successfully.":"showNotification() failed.",details:[...L.data.title?[`Title: ${L.data.title}`]:[],...L.data.error?[`Error: ${L.data.error}`]:[]]})))};return navigator.serviceWorker.addEventListener("message",A),()=>{navigator.serviceWorker.removeEventListener("message",A),U()}},[U]);const B=b.useCallback(async(A,L)=>{if(!o)throw new Error("Missing calendar id for push debug");const V={"Content-Type":"application/json",apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJybWVpZWJ4dnZlbGZraWhmYnhiIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjM5MDY0NzYsImV4cCI6MjA3OTQ4MjQ3Nn0.xexgaMCMIMNob6PK-1V-J-P0Dnu32BzaoG9HtWnyU2g"};return i!=null&&i.access_token&&(V.Authorization=`Bearer ${i.access_token}`),fetch("https://brmeiebxvvelfkihfbxb.supabase.co/functions/v1/send-push-test",{method:"POST",headers:V,body:JSON.stringify({mode:A,calendarId:o,endpoint:L,accessCode:n??null})})},[n,o,i==null?void 0:i.access_token]),$=b.useCallback(async()=>{if(!o)return;E("diagnose"),U(),C("Checking the Android recipient subscription and the exact saved rowâ¦");const A=wf();if(!A.supported){h({state:"no",label:"1. PushSubscription exists",message:"This browser cannot use the current Web Push stack.",details:[`Support failure: ${A.reason??"unknown"}`]}),p({state:"no",label:"2. Saved in push_subscriptions",message:"Skipped because no browser subscription can exist here.",details:[]}),m({state:"no",label:"3. Endpoint is Android-compatible and current",message:"Skipped because there is no compatible browser push support.",details:[]}),x({state:"no",label:"4. Test send to this exact subscription",message:"Skipped because there is no subscription to send to.",details:[]}),C("Diagnosis stopped before subscription checks because this browser does not support the current push stack."),E(null);return}try{let L;try{L=await Fy()}
960catch(W){h({state:"no",label:"1. PushSubscription exists",message:"The browser failed before it could read the current PushSubscription.",details:Zu(W,[`Origin: ${window.location.origin}`,"Service worker path: /sw.js"])}),p({state:"no",label:"2. Saved in push_subscriptions",message:"Skipped because the browser failed before subscription lookup completed.",details:[]}),m({state:"no",label:"3. Endpoint is Android-compatible and current",message:"Skipped because the browser failed before subscription lookup completed.",details:[]}),x({state:"no",label:"4. Test send to this exact subscription",message:"Skipped because the browser failed before subscription lookup completed.",details:[]}),C("Broken step found: the browser failed before reading the current PushSubscription.");return}const V=u8(L);let Y;try{Y=await L.pushManager.getSubscription()}catch(W){h({state:"no",label:"1. PushSubscription exists",message:"pushManager.getSubscription() threw while reading the current PushSubscription.",details:Zu(W,V)}),p({state:"no",label:"2. Saved in push_subscriptions",message:"Skipped because the browser could not read the current PushSubscription.",details:[]}),m({state:"no",label:"3. Endpoint is Android-compatible and current",message:"Skipped because the browser could not read the current PushSubscription.",details:[]}),x({state:"no",label:"4. Test send to this exact subscription",message:"Skipped because the browser could not read the current PushSubscription.",details:[]}),C("Broken step found: pushManager.getSubscription() threw on this device.");return}if(!Y){h({state:"no",label:"1. PushSubscription exists",message:"No current PushSubscription exists on this device.",details:["registration.pushManager.getSubscription() returned null.",...V]}),p({state:"no",label:"2. Saved in push_subscriptions",message:"Cannot check database row because there is no current browser subscription.",details:[]}),m({state:"no",label:"3. Endpoint is Android-compatible and current",message:"Cannot verify endpoint host/currentness without a browser subscription.",details:[]}),x({state:"no",label:"4. Test send to this exact subscription",message:"Cannot send because there is no current subscription.",details:[]}),C("Broken step found: the device has no current PushSubscription.");return}const Q=md(Y.endpoint)??"unknown";h({state:"yes",label:"1. PushSubscription exists",message:"Android Chrome has a current PushSubscription.",details:[`Endpoint host: ${Q}`,...V]});let re;try{re=await B("inspect",Y.endpoint)}catch(W){const H=Zu(W,[`Function URL: ${Kk}`,`Origin: ${window.location.origin}`,`navigator.onLine: ${navigator.onLine}`,`Endpoint host: ${Q}`]);p({state:"no",label:"2. Saved in push_subscriptions",message:"The backend inspection request failed before any HTTP response arrived.",details:H}),m({state:"no",label:"3. Endpoint is Android-compatible and current",message:"Cannot verify endpoint currentness because the inspection request failed before any HTTP response.",details:H}),x({state:"no",label:"4. Test send to this exact subscription",message:"Skipped because the inspection request failed before any HTTP response.",details:[]}),C("Broken step found: the backend inspection request failed before any HTTP response arrived.");return}const J=await re.text();let ne=null,G=null;if(J)try{ne=JSON.parse(J)}catch(W){G=W}if(G){const W=Zu(G,[`HTTP status: ${re.status}`,`Raw response body: ${J}`]);p({state:"no",label:"2. Saved in push_subscriptions",message:"The backend inspection response was not valid JSON.",details:W}),m({state:"no",label:"3. Endpoint is Android-compatible and current",message:"Cannot verify endpoint currentness because the inspection response was not valid JSON.",details:W}),x({state:"no",label:"4. Test send to this exact subscription",message:"Skipped because the inspection response could not be parsed.",details:[]}),C(`Broken step found: backend inspection returned unreadable JSON with HTTP ${re.status}.`);return}if(!re.ok||!ne){p({state:"no",label:"2. Saved in push_subscriptions",message:"Backend inspection failed while checking push_subscriptions.",details:[`HTTP status: ${re.status}`,`Response body: ${J||"(empty)"}`]}),m({state:"no",label:"3. Endpoint is Android-compatible and current",message:"Cannot verify endpoint currentness because backend inspection failed.",details:[`HTTP status: ${re.status}`,`Response body: ${J||"(empty)"}`]}),x({state:"no",label:"4. Test send to this exact subscription",message:"Skipped because the current saved row could not be confirmed.",details:[]}),C(`Broken step found: backend inspection failed with HTTP ${re.status}.`);return}const Z=ne.subscriptionFound===!0,ee=ne.staleRows??[],K=ne.endpointHost??Q,oe=K==="fcm.googleapis.com";p({state:Z?"yes":"no",label:"2. Saved in push_subscriptions",message:Z?"The exact current browser endpoint exists in push_subscriptions.":"The current browser endpoint is not saved in push_subscriptions.",details:[`Authorized as: ${ne.authorizedAs??(n?"shared":"owner")}`,`Current endpoint host: ${K}`,`Current row id: ${ne.subscriptionId??"not found"}`,...ne.lastSeenAt?[`last_seen_at: ${ne.lastSeenAt}`]:[]]}),m({state:oe&&Z?"yes":"no",label:"3. Endpoint is Android-compatible and current",message:oe&&Z?"The browser endpoint is an Android Chrome FCM endpoint and matches the current saved row.":"The endpoint host/currentness check failed.",details:[`Browser endpoint host: ${Q}`,`Saved endpoint host: ${K}`,`Android-compatible host (fcm.googleapis.com): ${oe?"yes":"no"}`,`Saved row matches current browser endpoint: ${Z?"yes":"no"}`,`Other saved rows in this debug scope: ${ee.length}`,...ee.slice(0,5).map(W=>`Stale row: ${W.id} ⢠${W.endpointHost??"unknown-host"} ⢠${W.lastSeenAt}`)]}),x({state:Z?"idle":"no",label:"4. Test send to this exact subscription",message:Z?"Ready to send a test push to the exact current subscription.":"Cannot send because the current browser endpoint is not saved in push_subscriptions.",details:Z?[`Target endpoint host: ${K}`]:[]}),C(Z?"Diagnosis finished for steps 1â3. Use Send test push to this device only for steps 4â6.":"Broken step found: the browser has a subscription, but the exact endpoint is not saved in push_subscriptions.")}catch(L){const V=L instanceof Error?L.message:"Unknown diagnosis error";
960h({state:"no",label:"1. PushSubscription exists",message:"Failed while checking the current PushSubscription.",details:[V]}),p({state:"no",label:"2. Saved in push_subscriptions",message:"Skipped because subscription lookup failed first.",details:[]}),m({state:"no",label:"3. Endpoint is Android-compatible and current",message:"Skipped because subscription lookup failed first.",details:[]}),x({state:"no",label:"4. Test send to this exact subscription",message:"Skipped because subscription lookup failed first.",details:[]}),C(`Broken step found during subscription diagnosis: ${V}`)}finally{E(null)}},[n,B,U,o]),I=b.useCallback(async()=>{if(o){E("clear"),C("Clearing the current device subscription and removing its saved rowâ¦");try{await LC({calendarId:o,accessCode:n}),y(Io("5. /sw.js receives the push event","Push receive check resets after the next test send.")),S(Io("6. /sw.js showNotification() succeeds","showNotification() check resets after the next test send.")),await $(),C("Cleared the current device subscription.")}catch(A){const L=A instanceof Error?A.message:"Unknown clear-subscription error";C(`Clear existing subscription failed: ${L}`)}finally{E(null)}}},[n,o,$]),R=b.useCallback(async()=>{if(o){E("resubscribe"),C("Clearing any old subscription, then creating and saving a fresh one for this deviceâ¦");try{try{await LC({calendarId:o,accessCode:n})}catch{}await Fy();const A=await yU(),L=await bU({calendarId:o,accessCode:n,deviceLabel:n?"shared-debug-device":void 0},A);C(`Re-subscribed this device. Endpoint host: ${L.endpointHost??md(A.endpoint)??"unknown"}`),await $()}catch(A){const L=A instanceof Error?A.message:"Unknown re-subscribe error";h({state:"no",label:"1. PushSubscription exists",message:"Re-subscribe failed while creating a PushSubscription.",details:[L]}),C(`Re-subscribe this device failed: ${L}`)}finally{E(null)}}},[n,o,$]),z=b.useCallback(async()=>{if(o){E("send"),C("Sending a test push to the exact current device subscription onlyâ¦");try{const A=await Fy(),L=u8(A),V=await A.pushManager.getSubscription();if(!V){x({state:"no",label:"4. Test send to this exact subscription",message:"Cannot send because no current PushSubscription exists.",details:["Run Re-subscribe this device first.",...L]}),C("Broken step found: there is no current PushSubscription to send to.");return}N(),x({state:"running",label:"4. Test send to this exact subscription",message:"Calling the backend function with this exact endpointâ¦",details:[`Endpoint host: ${md(V.endpoint)??"unknown"}`]});let Y;try{Y=await B("send",V.endpoint)}catch(re){const J=Zu(re,[`Function URL: ${Kk}`,`Origin: ${window.location.origin}`,`navigator.onLine: ${navigator.onLine}`,`Endpoint host: ${md(V.endpoint)??"unknown"}`,...L]);x({state:"no",label:"4. Test send to this exact subscription",message:"The backend send request failed before any HTTP response arrived.",details:J}),C("Broken step found: the backend send request failed before any HTTP response arrived.");return}const Q=await Y.text();x({state:Y.ok?"yes":"no",label:"4. Test send to this exact subscription",message:Y.ok?"Backend function reported a successful send to this exact subscription.":"Backend function failed to send to this exact subscription.",details:[`HTTP status: ${Y.status}`,`Response body: ${Q||"(empty)"}`]}),C(Y.ok?"Test push was accepted by the backend. Now the panel is waiting for /sw.js step 5 and step 6 results.":`Broken step found: backend send failed with HTTP ${Y.status}.`)}catch(A){const L=A instanceof Error?A.message:"Unknown test-send error";x({state:"no",label:"4. Test send to this exact subscription",message:"The test-send flow failed before the backend send request could complete.",details:Zu(A,[`Function URL: ${Kk}`,`Origin: ${window.location.origin}`])}),C(`Broken step found during test send: ${L}`)}finally{E(null)}}},[B,N,o]),O=b.useMemo(()=>[d,f,g,v,w,k],[g,w,f,v,k,d]);return c||a||s?l.jsx("div",{className:"min-h-screen bg-background p-6 overflow-x-hidden",children:l.jsx("div",{className:"mx-auto max-w-5xl",children:l.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading push debugâ¦"})})}):o?l.jsxs("div",{className:"min-h-screen bg-background p-4 md:p-8 overflow-x-hidden",children:[l.jsx(es,{title:"Push Debug",description:"Diagnose Android Web Push failure points for this calendar."}),l.jsxs("div",{className:"mx-auto max-w-5xl space-y-6",children:[l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(d$,{className:"h-5 w-5 text-primary"}),l.jsx("h1",{className:"text-2xl font-bold",children:"Push debug"})]}),l.jsxs("p",{className:"text-sm text-muted-foreground break-all",children:["Calendar: ",o]}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:["Path: ",n?"Shared recipient device":r?"Signed-in owner device":"Owner route without session"]})]}),l.jsxs(de,{variant:"outline",onClick:()=>t(M),children:[l.jsx(ci,{className:"mr-2 h-4 w-4"}),"Back to calendar"]})]}),l.jsxs(rt,{children:[l.jsx(ht,{children:l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx(mt,{className:"text-base",children:"Exact post-permission diagnosis"}),l.jsx(tn,{children:_})]}),l.jsx(Rn,{variant:"outline",children:"Android Chrome"})]})}),l.jsxs(ot,{className:"flex flex-wrap gap-2",children:[l.jsxs(de,{onClick:$,disabled:T!==null,children:[T==="diagnose"?l.jsx(Er,{className:"mr-2 h-4 w-4 animate-spin"}):l.jsx(dh,{className:"mr-2 h-4 w-4"}),"Run diagnosis"]}),l.jsxs(de,{variant:"outline",onClick:I,disabled:T!==null,children:[T==="clear"?l.jsx(Er,{className:"mr-2 h-4 w-4 animate-spin"}):l.jsx(q2,{className:"mr-2 h-4 w-4"}),"Clear existing subscription"]}),l.jsxs(de,{variant:"outline",onClick:R,disabled:T!==null,children:[T==="resubscribe"?l.jsx(Er,{className:"mr-2 h-4 w-4 animate-spin"}):l.jsx(bZ,{className:"mr-2 h-4 w-4"}),"Re-subscribe this device"]}),l.jsxs(de,{variant:"outline",onClick:z,disabled:T!==null,children:[T==="send"?l.jsx(Er,{className:"mr-2 h-4 w-4 animate-spin"}):l.jsx(vc,{className:"mr-2 h-4 w-4"}),"Send test push to this device only"]})]})]}),l.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:O.map(A=>l.jsx(YFe,{step:A},A.label))})]})]}):l.jsx("div",{className:"min-h-screen bg-background p-6 overflow-x-hidden",children:l.jsxs("div",{className:"mx-auto max-w-5xl space-y-4",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:u||"Push debug requires a valid shared link or a signed-in owner route."}),l.jsx(de,{variant:"outline",onClick:()=>
960t("/dashboard"),children:"Back to dashboard"})]})})}const JFe=new Jte({defaultOptions:{queries:{staleTime:5e3,gcTime:3e4,refetchOnWindowFocus:!1,refetchOnMount:!1,retry:1}}}),XFe=()=>l.jsx(Zte,{client:JFe,children:l.jsxs(xp,{children:[l.jsx(uQ,{}),l.jsx(zQ,{}),l.jsx(Gne,{children:l.jsx(xae,{children:l.jsx(wae,{children:l.jsxs(kae,{children:[l.jsx(Cae,{}),l.jsxs(Une,{children:[l.jsx($n,{path:"/",element:l.jsx(Xse,{})}),l.jsx($n,{path:"/auth",element:l.jsx(Wce,{})}),l.jsx($n,{path:"/reset-password",element:l.jsx(Hce,{})}),l.jsx($n,{path:"/dashboard",element:l.jsx(fue,{})}),l.jsx($n,{path:"/admin",element:l.jsx(cbe,{})}),l.jsx($n,{path:"/admin/settings",element:l.jsx(lbe,{})}),l.jsx($n,{path:"/settings",element:l.jsx(dbe,{})}),l.jsx($n,{path:"/demo",element:l.jsx(R0e,{})}),l.jsx($n,{path:"/calendar/owner/:calendarId",element:l.jsx(M0e,{})}),l.jsx($n,{path:"/calendar/owner/:calendarId/push-debug",element:l.jsx(d8,{})}),l.jsx($n,{path:"/calendar/:accessCode/push-debug",element:l.jsx(d8,{})}),l.jsx($n,{path:"/calendar/:accessCode",element:l.jsx($0e,{})}),l.jsx($n,{path:"/analytics/:calendarId",element:l.jsx(WFe,{})}),l.jsx($n,{path:"/generate-favicon",element:l.jsx(VFe,{})}),l.jsx($n,{path:"/terms",element:l.jsx(B0e,{})}),l.jsx($n,{path:"/privacy",element:l.jsx(U0e,{})}),l.jsx($n,{path:"/about",element:l.jsx(z0e,{})}),l.jsx($n,{path:"/updates",element:l.jsx(GFe,{})}),l.jsx($n,{path:"*",element:l.jsx(F0e,{})})]})]})})})})]})});DL(document.getElementById("root")).render(l.jsx(XFe,{}))});export default ZFe();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.