var EE=t=>{throw TypeError(t)};var X0=(t,r,o)=>r.has(t)||EE("Cannot "+o);var Ae=(t,r,o)=>(X0(t,r,"read from private field"),o?o.call(t):r.get(t)),Tt=(t,r,o)=>r.has(t)?EE("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(t):r.set(t,o),ft=(t,r,o,n)=>(X0(t,r,"write to private field"),n?n.call(t,o):r.set(t,o),o),Bt=(t,r,o)=>(X0(t,r,"access private method"),o);var Fp=(t,r,o,n)=>({set _(i){ft(t,r,i,o)},get _(){return Ae(t,r,n)}});function Z6(t,r){for(var o=0;on[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(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"&&n(s)}).observe(document,{childList:!0,subtree:!0});function o(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 n(i){if(i.ep)return;i.ep=!0;const a=o(i);fetch(i.href,a)}})();var Zr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Kt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Q6(t){if(t.__esModule)return t;var r=t.default;if(typeof r=="function"){var o=function n(){return this instanceof n?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};o.prototype=r.prototype}else o={};return Object.defineProperty(o,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(o,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),o}var gM={exports:{}},Zg={},vM={exports:{}},$t={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var ip=Symbol.for("react.element"),J6=Symbol.for("react.portal"),e8=Symbol.for("react.fragment"),t8=Symbol.for("react.strict_mode"),r8=Symbol.for("react.profiler"),n8=Symbol.for("react.provider"),o8=Symbol.for("react.context"),i8=Symbol.for("react.forward_ref"),a8=Symbol.for("react.suspense"),s8=Symbol.for("react.memo"),l8=Symbol.for("react.lazy"),TE=Symbol.iterator;function u8(t){return t===null||typeof t!="object"?null:(t=TE&&t[TE]||t["@@iterator"],typeof t=="function"?t:null)}var bM={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},xM=Object.assign,wM={};function ed(t,r,o){this.props=t,this.context=r,this.refs=wM,this.updater=o||bM}ed.prototype.isReactComponent={};ed.prototype.setState=function(t,r){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,r,"setState")};ed.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function _M(){}_M.prototype=ed.prototype;function H_(t,r,o){this.props=t,this.context=r,this.refs=wM,this.updater=o||bM}var q_=H_.prototype=new _M;q_.constructor=H_;xM(q_,ed.prototype);q_.isPureReactComponent=!0;var OE=Array.isArray,jM=Object.prototype.hasOwnProperty,X_={current:null},SM={key:!0,ref:!0,__self:!0,__source:!0};function EM(t,r,o){var n,i={},a=null,s=null;if(r!=null)for(n in r.ref!==void 0&&(s=r.ref),r.key!==void 0&&(a=""+r.key),r)jM.call(r,n)&&!SM.hasOwnProperty(n)&&(i[n]=r[n]);var l=arguments.length-2;if(l===1)i.children=o;else if(1>>1,U=$[Z];if(0>>1;Zi(H,K))Yi(ee,H)?($[Z]=ee,$[Y]=K,Z=Y):($[Z]=H,$[B]=K,Z=B);else if(Yi(ee,K))$[Z]=ee,$[Y]=K,Z=Y;else break e}}return G}function i($,G){var K=$.sortIndex-G.sortIndex;return K!==0?K:$.id-G.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,l=s.now();t.unstable_now=function(){return s.now()-l}}var u=[],c=[],h=1,f=null,d=3,m=!1,y=!1,p=!1,g=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v($){for(var G=o(c);G!==null;){if(G.callback===null)n(c);else if(G.startTime<=$)n(c),G.sortIndex=G.expirationTime,r(u,G);else break;G=o(c)}}function w($){if(p=!1,v($),!y)if(o(u)!==null)y=!0,z(_);else{var G=o(c);G!==null&&W(w,G.startTime-$)}}function _($,G){y=!1,p&&(p=!1,b(T),T=-1),m=!0;var K=d;try{for(v(G),f=o(u);f!==null&&(!(f.expirationTime>G)||$&&!O());){var Z=f.callback;if(typeof Z=="function"){f.callback=null,d=f.priorityLevel;var U=Z(f.expirationTime<=G);G=t.unstable_now(),typeof U=="function"?f.callback=U:f===o(u)&&n(u),v(G)}else n(u);f=o(u)}if(f!==null)var I=!0;else{var B=o(c);B!==null&&W(w,B.startTime-G),I=!1}return I}finally{f=null,d=K,m=!1}}var E=!1,S=null,T=-1,k=5,A=-1;function O(){return!(t.unstable_now()-A$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<$?Math.floor(1e3/$):5},t.unstable_getCurrentPriorityLevel=function(){return d},t.unstable_getFirstCallbackNode=function(){return o(u)},t.unstable_next=function($){switch(d){case 1:case 2:case 3:var G=3;break;default:G=d}var K=d;d=G;try{return $()}finally{d=K}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function($,G){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var K=d;d=$;try{return G()}finally{d=K}},t.unstable_scheduleCallback=function($,G,K){var Z=t.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0Z?($.sortIndex=K,r(c,$),o(u)===null&&$===o(c)&&(p?(b(T),T=-1):p=!0,W(w,K-Z))):($.sortIndex=U,r(u,$),y||m||(y=!0,z(_))),$},t.unstable_shouldYield=O,t.unstable_wrapCallback=function($){var G=d;return function(){var K=d;d=G;try{return $.apply(this,arguments)}finally{d=K}}}})(AM);CM.exports=AM;var x8=CM.exports;/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var w8=q,Mo=x8;function Qe(t){for(var r="https://reactjs.org/docs/error-decoder.html?invariant="+t,o=1;o"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),x1=Object.prototype.hasOwnProperty,_8=/^[: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]*$/,PE={},CE={};function j8(t){return x1.call(CE,t)?!0:x1.call(PE,t)?!1:_8.test(t)?CE[t]=!0:(PE[t]=!0,!1)}function S8(t,r,o,n){if(o!==null&&o.type===0)return!1;switch(typeof r){case"function":case"symbol":return!0;case"boolean":return n?!1:o!==null?!o.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function E8(t,r,o,n){if(r===null||typeof r>"u"||S8(t,r,o,n))return!0;if(n)return!1;if(o!==null)switch(o.type){case 3:return!r;case 4:return r===!1;case 5:return isNaN(r);case 6:return isNaN(r)||1>r}return!1}function no(t,r,o,n,i,a,s){this.acceptsBooleans=r===2||r===3||r===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=o,this.propertyName=t,this.type=r,this.sanitizeURL=a,this.removeEmptyString=s}var Tn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Tn[t]=new no(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var r=t[0];Tn[r]=new no(r,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Tn[t]=new no(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Tn[t]=new no(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){Tn[t]=new no(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Tn[t]=new no(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Tn[t]=new no(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Tn[t]=new no(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Tn[t]=new no(t,5,!1,t.toLowerCase(),null,!1,!1)});var K_=/[\-:]([a-z])/g;function Z_(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 r=t.replace(K_,Z_);Tn[r]=new no(r,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var r=t.replace(K_,Z_);Tn[r]=new no(r,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var r=t.replace(K_,Z_);Tn[r]=new no(r,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Tn[t]=new no(t,1,!1,t.toLowerCase(),null,!1,!1)});Tn.xlinkHref=new no("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Tn[t]=new no(t,1,!1,t.toLowerCase(),null,!0,!0)});function Q_(t,r,o,n){var i=Tn.hasOwnProperty(r)?Tn[r]:null;(i!==null?i.type!==0:n||!(2l||i[s]!==a[l]){var u=` `+i[s].replace(" at new "," at ");return t.displayName&&u.includes("")&&(u=u.replace("",t.displayName)),u}while(1<=s&&0<=l);break}}}finally{Z0=!1,Error.prepareStackTrace=o}return(t=t?t.displayName||t.name:"")?nf(t):""}function T8(t){switch(t.tag){case 5:return nf(t.type);case 16:return nf("Lazy");case 13:return nf("Suspense");case 19:return nf("SuspenseList");case 0:case 2:case 15:return t=Q0(t.type,!1),t;case 11:return t=Q0(t.type.render,!1),t;case 1:return t=Q0(t.type,!0),t;default:return""}}function S1(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 ju:return"Fragment";case _u:return"Portal";case w1:return"Profiler";case J_:return"StrictMode";case _1:return"Suspense";case j1:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case IM:return(t.displayName||"Context")+".Consumer";case RM:return(t._context.displayName||"Context")+".Provider";case ej:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case tj:return r=t.displayName||null,r!==null?r:S1(t.type)||"Memo";case ts:r=t._payload,t=t._init;try{return S1(t(r))}catch{}}return null}function O8(t){var r=t.type;switch(t.tag){case 24:return"Cache";case 9:return(r.displayName||"Context")+".Consumer";case 10:return(r._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=r.render,t=t.displayName||t.name||"",r.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return r;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return S1(r);case 8:return r===J_?"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 r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r}return null}function Is(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function LM(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function k8(t){var r=LM(t)?"checked":"value",o=Object.getOwnPropertyDescriptor(t.constructor.prototype,r),n=""+t[r];if(!t.hasOwnProperty(r)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var i=o.get,a=o.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return i.call(this)},set:function(s){n=""+s,a.call(this,s)}}),Object.defineProperty(t,r,{enumerable:o.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function Bp(t){t._valueTracker||(t._valueTracker=k8(t))}function DM(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var o=r.getValue(),n="";return t&&(n=LM(t)?t.checked?"true":"false":t.value),t=n,t!==o?(r.setValue(t),!0):!1}function Km(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 E1(t,r){var o=r.checked;return Nr({},r,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:o??t._wrapperState.initialChecked})}function ME(t,r){var o=r.defaultValue==null?"":r.defaultValue,n=r.checked!=null?r.checked:r.defaultChecked;o=Is(r.value!=null?r.value:o),t._wrapperState={initialChecked:n,initialValue:o,controlled:r.type==="checkbox"||r.type==="radio"?r.checked!=null:r.value!=null}}function FM(t,r){r=r.checked,r!=null&&Q_(t,"checked",r,!1)}function T1(t,r){FM(t,r);var o=Is(r.value),n=r.type;if(o!=null)n==="number"?(o===0&&t.value===""||t.value!=o)&&(t.value=""+o):t.value!==""+o&&(t.value=""+o);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}r.hasOwnProperty("value")?O1(t,r.type,o):r.hasOwnProperty("defaultValue")&&O1(t,r.type,Is(r.defaultValue)),r.checked==null&&r.defaultChecked!=null&&(t.defaultChecked=!!r.defaultChecked)}function RE(t,r,o){if(r.hasOwnProperty("value")||r.hasOwnProperty("defaultValue")){var n=r.type;if(!(n!=="submit"&&n!=="reset"||r.value!==void 0&&r.value!==null))return;r=""+t._wrapperState.initialValue,o||r===t.value||(t.value=r),t.defaultValue=r}o=t.name,o!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,o!==""&&(t.name=o)}function O1(t,r,o){(r!=="number"||Km(t.ownerDocument)!==t)&&(o==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+o&&(t.defaultValue=""+o))}var of=Array.isArray;function Bu(t,r,o,n){if(t=t.options,r){r={};for(var i=0;i"+r.valueOf().toString()+"",r=zp.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;r.firstChild;)t.appendChild(r.firstChild)}});function Vf(t,r){if(r){var o=t.firstChild;if(o&&o===t.lastChild&&o.nodeType===3){o.nodeValue=r;return}}t.textContent=r}var vf={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},P8=["Webkit","ms","Moz","O"];Object.keys(vf).forEach(function(t){P8.forEach(function(r){r=r+t.charAt(0).toUpperCase()+t.substring(1),vf[r]=vf[t]})});function zM(t,r,o){return r==null||typeof r=="boolean"||r===""?"":o||typeof r!="number"||r===0||vf.hasOwnProperty(t)&&vf[t]?(""+r).trim():r+"px"}function VM(t,r){t=t.style;for(var o in r)if(r.hasOwnProperty(o)){var n=o.indexOf("--")===0,i=zM(o,r[o],n);o==="float"&&(o="cssFloat"),n?t.setProperty(o,i):t[o]=i}}var C8=Nr({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 C1(t,r){if(r){if(C8[t]&&(r.children!=null||r.dangerouslySetInnerHTML!=null))throw Error(Qe(137,t));if(r.dangerouslySetInnerHTML!=null){if(r.children!=null)throw Error(Qe(60));if(typeof r.dangerouslySetInnerHTML!="object"||!("__html"in r.dangerouslySetInnerHTML))throw Error(Qe(61))}if(r.style!=null&&typeof r.style!="object")throw Error(Qe(62))}}function A1(t,r){if(t.indexOf("-")===-1)return typeof r.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 M1=null;function rj(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var R1=null,zu=null,Vu=null;function LE(t){if(t=lp(t)){if(typeof R1!="function")throw Error(Qe(280));var r=t.stateNode;r&&(r=rv(r),R1(t.stateNode,t.type,r))}}function GM(t){zu?Vu?Vu.push(t):Vu=[t]:zu=t}function WM(){if(zu){var t=zu,r=Vu;if(Vu=zu=null,LE(t),r)for(t=0;t>>=0,t===0?32:31-(B8(t)/z8|0)|0}var Vp=64,Gp=4194304;function af(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 ey(t,r){var o=t.pendingLanes;if(o===0)return 0;var n=0,i=t.suspendedLanes,a=t.pingedLanes,s=o&268435455;if(s!==0){var l=s&~i;l!==0?n=af(l):(a&=s,a!==0&&(n=af(a)))}else s=o&~i,s!==0?n=af(s):a!==0&&(n=af(a));if(n===0)return 0;if(r!==0&&r!==n&&!(r&i)&&(i=n&-n,a=r&-r,i>=a||i===16&&(a&4194240)!==0))return r;if(n&4&&(n|=o&16),r=t.entangledLanes,r!==0)for(t=t.entanglements,r&=n;0o;o++)r.push(t);return r}function ap(t,r,o){t.pendingLanes|=r,r!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,r=31-bi(r),t[r]=o}function H8(t,r){var o=t.pendingLanes&~r;t.pendingLanes=r,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=r,t.mutableReadLanes&=r,t.entangledLanes&=r,r=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0=xf),WE=" ",HE=!1;function dR(t,r){switch(t){case"keyup":return x$.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function fR(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Su=!1;function _$(t,r){switch(t){case"compositionend":return fR(r);case"keypress":return r.which!==32?null:(HE=!0,WE);case"textInput":return t=r.data,t===WE&&HE?null:t;default:return null}}function j$(t,r){if(Su)return t==="compositionend"||!cj&&dR(t,r)?(t=uR(),Rm=sj=vs=null,Su=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1=r)return{node:o,offset:r-t};t=n}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=KE(o)}}function yR(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?yR(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function gR(){for(var t=window,r=Km();r instanceof t.HTMLIFrameElement;){try{var o=typeof r.contentWindow.location.href=="string"}catch{o=!1}if(o)t=r.contentWindow;else break;r=Km(t.document)}return r}function dj(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}function M$(t){var r=gR(),o=t.focusedElem,n=t.selectionRange;if(r!==o&&o&&o.ownerDocument&&yR(o.ownerDocument.documentElement,o)){if(n!==null&&dj(o)){if(r=n.start,t=n.end,t===void 0&&(t=r),"selectionStart"in o)o.selectionStart=r,o.selectionEnd=Math.min(t,o.value.length);else if(t=(r=o.ownerDocument||document)&&r.defaultView||window,t.getSelection){t=t.getSelection();var i=o.textContent.length,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!t.extend&&a>n&&(i=n,n=a,a=i),i=ZE(o,a);var s=ZE(o,n);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(r=r.createRange(),r.setStart(i.node,i.offset),t.removeAllRanges(),a>n?(t.addRange(r),t.extend(s.node,s.offset)):(r.setEnd(s.node,s.offset),t.addRange(r)))}}for(r=[],t=o;t=t.parentNode;)t.nodeType===1&&r.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o=document.documentMode,Eu=null,$1=null,_f=null,U1=!1;function QE(t,r,o){var n=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;U1||Eu==null||Eu!==Km(n)||(n=Eu,"selectionStart"in n&&dj(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),_f&&Yf(_f,n)||(_f=n,n=ny($1,"onSelect"),0ku||(t.current=H1[ku],H1[ku]=null,ku--)}function gr(t,r){ku++,H1[ku]=t.current,t.current=r}var Ns={},Un=zs(Ns),po=zs(!1),Ml=Ns;function gc(t,r){var o=t.type.contextTypes;if(!o)return Ns;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===r)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in o)i[a]=r[a];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=r,t.__reactInternalMemoizedMaskedChildContext=i),i}function mo(t){return t=t.childContextTypes,t!=null}function iy(){Tr(po),Tr(Un)}function iT(t,r,o){if(Un.current!==Ns)throw Error(Qe(168));gr(Un,r),gr(po,o)}function TR(t,r,o){var n=t.stateNode;if(r=r.childContextTypes,typeof n.getChildContext!="function")return o;n=n.getChildContext();for(var i in n)if(!(i in r))throw Error(Qe(108,O8(t)||"Unknown",i));return Nr({},o,n)}function ay(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Ns,Ml=Un.current,gr(Un,t),gr(po,po.current),!0}function aT(t,r,o){var n=t.stateNode;if(!n)throw Error(Qe(169));o?(t=TR(t,r,Ml),n.__reactInternalMemoizedMergedChildContext=t,Tr(po),Tr(Un),gr(Un,t)):Tr(po),gr(po,o)}var fa=null,nv=!1,fb=!1;function OR(t){fa===null?fa=[t]:fa.push(t)}function G$(t){nv=!0,OR(t)}function Vs(){if(!fb&&fa!==null){fb=!0;var t=0,r=or;try{var o=fa;for(or=1;t>=s,i-=s,ha=1<<32-bi(r)+i|o<T?(k=S,S=null):k=S.sibling;var A=d(b,S,v[T],w);if(A===null){S===null&&(S=k);break}t&&S&&A.alternate===null&&r(b,S),x=a(A,x,T),E===null?_=A:E.sibling=A,E=A,S=k}if(T===v.length)return o(b,S),Pr&&rl(b,T),_;if(S===null){for(;TT?(k=S,S=null):k=S.sibling;var O=d(b,S,A.value,w);if(O===null){S===null&&(S=k);break}t&&S&&O.alternate===null&&r(b,S),x=a(O,x,T),E===null?_=O:E.sibling=O,E=O,S=k}if(A.done)return o(b,S),Pr&&rl(b,T),_;if(S===null){for(;!A.done;T++,A=v.next())A=f(b,A.value,w),A!==null&&(x=a(A,x,T),E===null?_=A:E.sibling=A,E=A);return Pr&&rl(b,T),_}for(S=n(b,S);!A.done;T++,A=v.next())A=m(S,b,T,A.value,w),A!==null&&(t&&A.alternate!==null&&S.delete(A.key===null?T:A.key),x=a(A,x,T),E===null?_=A:E.sibling=A,E=A);return t&&S.forEach(function(R){return r(b,R)}),Pr&&rl(b,T),_}function g(b,x,v,w){if(typeof v=="object"&&v!==null&&v.type===ju&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Up:e:{for(var _=v.key,E=x;E!==null;){if(E.key===_){if(_=v.type,_===ju){if(E.tag===7){o(b,E.sibling),x=i(E,v.props.children),x.return=b,b=x;break e}}else if(E.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===ts&&uT(_)===E.type){o(b,E.sibling),x=i(E,v.props),x.ref=Fd(b,E,v),x.return=b,b=x;break e}o(b,E);break}else r(b,E);E=E.sibling}v.type===ju?(x=kl(v.props.children,b.mode,w,v.key),x.return=b,b=x):(w=Bm(v.type,v.key,v.props,null,b.mode,w),w.ref=Fd(b,x,v),w.return=b,b=w)}return s(b);case _u:e:{for(E=v.key;x!==null;){if(x.key===E)if(x.tag===4&&x.stateNode.containerInfo===v.containerInfo&&x.stateNode.implementation===v.implementation){o(b,x.sibling),x=i(x,v.children||[]),x.return=b,b=x;break e}else{o(b,x);break}else r(b,x);x=x.sibling}x=xb(v,b.mode,w),x.return=b,b=x}return s(b);case ts:return E=v._init,g(b,x,E(v._payload),w)}if(of(v))return y(b,x,v,w);if(Rd(v))return p(b,x,v,w);Zp(b,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,x!==null&&x.tag===6?(o(b,x.sibling),x=i(x,v),x.return=b,b=x):(o(b,x),x=bb(v,b.mode,w),x.return=b,b=x),s(b)):o(b,x)}return g}var bc=AR(!0),MR=AR(!1),uy=zs(null),cy=null,Au=null,mj=null;function yj(){mj=Au=cy=null}function gj(t){var r=uy.current;Tr(uy),t._currentValue=r}function Y1(t,r,o){for(;t!==null;){var n=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,n!==null&&(n.childLanes|=r)):n!==null&&(n.childLanes&r)!==r&&(n.childLanes|=r),t===o)break;t=t.return}}function Wu(t,r){cy=t,mj=Au=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&r&&(fo=!0),t.firstContext=null)}function Zo(t){var r=t._currentValue;if(mj!==t)if(t={context:t,memoizedValue:r,next:null},Au===null){if(cy===null)throw Error(Qe(308));Au=t,cy.dependencies={lanes:0,firstContext:t}}else Au=Au.next=t;return r}var hl=null;function vj(t){hl===null?hl=[t]:hl.push(t)}function RR(t,r,o,n){var i=r.interleaved;return i===null?(o.next=o,vj(r)):(o.next=i.next,i.next=o),r.interleaved=o,Oa(t,n)}function Oa(t,r){t.lanes|=r;var o=t.alternate;for(o!==null&&(o.lanes|=r),o=t,t=t.return;t!==null;)t.childLanes|=r,o=t.alternate,o!==null&&(o.childLanes|=r),o=t,t=t.return;return o.tag===3?o.stateNode:null}var rs=!1;function bj(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function IR(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function xa(t,r){return{eventTime:t,lane:r,tag:0,payload:null,callback:null,next:null}}function Ts(t,r,o){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,Xt&2){var i=n.pending;return i===null?r.next=r:(r.next=i.next,i.next=r),n.pending=r,Oa(t,o)}return i=n.interleaved,i===null?(r.next=r,vj(n)):(r.next=i.next,i.next=r),n.interleaved=r,Oa(t,o)}function Nm(t,r,o){if(r=r.updateQueue,r!==null&&(r=r.shared,(o&4194240)!==0)){var n=r.lanes;n&=t.pendingLanes,o|=n,r.lanes=o,oj(t,o)}}function cT(t,r){var o=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,o===n)){var i=null,a=null;if(o=o.firstBaseUpdate,o!==null){do{var s={eventTime:o.eventTime,lane:o.lane,tag:o.tag,payload:o.payload,callback:o.callback,next:null};a===null?i=a=s:a=a.next=s,o=o.next}while(o!==null);a===null?i=a=r:a=a.next=r}else i=a=r;o={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,effects:n.effects},t.updateQueue=o;return}t=o.lastBaseUpdate,t===null?o.firstBaseUpdate=r:t.next=r,o.lastBaseUpdate=r}function dy(t,r,o,n){var i=t.updateQueue;rs=!1;var a=i.firstBaseUpdate,s=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var u=l,c=u.next;u.next=null,s===null?a=c:s.next=c,s=u;var h=t.alternate;h!==null&&(h=h.updateQueue,l=h.lastBaseUpdate,l!==s&&(l===null?h.firstBaseUpdate=c:l.next=c,h.lastBaseUpdate=u))}if(a!==null){var f=i.baseState;s=0,h=c=u=null,l=a;do{var d=l.lane,m=l.eventTime;if((n&d)===d){h!==null&&(h=h.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=t,p=l;switch(d=r,m=o,p.tag){case 1:if(y=p.payload,typeof y=="function"){f=y.call(m,f,d);break e}f=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=p.payload,d=typeof y=="function"?y.call(m,f,d):y,d==null)break e;f=Nr({},f,d);break e;case 2:rs=!0}}l.callback!==null&&l.lane!==0&&(t.flags|=64,d=i.effects,d===null?i.effects=[l]:d.push(l))}else m={eventTime:m,lane:d,tag:l.tag,payload:l.payload,callback:l.callback,next:null},h===null?(c=h=m,u=f):h=h.next=m,s|=d;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;d=l,l=d.next,d.next=null,i.lastBaseUpdate=d,i.shared.pending=null}}while(!0);if(h===null&&(u=f),i.baseState=u,i.firstBaseUpdate=c,i.lastBaseUpdate=h,r=i.shared.interleaved,r!==null){i=r;do s|=i.lane,i=i.next;while(i!==r)}else a===null&&(i.shared.lanes=0);Nl|=s,t.lanes=s,t.memoizedState=f}}function dT(t,r,o){if(t=r.effects,r.effects=null,t!==null)for(r=0;ro?o:4,t(!0);var n=pb.transition;pb.transition={};try{t(!1),r()}finally{or=o,pb.transition=n}}function ZR(){return Qo().memoizedState}function X$(t,r,o){var n=ks(t);if(o={lane:n,action:o,hasEagerState:!1,eagerState:null,next:null},QR(t))JR(r,o);else if(o=RR(t,r,o,n),o!==null){var i=eo();xi(o,t,n,i),eI(o,r,n)}}function Y$(t,r,o){var n=ks(t),i={lane:n,action:o,hasEagerState:!1,eagerState:null,next:null};if(QR(t))JR(r,i);else{var a=t.alternate;if(t.lanes===0&&(a===null||a.lanes===0)&&(a=r.lastRenderedReducer,a!==null))try{var s=r.lastRenderedState,l=a(s,o);if(i.hasEagerState=!0,i.eagerState=l,ji(l,s)){var u=r.interleaved;u===null?(i.next=i,vj(r)):(i.next=u.next,u.next=i),r.interleaved=i;return}}catch{}finally{}o=RR(t,r,i,n),o!==null&&(i=eo(),xi(o,t,n,i),eI(o,r,n))}}function QR(t){var r=t.alternate;return t===Ir||r!==null&&r===Ir}function JR(t,r){jf=hy=!0;var o=t.pending;o===null?r.next=r:(r.next=o.next,o.next=r),t.pending=r}function eI(t,r,o){if(o&4194240){var n=r.lanes;n&=t.pendingLanes,o|=n,r.lanes=o,oj(t,o)}}var py={readContext:Zo,useCallback:Mn,useContext:Mn,useEffect:Mn,useImperativeHandle:Mn,useInsertionEffect:Mn,useLayoutEffect:Mn,useMemo:Mn,useReducer:Mn,useRef:Mn,useState:Mn,useDebugValue:Mn,useDeferredValue:Mn,useTransition:Mn,useMutableSource:Mn,useSyncExternalStore:Mn,useId:Mn,unstable_isNewReconciler:!1},K$={readContext:Zo,useCallback:function(t,r){return Ri().memoizedState=[t,r===void 0?null:r],t},useContext:Zo,useEffect:hT,useImperativeHandle:function(t,r,o){return o=o!=null?o.concat([t]):null,Dm(4194308,4,HR.bind(null,r,t),o)},useLayoutEffect:function(t,r){return Dm(4194308,4,t,r)},useInsertionEffect:function(t,r){return Dm(4,2,t,r)},useMemo:function(t,r){var o=Ri();return r=r===void 0?null:r,t=t(),o.memoizedState=[t,r],t},useReducer:function(t,r,o){var n=Ri();return r=o!==void 0?o(r):r,n.memoizedState=n.baseState=r,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},n.queue=t,t=t.dispatch=X$.bind(null,Ir,t),[n.memoizedState,t]},useRef:function(t){var r=Ri();return t={current:t},r.memoizedState=t},useState:fT,useDebugValue:Oj,useDeferredValue:function(t){return Ri().memoizedState=t},useTransition:function(){var t=fT(!1),r=t[0];return t=q$.bind(null,t[1]),Ri().memoizedState=t,[r,t]},useMutableSource:function(){},useSyncExternalStore:function(t,r,o){var n=Ir,i=Ri();if(Pr){if(o===void 0)throw Error(Qe(407));o=o()}else{if(o=r(),gn===null)throw Error(Qe(349));Il&30||FR(n,r,o)}i.memoizedState=o;var a={value:o,getSnapshot:r};return i.queue=a,hT(UR.bind(null,n,a,t),[t]),n.flags|=2048,nh(9,$R.bind(null,n,a,o,r),void 0,null),o},useId:function(){var t=Ri(),r=gn.identifierPrefix;if(Pr){var o=pa,n=ha;o=(n&~(1<<32-bi(n)-1)).toString(32)+o,r=":"+r+"R"+o,o=th++,0<\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=s.createElement(o,{is:n.is}):(t=s.createElement(o),o==="select"&&(s=t,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):t=s.createElementNS(t,o),t[Fi]=r,t[Qf]=n,cI(t,r,!1,!1),r.stateNode=t;e:{switch(s=A1(o,n),o){case"dialog":jr("cancel",t),jr("close",t),i=n;break;case"iframe":case"object":case"embed":jr("load",t),i=n;break;case"video":case"audio":for(i=0;i_c&&(r.flags|=128,n=!0,$d(a,!1),r.lanes=4194304)}else{if(!n)if(t=fy(s),t!==null){if(r.flags|=128,n=!0,o=t.updateQueue,o!==null&&(r.updateQueue=o,r.flags|=4),$d(a,!0),a.tail===null&&a.tailMode==="hidden"&&!s.alternate&&!Pr)return Rn(r),null}else 2*Gr()-a.renderingStartTime>_c&&o!==1073741824&&(r.flags|=128,n=!0,$d(a,!1),r.lanes=4194304);a.isBackwards?(s.sibling=r.child,r.child=s):(o=a.last,o!==null?o.sibling=s:r.child=s,a.last=s)}return a.tail!==null?(r=a.tail,a.rendering=r,a.tail=r.sibling,a.renderingStartTime=Gr(),r.sibling=null,o=Mr.current,gr(Mr,n?o&1|2:o&1),r):(Rn(r),null);case 22:case 23:return Rj(),n=r.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(r.flags|=8192),n&&r.mode&1?So&1073741824&&(Rn(r),r.subtreeFlags&6&&(r.flags|=8192)):Rn(r),null;case 24:return null;case 25:return null}throw Error(Qe(156,r.tag))}function oU(t,r){switch(hj(r),r.tag){case 1:return mo(r.type)&&iy(),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return xc(),Tr(po),Tr(Un),_j(),t=r.flags,t&65536&&!(t&128)?(r.flags=t&-65537|128,r):null;case 5:return wj(r),null;case 13:if(Tr(Mr),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(Qe(340));vc()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return Tr(Mr),null;case 4:return xc(),null;case 10:return gj(r.type._context),null;case 22:case 23:return Rj(),null;case 24:return null;default:return null}}var Jp=!1,Dn=!1,iU=typeof WeakSet=="function"?WeakSet:Set,ut=null;function Mu(t,r){var o=t.ref;if(o!==null)if(typeof o=="function")try{o(null)}catch(n){Ur(t,r,n)}else o.current=null}function ox(t,r,o){try{o()}catch(n){Ur(t,r,n)}}var ST=!1;function aU(t,r){if(B1=ty,t=gR(),dj(t)){if("selectionStart"in t)var o={start:t.selectionStart,end:t.selectionEnd};else e:{o=(o=t.ownerDocument)&&o.defaultView||window;var n=o.getSelection&&o.getSelection();if(n&&n.rangeCount!==0){o=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{o.nodeType,a.nodeType}catch{o=null;break e}var s=0,l=-1,u=-1,c=0,h=0,f=t,d=null;t:for(;;){for(var m;f!==o||i!==0&&f.nodeType!==3||(l=s+i),f!==a||n!==0&&f.nodeType!==3||(u=s+n),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)d=f,f=m;for(;;){if(f===t)break t;if(d===o&&++c===i&&(l=s),d===a&&++h===n&&(u=s),(m=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=m}o=l===-1||u===-1?null:{start:l,end:u}}else o=null}o=o||{start:0,end:0}}else o=null;for(z1={focusedElem:t,selectionRange:o},ty=!1,ut=r;ut!==null;)if(r=ut,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,ut=t;else for(;ut!==null;){r=ut;try{var y=r.alternate;if(r.flags&1024)switch(r.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var p=y.memoizedProps,g=y.memoizedState,b=r.stateNode,x=b.getSnapshotBeforeUpdate(r.elementType===r.type?p:li(r.type,p),g);b.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var v=r.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Qe(163))}}catch(w){Ur(r,r.return,w)}if(t=r.sibling,t!==null){t.return=r.return,ut=t;break}ut=r.return}return y=ST,ST=!1,y}function Sf(t,r,o){var n=r.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var a=i.destroy;i.destroy=void 0,a!==void 0&&ox(r,o,a)}i=i.next}while(i!==n)}}function av(t,r){if(r=r.updateQueue,r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&t)===t){var n=o.create;o.destroy=n()}o=o.next}while(o!==r)}}function ix(t){var r=t.ref;if(r!==null){var o=t.stateNode;switch(t.tag){case 5:t=o;break;default:t=o}typeof r=="function"?r(t):r.current=t}}function hI(t){var r=t.alternate;r!==null&&(t.alternate=null,hI(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&(delete r[Fi],delete r[Qf],delete r[W1],delete r[z$],delete r[V$])),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 pI(t){return t.tag===5||t.tag===3||t.tag===4}function ET(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||pI(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 ax(t,r,o){var n=t.tag;if(n===5||n===6)t=t.stateNode,r?o.nodeType===8?o.parentNode.insertBefore(t,r):o.insertBefore(t,r):(o.nodeType===8?(r=o.parentNode,r.insertBefore(t,o)):(r=o,r.appendChild(t)),o=o._reactRootContainer,o!=null||r.onclick!==null||(r.onclick=oy));else if(n!==4&&(t=t.child,t!==null))for(ax(t,r,o),t=t.sibling;t!==null;)ax(t,r,o),t=t.sibling}function sx(t,r,o){var n=t.tag;if(n===5||n===6)t=t.stateNode,r?o.insertBefore(t,r):o.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(sx(t,r,o),t=t.sibling;t!==null;)sx(t,r,o),t=t.sibling}var jn=null,ci=!1;function Xa(t,r,o){for(o=o.child;o!==null;)mI(t,r,o),o=o.sibling}function mI(t,r,o){if(zi&&typeof zi.onCommitFiberUnmount=="function")try{zi.onCommitFiberUnmount(Qg,o)}catch{}switch(o.tag){case 5:Dn||Mu(o,r);case 6:var n=jn,i=ci;jn=null,Xa(t,r,o),jn=n,ci=i,jn!==null&&(ci?(t=jn,o=o.stateNode,t.nodeType===8?t.parentNode.removeChild(o):t.removeChild(o)):jn.removeChild(o.stateNode));break;case 18:jn!==null&&(ci?(t=jn,o=o.stateNode,t.nodeType===8?db(t.parentNode,o):t.nodeType===1&&db(t,o),qf(t)):db(jn,o.stateNode));break;case 4:n=jn,i=ci,jn=o.stateNode.containerInfo,ci=!0,Xa(t,r,o),jn=n,ci=i;break;case 0:case 11:case 14:case 15:if(!Dn&&(n=o.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,s=a.destroy;a=a.tag,s!==void 0&&(a&2||a&4)&&ox(o,r,s),i=i.next}while(i!==n)}Xa(t,r,o);break;case 1:if(!Dn&&(Mu(o,r),n=o.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=o.memoizedProps,n.state=o.memoizedState,n.componentWillUnmount()}catch(l){Ur(o,r,l)}Xa(t,r,o);break;case 21:Xa(t,r,o);break;case 22:o.mode&1?(Dn=(n=Dn)||o.memoizedState!==null,Xa(t,r,o),Dn=n):Xa(t,r,o);break;default:Xa(t,r,o)}}function TT(t){var r=t.updateQueue;if(r!==null){t.updateQueue=null;var o=t.stateNode;o===null&&(o=t.stateNode=new iU),r.forEach(function(n){var i=mU.bind(null,t,n);o.has(n)||(o.add(n),n.then(i,i))})}}function ii(t,r){var o=r.deletions;if(o!==null)for(var n=0;ni&&(i=s),n&=~a}if(n=i,n=Gr()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*lU(n/1960))-n,10t?16:t,bs===null)var n=!1;else{if(t=bs,bs=null,gy=0,Xt&6)throw Error(Qe(331));var i=Xt;for(Xt|=4,ut=t.current;ut!==null;){var a=ut,s=a.child;if(ut.flags&16){var l=a.deletions;if(l!==null){for(var u=0;uGr()-Aj?Ol(t,0):Cj|=o),yo(t,r)}function jI(t,r){r===0&&(t.mode&1?(r=Gp,Gp<<=1,!(Gp&130023424)&&(Gp=4194304)):r=1);var o=eo();t=Oa(t,r),t!==null&&(ap(t,r,o),yo(t,o))}function pU(t){var r=t.memoizedState,o=0;r!==null&&(o=r.retryLane),jI(t,o)}function mU(t,r){var o=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(o=i.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(Qe(314))}n!==null&&n.delete(r),jI(t,o)}var SI;SI=function(t,r,o){if(t!==null)if(t.memoizedProps!==r.pendingProps||po.current)fo=!0;else{if(!(t.lanes&o)&&!(r.flags&128))return fo=!1,rU(t,r,o);fo=!!(t.flags&131072)}else fo=!1,Pr&&r.flags&1048576&&kR(r,ly,r.index);switch(r.lanes=0,r.tag){case 2:var n=r.type;Fm(t,r),t=r.pendingProps;var i=gc(r,Un.current);Wu(r,o),i=Sj(null,r,n,t,i,o);var a=Ej();return r.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(r.tag=1,r.memoizedState=null,r.updateQueue=null,mo(n)?(a=!0,ay(r)):a=!1,r.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,bj(r),i.updater=iv,r.stateNode=i,i._reactInternals=r,Z1(r,n,t,o),r=ex(null,r,n,!0,a,o)):(r.tag=0,Pr&&a&&fj(r),Xn(null,r,i,o),r=r.child),r;case 16:n=r.elementType;e:{switch(Fm(t,r),t=r.pendingProps,i=n._init,n=i(n._payload),r.type=n,i=r.tag=gU(n),t=li(n,t),i){case 0:r=J1(null,r,n,t,o);break e;case 1:r=wT(null,r,n,t,o);break e;case 11:r=bT(null,r,n,t,o);break e;case 14:r=xT(null,r,n,li(n.type,t),o);break e}throw Error(Qe(306,n,""))}return r;case 0:return n=r.type,i=r.pendingProps,i=r.elementType===n?i:li(n,i),J1(t,r,n,i,o);case 1:return n=r.type,i=r.pendingProps,i=r.elementType===n?i:li(n,i),wT(t,r,n,i,o);case 3:e:{if(sI(r),t===null)throw Error(Qe(387));n=r.pendingProps,a=r.memoizedState,i=a.element,IR(t,r),dy(r,n,null,o);var s=r.memoizedState;if(n=s.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},r.updateQueue.baseState=a,r.memoizedState=a,r.flags&256){i=wc(Error(Qe(423)),r),r=_T(t,r,n,o,i);break e}else if(n!==i){i=wc(Error(Qe(424)),r),r=_T(t,r,n,o,i);break e}else for(ko=Es(r.stateNode.containerInfo.firstChild),Po=r,Pr=!0,pi=null,o=MR(r,null,n,o),r.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(vc(),n===i){r=ka(t,r,o);break e}Xn(t,r,n,o)}r=r.child}return r;case 5:return NR(r),t===null&&X1(r),n=r.type,i=r.pendingProps,a=t!==null?t.memoizedProps:null,s=i.children,V1(n,i)?s=null:a!==null&&V1(n,a)&&(r.flags|=32),aI(t,r),Xn(t,r,s,o),r.child;case 6:return t===null&&X1(r),null;case 13:return lI(t,r,o);case 4:return xj(r,r.stateNode.containerInfo),n=r.pendingProps,t===null?r.child=bc(r,null,n,o):Xn(t,r,n,o),r.child;case 11:return n=r.type,i=r.pendingProps,i=r.elementType===n?i:li(n,i),bT(t,r,n,i,o);case 7:return Xn(t,r,r.pendingProps,o),r.child;case 8:return Xn(t,r,r.pendingProps.children,o),r.child;case 12:return Xn(t,r,r.pendingProps.children,o),r.child;case 10:e:{if(n=r.type._context,i=r.pendingProps,a=r.memoizedProps,s=i.value,gr(uy,n._currentValue),n._currentValue=s,a!==null)if(ji(a.value,s)){if(a.children===i.children&&!po.current){r=ka(t,r,o);break e}}else for(a=r.child,a!==null&&(a.return=r);a!==null;){var l=a.dependencies;if(l!==null){s=a.child;for(var u=l.firstContext;u!==null;){if(u.context===n){if(a.tag===1){u=xa(-1,o&-o),u.tag=2;var c=a.updateQueue;if(c!==null){c=c.shared;var h=c.pending;h===null?u.next=u:(u.next=h.next,h.next=u),c.pending=u}}a.lanes|=o,u=a.alternate,u!==null&&(u.lanes|=o),Y1(a.return,o,r),l.lanes|=o;break}u=u.next}}else if(a.tag===10)s=a.type===r.type?null:a.child;else if(a.tag===18){if(s=a.return,s===null)throw Error(Qe(341));s.lanes|=o,l=s.alternate,l!==null&&(l.lanes|=o),Y1(s,o,r),s=a.sibling}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===r){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}Xn(t,r,i.children,o),r=r.child}return r;case 9:return i=r.type,n=r.pendingProps.children,Wu(r,o),i=Zo(i),n=n(i),r.flags|=1,Xn(t,r,n,o),r.child;case 14:return n=r.type,i=li(n,r.pendingProps),i=li(n.type,i),xT(t,r,n,i,o);case 15:return oI(t,r,r.type,r.pendingProps,o);case 17:return n=r.type,i=r.pendingProps,i=r.elementType===n?i:li(n,i),Fm(t,r),r.tag=1,mo(n)?(t=!0,ay(r)):t=!1,Wu(r,o),tI(r,n,i),Z1(r,n,i,o),ex(null,r,n,!0,t,o);case 19:return uI(t,r,o);case 22:return iI(t,r,o)}throw Error(Qe(156,r.tag))};function EI(t,r){return QM(t,r)}function yU(t,r,o,n){this.tag=t,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ho(t,r,o,n){return new yU(t,r,o,n)}function Nj(t){return t=t.prototype,!(!t||!t.isReactComponent)}function gU(t){if(typeof t=="function")return Nj(t)?1:0;if(t!=null){if(t=t.$$typeof,t===ej)return 11;if(t===tj)return 14}return 2}function Ps(t,r){var o=t.alternate;return o===null?(o=Ho(t.tag,r,t.key,t.mode),o.elementType=t.elementType,o.type=t.type,o.stateNode=t.stateNode,o.alternate=t,t.alternate=o):(o.pendingProps=r,o.type=t.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=t.flags&14680064,o.childLanes=t.childLanes,o.lanes=t.lanes,o.child=t.child,o.memoizedProps=t.memoizedProps,o.memoizedState=t.memoizedState,o.updateQueue=t.updateQueue,r=t.dependencies,o.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},o.sibling=t.sibling,o.index=t.index,o.ref=t.ref,o}function Bm(t,r,o,n,i,a){var s=2;if(n=t,typeof t=="function")Nj(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case ju:return kl(o.children,i,a,r);case J_:s=8,i|=8;break;case w1:return t=Ho(12,o,r,i|2),t.elementType=w1,t.lanes=a,t;case _1:return t=Ho(13,o,r,i),t.elementType=_1,t.lanes=a,t;case j1:return t=Ho(19,o,r,i),t.elementType=j1,t.lanes=a,t;case NM:return lv(o,i,a,r);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case RM:s=10;break e;case IM:s=9;break e;case ej:s=11;break e;case tj:s=14;break e;case ts:s=16,n=null;break e}throw Error(Qe(130,t==null?t:typeof t,""))}return r=Ho(s,o,r,i),r.elementType=t,r.type=n,r.lanes=a,r}function kl(t,r,o,n){return t=Ho(7,t,n,r),t.lanes=o,t}function lv(t,r,o,n){return t=Ho(22,t,n,r),t.elementType=NM,t.lanes=o,t.stateNode={isHidden:!1},t}function bb(t,r,o){return t=Ho(6,t,null,r),t.lanes=o,t}function xb(t,r,o){return r=Ho(4,t.children!==null?t.children:[],t.key,r),r.lanes=o,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}function vU(t,r,o,n,i){this.tag=r,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=eb(0),this.expirationTimes=eb(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=eb(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Lj(t,r,o,n,i,a,s,l,u){return t=new vU(t,r,o,l,u),r===1?(r=1,a===!0&&(r|=8)):r=0,a=Ho(3,null,null,r),t.current=a,a.stateNode=t,a.memoizedState={element:n,isDehydrated:o,cache:null,transitions:null,pendingSuspenseBoundaries:null},bj(a),t}function bU(t,r,o){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(PI)}catch(t){console.error(t)}}PI(),PM.exports=Io;var Ql=PM.exports;const CI=Kt(Ql);var AI,IT=Ql;AI=IT.createRoot,IT.hydrateRoot;const SU=1,EU=1e6;let wb=0;function TU(){return wb=(wb+1)%Number.MAX_SAFE_INTEGER,wb.toString()}const _b=new Map,NT=t=>{if(_b.has(t))return;const r=setTimeout(()=>{_b.delete(t),Of({type:"REMOVE_TOAST",toastId:t})},EU);_b.set(t,r)},OU=(t,r)=>{switch(r.type){case"ADD_TOAST":return{...t,toasts:[r.toast,...t.toasts].slice(0,SU)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(o=>o.id===r.toast.id?{...o,...r.toast}:o)};case"DISMISS_TOAST":{const{toastId:o}=r;return o?NT(o):t.toasts.forEach(n=>{NT(n.id)}),{...t,toasts:t.toasts.map(n=>n.id===o||o===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return r.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(o=>o.id!==r.toastId)}}},zm=[];let Vm={toasts:[]};function Of(t){Vm=OU(Vm,t),zm.forEach(r=>{r(Vm)})}function kU({...t}){const r=TU(),o=i=>Of({type:"UPDATE_TOAST",toast:{...i,id:r}}),n=()=>Of({type:"DISMISS_TOAST",toastId:r});return Of({type:"ADD_TOAST",toast:{...t,id:r,open:!0,onOpenChange:i=>{i||n()}}}),{id:r,dismiss:n,update:o}}function Fa(){const[t,r]=q.useState(Vm);return q.useEffect(()=>(zm.push(r),()=>{const o=zm.indexOf(r);o>-1&&zm.splice(o,1)}),[t]),{...t,toast:kU,dismiss:o=>Of({type:"DISMISS_TOAST",toastId:o})}}function It(t,r,{checkForDefaultPrevented:o=!0}={}){return function(i){if(t==null||t(i),o===!1||!i.defaultPrevented)return r==null?void 0:r(i)}}function PU(t,r){typeof t=="function"?t(r):t!=null&&(t.current=r)}function MI(...t){return r=>t.forEach(o=>PU(o,r))}function Or(...t){return q.useCallback(MI(...t),t)}function CU(t,r=[]){let o=[];function n(a,s){const l=q.createContext(s),u=o.length;o=[...o,s];function c(f){const{scope:d,children:m,...y}=f,p=(d==null?void 0:d[t][u])||l,g=q.useMemo(()=>y,Object.values(y));return D.jsx(p.Provider,{value:g,children:m})}function h(f,d){const m=(d==null?void 0:d[t][u])||l,y=q.useContext(m);if(y)return y;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${a}\``)}return c.displayName=a+"Provider",[c,h]}const i=()=>{const a=o.map(s=>q.createContext(s));return function(l){const u=(l==null?void 0:l[t])||a;return q.useMemo(()=>({[`__scope${t}`]:{...l,[t]:u}}),[l,u])}};return i.scopeName=t,[n,AU(i,...r)]}function AU(...t){const r=t[0];if(t.length===1)return r;const o=()=>{const n=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const s=n.reduce((l,{useScope:u,scopeName:c})=>{const f=u(a)[`__scope${c}`];return{...l,...f}},{});return q.useMemo(()=>({[`__scope${r.scopeName}`]:s}),[s])}};return o.scopeName=r.scopeName,o}var Dl=q.forwardRef((t,r)=>{const{children:o,...n}=t,i=q.Children.toArray(o),a=i.find(MU);if(a){const s=a.props.children,l=i.map(u=>u===a?q.Children.count(s)>1?q.Children.only(null):q.isValidElement(s)?s.props.children:null:u);return D.jsx(fx,{...n,ref:r,children:q.isValidElement(s)?q.cloneElement(s,void 0,l):null})}return D.jsx(fx,{...n,ref:r,children:o})});Dl.displayName="Slot";var fx=q.forwardRef((t,r)=>{const{children:o,...n}=t;if(q.isValidElement(o)){const i=IU(o);return q.cloneElement(o,{...RU(n,o.props),ref:r?MI(r,i):i})}return q.Children.count(o)>1?q.Children.only(null):null});fx.displayName="SlotClone";var RI=({children:t})=>D.jsx(D.Fragment,{children:t});function MU(t){return q.isValidElement(t)&&t.type===RI}function RU(t,r){const o={...r};for(const n in r){const i=t[n],a=r[n];/^on[A-Z]/.test(n)?i&&a?o[n]=(...l)=>{a(...l),i(...l)}:i&&(o[n]=i):n==="style"?o[n]={...i,...a}:n==="className"&&(o[n]=[i,a].filter(Boolean).join(" "))}return{...t,...o}}function IU(t){var n,i;let r=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning;return o?t.ref:(r=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o?t.props.ref:t.props.ref||t.ref)}function Uj(t){const r=t+"CollectionProvider",[o,n]=CU(r),[i,a]=o(r,{collectionRef:{current:null},itemMap:new Map}),s=m=>{const{scope:y,children:p}=m,g=me.useRef(null),b=me.useRef(new Map).current;return D.jsx(i,{scope:y,itemMap:b,collectionRef:g,children:p})};s.displayName=r;const l=t+"CollectionSlot",u=me.forwardRef((m,y)=>{const{scope:p,children:g}=m,b=a(l,p),x=Or(y,b.collectionRef);return D.jsx(Dl,{ref:x,children:g})});u.displayName=l;const c=t+"CollectionItemSlot",h="data-radix-collection-item",f=me.forwardRef((m,y)=>{const{scope:p,children:g,...b}=m,x=me.useRef(null),v=Or(y,x),w=a(c,p);return me.useEffect(()=>(w.itemMap.set(x,{ref:x,...b}),()=>void w.itemMap.delete(x))),D.jsx(Dl,{[h]:"",ref:v,children:g})});f.displayName=c;function d(m){const y=a(t+"CollectionConsumer",m);return me.useCallback(()=>{const g=y.collectionRef.current;if(!g)return[];const b=Array.from(g.querySelectorAll(`[${h}]`));return Array.from(y.itemMap.values()).sort((w,_)=>b.indexOf(w.ref.current)-b.indexOf(_.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:s,Slot:u,ItemSlot:f},d,n]}function nd(t,r=[]){let o=[];function n(a,s){const l=q.createContext(s),u=o.length;o=[...o,s];const c=f=>{var b;const{scope:d,children:m,...y}=f,p=((b=d==null?void 0:d[t])==null?void 0:b[u])||l,g=q.useMemo(()=>y,Object.values(y));return D.jsx(p.Provider,{value:g,children:m})};c.displayName=a+"Provider";function h(f,d){var p;const m=((p=d==null?void 0:d[t])==null?void 0:p[u])||l,y=q.useContext(m);if(y)return y;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${a}\``)}return[c,h]}const i=()=>{const a=o.map(s=>q.createContext(s));return function(l){const u=(l==null?void 0:l[t])||a;return q.useMemo(()=>({[`__scope${t}`]:{...l,[t]:u}}),[l,u])}};return i.scopeName=t,[n,NU(i,...r)]}function NU(...t){const r=t[0];if(t.length===1)return r;const o=()=>{const n=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const s=n.reduce((l,{useScope:u,scopeName:c})=>{const f=u(a)[`__scope${c}`];return{...l,...f}},{});return q.useMemo(()=>({[`__scope${r.scopeName}`]:s}),[s])}};return o.scopeName=r.scopeName,o}var LU=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Gt=LU.reduce((t,r)=>{const o=q.forwardRef((n,i)=>{const{asChild:a,...s}=n,l=a?Dl:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),D.jsx(l,{...s,ref:i})});return o.displayName=`Primitive.${r}`,{...t,[r]:o}},{});function II(t,r){t&&Ql.flushSync(()=>t.dispatchEvent(r))}function Ro(t){const r=q.useRef(t);return q.useEffect(()=>{r.current=t}),q.useMemo(()=>(...o)=>{var n;return(n=r.current)==null?void 0:n.call(r,...o)},[])}function DU(t,r=globalThis==null?void 0:globalThis.document){const o=Ro(t);q.useEffect(()=>{const n=i=>{i.key==="Escape"&&o(i)};return r.addEventListener("keydown",n,{capture:!0}),()=>r.removeEventListener("keydown",n,{capture:!0})},[o,r])}var FU="DismissableLayer",hx="dismissableLayer.update",$U="dismissableLayer.pointerDownOutside",UU="dismissableLayer.focusOutside",LT,NI=q.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),hv=q.forwardRef((t,r)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...u}=t,c=q.useContext(NI),[h,f]=q.useState(null),d=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=q.useState({}),y=Or(r,S=>f(S)),p=Array.from(c.layers),[g]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),b=p.indexOf(g),x=h?p.indexOf(h):-1,v=c.layersWithOutsidePointerEventsDisabled.size>0,w=x>=b,_=zU(S=>{const T=S.target,k=[...c.branches].some(A=>A.contains(T));!w||k||(i==null||i(S),s==null||s(S),S.defaultPrevented||l==null||l())},d),E=VU(S=>{const T=S.target;[...c.branches].some(A=>A.contains(T))||(a==null||a(S),s==null||s(S),S.defaultPrevented||l==null||l())},d);return DU(S=>{x===c.layers.size-1&&(n==null||n(S),!S.defaultPrevented&&l&&(S.preventDefault(),l()))},d),q.useEffect(()=>{if(h)return o&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(LT=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(h)),c.layers.add(h),DT(),()=>{o&&c.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=LT)}},[h,d,o,c]),q.useEffect(()=>()=>{h&&(c.layers.delete(h),c.layersWithOutsidePointerEventsDisabled.delete(h),DT())},[h,c]),q.useEffect(()=>{const S=()=>m({});return document.addEventListener(hx,S),()=>document.removeEventListener(hx,S)},[]),D.jsx(Gt.div,{...u,ref:y,style:{pointerEvents:v?w?"auto":"none":void 0,...t.style},onFocusCapture:It(t.onFocusCapture,E.onFocusCapture),onBlurCapture:It(t.onBlurCapture,E.onBlurCapture),onPointerDownCapture:It(t.onPointerDownCapture,_.onPointerDownCapture)})});hv.displayName=FU;var BU="DismissableLayerBranch",LI=q.forwardRef((t,r)=>{const o=q.useContext(NI),n=q.useRef(null),i=Or(r,n);return q.useEffect(()=>{const a=n.current;if(a)return o.branches.add(a),()=>{o.branches.delete(a)}},[o.branches]),D.jsx(Gt.div,{...t,ref:i})});LI.displayName=BU;function zU(t,r=globalThis==null?void 0:globalThis.document){const o=Ro(t),n=q.useRef(!1),i=q.useRef(()=>{});return q.useEffect(()=>{const a=l=>{if(l.target&&!n.current){let u=function(){DI($U,o,c,{discrete:!0})};const c={originalEvent:l};l.pointerType==="touch"?(r.removeEventListener("click",i.current),i.current=u,r.addEventListener("click",i.current,{once:!0})):u()}else r.removeEventListener("click",i.current);n.current=!1},s=window.setTimeout(()=>{r.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(s),r.removeEventListener("pointerdown",a),r.removeEventListener("click",i.current)}},[r,o]),{onPointerDownCapture:()=>n.current=!0}}function VU(t,r=globalThis==null?void 0:globalThis.document){const o=Ro(t),n=q.useRef(!1);return q.useEffect(()=>{const i=a=>{a.target&&!n.current&&DI(UU,o,{originalEvent:a},{discrete:!1})};return r.addEventListener("focusin",i),()=>r.removeEventListener("focusin",i)},[r,o]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function DT(){const t=new CustomEvent(hx);document.dispatchEvent(t)}function DI(t,r,o,{discrete:n}){const i=o.originalEvent.target,a=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:o});r&&i.addEventListener(t,r,{once:!0}),n?II(i,a):i.dispatchEvent(a)}var GU=hv,WU=LI,On=globalThis!=null&&globalThis.document?q.useLayoutEffect:()=>{},HU="Portal",Bj=q.forwardRef((t,r)=>{var l;const{container:o,...n}=t,[i,a]=q.useState(!1);On(()=>a(!0),[]);const s=o||i&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return s?CI.createPortal(D.jsx(Gt.div,{...n,ref:r}),s):null});Bj.displayName=HU;function qU(t,r){return q.useReducer((o,n)=>r[o][n]??o,t)}var cp=t=>{const{present:r,children:o}=t,n=XU(r),i=typeof o=="function"?o({present:n.isPresent}):q.Children.only(o),a=Or(n.ref,YU(i));return typeof o=="function"||n.isPresent?q.cloneElement(i,{ref:a}):null};cp.displayName="Presence";function XU(t){const[r,o]=q.useState(),n=q.useRef({}),i=q.useRef(t),a=q.useRef("none"),s=t?"mounted":"unmounted",[l,u]=qU(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return q.useEffect(()=>{const c=rm(n.current);a.current=l==="mounted"?c:"none"},[l]),On(()=>{const c=n.current,h=i.current;if(h!==t){const d=a.current,m=rm(c);t?u("MOUNT"):m==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(h&&d!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,u]),On(()=>{if(r){let c;const h=r.ownerDocument.defaultView??window,f=m=>{const p=rm(n.current).includes(m.animationName);if(m.target===r&&p&&(u("ANIMATION_END"),!i.current)){const g=r.style.animationFillMode;r.style.animationFillMode="forwards",c=h.setTimeout(()=>{r.style.animationFillMode==="forwards"&&(r.style.animationFillMode=g)})}},d=m=>{m.target===r&&(a.current=rm(n.current))};return r.addEventListener("animationstart",d),r.addEventListener("animationcancel",f),r.addEventListener("animationend",f),()=>{h.clearTimeout(c),r.removeEventListener("animationstart",d),r.removeEventListener("animationcancel",f),r.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[r,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:q.useCallback(c=>{c&&(n.current=getComputedStyle(c)),o(c)},[])}}function rm(t){return(t==null?void 0:t.animationName)||"none"}function YU(t){var n,i;let r=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning;return o?t.ref:(r=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o?t.props.ref:t.props.ref||t.ref)}function Fl({prop:t,defaultProp:r,onChange:o=()=>{}}){const[n,i]=KU({defaultProp:r,onChange:o}),a=t!==void 0,s=a?t:n,l=Ro(o),u=q.useCallback(c=>{if(a){const f=typeof c=="function"?c(t):c;f!==t&&l(f)}else i(c)},[a,t,i,l]);return[s,u]}function KU({defaultProp:t,onChange:r}){const o=q.useState(t),[n]=o,i=q.useRef(n),a=Ro(r);return q.useEffect(()=>{i.current!==n&&(a(n),i.current=n)},[n,i,a]),o}var ZU="VisuallyHidden",dp=q.forwardRef((t,r)=>D.jsx(Gt.span,{...t,ref:r,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}));dp.displayName=ZU;var QU=dp,zj="ToastProvider",[Vj,JU,eB]=Uj("Toast"),[FI,S_e]=nd("Toast",[eB]),[tB,pv]=FI(zj),$I=t=>{const{__scopeToast:r,label:o="Notification",duration:n=5e3,swipeDirection:i="right",swipeThreshold:a=50,children:s}=t,[l,u]=q.useState(null),[c,h]=q.useState(0),f=q.useRef(!1),d=q.useRef(!1);return o.trim()||console.error(`Invalid prop \`label\` supplied to \`${zj}\`. Expected non-empty \`string\`.`),D.jsx(Vj.Provider,{scope:r,children:D.jsx(tB,{scope:r,label:o,duration:n,swipeDirection:i,swipeThreshold:a,toastCount:c,viewport:l,onViewportChange:u,onToastAdd:q.useCallback(()=>h(m=>m+1),[]),onToastRemove:q.useCallback(()=>h(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:d,children:s})})};$I.displayName=zj;var UI="ToastViewport",rB=["F8"],px="toast.viewportPause",mx="toast.viewportResume",BI=q.forwardRef((t,r)=>{const{__scopeToast:o,hotkey:n=rB,label:i="Notifications ({hotkey})",...a}=t,s=pv(UI,o),l=JU(o),u=q.useRef(null),c=q.useRef(null),h=q.useRef(null),f=q.useRef(null),d=Or(r,f,s.onViewportChange),m=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=s.toastCount>0;q.useEffect(()=>{const g=b=>{var v;n.length!==0&&n.every(w=>b[w]||b.code===w)&&((v=f.current)==null||v.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[n]),q.useEffect(()=>{const g=u.current,b=f.current;if(y&&g&&b){const x=()=>{if(!s.isClosePausedRef.current){const E=new CustomEvent(px);b.dispatchEvent(E),s.isClosePausedRef.current=!0}},v=()=>{if(s.isClosePausedRef.current){const E=new CustomEvent(mx);b.dispatchEvent(E),s.isClosePausedRef.current=!1}},w=E=>{!g.contains(E.relatedTarget)&&v()},_=()=>{g.contains(document.activeElement)||v()};return g.addEventListener("focusin",x),g.addEventListener("focusout",w),g.addEventListener("pointermove",x),g.addEventListener("pointerleave",_),window.addEventListener("blur",x),window.addEventListener("focus",v),()=>{g.removeEventListener("focusin",x),g.removeEventListener("focusout",w),g.removeEventListener("pointermove",x),g.removeEventListener("pointerleave",_),window.removeEventListener("blur",x),window.removeEventListener("focus",v)}}},[y,s.isClosePausedRef]);const p=q.useCallback(({tabbingDirection:g})=>{const x=l().map(v=>{const w=v.ref.current,_=[w,...mB(w)];return g==="forwards"?_:_.reverse()});return(g==="forwards"?x.reverse():x).flat()},[l]);return q.useEffect(()=>{const g=f.current;if(g){const b=x=>{var _,E,S;const v=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!v){const T=document.activeElement,k=x.shiftKey;if(x.target===g&&k){(_=c.current)==null||_.focus();return}const R=p({tabbingDirection:k?"backwards":"forwards"}),C=R.findIndex(L=>L===T);jb(R.slice(C+1))?x.preventDefault():k?(E=c.current)==null||E.focus():(S=h.current)==null||S.focus()}};return g.addEventListener("keydown",b),()=>g.removeEventListener("keydown",b)}},[l,p]),D.jsxs(WU,{ref:u,role:"region","aria-label":i.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&D.jsx(yx,{ref:c,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"forwards"});jb(g)}}),D.jsx(Vj.Slot,{scope:o,children:D.jsx(Gt.ol,{tabIndex:-1,...a,ref:d})}),y&&D.jsx(yx,{ref:h,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"backwards"});jb(g)}})]})});BI.displayName=UI;var zI="ToastFocusProxy",yx=q.forwardRef((t,r)=>{const{__scopeToast:o,onFocusFromOutsideViewport:n,...i}=t,a=pv(zI,o);return D.jsx(dp,{"aria-hidden":!0,tabIndex:0,...i,ref:r,style:{position:"fixed"},onFocus:s=>{var c;const l=s.relatedTarget;!((c=a.viewport)!=null&&c.contains(l))&&n()}})});yx.displayName=zI;var mv="Toast",nB="toast.swipeStart",oB="toast.swipeMove",iB="toast.swipeCancel",aB="toast.swipeEnd",VI=q.forwardRef((t,r)=>{const{forceMount:o,open:n,defaultOpen:i,onOpenChange:a,...s}=t,[l=!0,u]=Fl({prop:n,defaultProp:i,onChange:a});return D.jsx(cp,{present:o||l,children:D.jsx(uB,{open:l,...s,ref:r,onClose:()=>u(!1),onPause:Ro(t.onPause),onResume:Ro(t.onResume),onSwipeStart:It(t.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:It(t.onSwipeMove,c=>{const{x:h,y:f}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${h}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:It(t.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:It(t.onSwipeEnd,c=>{const{x:h,y:f}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${h}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),u(!1)})})})});VI.displayName=mv;var[sB,lB]=FI(mv,{onClose(){}}),uB=q.forwardRef((t,r)=>{const{__scopeToast:o,type:n="foreground",duration:i,open:a,onClose:s,onEscapeKeyDown:l,onPause:u,onResume:c,onSwipeStart:h,onSwipeMove:f,onSwipeCancel:d,onSwipeEnd:m,...y}=t,p=pv(mv,o),[g,b]=q.useState(null),x=Or(r,L=>b(L)),v=q.useRef(null),w=q.useRef(null),_=i||p.duration,E=q.useRef(0),S=q.useRef(_),T=q.useRef(0),{onToastAdd:k,onToastRemove:A}=p,O=Ro(()=>{var F;(g==null?void 0:g.contains(document.activeElement))&&((F=p.viewport)==null||F.focus()),s()}),R=q.useCallback(L=>{!L||L===1/0||(window.clearTimeout(T.current),E.current=new Date().getTime(),T.current=window.setTimeout(O,L))},[O]);q.useEffect(()=>{const L=p.viewport;if(L){const F=()=>{R(S.current),c==null||c()},z=()=>{const W=new Date().getTime()-E.current;S.current=S.current-W,window.clearTimeout(T.current),u==null||u()};return L.addEventListener(px,z),L.addEventListener(mx,F),()=>{L.removeEventListener(px,z),L.removeEventListener(mx,F)}}},[p.viewport,_,u,c,R]),q.useEffect(()=>{a&&!p.isClosePausedRef.current&&R(_)},[a,_,p.isClosePausedRef,R]),q.useEffect(()=>(k(),()=>A()),[k,A]);const C=q.useMemo(()=>g?KI(g):null,[g]);return p.viewport?D.jsxs(D.Fragment,{children:[C&&D.jsx(cB,{__scopeToast:o,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:C}),D.jsx(sB,{scope:o,onClose:O,children:Ql.createPortal(D.jsx(Vj.ItemSlot,{scope:o,children:D.jsx(GU,{asChild:!0,onEscapeKeyDown:It(l,()=>{p.isFocusedToastEscapeKeyDownRef.current||O(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:D.jsx(Gt.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":p.swipeDirection,...y,ref:x,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:It(t.onKeyDown,L=>{L.key==="Escape"&&(l==null||l(L.nativeEvent),L.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,O()))}),onPointerDown:It(t.onPointerDown,L=>{L.button===0&&(v.current={x:L.clientX,y:L.clientY})}),onPointerMove:It(t.onPointerMove,L=>{if(!v.current)return;const F=L.clientX-v.current.x,z=L.clientY-v.current.y,W=!!w.current,$=["left","right"].includes(p.swipeDirection),G=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,K=$?G(0,F):0,Z=$?0:G(0,z),U=L.pointerType==="touch"?10:2,I={x:K,y:Z},B={originalEvent:L,delta:I};W?(w.current=I,nm(oB,f,B,{discrete:!1})):FT(I,p.swipeDirection,U)?(w.current=I,nm(nB,h,B,{discrete:!1}),L.target.setPointerCapture(L.pointerId)):(Math.abs(F)>U||Math.abs(z)>U)&&(v.current=null)}),onPointerUp:It(t.onPointerUp,L=>{const F=w.current,z=L.target;if(z.hasPointerCapture(L.pointerId)&&z.releasePointerCapture(L.pointerId),w.current=null,v.current=null,F){const W=L.currentTarget,$={originalEvent:L,delta:F};FT(F,p.swipeDirection,p.swipeThreshold)?nm(aB,m,$,{discrete:!0}):nm(iB,d,$,{discrete:!0}),W.addEventListener("click",G=>G.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),cB=t=>{const{__scopeToast:r,children:o,...n}=t,i=pv(mv,r),[a,s]=q.useState(!1),[l,u]=q.useState(!1);return hB(()=>s(!0)),q.useEffect(()=>{const c=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(c)},[]),l?null:D.jsx(Bj,{asChild:!0,children:D.jsx(dp,{...n,children:a&&D.jsxs(D.Fragment,{children:[i.label," ",o]})})})},dB="ToastTitle",GI=q.forwardRef((t,r)=>{const{__scopeToast:o,...n}=t;return D.jsx(Gt.div,{...n,ref:r})});GI.displayName=dB;var fB="ToastDescription",WI=q.forwardRef((t,r)=>{const{__scopeToast:o,...n}=t;return D.jsx(Gt.div,{...n,ref:r})});WI.displayName=fB;var HI="ToastAction",qI=q.forwardRef((t,r)=>{const{altText:o,...n}=t;return o.trim()?D.jsx(YI,{altText:o,asChild:!0,children:D.jsx(Gj,{...n,ref:r})}):(console.error(`Invalid prop \`altText\` supplied to \`${HI}\`. Expected non-empty \`string\`.`),null)});qI.displayName=HI;var XI="ToastClose",Gj=q.forwardRef((t,r)=>{const{__scopeToast:o,...n}=t,i=lB(XI,o);return D.jsx(YI,{asChild:!0,children:D.jsx(Gt.button,{type:"button",...n,ref:r,onClick:It(t.onClick,i.onClose)})})});Gj.displayName=XI;var YI=q.forwardRef((t,r)=>{const{__scopeToast:o,altText:n,...i}=t;return D.jsx(Gt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...i,ref:r})});function KI(t){const r=[];return Array.from(t.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&r.push(n.textContent),pB(n)){const i=n.ariaHidden||n.hidden||n.style.display==="none",a=n.dataset.radixToastAnnounceExclude==="";if(!i)if(a){const s=n.dataset.radixToastAnnounceAlt;s&&r.push(s)}else r.push(...KI(n))}}),r}function nm(t,r,o,{discrete:n}){const i=o.originalEvent.currentTarget,a=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:o});r&&i.addEventListener(t,r,{once:!0}),n?II(i,a):i.dispatchEvent(a)}var FT=(t,r,o=0)=>{const n=Math.abs(t.x),i=Math.abs(t.y),a=n>i;return r==="left"||r==="right"?a&&n>o:!a&&i>o};function hB(t=()=>{}){const r=Ro(t);On(()=>{let o=0,n=0;return o=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(r)),()=>{window.cancelAnimationFrame(o),window.cancelAnimationFrame(n)}},[r])}function pB(t){return t.nodeType===t.ELEMENT_NODE}function mB(t){const r=[],o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;o.nextNode();)r.push(o.currentNode);return r}function jb(t){const r=document.activeElement;return t.some(o=>o===r?!0:(o.focus(),document.activeElement!==r))}var yB=$I,ZI=BI,QI=VI,JI=GI,eN=WI,tN=qI,rN=Gj;function nN(t){var r,o,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(r=0;rtypeof t=="boolean"?`${t}`:t===0?"0":t,UT=Nt,yv=(t,r)=>o=>{var n;if((r==null?void 0:r.variants)==null)return UT(t,o==null?void 0:o.class,o==null?void 0:o.className);const{variants:i,defaultVariants:a}=r,s=Object.keys(i).map(c=>{const h=o==null?void 0:o[c],f=a==null?void 0:a[c];if(h===null)return null;const d=$T(h)||$T(f);return i[c][d]}),l=o&&Object.entries(o).reduce((c,h)=>{let[f,d]=h;return d===void 0||(c[f]=d),c},{}),u=r==null||(n=r.compoundVariants)===null||n===void 0?void 0:n.reduce((c,h)=>{let{class:f,className:d,...m}=h;return Object.entries(m).every(y=>{let[p,g]=y;return Array.isArray(g)?g.includes({...a,...l}[p]):{...a,...l}[p]===g})?[...c,f,d]:c},[]);return UT(t,s,u,o==null?void 0:o.class,o==null?void 0:o.className)};/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const gB=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),oN=(...t)=>t.filter((r,o,n)=>!!r&&r.trim()!==""&&n.indexOf(r)===o).join(" ").trim();/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var vB={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"};/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const bB=q.forwardRef(({color:t="currentColor",size:r=24,strokeWidth:o=2,absoluteStrokeWidth:n,className:i="",children:a,iconNode:s,...l},u)=>q.createElement("svg",{ref:u,...vB,width:r,height:r,stroke:t,strokeWidth:n?Number(o)*24/Number(r):o,className:oN("lucide",i),...l},[...s.map(([c,h])=>q.createElement(c,h)),...Array.isArray(a)?a:[a]]));/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ir=(t,r)=>{const o=q.forwardRef(({className:n,...i},a)=>q.createElement(bB,{ref:a,iconNode:r,className:oN(`lucide-${gB(t)}`,n),...i}));return o.displayName=`${t}`,o};/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xB=ir("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xy=ir("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wB=ir("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const _B=ir("BadgeCheck",[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const gx=ir("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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const iN=ir("ChartBar",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M7 16h8",key:"srdodz"}],["path",{d:"M7 11h12",key:"127s9w"}],["path",{d:"M7 6h3",key:"w9rmul"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const jB=ir("ChartNoAxesColumnIncreasing",[["line",{x1:"12",x2:"12",y1:"20",y2:"10",key:"1vz5eb"}],["line",{x1:"18",x2:"18",y1:"20",y2:"4",key:"cun8e5"}],["line",{x1:"6",x2:"6",y1:"20",y2:"16",key:"hq0ia6"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const aN=ir("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const gv=ir("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const SB=ir("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const EB=ir("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const TB=ir("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const OB=ir("Earth",[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const kB=ir("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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Wj=ir("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const PB=ir("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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const sN=ir("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const CB=ir("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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const lN=ir("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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const AB=ir("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Hj=ir("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Gm=ir("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const MB=ir("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Pl=ir("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const RB=ir("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const IB=ir("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const NB=ir("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const LB=ir("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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const DB=ir("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),qj="-",FB=t=>{const r=UB(t),{conflictingClassGroups:o,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:s=>{const l=s.split(qj);return l[0]===""&&l.length!==1&&l.shift(),uN(l,r)||$B(s)},getConflictingClassGroupIds:(s,l)=>{const u=o[s]||[];return l&&n[s]?[...u,...n[s]]:u}}},uN=(t,r)=>{var s;if(t.length===0)return r.classGroupId;const o=t[0],n=r.nextPart.get(o),i=n?uN(t.slice(1),n):void 0;if(i)return i;if(r.validators.length===0)return;const a=t.join(qj);return(s=r.validators.find(({validator:l})=>l(a)))==null?void 0:s.classGroupId},BT=/^\[(.+)\]$/,$B=t=>{if(BT.test(t)){const r=BT.exec(t)[1],o=r==null?void 0:r.substring(0,r.indexOf(":"));if(o)return"arbitrary.."+o}},UB=t=>{const{theme:r,prefix:o}=t,n={nextPart:new Map,validators:[]};return zB(Object.entries(t.classGroups),o).forEach(([a,s])=>{vx(s,n,a,r)}),n},vx=(t,r,o,n)=>{t.forEach(i=>{if(typeof i=="string"){const a=i===""?r:zT(r,i);a.classGroupId=o;return}if(typeof i=="function"){if(BB(i)){vx(i(n),r,o,n);return}r.validators.push({validator:i,classGroupId:o});return}Object.entries(i).forEach(([a,s])=>{vx(s,zT(r,a),o,n)})})},zT=(t,r)=>{let o=t;return r.split(qj).forEach(n=>{o.nextPart.has(n)||o.nextPart.set(n,{nextPart:new Map,validators:[]}),o=o.nextPart.get(n)}),o},BB=t=>t.isThemeGetter,zB=(t,r)=>r?t.map(([o,n])=>{const i=n.map(a=>typeof a=="string"?r+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([s,l])=>[r+s,l])):a);return[o,i]}):t,VB=t=>{if(t<1)return{get:()=>{},set:()=>{}};let r=0,o=new Map,n=new Map;const i=(a,s)=>{o.set(a,s),r++,r>t&&(r=0,n=o,o=new Map)};return{get(a){let s=o.get(a);if(s!==void 0)return s;if((s=n.get(a))!==void 0)return i(a,s),s},set(a,s){o.has(a)?o.set(a,s):i(a,s)}}},cN="!",GB=t=>{const{separator:r,experimentalParseClassName:o}=t,n=r.length===1,i=r[0],a=r.length,s=l=>{const u=[];let c=0,h=0,f;for(let g=0;gh?f-h:void 0;return{modifiers:u,hasImportantModifier:m,baseClassName:y,maybePostfixModifierPosition:p}};return o?l=>o({className:l,parseClassName:s}):s},WB=t=>{if(t.length<=1)return t;const r=[];let o=[];return t.forEach(n=>{n[0]==="["?(r.push(...o.sort(),n),o=[]):o.push(n)}),r.push(...o.sort()),r},HB=t=>({cache:VB(t.cacheSize),parseClassName:GB(t),...FB(t)}),qB=/\s+/,XB=(t,r)=>{const{parseClassName:o,getClassGroupId:n,getConflictingClassGroupIds:i}=r,a=[],s=t.trim().split(qB);let l="";for(let u=s.length-1;u>=0;u-=1){const c=s[u],{modifiers:h,hasImportantModifier:f,baseClassName:d,maybePostfixModifierPosition:m}=o(c);let y=!!m,p=n(y?d.substring(0,m):d);if(!p){if(!y){l=c+(l.length>0?" "+l:l);continue}if(p=n(d),!p){l=c+(l.length>0?" "+l:l);continue}y=!1}const g=WB(h).join(":"),b=f?g+cN:g,x=b+p;if(a.includes(x))continue;a.push(x);const v=i(p,y);for(let w=0;w0?" "+l:l)}return l};function YB(){let t=0,r,o,n="";for(;t{if(typeof t=="string")return t;let r,o="";for(let n=0;nf(h),t());return o=HB(c),n=o.cache.get,i=o.cache.set,a=l,l(u)}function l(u){const c=n(u);if(c)return c;const h=XB(u,o);return i(u,h),h}return function(){return a(YB.apply(null,arguments))}}const _r=t=>{const r=o=>o[t]||[];return r.isThemeGetter=!0,r},fN=/^\[(?:([a-z-]+):)?(.+)\]$/i,ZB=/^\d+\/\d+$/,QB=new Set(["px","full","screen"]),JB=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ez=/\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$/,tz=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,rz=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,nz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,na=t=>qu(t)||QB.has(t)||ZB.test(t),Ya=t=>od(t,"length",dz),qu=t=>!!t&&!Number.isNaN(Number(t)),Sb=t=>od(t,"number",qu),Bd=t=>!!t&&Number.isInteger(Number(t)),oz=t=>t.endsWith("%")&&qu(t.slice(0,-1)),Ct=t=>fN.test(t),Ka=t=>JB.test(t),iz=new Set(["length","size","percentage"]),az=t=>od(t,iz,hN),sz=t=>od(t,"position",hN),lz=new Set(["image","url"]),uz=t=>od(t,lz,hz),cz=t=>od(t,"",fz),zd=()=>!0,od=(t,r,o)=>{const n=fN.exec(t);return n?n[1]?typeof r=="string"?n[1]===r:r.has(n[1]):o(n[2]):!1},dz=t=>ez.test(t)&&!tz.test(t),hN=()=>!1,fz=t=>rz.test(t),hz=t=>nz.test(t),pz=()=>{const t=_r("colors"),r=_r("spacing"),o=_r("blur"),n=_r("brightness"),i=_r("borderColor"),a=_r("borderRadius"),s=_r("borderSpacing"),l=_r("borderWidth"),u=_r("contrast"),c=_r("grayscale"),h=_r("hueRotate"),f=_r("invert"),d=_r("gap"),m=_r("gradientColorStops"),y=_r("gradientColorStopPositions"),p=_r("inset"),g=_r("margin"),b=_r("opacity"),x=_r("padding"),v=_r("saturate"),w=_r("scale"),_=_r("sepia"),E=_r("skew"),S=_r("space"),T=_r("translate"),k=()=>["auto","contain","none"],A=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto",Ct,r],R=()=>[Ct,r],C=()=>["",na,Ya],L=()=>["auto",qu,Ct],F=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],z=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>["start","end","center","between","around","evenly","stretch"],G=()=>["","0",Ct],K=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Z=()=>[qu,Ct];return{cacheSize:500,separator:":",theme:{colors:[zd],spacing:[na,Ya],blur:["none","",Ka,Ct],brightness:Z(),borderColor:[t],borderRadius:["none","","full",Ka,Ct],borderSpacing:R(),borderWidth:C(),contrast:Z(),grayscale:G(),hueRotate:Z(),invert:G(),gap:R(),gradientColorStops:[t],gradientColorStopPositions:[oz,Ya],inset:O(),margin:O(),opacity:Z(),padding:R(),saturate:Z(),scale:Z(),sepia:G(),skew:Z(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",Ct]}],container:["container"],columns:[{columns:[Ka]}],"break-after":[{"break-after":K()}],"break-before":[{"break-before":K()}],"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:[...F(),Ct]}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Bd,Ct]}],basis:[{basis:O()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ct]}],grow:[{grow:G()}],shrink:[{shrink:G()}],order:[{order:["first","last","none",Bd,Ct]}],"grid-cols":[{"grid-cols":[zd]}],"col-start-end":[{col:["auto",{span:["full",Bd,Ct]},Ct]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[zd]}],"row-start-end":[{row:["auto",{span:[Bd,Ct]},Ct]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ct]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ct]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...$()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...$(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...$(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ct,r]}],"min-w":[{"min-w":[Ct,r,"min","max","fit"]}],"max-w":[{"max-w":[Ct,r,"none","full","min","max","fit","prose",{screen:[Ka]},Ka]}],h:[{h:[Ct,r,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ct,r,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ct,r,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ct,r,"auto","min","max","fit"]}],"font-size":[{text:["base",Ka,Ya]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Sb]}],"font-family":[{font:[zd]}],"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-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ct]}],"line-clamp":[{"line-clamp":["none",qu,Sb]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",na,Ct]}],"list-image":[{"list-image":["none",Ct]}],"list-style-type":[{list:["none","disc","decimal",Ct]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",na,Ya]}],"underline-offset":[{"underline-offset":["auto",na,Ct]}],"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:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ct]}],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",Ct]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...F(),sz]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",az]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},uz]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],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:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...z(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:z()}],"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:["",...z()]}],"outline-offset":[{"outline-offset":[na,Ct]}],"outline-w":[{outline:[na,Ya]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:C()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[na,Ya]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Ka,cz]}],"shadow-color":[{shadow:[zd]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[n]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",Ka,Ct]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[f]}],saturate:[{saturate:[v]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"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",Ct]}],duration:[{duration:Z()}],ease:[{ease:["linear","in","out","in-out",Ct]}],delay:[{delay:Z()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ct]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[Bd,Ct]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ct]}],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",Ct]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ct]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[na,Ya,Sb]}],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"]}}},mz=KB(pz);function St(...t){return mz(Nt(t))}const yz=yB,pN=q.forwardRef(({className:t,...r},o)=>D.jsx(ZI,{ref:o,className:St("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),...r}));pN.displayName=ZI.displayName;const gz=yv("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"}}),mN=q.forwardRef(({className:t,variant:r,...o},n)=>D.jsx(QI,{ref:n,className:St(gz({variant:r}),t),...o}));mN.displayName=QI.displayName;const vz=q.forwardRef(({className:t,...r},o)=>D.jsx(tN,{ref:o,className:St("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 hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",t),...r}));vz.displayName=tN.displayName;const yN=q.forwardRef(({className:t,...r},o)=>D.jsx(rN,{ref:o,className:St("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...r,children:D.jsx(DB,{className:"h-4 w-4"})}));yN.displayName=rN.displayName;const gN=q.forwardRef(({className:t,...r},o)=>D.jsx(JI,{ref:o,className:St("text-sm font-semibold",t),...r}));gN.displayName=JI.displayName;const vN=q.forwardRef(({className:t,...r},o)=>D.jsx(eN,{ref:o,className:St("text-sm opacity-90",t),...r}));vN.displayName=eN.displayName;function bz(){const{toasts:t}=Fa();return D.jsxs(yz,{children:[t.map(function({id:r,title:o,description:n,action:i,...a}){return D.jsxs(mN,{...a,children:[D.jsxs("div",{className:"grid gap-1",children:[o&&D.jsx(gN,{children:o}),n&&D.jsx(vN,{children:n})]}),i,D.jsx(yN,{})]},r)}),D.jsx(pN,{})]})}var VT=["light","dark"],xz="(prefers-color-scheme: dark)",wz=q.createContext(void 0),_z={setTheme:t=>{},themes:[]},jz=()=>{var t;return(t=q.useContext(wz))!=null?t:_z};q.memo(({forcedTheme:t,storageKey:r,attribute:o,enableSystem:n,enableColorScheme:i,defaultTheme:a,value:s,attrs:l,nonce:u})=>{let c=a==="system",h=o==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(y=>`'${y}'`).join(",")})`};`:`var d=document.documentElement,n='${o}',s='setAttribute';`,f=i?VT.includes(a)&&a?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${a}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",d=(y,p=!1,g=!0)=>{let b=s?s[y]:y,x=p?y+"|| ''":`'${b}'`,v="";return i&&g&&!p&&VT.includes(y)&&(v+=`d.style.colorScheme = '${y}';`),o==="class"?p||b?v+=`c.add(${x})`:v+="null":b&&(v+=`d[s](n,${x})`),v},m=t?`!function(){${h}${d(t)}}()`:n?`!function(){try{${h}var e=localStorage.getItem('${r}');if('system'===e||(!e&&${c})){var t='${xz}',m=window.matchMedia(t);if(m.media!==t||m.matches){${d("dark")}}else{${d("light")}}}else if(e){${s?`var x=${JSON.stringify(s)};`:""}${d(s?"x[e]":"e",!0)}}${c?"":"else{"+d(a,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${h}var e=localStorage.getItem('${r}');if(e){${s?`var x=${JSON.stringify(s)};`:""}${d(s?"x[e]":"e",!0)}}else{${d(a,!1,!1)};}${f}}catch(t){}}();`;return q.createElement("script",{nonce:u,dangerouslySetInnerHTML:{__html:m}})});var Sz=t=>{switch(t){case"success":return Oz;case"info":return Pz;case"warning":return kz;case"error":return Cz;default:return null}},Ez=Array(12).fill(0),Tz=({visible:t})=>me.createElement("div",{className:"sonner-loading-wrapper","data-visible":t},me.createElement("div",{className:"sonner-spinner"},Ez.map((r,o)=>me.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),Oz=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.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"})),kz=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},me.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"})),Pz=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.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"})),Cz=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.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"})),Az=()=>{let[t,r]=me.useState(document.hidden);return me.useEffect(()=>{let o=()=>{r(document.hidden)};return document.addEventListener("visibilitychange",o),()=>window.removeEventListener("visibilitychange",o)},[]),t},bx=1,Mz=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;let{message:o,...n}=t,i=typeof(t==null?void 0:t.id)=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:bx++,a=this.toasts.find(l=>l.id===i),s=t.dismissible===void 0?!0:t.dismissible;return a?this.toasts=this.toasts.map(l=>l.id===i?(this.publish({...l,...t,id:i,title:o}),{...l,...t,id:i,dismissible:s,title:o}):l):this.addToast({title:o,...n,dismissible:s,id:i}),i},this.dismiss=t=>(t||this.toasts.forEach(r=>{this.subscribers.forEach(o=>o({id:r.id,dismiss:!0}))}),this.subscribers.forEach(r=>r({id:t,dismiss:!0})),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let o;r.loading!==void 0&&(o=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));let n=t instanceof Promise?t:t(),i=o!==void 0;return n.then(async a=>{if(Iz(a)&&!a.ok){i=!1;let s=typeof r.error=="function"?await r.error(`HTTP error! status: ${a.status}`):r.error,l=typeof r.description=="function"?await r.description(`HTTP error! status: ${a.status}`):r.description;this.create({id:o,type:"error",message:s,description:l})}else if(r.success!==void 0){i=!1;let s=typeof r.success=="function"?await r.success(a):r.success,l=typeof r.description=="function"?await r.description(a):r.description;this.create({id:o,type:"success",message:s,description:l})}}).catch(async a=>{if(r.error!==void 0){i=!1;let s=typeof r.error=="function"?await r.error(a):r.error,l=typeof r.description=="function"?await r.description(a):r.description;this.create({id:o,type:"error",message:s,description:l})}}).finally(()=>{var a;i&&(this.dismiss(o),o=void 0),(a=r.finally)==null||a.call(r)}),o},this.custom=(t,r)=>{let o=(r==null?void 0:r.id)||bx++;return this.create({jsx:t(o),id:o,...r}),o},this.subscribers=[],this.toasts=[]}},jo=new Mz,Rz=(t,r)=>{let o=(r==null?void 0:r.id)||bx++;return jo.addToast({title:t,...r,id:o}),o},Iz=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",Nz=Rz,Lz=()=>jo.toasts;Object.assign(Nz,{success:jo.success,info:jo.info,warning:jo.warning,error:jo.error,custom:jo.custom,message:jo.message,promise:jo.promise,dismiss:jo.dismiss,loading:jo.loading},{getHistory:Lz});function Dz(t,{insertAt:r}={}){if(typeof document>"u")return;let o=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",r==="top"&&o.firstChild?o.insertBefore(n,o.firstChild):o.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}Dz(`: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}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-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;left: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;background:var(--gray1);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}: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:0;right:0;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}: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, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);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-border: hsl(0, 0%, 20%);--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%);--error-text: hsl(358, 100%, 81%)}[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%)} `);function om(t){return t.label!==void 0}var Fz=3,$z="32px",Uz=4e3,Bz=356,zz=14,Vz=20,Gz=200;function Wz(...t){return t.filter(Boolean).join(" ")}var Hz=t=>{var r,o,n,i,a,s,l,u,c,h;let{invert:f,toast:d,unstyled:m,interacting:y,setHeights:p,visibleToasts:g,heights:b,index:x,toasts:v,expanded:w,removeToast:_,defaultRichColors:E,closeButton:S,style:T,cancelButtonStyle:k,actionButtonStyle:A,className:O="",descriptionClassName:R="",duration:C,position:L,gap:F,loadingIcon:z,expandByDefault:W,classNames:$,icons:G,closeButtonAriaLabel:K="Close toast",pauseWhenPageIsHidden:Z,cn:U}=t,[I,B]=me.useState(!1),[H,Y]=me.useState(!1),[ee,oe]=me.useState(!1),[ce,he]=me.useState(!1),[ae,te]=me.useState(0),[pe,ne]=me.useState(0),fe=me.useRef(null),be=me.useRef(null),Ee=x===0,re=x+1<=g,se=d.type,ye=d.dismissible!==!1,Pe=d.className||"",_e=d.descriptionClassName||"",Ne=me.useMemo(()=>b.findIndex(Fe=>Fe.toastId===d.id)||0,[b,d.id]),$e=me.useMemo(()=>{var Fe;return(Fe=d.closeButton)!=null?Fe:S},[d.closeButton,S]),ze=me.useMemo(()=>d.duration||C||Uz,[d.duration,C]),Ke=me.useRef(0),Xe=me.useRef(0),Te=me.useRef(0),Be=me.useRef(null),[ke,ie]=L.split("-"),ue=me.useMemo(()=>b.reduce((Fe,We,He)=>He>=Ne?Fe:Fe+We.height,0),[b,Ne]),J=Az(),de=d.invert||f,je=se==="loading";Xe.current=me.useMemo(()=>Ne*F+ue,[Ne,ue]),me.useEffect(()=>{B(!0)},[]),me.useLayoutEffect(()=>{if(!I)return;let Fe=be.current,We=Fe.style.height;Fe.style.height="auto";let He=Fe.getBoundingClientRect().height;Fe.style.height=We,ne(He),p(Je=>Je.find(ht=>ht.toastId===d.id)?Je.map(ht=>ht.toastId===d.id?{...ht,height:He}:ht):[{toastId:d.id,height:He,position:d.position},...Je])},[I,d.title,d.description,p,d.id]);let Oe=me.useCallback(()=>{Y(!0),te(Xe.current),p(Fe=>Fe.filter(We=>We.toastId!==d.id)),setTimeout(()=>{_(d)},Gz)},[d,_,p,Xe]);me.useEffect(()=>{if(d.promise&&se==="loading"||d.duration===1/0||d.type==="loading")return;let Fe,We=ze;return w||y||Z&&J?(()=>{if(Te.current{var He;(He=d.onAutoClose)==null||He.call(d,d),Oe()},We)),()=>clearTimeout(Fe)},[w,y,W,d,ze,Oe,d.promise,se,Z,J]),me.useEffect(()=>{let Fe=be.current;if(Fe){let We=Fe.getBoundingClientRect().height;return ne(We),p(He=>[{toastId:d.id,height:We,position:d.position},...He]),()=>p(He=>He.filter(Je=>Je.toastId!==d.id))}},[p,d.id]),me.useEffect(()=>{d.delete&&Oe()},[Oe,d.delete]);function De(){return G!=null&&G.loading?me.createElement("div",{className:"sonner-loader","data-visible":se==="loading"},G.loading):z?me.createElement("div",{className:"sonner-loader","data-visible":se==="loading"},z):me.createElement(Tz,{visible:se==="loading"})}return me.createElement("li",{"aria-live":d.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:be,className:U(O,Pe,$==null?void 0:$.toast,(r=d==null?void 0:d.classNames)==null?void 0:r.toast,$==null?void 0:$.default,$==null?void 0:$[se],(o=d==null?void 0:d.classNames)==null?void 0:o[se]),"data-sonner-toast":"","data-rich-colors":(n=d.richColors)!=null?n:E,"data-styled":!(d.jsx||d.unstyled||m),"data-mounted":I,"data-promise":!!d.promise,"data-removed":H,"data-visible":re,"data-y-position":ke,"data-x-position":ie,"data-index":x,"data-front":Ee,"data-swiping":ee,"data-dismissible":ye,"data-type":se,"data-invert":de,"data-swipe-out":ce,"data-expanded":!!(w||W&&I),style:{"--index":x,"--toasts-before":x,"--z-index":v.length-x,"--offset":`${H?ae:Xe.current}px`,"--initial-height":W?"auto":`${pe}px`,...T,...d.style},onPointerDown:Fe=>{je||!ye||(fe.current=new Date,te(Xe.current),Fe.target.setPointerCapture(Fe.pointerId),Fe.target.tagName!=="BUTTON"&&(oe(!0),Be.current={x:Fe.clientX,y:Fe.clientY}))},onPointerUp:()=>{var Fe,We,He,Je;if(ce||!ye)return;Be.current=null;let ht=Number(((Fe=be.current)==null?void 0:Fe.style.getPropertyValue("--swipe-amount").replace("px",""))||0),mt=new Date().getTime()-((We=fe.current)==null?void 0:We.getTime()),st=Math.abs(ht)/mt;if(Math.abs(ht)>=Vz||st>.11){te(Xe.current),(He=d.onDismiss)==null||He.call(d,d),Oe(),he(!0);return}(Je=be.current)==null||Je.style.setProperty("--swipe-amount","0px"),oe(!1)},onPointerMove:Fe=>{var We;if(!Be.current||!ye)return;let He=Fe.clientY-Be.current.y,Je=Fe.clientX-Be.current.x,ht=(ke==="top"?Math.min:Math.max)(0,He),mt=Fe.pointerType==="touch"?10:2;Math.abs(ht)>mt?(We=be.current)==null||We.style.setProperty("--swipe-amount",`${He}px`):Math.abs(Je)>mt&&(Be.current=null)}},$e&&!d.jsx?me.createElement("button",{"aria-label":K,"data-disabled":je,"data-close-button":!0,onClick:je||!ye?()=>{}:()=>{var Fe;Oe(),(Fe=d.onDismiss)==null||Fe.call(d,d)},className:U($==null?void 0:$.closeButton,(i=d==null?void 0:d.classNames)==null?void 0:i.closeButton)},me.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"},me.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),me.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,d.jsx||me.isValidElement(d.title)?d.jsx||d.title:me.createElement(me.Fragment,null,se||d.icon||d.promise?me.createElement("div",{"data-icon":"",className:U($==null?void 0:$.icon,(a=d==null?void 0:d.classNames)==null?void 0:a.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||De():null,d.type!=="loading"?d.icon||(G==null?void 0:G[se])||Sz(se):null):null,me.createElement("div",{"data-content":"",className:U($==null?void 0:$.content,(s=d==null?void 0:d.classNames)==null?void 0:s.content)},me.createElement("div",{"data-title":"",className:U($==null?void 0:$.title,(l=d==null?void 0:d.classNames)==null?void 0:l.title)},d.title),d.description?me.createElement("div",{"data-description":"",className:U(R,_e,$==null?void 0:$.description,(u=d==null?void 0:d.classNames)==null?void 0:u.description)},d.description):null),me.isValidElement(d.cancel)?d.cancel:d.cancel&&om(d.cancel)?me.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||k,onClick:Fe=>{var We,He;om(d.cancel)&&ye&&((He=(We=d.cancel).onClick)==null||He.call(We,Fe),Oe())},className:U($==null?void 0:$.cancelButton,(c=d==null?void 0:d.classNames)==null?void 0:c.cancelButton)},d.cancel.label):null,me.isValidElement(d.action)?d.action:d.action&&om(d.action)?me.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||A,onClick:Fe=>{var We,He;om(d.action)&&(Fe.defaultPrevented||((He=(We=d.action).onClick)==null||He.call(We,Fe),Oe()))},className:U($==null?void 0:$.actionButton,(h=d==null?void 0:d.classNames)==null?void 0:h.actionButton)},d.action.label):null))};function GT(){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}var qz=t=>{let{invert:r,position:o="bottom-right",hotkey:n=["altKey","KeyT"],expand:i,closeButton:a,className:s,offset:l,theme:u="light",richColors:c,duration:h,style:f,visibleToasts:d=Fz,toastOptions:m,dir:y=GT(),gap:p=zz,loadingIcon:g,icons:b,containerAriaLabel:x="Notifications",pauseWhenPageIsHidden:v,cn:w=Wz}=t,[_,E]=me.useState([]),S=me.useMemo(()=>Array.from(new Set([o].concat(_.filter(Z=>Z.position).map(Z=>Z.position)))),[_,o]),[T,k]=me.useState([]),[A,O]=me.useState(!1),[R,C]=me.useState(!1),[L,F]=me.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),z=me.useRef(null),W=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),$=me.useRef(null),G=me.useRef(!1),K=me.useCallback(Z=>{var U;(U=_.find(I=>I.id===Z.id))!=null&&U.delete||jo.dismiss(Z.id),E(I=>I.filter(({id:B})=>B!==Z.id))},[_]);return me.useEffect(()=>jo.subscribe(Z=>{if(Z.dismiss){E(U=>U.map(I=>I.id===Z.id?{...I,delete:!0}:I));return}setTimeout(()=>{CI.flushSync(()=>{E(U=>{let I=U.findIndex(B=>B.id===Z.id);return I!==-1?[...U.slice(0,I),{...U[I],...Z},...U.slice(I+1)]:[Z,...U]})})})}),[]),me.useEffect(()=>{if(u!=="system"){F(u);return}u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?F("dark"):F("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:Z})=>{F(Z?"dark":"light")})},[u]),me.useEffect(()=>{_.length<=1&&O(!1)},[_]),me.useEffect(()=>{let Z=U=>{var I,B;n.every(H=>U[H]||U.code===H)&&(O(!0),(I=z.current)==null||I.focus()),U.code==="Escape"&&(document.activeElement===z.current||(B=z.current)!=null&&B.contains(document.activeElement))&&O(!1)};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[n]),me.useEffect(()=>{if(z.current)return()=>{$.current&&($.current.focus({preventScroll:!0}),$.current=null,G.current=!1)}},[z.current]),_.length?me.createElement("section",{"aria-label":`${x} ${W}`,tabIndex:-1},S.map((Z,U)=>{var I;let[B,H]=Z.split("-");return me.createElement("ol",{key:Z,dir:y==="auto"?GT():y,tabIndex:-1,ref:z,className:s,"data-sonner-toaster":!0,"data-theme":L,"data-y-position":B,"data-x-position":H,style:{"--front-toast-height":`${((I=T[0])==null?void 0:I.height)||0}px`,"--offset":typeof l=="number"?`${l}px`:l||$z,"--width":`${Bz}px`,"--gap":`${p}px`,...f},onBlur:Y=>{G.current&&!Y.currentTarget.contains(Y.relatedTarget)&&(G.current=!1,$.current&&($.current.focus({preventScroll:!0}),$.current=null))},onFocus:Y=>{Y.target instanceof HTMLElement&&Y.target.dataset.dismissible==="false"||G.current||(G.current=!0,$.current=Y.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{R||O(!1)},onPointerDown:Y=>{Y.target instanceof HTMLElement&&Y.target.dataset.dismissible==="false"||C(!0)},onPointerUp:()=>C(!1)},_.filter(Y=>!Y.position&&U===0||Y.position===Z).map((Y,ee)=>{var oe,ce;return me.createElement(Hz,{key:Y.id,icons:b,index:ee,toast:Y,defaultRichColors:c,duration:(oe=m==null?void 0:m.duration)!=null?oe:h,className:m==null?void 0:m.className,descriptionClassName:m==null?void 0:m.descriptionClassName,invert:r,visibleToasts:d,closeButton:(ce=m==null?void 0:m.closeButton)!=null?ce:a,interacting:R,position:Z,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:K,toasts:_.filter(he=>he.position==Y.position),heights:T.filter(he=>he.position==Y.position),setHeights:k,expandByDefault:i,gap:p,loadingIcon:g,expanded:A,pauseWhenPageIsHidden:v,cn:w})}))})):null};const Xz=({...t})=>{const{theme:r="system"}=jz();return D.jsx(qz,{theme:r,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 Yz=OM.useId||(()=>{}),Kz=0;function fp(t){const[r,o]=q.useState(Yz());return On(()=>{o(n=>n??String(Kz++))},[t]),r?`radix-${r}`:""}const Zz=["top","right","bottom","left"],Ls=Math.min,To=Math.max,wy=Math.round,im=Math.floor,Ds=t=>({x:t,y:t}),Qz={left:"right",right:"left",bottom:"top",top:"bottom"},Jz={start:"end",end:"start"};function xx(t,r,o){return To(t,Ls(r,o))}function Pa(t,r){return typeof t=="function"?t(r):t}function Ca(t){return t.split("-")[0]}function id(t){return t.split("-")[1]}function Xj(t){return t==="x"?"y":"x"}function Yj(t){return t==="y"?"height":"width"}function Fs(t){return["top","bottom"].includes(Ca(t))?"y":"x"}function Kj(t){return Xj(Fs(t))}function e7(t,r,o){o===void 0&&(o=!1);const n=id(t),i=Kj(t),a=Yj(i);let s=i==="x"?n===(o?"end":"start")?"right":"left":n==="start"?"bottom":"top";return r.reference[a]>r.floating[a]&&(s=_y(s)),[s,_y(s)]}function t7(t){const r=_y(t);return[wx(t),r,wx(r)]}function wx(t){return t.replace(/start|end/g,r=>Jz[r])}function r7(t,r,o){const n=["left","right"],i=["right","left"],a=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return o?r?i:n:r?n:i;case"left":case"right":return r?a:s;default:return[]}}function n7(t,r,o,n){const i=id(t);let a=r7(Ca(t),o==="start",n);return i&&(a=a.map(s=>s+"-"+i),r&&(a=a.concat(a.map(wx)))),a}function _y(t){return t.replace(/left|right|bottom|top/g,r=>Qz[r])}function o7(t){return{top:0,right:0,bottom:0,left:0,...t}}function bN(t){return typeof t!="number"?o7(t):{top:t,right:t,bottom:t,left:t}}function jy(t){const{x:r,y:o,width:n,height:i}=t;return{width:n,height:i,top:o,left:r,right:r+n,bottom:o+i,x:r,y:o}}function WT(t,r,o){let{reference:n,floating:i}=t;const a=Fs(r),s=Kj(r),l=Yj(s),u=Ca(r),c=a==="y",h=n.x+n.width/2-i.width/2,f=n.y+n.height/2-i.height/2,d=n[l]/2-i[l]/2;let m;switch(u){case"top":m={x:h,y:n.y-i.height};break;case"bottom":m={x:h,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:f};break;case"left":m={x:n.x-i.width,y:f};break;default:m={x:n.x,y:n.y}}switch(id(r)){case"start":m[s]-=d*(o&&c?-1:1);break;case"end":m[s]+=d*(o&&c?-1:1);break}return m}const i7=async(t,r,o)=>{const{placement:n="bottom",strategy:i="absolute",middleware:a=[],platform:s}=o,l=a.filter(Boolean),u=await(s.isRTL==null?void 0:s.isRTL(r));let c=await s.getElementRects({reference:t,floating:r,strategy:i}),{x:h,y:f}=WT(c,n,u),d=n,m={},y=0;for(let p=0;p({name:"arrow",options:t,async fn(r){const{x:o,y:n,placement:i,rects:a,platform:s,elements:l,middlewareData:u}=r,{element:c,padding:h=0}=Pa(t,r)||{};if(c==null)return{};const f=bN(h),d={x:o,y:n},m=Kj(i),y=Yj(m),p=await s.getDimensions(c),g=m==="y",b=g?"top":"left",x=g?"bottom":"right",v=g?"clientHeight":"clientWidth",w=a.reference[y]+a.reference[m]-d[m]-a.floating[y],_=d[m]-a.reference[m],E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let S=E?E[v]:0;(!S||!await(s.isElement==null?void 0:s.isElement(E)))&&(S=l.floating[v]||a.floating[y]);const T=w/2-_/2,k=S/2-p[y]/2-1,A=Ls(f[b],k),O=Ls(f[x],k),R=A,C=S-p[y]-O,L=S/2-p[y]/2+T,F=xx(R,L,C),z=!u.arrow&&id(i)!=null&&L!==F&&a.reference[y]/2-(LL<=0)){var O,R;const L=(((O=a.flip)==null?void 0:O.index)||0)+1,F=S[L];if(F)return{data:{index:L,overflows:A},reset:{placement:F}};let z=(R=A.filter(W=>W.overflows[0]<=0).sort((W,$)=>W.overflows[1]-$.overflows[1])[0])==null?void 0:R.placement;if(!z)switch(m){case"bestFit":{var C;const W=(C=A.filter($=>{if(E){const G=Fs($.placement);return G===x||G==="y"}return!0}).map($=>[$.placement,$.overflows.filter(G=>G>0).reduce((G,K)=>G+K,0)]).sort(($,G)=>$[1]-G[1])[0])==null?void 0:C[0];W&&(z=W);break}case"initialPlacement":z=l;break}if(i!==z)return{reset:{placement:z}}}return{}}}};function HT(t,r){return{top:t.top-r.height,right:t.right-r.width,bottom:t.bottom-r.height,left:t.left-r.width}}function qT(t){return Zz.some(r=>t[r]>=0)}const l7=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(r){const{rects:o}=r,{strategy:n="referenceHidden",...i}=Pa(t,r);switch(n){case"referenceHidden":{const a=await ih(r,{...i,elementContext:"reference"}),s=HT(a,o.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:qT(s)}}}case"escaped":{const a=await ih(r,{...i,altBoundary:!0}),s=HT(a,o.floating);return{data:{escapedOffsets:s,escaped:qT(s)}}}default:return{}}}}};async function u7(t,r){const{placement:o,platform:n,elements:i}=t,a=await(n.isRTL==null?void 0:n.isRTL(i.floating)),s=Ca(o),l=id(o),u=Fs(o)==="y",c=["left","top"].includes(s)?-1:1,h=a&&u?-1:1,f=Pa(r,t);let{mainAxis:d,crossAxis:m,alignmentAxis:y}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof y=="number"&&(m=l==="end"?y*-1:y),u?{x:m*h,y:d*c}:{x:d*c,y:m*h}}const c7=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(r){var o,n;const{x:i,y:a,placement:s,middlewareData:l}=r,u=await u7(r,t);return s===((o=l.offset)==null?void 0:o.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:i+u.x,y:a+u.y,data:{...u,placement:s}}}}},d7=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(r){const{x:o,y:n,placement:i}=r,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:g=>{let{x:b,y:x}=g;return{x:b,y:x}}},...u}=Pa(t,r),c={x:o,y:n},h=await ih(r,u),f=Fs(Ca(i)),d=Xj(f);let m=c[d],y=c[f];if(a){const g=d==="y"?"top":"left",b=d==="y"?"bottom":"right",x=m+h[g],v=m-h[b];m=xx(x,m,v)}if(s){const g=f==="y"?"top":"left",b=f==="y"?"bottom":"right",x=y+h[g],v=y-h[b];y=xx(x,y,v)}const p=l.fn({...r,[d]:m,[f]:y});return{...p,data:{x:p.x-o,y:p.y-n,enabled:{[d]:a,[f]:s}}}}}},f7=function(t){return t===void 0&&(t={}),{options:t,fn(r){const{x:o,y:n,placement:i,rects:a,middlewareData:s}=r,{offset:l=0,mainAxis:u=!0,crossAxis:c=!0}=Pa(t,r),h={x:o,y:n},f=Fs(i),d=Xj(f);let m=h[d],y=h[f];const p=Pa(l,r),g=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(u){const v=d==="y"?"height":"width",w=a.reference[d]-a.floating[v]+g.mainAxis,_=a.reference[d]+a.reference[v]-g.mainAxis;m_&&(m=_)}if(c){var b,x;const v=d==="y"?"width":"height",w=["top","left"].includes(Ca(i)),_=a.reference[f]-a.floating[v]+(w&&((b=s.offset)==null?void 0:b[f])||0)+(w?0:g.crossAxis),E=a.reference[f]+a.reference[v]+(w?0:((x=s.offset)==null?void 0:x[f])||0)-(w?g.crossAxis:0);y<_?y=_:y>E&&(y=E)}return{[d]:m,[f]:y}}}},h7=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(r){var o,n;const{placement:i,rects:a,platform:s,elements:l}=r,{apply:u=()=>{},...c}=Pa(t,r),h=await ih(r,c),f=Ca(i),d=id(i),m=Fs(i)==="y",{width:y,height:p}=a.floating;let g,b;f==="top"||f==="bottom"?(g=f,b=d===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(b=f,g=d==="end"?"top":"bottom");const x=p-h.top-h.bottom,v=y-h.left-h.right,w=Ls(p-h[g],x),_=Ls(y-h[b],v),E=!r.middlewareData.shift;let S=w,T=_;if((o=r.middlewareData.shift)!=null&&o.enabled.x&&(T=v),(n=r.middlewareData.shift)!=null&&n.enabled.y&&(S=x),E&&!d){const A=To(h.left,0),O=To(h.right,0),R=To(h.top,0),C=To(h.bottom,0);m?T=y-2*(A!==0||O!==0?A+O:To(h.left,h.right)):S=p-2*(R!==0||C!==0?R+C:To(h.top,h.bottom))}await u({...r,availableWidth:T,availableHeight:S});const k=await s.getDimensions(l.floating);return y!==k.width||p!==k.height?{reset:{rects:!0}}:{}}}};function vv(){return typeof window<"u"}function ad(t){return xN(t)?(t.nodeName||"").toLowerCase():"#document"}function Co(t){var r;return(t==null||(r=t.ownerDocument)==null?void 0:r.defaultView)||window}function Ki(t){var r;return(r=(xN(t)?t.ownerDocument:t.document)||window.document)==null?void 0:r.documentElement}function xN(t){return vv()?t instanceof Node||t instanceof Co(t).Node:!1}function Si(t){return vv()?t instanceof Element||t instanceof Co(t).Element:!1}function qi(t){return vv()?t instanceof HTMLElement||t instanceof Co(t).HTMLElement:!1}function XT(t){return!vv()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Co(t).ShadowRoot}function hp(t){const{overflow:r,overflowX:o,overflowY:n,display:i}=Ei(t);return/auto|scroll|overlay|hidden|clip/.test(r+n+o)&&!["inline","contents"].includes(i)}function p7(t){return["table","td","th"].includes(ad(t))}function bv(t){return[":popover-open",":modal"].some(r=>{try{return t.matches(r)}catch{return!1}})}function Zj(t){const r=Qj(),o=Si(t)?Ei(t):t;return o.transform!=="none"||o.perspective!=="none"||(o.containerType?o.containerType!=="normal":!1)||!r&&(o.backdropFilter?o.backdropFilter!=="none":!1)||!r&&(o.filter?o.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(o.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(o.contain||"").includes(n))}function m7(t){let r=$s(t);for(;qi(r)&&!jc(r);){if(Zj(r))return r;if(bv(r))return null;r=$s(r)}return null}function Qj(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function jc(t){return["html","body","#document"].includes(ad(t))}function Ei(t){return Co(t).getComputedStyle(t)}function xv(t){return Si(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function $s(t){if(ad(t)==="html")return t;const r=t.assignedSlot||t.parentNode||XT(t)&&t.host||Ki(t);return XT(r)?r.host:r}function wN(t){const r=$s(t);return jc(r)?t.ownerDocument?t.ownerDocument.body:t.body:qi(r)&&hp(r)?r:wN(r)}function ah(t,r,o){var n;r===void 0&&(r=[]),o===void 0&&(o=!0);const i=wN(t),a=i===((n=t.ownerDocument)==null?void 0:n.body),s=Co(i);if(a){const l=_x(s);return r.concat(s,s.visualViewport||[],hp(i)?i:[],l&&o?ah(l):[])}return r.concat(i,ah(i,[],o))}function _x(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function _N(t){const r=Ei(t);let o=parseFloat(r.width)||0,n=parseFloat(r.height)||0;const i=qi(t),a=i?t.offsetWidth:o,s=i?t.offsetHeight:n,l=wy(o)!==a||wy(n)!==s;return l&&(o=a,n=s),{width:o,height:n,$:l}}function Jj(t){return Si(t)?t:t.contextElement}function Xu(t){const r=Jj(t);if(!qi(r))return Ds(1);const o=r.getBoundingClientRect(),{width:n,height:i,$:a}=_N(r);let s=(a?wy(o.width):o.width)/n,l=(a?wy(o.height):o.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const y7=Ds(0);function jN(t){const r=Co(t);return!Qj()||!r.visualViewport?y7:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function g7(t,r,o){return r===void 0&&(r=!1),!o||r&&o!==Co(t)?!1:r}function $l(t,r,o,n){r===void 0&&(r=!1),o===void 0&&(o=!1);const i=t.getBoundingClientRect(),a=Jj(t);let s=Ds(1);r&&(n?Si(n)&&(s=Xu(n)):s=Xu(t));const l=g7(a,o,n)?jN(a):Ds(0);let u=(i.left+l.x)/s.x,c=(i.top+l.y)/s.y,h=i.width/s.x,f=i.height/s.y;if(a){const d=Co(a),m=n&&Si(n)?Co(n):n;let y=d,p=_x(y);for(;p&&n&&m!==y;){const g=Xu(p),b=p.getBoundingClientRect(),x=Ei(p),v=b.left+(p.clientLeft+parseFloat(x.paddingLeft))*g.x,w=b.top+(p.clientTop+parseFloat(x.paddingTop))*g.y;u*=g.x,c*=g.y,h*=g.x,f*=g.y,u+=v,c+=w,y=Co(p),p=_x(y)}}return jy({width:h,height:f,x:u,y:c})}function v7(t){let{elements:r,rect:o,offsetParent:n,strategy:i}=t;const a=i==="fixed",s=Ki(n),l=r?bv(r.floating):!1;if(n===s||l&&a)return o;let u={scrollLeft:0,scrollTop:0},c=Ds(1);const h=Ds(0),f=qi(n);if((f||!f&&!a)&&((ad(n)!=="body"||hp(s))&&(u=xv(n)),qi(n))){const d=$l(n);c=Xu(n),h.x=d.x+n.clientLeft,h.y=d.y+n.clientTop}return{width:o.width*c.x,height:o.height*c.y,x:o.x*c.x-u.scrollLeft*c.x+h.x,y:o.y*c.y-u.scrollTop*c.y+h.y}}function b7(t){return Array.from(t.getClientRects())}function jx(t,r){const o=xv(t).scrollLeft;return r?r.left+o:$l(Ki(t)).left+o}function x7(t){const r=Ki(t),o=xv(t),n=t.ownerDocument.body,i=To(r.scrollWidth,r.clientWidth,n.scrollWidth,n.clientWidth),a=To(r.scrollHeight,r.clientHeight,n.scrollHeight,n.clientHeight);let s=-o.scrollLeft+jx(t);const l=-o.scrollTop;return Ei(n).direction==="rtl"&&(s+=To(r.clientWidth,n.clientWidth)-i),{width:i,height:a,x:s,y:l}}function w7(t,r){const o=Co(t),n=Ki(t),i=o.visualViewport;let a=n.clientWidth,s=n.clientHeight,l=0,u=0;if(i){a=i.width,s=i.height;const c=Qj();(!c||c&&r==="fixed")&&(l=i.offsetLeft,u=i.offsetTop)}return{width:a,height:s,x:l,y:u}}function _7(t,r){const o=$l(t,!0,r==="fixed"),n=o.top+t.clientTop,i=o.left+t.clientLeft,a=qi(t)?Xu(t):Ds(1),s=t.clientWidth*a.x,l=t.clientHeight*a.y,u=i*a.x,c=n*a.y;return{width:s,height:l,x:u,y:c}}function YT(t,r,o){let n;if(r==="viewport")n=w7(t,o);else if(r==="document")n=x7(Ki(t));else if(Si(r))n=_7(r,o);else{const i=jN(t);n={...r,x:r.x-i.x,y:r.y-i.y}}return jy(n)}function SN(t,r){const o=$s(t);return o===r||!Si(o)||jc(o)?!1:Ei(o).position==="fixed"||SN(o,r)}function j7(t,r){const o=r.get(t);if(o)return o;let n=ah(t,[],!1).filter(l=>Si(l)&&ad(l)!=="body"),i=null;const a=Ei(t).position==="fixed";let s=a?$s(t):t;for(;Si(s)&&!jc(s);){const l=Ei(s),u=Zj(s);!u&&l.position==="fixed"&&(i=null),(a?!u&&!i:!u&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||hp(s)&&!u&&SN(t,s))?n=n.filter(h=>h!==s):i=l,s=$s(s)}return r.set(t,n),n}function S7(t){let{element:r,boundary:o,rootBoundary:n,strategy:i}=t;const s=[...o==="clippingAncestors"?bv(r)?[]:j7(r,this._c):[].concat(o),n],l=s[0],u=s.reduce((c,h)=>{const f=YT(r,h,i);return c.top=To(f.top,c.top),c.right=Ls(f.right,c.right),c.bottom=Ls(f.bottom,c.bottom),c.left=To(f.left,c.left),c},YT(r,l,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function E7(t){const{width:r,height:o}=_N(t);return{width:r,height:o}}function T7(t,r,o){const n=qi(r),i=Ki(r),a=o==="fixed",s=$l(t,!0,a,r);let l={scrollLeft:0,scrollTop:0};const u=Ds(0);if(n||!n&&!a)if((ad(r)!=="body"||hp(i))&&(l=xv(r)),n){const m=$l(r,!0,a,r);u.x=m.x+r.clientLeft,u.y=m.y+r.clientTop}else i&&(u.x=jx(i));let c=0,h=0;if(i&&!n&&!a){const m=i.getBoundingClientRect();h=m.top+l.scrollTop,c=m.left+l.scrollLeft-jx(i,m)}const f=s.left+l.scrollLeft-u.x-c,d=s.top+l.scrollTop-u.y-h;return{x:f,y:d,width:s.width,height:s.height}}function Eb(t){return Ei(t).position==="static"}function KT(t,r){if(!qi(t)||Ei(t).position==="fixed")return null;if(r)return r(t);let o=t.offsetParent;return Ki(t)===o&&(o=o.ownerDocument.body),o}function EN(t,r){const o=Co(t);if(bv(t))return o;if(!qi(t)){let i=$s(t);for(;i&&!jc(i);){if(Si(i)&&!Eb(i))return i;i=$s(i)}return o}let n=KT(t,r);for(;n&&p7(n)&&Eb(n);)n=KT(n,r);return n&&jc(n)&&Eb(n)&&!Zj(n)?o:n||m7(t)||o}const O7=async function(t){const r=this.getOffsetParent||EN,o=this.getDimensions,n=await o(t.floating);return{reference:T7(t.reference,await r(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function k7(t){return Ei(t).direction==="rtl"}const P7={convertOffsetParentRelativeRectToViewportRelativeRect:v7,getDocumentElement:Ki,getClippingRect:S7,getOffsetParent:EN,getElementRects:O7,getClientRects:b7,getDimensions:E7,getScale:Xu,isElement:Si,isRTL:k7};function C7(t,r){let o=null,n;const i=Ki(t);function a(){var l;clearTimeout(n),(l=o)==null||l.disconnect(),o=null}function s(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),a();const{left:c,top:h,width:f,height:d}=t.getBoundingClientRect();if(l||r(),!f||!d)return;const m=im(h),y=im(i.clientWidth-(c+f)),p=im(i.clientHeight-(h+d)),g=im(c),x={rootMargin:-m+"px "+-y+"px "+-p+"px "+-g+"px",threshold:To(0,Ls(1,u))||1};let v=!0;function w(_){const E=_[0].intersectionRatio;if(E!==u){if(!v)return s();E?s(!1,E):n=setTimeout(()=>{s(!1,1e-7)},1e3)}v=!1}try{o=new IntersectionObserver(w,{...x,root:i.ownerDocument})}catch{o=new IntersectionObserver(w,x)}o.observe(t)}return s(!0),a}function A7(t,r,o,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=n,c=Jj(t),h=i||a?[...c?ah(c):[],...ah(r)]:[];h.forEach(b=>{i&&b.addEventListener("scroll",o,{passive:!0}),a&&b.addEventListener("resize",o)});const f=c&&l?C7(c,o):null;let d=-1,m=null;s&&(m=new ResizeObserver(b=>{let[x]=b;x&&x.target===c&&m&&(m.unobserve(r),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var v;(v=m)==null||v.observe(r)})),o()}),c&&!u&&m.observe(c),m.observe(r));let y,p=u?$l(t):null;u&&g();function g(){const b=$l(t);p&&(b.x!==p.x||b.y!==p.y||b.width!==p.width||b.height!==p.height)&&o(),p=b,y=requestAnimationFrame(g)}return o(),()=>{var b;h.forEach(x=>{i&&x.removeEventListener("scroll",o),a&&x.removeEventListener("resize",o)}),f==null||f(),(b=m)==null||b.disconnect(),m=null,u&&cancelAnimationFrame(y)}}const M7=c7,R7=d7,I7=s7,N7=h7,L7=l7,ZT=a7,D7=f7,F7=(t,r,o)=>{const n=new Map,i={platform:P7,...o},a={...i.platform,_c:n};return i7(t,r,{...i,platform:a})};var Wm=typeof document<"u"?q.useLayoutEffect:q.useEffect;function Sy(t,r){if(t===r)return!0;if(typeof t!=typeof r)return!1;if(typeof t=="function"&&t.toString()===r.toString())return!0;let o,n,i;if(t&&r&&typeof t=="object"){if(Array.isArray(t)){if(o=t.length,o!==r.length)return!1;for(n=o;n--!==0;)if(!Sy(t[n],r[n]))return!1;return!0}if(i=Object.keys(t),o=i.length,o!==Object.keys(r).length)return!1;for(n=o;n--!==0;)if(!{}.hasOwnProperty.call(r,i[n]))return!1;for(n=o;n--!==0;){const a=i[n];if(!(a==="_owner"&&t.$$typeof)&&!Sy(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}function TN(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function QT(t,r){const o=TN(t);return Math.round(r*o)/o}function Tb(t){const r=q.useRef(t);return Wm(()=>{r.current=t}),r}function $7(t){t===void 0&&(t={});const{placement:r="bottom",strategy:o="absolute",middleware:n=[],platform:i,elements:{reference:a,floating:s}={},transform:l=!0,whileElementsMounted:u,open:c}=t,[h,f]=q.useState({x:0,y:0,strategy:o,placement:r,middlewareData:{},isPositioned:!1}),[d,m]=q.useState(n);Sy(d,n)||m(n);const[y,p]=q.useState(null),[g,b]=q.useState(null),x=q.useCallback($=>{$!==E.current&&(E.current=$,p($))},[]),v=q.useCallback($=>{$!==S.current&&(S.current=$,b($))},[]),w=a||y,_=s||g,E=q.useRef(null),S=q.useRef(null),T=q.useRef(h),k=u!=null,A=Tb(u),O=Tb(i),R=Tb(c),C=q.useCallback(()=>{if(!E.current||!S.current)return;const $={placement:r,strategy:o,middleware:d};O.current&&($.platform=O.current),F7(E.current,S.current,$).then(G=>{const K={...G,isPositioned:R.current!==!1};L.current&&!Sy(T.current,K)&&(T.current=K,Ql.flushSync(()=>{f(K)}))})},[d,r,o,O,R]);Wm(()=>{c===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f($=>({...$,isPositioned:!1})))},[c]);const L=q.useRef(!1);Wm(()=>(L.current=!0,()=>{L.current=!1}),[]),Wm(()=>{if(w&&(E.current=w),_&&(S.current=_),w&&_){if(A.current)return A.current(w,_,C);C()}},[w,_,C,A,k]);const F=q.useMemo(()=>({reference:E,floating:S,setReference:x,setFloating:v}),[x,v]),z=q.useMemo(()=>({reference:w,floating:_}),[w,_]),W=q.useMemo(()=>{const $={position:o,left:0,top:0};if(!z.floating)return $;const G=QT(z.floating,h.x),K=QT(z.floating,h.y);return l?{...$,transform:"translate("+G+"px, "+K+"px)",...TN(z.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:G,top:K}},[o,l,z.floating,h.x,h.y]);return q.useMemo(()=>({...h,update:C,refs:F,elements:z,floatingStyles:W}),[h,C,F,z,W])}const U7=t=>{function r(o){return{}.hasOwnProperty.call(o,"current")}return{name:"arrow",options:t,fn(o){const{element:n,padding:i}=typeof t=="function"?t(o):t;return n&&r(n)?n.current!=null?ZT({element:n.current,padding:i}).fn(o):{}:n?ZT({element:n,padding:i}).fn(o):{}}}},B7=(t,r)=>({...M7(t),options:[t,r]}),z7=(t,r)=>({...R7(t),options:[t,r]}),V7=(t,r)=>({...D7(t),options:[t,r]}),G7=(t,r)=>({...I7(t),options:[t,r]}),W7=(t,r)=>({...N7(t),options:[t,r]}),H7=(t,r)=>({...L7(t),options:[t,r]}),q7=(t,r)=>({...U7(t),options:[t,r]});var X7="Arrow",ON=q.forwardRef((t,r)=>{const{children:o,width:n=10,height:i=5,...a}=t;return D.jsx(Gt.svg,{...a,ref:r,width:n,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?o:D.jsx("polygon",{points:"0,0 30,0 15,10"})})});ON.displayName=X7;var Y7=ON;function K7(t,r=[]){let o=[];function n(a,s){const l=q.createContext(s),u=o.length;o=[...o,s];function c(f){const{scope:d,children:m,...y}=f,p=(d==null?void 0:d[t][u])||l,g=q.useMemo(()=>y,Object.values(y));return D.jsx(p.Provider,{value:g,children:m})}function h(f,d){const m=(d==null?void 0:d[t][u])||l,y=q.useContext(m);if(y)return y;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${a}\``)}return c.displayName=a+"Provider",[c,h]}const i=()=>{const a=o.map(s=>q.createContext(s));return function(l){const u=(l==null?void 0:l[t])||a;return q.useMemo(()=>({[`__scope${t}`]:{...l,[t]:u}}),[l,u])}};return i.scopeName=t,[n,Z7(i,...r)]}function Z7(...t){const r=t[0];if(t.length===1)return r;const o=()=>{const n=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const s=n.reduce((l,{useScope:u,scopeName:c})=>{const f=u(a)[`__scope${c}`];return{...l,...f}},{});return q.useMemo(()=>({[`__scope${r.scopeName}`]:s}),[s])}};return o.scopeName=r.scopeName,o}function kN(t){const[r,o]=q.useState(void 0);return On(()=>{if(t){o({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const a=i[0];let s,l;if("borderBoxSize"in a){const u=a.borderBoxSize,c=Array.isArray(u)?u[0]:u;s=c.inlineSize,l=c.blockSize}else s=t.offsetWidth,l=t.offsetHeight;o({width:s,height:l})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else o(void 0)},[t]),r}var eS="Popper",[PN,wv]=K7(eS),[Q7,CN]=PN(eS),AN=t=>{const{__scopePopper:r,children:o}=t,[n,i]=q.useState(null);return D.jsx(Q7,{scope:r,anchor:n,onAnchorChange:i,children:o})};AN.displayName=eS;var MN="PopperAnchor",RN=q.forwardRef((t,r)=>{const{__scopePopper:o,virtualRef:n,...i}=t,a=CN(MN,o),s=q.useRef(null),l=Or(r,s);return q.useEffect(()=>{a.onAnchorChange((n==null?void 0:n.current)||s.current)}),n?null:D.jsx(Gt.div,{...i,ref:l})});RN.displayName=MN;var tS="PopperContent",[J7,e9]=PN(tS),IN=q.forwardRef((t,r)=>{var ee,oe,ce,he,ae,te;const{__scopePopper:o,side:n="bottom",sideOffset:i=0,align:a="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:c=[],collisionPadding:h=0,sticky:f="partial",hideWhenDetached:d=!1,updatePositionStrategy:m="optimized",onPlaced:y,...p}=t,g=CN(tS,o),[b,x]=q.useState(null),v=Or(r,pe=>x(pe)),[w,_]=q.useState(null),E=kN(w),S=(E==null?void 0:E.width)??0,T=(E==null?void 0:E.height)??0,k=n+(a!=="center"?"-"+a:""),A=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},O=Array.isArray(c)?c:[c],R=O.length>0,C={padding:A,boundary:O.filter(r9),altBoundary:R},{refs:L,floatingStyles:F,placement:z,isPositioned:W,middlewareData:$}=$7({strategy:"fixed",placement:k,whileElementsMounted:(...pe)=>A7(...pe,{animationFrame:m==="always"}),elements:{reference:g.anchor},middleware:[B7({mainAxis:i+T,alignmentAxis:s}),u&&z7({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?V7():void 0,...C}),u&&G7({...C}),W7({...C,apply:({elements:pe,rects:ne,availableWidth:fe,availableHeight:be})=>{const{width:Ee,height:re}=ne.reference,se=pe.floating.style;se.setProperty("--radix-popper-available-width",`${fe}px`),se.setProperty("--radix-popper-available-height",`${be}px`),se.setProperty("--radix-popper-anchor-width",`${Ee}px`),se.setProperty("--radix-popper-anchor-height",`${re}px`)}}),w&&q7({element:w,padding:l}),n9({arrowWidth:S,arrowHeight:T}),d&&H7({strategy:"referenceHidden",...C})]}),[G,K]=DN(z),Z=Ro(y);On(()=>{W&&(Z==null||Z())},[W,Z]);const U=(ee=$.arrow)==null?void 0:ee.x,I=(oe=$.arrow)==null?void 0:oe.y,B=((ce=$.arrow)==null?void 0:ce.centerOffset)!==0,[H,Y]=q.useState();return On(()=>{b&&Y(window.getComputedStyle(b).zIndex)},[b]),D.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:W?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:H,"--radix-popper-transform-origin":[(he=$.transformOrigin)==null?void 0:he.x,(ae=$.transformOrigin)==null?void 0:ae.y].join(" "),...((te=$.hide)==null?void 0:te.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:D.jsx(J7,{scope:o,placedSide:G,onArrowChange:_,arrowX:U,arrowY:I,shouldHideArrow:B,children:D.jsx(Gt.div,{"data-side":G,"data-align":K,...p,ref:v,style:{...p.style,animation:W?void 0:"none"}})})})});IN.displayName=tS;var NN="PopperArrow",t9={top:"bottom",right:"left",bottom:"top",left:"right"},LN=q.forwardRef(function(r,o){const{__scopePopper:n,...i}=r,a=e9(NN,n),s=t9[a.placedSide];return D.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:D.jsx(Y7,{...i,ref:o,style:{...i.style,display:"block"}})})});LN.displayName=NN;function r9(t){return t!==null}var n9=t=>({name:"transformOrigin",options:t,fn(r){var g,b,x;const{placement:o,rects:n,middlewareData:i}=r,s=((g=i.arrow)==null?void 0:g.centerOffset)!==0,l=s?0:t.arrowWidth,u=s?0:t.arrowHeight,[c,h]=DN(o),f={start:"0%",center:"50%",end:"100%"}[h],d=(((b=i.arrow)==null?void 0:b.x)??0)+l/2,m=(((x=i.arrow)==null?void 0:x.y)??0)+u/2;let y="",p="";return c==="bottom"?(y=s?f:`${d}px`,p=`${-u}px`):c==="top"?(y=s?f:`${d}px`,p=`${n.floating.height+u}px`):c==="right"?(y=`${-u}px`,p=s?f:`${m}px`):c==="left"&&(y=`${n.floating.width+u}px`,p=s?f:`${m}px`),{data:{x:y,y:p}}}});function DN(t){const[r,o="center"]=t.split("-");return[r,o]}var o9=AN,FN=RN,$N=IN,UN=LN,[_v,E_e]=nd("Tooltip",[wv]),rS=wv(),BN="TooltipProvider",i9=700,JT="tooltip.open",[a9,zN]=_v(BN),VN=t=>{const{__scopeTooltip:r,delayDuration:o=i9,skipDelayDuration:n=300,disableHoverableContent:i=!1,children:a}=t,[s,l]=q.useState(!0),u=q.useRef(!1),c=q.useRef(0);return q.useEffect(()=>{const h=c.current;return()=>window.clearTimeout(h)},[]),D.jsx(a9,{scope:r,isOpenDelayed:s,delayDuration:o,onOpen:q.useCallback(()=>{window.clearTimeout(c.current),l(!1)},[]),onClose:q.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>l(!0),n)},[n]),isPointerInTransitRef:u,onPointerInTransitChange:q.useCallback(h=>{u.current=h},[]),disableHoverableContent:i,children:a})};VN.displayName=BN;var GN="Tooltip",[T_e,jv]=_v(GN),Sx="TooltipTrigger",s9=q.forwardRef((t,r)=>{const{__scopeTooltip:o,...n}=t,i=jv(Sx,o),a=zN(Sx,o),s=rS(o),l=q.useRef(null),u=Or(r,l,i.onTriggerChange),c=q.useRef(!1),h=q.useRef(!1),f=q.useCallback(()=>c.current=!1,[]);return q.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),D.jsx(FN,{asChild:!0,...s,children:D.jsx(Gt.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...n,ref:u,onPointerMove:It(t.onPointerMove,d=>{d.pointerType!=="touch"&&!h.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),h.current=!0)}),onPointerLeave:It(t.onPointerLeave,()=>{i.onTriggerLeave(),h.current=!1}),onPointerDown:It(t.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:It(t.onFocus,()=>{c.current||i.onOpen()}),onBlur:It(t.onBlur,i.onClose),onClick:It(t.onClick,i.onClose)})})});s9.displayName=Sx;var l9="TooltipPortal",[O_e,u9]=_v(l9,{forceMount:void 0}),Sc="TooltipContent",WN=q.forwardRef((t,r)=>{const o=u9(Sc,t.__scopeTooltip),{forceMount:n=o.forceMount,side:i="top",...a}=t,s=jv(Sc,t.__scopeTooltip);return D.jsx(cp,{present:n||s.open,children:s.disableHoverableContent?D.jsx(HN,{side:i,...a,ref:r}):D.jsx(c9,{side:i,...a,ref:r})})}),c9=q.forwardRef((t,r)=>{const o=jv(Sc,t.__scopeTooltip),n=zN(Sc,t.__scopeTooltip),i=q.useRef(null),a=Or(r,i),[s,l]=q.useState(null),{trigger:u,onClose:c}=o,h=i.current,{onPointerInTransitChange:f}=n,d=q.useCallback(()=>{l(null),f(!1)},[f]),m=q.useCallback((y,p)=>{const g=y.currentTarget,b={x:y.clientX,y:y.clientY},x=p9(b,g.getBoundingClientRect()),v=m9(b,x),w=y9(p.getBoundingClientRect()),_=v9([...v,...w]);l(_),f(!0)},[f]);return q.useEffect(()=>()=>d(),[d]),q.useEffect(()=>{if(u&&h){const y=g=>m(g,h),p=g=>m(g,u);return u.addEventListener("pointerleave",y),h.addEventListener("pointerleave",p),()=>{u.removeEventListener("pointerleave",y),h.removeEventListener("pointerleave",p)}}},[u,h,m,d]),q.useEffect(()=>{if(s){const y=p=>{const g=p.target,b={x:p.clientX,y:p.clientY},x=(u==null?void 0:u.contains(g))||(h==null?void 0:h.contains(g)),v=!g9(b,s);x?d():v&&(d(),c())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[u,h,s,c,d]),D.jsx(HN,{...t,ref:a})}),[d9,f9]=_v(GN,{isInside:!1}),HN=q.forwardRef((t,r)=>{const{__scopeTooltip:o,children:n,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:s,...l}=t,u=jv(Sc,o),c=rS(o),{onClose:h}=u;return q.useEffect(()=>(document.addEventListener(JT,h),()=>document.removeEventListener(JT,h)),[h]),q.useEffect(()=>{if(u.trigger){const f=d=>{const m=d.target;m!=null&&m.contains(u.trigger)&&h()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[u.trigger,h]),D.jsx(hv,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:h,children:D.jsxs($N,{"data-state":u.stateAttribute,...c,...l,ref:r,style:{...l.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:[D.jsx(RI,{children:n}),D.jsx(d9,{scope:o,isInside:!0,children:D.jsx(QU,{id:u.contentId,role:"tooltip",children:i||n})})]})})});WN.displayName=Sc;var qN="TooltipArrow",h9=q.forwardRef((t,r)=>{const{__scopeTooltip:o,...n}=t,i=rS(o);return f9(qN,o).isInside?null:D.jsx(UN,{...i,...n,ref:r})});h9.displayName=qN;function p9(t,r){const o=Math.abs(r.top-t.y),n=Math.abs(r.bottom-t.y),i=Math.abs(r.right-t.x),a=Math.abs(r.left-t.x);switch(Math.min(o,n,i,a)){case a:return"left";case i:return"right";case o:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function m9(t,r,o=5){const n=[];switch(r){case"top":n.push({x:t.x-o,y:t.y+o},{x:t.x+o,y:t.y+o});break;case"bottom":n.push({x:t.x-o,y:t.y-o},{x:t.x+o,y:t.y-o});break;case"left":n.push({x:t.x+o,y:t.y-o},{x:t.x+o,y:t.y+o});break;case"right":n.push({x:t.x-o,y:t.y-o},{x:t.x-o,y:t.y+o});break}return n}function y9(t){const{top:r,right:o,bottom:n,left:i}=t;return[{x:i,y:r},{x:o,y:r},{x:o,y:n},{x:i,y:n}]}function g9(t,r){const{x:o,y:n}=t;let i=!1;for(let a=0,s=r.length-1;an!=h>n&&o<(c-l)*(n-u)/(h-u)+l&&(i=!i)}return i}function v9(t){const r=t.slice();return r.sort((o,n)=>o.xn.x?1:o.yn.y?1:0),b9(r)}function b9(t){if(t.length<=1)return t.slice();const r=[];for(let n=0;n=2;){const a=r[r.length-1],s=r[r.length-2];if((a.x-s.x)*(i.y-s.y)>=(a.y-s.y)*(i.x-s.x))r.pop();else break}r.push(i)}r.pop();const o=[];for(let n=t.length-1;n>=0;n--){const i=t[n];for(;o.length>=2;){const a=o[o.length-1],s=o[o.length-2];if((a.x-s.x)*(i.y-s.y)>=(a.y-s.y)*(i.x-s.x))o.pop();else break}o.push(i)}return o.pop(),r.length===1&&o.length===1&&r[0].x===o[0].x&&r[0].y===o[0].y?r:r.concat(o)}var x9=VN,XN=WN;const w9=x9,_9=q.forwardRef(({className:t,sideOffset:r=4,...o},n)=>D.jsx(XN,{ref:n,sideOffset:r,className:St("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]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...o}));_9.displayName=XN.displayName;var pp=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(){}},Ul=typeof window>"u"||"Deno"in globalThis;function Bo(){}function j9(t,r){return typeof t=="function"?t(r):t}function Ex(t){return typeof t=="number"&&t>=0&&t!==1/0}function YN(t,r){return Math.max(t+(r||0)-Date.now(),0)}function Yu(t,r){return typeof t=="function"?t(r):t}function mi(t,r){return typeof t=="function"?t(r):t}function eO(t,r){const{type:o="all",exact:n,fetchStatus:i,predicate:a,queryKey:s,stale:l}=t;if(s){if(n){if(r.queryHash!==nS(s,r.options))return!1}else if(!lh(r.queryKey,s))return!1}if(o!=="all"){const u=r.isActive();if(o==="active"&&!u||o==="inactive"&&u)return!1}return!(typeof l=="boolean"&&r.isStale()!==l||i&&i!==r.state.fetchStatus||a&&!a(r))}function tO(t,r){const{exact:o,status:n,predicate:i,mutationKey:a}=t;if(a){if(!r.options.mutationKey)return!1;if(o){if(sh(r.options.mutationKey)!==sh(a))return!1}else if(!lh(r.options.mutationKey,a))return!1}return!(n&&r.state.status!==n||i&&!i(r))}function nS(t,r){return((r==null?void 0:r.queryKeyHashFn)||sh)(t)}function sh(t){return JSON.stringify(t,(r,o)=>Ox(o)?Object.keys(o).sort().reduce((n,i)=>(n[i]=o[i],n),{}):o)}function lh(t,r){return t===r?!0:typeof t!=typeof r?!1:t&&r&&typeof t=="object"&&typeof r=="object"?!Object.keys(r).some(o=>!lh(t[o],r[o])):!1}function KN(t,r){if(t===r)return t;const o=rO(t)&&rO(r);if(o||Ox(t)&&Ox(r)){const n=o?t:Object.keys(t),i=n.length,a=o?r:Object.keys(r),s=a.length,l=o?[]:{};let u=0;for(let c=0;c{setTimeout(r,t)})}function kx(t,r,o){return typeof o.structuralSharing=="function"?o.structuralSharing(t,r):o.structuralSharing!==!1?KN(t,r):r}function E9(t,r,o=0){const n=[...t,r];return o&&n.length>o?n.slice(1):n}function T9(t,r,o=0){const n=[r,...t];return o&&n.length>o?n.slice(0,-1):n}var oS=Symbol();function ZN(t,r){return!t.queryFn&&(r!=null&&r.initialPromise)?()=>r.initialPromise:!t.queryFn||t.queryFn===oS?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var xl,ds,nc,lM,O9=(lM=class extends pp{constructor(){super();Tt(this,xl);Tt(this,ds);Tt(this,nc);ft(this,nc,r=>{if(!Ul&&window.addEventListener){const o=()=>r();return window.addEventListener("visibilitychange",o,!1),()=>{window.removeEventListener("visibilitychange",o)}}})}onSubscribe(){Ae(this,ds)||this.setEventListener(Ae(this,nc))}onUnsubscribe(){var r;this.hasListeners()||((r=Ae(this,ds))==null||r.call(this),ft(this,ds,void 0))}setEventListener(r){var o;ft(this,nc,r),(o=Ae(this,ds))==null||o.call(this),ft(this,ds,r(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(r){Ae(this,xl)!==r&&(ft(this,xl,r),this.onFocus())}onFocus(){const r=this.isFocused();this.listeners.forEach(o=>{o(r)})}isFocused(){var r;return typeof Ae(this,xl)=="boolean"?Ae(this,xl):((r=globalThis.document)==null?void 0:r.visibilityState)!=="hidden"}},xl=new WeakMap,ds=new WeakMap,nc=new WeakMap,lM),iS=new O9,oc,fs,ic,uM,k9=(uM=class extends pp{constructor(){super();Tt(this,oc,!0);Tt(this,fs);Tt(this,ic);ft(this,ic,r=>{if(!Ul&&window.addEventListener){const o=()=>r(!0),n=()=>r(!1);return window.addEventListener("online",o,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",o),window.removeEventListener("offline",n)}}})}onSubscribe(){Ae(this,fs)||this.setEventListener(Ae(this,ic))}onUnsubscribe(){var r;this.hasListeners()||((r=Ae(this,fs))==null||r.call(this),ft(this,fs,void 0))}setEventListener(r){var o;ft(this,ic,r),(o=Ae(this,fs))==null||o.call(this),ft(this,fs,r(this.setOnline.bind(this)))}setOnline(r){Ae(this,oc)!==r&&(ft(this,oc,r),this.listeners.forEach(n=>{n(r)}))}isOnline(){return Ae(this,oc)}},oc=new WeakMap,fs=new WeakMap,ic=new WeakMap,uM),Ey=new k9;function Px(){let t,r;const o=new Promise((i,a)=>{t=i,r=a});o.status="pending",o.catch(()=>{});function n(i){Object.assign(o,i),delete o.resolve,delete o.reject}return o.resolve=i=>{n({status:"fulfilled",value:i}),t(i)},o.reject=i=>{n({status:"rejected",reason:i}),r(i)},o}function P9(t){return Math.min(1e3*2**t,3e4)}function QN(t){return(t??"online")==="online"?Ey.isOnline():!0}var JN=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function Ob(t){return t instanceof JN}function eL(t){let r=!1,o=0,n=!1,i;const a=Px(),s=p=>{var g;n||(d(new JN(p)),(g=t.abort)==null||g.call(t))},l=()=>{r=!0},u=()=>{r=!1},c=()=>iS.isFocused()&&(t.networkMode==="always"||Ey.isOnline())&&t.canRun(),h=()=>QN(t.networkMode)&&t.canRun(),f=p=>{var g;n||(n=!0,(g=t.onSuccess)==null||g.call(t,p),i==null||i(),a.resolve(p))},d=p=>{var g;n||(n=!0,(g=t.onError)==null||g.call(t,p),i==null||i(),a.reject(p))},m=()=>new Promise(p=>{var g;i=b=>{(n||c())&&p(b)},(g=t.onPause)==null||g.call(t)}).then(()=>{var p;i=void 0,n||(p=t.onContinue)==null||p.call(t)}),y=()=>{if(n)return;let p;const g=o===0?t.initialPromise:void 0;try{p=g??t.fn()}catch(b){p=Promise.reject(b)}Promise.resolve(p).then(f).catch(b=>{var E;if(n)return;const x=t.retry??(Ul?0:3),v=t.retryDelay??P9,w=typeof v=="function"?v(o,b):v,_=x===!0||typeof x=="number"&&oc()?void 0:m()).then(()=>{r?d(b):y()})})};return{promise:a,cancel:s,continue:()=>(i==null||i(),a),cancelRetry:l,continueRetry:u,canStart:h,start:()=>(h()?y():m().then(y),a)}}function C9(){let t=[],r=0,o=l=>{l()},n=l=>{l()},i=l=>setTimeout(l,0);const a=l=>{r?t.push(l):i(()=>{o(l)})},s=()=>{const l=t;t=[],l.length&&i(()=>{n(()=>{l.forEach(u=>{o(u)})})})};return{batch:l=>{let u;r++;try{u=l()}finally{r--,r||s()}return u},batchCalls:l=>(...u)=>{a(()=>{l(...u)})},schedule:a,setNotifyFunction:l=>{o=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{i=l}}}var Sn=C9(),wl,cM,tL=(cM=class{constructor(){Tt(this,wl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ex(this.gcTime)&&ft(this,wl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Ul?1/0:5*60*1e3))}clearGcTimeout(){Ae(this,wl)&&(clearTimeout(Ae(this,wl)),ft(this,wl,void 0))}},wl=new WeakMap,cM),ac,sc,Uo,Nn,tp,_l,ui,aa,dM,A9=(dM=class extends tL{constructor(r){super();Tt(this,ui);Tt(this,ac);Tt(this,sc);Tt(this,Uo);Tt(this,Nn);Tt(this,tp);Tt(this,_l);ft(this,_l,!1),ft(this,tp,r.defaultOptions),this.setOptions(r.options),this.observers=[],ft(this,Uo,r.cache),this.queryKey=r.queryKey,this.queryHash=r.queryHash,ft(this,ac,M9(this.options)),this.state=r.state??Ae(this,ac),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var r;return(r=Ae(this,Nn))==null?void 0:r.promise}setOptions(r){this.options={...Ae(this,tp),...r},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Ae(this,Uo).remove(this)}setData(r,o){const n=kx(this.state.data,r,this.options);return Bt(this,ui,aa).call(this,{data:n,type:"success",dataUpdatedAt:o==null?void 0:o.updatedAt,manual:o==null?void 0:o.manual}),n}setState(r,o){Bt(this,ui,aa).call(this,{type:"setState",state:r,setStateOptions:o})}cancel(r){var n,i;const o=(n=Ae(this,Nn))==null?void 0:n.promise;return(i=Ae(this,Nn))==null||i.cancel(r),o?o.then(Bo).catch(Bo):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Ae(this,ac))}isActive(){return this.observers.some(r=>mi(r.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===oS||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(r=>r.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(r=0){return this.state.isInvalidated||this.state.data===void 0||!YN(this.state.dataUpdatedAt,r)}onFocus(){var o;const r=this.observers.find(n=>n.shouldFetchOnWindowFocus());r==null||r.refetch({cancelRefetch:!1}),(o=Ae(this,Nn))==null||o.continue()}onOnline(){var o;const r=this.observers.find(n=>n.shouldFetchOnReconnect());r==null||r.refetch({cancelRefetch:!1}),(o=Ae(this,Nn))==null||o.continue()}addObserver(r){this.observers.includes(r)||(this.observers.push(r),this.clearGcTimeout(),Ae(this,Uo).notify({type:"observerAdded",query:this,observer:r}))}removeObserver(r){this.observers.includes(r)&&(this.observers=this.observers.filter(o=>o!==r),this.observers.length||(Ae(this,Nn)&&(Ae(this,_l)?Ae(this,Nn).cancel({revert:!0}):Ae(this,Nn).cancelRetry()),this.scheduleGc()),Ae(this,Uo).notify({type:"observerRemoved",query:this,observer:r}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Bt(this,ui,aa).call(this,{type:"invalidate"})}fetch(r,o){var u,c,h;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(o!=null&&o.cancelRefetch))this.cancel({silent:!0});else if(Ae(this,Nn))return Ae(this,Nn).continueRetry(),Ae(this,Nn).promise}if(r&&this.setOptions(r),!this.options.queryFn){const f=this.observers.find(d=>d.options.queryFn);f&&this.setOptions(f.options)}const n=new AbortController,i=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(ft(this,_l,!0),n.signal)})},a=()=>{const f=ZN(this.options,o),d={queryKey:this.queryKey,meta:this.meta};return i(d),ft(this,_l,!1),this.options.persister?this.options.persister(f,d,this):f(d)},s={fetchOptions:o,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:a};i(s),(u=this.options.behavior)==null||u.onFetch(s,this),ft(this,sc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=s.fetchOptions)==null?void 0:c.meta))&&Bt(this,ui,aa).call(this,{type:"fetch",meta:(h=s.fetchOptions)==null?void 0:h.meta});const l=f=>{var d,m,y,p;Ob(f)&&f.silent||Bt(this,ui,aa).call(this,{type:"error",error:f}),Ob(f)||((m=(d=Ae(this,Uo).config).onError)==null||m.call(d,f,this),(p=(y=Ae(this,Uo).config).onSettled)==null||p.call(y,this.state.data,f,this)),this.scheduleGc()};return ft(this,Nn,eL({initialPromise:o==null?void 0:o.initialPromise,fn:s.fetchFn,abort:n.abort.bind(n),onSuccess:f=>{var d,m,y,p;if(f===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(g){l(g);return}(m=(d=Ae(this,Uo).config).onSuccess)==null||m.call(d,f,this),(p=(y=Ae(this,Uo).config).onSettled)==null||p.call(y,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,d)=>{Bt(this,ui,aa).call(this,{type:"failed",failureCount:f,error:d})},onPause:()=>{Bt(this,ui,aa).call(this,{type:"pause"})},onContinue:()=>{Bt(this,ui,aa).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),Ae(this,Nn).start()}},ac=new WeakMap,sc=new WeakMap,Uo=new WeakMap,Nn=new WeakMap,tp=new WeakMap,_l=new WeakMap,ui=new WeakSet,aa=function(r){const o=n=>{switch(r.type){case"failed":return{...n,fetchFailureCount:r.failureCount,fetchFailureReason:r.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...rL(n.data,this.options),fetchMeta:r.meta??null};case"success":return{...n,data:r.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:r.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!r.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=r.error;return Ob(i)&&i.revert&&Ae(this,sc)?{...Ae(this,sc),fetchStatus:"idle"}:{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...r.state}}};this.state=o(this.state),Sn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),Ae(this,Uo).notify({query:this,type:"updated",action:r})})},dM);function rL(t,r){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:QN(r.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function M9(t){const r=typeof t.initialData=="function"?t.initialData():t.initialData,o=r!==void 0,n=o?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:r,dataUpdateCount:0,dataUpdatedAt:o?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:o?"success":"pending",fetchStatus:"idle"}}var Ii,fM,R9=(fM=class extends pp{constructor(r={}){super();Tt(this,Ii);this.config=r,ft(this,Ii,new Map)}build(r,o,n){const i=o.queryKey,a=o.queryHash??nS(i,o);let s=this.get(a);return s||(s=new A9({cache:this,queryKey:i,queryHash:a,options:r.defaultQueryOptions(o),state:n,defaultOptions:r.getQueryDefaults(i)}),this.add(s)),s}add(r){Ae(this,Ii).has(r.queryHash)||(Ae(this,Ii).set(r.queryHash,r),this.notify({type:"added",query:r}))}remove(r){const o=Ae(this,Ii).get(r.queryHash);o&&(r.destroy(),o===r&&Ae(this,Ii).delete(r.queryHash),this.notify({type:"removed",query:r}))}clear(){Sn.batch(()=>{this.getAll().forEach(r=>{this.remove(r)})})}get(r){return Ae(this,Ii).get(r)}getAll(){return[...Ae(this,Ii).values()]}find(r){const o={exact:!0,...r};return this.getAll().find(n=>eO(o,n))}findAll(r={}){const o=this.getAll();return Object.keys(r).length>0?o.filter(n=>eO(r,n)):o}notify(r){Sn.batch(()=>{this.listeners.forEach(o=>{o(r)})})}onFocus(){Sn.batch(()=>{this.getAll().forEach(r=>{r.onFocus()})})}onOnline(){Sn.batch(()=>{this.getAll().forEach(r=>{r.onOnline()})})}},Ii=new WeakMap,fM),Ni,Hn,jl,Li,Za,hM,I9=(hM=class extends tL{constructor(r){super();Tt(this,Li);Tt(this,Ni);Tt(this,Hn);Tt(this,jl);this.mutationId=r.mutationId,ft(this,Hn,r.mutationCache),ft(this,Ni,[]),this.state=r.state||N9(),this.setOptions(r.options),this.scheduleGc()}setOptions(r){this.options=r,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(r){Ae(this,Ni).includes(r)||(Ae(this,Ni).push(r),this.clearGcTimeout(),Ae(this,Hn).notify({type:"observerAdded",mutation:this,observer:r}))}removeObserver(r){ft(this,Ni,Ae(this,Ni).filter(o=>o!==r)),this.scheduleGc(),Ae(this,Hn).notify({type:"observerRemoved",mutation:this,observer:r})}optionalRemove(){Ae(this,Ni).length||(this.state.status==="pending"?this.scheduleGc():Ae(this,Hn).remove(this))}continue(){var r;return((r=Ae(this,jl))==null?void 0:r.continue())??this.execute(this.state.variables)}async execute(r){var i,a,s,l,u,c,h,f,d,m,y,p,g,b,x,v,w,_,E,S;ft(this,jl,eL({fn:()=>this.options.mutationFn?this.options.mutationFn(r):Promise.reject(new Error("No mutationFn found")),onFail:(T,k)=>{Bt(this,Li,Za).call(this,{type:"failed",failureCount:T,error:k})},onPause:()=>{Bt(this,Li,Za).call(this,{type:"pause"})},onContinue:()=>{Bt(this,Li,Za).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Ae(this,Hn).canRun(this)}));const o=this.state.status==="pending",n=!Ae(this,jl).canStart();try{if(!o){Bt(this,Li,Za).call(this,{type:"pending",variables:r,isPaused:n}),await((a=(i=Ae(this,Hn).config).onMutate)==null?void 0:a.call(i,r,this));const k=await((l=(s=this.options).onMutate)==null?void 0:l.call(s,r));k!==this.state.context&&Bt(this,Li,Za).call(this,{type:"pending",context:k,variables:r,isPaused:n})}const T=await Ae(this,jl).start();return await((c=(u=Ae(this,Hn).config).onSuccess)==null?void 0:c.call(u,T,r,this.state.context,this)),await((f=(h=this.options).onSuccess)==null?void 0:f.call(h,T,r,this.state.context)),await((m=(d=Ae(this,Hn).config).onSettled)==null?void 0:m.call(d,T,null,this.state.variables,this.state.context,this)),await((p=(y=this.options).onSettled)==null?void 0:p.call(y,T,null,r,this.state.context)),Bt(this,Li,Za).call(this,{type:"success",data:T}),T}catch(T){try{throw await((b=(g=Ae(this,Hn).config).onError)==null?void 0:b.call(g,T,r,this.state.context,this)),await((v=(x=this.options).onError)==null?void 0:v.call(x,T,r,this.state.context)),await((_=(w=Ae(this,Hn).config).onSettled)==null?void 0:_.call(w,void 0,T,this.state.variables,this.state.context,this)),await((S=(E=this.options).onSettled)==null?void 0:S.call(E,void 0,T,r,this.state.context)),T}finally{Bt(this,Li,Za).call(this,{type:"error",error:T})}}finally{Ae(this,Hn).runNext(this)}}},Ni=new WeakMap,Hn=new WeakMap,jl=new WeakMap,Li=new WeakSet,Za=function(r){const o=n=>{switch(r.type){case"failed":return{...n,failureCount:r.failureCount,failureReason:r.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:r.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:r.isPaused,status:"pending",variables:r.variables,submittedAt:Date.now()};case"success":return{...n,data:r.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:r.error,failureCount:n.failureCount+1,failureReason:r.error,isPaused:!1,status:"error"}}};this.state=o(this.state),Sn.batch(()=>{Ae(this,Ni).forEach(n=>{n.onMutationUpdate(r)}),Ae(this,Hn).notify({mutation:this,type:"updated",action:r})})},hM);function N9(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var _o,rp,pM,L9=(pM=class extends pp{constructor(r={}){super();Tt(this,_o);Tt(this,rp);this.config=r,ft(this,_o,new Map),ft(this,rp,Date.now())}build(r,o,n){const i=new I9({mutationCache:this,mutationId:++Fp(this,rp)._,options:r.defaultMutationOptions(o),state:n});return this.add(i),i}add(r){const o=am(r),n=Ae(this,_o).get(o)??[];n.push(r),Ae(this,_o).set(o,n),this.notify({type:"added",mutation:r})}remove(r){var n;const o=am(r);if(Ae(this,_o).has(o)){const i=(n=Ae(this,_o).get(o))==null?void 0:n.filter(a=>a!==r);i&&(i.length===0?Ae(this,_o).delete(o):Ae(this,_o).set(o,i))}this.notify({type:"removed",mutation:r})}canRun(r){var n;const o=(n=Ae(this,_o).get(am(r)))==null?void 0:n.find(i=>i.state.status==="pending");return!o||o===r}runNext(r){var n;const o=(n=Ae(this,_o).get(am(r)))==null?void 0:n.find(i=>i!==r&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}clear(){Sn.batch(()=>{this.getAll().forEach(r=>{this.remove(r)})})}getAll(){return[...Ae(this,_o).values()].flat()}find(r){const o={exact:!0,...r};return this.getAll().find(n=>tO(o,n))}findAll(r={}){return this.getAll().filter(o=>tO(r,o))}notify(r){Sn.batch(()=>{this.listeners.forEach(o=>{o(r)})})}resumePausedMutations(){const r=this.getAll().filter(o=>o.state.isPaused);return Sn.batch(()=>Promise.all(r.map(o=>o.continue().catch(Bo))))}},_o=new WeakMap,rp=new WeakMap,pM);function am(t){var r;return((r=t.options.scope)==null?void 0:r.id)??String(t.mutationId)}function oO(t){return{onFetch:(r,o)=>{var h,f,d,m,y;const n=r.options,i=(d=(f=(h=r.fetchOptions)==null?void 0:h.meta)==null?void 0:f.fetchMore)==null?void 0:d.direction,a=((m=r.state.data)==null?void 0:m.pages)||[],s=((y=r.state.data)==null?void 0:y.pageParams)||[];let l={pages:[],pageParams:[]},u=0;const c=async()=>{let p=!1;const g=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(r.signal.aborted?p=!0:r.signal.addEventListener("abort",()=>{p=!0}),r.signal)})},b=ZN(r.options,r.fetchOptions),x=async(v,w,_)=>{if(p)return Promise.reject();if(w==null&&v.pages.length)return Promise.resolve(v);const E={queryKey:r.queryKey,pageParam:w,direction:_?"backward":"forward",meta:r.options.meta};g(E);const S=await b(E),{maxPages:T}=r.options,k=_?T9:E9;return{pages:k(v.pages,S,T),pageParams:k(v.pageParams,w,T)}};if(i&&a.length){const v=i==="backward",w=v?D9:iO,_={pages:a,pageParams:s},E=w(n,_);l=await x(_,E,v)}else{const v=t??a.length;do{const w=u===0?s[0]??n.initialPageParam:iO(n,l);if(u>0&&w==null)break;l=await x(l,w),u++}while(u{var p,g;return(g=(p=r.options).persister)==null?void 0:g.call(p,c,{queryKey:r.queryKey,meta:r.options.meta,signal:r.signal},o)}:r.fetchFn=c}}}function iO(t,{pages:r,pageParams:o}){const n=r.length-1;return r.length>0?t.getNextPageParam(r[n],r,o[n],o):void 0}function D9(t,{pages:r,pageParams:o}){var n;return r.length>0?(n=t.getPreviousPageParam)==null?void 0:n.call(t,r[0],r,o[0],o):void 0}var Fr,hs,ps,lc,uc,ms,cc,dc,mM,F9=(mM=class{constructor(t={}){Tt(this,Fr);Tt(this,hs);Tt(this,ps);Tt(this,lc);Tt(this,uc);Tt(this,ms);Tt(this,cc);Tt(this,dc);ft(this,Fr,t.queryCache||new R9),ft(this,hs,t.mutationCache||new L9),ft(this,ps,t.defaultOptions||{}),ft(this,lc,new Map),ft(this,uc,new Map),ft(this,ms,0)}mount(){Fp(this,ms)._++,Ae(this,ms)===1&&(ft(this,cc,iS.subscribe(async t=>{t&&(await this.resumePausedMutations(),Ae(this,Fr).onFocus())})),ft(this,dc,Ey.subscribe(async t=>{t&&(await this.resumePausedMutations(),Ae(this,Fr).onOnline())})))}unmount(){var t,r;Fp(this,ms)._--,Ae(this,ms)===0&&((t=Ae(this,cc))==null||t.call(this),ft(this,cc,void 0),(r=Ae(this,dc))==null||r.call(this),ft(this,dc,void 0))}isFetching(t){return Ae(this,Fr).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return Ae(this,hs).findAll({...t,status:"pending"}).length}getQueryData(t){var o;const r=this.defaultQueryOptions({queryKey:t});return(o=Ae(this,Fr).get(r.queryHash))==null?void 0:o.state.data}ensureQueryData(t){const r=this.getQueryData(t.queryKey);if(r===void 0)return this.fetchQuery(t);{const o=this.defaultQueryOptions(t),n=Ae(this,Fr).build(this,o);return t.revalidateIfStale&&n.isStaleByTime(Yu(o.staleTime,n))&&this.prefetchQuery(o),Promise.resolve(r)}}getQueriesData(t){return Ae(this,Fr).findAll(t).map(({queryKey:r,state:o})=>{const n=o.data;return[r,n]})}setQueryData(t,r,o){const n=this.defaultQueryOptions({queryKey:t}),i=Ae(this,Fr).get(n.queryHash),a=i==null?void 0:i.state.data,s=j9(r,a);if(s!==void 0)return Ae(this,Fr).build(this,n).setData(s,{...o,manual:!0})}setQueriesData(t,r,o){return Sn.batch(()=>Ae(this,Fr).findAll(t).map(({queryKey:n})=>[n,this.setQueryData(n,r,o)]))}getQueryState(t){var o;const r=this.defaultQueryOptions({queryKey:t});return(o=Ae(this,Fr).get(r.queryHash))==null?void 0:o.state}removeQueries(t){const r=Ae(this,Fr);Sn.batch(()=>{r.findAll(t).forEach(o=>{r.remove(o)})})}resetQueries(t,r){const o=Ae(this,Fr),n={type:"active",...t};return Sn.batch(()=>(o.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries(n,r)))}cancelQueries(t={},r={}){const o={revert:!0,...r},n=Sn.batch(()=>Ae(this,Fr).findAll(t).map(i=>i.cancel(o)));return Promise.all(n).then(Bo).catch(Bo)}invalidateQueries(t={},r={}){return Sn.batch(()=>{if(Ae(this,Fr).findAll(t).forEach(n=>{n.invalidate()}),t.refetchType==="none")return Promise.resolve();const o={...t,type:t.refetchType??t.type??"active"};return this.refetchQueries(o,r)})}refetchQueries(t={},r){const o={...r,cancelRefetch:(r==null?void 0:r.cancelRefetch)??!0},n=Sn.batch(()=>Ae(this,Fr).findAll(t).filter(i=>!i.isDisabled()).map(i=>{let a=i.fetch(void 0,o);return o.throwOnError||(a=a.catch(Bo)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(Bo)}fetchQuery(t){const r=this.defaultQueryOptions(t);r.retry===void 0&&(r.retry=!1);const o=Ae(this,Fr).build(this,r);return o.isStaleByTime(Yu(r.staleTime,o))?o.fetch(r):Promise.resolve(o.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Bo).catch(Bo)}fetchInfiniteQuery(t){return t.behavior=oO(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Bo).catch(Bo)}ensureInfiniteQueryData(t){return t.behavior=oO(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Ey.isOnline()?Ae(this,hs).resumePausedMutations():Promise.resolve()}getQueryCache(){return Ae(this,Fr)}getMutationCache(){return Ae(this,hs)}getDefaultOptions(){return Ae(this,ps)}setDefaultOptions(t){ft(this,ps,t)}setQueryDefaults(t,r){Ae(this,lc).set(sh(t),{queryKey:t,defaultOptions:r})}getQueryDefaults(t){const r=[...Ae(this,lc).values()];let o={};return r.forEach(n=>{lh(t,n.queryKey)&&(o={...o,...n.defaultOptions})}),o}setMutationDefaults(t,r){Ae(this,uc).set(sh(t),{mutationKey:t,defaultOptions:r})}getMutationDefaults(t){const r=[...Ae(this,uc).values()];let o={};return r.forEach(n=>{lh(t,n.mutationKey)&&(o={...o,...n.defaultOptions})}),o}defaultQueryOptions(t){if(t._defaulted)return t;const r={...Ae(this,ps).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return r.queryHash||(r.queryHash=nS(r.queryKey,r)),r.refetchOnReconnect===void 0&&(r.refetchOnReconnect=r.networkMode!=="always"),r.throwOnError===void 0&&(r.throwOnError=!!r.suspense),!r.networkMode&&r.persister&&(r.networkMode="offlineFirst"),r.enabled!==!0&&r.queryFn===oS&&(r.enabled=!1),r}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...Ae(this,ps).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){Ae(this,Fr).clear(),Ae(this,hs).clear()}},Fr=new WeakMap,hs=new WeakMap,ps=new WeakMap,lc=new WeakMap,uc=new WeakMap,ms=new WeakMap,cc=new WeakMap,dc=new WeakMap,mM),ao,zt,np,qn,Sl,fc,ys,Di,op,hc,pc,El,Tl,gs,mc,Jt,lf,Cx,Ax,Mx,Rx,Ix,Nx,Lx,nL,yM,$9=(yM=class extends pp{constructor(r,o){super();Tt(this,Jt);Tt(this,ao);Tt(this,zt);Tt(this,np);Tt(this,qn);Tt(this,Sl);Tt(this,fc);Tt(this,ys);Tt(this,Di);Tt(this,op);Tt(this,hc);Tt(this,pc);Tt(this,El);Tt(this,Tl);Tt(this,gs);Tt(this,mc,new Set);this.options=o,ft(this,ao,r),ft(this,Di,null),ft(this,ys,Px()),this.options.experimental_prefetchInRender||Ae(this,ys).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(o)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Ae(this,zt).addObserver(this),aO(Ae(this,zt),this.options)?Bt(this,Jt,lf).call(this):this.updateResult(),Bt(this,Jt,Rx).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Dx(Ae(this,zt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Dx(Ae(this,zt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Bt(this,Jt,Ix).call(this),Bt(this,Jt,Nx).call(this),Ae(this,zt).removeObserver(this)}setOptions(r,o){const n=this.options,i=Ae(this,zt);if(this.options=Ae(this,ao).defaultQueryOptions(r),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof mi(this.options.enabled,Ae(this,zt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Bt(this,Jt,Lx).call(this),Ae(this,zt).setOptions(this.options),n._defaulted&&!Tx(this.options,n)&&Ae(this,ao).getQueryCache().notify({type:"observerOptionsUpdated",query:Ae(this,zt),observer:this});const a=this.hasListeners();a&&sO(Ae(this,zt),i,this.options,n)&&Bt(this,Jt,lf).call(this),this.updateResult(o),a&&(Ae(this,zt)!==i||mi(this.options.enabled,Ae(this,zt))!==mi(n.enabled,Ae(this,zt))||Yu(this.options.staleTime,Ae(this,zt))!==Yu(n.staleTime,Ae(this,zt)))&&Bt(this,Jt,Cx).call(this);const s=Bt(this,Jt,Ax).call(this);a&&(Ae(this,zt)!==i||mi(this.options.enabled,Ae(this,zt))!==mi(n.enabled,Ae(this,zt))||s!==Ae(this,gs))&&Bt(this,Jt,Mx).call(this,s)}getOptimisticResult(r){const o=Ae(this,ao).getQueryCache().build(Ae(this,ao),r),n=this.createResult(o,r);return B9(this,n)&&(ft(this,qn,n),ft(this,fc,this.options),ft(this,Sl,Ae(this,zt).state)),n}getCurrentResult(){return Ae(this,qn)}trackResult(r,o){const n={};return Object.keys(r).forEach(i=>{Object.defineProperty(n,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),o==null||o(i),r[i])})}),n}trackProp(r){Ae(this,mc).add(r)}getCurrentQuery(){return Ae(this,zt)}refetch({...r}={}){return this.fetch({...r})}fetchOptimistic(r){const o=Ae(this,ao).defaultQueryOptions(r),n=Ae(this,ao).getQueryCache().build(Ae(this,ao),o);return n.fetch().then(()=>this.createResult(n,o))}fetch(r){return Bt(this,Jt,lf).call(this,{...r,cancelRefetch:r.cancelRefetch??!0}).then(()=>(this.updateResult(),Ae(this,qn)))}createResult(r,o){var T;const n=Ae(this,zt),i=this.options,a=Ae(this,qn),s=Ae(this,Sl),l=Ae(this,fc),c=r!==n?r.state:Ae(this,np),{state:h}=r;let f={...h},d=!1,m;if(o._optimisticResults){const k=this.hasListeners(),A=!k&&aO(r,o),O=k&&sO(r,n,o,i);(A||O)&&(f={...f,...rL(h.data,r.options)}),o._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:y,errorUpdatedAt:p,status:g}=f;if(o.select&&f.data!==void 0)if(a&&f.data===(s==null?void 0:s.data)&&o.select===Ae(this,op))m=Ae(this,hc);else try{ft(this,op,o.select),m=o.select(f.data),m=kx(a==null?void 0:a.data,m,o),ft(this,hc,m),ft(this,Di,null)}catch(k){ft(this,Di,k)}else m=f.data;if(o.placeholderData!==void 0&&m===void 0&&g==="pending"){let k;if(a!=null&&a.isPlaceholderData&&o.placeholderData===(l==null?void 0:l.placeholderData))k=a.data;else if(k=typeof o.placeholderData=="function"?o.placeholderData((T=Ae(this,pc))==null?void 0:T.state.data,Ae(this,pc)):o.placeholderData,o.select&&k!==void 0)try{k=o.select(k),ft(this,Di,null)}catch(A){ft(this,Di,A)}k!==void 0&&(g="success",m=kx(a==null?void 0:a.data,k,o),d=!0)}Ae(this,Di)&&(y=Ae(this,Di),m=Ae(this,hc),p=Date.now(),g="error");const b=f.fetchStatus==="fetching",x=g==="pending",v=g==="error",w=x&&b,_=m!==void 0,S={status:g,fetchStatus:f.fetchStatus,isPending:x,isSuccess:g==="success",isError:v,isInitialLoading:w,isLoading:w,data:m,dataUpdatedAt:f.dataUpdatedAt,error:y,errorUpdatedAt:p,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:b,isRefetching:b&&!x,isLoadingError:v&&!_,isPaused:f.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:v&&_,isStale:aS(r,o),refetch:this.refetch,promise:Ae(this,ys)};if(this.options.experimental_prefetchInRender){const k=R=>{S.status==="error"?R.reject(S.error):S.data!==void 0&&R.resolve(S.data)},A=()=>{const R=ft(this,ys,S.promise=Px());k(R)},O=Ae(this,ys);switch(O.status){case"pending":r.queryHash===n.queryHash&&k(O);break;case"fulfilled":(S.status==="error"||S.data!==O.value)&&A();break;case"rejected":(S.status!=="error"||S.error!==O.reason)&&A();break}}return S}updateResult(r){const o=Ae(this,qn),n=this.createResult(Ae(this,zt),this.options);if(ft(this,Sl,Ae(this,zt).state),ft(this,fc,this.options),Ae(this,Sl).data!==void 0&&ft(this,pc,Ae(this,zt)),Tx(n,o))return;ft(this,qn,n);const i={},a=()=>{if(!o)return!0;const{notifyOnChangeProps:s}=this.options,l=typeof s=="function"?s():s;if(l==="all"||!l&&!Ae(this,mc).size)return!0;const u=new Set(l??Ae(this,mc));return this.options.throwOnError&&u.add("error"),Object.keys(Ae(this,qn)).some(c=>{const h=c;return Ae(this,qn)[h]!==o[h]&&u.has(h)})};(r==null?void 0:r.listeners)!==!1&&a()&&(i.listeners=!0),Bt(this,Jt,nL).call(this,{...i,...r})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Bt(this,Jt,Rx).call(this)}},ao=new WeakMap,zt=new WeakMap,np=new WeakMap,qn=new WeakMap,Sl=new WeakMap,fc=new WeakMap,ys=new WeakMap,Di=new WeakMap,op=new WeakMap,hc=new WeakMap,pc=new WeakMap,El=new WeakMap,Tl=new WeakMap,gs=new WeakMap,mc=new WeakMap,Jt=new WeakSet,lf=function(r){Bt(this,Jt,Lx).call(this);let o=Ae(this,zt).fetch(this.options,r);return r!=null&&r.throwOnError||(o=o.catch(Bo)),o},Cx=function(){Bt(this,Jt,Ix).call(this);const r=Yu(this.options.staleTime,Ae(this,zt));if(Ul||Ae(this,qn).isStale||!Ex(r))return;const n=YN(Ae(this,qn).dataUpdatedAt,r)+1;ft(this,El,setTimeout(()=>{Ae(this,qn).isStale||this.updateResult()},n))},Ax=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Ae(this,zt)):this.options.refetchInterval)??!1},Mx=function(r){Bt(this,Jt,Nx).call(this),ft(this,gs,r),!(Ul||mi(this.options.enabled,Ae(this,zt))===!1||!Ex(Ae(this,gs))||Ae(this,gs)===0)&&ft(this,Tl,setInterval(()=>{(this.options.refetchIntervalInBackground||iS.isFocused())&&Bt(this,Jt,lf).call(this)},Ae(this,gs)))},Rx=function(){Bt(this,Jt,Cx).call(this),Bt(this,Jt,Mx).call(this,Bt(this,Jt,Ax).call(this))},Ix=function(){Ae(this,El)&&(clearTimeout(Ae(this,El)),ft(this,El,void 0))},Nx=function(){Ae(this,Tl)&&(clearInterval(Ae(this,Tl)),ft(this,Tl,void 0))},Lx=function(){const r=Ae(this,ao).getQueryCache().build(Ae(this,ao),this.options);if(r===Ae(this,zt))return;const o=Ae(this,zt);ft(this,zt,r),ft(this,np,r.state),this.hasListeners()&&(o==null||o.removeObserver(this),r.addObserver(this))},nL=function(r){Sn.batch(()=>{r.listeners&&this.listeners.forEach(o=>{o(Ae(this,qn))}),Ae(this,ao).getQueryCache().notify({query:Ae(this,zt),type:"observerResultsUpdated"})})},yM);function U9(t,r){return mi(r.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&r.retryOnMount===!1)}function aO(t,r){return U9(t,r)||t.state.data!==void 0&&Dx(t,r,r.refetchOnMount)}function Dx(t,r,o){if(mi(r.enabled,t)!==!1){const n=typeof o=="function"?o(t):o;return n==="always"||n!==!1&&aS(t,r)}return!1}function sO(t,r,o,n){return(t!==r||mi(n.enabled,t)===!1)&&(!o.suspense||t.state.status!=="error")&&aS(t,o)}function aS(t,r){return mi(r.enabled,t)!==!1&&t.isStaleByTime(Yu(r.staleTime,t))}function B9(t,r){return!Tx(t.getCurrentResult(),r)}var oL=q.createContext(void 0),z9=t=>{const r=q.useContext(oL);if(!r)throw new Error("No QueryClient set, use QueryClientProvider to set one");return r},V9=({client:t,children:r})=>(q.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),D.jsx(oL.Provider,{value:t,children:r})),iL=q.createContext(!1),G9=()=>q.useContext(iL);iL.Provider;function W9(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var H9=q.createContext(W9()),q9=()=>q.useContext(H9);function X9(t,r){return typeof t=="function"?t(...r):!!t}function Y9(){}var K9=(t,r)=>{(t.suspense||t.throwOnError)&&(r.isReset()||(t.retryOnMount=!1))},Z9=t=>{q.useEffect(()=>{t.clearReset()},[t])},Q9=({result:t,errorResetBoundary:r,throwOnError:o,query:n})=>t.isError&&!r.isReset()&&!t.isFetching&&n&&X9(o,[t.error,n]),J9=t=>{t.suspense&&(t.staleTime===void 0&&(t.staleTime=1e3),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3)))},eV=(t,r)=>t.isLoading&&t.isFetching&&!r,tV=(t,r)=>(t==null?void 0:t.suspense)&&r.isPending,lO=(t,r,o)=>r.fetchOptimistic(t).catch(()=>{o.clearReset()});function rV(t,r,o){var h,f,d,m,y;const n=z9(),i=G9(),a=q9(),s=n.defaultQueryOptions(t);(f=(h=n.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||f.call(h,s),s._optimisticResults=i?"isRestoring":"optimistic",J9(s),K9(s,a),Z9(a);const l=!n.getQueryCache().get(s.queryHash),[u]=q.useState(()=>new r(n,s)),c=u.getOptimisticResult(s);if(q.useSyncExternalStore(q.useCallback(p=>{const g=i?()=>{}:u.subscribe(Sn.batchCalls(p));return u.updateResult(),g},[u,i]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),q.useEffect(()=>{u.setOptions(s,{listeners:!1})},[s,u]),tV(s,c))throw lO(s,u,a);if(Q9({result:c,errorResetBoundary:a,throwOnError:s.throwOnError,query:n.getQueryCache().get(s.queryHash)}))throw c.error;if((m=(d=n.getDefaultOptions().queries)==null?void 0:d._experimental_afterQuery)==null||m.call(d,s,c),s.experimental_prefetchInRender&&!Ul&&eV(c,i)){const p=l?lO(s,u,a):(y=n.getQueryCache().get(s.queryHash))==null?void 0:y.promise;p==null||p.catch(Y9).finally(()=>{u.updateResult()})}return s.notifyOnChangeProps?c:u.trackResult(c)}function Ty(t,r){return rV(t,$9)}/** * @remix-run/router v1.20.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function uh(){return uh=Object.assign?Object.assign.bind():function(t){for(var r=1;r"u")throw new Error(r)}function aL(t,r){if(!t){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function oV(){return Math.random().toString(36).substr(2,8)}function cO(t,r){return{usr:t.state,key:t.key,idx:r}}function Fx(t,r,o,n){return o===void 0&&(o=null),uh({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof r=="string"?sd(r):r,{state:o,key:r&&r.key||n||oV()})}function Oy(t){let{pathname:r="/",search:o="",hash:n=""}=t;return o&&o!=="?"&&(r+=o.charAt(0)==="?"?o:"?"+o),n&&n!=="#"&&(r+=n.charAt(0)==="#"?n:"#"+n),r}function sd(t){let r={};if(t){let o=t.indexOf("#");o>=0&&(r.hash=t.substr(o),t=t.substr(0,o));let n=t.indexOf("?");n>=0&&(r.search=t.substr(n),t=t.substr(0,n)),t&&(r.pathname=t)}return r}function iV(t,r,o,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:a=!1}=n,s=i.history,l=xs.Pop,u=null,c=h();c==null&&(c=0,s.replaceState(uh({},s.state,{idx:c}),""));function h(){return(s.state||{idx:null}).idx}function f(){l=xs.Pop;let g=h(),b=g==null?null:g-c;c=g,u&&u({action:l,location:p.location,delta:b})}function d(g,b){l=xs.Push;let x=Fx(p.location,g,b);c=h()+1;let v=cO(x,c),w=p.createHref(x);try{s.pushState(v,"",w)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;i.location.assign(w)}a&&u&&u({action:l,location:p.location,delta:1})}function m(g,b){l=xs.Replace;let x=Fx(p.location,g,b);c=h();let v=cO(x,c),w=p.createHref(x);s.replaceState(v,"",w),a&&u&&u({action:l,location:p.location,delta:0})}function y(g){let b=i.location.origin!=="null"?i.location.origin:i.location.href,x=typeof g=="string"?g:Oy(g);return x=x.replace(/ $/,"%20"),Qr(b,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,b)}let p={get action(){return l},get location(){return t(i,s)},listen(g){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(uO,f),u=g,()=>{i.removeEventListener(uO,f),u=null}},createHref(g){return r(i,g)},createURL:y,encodeLocation(g){let b=y(g);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:d,replace:m,go(g){return s.go(g)}};return p}var dO;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(dO||(dO={}));function aV(t,r,o){return o===void 0&&(o="/"),sV(t,r,o,!1)}function sV(t,r,o,n){let i=typeof r=="string"?sd(r):r,a=sS(i.pathname||"/",o);if(a==null)return null;let s=sL(t);lV(s);let l=null;for(let u=0;l==null&&u{let u={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:s,route:a};u.relativePath.startsWith("/")&&(Qr(u.relativePath.startsWith(n),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(n.length));let c=Cs([n,u.relativePath]),h=o.concat(u);a.children&&a.children.length>0&&(Qr(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),sL(a.children,r,h,c)),!(a.path==null&&!a.index)&&r.push({path:c,score:mV(c,a.index),routesMeta:h})};return t.forEach((a,s)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))i(a,s);else for(let u of lL(a.path))i(a,s,u)}),r}function lL(t){let r=t.split("/");if(r.length===0)return[];let[o,...n]=r,i=o.endsWith("?"),a=o.replace(/\?$/,"");if(n.length===0)return i?[a,""]:[a];let s=lL(n.join("/")),l=[];return l.push(...s.map(u=>u===""?a:[a,u].join("/"))),i&&l.push(...s),l.map(u=>t.startsWith("/")&&u===""?"/":u)}function lV(t){t.sort((r,o)=>r.score!==o.score?o.score-r.score:yV(r.routesMeta.map(n=>n.childrenIndex),o.routesMeta.map(n=>n.childrenIndex)))}const uV=/^:[\w-]+$/,cV=3,dV=2,fV=1,hV=10,pV=-2,fO=t=>t==="*";function mV(t,r){let o=t.split("/"),n=o.length;return o.some(fO)&&(n+=pV),r&&(n+=dV),o.filter(i=>!fO(i)).reduce((i,a)=>i+(uV.test(a)?cV:a===""?fV:hV),n)}function yV(t,r){return t.length===r.length&&t.slice(0,-1).every((n,i)=>n===r[i])?t[t.length-1]-r[r.length-1]:0}function gV(t,r,o){let{routesMeta:n}=t,i={},a="/",s=[];for(let l=0;l{let{paramName:d,isOptional:m}=h;if(d==="*"){let p=l[f]||"";s=a.slice(0,a.length-p.length).replace(/(.)\/+$/,"$1")}const y=l[f];return m&&!y?c[d]=void 0:c[d]=(y||"").replace(/%2F/g,"/"),c},{}),pathname:a,pathnameBase:s,pattern:t}}function vV(t,r,o){r===void 0&&(r=!1),o===void 0&&(o=!0),aL(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 n=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,l,u)=>(n.push({paramName:l,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(n.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,r?void 0:"i"),n]}function bV(t){try{return t.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return aL(!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 ("+r+").")),t}}function sS(t,r){if(r==="/")return t;if(!t.toLowerCase().startsWith(r.toLowerCase()))return null;let o=r.endsWith("/")?r.length-1:r.length,n=t.charAt(o);return n&&n!=="/"?null:t.slice(o)||"/"}function xV(t,r){r===void 0&&(r="/");let{pathname:o,search:n="",hash:i=""}=typeof t=="string"?sd(t):t;return{pathname:o?o.startsWith("/")?o:wV(o,r):r,search:SV(n),hash:EV(i)}}function wV(t,r){let o=r.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?o.length>1&&o.pop():i!=="."&&o.push(i)}),o.length>1?o.join("/"):"/"}function kb(t,r,o,n){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+r+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+o+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function _V(t){return t.filter((r,o)=>o===0||r.route.path&&r.route.path.length>0)}function uL(t,r){let o=_V(t);return r?o.map((n,i)=>i===o.length-1?n.pathname:n.pathnameBase):o.map(n=>n.pathnameBase)}function cL(t,r,o,n){n===void 0&&(n=!1);let i;typeof t=="string"?i=sd(t):(i=uh({},t),Qr(!i.pathname||!i.pathname.includes("?"),kb("?","pathname","search",i)),Qr(!i.pathname||!i.pathname.includes("#"),kb("#","pathname","hash",i)),Qr(!i.search||!i.search.includes("#"),kb("#","search","hash",i)));let a=t===""||i.pathname==="",s=a?"/":i.pathname,l;if(s==null)l=o;else{let f=r.length-1;if(!n&&s.startsWith("..")){let d=s.split("/");for(;d[0]==="..";)d.shift(),f-=1;i.pathname=d.join("/")}l=f>=0?r[f]:"/"}let u=xV(i,l),c=s&&s!=="/"&&s.endsWith("/"),h=(a||s===".")&&o.endsWith("/");return!u.pathname.endsWith("/")&&(c||h)&&(u.pathname+="/"),u}const Cs=t=>t.join("/").replace(/\/\/+/g,"/"),jV=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),SV=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,EV=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function TV(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const dL=["post","put","patch","delete"];new Set(dL);const OV=["get",...dL];new Set(OV);/** * React Router v6.27.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function ch(){return ch=Object.assign?Object.assign.bind():function(t){for(var r=1;r{l.current=!0}),q.useCallback(function(c,h){if(h===void 0&&(h={}),!l.current)return;if(typeof c=="number"){n.go(c);return}let f=cL(c,JSON.parse(s),a,h.relative==="path");t==null&&r!=="/"&&(f.pathname=f.pathname==="/"?r:Cs([r,f.pathname])),(h.replace?n.replace:n.push)(f,h.state,h)},[r,n,s,a,t])}function yp(){let{matches:t}=q.useContext(Gs),r=t[t.length-1];return r?r.params:{}}function pL(t,r){let{relative:o}=r===void 0?{}:r,{future:n}=q.useContext(Jl),{matches:i}=q.useContext(Gs),{pathname:a}=Ws(),s=JSON.stringify(uL(i,n.v7_relativeSplatPath));return q.useMemo(()=>cL(t,JSON.parse(s),a,o==="path"),[t,s,a,o])}function AV(t,r){return MV(t,r)}function MV(t,r,o,n){mp()||Qr(!1);let{navigator:i}=q.useContext(Jl),{matches:a}=q.useContext(Gs),s=a[a.length-1],l=s?s.params:{};s&&s.pathname;let u=s?s.pathnameBase:"/";s&&s.route;let c=Ws(),h;if(r){var f;let g=typeof r=="string"?sd(r):r;u==="/"||(f=g.pathname)!=null&&f.startsWith(u)||Qr(!1),h=g}else h=c;let d=h.pathname||"/",m=d;if(u!=="/"){let g=u.replace(/^\//,"").split("/");m="/"+d.replace(/^\//,"").split("/").slice(g.length).join("/")}let y=aV(t,{pathname:m}),p=DV(y&&y.map(g=>Object.assign({},g,{params:Object.assign({},l,g.params),pathname:Cs([u,i.encodeLocation?i.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?u:Cs([u,i.encodeLocation?i.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),a,o,n);return r&&p?q.createElement(Sv.Provider,{value:{location:ch({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:xs.Pop}},p):p}function RV(){let t=BV(),r=TV(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),o=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return q.createElement(q.Fragment,null,q.createElement("h2",null,"Unexpected Application Error!"),q.createElement("h3",{style:{fontStyle:"italic"}},r),o?q.createElement("pre",{style:i},o):null,null)}const IV=q.createElement(RV,null);class NV extends q.Component{constructor(r){super(r),this.state={location:r.location,revalidation:r.revalidation,error:r.error}}static getDerivedStateFromError(r){return{error:r}}static getDerivedStateFromProps(r,o){return o.location!==r.location||o.revalidation!=="idle"&&r.revalidation==="idle"?{error:r.error,location:r.location,revalidation:r.revalidation}:{error:r.error!==void 0?r.error:o.error,location:o.location,revalidation:r.revalidation||o.revalidation}}componentDidCatch(r,o){console.error("React Router caught the following error during render",r,o)}render(){return this.state.error!==void 0?q.createElement(Gs.Provider,{value:this.props.routeContext},q.createElement(fL.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function LV(t){let{routeContext:r,match:o,children:n}=t,i=q.useContext(lS);return i&&i.static&&i.staticContext&&(o.route.errorElement||o.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=o.route.id),q.createElement(Gs.Provider,{value:r},n)}function DV(t,r,o,n){var i;if(r===void 0&&(r=[]),o===void 0&&(o=null),n===void 0&&(n=null),t==null){var a;if(!o)return null;if(o.errors)t=o.matches;else if((a=n)!=null&&a.v7_partialHydration&&r.length===0&&!o.initialized&&o.matches.length>0)t=o.matches;else return null}let s=t,l=(i=o)==null?void 0:i.errors;if(l!=null){let h=s.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);h>=0||Qr(!1),s=s.slice(0,Math.min(s.length,h+1))}let u=!1,c=-1;if(o&&n&&n.v7_partialHydration)for(let h=0;h=0?s=s.slice(0,c+1):s=[s[0]];break}}}return s.reduceRight((h,f,d)=>{let m,y=!1,p=null,g=null;o&&(m=l&&f.route.id?l[f.route.id]:void 0,p=f.route.errorElement||IV,u&&(c<0&&d===0?(y=!0,g=null):c===d&&(y=!0,g=f.route.hydrateFallbackElement||null)));let b=r.concat(s.slice(0,d+1)),x=()=>{let v;return m?v=p:y?v=g:f.route.Component?v=q.createElement(f.route.Component,null):f.route.element?v=f.route.element:v=h,q.createElement(LV,{match:f,routeContext:{outlet:h,matches:b,isDataRoute:o!=null},children:v})};return o&&(f.route.ErrorBoundary||f.route.errorElement||d===0)?q.createElement(NV,{location:o.location,revalidation:o.revalidation,component:p,error:m,children:x(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):x()},null)}var mL=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(mL||{}),ky=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}(ky||{});function FV(t){let r=q.useContext(lS);return r||Qr(!1),r}function $V(t){let r=q.useContext(kV);return r||Qr(!1),r}function UV(t){let r=q.useContext(Gs);return r||Qr(!1),r}function yL(t){let r=UV(),o=r.matches[r.matches.length-1];return o.route.id||Qr(!1),o.route.id}function BV(){var t;let r=q.useContext(fL),o=$V(ky.UseRouteError),n=yL(ky.UseRouteError);return r!==void 0?r:(t=o.errors)==null?void 0:t[n]}function zV(){let{router:t}=FV(mL.UseNavigateStable),r=yL(ky.UseNavigateStable),o=q.useRef(!1);return hL(()=>{o.current=!0}),q.useCallback(function(i,a){a===void 0&&(a={}),o.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,ch({fromRouteId:r},a)))},[t,r])}function fn(t){Qr(!1)}function VV(t){let{basename:r="/",children:o=null,location:n,navigationType:i=xs.Pop,navigator:a,static:s=!1,future:l}=t;mp()&&Qr(!1);let u=r.replace(/^\/*/,"/"),c=q.useMemo(()=>({basename:u,navigator:a,static:s,future:ch({v7_relativeSplatPath:!1},l)}),[u,l,a,s]);typeof n=="string"&&(n=sd(n));let{pathname:h="/",search:f="",hash:d="",state:m=null,key:y="default"}=n,p=q.useMemo(()=>{let g=sS(h,u);return g==null?null:{location:{pathname:g,search:f,hash:d,state:m,key:y},navigationType:i}},[u,h,f,d,m,y,i]);return p==null?null:q.createElement(Jl.Provider,{value:c},q.createElement(Sv.Provider,{children:o,value:p}))}function GV(t){let{children:r,location:o}=t;return AV($x(r),o)}new Promise(()=>{});function $x(t,r){r===void 0&&(r=[]);let o=[];return q.Children.forEach(t,(n,i)=>{if(!q.isValidElement(n))return;let a=[...r,i];if(n.type===q.Fragment){o.push.apply(o,$x(n.props.children,a));return}n.type!==fn&&Qr(!1),!n.props.index||!n.props.children||Qr(!1);let s={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(s.children=$x(n.props.children,a)),o.push(s)}),o}/** * React Router DOM v6.27.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Ux(){return Ux=Object.assign?Object.assign.bind():function(t){for(var r=1;r=0)&&(o[i]=t[i]);return o}function HV(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function qV(t,r){return t.button===0&&(!r||r==="_self")&&!HV(t)}function Bx(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((r,o)=>{let n=t[o];return r.concat(Array.isArray(n)?n.map(i=>[o,i]):[[o,n]])},[]))}function XV(t,r){let o=Bx(t);return r&&r.forEach((n,i)=>{o.has(i)||r.getAll(i).forEach(a=>{o.append(i,a)})}),o}const YV=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],KV="6";try{window.__reactRouterVersion=KV}catch{}const ZV="startTransition",pO=OM[ZV];function QV(t){let{basename:r,children:o,future:n,window:i}=t,a=q.useRef();a.current==null&&(a.current=nV({window:i,v5Compat:!0}));let s=a.current,[l,u]=q.useState({action:s.action,location:s.location}),{v7_startTransition:c}=n||{},h=q.useCallback(f=>{c&&pO?pO(()=>u(f)):u(f)},[u,c]);return q.useLayoutEffect(()=>s.listen(h),[s,h]),q.createElement(VV,{basename:r,children:o,location:l.location,navigationType:l.action,navigator:s,future:n})}const JV=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",eG=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,kr=q.forwardRef(function(r,o){let{onClick:n,relative:i,reloadDocument:a,replace:s,state:l,target:u,to:c,preventScrollReset:h,viewTransition:f}=r,d=WV(r,YV),{basename:m}=q.useContext(Jl),y,p=!1;if(typeof c=="string"&&eG.test(c)&&(y=c,JV))try{let v=new URL(window.location.href),w=c.startsWith("//")?new URL(v.protocol+c):new URL(c),_=sS(w.pathname,m);w.origin===v.origin&&_!=null?c=_+w.search+w.hash:p=!0}catch{}let g=PV(c,{relative:i}),b=tG(c,{replace:s,state:l,target:u,preventScrollReset:h,relative:i,viewTransition:f});function x(v){n&&n(v),v.defaultPrevented||b(v)}return q.createElement("a",Ux({},d,{href:y||g,onClick:p||a?n:x,ref:o,target:u}))});var mO;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(mO||(mO={}));var yO;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(yO||(yO={}));function tG(t,r){let{target:o,replace:n,state:i,preventScrollReset:a,relative:s,viewTransition:l}=r===void 0?{}:r,u=$a(),c=Ws(),h=pL(t,{relative:s});return q.useCallback(f=>{if(qV(f,o)){f.preventDefault();let d=n!==void 0?n:Oy(c)===Oy(h);u(t,{replace:d,state:i,preventScrollReset:a,relative:s,viewTransition:l})}},[c,u,h,n,i,o,t,a,s,l])}function rG(t){let r=q.useRef(Bx(t)),o=q.useRef(!1),n=Ws(),i=q.useMemo(()=>XV(n.search,o.current?null:r.current),[n.search]),a=$a(),s=q.useCallback((l,u)=>{const c=Bx(typeof l=="function"?l(i):l);o.current=!0,a("?"+c,u)},[a,i]);return[i,s]}const nG="modulepreload",oG=function(t){return"/"+t},gO={},Ec=function(r,o,n){let i=Promise.resolve();if(o&&o.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),l=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));i=Promise.allSettled(o.map(u=>{if(u=oG(u),u in gO)return;gO[u]=!0;const c=u.endsWith(".css"),h=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${h}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":nG,c||(f.as="script"),f.crossOrigin="",f.href=u,l&&f.setAttribute("nonce",l),document.head.appendChild(f),c)return new Promise((d,m)=>{f.addEventListener("load",d),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${u}`)))})}))}function a(s){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=s,window.dispatchEvent(l),!l.defaultPrevented)throw s}return i.then(s=>{for(const l of s||[])l.status==="rejected"&&a(l.reason);return r().catch(a)})},iG=t=>{let r;return t?r=t:typeof fetch>"u"?r=(...o)=>Ec(async()=>{const{default:n}=await Promise.resolve().then(()=>ld);return{default:n}},void 0).then(({default:n})=>n(...o)):r=fetch,(...o)=>r(...o)};class uS extends Error{constructor(r,o="FunctionsError",n){super(r),this.name=o,this.context=n}}class aG extends uS{constructor(r){super("Failed to send a request to the Edge Function","FunctionsFetchError",r)}}class sG extends uS{constructor(r){super("Relay Error invoking the Edge Function","FunctionsRelayError",r)}}class lG extends uS{constructor(r){super("Edge Function returned a non-2xx status code","FunctionsHttpError",r)}}var zx;(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"})(zx||(zx={}));var uG=function(t,r,o,n){function i(a){return a instanceof o?a:new o(function(s){s(a)})}return new(o||(o=Promise))(function(a,s){function l(h){try{c(n.next(h))}catch(f){s(f)}}function u(h){try{c(n.throw(h))}catch(f){s(f)}}function c(h){h.done?a(h.value):i(h.value).then(l,u)}c((n=n.apply(t,r||[])).next())})};class cG{constructor(r,{headers:o={},customFetch:n,region:i=zx.Any}={}){this.url=r,this.headers=o,this.region=i,this.fetch=iG(n)}setAuth(r){this.headers.Authorization=`Bearer ${r}`}invoke(r,o={}){var n;return uG(this,void 0,void 0,function*(){try{const{headers:i,method:a,body:s}=o;let l={},{region:u}=o;u||(u=this.region),u&&u!=="any"&&(l["x-region"]=u);let c;s&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)&&(typeof Blob<"u"&&s instanceof Blob||s instanceof ArrayBuffer?(l["Content-Type"]="application/octet-stream",c=s):typeof s=="string"?(l["Content-Type"]="text/plain",c=s):typeof FormData<"u"&&s instanceof FormData?c=s:(l["Content-Type"]="application/json",c=JSON.stringify(s)));const h=yield this.fetch(`${this.url}/${r}`,{method:a||"POST",headers:Object.assign(Object.assign(Object.assign({},l),this.headers),i),body:c}).catch(y=>{throw new aG(y)}),f=h.headers.get("x-relay-error");if(f&&f==="true")throw new sG(h);if(!h.ok)throw new lG(h);let d=((n=h.headers.get("Content-Type"))!==null&&n!==void 0?n:"text/plain").split(";")[0].trim(),m;return d==="application/json"?m=yield h.json():d==="application/octet-stream"?m=yield h.blob():d==="text/event-stream"?m=h:d==="multipart/form-data"?m=yield h.formData():m=yield h.text(),{data:m,error:null}}catch(i){return{data:null,error:i}}})}}var co={},cS={},Ev={},gp={},Tv={},Ov={},dG=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},Tc=dG();const fG=Tc.fetch,gL=Tc.fetch.bind(Tc),vL=Tc.Headers,hG=Tc.Request,pG=Tc.Response,ld=Object.freeze(Object.defineProperty({__proto__:null,Headers:vL,Request:hG,Response:pG,default:gL,fetch:fG},Symbol.toStringTag,{value:"Module"})),mG=Q6(ld);var kv={};Object.defineProperty(kv,"__esModule",{value:!0});let yG=class extends Error{constructor(r){super(r.message),this.name="PostgrestError",this.details=r.details,this.hint=r.hint,this.code=r.code}};kv.default=yG;var bL=Zr&&Zr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ov,"__esModule",{value:!0});const gG=bL(mG),vG=bL(kv);let bG=class{constructor(r){this.shouldThrowOnError=!1,this.method=r.method,this.url=r.url,this.headers=r.headers,this.schema=r.schema,this.body=r.body,this.shouldThrowOnError=r.shouldThrowOnError,this.signal=r.signal,this.isMaybeSingle=r.isMaybeSingle,r.fetch?this.fetch=r.fetch:typeof fetch>"u"?this.fetch=gG.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(r,o){return this.headers=Object.assign({},this.headers),this.headers[r]=o,this}then(r,o){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");const n=this.fetch;let i=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async a=>{var s,l,u;let c=null,h=null,f=null,d=a.status,m=a.statusText;if(a.ok){if(this.method!=="HEAD"){const b=await a.text();b===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?h=b:h=JSON.parse(b))}const p=(s=this.headers.Prefer)===null||s===void 0?void 0:s.match(/count=(exact|planned|estimated)/),g=(l=a.headers.get("content-range"))===null||l===void 0?void 0:l.split("/");p&&g&&g.length>1&&(f=parseInt(g[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(h)&&(h.length>1?(c={code:"PGRST116",details:`Results contain ${h.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},h=null,f=null,d=406,m="Not Acceptable"):h.length===1?h=h[0]:h=null)}else{const p=await a.text();try{c=JSON.parse(p),Array.isArray(c)&&a.status===404&&(h=[],c=null,d=200,m="OK")}catch{a.status===404&&p===""?(d=204,m="No Content"):c={message:p}}if(c&&this.isMaybeSingle&&(!((u=c==null?void 0:c.details)===null||u===void 0)&&u.includes("0 rows"))&&(c=null,d=200,m="OK"),c&&this.shouldThrowOnError)throw new vG.default(c)}return{error:c,data:h,count:f,status:d,statusText:m}});return this.shouldThrowOnError||(i=i.catch(a=>{var s,l,u;return{error:{message:`${(s=a==null?void 0:a.name)!==null&&s!==void 0?s:"FetchError"}: ${a==null?void 0:a.message}`,details:`${(l=a==null?void 0:a.stack)!==null&&l!==void 0?l:""}`,hint:"",code:`${(u=a==null?void 0:a.code)!==null&&u!==void 0?u:""}`},data:null,count:null,status:0,statusText:""}})),i.then(r,o)}};Ov.default=bG;var xG=Zr&&Zr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Tv,"__esModule",{value:!0});const wG=xG(Ov);let _G=class extends wG.default{select(r){let o=!1;const n=(r??"*").split("").map(i=>/\s/.test(i)&&!o?"":(i==='"'&&(o=!o),i)).join("");return this.url.searchParams.set("select",n),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(r,{ascending:o=!0,nullsFirst:n,foreignTable:i,referencedTable:a=i}={}){const s=a?`${a}.order`:"order",l=this.url.searchParams.get(s);return this.url.searchParams.set(s,`${l?`${l},`:""}${r}.${o?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(r,{foreignTable:o,referencedTable:n=o}={}){const i=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(i,`${r}`),this}range(r,o,{foreignTable:n,referencedTable:i=n}={}){const a=typeof i>"u"?"offset":`${i}.offset`,s=typeof i>"u"?"limit":`${i}.limit`;return this.url.searchParams.set(a,`${r}`),this.url.searchParams.set(s,`${o-r+1}`),this}abortSignal(r){return this.signal=r,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}explain({analyze:r=!1,verbose:o=!1,settings:n=!1,buffers:i=!1,wal:a=!1,format:s="text"}={}){var l;const u=[r?"analyze":null,o?"verbose":null,n?"settings":null,i?"buffers":null,a?"wal":null].filter(Boolean).join("|"),c=(l=this.headers.Accept)!==null&&l!==void 0?l:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${s}; for="${c}"; options=${u};`,s==="json"?this:this}rollback(){var r;return((r=this.headers.Prefer)!==null&&r!==void 0?r:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}};Tv.default=_G;var jG=Zr&&Zr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(gp,"__esModule",{value:!0});const SG=jG(Tv);let EG=class extends SG.default{eq(r,o){return this.url.searchParams.append(r,`eq.${o}`),this}neq(r,o){return this.url.searchParams.append(r,`neq.${o}`),this}gt(r,o){return this.url.searchParams.append(r,`gt.${o}`),this}gte(r,o){return this.url.searchParams.append(r,`gte.${o}`),this}lt(r,o){return this.url.searchParams.append(r,`lt.${o}`),this}lte(r,o){return this.url.searchParams.append(r,`lte.${o}`),this}like(r,o){return this.url.searchParams.append(r,`like.${o}`),this}likeAllOf(r,o){return this.url.searchParams.append(r,`like(all).{${o.join(",")}}`),this}likeAnyOf(r,o){return this.url.searchParams.append(r,`like(any).{${o.join(",")}}`),this}ilike(r,o){return this.url.searchParams.append(r,`ilike.${o}`),this}ilikeAllOf(r,o){return this.url.searchParams.append(r,`ilike(all).{${o.join(",")}}`),this}ilikeAnyOf(r,o){return this.url.searchParams.append(r,`ilike(any).{${o.join(",")}}`),this}is(r,o){return this.url.searchParams.append(r,`is.${o}`),this}in(r,o){const n=Array.from(new Set(o)).map(i=>typeof i=="string"&&new RegExp("[,()]").test(i)?`"${i}"`:`${i}`).join(",");return this.url.searchParams.append(r,`in.(${n})`),this}contains(r,o){return typeof o=="string"?this.url.searchParams.append(r,`cs.${o}`):Array.isArray(o)?this.url.searchParams.append(r,`cs.{${o.join(",")}}`):this.url.searchParams.append(r,`cs.${JSON.stringify(o)}`),this}containedBy(r,o){return typeof o=="string"?this.url.searchParams.append(r,`cd.${o}`):Array.isArray(o)?this.url.searchParams.append(r,`cd.{${o.join(",")}}`):this.url.searchParams.append(r,`cd.${JSON.stringify(o)}`),this}rangeGt(r,o){return this.url.searchParams.append(r,`sr.${o}`),this}rangeGte(r,o){return this.url.searchParams.append(r,`nxl.${o}`),this}rangeLt(r,o){return this.url.searchParams.append(r,`sl.${o}`),this}rangeLte(r,o){return this.url.searchParams.append(r,`nxr.${o}`),this}rangeAdjacent(r,o){return this.url.searchParams.append(r,`adj.${o}`),this}overlaps(r,o){return typeof o=="string"?this.url.searchParams.append(r,`ov.${o}`):this.url.searchParams.append(r,`ov.{${o.join(",")}}`),this}textSearch(r,o,{config:n,type:i}={}){let a="";i==="plain"?a="pl":i==="phrase"?a="ph":i==="websearch"&&(a="w");const s=n===void 0?"":`(${n})`;return this.url.searchParams.append(r,`${a}fts${s}.${o}`),this}match(r){return Object.entries(r).forEach(([o,n])=>{this.url.searchParams.append(o,`eq.${n}`)}),this}not(r,o,n){return this.url.searchParams.append(r,`not.${o}.${n}`),this}or(r,{foreignTable:o,referencedTable:n=o}={}){const i=n?`${n}.or`:"or";return this.url.searchParams.append(i,`(${r})`),this}filter(r,o,n){return this.url.searchParams.append(r,`${o}.${n}`),this}};gp.default=EG;var TG=Zr&&Zr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ev,"__esModule",{value:!0});const Vd=TG(gp);let OG=class{constructor(r,{headers:o={},schema:n,fetch:i}){this.url=r,this.headers=o,this.schema=n,this.fetch=i}select(r,{head:o=!1,count:n}={}){const i=o?"HEAD":"GET";let a=!1;const s=(r??"*").split("").map(l=>/\s/.test(l)&&!a?"":(l==='"'&&(a=!a),l)).join("");return this.url.searchParams.set("select",s),n&&(this.headers.Prefer=`count=${n}`),new Vd.default({method:i,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(r,{count:o,defaultToNull:n=!0}={}){const i="POST",a=[];if(this.headers.Prefer&&a.push(this.headers.Prefer),o&&a.push(`count=${o}`),n||a.push("missing=default"),this.headers.Prefer=a.join(","),Array.isArray(r)){const s=r.reduce((l,u)=>l.concat(Object.keys(u)),[]);if(s.length>0){const l=[...new Set(s)].map(u=>`"${u}"`);this.url.searchParams.set("columns",l.join(","))}}return new Vd.default({method:i,url:this.url,headers:this.headers,schema:this.schema,body:r,fetch:this.fetch,allowEmpty:!1})}upsert(r,{onConflict:o,ignoreDuplicates:n=!1,count:i,defaultToNull:a=!0}={}){const s="POST",l=[`resolution=${n?"ignore":"merge"}-duplicates`];if(o!==void 0&&this.url.searchParams.set("on_conflict",o),this.headers.Prefer&&l.push(this.headers.Prefer),i&&l.push(`count=${i}`),a||l.push("missing=default"),this.headers.Prefer=l.join(","),Array.isArray(r)){const u=r.reduce((c,h)=>c.concat(Object.keys(h)),[]);if(u.length>0){const c=[...new Set(u)].map(h=>`"${h}"`);this.url.searchParams.set("columns",c.join(","))}}return new Vd.default({method:s,url:this.url,headers:this.headers,schema:this.schema,body:r,fetch:this.fetch,allowEmpty:!1})}update(r,{count:o}={}){const n="PATCH",i=[];return this.headers.Prefer&&i.push(this.headers.Prefer),o&&i.push(`count=${o}`),this.headers.Prefer=i.join(","),new Vd.default({method:n,url:this.url,headers:this.headers,schema:this.schema,body:r,fetch:this.fetch,allowEmpty:!1})}delete({count:r}={}){const o="DELETE",n=[];return r&&n.push(`count=${r}`),this.headers.Prefer&&n.unshift(this.headers.Prefer),this.headers.Prefer=n.join(","),new Vd.default({method:o,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};Ev.default=OG;var Pv={},Cv={};Object.defineProperty(Cv,"__esModule",{value:!0});Cv.version=void 0;Cv.version="0.0.0-automated";Object.defineProperty(Pv,"__esModule",{value:!0});Pv.DEFAULT_HEADERS=void 0;const kG=Cv;Pv.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${kG.version}`};var xL=Zr&&Zr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(cS,"__esModule",{value:!0});const PG=xL(Ev),CG=xL(gp),AG=Pv;let MG=class wL{constructor(r,{headers:o={},schema:n,fetch:i}={}){this.url=r,this.headers=Object.assign(Object.assign({},AG.DEFAULT_HEADERS),o),this.schemaName=n,this.fetch=i}from(r){const o=new URL(`${this.url}/${r}`);return new PG.default(o,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(r){return new wL(this.url,{headers:this.headers,schema:r,fetch:this.fetch})}rpc(r,o={},{head:n=!1,get:i=!1,count:a}={}){let s;const l=new URL(`${this.url}/rpc/${r}`);let u;n||i?(s=n?"HEAD":"GET",Object.entries(o).filter(([h,f])=>f!==void 0).map(([h,f])=>[h,Array.isArray(f)?`{${f.join(",")}}`:`${f}`]).forEach(([h,f])=>{l.searchParams.append(h,f)})):(s="POST",u=o);const c=Object.assign({},this.headers);return a&&(c.Prefer=`count=${a}`),new CG.default({method:s,url:l,headers:c,schema:this.schemaName,body:u,fetch:this.fetch,allowEmpty:!1})}};cS.default=MG;var ud=Zr&&Zr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(co,"__esModule",{value:!0});co.PostgrestError=co.PostgrestBuilder=co.PostgrestTransformBuilder=co.PostgrestFilterBuilder=co.PostgrestQueryBuilder=co.PostgrestClient=void 0;const _L=ud(cS);co.PostgrestClient=_L.default;const jL=ud(Ev);co.PostgrestQueryBuilder=jL.default;const SL=ud(gp);co.PostgrestFilterBuilder=SL.default;const EL=ud(Tv);co.PostgrestTransformBuilder=EL.default;const TL=ud(Ov);co.PostgrestBuilder=TL.default;const OL=ud(kv);co.PostgrestError=OL.default;var RG=co.default={PostgrestClient:_L.default,PostgrestQueryBuilder:jL.default,PostgrestFilterBuilder:SL.default,PostgrestTransformBuilder:EL.default,PostgrestBuilder:TL.default,PostgrestError:OL.default};const{PostgrestClient:IG,PostgrestQueryBuilder:R_e,PostgrestFilterBuilder:I_e,PostgrestTransformBuilder:N_e,PostgrestBuilder:L_e,PostgrestError:D_e}=RG,NG="2.11.2",LG={"X-Client-Info":`realtime-js/${NG}`},DG="1.0.0",kL=1e4,FG=1e3;var Ku;(function(t){t[t.connecting=0]="connecting",t[t.open=1]="open",t[t.closing=2]="closing",t[t.closed=3]="closed"})(Ku||(Ku={}));var xo;(function(t){t.closed="closed",t.errored="errored",t.joined="joined",t.joining="joining",t.leaving="leaving"})(xo||(xo={}));var di;(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"})(di||(di={}));var Vx;(function(t){t.websocket="websocket"})(Vx||(Vx={}));var ul;(function(t){t.Connecting="connecting",t.Open="open",t.Closing="closing",t.Closed="closed"})(ul||(ul={}));class $G{constructor(){this.HEADER_LENGTH=1}decode(r,o){return r.constructor===ArrayBuffer?o(this._binaryDecode(r)):o(typeof r=="string"?JSON.parse(r):{})}_binaryDecode(r){const o=new DataView(r),n=new TextDecoder;return this._decodeBroadcast(r,o,n)}_decodeBroadcast(r,o,n){const i=o.getUint8(1),a=o.getUint8(2);let s=this.HEADER_LENGTH+2;const l=n.decode(r.slice(s,s+i));s=s+i;const u=n.decode(r.slice(s,s+a));s=s+a;const c=JSON.parse(n.decode(r.slice(s,r.byteLength)));return{ref:null,topic:l,event:u,payload:c}}}class PL{constructor(r,o){this.callback=r,this.timerCalc=o,this.timer=void 0,this.tries=0,this.callback=r,this.timerCalc=o}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var pr;(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"})(pr||(pr={}));const vO=(t,r,o={})=>{var n;const i=(n=o.skipTypes)!==null&&n!==void 0?n:[];return Object.keys(r).reduce((a,s)=>(a[s]=UG(s,t,r,i),a),{})},UG=(t,r,o,n)=>{const i=r.find(l=>l.name===t),a=i==null?void 0:i.type,s=o[t];return a&&!n.includes(a)?CL(a,s):Gx(s)},CL=(t,r)=>{if(t.charAt(0)==="_"){const o=t.slice(1,t.length);return GG(r,o)}switch(t){case pr.bool:return BG(r);case pr.float4:case pr.float8:case pr.int2:case pr.int4:case pr.int8:case pr.numeric:case pr.oid:return zG(r);case pr.json:case pr.jsonb:return VG(r);case pr.timestamp:return WG(r);case pr.abstime:case pr.date:case pr.daterange:case pr.int4range:case pr.int8range:case pr.money:case pr.reltime:case pr.text:case pr.time:case pr.timestamptz:case pr.timetz:case pr.tsrange:case pr.tstzrange:return Gx(r);default:return Gx(r)}},Gx=t=>t,BG=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},zG=t=>{if(typeof t=="string"){const r=parseFloat(t);if(!Number.isNaN(r))return r}return t},VG=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch(r){return console.log(`JSON parse error: ${r}`),t}return t},GG=(t,r)=>{if(typeof t!="string")return t;const o=t.length-1,n=t[o];if(t[0]==="{"&&n==="}"){let a;const s=t.slice(1,o);try{a=JSON.parse("["+s+"]")}catch{a=s?s.split(","):[]}return a.map(l=>CL(r,l))}return t},WG=t=>typeof t=="string"?t.replace(" ","T"):t,AL=t=>{let r=t;return r=r.replace(/^ws/i,"http"),r=r.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),r.replace(/\/+$/,"")};class Pb{constructor(r,o,n={},i=kL){this.channel=r,this.event=o,this.payload=n,this.timeout=i,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(r){this.timeout=r,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(r){this.payload=Object.assign(Object.assign({},this.payload),r)}receive(r,o){var n;return this._hasReceived(r)&&o((n=this.receivedResp)===null||n===void 0?void 0:n.response),this.recHooks.push({status:r,callback:o}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const r=o=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=o,this._matchReceive(o)};this.channel._on(this.refEvent,{},r),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(r,o){this.refEvent&&this.channel._trigger(this.refEvent,{status:r,response:o})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:r,response:o}){this.recHooks.filter(n=>n.status===r).forEach(n=>n.callback(o))}_hasReceived(r){return this.receivedResp&&this.receivedResp.status===r}}var bO;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(bO||(bO={}));class kf{constructor(r,o){this.channel=r,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const n=(o==null?void 0:o.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(n.state,{},i=>{const{onJoin:a,onLeave:s,onSync:l}=this.caller;this.joinRef=this.channel._joinRef(),this.state=kf.syncState(this.state,i,a,s),this.pendingDiffs.forEach(u=>{this.state=kf.syncDiff(this.state,u,a,s)}),this.pendingDiffs=[],l()}),this.channel._on(n.diff,{},i=>{const{onJoin:a,onLeave:s,onSync:l}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(i):(this.state=kf.syncDiff(this.state,i,a,s),l())}),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(r,o,n,i){const a=this.cloneDeep(r),s=this.transformState(o),l={},u={};return this.map(a,(c,h)=>{s[c]||(u[c]=h)}),this.map(s,(c,h)=>{const f=a[c];if(f){const d=h.map(g=>g.presence_ref),m=f.map(g=>g.presence_ref),y=h.filter(g=>m.indexOf(g.presence_ref)<0),p=f.filter(g=>d.indexOf(g.presence_ref)<0);y.length>0&&(l[c]=y),p.length>0&&(u[c]=p)}else l[c]=h}),this.syncDiff(a,{joins:l,leaves:u},n,i)}static syncDiff(r,o,n,i){const{joins:a,leaves:s}={joins:this.transformState(o.joins),leaves:this.transformState(o.leaves)};return n||(n=()=>{}),i||(i=()=>{}),this.map(a,(l,u)=>{var c;const h=(c=r[l])!==null&&c!==void 0?c:[];if(r[l]=this.cloneDeep(u),h.length>0){const f=r[l].map(m=>m.presence_ref),d=h.filter(m=>f.indexOf(m.presence_ref)<0);r[l].unshift(...d)}n(l,h,u)}),this.map(s,(l,u)=>{let c=r[l];if(!c)return;const h=u.map(f=>f.presence_ref);c=c.filter(f=>h.indexOf(f.presence_ref)<0),r[l]=c,i(l,c,u),c.length===0&&delete r[l]}),r}static map(r,o){return Object.getOwnPropertyNames(r).map(n=>o(n,r[n]))}static transformState(r){return r=this.cloneDeep(r),Object.getOwnPropertyNames(r).reduce((o,n)=>{const i=r[n];return"metas"in i?o[n]=i.metas.map(a=>(a.presence_ref=a.phx_ref,delete a.phx_ref,delete a.phx_ref_prev,a)):o[n]=i,o},{})}static cloneDeep(r){return JSON.parse(JSON.stringify(r))}onJoin(r){this.caller.onJoin=r}onLeave(r){this.caller.onLeave=r}onSync(r){this.caller.onSync=r}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var xO;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(xO||(xO={}));var wO;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(wO||(wO={}));var ca;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(ca||(ca={}));class dS{constructor(r,o={config:{}},n){this.topic=r,this.params=o,this.socket=n,this.bindings={},this.state=xo.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=r.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:""},private:!1},o.config),this.timeout=this.socket.timeout,this.joinPush=new Pb(this,di.join,this.params,this.timeout),this.rejoinTimer=new PL(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=xo.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(i=>i.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=xo.closed,this.socket._remove(this)}),this._onError(i=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,i),this.state=xo.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=xo.errored,this.rejoinTimer.scheduleTimeout())}),this._on(di.reply,{},(i,a)=>{this._trigger(this._replyEventName(a),i)}),this.presence=new kf(this),this.broadcastEndpointURL=AL(this.socket.endPoint)+"/api/broadcast",this.private=this.params.config.private||!1}subscribe(r,o=this.timeout){var n,i;if(this.socket.isConnected()||this.socket.connect(),this.joinedOnce)throw"tried to subscribe multiple times. 'subscribe' can only be called a single time per channel instance";{const{config:{broadcast:a,presence:s,private:l}}=this.params;this._onError(h=>r==null?void 0:r(ca.CHANNEL_ERROR,h)),this._onClose(()=>r==null?void 0:r(ca.CLOSED));const u={},c={broadcast:a,presence:s,postgres_changes:(i=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(h=>h.filter))!==null&&i!==void 0?i:[],private:l};this.socket.accessTokenValue&&(u.access_token=this.socket.accessTokenValue),this.updateJoinPayload(Object.assign({config:c},u)),this.joinedOnce=!0,this._rejoin(o),this.joinPush.receive("ok",async({postgres_changes:h})=>{var f;if(this.socket.setAuth(),h===void 0){r==null||r(ca.SUBSCRIBED);return}else{const d=this.bindings.postgres_changes,m=(f=d==null?void 0:d.length)!==null&&f!==void 0?f:0,y=[];for(let p=0;p{r==null||r(ca.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(h).join(", ")||"error")))}).receive("timeout",()=>{r==null||r(ca.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(r,o={}){return await this.send({type:"presence",event:"track",payload:r},o.timeout||this.timeout)}async untrack(r={}){return await this.send({type:"presence",event:"untrack"},r)}on(r,o,n){return this._on(r,o,n)}async send(r,o={}){var n,i;if(!this._canPush()&&r.type==="broadcast"){const{event:a,payload:s}=r,u={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 c=await this._fetchWithTimeout(this.broadcastEndpointURL,u,(n=o.timeout)!==null&&n!==void 0?n:this.timeout);return await((i=c.body)===null||i===void 0?void 0:i.cancel()),c.ok?"ok":"error"}catch(c){return c.name==="AbortError"?"timed out":"error"}}else return new Promise(a=>{var s,l,u;const c=this._push(r.type,r,o.timeout||this.timeout);r.type==="broadcast"&&!(!((u=(l=(s=this.params)===null||s===void 0?void 0:s.config)===null||l===void 0?void 0:l.broadcast)===null||u===void 0)&&u.ack)&&a("ok"),c.receive("ok",()=>a("ok")),c.receive("error",()=>a("error")),c.receive("timeout",()=>a("timed out"))})}updateJoinPayload(r){this.joinPush.updatePayload(r)}unsubscribe(r=this.timeout){this.state=xo.leaving;const o=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(di.close,"leave",this._joinRef())};return this.rejoinTimer.reset(),this.joinPush.destroy(),new Promise(n=>{const i=new Pb(this,di.leave,{},r);i.receive("ok",()=>{o(),n("ok")}).receive("timeout",()=>{o(),n("timed out")}).receive("error",()=>{n("error")}),i.send(),this._canPush()||i.trigger("ok",{})})}async _fetchWithTimeout(r,o,n){const i=new AbortController,a=setTimeout(()=>i.abort(),n),s=await this.socket.fetch(r,Object.assign(Object.assign({},o),{signal:i.signal}));return clearTimeout(a),s}_push(r,o,n=this.timeout){if(!this.joinedOnce)throw`tried to push '${r}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let i=new Pb(this,r,o,n);return this._canPush()?i.send():(i.startTimeout(),this.pushBuffer.push(i)),i}_onMessage(r,o,n){return o}_isMember(r){return this.topic===r}_joinRef(){return this.joinPush.ref}_trigger(r,o,n){var i,a;const s=r.toLocaleLowerCase(),{close:l,error:u,leave:c,join:h}=di;if(n&&[l,u,c,h].indexOf(s)>=0&&n!==this._joinRef())return;let d=this._onMessage(s,o,n);if(o&&!d)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(m=>{var y,p,g;return((y=m.filter)===null||y===void 0?void 0:y.event)==="*"||((g=(p=m.filter)===null||p===void 0?void 0:p.event)===null||g===void 0?void 0:g.toLocaleLowerCase())===s}).map(m=>m.callback(d,n)):(a=this.bindings[s])===null||a===void 0||a.filter(m=>{var y,p,g,b,x,v;if(["broadcast","presence","postgres_changes"].includes(s))if("id"in m){const w=m.id,_=(y=m.filter)===null||y===void 0?void 0:y.event;return w&&((p=o.ids)===null||p===void 0?void 0:p.includes(w))&&(_==="*"||(_==null?void 0:_.toLocaleLowerCase())===((g=o.data)===null||g===void 0?void 0:g.type.toLocaleLowerCase()))}else{const w=(x=(b=m==null?void 0:m.filter)===null||b===void 0?void 0:b.event)===null||x===void 0?void 0:x.toLocaleLowerCase();return w==="*"||w===((v=o==null?void 0:o.event)===null||v===void 0?void 0:v.toLocaleLowerCase())}else return m.type.toLocaleLowerCase()===s}).map(m=>{if(typeof d=="object"&&"ids"in d){const y=d.data,{schema:p,table:g,commit_timestamp:b,type:x,errors:v}=y;d=Object.assign(Object.assign({},{schema:p,table:g,commit_timestamp:b,eventType:x,new:{},old:{},errors:v}),this._getPayloadRecords(y))}m.callback(d,n)})}_isClosed(){return this.state===xo.closed}_isJoined(){return this.state===xo.joined}_isJoining(){return this.state===xo.joining}_isLeaving(){return this.state===xo.leaving}_replyEventName(r){return`chan_reply_${r}`}_on(r,o,n){const i=r.toLocaleLowerCase(),a={type:i,filter:o,callback:n};return this.bindings[i]?this.bindings[i].push(a):this.bindings[i]=[a],this}_off(r,o){const n=r.toLocaleLowerCase();return this.bindings[n]=this.bindings[n].filter(i=>{var a;return!(((a=i.type)===null||a===void 0?void 0:a.toLocaleLowerCase())===n&&dS.isEqual(i.filter,o))}),this}static isEqual(r,o){if(Object.keys(r).length!==Object.keys(o).length)return!1;for(const n in r)if(r[n]!==o[n])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(r){this._on(di.close,{},r)}_onError(r){this._on(di.error,{},o=>r(o))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(r=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=xo.joining,this.joinPush.resend(r))}_getPayloadRecords(r){const o={new:{},old:{}};return(r.type==="INSERT"||r.type==="UPDATE")&&(o.new=vO(r.columns,r.record)),(r.type==="UPDATE"||r.type==="DELETE")&&(o.old=vO(r.columns,r.old_record)),o}}const HG=()=>{},qG=typeof WebSocket<"u",XG=` addEventListener("message", (e) => { if (e.data.event === "start") { setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); } });`;class YG{constructor(r,o){var n;this.accessTokenValue=null,this.apiKey=null,this.channels=[],this.endPoint="",this.httpEndpoint="",this.headers=LG,this.params={},this.timeout=kL,this.heartbeatIntervalMs=3e4,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.ref=0,this.logger=HG,this.conn=null,this.sendBuffer=[],this.serializer=new $G,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._resolveFetch=a=>{let s;return a?s=a:typeof fetch>"u"?s=(...l)=>Ec(async()=>{const{default:u}=await Promise.resolve().then(()=>ld);return{default:u}},void 0).then(({default:u})=>u(...l)):s=fetch,(...l)=>s(...l)},this.endPoint=`${r}/${Vx.websocket}`,this.httpEndpoint=AL(r),o!=null&&o.transport?this.transport=o.transport:this.transport=null,o!=null&&o.params&&(this.params=o.params),o!=null&&o.headers&&(this.headers=Object.assign(Object.assign({},this.headers),o.headers)),o!=null&&o.timeout&&(this.timeout=o.timeout),o!=null&&o.logger&&(this.logger=o.logger),o!=null&&o.heartbeatIntervalMs&&(this.heartbeatIntervalMs=o.heartbeatIntervalMs);const i=(n=o==null?void 0:o.params)===null||n===void 0?void 0:n.apikey;if(i&&(this.accessTokenValue=i,this.apiKey=i),this.reconnectAfterMs=o!=null&&o.reconnectAfterMs?o.reconnectAfterMs:a=>[1e3,2e3,5e3,1e4][a-1]||1e4,this.encode=o!=null&&o.encode?o.encode:(a,s)=>s(JSON.stringify(a)),this.decode=o!=null&&o.decode?o.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new PL(async()=>{this.disconnect(),this.connect()},this.reconnectAfterMs),this.fetch=this._resolveFetch(o==null?void 0:o.fetch),o!=null&&o.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.worker=(o==null?void 0:o.worker)||!1,this.workerUrl=o==null?void 0:o.workerUrl}this.accessToken=(o==null?void 0:o.accessToken)||null}connect(){if(!this.conn){if(this.transport){this.conn=new this.transport(this.endpointURL(),void 0,{headers:this.headers});return}if(qG){this.conn=new WebSocket(this.endpointURL()),this.setupConnection();return}this.conn=new KG(this.endpointURL(),void 0,{close:()=>{this.conn=null}}),Ec(async()=>{const{default:r}=await import("./browser-Dt25fZLl.js").then(o=>o.b);return{default:r}},[]).then(({default:r})=>{this.conn=new r(this.endpointURL(),void 0,{headers:this.headers}),this.setupConnection()})}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:DG}))}disconnect(r,o){this.conn&&(this.conn.onclose=function(){},r?this.conn.close(r,o??""):this.conn.close(),this.conn=null,this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.reset())}getChannels(){return this.channels}async removeChannel(r){const o=await r.unsubscribe();return this.channels.length===0&&this.disconnect(),o}async removeAllChannels(){const r=await Promise.all(this.channels.map(o=>o.unsubscribe()));return this.disconnect(),r}log(r,o,n){this.logger(r,o,n)}connectionState(){switch(this.conn&&this.conn.readyState){case Ku.connecting:return ul.Connecting;case Ku.open:return ul.Open;case Ku.closing:return ul.Closing;default:return ul.Closed}}isConnected(){return this.connectionState()===ul.Open}channel(r,o={config:{}}){const n=new dS(`realtime:${r}`,o,this);return this.channels.push(n),n}push(r){const{topic:o,event:n,payload:i,ref:a}=r,s=()=>{this.encode(r,l=>{var u;(u=this.conn)===null||u===void 0||u.send(l)})};this.log("push",`${o} ${n} (${a})`,i),this.isConnected()?s():this.sendBuffer.push(s)}async setAuth(r=null){let o=r||this.accessToken&&await this.accessToken()||this.accessTokenValue;if(o){let n=null;try{n=JSON.parse(atob(o.split(".")[1]))}catch{}if(n&&n.exp&&!(Math.floor(Date.now()/1e3)-n.exp<0))return this.log("auth",`InvalidJWTToken: Invalid value for JWT claim "exp" with value ${n.exp}`),Promise.reject(`InvalidJWTToken: Invalid value for JWT claim "exp" with value ${n.exp}`);this.accessTokenValue=o,this.channels.forEach(i=>{o&&i.updateJoinPayload({access_token:o}),i.joinedOnce&&i._isJoined()&&i._push(di.access_token,{access_token:o})})}}async sendHeartbeat(){var r;if(this.isConnected()){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),(r=this.conn)===null||r===void 0||r.close(FG,"hearbeat timeout");return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.setAuth()}}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(r=>r()),this.sendBuffer=[])}_makeRef(){let r=this.ref+1;return r===this.ref?this.ref=0:this.ref=r,this.ref.toString()}_leaveOpenTopic(r){let o=this.channels.find(n=>n.topic===r&&(n._isJoined()||n._isJoining()));o&&(this.log("transport",`leaving duplicate topic "${r}"`),o.unsubscribe())}_remove(r){this.channels=this.channels.filter(o=>o._joinRef()!==r._joinRef())}setupConnection(){this.conn&&(this.conn.binaryType="arraybuffer",this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=r=>this._onConnError(r),this.conn.onmessage=r=>this._onConnMessage(r),this.conn.onclose=r=>this._onConnClose(r))}_onConnMessage(r){this.decode(r.data,o=>{let{topic:n,event:i,payload:a,ref:s}=o;s&&s===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null),this.log("receive",`${a.status||""} ${n} ${i} ${s&&"("+s+")"||""}`,a),this.channels.filter(l=>l._isMember(n)).forEach(l=>l._trigger(i,a,s)),this.stateChangeCallbacks.message.forEach(l=>l(o))})}async _onConnOpen(){if(this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this.reconnectTimer.reset(),!this.worker)this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs);else{this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const r=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(r),this.workerRef.onerror=o=>{this.log("worker","worker error",o.message),this.workerRef.terminate()},this.workerRef.onmessage=o=>{o.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}this.stateChangeCallbacks.open.forEach(r=>r())}_onConnClose(r){this.log("transport","close",r),this._triggerChanError(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(o=>o(r))}_onConnError(r){this.log("transport",r.message),this._triggerChanError(),this.stateChangeCallbacks.error.forEach(o=>o(r))}_triggerChanError(){this.channels.forEach(r=>r._trigger(di.error))}_appendParams(r,o){if(Object.keys(o).length===0)return r;const n=r.match(/\?/)?"&":"?",i=new URLSearchParams(o);return`${r}${n}${i}`}_workerObjectUrl(r){let o;if(r)o=r;else{const n=new Blob([XG],{type:"application/javascript"});o=URL.createObjectURL(n)}return o}}class KG{constructor(r,o,n){this.binaryType="arraybuffer",this.onclose=()=>{},this.onerror=()=>{},this.onmessage=()=>{},this.onopen=()=>{},this.readyState=Ku.connecting,this.send=()=>{},this.url=null,this.url=r,this.close=n.close}}class fS extends Error{constructor(r){super(r),this.__isStorageError=!0,this.name="StorageError"}}function hn(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}class ZG extends fS{constructor(r,o){super(r),this.name="StorageApiError",this.status=o}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class Wx extends fS{constructor(r,o){super(r),this.name="StorageUnknownError",this.originalError=o}}var QG=function(t,r,o,n){function i(a){return a instanceof o?a:new o(function(s){s(a)})}return new(o||(o=Promise))(function(a,s){function l(h){try{c(n.next(h))}catch(f){s(f)}}function u(h){try{c(n.throw(h))}catch(f){s(f)}}function c(h){h.done?a(h.value):i(h.value).then(l,u)}c((n=n.apply(t,r||[])).next())})};const ML=t=>{let r;return t?r=t:typeof fetch>"u"?r=(...o)=>Ec(async()=>{const{default:n}=await Promise.resolve().then(()=>ld);return{default:n}},void 0).then(({default:n})=>n(...o)):r=fetch,(...o)=>r(...o)},JG=()=>QG(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Ec(()=>Promise.resolve().then(()=>ld),void 0)).Response:Response}),Hx=t=>{if(Array.isArray(t))return t.map(o=>Hx(o));if(typeof t=="function"||t!==Object(t))return t;const r={};return Object.entries(t).forEach(([o,n])=>{const i=o.replace(/([-_][a-z])/gi,a=>a.toUpperCase().replace(/[-_]/g,""));r[i]=Hx(n)}),r};var eu=function(t,r,o,n){function i(a){return a instanceof o?a:new o(function(s){s(a)})}return new(o||(o=Promise))(function(a,s){function l(h){try{c(n.next(h))}catch(f){s(f)}}function u(h){try{c(n.throw(h))}catch(f){s(f)}}function c(h){h.done?a(h.value):i(h.value).then(l,u)}c((n=n.apply(t,r||[])).next())})};const Cb=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),eW=(t,r,o)=>eu(void 0,void 0,void 0,function*(){const n=yield JG();t instanceof n&&!(o!=null&&o.noResolveJson)?t.json().then(i=>{r(new ZG(Cb(i),t.status||500))}).catch(i=>{r(new Wx(Cb(i),i))}):r(new Wx(Cb(t),t))}),tW=(t,r,o,n)=>{const i={method:t,headers:(r==null?void 0:r.headers)||{}};return t==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json"},r==null?void 0:r.headers),n&&(i.body=JSON.stringify(n)),Object.assign(Object.assign({},i),o))};function vp(t,r,o,n,i,a){return eu(this,void 0,void 0,function*(){return new Promise((s,l)=>{t(o,tW(r,n,i,a)).then(u=>{if(!u.ok)throw u;return n!=null&&n.noResolveJson?u:u.json()}).then(u=>s(u)).catch(u=>eW(u,l,n))})})}function Py(t,r,o,n){return eu(this,void 0,void 0,function*(){return vp(t,"GET",r,o,n)})}function ns(t,r,o,n,i){return eu(this,void 0,void 0,function*(){return vp(t,"POST",r,n,i,o)})}function rW(t,r,o,n,i){return eu(this,void 0,void 0,function*(){return vp(t,"PUT",r,n,i,o)})}function nW(t,r,o,n){return eu(this,void 0,void 0,function*(){return vp(t,"HEAD",r,Object.assign(Object.assign({},o),{noResolveJson:!0}),n)})}function RL(t,r,o,n,i){return eu(this,void 0,void 0,function*(){return vp(t,"DELETE",r,n,i,o)})}var oo=function(t,r,o,n){function i(a){return a instanceof o?a:new o(function(s){s(a)})}return new(o||(o=Promise))(function(a,s){function l(h){try{c(n.next(h))}catch(f){s(f)}}function u(h){try{c(n.throw(h))}catch(f){s(f)}}function c(h){h.done?a(h.value):i(h.value).then(l,u)}c((n=n.apply(t,r||[])).next())})};const oW={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},_O={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class iW{constructor(r,o={},n,i){this.url=r,this.headers=o,this.bucketId=n,this.fetch=ML(i)}uploadOrUpdate(r,o,n,i){return oo(this,void 0,void 0,function*(){try{let a;const s=Object.assign(Object.assign({},_O),i);let l=Object.assign(Object.assign({},this.headers),r==="POST"&&{"x-upsert":String(s.upsert)});const u=s.metadata;typeof Blob<"u"&&n instanceof Blob?(a=new FormData,a.append("cacheControl",s.cacheControl),u&&a.append("metadata",this.encodeMetadata(u)),a.append("",n)):typeof FormData<"u"&&n instanceof FormData?(a=n,a.append("cacheControl",s.cacheControl),u&&a.append("metadata",this.encodeMetadata(u))):(a=n,l["cache-control"]=`max-age=${s.cacheControl}`,l["content-type"]=s.contentType,u&&(l["x-metadata"]=this.toBase64(this.encodeMetadata(u)))),i!=null&&i.headers&&(l=Object.assign(Object.assign({},l),i.headers));const c=this._removeEmptyFolders(o),h=this._getFinalPath(c),f=yield this.fetch(`${this.url}/object/${h}`,Object.assign({method:r,body:a,headers:l},s!=null&&s.duplex?{duplex:s.duplex}:{})),d=yield f.json();return f.ok?{data:{path:c,id:d.Id,fullPath:d.Key},error:null}:{data:null,error:d}}catch(a){if(hn(a))return{data:null,error:a};throw a}})}upload(r,o,n){return oo(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",r,o,n)})}uploadToSignedUrl(r,o,n,i){return oo(this,void 0,void 0,function*(){const a=this._removeEmptyFolders(r),s=this._getFinalPath(a),l=new URL(this.url+`/object/upload/sign/${s}`);l.searchParams.set("token",o);try{let u;const c=Object.assign({upsert:_O.upsert},i),h=Object.assign(Object.assign({},this.headers),{"x-upsert":String(c.upsert)});typeof Blob<"u"&&n instanceof Blob?(u=new FormData,u.append("cacheControl",c.cacheControl),u.append("",n)):typeof FormData<"u"&&n instanceof FormData?(u=n,u.append("cacheControl",c.cacheControl)):(u=n,h["cache-control"]=`max-age=${c.cacheControl}`,h["content-type"]=c.contentType);const f=yield this.fetch(l.toString(),{method:"PUT",body:u,headers:h}),d=yield f.json();return f.ok?{data:{path:a,fullPath:d.Key},error:null}:{data:null,error:d}}catch(u){if(hn(u))return{data:null,error:u};throw u}})}createSignedUploadUrl(r,o){return oo(this,void 0,void 0,function*(){try{let n=this._getFinalPath(r);const i=Object.assign({},this.headers);o!=null&&o.upsert&&(i["x-upsert"]="true");const a=yield ns(this.fetch,`${this.url}/object/upload/sign/${n}`,{},{headers:i}),s=new URL(this.url+a.url),l=s.searchParams.get("token");if(!l)throw new fS("No token returned by API");return{data:{signedUrl:s.toString(),path:r,token:l},error:null}}catch(n){if(hn(n))return{data:null,error:n};throw n}})}update(r,o,n){return oo(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",r,o,n)})}move(r,o,n){return oo(this,void 0,void 0,function*(){try{return{data:yield ns(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:r,destinationKey:o,destinationBucket:n==null?void 0:n.destinationBucket},{headers:this.headers}),error:null}}catch(i){if(hn(i))return{data:null,error:i};throw i}})}copy(r,o,n){return oo(this,void 0,void 0,function*(){try{return{data:{path:(yield ns(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:r,destinationKey:o,destinationBucket:n==null?void 0:n.destinationBucket},{headers:this.headers})).Key},error:null}}catch(i){if(hn(i))return{data:null,error:i};throw i}})}createSignedUrl(r,o,n){return oo(this,void 0,void 0,function*(){try{let i=this._getFinalPath(r),a=yield ns(this.fetch,`${this.url}/object/sign/${i}`,Object.assign({expiresIn:o},n!=null&&n.transform?{transform:n.transform}:{}),{headers:this.headers});const s=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return a={signedUrl:encodeURI(`${this.url}${a.signedURL}${s}`)},{data:a,error:null}}catch(i){if(hn(i))return{data:null,error:i};throw i}})}createSignedUrls(r,o,n){return oo(this,void 0,void 0,function*(){try{const i=yield ns(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:o,paths:r},{headers:this.headers}),a=n!=null&&n.download?`&download=${n.download===!0?"":n.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(hn(i))return{data:null,error:i};throw i}})}download(r,o){return oo(this,void 0,void 0,function*(){const i=typeof(o==null?void 0:o.transform)<"u"?"render/image/authenticated":"object",a=this.transformOptsToQueryString((o==null?void 0:o.transform)||{}),s=a?`?${a}`:"";try{const l=this._getFinalPath(r);return{data:yield(yield Py(this.fetch,`${this.url}/${i}/${l}${s}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(l){if(hn(l))return{data:null,error:l};throw l}})}info(r){return oo(this,void 0,void 0,function*(){const o=this._getFinalPath(r);try{const n=yield Py(this.fetch,`${this.url}/object/info/${o}`,{headers:this.headers});return{data:Hx(n),error:null}}catch(n){if(hn(n))return{data:null,error:n};throw n}})}exists(r){return oo(this,void 0,void 0,function*(){const o=this._getFinalPath(r);try{return yield nW(this.fetch,`${this.url}/object/${o}`,{headers:this.headers}),{data:!0,error:null}}catch(n){if(hn(n)&&n instanceof Wx){const i=n.originalError;if([400,404].includes(i==null?void 0:i.status))return{data:!1,error:n}}throw n}})}getPublicUrl(r,o){const n=this._getFinalPath(r),i=[],a=o!=null&&o.download?`download=${o.download===!0?"":o.download}`:"";a!==""&&i.push(a);const l=typeof(o==null?void 0:o.transform)<"u"?"render/image":"object",u=this.transformOptsToQueryString((o==null?void 0:o.transform)||{});u!==""&&i.push(u);let c=i.join("&");return c!==""&&(c=`?${c}`),{data:{publicUrl:encodeURI(`${this.url}/${l}/public/${n}${c}`)}}}remove(r){return oo(this,void 0,void 0,function*(){try{return{data:yield RL(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:r},{headers:this.headers}),error:null}}catch(o){if(hn(o))return{data:null,error:o};throw o}})}list(r,o,n){return oo(this,void 0,void 0,function*(){try{const i=Object.assign(Object.assign(Object.assign({},oW),o),{prefix:r||""});return{data:yield ns(this.fetch,`${this.url}/object/list/${this.bucketId}`,i,{headers:this.headers},n),error:null}}catch(i){if(hn(i))return{data:null,error:i};throw i}})}encodeMetadata(r){return JSON.stringify(r)}toBase64(r){return typeof Buffer<"u"?Buffer.from(r).toString("base64"):btoa(r)}_getFinalPath(r){return`${this.bucketId}/${r}`}_removeEmptyFolders(r){return r.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(r){const o=[];return r.width&&o.push(`width=${r.width}`),r.height&&o.push(`height=${r.height}`),r.resize&&o.push(`resize=${r.resize}`),r.format&&o.push(`format=${r.format}`),r.quality&&o.push(`quality=${r.quality}`),o.join("&")}}const aW="2.7.1",sW={"X-Client-Info":`storage-js/${aW}`};var du=function(t,r,o,n){function i(a){return a instanceof o?a:new o(function(s){s(a)})}return new(o||(o=Promise))(function(a,s){function l(h){try{c(n.next(h))}catch(f){s(f)}}function u(h){try{c(n.throw(h))}catch(f){s(f)}}function c(h){h.done?a(h.value):i(h.value).then(l,u)}c((n=n.apply(t,r||[])).next())})};class lW{constructor(r,o={},n){this.url=r,this.headers=Object.assign(Object.assign({},sW),o),this.fetch=ML(n)}listBuckets(){return du(this,void 0,void 0,function*(){try{return{data:yield Py(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(r){if(hn(r))return{data:null,error:r};throw r}})}getBucket(r){return du(this,void 0,void 0,function*(){try{return{data:yield Py(this.fetch,`${this.url}/bucket/${r}`,{headers:this.headers}),error:null}}catch(o){if(hn(o))return{data:null,error:o};throw o}})}createBucket(r,o={public:!1}){return du(this,void 0,void 0,function*(){try{return{data:yield ns(this.fetch,`${this.url}/bucket`,{id:r,name:r,public:o.public,file_size_limit:o.fileSizeLimit,allowed_mime_types:o.allowedMimeTypes},{headers:this.headers}),error:null}}catch(n){if(hn(n))return{data:null,error:n};throw n}})}updateBucket(r,o){return du(this,void 0,void 0,function*(){try{return{data:yield rW(this.fetch,`${this.url}/bucket/${r}`,{id:r,name:r,public:o.public,file_size_limit:o.fileSizeLimit,allowed_mime_types:o.allowedMimeTypes},{headers:this.headers}),error:null}}catch(n){if(hn(n))return{data:null,error:n};throw n}})}emptyBucket(r){return du(this,void 0,void 0,function*(){try{return{data:yield ns(this.fetch,`${this.url}/bucket/${r}/empty`,{},{headers:this.headers}),error:null}}catch(o){if(hn(o))return{data:null,error:o};throw o}})}deleteBucket(r){return du(this,void 0,void 0,function*(){try{return{data:yield RL(this.fetch,`${this.url}/bucket/${r}`,{},{headers:this.headers}),error:null}}catch(o){if(hn(o))return{data:null,error:o};throw o}})}}class uW extends lW{constructor(r,o={},n){super(r,o,n)}from(r){return new iW(this.url,this.headers,r,this.fetch)}}const cW="2.48.1";let uf="";typeof Deno<"u"?uf="deno":typeof document<"u"?uf="web":typeof navigator<"u"&&navigator.product==="ReactNative"?uf="react-native":uf="node";const dW={"X-Client-Info":`supabase-js-${uf}/${cW}`},fW={headers:dW},hW={schema:"public"},pW={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},mW={};var yW=function(t,r,o,n){function i(a){return a instanceof o?a:new o(function(s){s(a)})}return new(o||(o=Promise))(function(a,s){function l(h){try{c(n.next(h))}catch(f){s(f)}}function u(h){try{c(n.throw(h))}catch(f){s(f)}}function c(h){h.done?a(h.value):i(h.value).then(l,u)}c((n=n.apply(t,r||[])).next())})};const gW=t=>{let r;return t?r=t:typeof fetch>"u"?r=gL:r=fetch,(...o)=>r(...o)},vW=()=>typeof Headers>"u"?vL:Headers,bW=(t,r,o)=>{const n=gW(o),i=vW();return(a,s)=>yW(void 0,void 0,void 0,function*(){var l;const u=(l=yield r())!==null&&l!==void 0?l:t;let c=new i(s==null?void 0:s.headers);return c.has("apikey")||c.set("apikey",t),c.has("Authorization")||c.set("Authorization",`Bearer ${u}`),n(a,Object.assign(Object.assign({},s),{headers:c}))})};var xW=function(t,r,o,n){function i(a){return a instanceof o?a:new o(function(s){s(a)})}return new(o||(o=Promise))(function(a,s){function l(h){try{c(n.next(h))}catch(f){s(f)}}function u(h){try{c(n.throw(h))}catch(f){s(f)}}function c(h){h.done?a(h.value):i(h.value).then(l,u)}c((n=n.apply(t,r||[])).next())})};function wW(t){return t.replace(/\/$/,"")}function _W(t,r){const{db:o,auth:n,realtime:i,global:a}=t,{db:s,auth:l,realtime:u,global:c}=r,h={db:Object.assign(Object.assign({},s),o),auth:Object.assign(Object.assign({},l),n),realtime:Object.assign(Object.assign({},u),i),global:Object.assign(Object.assign({},c),a),accessToken:()=>xW(this,void 0,void 0,function*(){return""})};return t.accessToken?h.accessToken=t.accessToken:delete h.accessToken,h}const IL="2.67.3",jW="http://localhost:9999",SW="supabase.auth.token",EW={"X-Client-Info":`gotrue-js/${IL}`},jO=10,qx="X-Supabase-Api-Version",NL={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}};function TW(t){return Math.round(Date.now()/1e3)+t}function OW(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const r=Math.random()*16|0;return(t=="x"?r:r&3|8).toString(16)})}const Mi=()=>typeof window<"u"&&typeof document<"u",Qs={tested:!1,writable:!1},Pf=()=>{if(!Mi())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Qs.tested)return Qs.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),Qs.tested=!0,Qs.writable=!0}catch{Qs.tested=!0,Qs.writable=!1}return Qs.writable};function kW(t){const r={},o=new URL(t);if(o.hash&&o.hash[0]==="#")try{new URLSearchParams(o.hash.substring(1)).forEach((i,a)=>{r[a]=i})}catch{}return o.searchParams.forEach((n,i)=>{r[i]=n}),r}const LL=t=>{let r;return t?r=t:typeof fetch>"u"?r=(...o)=>Ec(async()=>{const{default:n}=await Promise.resolve().then(()=>ld);return{default:n}},void 0).then(({default:n})=>n(...o)):r=fetch,(...o)=>r(...o)},PW=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",DL=async(t,r,o)=>{await t.setItem(r,JSON.stringify(o))},sm=async(t,r)=>{const o=await t.getItem(r);if(!o)return null;try{return JSON.parse(o)}catch{return o}},lm=async(t,r)=>{await t.removeItem(r)};function CW(t){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let o="",n,i,a,s,l,u,c,h=0;for(t=t.replace("-","+").replace("_","/");h>4,i=(l&15)<<4|u>>2,a=(u&3)<<6|c,o=o+String.fromCharCode(n),u!=64&&i!=0&&(o=o+String.fromCharCode(i)),c!=64&&a!=0&&(o=o+String.fromCharCode(a));return o}class Av{constructor(){this.promise=new Av.promiseConstructor((r,o)=>{this.resolve=r,this.reject=o})}}Av.promiseConstructor=Promise;function SO(t){const r=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}=?$|[a-z0-9_-]{2}(==)?$)$/i,o=t.split(".");if(o.length!==3)throw new Error("JWT is not valid: not a JWT structure");if(!r.test(o[1]))throw new Error("JWT is not valid: payload is not in base64url format");const n=o[1];return JSON.parse(CW(n))}async function AW(t){return await new Promise(r=>{setTimeout(()=>r(null),t)})}function MW(t,r){return new Promise((n,i)=>{(async()=>{for(let a=0;a<1/0;a++)try{const s=await t(a);if(!r(a,null,s)){n(s);return}}catch(s){if(!r(a,s)){i(s);return}}})()})}function RW(t){return("0"+t.toString(16)).substr(-2)}function IW(){const r=new Uint32Array(56);if(typeof crypto>"u"){const o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=o.length;let i="";for(let a=0;a<56;a++)i+=o.charAt(Math.floor(Math.random()*n));return i}return crypto.getRandomValues(r),Array.from(r,RW).join("")}async function NW(t){const o=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",o),i=new Uint8Array(n);return Array.from(i).map(a=>String.fromCharCode(a)).join("")}function LW(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function DW(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 o=await NW(t);return LW(o)}async function fu(t,r,o=!1){const n=IW();let i=n;o&&(i+="/PASSWORD_RECOVERY"),await DL(t,`${r}-code-verifier`,i);const a=await DW(n);return[a,n===a?"plain":"s256"]}const FW=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function $W(t){const r=t.headers.get(qx);if(!r||!r.match(FW))return null;try{return new Date(`${r}T00:00:00.0Z`)}catch{return null}}class hS extends Error{constructor(r,o,n){super(r),this.__isAuthError=!0,this.name="AuthError",this.status=o,this.code=n}}function Rt(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class UW extends hS{constructor(r,o,n){super(r,o,n),this.name="AuthApiError",this.status=o,this.code=n}}function BW(t){return Rt(t)&&t.name==="AuthApiError"}class FL extends hS{constructor(r,o){super(r),this.name="AuthUnknownError",this.originalError=o}}class tu extends hS{constructor(r,o,n,i){super(r,n,i),this.name=o,this.status=n}}class Qa extends tu{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function zW(t){return Rt(t)&&t.name==="AuthSessionMissingError"}class Ab extends tu{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class um extends tu{constructor(r){super(r,"AuthInvalidCredentialsError",400,void 0)}}class cm extends tu{constructor(r,o=null){super(r,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=o}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function VW(t){return Rt(t)&&t.name==="AuthImplicitGrantRedirectError"}class EO extends tu{constructor(r,o=null){super(r,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=o}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class Xx extends tu{constructor(r,o){super(r,"AuthRetryableFetchError",o,void 0)}}function Mb(t){return Rt(t)&&t.name==="AuthRetryableFetchError"}class TO extends tu{constructor(r,o,n){super(r,"AuthWeakPasswordError",o,"weak_password"),this.reasons=n}}var GW=function(t,r){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&r.indexOf(n)<0&&(o[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);it.msg||t.message||t.error_description||t.error||JSON.stringify(t),WW=[502,503,504];async function OO(t){var r;if(!PW(t))throw new Xx(ol(t),0);if(WW.includes(t.status))throw new Xx(ol(t),t.status);let o;try{o=await t.json()}catch(a){throw new FL(ol(a),a)}let n;const i=$W(t);if(i&&i.getTime()>=NL["2024-01-01"].timestamp&&typeof o=="object"&&o&&typeof o.code=="string"?n=o.code:typeof o=="object"&&o&&typeof o.error_code=="string"&&(n=o.error_code),n){if(n==="weak_password")throw new TO(ol(o),t.status,((r=o.weak_password)===null||r===void 0?void 0:r.reasons)||[]);if(n==="session_not_found")throw new Qa}else if(typeof o=="object"&&o&&typeof o.weak_password=="object"&&o.weak_password&&Array.isArray(o.weak_password.reasons)&&o.weak_password.reasons.length&&o.weak_password.reasons.reduce((a,s)=>a&&typeof s=="string",!0))throw new TO(ol(o),t.status,o.weak_password.reasons);throw new UW(ol(o),t.status||500,n)}const HW=(t,r,o,n)=>{const i={method:t,headers:(r==null?void 0:r.headers)||{}};return t==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},r==null?void 0:r.headers),i.body=JSON.stringify(n),Object.assign(Object.assign({},i),o))};async function Vt(t,r,o,n){var i;const a=Object.assign({},n==null?void 0:n.headers);a[qx]||(a[qx]=NL["2024-01-01"].name),n!=null&&n.jwt&&(a.Authorization=`Bearer ${n.jwt}`);const s=(i=n==null?void 0:n.query)!==null&&i!==void 0?i:{};n!=null&&n.redirectTo&&(s.redirect_to=n.redirectTo);const l=Object.keys(s).length?"?"+new URLSearchParams(s).toString():"",u=await qW(t,r,o+l,{headers:a,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(u):{data:Object.assign({},u),error:null}}async function qW(t,r,o,n,i,a){const s=HW(r,n,i,a);let l;try{l=await t(o,Object.assign({},s))}catch(u){throw console.error(u),new Xx(ol(u),0)}if(l.ok||await OO(l),n!=null&&n.noResolveJson)return l;try{return await l.json()}catch(u){await OO(u)}}function Ja(t){var r;let o=null;ZW(t)&&(o=Object.assign({},t),t.expires_at||(o.expires_at=TW(t.expires_in)));const n=(r=t.user)!==null&&r!==void 0?r:t;return{data:{session:o,user:n},error:null}}function kO(t){const r=Ja(t);return!r.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((o,n)=>o&&typeof n=="string",!0)&&(r.data.weak_password=t.weak_password),r}function ls(t){var r;return{data:{user:(r=t.user)!==null&&r!==void 0?r:t},error:null}}function XW(t){return{data:t,error:null}}function YW(t){const{action_link:r,email_otp:o,hashed_token:n,redirect_to:i,verification_type:a}=t,s=GW(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),l={action_link:r,email_otp:o,hashed_token:n,redirect_to:i,verification_type:a},u=Object.assign({},s);return{data:{properties:l,user:u},error:null}}function KW(t){return t}function ZW(t){return t.access_token&&t.refresh_token&&t.expires_in}var QW=function(t,r){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&r.indexOf(n)<0&&(o[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i0&&(m.forEach(y=>{const p=parseInt(y.split(";")[0].split("=")[1].substring(0,1)),g=JSON.parse(y.split(";")[1].split("=")[1]);c[`${g}Page`]=p}),c.total=parseInt(d)),{data:Object.assign(Object.assign({},f),c),error:null}}catch(c){if(Rt(c))return{data:{users:[]},error:c};throw c}}async getUserById(r){try{return await Vt(this.fetch,"GET",`${this.url}/admin/users/${r}`,{headers:this.headers,xform:ls})}catch(o){if(Rt(o))return{data:{user:null},error:o};throw o}}async updateUserById(r,o){try{return await Vt(this.fetch,"PUT",`${this.url}/admin/users/${r}`,{body:o,headers:this.headers,xform:ls})}catch(n){if(Rt(n))return{data:{user:null},error:n};throw n}}async deleteUser(r,o=!1){try{return await Vt(this.fetch,"DELETE",`${this.url}/admin/users/${r}`,{headers:this.headers,body:{should_soft_delete:o},xform:ls})}catch(n){if(Rt(n))return{data:{user:null},error:n};throw n}}async _listFactors(r){try{const{data:o,error:n}=await Vt(this.fetch,"GET",`${this.url}/admin/users/${r.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:o,error:n}}catch(o){if(Rt(o))return{data:null,error:o};throw o}}async _deleteFactor(r){try{return{data:await Vt(this.fetch,"DELETE",`${this.url}/admin/users/${r.userId}/factors/${r.id}`,{headers:this.headers}),error:null}}catch(o){if(Rt(o))return{data:null,error:o};throw o}}}const eH={getItem:t=>Pf()?globalThis.localStorage.getItem(t):null,setItem:(t,r)=>{Pf()&&globalThis.localStorage.setItem(t,r)},removeItem:t=>{Pf()&&globalThis.localStorage.removeItem(t)}};function PO(t={}){return{getItem:r=>t[r]||null,setItem:(r,o)=>{t[r]=o},removeItem:r=>{delete t[r]}}}function tH(){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)}}const hu={debug:!!(globalThis&&Pf()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class $L extends Error{constructor(r){super(r),this.isAcquireTimeout=!0}}class rH extends $L{}async function nH(t,r,o){hu.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,r);const n=new globalThis.AbortController;return r>0&&setTimeout(()=>{n.abort(),hu.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},r),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,r===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async i=>{if(i){hu.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,i.name);try{return await o()}finally{hu.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,i.name)}}else{if(r===0)throw hu.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new rH(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(hu.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 o()}}))}tH();const oH={url:jW,storageKey:SW,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:EW,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1},Gd=30*1e3,CO=3;async function AO(t,r,o){return await o()}class dh{constructor(r){var o,n;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,this.instanceID=dh.nextInstanceID,dh.nextInstanceID+=1,this.instanceID>0&&Mi()&&console.warn("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.");const i=Object.assign(Object.assign({},oH),r);if(this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.persistSession=i.persistSession,this.storageKey=i.storageKey,this.autoRefreshToken=i.autoRefreshToken,this.admin=new JW({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=LL(i.fetch),this.lock=i.lock||AO,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,i.lock?this.lock=i.lock:Mi()&&(!((o=globalThis==null?void 0:globalThis.navigator)===null||o===void 0)&&o.locks)?this.lock=nH:this.lock=AO,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)},this.persistSession?i.storage?this.storage=i.storage:Pf()?this.storage=eH:(this.memoryStorage={},this.storage=PO(this.memoryStorage)):(this.memoryStorage={},this.storage=PO(this.memoryStorage)),Mi()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(a){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",a)}(n=this.broadcastChannel)===null||n===void 0||n.addEventListener("message",async a=>{this._debug("received broadcast notification from other tab or client",a),await this._notifyAllSubscribers(a.data.event,a.data.session,!1)})}this.initialize()}_debug(...r){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${IL}) ${new Date().toISOString()}`,...r),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 r;try{const o=kW(window.location.href);let n="none";if(this._isImplicitGrantCallback(o)?n="implicit":await this._isPKCECallback(o)&&(n="pkce"),Mi()&&this.detectSessionInUrl&&n!=="none"){const{data:i,error:a}=await this._getSessionFromURL(o,n);if(a){if(this._debug("#_initialize()","error detecting session from URL",a),VW(a)){const u=(r=a.details)===null||r===void 0?void 0:r.code;if(u==="identity_already_exists"||u==="identity_not_found"||u==="single_identity_not_deletable")return{error:a}}return await this._removeSession(),{error:a}}const{session:s,redirectType:l}=i;return this._debug("#_initialize()","detected session in URL",s,"redirect type",l),await this._saveSession(s),setTimeout(async()=>{l==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",s):await this._notifyAllSubscribers("SIGNED_IN",s)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(o){return Rt(o)?{error:o}:{error:new FL("Unexpected error during initialization",o)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(r){var o,n,i;try{const a=await Vt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(o=r==null?void 0:r.options)===null||o===void 0?void 0:o.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(i=r==null?void 0:r.options)===null||i===void 0?void 0:i.captchaToken}},xform:Ja}),{data:s,error:l}=a;if(l||!s)return{data:{user:null,session:null},error:l};const u=s.session,c=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",u)),{data:{user:c,session:u},error:null}}catch(a){if(Rt(a))return{data:{user:null,session:null},error:a};throw a}}async signUp(r){var o,n,i;try{let a;if("email"in r){const{email:h,password:f,options:d}=r;let m=null,y=null;this.flowType==="pkce"&&([m,y]=await fu(this.storage,this.storageKey)),a=await Vt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:d==null?void 0:d.emailRedirectTo,body:{email:h,password:f,data:(o=d==null?void 0:d.data)!==null&&o!==void 0?o:{},gotrue_meta_security:{captcha_token:d==null?void 0:d.captchaToken},code_challenge:m,code_challenge_method:y},xform:Ja})}else if("phone"in r){const{phone:h,password:f,options:d}=r;a=await Vt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:h,password:f,data:(n=d==null?void 0:d.data)!==null&&n!==void 0?n:{},channel:(i=d==null?void 0:d.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:d==null?void 0:d.captchaToken}},xform:Ja})}else throw new um("You must provide either an email or phone number and a password");const{data:s,error:l}=a;if(l||!s)return{data:{user:null,session:null},error:l};const u=s.session,c=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",u)),{data:{user:c,session:u},error:null}}catch(a){if(Rt(a))return{data:{user:null,session:null},error:a};throw a}}async signInWithPassword(r){try{let o;if("email"in r){const{email:a,password:s,options:l}=r;o=await Vt(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:a,password:s,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:kO})}else if("phone"in r){const{phone:a,password:s,options:l}=r;o=await Vt(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:a,password:s,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:kO})}else throw new um("You must provide either an email or phone number and a password");const{data:n,error:i}=o;return i?{data:{user:null,session:null},error:i}:!n||!n.session||!n.user?{data:{user:null,session:null},error:new Ab}:(n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),{data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:i})}catch(o){if(Rt(o))return{data:{user:null,session:null},error:o};throw o}}async signInWithOAuth(r){var o,n,i,a;return await this._handleProviderSignIn(r.provider,{redirectTo:(o=r.options)===null||o===void 0?void 0:o.redirectTo,scopes:(n=r.options)===null||n===void 0?void 0:n.scopes,queryParams:(i=r.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(a=r.options)===null||a===void 0?void 0:a.skipBrowserRedirect})}async exchangeCodeForSession(r){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(r))}async _exchangeCodeForSession(r){const o=await sm(this.storage,`${this.storageKey}-code-verifier`),[n,i]=(o??"").split("/");try{const{data:a,error:s}=await Vt(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:r,code_verifier:n},xform:Ja});if(await lm(this.storage,`${this.storageKey}-code-verifier`),s)throw s;return!a||!a.session||!a.user?{data:{user:null,session:null,redirectType:null},error:new Ab}:(a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),{data:Object.assign(Object.assign({},a),{redirectType:i??null}),error:s})}catch(a){if(Rt(a))return{data:{user:null,session:null,redirectType:null},error:a};throw a}}async signInWithIdToken(r){try{const{options:o,provider:n,token:i,access_token:a,nonce:s}=r,l=await Vt(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:i,access_token:a,nonce:s,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:Ja}),{data:u,error:c}=l;return c?{data:{user:null,session:null},error:c}:!u||!u.session||!u.user?{data:{user:null,session:null},error:new Ab}:(u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",u.session)),{data:u,error:c})}catch(o){if(Rt(o))return{data:{user:null,session:null},error:o};throw o}}async signInWithOtp(r){var o,n,i,a,s;try{if("email"in r){const{email:l,options:u}=r;let c=null,h=null;this.flowType==="pkce"&&([c,h]=await fu(this.storage,this.storageKey));const{error:f}=await Vt(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:l,data:(o=u==null?void 0:u.data)!==null&&o!==void 0?o:{},create_user:(n=u==null?void 0:u.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:u==null?void 0:u.captchaToken},code_challenge:c,code_challenge_method:h},redirectTo:u==null?void 0:u.emailRedirectTo});return{data:{user:null,session:null},error:f}}if("phone"in r){const{phone:l,options:u}=r,{data:c,error:h}=await Vt(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:l,data:(i=u==null?void 0:u.data)!==null&&i!==void 0?i:{},create_user:(a=u==null?void 0:u.shouldCreateUser)!==null&&a!==void 0?a:!0,gotrue_meta_security:{captcha_token:u==null?void 0:u.captchaToken},channel:(s=u==null?void 0:u.channel)!==null&&s!==void 0?s:"sms"}});return{data:{user:null,session:null,messageId:c==null?void 0:c.message_id},error:h}}throw new um("You must provide either an email or phone number.")}catch(l){if(Rt(l))return{data:{user:null,session:null},error:l};throw l}}async verifyOtp(r){var o,n;try{let i,a;"options"in r&&(i=(o=r.options)===null||o===void 0?void 0:o.redirectTo,a=(n=r.options)===null||n===void 0?void 0:n.captchaToken);const{data:s,error:l}=await Vt(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},r),{gotrue_meta_security:{captcha_token:a}}),redirectTo:i,xform:Ja});if(l)throw l;if(!s)throw new Error("An error occurred on token verification.");const u=s.session,c=s.user;return u!=null&&u.access_token&&(await this._saveSession(u),await this._notifyAllSubscribers(r.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",u)),{data:{user:c,session:u},error:null}}catch(i){if(Rt(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithSSO(r){var o,n,i;try{let a=null,s=null;return this.flowType==="pkce"&&([a,s]=await fu(this.storage,this.storageKey)),await Vt(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in r?{provider_id:r.providerId}:null),"domain"in r?{domain:r.domain}:null),{redirect_to:(n=(o=r.options)===null||o===void 0?void 0:o.redirectTo)!==null&&n!==void 0?n:void 0}),!((i=r==null?void 0:r.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:r.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:a,code_challenge_method:s}),headers:this.headers,xform:XW})}catch(a){if(Rt(a))return{data:null,error:a};throw a}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async r=>{const{data:{session:o},error:n}=r;if(n)throw n;if(!o)throw new Qa;const{error:i}=await Vt(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:o.access_token});return{data:{user:null,session:null},error:i}})}catch(r){if(Rt(r))return{data:{user:null,session:null},error:r};throw r}}async resend(r){try{const o=`${this.url}/resend`;if("email"in r){const{email:n,type:i,options:a}=r,{error:s}=await Vt(this.fetch,"POST",o,{headers:this.headers,body:{email:n,type:i,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},redirectTo:a==null?void 0:a.emailRedirectTo});return{data:{user:null,session:null},error:s}}else if("phone"in r){const{phone:n,type:i,options:a}=r,{data:s,error:l}=await Vt(this.fetch,"POST",o,{headers:this.headers,body:{phone:n,type:i,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}}});return{data:{user:null,session:null,messageId:s==null?void 0:s.message_id},error:l}}throw new um("You must provide either an email or phone number and a type")}catch(o){if(Rt(o))return{data:{user:null,session:null},error:o};throw o}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async o=>o))}async _acquireLock(r,o){this._debug("#_acquireLock","begin",r);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await n,await o()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,r,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=o();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(r){this._debug("#_useSession","begin");try{const o=await this.__loadSession();return await r(o)}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 r=null;const o=await sm(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",o),o!==null&&(this._isValidSession(o)?r=o:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!r)return{data:{session:null},error:null};const n=r.expires_at?r.expires_at<=Date.now()/1e3:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",r.expires_at),!n){if(this.storage.isServer){let s=this.suppressGetSessionWarning;r=new Proxy(r,{get:(u,c,h)=>(!s&&c==="user"&&(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."),s=!0,this.suppressGetSessionWarning=!0),Reflect.get(u,c,h))})}return{data:{session:r},error:null}}const{session:i,error:a}=await this._callRefreshToken(r.refresh_token);return a?{data:{session:null},error:a}:{data:{session:i},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(r){return r?await this._getUser(r):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(r){try{return r?await Vt(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:r,xform:ls}):await this._useSession(async o=>{var n,i,a;const{data:s,error:l}=o;if(l)throw l;return!(!((n=s.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Qa}:await Vt(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:ls})})}catch(o){if(Rt(o))return zW(o)&&(await this._removeSession(),await lm(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:o};throw o}}async updateUser(r,o={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(r,o))}async _updateUser(r,o={}){try{return await this._useSession(async n=>{const{data:i,error:a}=n;if(a)throw a;if(!i.session)throw new Qa;const s=i.session;let l=null,u=null;this.flowType==="pkce"&&r.email!=null&&([l,u]=await fu(this.storage,this.storageKey));const{data:c,error:h}=await Vt(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:o==null?void 0:o.emailRedirectTo,body:Object.assign(Object.assign({},r),{code_challenge:l,code_challenge_method:u}),jwt:s.access_token,xform:ls});if(h)throw h;return s.user=c.user,await this._saveSession(s),await this._notifyAllSubscribers("USER_UPDATED",s),{data:{user:s.user},error:null}})}catch(n){if(Rt(n))return{data:{user:null},error:n};throw n}}_decodeJWT(r){return SO(r)}async setSession(r){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(r))}async _setSession(r){try{if(!r.access_token||!r.refresh_token)throw new Qa;const o=Date.now()/1e3;let n=o,i=!0,a=null;const s=SO(r.access_token);if(s.exp&&(n=s.exp,i=n<=o),i){const{session:l,error:u}=await this._callRefreshToken(r.refresh_token);if(u)return{data:{user:null,session:null},error:u};if(!l)return{data:{user:null,session:null},error:null};a=l}else{const{data:l,error:u}=await this._getUser(r.access_token);if(u)throw u;a={access_token:r.access_token,refresh_token:r.refresh_token,user:l.user,token_type:"bearer",expires_in:n-o,expires_at:n},await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)}return{data:{user:a.user,session:a},error:null}}catch(o){if(Rt(o))return{data:{session:null,user:null},error:o};throw o}}async refreshSession(r){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(r))}async _refreshSession(r){try{return await this._useSession(async o=>{var n;if(!r){const{data:s,error:l}=o;if(l)throw l;r=(n=s.session)!==null&&n!==void 0?n:void 0}if(!(r!=null&&r.refresh_token))throw new Qa;const{session:i,error:a}=await this._callRefreshToken(r.refresh_token);return a?{data:{user:null,session:null},error:a}:i?{data:{user:i.user,session:i},error:null}:{data:{user:null,session:null},error:null}})}catch(o){if(Rt(o))return{data:{user:null,session:null},error:o};throw o}}async _getSessionFromURL(r,o){try{if(!Mi())throw new cm("No browser detected.");if(r.error||r.error_description||r.error_code)throw new cm(r.error_description||"Error in URL with unspecified error_description",{error:r.error||"unspecified_error",code:r.error_code||"unspecified_code"});switch(o){case"implicit":if(this.flowType==="pkce")throw new EO("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new cm("Not a valid implicit grant flow url.");break;default:}if(o==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!r.code)throw new EO("No code detected.");const{data:x,error:v}=await this._exchangeCodeForSession(r.code);if(v)throw v;const w=new URL(window.location.href);return w.searchParams.delete("code"),window.history.replaceState(window.history.state,"",w.toString()),{data:{session:x.session,redirectType:null},error:null}}const{provider_token:n,provider_refresh_token:i,access_token:a,refresh_token:s,expires_in:l,expires_at:u,token_type:c}=r;if(!a||!l||!s||!c)throw new cm("No session defined in URL");const h=Math.round(Date.now()/1e3),f=parseInt(l);let d=h+f;u&&(d=parseInt(u));const m=d-h;m*1e3<=Gd&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${m}s, should have been closer to ${f}s`);const y=d-f;h-y>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",y,d,h):h-y<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",y,d,h);const{data:p,error:g}=await this._getUser(a);if(g)throw g;const b={provider_token:n,provider_refresh_token:i,access_token:a,expires_in:f,expires_at:d,refresh_token:s,token_type:c,user:p.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:b,redirectType:r.type},error:null}}catch(n){if(Rt(n))return{data:{session:null,redirectType:null},error:n};throw n}}_isImplicitGrantCallback(r){return!!(r.access_token||r.error_description)}async _isPKCECallback(r){const o=await sm(this.storage,`${this.storageKey}-code-verifier`);return!!(r.code&&o)}async signOut(r={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(r))}async _signOut({scope:r}={scope:"global"}){return await this._useSession(async o=>{var n;const{data:i,error:a}=o;if(a)return{error:a};const s=(n=i.session)===null||n===void 0?void 0:n.access_token;if(s){const{error:l}=await this.admin.signOut(s,r);if(l&&!(BW(l)&&(l.status===404||l.status===401||l.status===403)))return{error:l}}return r!=="others"&&(await this._removeSession(),await lm(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(r){const o=OW(),n={id:o,callback:r,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",o),this.stateChangeEmitters.delete(o)}};return this._debug("#onAuthStateChange()","registered callback with id",o),this.stateChangeEmitters.set(o,n),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(o)})))(),{data:{subscription:n}}}async _emitInitialSession(r){return await this._useSession(async o=>{var n,i;try{const{data:{session:a},error:s}=o;if(s)throw s;await((n=this.stateChangeEmitters.get(r))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",a)),this._debug("INITIAL_SESSION","callback id",r,"session",a)}catch(a){await((i=this.stateChangeEmitters.get(r))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",r,"error",a),console.error(a)}})}async resetPasswordForEmail(r,o={}){let n=null,i=null;this.flowType==="pkce"&&([n,i]=await fu(this.storage,this.storageKey,!0));try{return await Vt(this.fetch,"POST",`${this.url}/recover`,{body:{email:r,code_challenge:n,code_challenge_method:i,gotrue_meta_security:{captcha_token:o.captchaToken}},headers:this.headers,redirectTo:o.redirectTo})}catch(a){if(Rt(a))return{data:null,error:a};throw a}}async getUserIdentities(){var r;try{const{data:o,error:n}=await this.getUser();if(n)throw n;return{data:{identities:(r=o.user.identities)!==null&&r!==void 0?r:[]},error:null}}catch(o){if(Rt(o))return{data:null,error:o};throw o}}async linkIdentity(r){var o;try{const{data:n,error:i}=await this._useSession(async a=>{var s,l,u,c,h;const{data:f,error:d}=a;if(d)throw d;const m=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,r.provider,{redirectTo:(s=r.options)===null||s===void 0?void 0:s.redirectTo,scopes:(l=r.options)===null||l===void 0?void 0:l.scopes,queryParams:(u=r.options)===null||u===void 0?void 0:u.queryParams,skipBrowserRedirect:!0});return await Vt(this.fetch,"GET",m,{headers:this.headers,jwt:(h=(c=f.session)===null||c===void 0?void 0:c.access_token)!==null&&h!==void 0?h:void 0})});if(i)throw i;return Mi()&&!(!((o=r.options)===null||o===void 0)&&o.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),{data:{provider:r.provider,url:n==null?void 0:n.url},error:null}}catch(n){if(Rt(n))return{data:{provider:r.provider,url:null},error:n};throw n}}async unlinkIdentity(r){try{return await this._useSession(async o=>{var n,i;const{data:a,error:s}=o;if(s)throw s;return await Vt(this.fetch,"DELETE",`${this.url}/user/identities/${r.identity_id}`,{headers:this.headers,jwt:(i=(n=a.session)===null||n===void 0?void 0:n.access_token)!==null&&i!==void 0?i:void 0})})}catch(o){if(Rt(o))return{data:null,error:o};throw o}}async _refreshAccessToken(r){const o=`#_refreshAccessToken(${r.substring(0,5)}...)`;this._debug(o,"begin");try{const n=Date.now();return await MW(async i=>(i>0&&await AW(200*Math.pow(2,i-1)),this._debug(o,"refreshing attempt",i),await Vt(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:r},headers:this.headers,xform:Ja})),(i,a)=>{const s=200*Math.pow(2,i);return a&&Mb(a)&&Date.now()+s-n{try{await l.callback(r,o)}catch(u){a.push(u)}});if(await Promise.all(s),a.length>0){for(let l=0;lthis._autoRefreshTokenTick(),Gd);this.autoRefreshTicker=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const r=this.autoRefreshTicker;this.autoRefreshTicker=null,r&&clearInterval(r)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const r=Date.now();try{return await this._useSession(async o=>{const{data:{session:n}}=o;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const i=Math.floor((n.expires_at*1e3-r)/Gd);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${Gd}ms, refresh threshold is ${CO} ticks`),i<=CO&&await this._callRefreshToken(n.refresh_token)})}catch(o){console.error("Auto refresh tick failed with error. This is likely a transient error.",o)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(r){if(r.isAcquireTimeout||r instanceof $L)this._debug("auto refresh token tick lock not available");else throw r}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Mi()||!(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(r){console.error("_handleVisibilityChange",r)}}async _onVisibilityChanged(r){const o=`#_onVisibilityChanged(${r})`;this._debug(o,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),r||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(o,"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(r,o,n){const i=[`provider=${encodeURIComponent(o)}`];if(n!=null&&n.redirectTo&&i.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&i.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[a,s]=await fu(this.storage,this.storageKey),l=new URLSearchParams({code_challenge:`${encodeURIComponent(a)}`,code_challenge_method:`${encodeURIComponent(s)}`});i.push(l.toString())}if(n!=null&&n.queryParams){const a=new URLSearchParams(n.queryParams);i.push(a.toString())}return n!=null&&n.skipBrowserRedirect&&i.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${r}?${i.join("&")}`}async _unenroll(r){try{return await this._useSession(async o=>{var n;const{data:i,error:a}=o;return a?{data:null,error:a}:await Vt(this.fetch,"DELETE",`${this.url}/factors/${r.factorId}`,{headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token})})}catch(o){if(Rt(o))return{data:null,error:o};throw o}}async _enroll(r){try{return await this._useSession(async o=>{var n,i;const{data:a,error:s}=o;if(s)return{data:null,error:s};const l=Object.assign({friendly_name:r.friendlyName,factor_type:r.factorType},r.factorType==="phone"?{phone:r.phone}:{issuer:r.issuer}),{data:u,error:c}=await Vt(this.fetch,"POST",`${this.url}/factors`,{body:l,headers:this.headers,jwt:(n=a==null?void 0:a.session)===null||n===void 0?void 0:n.access_token});return c?{data:null,error:c}:(r.factorType==="totp"&&(!((i=u==null?void 0:u.totp)===null||i===void 0)&&i.qr_code)&&(u.totp.qr_code=`data:image/svg+xml;utf-8,${u.totp.qr_code}`),{data:u,error:null})})}catch(o){if(Rt(o))return{data:null,error:o};throw o}}async _verify(r){return this._acquireLock(-1,async()=>{try{return await this._useSession(async o=>{var n;const{data:i,error:a}=o;if(a)return{data:null,error:a};const{data:s,error:l}=await Vt(this.fetch,"POST",`${this.url}/factors/${r.factorId}/verify`,{body:{code:r.code,challenge_id:r.challengeId},headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token});return l?{data:null,error:l}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+s.expires_in},s)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",s),{data:s,error:l})})}catch(o){if(Rt(o))return{data:null,error:o};throw o}})}async _challenge(r){return this._acquireLock(-1,async()=>{try{return await this._useSession(async o=>{var n;const{data:i,error:a}=o;return a?{data:null,error:a}:await Vt(this.fetch,"POST",`${this.url}/factors/${r.factorId}/challenge`,{body:{channel:r.channel},headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token})})}catch(o){if(Rt(o))return{data:null,error:o};throw o}})}async _challengeAndVerify(r){const{data:o,error:n}=await this._challenge({factorId:r.factorId});return n?{data:null,error:n}:await this._verify({factorId:r.factorId,challengeId:o.id,code:r.code})}async _listFactors(){const{data:{user:r},error:o}=await this.getUser();if(o)return{data:null,error:o};const n=(r==null?void 0:r.factors)||[],i=n.filter(s=>s.factor_type==="totp"&&s.status==="verified"),a=n.filter(s=>s.factor_type==="phone"&&s.status==="verified");return{data:{all:n,totp:i,phone:a},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async r=>{var o,n;const{data:{session:i},error:a}=r;if(a)return{data:null,error:a};if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const s=this._decodeJWT(i.access_token);let l=null;s.aal&&(l=s.aal);let u=l;((n=(o=i.user.factors)===null||o===void 0?void 0:o.filter(f=>f.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(u="aal2");const h=s.amr||[];return{data:{currentLevel:l,nextLevel:u,currentAuthenticationMethods:h},error:null}}))}}dh.nextInstanceID=0;const iH=dh;class aH extends iH{constructor(r){super(r)}}var sH=function(t,r,o,n){function i(a){return a instanceof o?a:new o(function(s){s(a)})}return new(o||(o=Promise))(function(a,s){function l(h){try{c(n.next(h))}catch(f){s(f)}}function u(h){try{c(n.throw(h))}catch(f){s(f)}}function c(h){h.done?a(h.value):i(h.value).then(l,u)}c((n=n.apply(t,r||[])).next())})};class lH{constructor(r,o,n){var i,a,s;if(this.supabaseUrl=r,this.supabaseKey=o,!r)throw new Error("supabaseUrl is required.");if(!o)throw new Error("supabaseKey is required.");const l=wW(r);this.realtimeUrl=`${l}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${l}/auth/v1`,this.storageUrl=`${l}/storage/v1`,this.functionsUrl=`${l}/functions/v1`;const u=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,c={db:hW,realtime:mW,auth:Object.assign(Object.assign({},pW),{storageKey:u}),global:fW},h=_W(n??{},c);this.storageKey=(i=h.auth.storageKey)!==null&&i!==void 0?i:"",this.headers=(a=h.global.headers)!==null&&a!==void 0?a:{},h.accessToken?(this.accessToken=h.accessToken,this.auth=new Proxy({},{get:(f,d)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(d)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((s=h.auth)!==null&&s!==void 0?s:{},this.headers,h.global.fetch),this.fetch=bW(o,this._getAccessToken.bind(this),h.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},h.realtime)),this.rest=new IG(`${l}/rest/v1`,{headers:this.headers,schema:h.db.schema,fetch:this.fetch}),h.accessToken||this._listenForAuthEvents()}get functions(){return new cG(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new uW(this.storageUrl,this.headers,this.fetch)}from(r){return this.rest.from(r)}schema(r){return this.rest.schema(r)}rpc(r,o={},n={}){return this.rest.rpc(r,o,n)}channel(r,o={config:{}}){return this.realtime.channel(r,o)}getChannels(){return this.realtime.getChannels()}removeChannel(r){return this.realtime.removeChannel(r)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var r,o;return sH(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();const{data:n}=yield this.auth.getSession();return(o=(r=n.session)===null||r===void 0?void 0:r.access_token)!==null&&o!==void 0?o:null})}_initSupabaseAuthClient({autoRefreshToken:r,persistSession:o,detectSessionInUrl:n,storage:i,storageKey:a,flowType:s,lock:l,debug:u},c,h){const f={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new aH({url:this.authUrl,headers:Object.assign(Object.assign({},f),c),storageKey:a,autoRefreshToken:r,persistSession:o,detectSessionInUrl:n,storage:i,flowType:s,lock:l,debug:u,fetch:h,hasCustomAuthorizationHeader:"Authorization"in this.headers})}_initRealtimeClient(r){return new YG(this.realtimeUrl,Object.assign(Object.assign({},r),{params:Object.assign({apikey:this.supabaseKey},r==null?void 0:r.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((o,n)=>{this._handleTokenChanged(o,"CLIENT",n==null?void 0:n.access_token)})}_handleTokenChanged(r,o,n){(r==="TOKEN_REFRESHED"||r==="SIGNED_IN")&&this.changedAccessToken!==n?this.changedAccessToken=n:r==="SIGNED_OUT"&&(this.realtime.setAuth(),o=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const uH=(t,r,o)=>new lH(t,r,o),cH="https://dwdpgiapigozxydgsimj.supabase.co",dH="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImR3ZHBnaWFwaWdvenh5ZGdzaW1qIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MzkxOTkxMTUsImV4cCI6MjA1NDc3NTExNX0.Lmofa0mhNuqyH8jWsvmZFTRJdn3kCZr-Ia4OPVWCBZ8",rr=uH(cH,dH),UL=()=>{const t=Ws(),[r,o]=q.useState(!1);q.useEffect(()=>{o(!0),console.log("[usePageMetadata] Hook mounted, pathname:",t.pathname)},[]);const i=(c=>{if(c==="/"||c==="")return console.log('[usePageMetadata] Root path detected, returning "/"'),"/";const h=c.endsWith("/")?c.slice(0,-1):c;return console.log("[usePageMetadata] Normalized route:",h),h})(t.pathname),{data:a,isError:s,error:l,isLoading:u}=Ty({queryKey:["page-metadata",i],queryFn:async()=>{console.log("[usePageMetadata] Starting metadata fetch for route:",i);const c=JSON.stringify({path:i});console.log("[usePageMetadata] Request body:",c);try{const{data:h,error:f}=await rr.functions.invoke("get-metadata",{body:c});if(console.log("[usePageMetadata] Supabase response:",{data:h,error:f}),f)throw console.error("[usePageMetadata] Supabase error:",f),f;return h?(console.log("[usePageMetadata] Successfully received metadata:",h),h):(console.log("[usePageMetadata] No metadata found"),null)}catch(h){throw console.error("[usePageMetadata] Error in queryFn:",h),h}},enabled:r,retry:1,staleTime:1e3*60*5});return q.useEffect(()=>{u&&console.log("[usePageMetadata] Query is loading..."),s&&console.error("[usePageMetadata] Query error:",l)},[u,s,l]),q.useEffect(()=>{if(typeof window<"u"&&a){console.log("[usePageMetadata] Applying metadata:",a),document.title!==a.title&&(document.title=a.title);let c=document.querySelector('meta[name="description"]');c||(c=document.createElement("meta"),c.setAttribute("name","description"),document.head.appendChild(c)),c.setAttribute("content",a.meta_description);let h=document.querySelector('link[rel="canonical"]');h||(h=document.createElement("link"),h.setAttribute("rel","canonical"),document.head.appendChild(h)),h.setAttribute("href",a.canonical_url||window.location.href);const f={"og:title":a.title,"og:description":a.meta_description,"og:type":"website","og:url":a.canonical_url||window.location.href};Object.entries(f).forEach(([d,m])=>{let y=document.querySelector(`meta[property="${d}"]`);y||(y=document.createElement("meta"),y.setAttribute("property",d),document.head.appendChild(y)),y.setAttribute("content",m)})}},[a]),a},fH=({children:t})=>(UL(),D.jsx(D.Fragment,{children:t})),Kn=q.forwardRef(({className:t,...r},o)=>D.jsx("div",{ref:o,className:St("rounded-lg border bg-card text-card-foreground shadow-sm",t),...r}));Kn.displayName="Card";const hH=q.forwardRef(({className:t,...r},o)=>D.jsx("div",{ref:o,className:St("flex flex-col space-y-1.5 p-6",t),...r}));hH.displayName="CardHeader";const pH=q.forwardRef(({className:t,...r},o)=>D.jsx("h3",{ref:o,className:St("text-2xl font-semibold leading-none tracking-tight",t),...r}));pH.displayName="CardTitle";const mH=q.forwardRef(({className:t,...r},o)=>D.jsx("p",{ref:o,className:St("text-sm text-muted-foreground",t),...r}));mH.displayName="CardDescription";const yH=q.forwardRef(({className:t,...r},o)=>D.jsx("div",{ref:o,className:St("p-6 pt-0",t),...r}));yH.displayName="CardContent";const gH=q.forwardRef(({className:t,...r},o)=>D.jsx("div",{ref:o,className:St("flex items-center p-6 pt-0",t),...r}));gH.displayName="CardFooter";const vH=yv("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 Cf({className:t,variant:r,...o}){return D.jsx("div",{className:St(vH({variant:r}),t),...o})}const Yx=({id:t,name:r,location:o,rating:n=0,commentCount:i=0,imageUrl:a,isPremium:s=!1,country:l,courtType:u,images:c})=>{const h=(c==null?void 0:c[0])||a||"/placeholder.svg",f=()=>{const d=encodeURIComponent(o),m=encodeURIComponent(r);switch(l){case"DE":return`/padel-courts-germany/${d}/${m}`;case"ES":return`/padel-courts-spain/${d}/${m}`;case"IT":return`/padel-courts-italy/${d}/${m}`;case"SE":return`/padel-courts-sweden/${d}/${m}`;default:return`/courts/${t}`}};return D.jsx(kr,{to:f(),children:D.jsxs(Kn,{className:`overflow-hidden transition-all duration-300 hover:scale-[1.02] ${s?"premium-card":"glass-card"}`,children:[D.jsxs("div",{className:"relative h-48 overflow-hidden",children:[D.jsx("img",{src:h,alt:r,className:"w-full h-full object-cover",loading:"lazy"}),s&&D.jsx(Cf,{className:"absolute top-2 right-2 bg-brand-500 text-white",children:"Premium"}),D.jsx(Cf,{className:`absolute top-2 left-2 ${u==="indoor"?"bg-[#E5DEFF] text-[#6E56CF]":"bg-[#F2FCE2] text-[#4C9F38]"}`,children:u==="indoor"?"Indoor":"Outdoor"})]}),D.jsxs("div",{className:"p-4",children:[D.jsxs("div",{className:"flex justify-between items-start mb-2",children:[D.jsx("h3",{className:"text-lg font-semibold",children:r}),D.jsx(Cf,{variant:"outline",children:l})]}),D.jsxs("div",{className:"flex items-center text-muted-foreground mb-3",children:[D.jsx(lN,{className:"w-4 h-4 mr-1"}),D.jsx("span",{className:"text-sm",children:o})]}),D.jsxs("div",{className:"flex justify-between items-center",children:[D.jsxs("div",{className:"flex items-center",children:[D.jsx(Pl,{className:"w-4 h-4 text-brand-400 mr-1"}),D.jsx("span",{className:"text-sm",children:n.toFixed(1)})]}),D.jsxs("div",{className:"flex items-center",children:[D.jsx(Hj,{className:"w-4 h-4 mr-1"}),D.jsx("span",{className:"text-sm",children:i})]})]})]})]})})},so=q.forwardRef(({className:t,type:r,...o},n)=>D.jsx("input",{type:r,className:St("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background 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:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:n,...o}));so.displayName="Input";const BL=()=>D.jsxs("div",{className:"relative",children:[D.jsx(so,{type:"search",placeholder:"Search for padel courts...",className:"pl-10 bg-secondary/30 backdrop-blur-sm border-white/10"}),D.jsx(MB,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"})]}),bH=yv("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"}}),tr=q.forwardRef(({className:t,variant:r,size:o,asChild:n=!1,...i},a)=>{const s=n?Dl:"button";return D.jsx(s,{className:St(bH({variant:r,size:o,className:t})),ref:a,...i})});tr.displayName="Button";const xH=[{code:"SE",name:"Sweden"},{code:"DE",name:"Germany"},{code:"ES",name:"Spain"},{code:"IT",name:"Italy"}],wH=({selectedCountry:t,onSelect:r})=>D.jsx("div",{className:"flex gap-2 overflow-x-auto pb-2",children:xH.map(o=>D.jsx(tr,{variant:t===o.code?"default":"secondary",className:"whitespace-nowrap",onClick:()=>r(o.code),children:o.name},o.code))}),Rb=768;function _H(){const[t,r]=q.useState(void 0);return q.useEffect(()=>{const o=window.matchMedia(`(max-width: ${Rb-1}px)`),n=()=>{r(window.innerWidtho.removeEventListener("change",n)},[]),!!t}const Zi=()=>{const[t,r]=q.useState(!1),o=_H(),[n,i]=q.useState(null);q.useEffect(()=>{rr.auth.getSession().then(({data:{session:c}})=>{i((c==null?void 0:c.user)??null)});const{data:{subscription:u}}=rr.auth.onAuthStateChange((c,h)=>{i((h==null?void 0:h.user)??null)});return()=>u.unsubscribe()},[]);const a=async()=>{await rr.auth.signOut()},s=()=>r(!t),l=[{to:"/",icon:D.jsx(PB,{className:"w-4 h-4"}),label:"Home"},{to:"/padel-courts-worldwide",icon:D.jsx(OB,{className:"w-4 h-4"}),label:"Padel Worldwide"},{to:"/top-courts",icon:D.jsx(Pl,{className:"w-4 h-4"}),label:"Top Courts"},{to:"/statistics",icon:D.jsx(iN,{className:"w-4 h-4"}),label:"Statistics"},{to:"/about",icon:D.jsx(sN,{className:"w-4 h-4"}),label:"About"}];return D.jsxs("nav",{className:"max-w-6xl mx-auto flex items-center justify-between mb-12 relative",children:[D.jsx(kr,{to:"/",className:"flex-shrink-0",children:D.jsx("h2",{className:"text-2xl font-bold tracking-tight text-gradient",children:"Padellocator"})}),o?D.jsx(tr,{variant:"ghost",onClick:s,className:"ml-auto",children:D.jsx(AB,{className:"w-6 h-6"})}):D.jsx("div",{className:"flex items-center gap-4",children:l.map(u=>D.jsx(kr,{to:u.to,children:D.jsxs(tr,{variant:"ghost",className:"gap-2",children:[u.icon,u.label]})},u.to))}),!o&&D.jsx("div",{className:"flex items-center gap-4",children:n?D.jsxs(D.Fragment,{children:[D.jsx("span",{className:"text-sm text-muted-foreground",children:n.email}),D.jsx(tr,{variant:"secondary",onClick:a,children:"Sign Out"}),D.jsx(kr,{to:"/submit-court",children:D.jsxs(tr,{className:"bg-brand-500 hover:bg-brand-600 gap-2",children:[D.jsx(Gm,{className:"w-4 h-4"}),"Submit Court"]})})]}):D.jsxs(D.Fragment,{children:[D.jsx(kr,{to:"/auth",children:D.jsx(tr,{variant:"secondary",children:"Sign In"})}),D.jsx(kr,{to:"/submit-court",children:D.jsxs(tr,{className:"bg-brand-500 hover:bg-brand-600 gap-2",children:[D.jsx(Gm,{className:"w-4 h-4"}),"Submit Court"]})})]})}),o&&t&&D.jsxs("div",{className:"absolute top-full right-0 mt-2 w-64 py-2 bg-background border border-border rounded-lg shadow-lg z-50",children:[l.map(u=>D.jsx(kr,{to:u.to,onClick:()=>r(!1),children:D.jsxs(tr,{variant:"ghost",className:"w-full justify-start gap-2",children:[u.icon,u.label]})},u.to)),D.jsxs("div",{className:"px-2 pt-2 border-t border-border mt-2",children:[n?D.jsxs(D.Fragment,{children:[D.jsx("div",{className:"px-3 py-2 text-sm text-muted-foreground",children:n.email}),D.jsx(tr,{variant:"secondary",onClick:a,className:"w-full mb-2",children:"Sign Out"})]}):D.jsx(kr,{to:"/auth",onClick:()=>r(!1),children:D.jsx(tr,{variant:"secondary",className:"w-full mb-2",children:"Sign In"})}),D.jsx(kr,{to:"/submit-court",onClick:()=>r(!1),children:D.jsxs(tr,{className:"w-full bg-brand-500 hover:bg-brand-600 gap-2",children:[D.jsx(Gm,{className:"w-4 h-4"}),"Submit Court"]})})]})]})]})},Qi=()=>D.jsx("footer",{className:"border-t mt-24",children:D.jsxs("div",{className:"max-w-6xl mx-auto py-12 px-4",children:[D.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-8",children:[D.jsxs("div",{className:"space-y-4",children:[D.jsx("h3",{className:"text-lg font-semibold",children:"Padellocator"}),D.jsx("p",{className:"text-sm text-muted-foreground",children:"Find and book the best padel courts Worldwide."})]}),D.jsxs("div",{className:"space-y-4",children:[D.jsx("h3",{className:"text-lg font-semibold",children:"Quick Links"}),D.jsxs("ul",{className:"space-y-2",children:[D.jsx("li",{children:D.jsx(kr,{to:"/",className:"text-sm text-muted-foreground hover:text-foreground",children:"Home"})}),D.jsx("li",{children:D.jsx(kr,{to:"/top-courts",className:"text-sm text-muted-foreground hover:text-foreground",children:"Top Courts"})}),D.jsx("li",{children:D.jsx(tr,{variant:"link",className:"text-sm text-muted-foreground hover:text-foreground p-0 h-auto",children:"About Us"})})]})]}),D.jsxs("div",{className:"space-y-4",children:[D.jsx("h3",{className:"text-lg font-semibold",children:"Find Courts By Country"}),D.jsxs("ul",{className:"space-y-2",children:[D.jsx("li",{children:D.jsx(kr,{to:"/padel-courts-spain",className:"text-sm text-muted-foreground hover:text-foreground",children:"Spain"})}),D.jsx("li",{children:D.jsx(kr,{to:"/padel-courts-sweden",className:"text-sm text-muted-foreground hover:text-foreground",children:"Sweden"})}),D.jsx("li",{children:D.jsx(kr,{to:"/padel-courts-germany",className:"text-sm text-muted-foreground hover:text-foreground",children:"Germany"})}),D.jsx("li",{children:D.jsx(kr,{to:"/padel-courts-italy",className:"text-sm text-muted-foreground hover:text-foreground",children:"Italy"})})]})]}),D.jsxs("div",{className:"space-y-4",children:[D.jsx("h3",{className:"text-lg font-semibold",children:"Contact"}),D.jsxs("ul",{className:"space-y-2",children:[D.jsx("li",{className:"text-sm text-muted-foreground",children:"Email: contact@padellocator.com"}),D.jsx("li",{className:"text-sm text-muted-foreground",children:"Phone: +44 123 456 789"})]})]})]}),D.jsx("div",{className:"border-t mt-8 pt-8 text-center",children:D.jsxs("p",{className:"text-sm text-muted-foreground",children:["© ",new Date().getFullYear()," Padellocator. All rights reserved."]})})]})});function dm(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var zL={exports:{}};/*! p5.js v1.9.0 November 28, 2023 */(function(t,r){(function(o){t.exports=o()})(function(){var o;return function n(i,a,s){function l(h,f){if(!a[h]){if(!i[h]){var d=typeof dm=="function"&&dm;if(!f&&d)return d(h,!0);if(u)return u(h,!0);throw(f=new Error("Cannot find module '"+h+"'")).code="MODULE_NOT_FOUND",f}d=a[h]={exports:{}},i[h][0].call(d.exports,function(m){return l(i[h][1][m]||m)},d,d.exports,n,i,a,s)}return a[h].exports}for(var u=typeof dm=="function"&&dm,c=0;c>16&255,x[v++]=y>>8&255,x[v++]=255&y;return b===2&&(y=l[m.charCodeAt(p)]<<2|l[m.charCodeAt(p+1)]>>4,x[v++]=255&y),b===1&&(y=l[m.charCodeAt(p)]<<10|l[m.charCodeAt(p+1)]<<4|l[m.charCodeAt(p+2)]>>2,x[v++]=y>>8&255,x[v++]=255&y),x},a.fromByteArray=function(m){for(var y,p=m.length,g=p%3,b=[],x=0,v=p-g;x>18&63]+s[A>>12&63]+s[A>>6&63]+s[63&A]}(S));return T.join("")}(m,x,v>2]+s[y<<4&63]+"==")):g==2&&(y=(m[p-2]<<8)+m[p-1],b.push(s[y>>10]+s[y>>4&63]+s[y<<2&63]+"=")),b.join("")};for(var s=[],l=[],u=typeof Uint8Array<"u"?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,f=c.length;h>>1;case"base64":return $(I).length;default:if(ee)return Y?-1:W(I).length;B=(""+B).toLowerCase(),ee=!0}}function v(I,B,H){var Y,ee=!1;if((B=B===void 0||B<0?0:B)>this.length||(H=H===void 0||H>this.length?this.length:H)<=0||(H>>>=0)<=(B>>>=0))return"";for(I=I||"utf8";;)switch(I){case"hex":var oe=this,re=B,ce=H,pe=oe.length;(!ce||ce<0||pe=I.length){if(ee)return-1;H=I.length-1}else if(H<0){if(!ee)return-1;H=0}if(typeof B=="string"&&(B=d.from(B,Y)),d.isBuffer(B))return B.length===0?-1:E(I,B,H,Y,ee);if(typeof B=="number")return B&=255,typeof Uint8Array.prototype.indexOf=="function"?(ee?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(I,B,H):E(I,[B],H,Y,ee);throw new TypeError("val must be string, number or Buffer")}function E(I,B,H,Y,ee){var oe=1,ce=I.length,he=B.length;if(Y!==void 0&&((Y=String(Y).toLowerCase())==="ucs2"||Y==="ucs-2"||Y==="utf16le"||Y==="utf-16le")){if(I.length<2||B.length<2)return-1;ce/=oe=2,he/=2,H/=2}function ae(be,Ee){return oe===1?be[Ee]:be.readUInt16BE(Ee*oe)}if(ee)for(var te=-1,pe=H;pe>8,he=he%256,ae.push(he),ae.push(ce);return ae}(B,I.length-H),I,H,Y)}function k(I,B,H){H=Math.min(I.length,H);for(var Y=[],ee=B;ee>>10&1023|55296),pe=56320|1023&pe),Y.push(pe),ee+=ne}var fe=Y,be=fe.length;if(be<=A)return String.fromCharCode.apply(String,fe);for(var Ee="",re=0;re"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}}),typeof Symbol<"u"&&Symbol.species!=null&&d[Symbol.species]===d&&Object.defineProperty(d,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),d.poolSize=8192,d.from=m,Object.setPrototypeOf(d.prototype,Uint8Array.prototype),Object.setPrototypeOf(d,Uint8Array),d.alloc=function(I,B,H){return B=B,H=H,y(I=I),!(I<=0)&&B!==void 0?typeof H=="string"?f(I).fill(B,H):f(I).fill(B):f(I)},d.allocUnsafe=p,d.allocUnsafeSlow=p,d.isBuffer=function(I){return I!=null&&I._isBuffer===!0&&I!==d.prototype},d.compare=function(I,B){if(K(I,Uint8Array)&&(I=d.from(I,I.offset,I.byteLength)),K(B,Uint8Array)&&(B=d.from(B,B.offset,B.byteLength)),!d.isBuffer(I)||!d.isBuffer(B))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(I===B)return 0;for(var H=I.length,Y=B.length,ee=0,oe=Math.min(H,Y);eeI&&(B+=" ... "),""},c&&(d.prototype[c]=d.prototype.inspect),d.prototype.compare=function(I,B,H,Y,ee){if(K(I,Uint8Array)&&(I=d.from(I,I.offset,I.byteLength)),!d.isBuffer(I))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof I);if(H===void 0&&(H=I?I.length:0),Y===void 0&&(Y=0),ee===void 0&&(ee=this.length),(B=B===void 0?0:B)<0||H>I.length||Y<0||ee>this.length)throw new RangeError("out of range index");if(ee<=Y&&H<=B)return 0;if(ee<=Y)return-1;if(H<=B)return 1;if(this===I)return 0;for(var oe=(ee>>>=0)-(Y>>>=0),ce=(H>>>=0)-(B>>>=0),he=Math.min(oe,ce),ae=this.slice(Y,ee),te=I.slice(B,H),pe=0;pe>>=0,isFinite(H)?(H>>>=0,Y===void 0&&(Y="utf8")):(Y=H,H=void 0)}var ee=this.length-B;if((H===void 0||eethis.length)throw new RangeError("Attempt to write outside buffer bounds");Y=Y||"utf8";for(var oe,ce,he,ae=!1;;)switch(Y){case"hex":var te=this,pe=I,ne=B,fe=H,be=(ne=Number(ne)||0,te.length-ne);(!fe||be<(fe=Number(fe)))&&(fe=be),(be=pe.length)/2I.length)throw new RangeError("Index out of range")}function C(I,B,H,Y){if(H+Y>I.length)throw new RangeError("Index out of range");if(H<0)throw new RangeError("Index out of range")}function L(I,B,H,Y,ee){return B=+B,H>>>=0,ee||C(I,0,H,4),u.write(I,B,H,Y,23,4),H+4}function F(I,B,H,Y,ee){return B=+B,H>>>=0,ee||C(I,0,H,8),u.write(I,B,H,Y,52,8),H+8}d.prototype.slice=function(I,B){var H=this.length,H=((I=~~I)<0?(I+=H)<0&&(I=0):H>>=0,B>>>=0,H||O(I,B,this.length);for(var Y=this[I],ee=1,oe=0;++oe>>=0,B>>>=0,H||O(I,B,this.length);for(var Y=this[I+--B],ee=1;0>>=0,B||O(I,1,this.length),this[I]},d.prototype.readUInt16LE=function(I,B){return I>>>=0,B||O(I,2,this.length),this[I]|this[I+1]<<8},d.prototype.readUInt16BE=function(I,B){return I>>>=0,B||O(I,2,this.length),this[I]<<8|this[I+1]},d.prototype.readUInt32LE=function(I,B){return I>>>=0,B||O(I,4,this.length),(this[I]|this[I+1]<<8|this[I+2]<<16)+16777216*this[I+3]},d.prototype.readUInt32BE=function(I,B){return I>>>=0,B||O(I,4,this.length),16777216*this[I]+(this[I+1]<<16|this[I+2]<<8|this[I+3])},d.prototype.readIntLE=function(I,B,H){I>>>=0,B>>>=0,H||O(I,B,this.length);for(var Y=this[I],ee=1,oe=0;++oe>>=0,B>>>=0,H||O(I,B,this.length);for(var Y=B,ee=1,oe=this[I+--Y];0>>=0,B||O(I,1,this.length),128&this[I]?-1*(255-this[I]+1):this[I]},d.prototype.readInt16LE=function(I,B){return I>>>=0,B||O(I,2,this.length),B=this[I]|this[I+1]<<8,32768&B?4294901760|B:B},d.prototype.readInt16BE=function(I,B){return I>>>=0,B||O(I,2,this.length),B=this[I+1]|this[I]<<8,32768&B?4294901760|B:B},d.prototype.readInt32LE=function(I,B){return I>>>=0,B||O(I,4,this.length),this[I]|this[I+1]<<8|this[I+2]<<16|this[I+3]<<24},d.prototype.readInt32BE=function(I,B){return I>>>=0,B||O(I,4,this.length),this[I]<<24|this[I+1]<<16|this[I+2]<<8|this[I+3]},d.prototype.readFloatLE=function(I,B){return I>>>=0,B||O(I,4,this.length),u.read(this,I,!0,23,4)},d.prototype.readFloatBE=function(I,B){return I>>>=0,B||O(I,4,this.length),u.read(this,I,!1,23,4)},d.prototype.readDoubleLE=function(I,B){return I>>>=0,B||O(I,8,this.length),u.read(this,I,!0,52,8)},d.prototype.readDoubleBE=function(I,B){return I>>>=0,B||O(I,8,this.length),u.read(this,I,!1,52,8)},d.prototype.writeUIntLE=function(I,B,H,Y){I=+I,B>>>=0,H>>>=0,Y||R(this,I,B,H,Math.pow(2,8*H)-1,0);var ee=1,oe=0;for(this[B]=255&I;++oe>>=0,H>>>=0,Y||R(this,I,B,H,Math.pow(2,8*H)-1,0);var ee=H-1,oe=1;for(this[B+ee]=255&I;0<=--ee&&(oe*=256);)this[B+ee]=I/oe&255;return B+H},d.prototype.writeUInt8=function(I,B,H){return I=+I,B>>>=0,H||R(this,I,B,1,255,0),this[B]=255&I,B+1},d.prototype.writeUInt16LE=function(I,B,H){return I=+I,B>>>=0,H||R(this,I,B,2,65535,0),this[B]=255&I,this[B+1]=I>>>8,B+2},d.prototype.writeUInt16BE=function(I,B,H){return I=+I,B>>>=0,H||R(this,I,B,2,65535,0),this[B]=I>>>8,this[B+1]=255&I,B+2},d.prototype.writeUInt32LE=function(I,B,H){return I=+I,B>>>=0,H||R(this,I,B,4,4294967295,0),this[B+3]=I>>>24,this[B+2]=I>>>16,this[B+1]=I>>>8,this[B]=255&I,B+4},d.prototype.writeUInt32BE=function(I,B,H){return I=+I,B>>>=0,H||R(this,I,B,4,4294967295,0),this[B]=I>>>24,this[B+1]=I>>>16,this[B+2]=I>>>8,this[B+3]=255&I,B+4},d.prototype.writeIntLE=function(I,B,H,Y){I=+I,B>>>=0,Y||R(this,I,B,H,(Y=Math.pow(2,8*H-1))-1,-Y);var ee=0,oe=1,ce=0;for(this[B]=255&I;++ee>0)-ce&255;return B+H},d.prototype.writeIntBE=function(I,B,H,Y){I=+I,B>>>=0,Y||R(this,I,B,H,(Y=Math.pow(2,8*H-1))-1,-Y);var ee=H-1,oe=1,ce=0;for(this[B+ee]=255&I;0<=--ee&&(oe*=256);)I<0&&ce===0&&this[B+ee+1]!==0&&(ce=1),this[B+ee]=(I/oe>>0)-ce&255;return B+H},d.prototype.writeInt8=function(I,B,H){return I=+I,B>>>=0,H||R(this,I,B,1,127,-128),this[B]=255&(I=I<0?255+I+1:I),B+1},d.prototype.writeInt16LE=function(I,B,H){return I=+I,B>>>=0,H||R(this,I,B,2,32767,-32768),this[B]=255&I,this[B+1]=I>>>8,B+2},d.prototype.writeInt16BE=function(I,B,H){return I=+I,B>>>=0,H||R(this,I,B,2,32767,-32768),this[B]=I>>>8,this[B+1]=255&I,B+2},d.prototype.writeInt32LE=function(I,B,H){return I=+I,B>>>=0,H||R(this,I,B,4,2147483647,-2147483648),this[B]=255&I,this[B+1]=I>>>8,this[B+2]=I>>>16,this[B+3]=I>>>24,B+4},d.prototype.writeInt32BE=function(I,B,H){return I=+I,B>>>=0,H||R(this,I,B,4,2147483647,-2147483648),this[B]=(I=I<0?4294967295+I+1:I)>>>24,this[B+1]=I>>>16,this[B+2]=I>>>8,this[B+3]=255&I,B+4},d.prototype.writeFloatLE=function(I,B,H){return L(this,I,B,!0,H)},d.prototype.writeFloatBE=function(I,B,H){return L(this,I,B,!1,H)},d.prototype.writeDoubleLE=function(I,B,H){return F(this,I,B,!0,H)},d.prototype.writeDoubleBE=function(I,B,H){return F(this,I,B,!1,H)},d.prototype.copy=function(I,B,H,Y){if(!d.isBuffer(I))throw new TypeError("argument should be a Buffer");if(H=H||0,Y||Y===0||(Y=this.length),B>=I.length&&(B=I.length),(Y=0=this.length)throw new RangeError("Index out of range");if(Y<0)throw new RangeError("sourceEnd out of bounds");Y>this.length&&(Y=this.length);var ee=(Y=I.length-B>>=0,H=H===void 0?this.length:H>>>0,typeof(I=I||0)=="number")for(oe=B;oe>6|192,63&H|128)}else if(H<65536){if((B-=3)<0)break;oe.push(H>>12|224,H>>6&63|128,63&H|128)}else{if(!(H<1114112))throw new Error("Invalid code point");if((B-=4)<0)break;oe.push(H>>18|240,H>>12&63|128,H>>6&63|128,63&H|128)}}return oe}function $(I){return l.toByteArray(function(B){if((B=(B=B.split("=")[0]).trim().replace(z,"")).length<2)return"";for(;B.length%4!=0;)B+="=";return B}(I))}function G(I,B,H,Y){for(var ee=0;ee=B.length||ee>=I.length);++ee)B[ee+H]=I[ee];return ee}function K(I,B){return I instanceof B||I!=null&&I.constructor!=null&&I.constructor.name!=null&&I.constructor.name===B.name}function Z(I){return I!=I}var U=function(){for(var I="0123456789abcdef",B=new Array(256),H=0;H<16;++H)for(var Y=16*H,ee=0;ee<16;++ee)B[Y+ee]=I[H]+I[ee];return B}()}).call(this,n("buffer").Buffer)},{"base64-js":1,buffer:4,ieee754:246}],5:[function(n,i,a){i.exports=function(s){if(typeof s!="function")throw TypeError(String(s)+" is not a function");return s}},{}],6:[function(n,i,a){var s=n("../internals/is-object");i.exports=function(l){if(s(l)||l===null)return l;throw TypeError("Can't set "+String(l)+" as a prototype")}},{"../internals/is-object":74}],7:[function(u,i,a){var s=u("../internals/well-known-symbol"),l=u("../internals/object-create"),u=u("../internals/object-define-property"),c=s("unscopables"),h=Array.prototype;h[c]==null&&u.f(h,c,{configurable:!0,value:l(null)}),i.exports=function(f){h[c][f]=!0}},{"../internals/object-create":90,"../internals/object-define-property":92,"../internals/well-known-symbol":148}],8:[function(n,i,a){var s=n("../internals/string-multibyte").charAt;i.exports=function(l,u,c){return u+(c?s(l,u).length:1)}},{"../internals/string-multibyte":123}],9:[function(n,i,a){i.exports=function(s,l,u){if(s instanceof l)return s;throw TypeError("Incorrect "+(u?u+" ":"")+"invocation")}},{}],10:[function(n,i,a){var s=n("../internals/is-object");i.exports=function(l){if(s(l))return l;throw TypeError(String(l)+" is not an object")}},{"../internals/is-object":74}],11:[function(n,i,a){i.exports=typeof ArrayBuffer<"u"&&typeof DataView<"u"},{}],12:[function(C,i,a){function s(F){return f(F)&&d(L,m(F))}var l,u=C("../internals/array-buffer-native"),c=C("../internals/descriptors"),h=C("../internals/global"),f=C("../internals/is-object"),d=C("../internals/has"),m=C("../internals/classof"),y=C("../internals/create-non-enumerable-property"),p=C("../internals/redefine"),g=C("../internals/object-define-property").f,b=C("../internals/object-get-prototype-of"),x=C("../internals/object-set-prototype-of"),A=C("../internals/well-known-symbol"),C=C("../internals/uid"),v=h.Int8Array,w=v&&v.prototype,_=h.Uint8ClampedArray,_=_&&_.prototype,E=v&&b(v),S=w&&b(w),T=Object.prototype,k=T.isPrototypeOf,A=A("toStringTag"),O=C("TYPED_ARRAY_TAG"),R=u&&!!x&&m(h.opera)!=="Opera",C=!1,L={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8};for(l in L)h[l]||(R=!1);if((!R||typeof E!="function"||E===Function.prototype)&&(E=function(){throw TypeError("Incorrect invocation")},R))for(l in L)h[l]&&x(h[l],E);if((!R||!S||S===T)&&(S=E.prototype,R))for(l in L)h[l]&&x(h[l].prototype,S);if(R&&b(_)!==S&&x(_,S),c&&!d(S,A))for(l in C=!0,g(S,A,{get:function(){return f(this)?this[O]:void 0}}),L)h[l]&&y(h[l],O,l);i.exports={NATIVE_ARRAY_BUFFER_VIEWS:R,TYPED_ARRAY_TAG:C&&O,aTypedArray:function(F){if(s(F))return F;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(F){if(x){if(k.call(E,F))return F}else for(var z in L)if(d(L,l)&&(z=h[z],z&&(F===z||k.call(z,F))))return F;throw TypeError("Target is not a typed array constructor")},exportTypedArrayMethod:function(F,z,W){if(c){if(W)for(var $ in L)$=h[$],$&&d($.prototype,F)&&delete $.prototype[F];S[F]&&!W||p(S,F,!W&&R&&w[F]||z)}},exportTypedArrayStaticMethod:function(F,z,W){var $,G;if(c){if(x){if(W)for($ in L)(G=h[$])&&d(G,F)&&delete G[F];if(E[F]&&!W)return;try{return p(E,F,!W&&R&&v[F]||z)}catch{}}for($ in L)!(G=h[$])||G[F]&&!W||p(G,F,z)}},isView:function(F){return F=m(F),F==="DataView"||d(L,F)},isTypedArray:s,TypedArray:E,TypedArrayPrototype:S}},{"../internals/array-buffer-native":11,"../internals/classof":29,"../internals/create-non-enumerable-property":38,"../internals/descriptors":43,"../internals/global":59,"../internals/has":60,"../internals/is-object":74,"../internals/object-define-property":92,"../internals/object-get-prototype-of":97,"../internals/object-set-prototype-of":101,"../internals/redefine":108,"../internals/uid":145,"../internals/well-known-symbol":148}],13:[function(H,i,a){function s(ne){return[255&ne]}function l(ne){return[255&ne,ne>>8&255]}function u(ne){return[255&ne,ne>>8&255,ne>>16&255,ne>>24&255]}function c(ne){return ne[3]<<24|ne[2]<<16|ne[1]<<8|ne[0]}function h(ne){return oe(ne,23,4)}function f(ne){return oe(ne,52,8)}function d(ne,fe){C(ne[K],fe,{get:function(){return z(this)[fe]}})}function m(ye,fe,se,Ee){if(se=T(se),ye=z(ye),se+fe>ye.byteLength)throw ee(Z);var re=z(ye.buffer).bytes,se=se+ye.byteOffset,ye=re.slice(se,se+fe);return Ee?ye:ye.reverse()}function y(ne,fe,be,Ee,re,se){if(be=T(be),ne=z(ne),be+fe>ne.byteLength)throw ee(Z);for(var ye=z(ne.buffer).bytes,Pe=be+ne.byteOffset,_e=Ee(+re),Ne=0;Nete;)(he=ae[te++])in I||x(I,he,U[he]);p.constructor=I}O&&A(H)!==Y&&O(H,Y);var k=new B(new I(2)),pe=H.setInt8;k.setInt8(0,2147483648),k.setInt8(1,2147483649),!k.getInt8(0)&&k.getInt8(1)||v(H,{setInt8:function(fe,be){pe.call(this,fe,be<<24>>24)},setUint8:function(fe,be){pe.call(this,fe,be<<24>>24)}},{unsafe:!0})}else I=function(ne){_(this,I,$),ne=T(ne),W(this,{bytes:L.call(new Array(ne),0),byteLength:ne}),g||(this.byteLength=ne)},B=function(ne,re,be){_(this,B,G),_(ne,I,G);var Ee=z(ne).byteLength,re=E(re);if(re<0||Ee>24},getUint8:function(ne){return m(this,1,ne)[0]},getInt16:function(ne){return ne=m(this,2,ne,1>16},getUint16:function(ne){return ne=m(this,2,ne,1>>0},getFloat32:function(ne){return ce(m(this,4,ne,1"+d+""}},{"../internals/require-object-coercible":113}],37:[function(n,i,a){function s(){return this}var l=n("../internals/iterators-core").IteratorPrototype,u=n("../internals/object-create"),c=n("../internals/create-property-descriptor"),h=n("../internals/set-to-string-tag"),f=n("../internals/iterators");i.exports=function(d,m,y){return m+=" Iterator",d.prototype=u(l,{next:c(1,y)}),h(d,m,!1,!0),f[m]=s,d}},{"../internals/create-property-descriptor":39,"../internals/iterators":79,"../internals/iterators-core":78,"../internals/object-create":90,"../internals/set-to-string-tag":117}],38:[function(n,i,a){var s=n("../internals/descriptors"),l=n("../internals/object-define-property"),u=n("../internals/create-property-descriptor");i.exports=s?function(c,h,f){return l.f(c,h,u(1,f))}:function(c,h,f){return c[h]=f,c}},{"../internals/create-property-descriptor":39,"../internals/descriptors":43,"../internals/object-define-property":92}],39:[function(n,i,a){i.exports=function(s,l){return{enumerable:!(1&s),configurable:!(2&s),writable:!(4&s),value:l}}},{}],40:[function(n,i,a){var s=n("../internals/to-primitive"),l=n("../internals/object-define-property"),u=n("../internals/create-property-descriptor");i.exports=function(c,h,f){h=s(h),h in c?l.f(c,h,u(0,f)):c[h]=f}},{"../internals/create-property-descriptor":39,"../internals/object-define-property":92,"../internals/to-primitive":140}],41:[function(b,i,a){function s(){return this}var l=b("../internals/export"),u=b("../internals/create-iterator-constructor"),c=b("../internals/object-get-prototype-of"),h=b("../internals/object-set-prototype-of"),f=b("../internals/set-to-string-tag"),d=b("../internals/create-non-enumerable-property"),m=b("../internals/redefine"),y=b("../internals/well-known-symbol"),p=b("../internals/is-pure"),g=b("../internals/iterators"),b=b("../internals/iterators-core"),x=b.IteratorPrototype,v=b.BUGGY_SAFARI_ITERATORS,w=y("iterator"),_="values",E="entries";i.exports=function(S,T,k,W,O,R,C){u(k,T,W);function L(I){if(I===O&&Z)return Z;if(!v&&I in G)return G[I];switch(I){case"keys":case _:case E:return function(){return new k(this,I)}}return function(){return new k(this)}}var F,z,W=T+" Iterator",$=!1,G=S.prototype,K=G[w]||G["@@iterator"]||O&&G[O],Z=!v&&K||L(O),U=T=="Array"&&G.entries||K;if(U&&(U=c(U.call(new S)),x!==Object.prototype&&U.next&&(p||c(U)===x||(h?h(U,x):typeof U[w]!="function"&&d(U,w,s)),f(U,W,!0,!0),p&&(g[W]=s))),O==_&&K&&K.name!==_&&($=!0,Z=function(){return K.call(this)}),p&&!C||G[w]===Z||d(G,w,Z),g[T]=Z,O)if(F={values:L(_),keys:R?Z:L("keys"),entries:L(E)},C)for(z in F)!v&&!$&&z in G||m(G,z,F[z]);else l({target:T,proto:!0,forced:v||$},F);return F}},{"../internals/create-iterator-constructor":37,"../internals/create-non-enumerable-property":38,"../internals/export":50,"../internals/is-pure":75,"../internals/iterators":79,"../internals/iterators-core":78,"../internals/object-get-prototype-of":97,"../internals/object-set-prototype-of":101,"../internals/redefine":108,"../internals/set-to-string-tag":117,"../internals/well-known-symbol":148}],42:[function(n,i,a){var s=n("../internals/path"),l=n("../internals/has"),u=n("../internals/well-known-symbol-wrapped"),c=n("../internals/object-define-property").f;i.exports=function(h){var f=s.Symbol||(s.Symbol={});l(f,h)||c(f,h,{value:u.f(h)})}},{"../internals/has":60,"../internals/object-define-property":92,"../internals/path":104,"../internals/well-known-symbol-wrapped":147}],43:[function(n,i,a){n=n("../internals/fails"),i.exports=!n(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})},{"../internals/fails":51}],44:[function(l,i,a){var s=l("../internals/global"),l=l("../internals/is-object"),u=s.document,c=l(u)&&l(u.createElement);i.exports=function(h){return c?u.createElement(h):{}}},{"../internals/global":59,"../internals/is-object":74}],45:[function(n,i,a){i.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},{}],46:[function(n,i,a){n=n("../internals/engine-user-agent"),i.exports=/(iphone|ipod|ipad).*applewebkit/i.test(n)},{"../internals/engine-user-agent":47}],47:[function(n,i,a){n=n("../internals/get-built-in"),i.exports=n("navigator","userAgent")||""},{"../internals/get-built-in":56}],48:[function(u,i,a){var s,l,c=u("../internals/global"),u=u("../internals/engine-user-agent"),c=c.process,c=c&&c.versions,c=c&&c.v8;c?l=(s=c.split("."))[0]+s[1]:u&&(!(s=u.match(/Edge\/(\d+)/))||74<=s[1])&&(s=u.match(/Chrome\/(\d+)/))&&(l=s[1]),i.exports=l&&+l},{"../internals/engine-user-agent":47,"../internals/global":59}],49:[function(n,i,a){i.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},{}],50:[function(n,i,a){var s=n("../internals/global"),l=n("../internals/object-get-own-property-descriptor").f,u=n("../internals/create-non-enumerable-property"),c=n("../internals/redefine"),h=n("../internals/set-global"),f=n("../internals/copy-constructor-properties"),d=n("../internals/is-forced");i.exports=function(m,y){var p,g,b,x=m.target,v=m.global,w=m.stat,_=v?s:w?s[x]||h(x,{}):(s[x]||{}).prototype;if(_)for(p in y){if(g=y[p],b=m.noTargetGet?(b=l(_,p))&&b.value:_[p],!d(v?p:x+(w?".":"#")+p,m.forced)&&b!==void 0){if(typeof g==typeof b)continue;f(g,b)}(m.sham||b&&b.sham)&&u(g,"sham",!0),c(_,p,g,m)}}},{"../internals/copy-constructor-properties":33,"../internals/create-non-enumerable-property":38,"../internals/global":59,"../internals/is-forced":73,"../internals/object-get-own-property-descriptor":93,"../internals/redefine":108,"../internals/set-global":115}],51:[function(n,i,a){i.exports=function(s){try{return!!s()}catch{return!0}}},{}],52:[function(y,i,a){y("../modules/es.regexp.exec");var s=y("../internals/redefine"),l=y("../internals/fails"),u=y("../internals/well-known-symbol"),c=y("../internals/regexp-exec"),h=y("../internals/create-non-enumerable-property"),f=u("species"),d=!l(function(){var b=/./;return b.exec=function(){var x=[];return x.groups={a:"7"},x},"".replace(b,"$")!=="7"}),m="a".replace(/./,"$0")==="$0",y=u("replace"),p=!!/./[y]&&/./[y]("a","$0")==="",g=!l(function(){var x=/(?:)/,b=x.exec,x=(x.exec=function(){return b.apply(this,arguments)},"ab".split(x));return x.length!==2||x[0]!=="a"||x[1]!=="b"});i.exports=function(b,x,v,w){var _,E,S=u(b),T=!l(function(){var A={};return A[S]=function(){return 7},""[b](A)!=7}),k=T&&!l(function(){var A=!1,O=/a/;return b==="split"&&((O={constructor:{}}).constructor[f]=function(){return O},O.flags="",O[S]=/./[S]),O.exec=function(){return A=!0,null},O[S](""),!A});T&&k&&(b!=="replace"||d&&m&&!p)&&(b!=="split"||g)||(_=/./[S],v=(k=v(S,""[b],function(A,O,R,C,L){return O.exec===c?T&&!L?{done:!0,value:_.call(O,R,C)}:{done:!0,value:A.call(R,O,C)}:{done:!1}},{REPLACE_KEEPS_$0:m,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:p}))[0],E=k[1],s(String.prototype,b,v),s(RegExp.prototype,S,x==2?function(A,O){return E.call(A,this,O)}:function(A){return E.call(A,this)})),w&&h(RegExp.prototype[S],"sham",!0)}},{"../internals/create-non-enumerable-property":38,"../internals/fails":51,"../internals/redefine":108,"../internals/regexp-exec":110,"../internals/well-known-symbol":148,"../modules/es.regexp.exec":187}],53:[function(n,i,a){n=n("../internals/fails"),i.exports=!n(function(){return Object.isExtensible(Object.preventExtensions({}))})},{"../internals/fails":51}],54:[function(n,i,a){var s=n("../internals/a-function");i.exports=function(l,u,c){if(s(l),u===void 0)return l;switch(c){case 0:return function(){return l.call(u)};case 1:return function(h){return l.call(u,h)};case 2:return function(h,f){return l.call(u,h,f)};case 3:return function(h,f,d){return l.call(u,h,f,d)}}return function(){return l.apply(u,arguments)}}},{"../internals/a-function":5}],55:[function(n,i,a){var s=n("../internals/a-function"),l=n("../internals/is-object"),u=[].slice,c={};i.exports=Function.bind||function(h){var f=s(this),d=u.call(arguments,1),m=function(){var y=d.concat(u.call(arguments));if(this instanceof m){var p=f,g=y.length,b=y;if(!(g in c)){for(var x=[],v=0;v>1,_=d===23?l(2,-24)-l(2,-77):0,E=f<0||f===0&&1/f<0?1:0,S=0;for((f=s(f))!=f||f===1/0?(p=f!=f?1:0,y=v):(y=u(c(f)/h),f*(g=l(2,-y))<1&&(y--,g*=2),2<=(f+=1<=y+w?_/g:_*l(2,1-w))*g&&(y++,g/=2),v<=y+w?(p=0,y=v):1<=y+w?(p=(f*g-1)*l(2,d),y+=w):(p=f*l(2,w-1)*l(2,d),y=0));8<=d;b[S++]=255&p,p/=256,d-=8);for(y=y<>1,b=v-7,x=y-1,v=f[x--],w=127&v;for(v>>=7;0>=-b,b+=d;0"+w+""},v=function(){try{l=document.domain&&new ActiveXObject("htmlfile")}catch{}v=l?((w=l).write(x("")),w.close(),_=w.parentWindow.Object,w=null,_):(w=m("iframe"),_="java"+g+":",w.style.display="none",d.appendChild(w),w.src=String(_),(_=w.contentWindow.document).open(),_.write(x("document.F=Object")),_.close(),_.F);for(var w,_,E=h.length;E--;)delete v[p][h[E]];return v()};f[b]=!0,i.exports=Object.create||function(w,_){var E;return w!==null?(s[p]=u(w),E=new s,s[p]=null,E[b]=w):E=v(),_===void 0?E:c(E,_)}},{"../internals/an-object":10,"../internals/document-create-element":44,"../internals/enum-bug-keys":49,"../internals/hidden-keys":61,"../internals/html":63,"../internals/object-define-properties":91,"../internals/shared-key":118}],91:[function(n,i,a){var s=n("../internals/descriptors"),l=n("../internals/object-define-property"),u=n("../internals/an-object"),c=n("../internals/object-keys");i.exports=s?Object.defineProperties:function(h,f){u(h);for(var d,m=c(f),y=m.length,p=0;py;)!s(m,d=f[y++])||~u(p,d)||p.push(d);return p}},{"../internals/array-includes":18,"../internals/has":60,"../internals/hidden-keys":61,"../internals/to-indexed-object":134}],99:[function(n,i,a){var s=n("../internals/object-keys-internal"),l=n("../internals/enum-bug-keys");i.exports=Object.keys||function(u){return s(u,l)}},{"../internals/enum-bug-keys":49,"../internals/object-keys-internal":98}],100:[function(n,i,a){var s={}.propertyIsEnumerable,l=Object.getOwnPropertyDescriptor,u=l&&!s.call({1:2},1);a.f=u?function(c){return c=l(this,c),!!c&&c.enumerable}:s},{}],101:[function(n,i,a){var s=n("../internals/an-object"),l=n("../internals/a-possible-prototype");i.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var u,c=!1,h={};try{(u=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(h,[]),c=h instanceof Array}catch{}return function(f,d){return s(f),l(d),c?u.call(f,d):f.__proto__=d,f}}():void 0)},{"../internals/a-possible-prototype":6,"../internals/an-object":10}],102:[function(n,i,a){var s=n("../internals/to-string-tag-support"),l=n("../internals/classof");i.exports=s?{}.toString:function(){return"[object "+l(this)+"]"}},{"../internals/classof":29,"../internals/to-string-tag-support":141}],103:[function(n,i,a){var s=n("../internals/get-built-in"),l=n("../internals/object-get-own-property-names"),u=n("../internals/object-get-own-property-symbols"),c=n("../internals/an-object");i.exports=s("Reflect","ownKeys")||function(h){var f=l.f(c(h)),d=u.f;return d?f.concat(d(h)):f}},{"../internals/an-object":10,"../internals/get-built-in":56,"../internals/object-get-own-property-names":95,"../internals/object-get-own-property-symbols":96}],104:[function(n,i,a){n=n("../internals/global"),i.exports=n},{"../internals/global":59}],105:[function(n,i,a){i.exports=function(s){try{return{error:!1,value:s()}}catch(l){return{error:!0,value:l}}}},{}],106:[function(n,i,a){var s=n("../internals/an-object"),l=n("../internals/is-object"),u=n("../internals/new-promise-capability");i.exports=function(c,h){return s(c),l(h)&&h.constructor===c?h:((0,(c=u.f(c)).resolve)(h),c.promise)}},{"../internals/an-object":10,"../internals/is-object":74,"../internals/new-promise-capability":86}],107:[function(n,i,a){var s=n("../internals/redefine");i.exports=function(l,u,c){for(var h in u)s(l,h,u[h],c);return l}},{"../internals/redefine":108}],108:[function(f,i,a){var s=f("../internals/global"),l=f("../internals/create-non-enumerable-property"),u=f("../internals/has"),c=f("../internals/set-global"),h=f("../internals/inspect-source"),f=f("../internals/internal-state"),d=f.get,m=f.enforce,y=String(String).split("String");(i.exports=function(p,g,b,_){var v=!!_&&!!_.unsafe,w=!!_&&!!_.enumerable,_=!!_&&!!_.noTargetGet;typeof b=="function"&&(typeof g!="string"||u(b,"name")||l(b,"name",g),m(b).source=y.join(typeof g=="string"?g:"")),p===s?w?p[g]=b:c(g,b):(v?!_&&p[g]&&(w=!0):delete p[g],w?p[g]=b:l(p,g,b))})(Function.prototype,"toString",function(){return typeof this=="function"&&d(this).source||h(this)})},{"../internals/create-non-enumerable-property":38,"../internals/global":59,"../internals/has":60,"../internals/inspect-source":68,"../internals/internal-state":70,"../internals/set-global":115}],109:[function(n,i,a){var s=n("./classof-raw"),l=n("./regexp-exec");i.exports=function(u,c){var h=u.exec;if(typeof h=="function"){if(h=h.call(u,c),typeof h!="object")throw TypeError("RegExp exec method returned something other than an Object or null");return h}if(s(u)!=="RegExp")throw TypeError("RegExp#exec called on incompatible receiver");return l.call(u,c)}},{"./classof-raw":28,"./regexp-exec":110}],110:[function(c,i,a){var s,l,u=c("./regexp-flags"),c=c("./regexp-sticky-helpers"),h=RegExp.prototype.exec,f=String.prototype.replace,d=h,m=(s=/a/,l=/b*/g,h.call(s,"a"),h.call(l,"a"),s.lastIndex!==0||l.lastIndex!==0),y=c.UNSUPPORTED_Y||c.BROKEN_CARET,p=/()??/.exec("")[1]!==void 0;i.exports=d=m||p||y?function(g){var b,x,v,w,_=this,E=y&&_.sticky,S=u.call(_),T=_.source,k=0,A=g;return E&&((S=S.replace("y","")).indexOf("g")===-1&&(S+="g"),A=String(g).slice(_.lastIndex),0<_.lastIndex&&(!_.multiline||_.multiline&&g[_.lastIndex-1]!==` `)&&(T="(?: "+T+")",A=" "+A,k++),x=new RegExp("^(?:"+T+")",S)),p&&(x=new RegExp("^"+T+"$(?!\\s)",S)),m&&(b=_.lastIndex),v=h.call(E?x:_,A),E?v?(v.input=v.input.slice(k),v[0]=v[0].slice(k),v.index=_.lastIndex,_.lastIndex+=v[0].length):_.lastIndex=0:m&&v&&(_.lastIndex=_.global?v.index+v[0].length:b),p&&v&&1x&&(g=g.slice(0,x)),f?p+g:g+p)}}var l=n("../internals/to-length"),u=n("../internals/string-repeat"),c=n("../internals/require-object-coercible"),h=Math.ceil;i.exports={start:s(!1),end:s(!0)}},{"../internals/require-object-coercible":113,"../internals/string-repeat":127,"../internals/to-length":136}],126:[function(n,i,a){function s(v){return v+22+75*(v<26)}function l(v){var w,_=[],E=(v=function(K){for(var Z=[],U=0,I=K.length;Ub((u-T)/L))throw RangeError(p);for(T+=(R-S)*L,S=R,C=0;Cu)throw RangeError(p);if(w==S){for(var F=T,z=c;;z+=c){var W=z<=k?1:k+h<=z?h:z-k;if(F>1,K+=b(K/Z);g*h>>1>>=1)&&(c+=c))1&f&&(h+=c);return h}},{"../internals/require-object-coercible":113,"../internals/to-integer":135}],128:[function(n,i,a){var s=n("../internals/fails"),l=n("../internals/whitespaces");i.exports=function(u){return s(function(){return!!l[u]()||"​…᠎"[u]()!="​…᠎"||l[u].name!==u})}},{"../internals/fails":51,"../internals/whitespaces":149}],129:[function(u,i,a){function s(f){return function(d){return d=String(l(d)),1&f&&(d=d.replace(c,"")),d=2&f?d.replace(h,""):d}}var l=u("../internals/require-object-coercible"),u="["+u("../internals/whitespaces")+"]",c=RegExp("^"+u+u+"*"),h=RegExp(u+u+"*$");i.exports={start:s(1),end:s(2),trim:s(3)}},{"../internals/require-object-coercible":113,"../internals/whitespaces":149}],130:[function(g,i,a){function s(O){return function(){A(O)}}function l(O){A(O.data)}function u(O){h.postMessage(O+"",b.protocol+"//"+b.host)}var c,h=g("../internals/global"),f=g("../internals/fails"),d=g("../internals/classof-raw"),m=g("../internals/function-bind-context"),y=g("../internals/html"),p=g("../internals/document-create-element"),g=g("../internals/engine-is-ios"),b=h.location,x=h.setImmediate,v=h.clearImmediate,w=h.process,_=h.MessageChannel,E=h.Dispatch,S=0,T={},k="onreadystatechange",A=function(O){var R;T.hasOwnProperty(O)&&(R=T[O],delete T[O],R())};x&&v||(x=function(O){for(var R=[],C=1;C=p.length?{value:y.target=void 0,done:!0}:g=="keys"?{value:b,done:!1}:g=="values"?{value:p[b],done:!1}:{value:[b,p[b]],done:!1}},"values"),u.Arguments=u.Array,l("keys"),l("values"),l("entries")},{"../internals/add-to-unscopables":7,"../internals/define-iterator":41,"../internals/internal-state":70,"../internals/iterators":79,"../internals/to-indexed-object":134}],162:[function(h,i,a){var s=h("../internals/export"),c=h("../internals/indexed-object"),l=h("../internals/to-indexed-object"),h=h("../internals/array-method-is-strict"),u=[].join,c=c!=Object,h=h("join",",");s({target:"Array",proto:!0,forced:c||!h},{join:function(f){return u.call(l(this),f===void 0?",":f)}})},{"../internals/array-method-is-strict":22,"../internals/export":50,"../internals/indexed-object":66,"../internals/to-indexed-object":134}],163:[function(l,i,a){var s=l("../internals/export"),l=l("../internals/array-last-index-of");s({target:"Array",proto:!0,forced:l!==[].lastIndexOf},{lastIndexOf:l})},{"../internals/array-last-index-of":20,"../internals/export":50}],164:[function(c,i,a){var s=c("../internals/export"),l=c("../internals/array-iteration").map,u=c("../internals/array-method-has-species-support"),c=c("../internals/array-method-uses-to-length"),u=u("map"),c=c("map");s({target:"Array",proto:!0,forced:!u||!c},{map:function(h){return l(this,h,1R;R++)f(E,k=O[R])&&!f(A,k)&&v(A,k,x(E,k));(A.prototype=S).constructor=A,h(u,_,A)}},{"../internals/classof-raw":28,"../internals/descriptors":43,"../internals/fails":51,"../internals/global":59,"../internals/has":60,"../internals/inherit-if-required":67,"../internals/is-forced":73,"../internals/object-create":90,"../internals/object-define-property":92,"../internals/object-get-own-property-descriptor":93,"../internals/object-get-own-property-names":95,"../internals/redefine":108,"../internals/string-trim":129,"../internals/to-primitive":140}],174:[function(n,i,a){n("../internals/export")({target:"Number",stat:!0},{isFinite:n("../internals/number-is-finite")})},{"../internals/export":50,"../internals/number-is-finite":88}],175:[function(f,i,a){function s(y,p,g){return p===0?g:p%2==1?s(y,p-1,g*y):s(y*y,p/2,g)}var l=f("../internals/export"),u=f("../internals/to-integer"),c=f("../internals/this-number-value"),h=f("../internals/string-repeat"),f=f("../internals/fails"),d=1 .toFixed,m=Math.floor;l({target:"Number",proto:!0,forced:d&&(8e-5.toFixed(3)!=="0.000"||.9.toFixed(0)!=="1"||1.255.toFixed(2)!=="1.25"||0xde0b6b3a7640080.toFixed(0)!=="1000000000000000128")||!f(function(){d.call({})})},{toFixed:function(_){function p(k,A){for(var O=-1,R=A;++O<6;)R+=k*E[O],E[O]=R%1e7,R=m(R/1e7)}function g(k){for(var A=6,O=0;0<=--A;)O+=E[A],E[A]=m(O/k),O=O%k*1e7}function b(){for(var k,A=6,O="";0<=--A;)O===""&&A!==0&&E[A]===0||(k=String(E[A]),O=O===""?k:O+h.call("0",7-k.length)+k);return O}var x,v,w=c(this),_=u(_),E=[0,0,0,0,0,0],S="",T="0";if(_<0||20<_)throw RangeError("Incorrect fraction digits");if(w!=w)return"NaN";if(w<=-1e21||1e21<=w)return String(w);if(w<0&&(S="-",w=-w),1e-21De;){var Fe,We,He,Je=ue[De++],ht=Oe?Je.ok:Je.fail,mt=Je.resolve,st=Je.reject,xt=Je.domain;try{ht?(Oe||(ke.rejection===se&&function(bt,fr){O.call(d,function(){te?oe.emit("rejectionHandled",bt):$e(fe,bt,fr.value)})}(Be,ke),ke.rejection=re),ht===!0?Fe=je:(xt&&xt.enter(),Fe=ht(je),xt&&(xt.exit(),He=!0)),Fe===Je.promise?st(Y("Promise-chain cycle")):(We=_e(Fe))?We.call(Fe,mt,st):mt(Fe)):st(je)}catch(bt){xt&&!He&&xt.exit(),st(bt)}}ke.reactions=[],ke.notified=!1,ie&&!ke.rejection&&(J=Be,de=ke,O.call(d,function(){var bt=de.value,fr=ze(de);if(fr&&(fr=z(function(){te?oe.emit("unhandledRejection",bt,J):$e(ne,J,bt)}),de.rejection=te||ze(de)?se:re,fr.error))throw fr.value}))}))},$e=function(Be,ke,ie){var ue;pe?((ue=ee.createEvent("Event")).promise=ke,ue.reason=ie,ue.initEvent(Be,!1,!0),d.dispatchEvent(ue)):ue={promise:ke,reason:ie},(ke=d["on"+Be])?ke(ue):Be===ne&&L("Unhandled promise rejection",ie)},ze=function(Be){return Be.rejection!==re&&!Be.parent},Ke=function(Be,ke,ie,ue){return function(J){Be(ke,ie,J,ue)}},Xe=function(Be,ke,ie,ue){ke.done||(ke.done=!0,(ke=ue||ke).value=ie,ke.state=Ee,Ne(Be,ke,!0))},Te=function(Be,ke,ie,ue){if(!ke.done){ke.done=!0,ue&&(ke=ue);try{if(Be===ie)throw Y("Promise can't be resolved itself");var J=_e(ie);J?R(function(){var de={done:!1};try{J.call(ie,Ke(Te,Be,de,ke),Ke(Xe,Be,de,ke))}catch(je){Xe(Be,de,je,ke)}}):(ke.value=ie,ke.state=be,Ne(Be,ke,!1))}catch(de){Xe(Be,{done:!1},de,ke)}}};ye&&(H=function(Be){_(this,H,Z),w(Be),s.call(this);var ke=U(this);try{Be(Ke(Te,this,ke),Ke(Xe,this,ke))}catch(ie){Xe(this,ke,ie)}},(s=function(Be){I(this,{type:Z,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=g(H.prototype,{then:function(Be,ke){var ie=B(this),ue=he(A(this,H));return ue.ok=typeof Be!="function"||Be,ue.fail=typeof ke=="function"&&ke,ue.domain=te?oe.domain:void 0,ie.parent=!0,ie.reactions.push(ue),ie.state!=0&&Ne(this,ie,!1),ue.promise},catch:function(Be){return this.then(void 0,Be)}}),l=function(){var Be=new s,ke=U(Be);this.promise=Be,this.resolve=Ke(Te,Be,ke),this.reject=Ke(Xe,Be,ke)},F.f=he=function(Be){return Be===H||Be===u?new l:ae(Be)},f||typeof y!="function"||(c=y.prototype.then,p(y.prototype,"then",function(Be,ke){var ie=this;return new H(function(ue,J){c.call(ie,ue,J)}).then(Be,ke)},{unsafe:!0}),typeof ce=="function"&&h({global:!0,enumerable:!0,forced:!0},{fetch:function(Be){return C(H,ce.apply(d,arguments))}}))),h({global:!0,wrap:!0,forced:ye},{Promise:H}),b(H,Z,!1,!0),x(Z),u=m(Z),h({target:Z,stat:!0,forced:ye},{reject:function(Be){var ke=he(this);return ke.reject.call(void 0,Be),ke.promise}}),h({target:Z,stat:!0,forced:f||ye},{resolve:function(Be){return C(f&&this===u?H:this,Be)}}),h({target:Z,stat:!0,forced:Pe},{all:function(Be){var ke=this,ie=he(ke),ue=ie.resolve,J=ie.reject,de=z(function(){var je=w(ke.resolve),Oe=[],De=0,Fe=1;T(Be,function(We){var He=De++,Je=!1;Oe.push(void 0),Fe++,je.call(ke,We).then(function(ht){Je||(Je=!0,Oe[He]=ht,--Fe||ue(Oe))},J)}),--Fe||ue(Oe)});return de.error&&J(de.value),ie.promise},race:function(Be){var ke=this,ie=he(ke),ue=ie.reject,J=z(function(){var de=w(ke.resolve);T(Be,function(je){de.call(ke,je).then(ie.resolve,ue)})});return J.error&&ue(J.value),ie.promise}})},{"../internals/a-function":5,"../internals/an-instance":9,"../internals/check-correctness-of-iteration":27,"../internals/classof-raw":28,"../internals/engine-v8-version":48,"../internals/export":50,"../internals/get-built-in":56,"../internals/global":59,"../internals/host-report-errors":62,"../internals/inspect-source":68,"../internals/internal-state":70,"../internals/is-forced":73,"../internals/is-object":74,"../internals/is-pure":75,"../internals/iterate":77,"../internals/microtask":81,"../internals/native-promise-constructor":82,"../internals/new-promise-capability":86,"../internals/perform":105,"../internals/promise-resolve":106,"../internals/redefine":108,"../internals/redefine-all":107,"../internals/set-species":116,"../internals/set-to-string-tag":117,"../internals/species-constructor":121,"../internals/task":130,"../internals/well-known-symbol":148}],184:[function(d,i,a){var s=d("../internals/export"),g=d("../internals/get-built-in"),l=d("../internals/a-function"),u=d("../internals/an-object"),c=d("../internals/is-object"),h=d("../internals/object-create"),f=d("../internals/function-bind"),d=d("../internals/fails"),m=g("Reflect","construct"),y=d(function(){function b(){}return!(m(function(){},[],b)instanceof b)}),p=!d(function(){m(function(){})}),g=y||p;s({target:"Reflect",stat:!0,forced:g,sham:g},{construct:function(b,x){l(b),u(x);var v=arguments.length<3?b:l(arguments[2]);if(p&&!y)return m(b,x,v);if(b==v){switch(x.length){case 0:return new b;case 1:return new b(x[0]);case 2:return new b(x[0],x[1]);case 3:return new b(x[0],x[1],x[2]);case 4:return new b(x[0],x[1],x[2],x[3])}var w=[null];return w.push.apply(w,x),new(f.apply(b,w))}return w=v.prototype,v=h(c(w)?w:Object.prototype),w=Function.apply.call(b,v,x),c(w)?w:v}})},{"../internals/a-function":5,"../internals/an-object":10,"../internals/export":50,"../internals/fails":51,"../internals/function-bind":55,"../internals/get-built-in":56,"../internals/is-object":74,"../internals/object-create":90}],185:[function(n,i,a){var s=n("../internals/export"),l=n("../internals/is-object"),u=n("../internals/an-object"),c=n("../internals/has"),h=n("../internals/object-get-own-property-descriptor"),f=n("../internals/object-get-prototype-of");s({target:"Reflect",stat:!0},{get:function d(m,y){var p,g=arguments.length<3?m:arguments[2];return u(m)===g?m[y]:(p=h.f(m,y))?c(p,"value")?p.value:p.get===void 0?void 0:p.get.call(g):l(p=f(m))?d(p,y,g):void 0}})},{"../internals/an-object":10,"../internals/export":50,"../internals/has":60,"../internals/is-object":74,"../internals/object-get-own-property-descriptor":93,"../internals/object-get-prototype-of":97}],186:[function(n,i,a){var s=n("../internals/descriptors"),l=n("../internals/global"),u=n("../internals/is-forced"),c=n("../internals/inherit-if-required"),h=n("../internals/object-define-property").f,f=n("../internals/object-get-own-property-names").f,d=n("../internals/is-regexp"),m=n("../internals/regexp-flags"),y=n("../internals/regexp-sticky-helpers"),p=n("../internals/redefine"),g=n("../internals/fails"),b=n("../internals/internal-state").set,x=n("../internals/set-species"),v=n("../internals/well-known-symbol")("match"),w=l.RegExp,_=w.prototype,E=/a/g,S=/a/g,T=new w(E)!==E,k=y.UNSUPPORTED_Y;if(s&&u("RegExp",!T||k||g(function(){return S[v]=!1,w(E)!=E||w(S)==S||w(E,"i")!="/a/i"}))){for(var A=function(C,L){var F,z=this instanceof A,W=d(C),$=L===void 0;return!z&&W&&C.constructor===A&&$?C:(T?W&&!$&&(C=C.source):C instanceof A&&($&&(L=m.call(C)),C=C.source),k&&(F=!!L&&-1R;)(function(C){C in A||h(A,C,{configurable:!0,get:function(){return w[C]},set:function(L){w[C]=L}})})(O[R++]);(_.constructor=A).prototype=_,p(l,"RegExp",A)}x("RegExp")},{"../internals/descriptors":43,"../internals/fails":51,"../internals/global":59,"../internals/inherit-if-required":67,"../internals/internal-state":70,"../internals/is-forced":73,"../internals/is-regexp":76,"../internals/object-define-property":92,"../internals/object-get-own-property-names":95,"../internals/redefine":108,"../internals/regexp-flags":111,"../internals/regexp-sticky-helpers":112,"../internals/set-species":116,"../internals/well-known-symbol":148}],187:[function(l,i,a){var s=l("../internals/export"),l=l("../internals/regexp-exec");s({target:"RegExp",proto:!0,forced:/./.exec!==l},{exec:l})},{"../internals/export":50,"../internals/regexp-exec":110}],188:[function(c,i,a){var s=c("../internals/redefine"),l=c("../internals/an-object"),d=c("../internals/fails"),u=c("../internals/regexp-flags"),c="toString",h=RegExp.prototype,f=h[c],d=d(function(){return f.call({source:"a",flags:"b"})!="/a/b"}),m=f.name!=c;(d||m)&&s(RegExp.prototype,c,function(){var y=l(this),p=String(y.source),g=y.flags;return"/"+p+"/"+String(g===void 0&&y instanceof RegExp&&!("flags"in h)?u.call(y):g)},{unsafe:!0})},{"../internals/an-object":10,"../internals/fails":51,"../internals/redefine":108,"../internals/regexp-flags":111}],189:[function(l,i,a){var s=l("../internals/collection"),l=l("../internals/collection-strong");i.exports=s("Set",function(u){return function(){return u(this,arguments.length?arguments[0]:void 0)}},l)},{"../internals/collection":32,"../internals/collection-strong":30}],190:[function(f,i,a){var s=f("../internals/export"),l=f("../internals/object-get-own-property-descriptor").f,u=f("../internals/to-length"),c=f("../internals/not-a-regexp"),h=f("../internals/require-object-coercible"),y=f("../internals/correct-is-regexp-logic"),f=f("../internals/is-pure"),d="".endsWith,m=Math.min,y=y("endsWith");s({target:"String",proto:!0,forced:!!(f||y||!(s=l(String.prototype,"endsWith"))||s.writable)&&!y},{endsWith:function(p){var g=String(h(this)),b=(c(p),1=m.length?{value:void 0,done:!0}:(m=s(m,y),d.index+=m.length,{value:m,done:!1})})},{"../internals/define-iterator":41,"../internals/internal-state":70,"../internals/string-multibyte":123}],193:[function(n,i,a){var s=n("../internals/fix-regexp-well-known-symbol-logic"),l=n("../internals/an-object"),u=n("../internals/to-length"),c=n("../internals/require-object-coercible"),h=n("../internals/advance-string-index"),f=n("../internals/regexp-exec-abstract");s("match",1,function(d,m,y){return[function(p){var g=c(this),b=p==null?void 0:p[d];return b!==void 0?b.call(p,g):new RegExp(p)[d](String(g))},function(p){var g=y(m,p,this);if(g.done)return g.value;var b=l(p),x=String(this);if(!b.global)return f(b,x);for(var v=b.unicode,w=[],_=b.lastIndex=0;(E=f(b,x))!==null;){var E=String(E[0]);(w[_]=E)===""&&(b.lastIndex=h(x,u(b.lastIndex),v)),_++}return _===0?null:w}]})},{"../internals/advance-string-index":8,"../internals/an-object":10,"../internals/fix-regexp-well-known-symbol-logic":52,"../internals/regexp-exec-abstract":109,"../internals/require-object-coercible":113,"../internals/to-length":136}],194:[function(n,i,a){var s=n("../internals/export"),l=n("../internals/string-pad").start;s({target:"String",proto:!0,forced:n("../internals/string-pad-webkit-bug")},{padStart:function(u){return l(this,u,1]*>)/g,x=/\$([$&'`]|\d\d?)/g;s("replace",2,function(v,w,_,E){var S=E.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,T=E.REPLACE_KEEPS_$0,k=S?"$":"$0";return[function(A,O){var R=f(this),C=A==null?void 0:A[v];return C!==void 0?C.call(A,R,O):w.call(String(R),A,O)},function(A,O){if(!S&&T||typeof O=="string"&&O.indexOf(k)===-1){var R=_(w,A,this,O);if(R.done)return R.value}for(var C,L=l(A),F=String(this),z=typeof O=="function",W=(z||(O=String(O)),L.global),$=(W&&(C=L.unicode,L.lastIndex=0),[]);(I=m(L,F))!==null&&($.push(I),W);)String(I[0])===""&&(L.lastIndex=d(F,c(L.lastIndex),C));for(var G,K="",Z=0,U=0;U<$.length;U++){for(var I=$[U],B=String(I[0]),H=y(p(h(I.index),F.length),0),Y=[],ee=1;ee>>0;if(O==0)return[];if(T===void 0)return[A];if(!l(T))return _.call(A,T,O);for(var R,C,L,F=[],k=(T.ignoreCase?"i":"")+(T.multiline?"m":"")+(T.unicode?"u":"")+(T.sticky?"y":""),z=0,W=new RegExp(T.source,k+"g");(R=y.call(W,A))&&!(z<(C=W.lastIndex)&&(F.push(A.slice(z,R.index)),1=O));)W.lastIndex===R.index&&W.lastIndex++;return z===A.length?!L&&W.test("")||F.push(""):F.push(A.slice(z)),F.length>O?F.slice(0,O):F}:"0".split(void 0,0).length?function(T,k){return T===void 0&&k===0?[]:_.call(this,T,k)}:_;return[function(T,k){var A=c(this),O=T==null?void 0:T[w];return O!==void 0?O.call(T,A,k):S.call(String(A),T,k)},function(R,k){var A=E(S,R,this,k,S!==_);if(A.done)return A.value;var A=u(R),O=String(this),R=h(A,RegExp),C=A.unicode,L=(A.ignoreCase?"i":"")+(A.multiline?"m":"")+(A.unicode?"u":"")+(v?"y":"g"),F=new R(v?A:"^(?:"+A.source+")",L),z=k===void 0?x:k>>>0;if(z==0)return[];if(O.length===0)return m(F,O)===null?[O]:[];for(var W=0,$=0,G=[];$ce.key){te.splice(he,0,ce);break}he===ne&&te.push(ce)}ae.updateURL()},forEach:function(ce){for(var he,ae=G(this).entries,te=_(ce,16))return;for(Lr=0;cn();){if(un=null,Lr>0)if(cn()=="."&&Lr<4)ot++;else return;if(!H.test(cn()))return;for(;H.test(cn());){if(Oi=parseInt(cn(),10),un===null)un=Oi;else{if(un==0)return;un=un*10+Oi}if(un>255)return;ot++}Ht[nt]=Ht[nt]*256+un,Lr++,(Lr==2||Lr==4)&&nt++}if(Lr!=4)return;break}else if(cn()==":"){if(ot++,!cn())return}else if(cn())return;Ht[nt++]=Vr}if(Ut!==null)for(bo=nt-Ut,nt=7;nt!=0&&bo>0;)ki=Ht[nt],Ht[nt--]=Ht[Ut+bo-1],Ht[Ut+--bo]=ki;else if(nt!=8)return;return Ht}(Ze.slice(1,-1)))?void(we.host=it):Z;if(_e(we))return Ze=T(Ze),he.test(Ze)||(it=function(qe){var Ht=qe.split("."),nt,Ut,ot,Vr,en,Lr,un;if(Ht.length&&Ht[Ht.length-1]==""&&Ht.pop(),(nt=Ht.length)>4)return qe;for(Ut=[],ot=0;ot1&&Vr.charAt(0)=="0"&&(en=Y.test(Vr)?16:8,Vr=Vr.slice(en==8?1:2)),Vr==="")Lr=0;else{if(!(en==10?oe:en==8?ee:ce).test(Vr))return qe;Lr=parseInt(Vr,en)}Ut.push(Lr)}for(ot=0;ot=$(256,5-nt))return null}else if(Lr>255)return null;for(un=Ut.pop(),ot=0;ot":1,"`":1}),re=_({},Ee,{"#":1,"?":1,"{":1,"}":1}),se=_({},re,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),ye=function(we,Ze){var it=S(we,0);return 32"u"&&s!==void 0&&{}.toString.call(s)==="[object process]",v=typeof Uint8ClampedArray<"u"&&typeof importScripts<"u"&&typeof MessageChannel<"u";function w(){var ne=setTimeout;return function(){return ne(E,1)}}var _=new Array(1e3);function E(){for(var ne=0;neA,applyPalette:()=>function(z,W,$="rgb565"){if(!z||!z.buffer)throw new Error("quantize() expected RGBA Uint8Array data");if(!(z instanceof Uint8Array||z instanceof Uint8ClampedArray))throw new Error("quantize() expected RGBA Uint8Array data");if(256>24&255,H=ee>>16&255,Y=ee>>8&255,ee=255&ee,oe=p(ee,Y,H,B),oe=oe in I?I[oe]:I[oe]=function(ne,fe,be,Ee,re){let se=0,ye=1e100;for(let $e=0;$eye||(Pe=_e[0],(Ne+=S(Pe-ne))>ye||(Pe=_e[1],(Ne+=S(Pe-fe))>ye||(Pe=_e[2],(Ne+=S(Pe-be))>ye||(ye=Ne,se=$e))))}return se}(ee,Y,H,B,W);U[pe]=oe}else{const pe=$==="rgb444"?g:y;for(let ne=0;ne>16&255,he=ae>>8&255,ae=255&ae,te=pe(ae,he,ce),te=te in I?I[te]:I[te]=function(fe,be,Ee,re){let se=0,ye=1e100;for(let $e=0;$eye||(Pe=_e[1],(Ne+=S(Pe-be))>ye||(Pe=_e[2],(Ne+=S(Pe-Ee))>ye||(ye=Ne,se=$e)))}return se}(ae,he,ce,W);U[ne]=te}}return U},default:()=>F,nearestColor:()=>function(z,W,$=_){return z[T(z,W,$)]},nearestColorIndex:()=>T,nearestColorIndexWithDistance:()=>k,prequantize:()=>function(z,{roundRGB:W=5,roundAlpha:$=10,oneBitAlpha:G=null}={}){const K=new Uint32Array(z.buffer);for(let H=0;H>24&255;var Z,U=B>>16&255,I=B>>8&255,B=255&B;Y=E(Y,$),G&&(Z=typeof G=="number"?G:127,Y=Y<=Z?0:255),B=E(B,W),I=E(I,W),U=E(U,W),K[H]=Y<<24|U<<16|I<<8|B<<0}},quantize:()=>function(z,W,$={}){var{format:G="rgb565",clearAlpha:K=!0,clearAlphaColor:Z=0,clearAlphaThreshold:U=0,oneBitAlpha:I=!1}=$;if(!z||!z.buffer)throw new Error("quantize() expected RGBA Uint8Array data");if(!(z instanceof Uint8Array||z instanceof Uint8ClampedArray))throw new Error("quantize() expected RGBA Uint8Array data");z=new Uint32Array(z.buffer);let B=$.useSqrt!==!1;const H=G==="rgba4444",Y=function(ze,Ke){const Xe=Ke==="rgb444"?4096:65536,Te=new Array(Xe),Be=ze.length;if(Ke==="rgba4444")for(let mt=0;mt>24&255,ie=J>>16&255,ue=J>>8&255,J=255&J,de=p(J,ue,ie,ke);let st=de in Te?Te[de]:Te[de]=w();st.rc+=J,st.gc+=ue,st.bc+=ie,st.ac+=ke,st.cnt++}else if(Ke==="rgb444")for(let mt=0;mt>16&255,Oe=De>>8&255,De=255&De,Fe=g(De,Oe,je);let st=Fe in Te?Te[Fe]:Te[Fe]=w();st.rc+=De,st.gc+=Oe,st.bc+=je,st.cnt++}else for(let mt=0;mt>16&255,He=Je>>8&255,Je=255&Je,ht=y(Je,He,We);let st=ht in Te?Te[ht]:Te[ht]=w();st.rc+=Je,st.gc+=He,st.bc+=We,st.cnt++}return Te}(z,G),ee=Y.length,oe=ee-1,ce=new Uint32Array(ee+1);for(var he=0,ae=0;ae>1,!(Y[te=ce[ne]].err<=fe));pe=ne)ce[pe]=te;ce[pe]=ae}var be,Ee=he-W;for(ae=0;ae=be.mtm&&Y[be.nn].mtm<=be.tm)break;for(be.mtm==oe?re=ce[1]=ce[ce[0]--]:(v(Y,re),be.tm=ae),fe=Y[re].err,pe=1;(ne=pe+pe)<=ce[0]&&(neY[ce[ne+1]].err&&ne++,!(fe<=Y[te=ce[ne]].err));pe=ne)ce[pe]=te;ce[pe]=re}var se=Y[be.nn],ye=be.cnt,Pe=se.cnt,_e=1/(ye+Pe);H&&(be.ac=_e*(ye*be.ac+Pe*se.ac)),be.rc=_e*(ye*be.rc+Pe*se.rc),be.gc=_e*(ye*be.gc+Pe*se.gc),be.bc=_e*(ye*be.bc+Pe*se.bc),be.cnt+=se.cnt,be.mtm=++ae,Y[se.bk].fw=se.fw,Y[se.fw].bk=se.bk,se.mtm=oe}let Ne=[];for(ae=0;;0){let ze=b(Math.round(Y[ae].rc),0,255),Ke=b(Math.round(Y[ae].gc),0,255),Xe=b(Math.round(Y[ae].bc),0,255),Te=255;H&&(Te=b(Math.round(Y[ae].ac),0,255),I&&($e=typeof I=="number"?I:127,Te=Te<=$e?0:255),K&&Te<=U&&(ze=Ke=Xe=Z,Te=0));var $e=H?[ze,Ke,Xe,Te]:[ze,Ke,Xe];if(function(Be,ke){for(let J=0;Jfunction(z,W,$=5){if(z.length&&W.length){var G=z.map(B=>B.slice(0,3)),K=$*$,Z=z[0].length;for(let B=0;BZ?H.slice(0,3):H.slice();var I=k(G,H.slice(0,3),_),U=I[0],I=I[1];0>>0),Z!=0&&(K=Math.max(K,256));const U=$;$=new Uint8Array(K),0>=8,ee-=8;if((fe>te||he)&&(he?(ae=ce,te=(1<>=8,ee-=8;0>3}function p(z,W,$,G){return z>>4|240&W|(240&$)<<4|(240&G)<<8}function g(z,W,$){return z>>4<<8|240&W|$>>4}function b(z,W,$){return z>8&255)}function C(z,W){for(var $=0;$>1,g=-7,b=u?v-1:0,x=u?-1:1,v=s[l+b];for(b+=x,f=v&(1<<-g)-1,v>>=-g,g+=m;0>=-g,g+=c;0>1,b=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=c?0:w-1,v=c?1:-1,w=l<0||l===0&&1/l<0?1:0;for(l=Math.abs(l),isNaN(l)||l===1/0?(m=isNaN(l)?1:0,d=p):(d=Math.floor(Math.log(l)/Math.LN2),l*(c=Math.pow(2,-d))<1&&(d--,c*=2),2<=(l+=1<=d+g?b/c:b*Math.pow(2,1-g))*c&&(d++,c/=2),p<=d+g?(m=0,d=p):1<=d+g?(m=(l*c-1)*Math.pow(2,h),d+=g):(m=l*Math.pow(2,g-1)*Math.pow(2,h),d=0));8<=h;s[u+x]=255&m,x+=v,m/=256,h-=8);for(d=d<Math.abs(ie[0])&&(ue=1),ue=Math.abs(ie[2])>Math.abs(ie[ue])?2:ue}function R(ie,ue){ie.f+=ue.f,ie.b.f+=ue.b.f}function C(ie,ue,J){return ie=ie.a,ue=ue.a,J=J.a,ue.b.a===ie?J.b.a===ie?u(ue.a,J.a)?h(J.b.a,ue.a,J.a)<=0:0<=h(ue.b.a,J.a,ue.a):h(J.b.a,ie,J.a)<=0:J.b.a===ie?0<=h(ue.b.a,ie,ue.a):(ue=c(ue.b.a,ie,ue.a),(ie=c(J.b.a,ie,J.a))<=ue)}function L(ie){ie.a.i=null;var ue=ie.e;ue.a.c=ue.c,ue.c.a=ue.a,ie.e=null}function F(ie,ue){b(ie.a),ie.c=!1,(ie.a=ue).i=ie}function z(ie){for(var ue=ie.a.a;(ie=ke(ie)).a.a===ue;);return ie.c&&(F(ie,ue=v(Be(ie).a.b,ie.a.e)),ie=ke(ie)),ie}function W(ie,ue,J){var de=new Te;return de.a=J,de.e=he(ie.f,ue.e,de),J.i=de}function $(ie,ue){switch(ie.s){case 100130:return(1&ue)!=0;case 100131:return ue!==0;case 100132:return 0>1]],Fe[De[He]])?Ke:Xe)(J,He),Fe[Oe]=null,We[Oe]=J.b,J.b=Oe}else for(J.c[-(Oe+1)]=null;0Math.max(De.a,We.a))){if(u(Oe,De)){if(0J.f&&(J.f*=2,J.c=Ne(J.c,J.f+1)),J.b===0?je=de:(je=J.b,J.b=J.c[J.b]),J.e[je]=ue,J.c[je]=de,J.d[de]=je,J.h&&Xe(J,de),je):(J=ie.a++,ie.c[J]=ue,-(J+1))}function Pe(ie){if(ie.a===0)return ze(ie.b);var ue=ie.c[ie.d[ie.a-1]];if(ie.b.a!==0&&u($e(ie.b),ue))return ze(ie.b);for(;--ie.a,0ie.a||u(de[De],de[We])){je[J[Oe]=De]=Oe;break}je[J[Oe]=We]=Oe,Oe=Fe}}function Xe(ie,ue){for(var J=ie.d,de=ie.e,je=ie.c,Oe=ue,De=J[Oe];;){var Fe=Oe>>1,We=J[Fe];if(Fe==0||u(de[We],de[De])){je[J[Oe]=De]=Oe;break}je[J[Oe]=We]=Oe,Oe=Fe}}function Te(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function Be(ie){return ie.e.c.b}function ke(ie){return ie.e.a.b}(s=te.prototype).x=function(){pe(this,0)},s.B=function(ie,ue){switch(ie){case 100142:return;case 100140:switch(ue){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=ue)}break;case 100141:return void(this.m=!!ue);default:return void ne(this,100900)}ne(this,100901)},s.y=function(ie){switch(ie){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:ne(this,100900)}return!1},s.A=function(ie,ue,J){this.j[0]=ie,this.j[1]=ue,this.j[2]=J},s.z=function(ie,ue){var J=ue||null;switch(ie){case 100100:case 100106:this.h=J;break;case 100104:case 100110:this.l=J;break;case 100101:case 100107:this.k=J;break;case 100102:case 100108:this.i=J;break;case 100103:case 100109:this.p=J;break;case 100105:case 100111:this.o=J;break;case 100112:this.r=J;break;default:ne(this,100900)}},s.C=function(ie,ue){var J=!1,de=[0,0,0];pe(this,2);for(var je=0;je<3;++je){var Oe=ie[je];Oe<-1e150&&(Oe=-1e150,J=!0),1e150de[He]&&(de[He]=Je,je[He]=J)}if(de[1]-Fe[1]>de[J=0]-Fe[0]&&(J=1),Fe[J=de[2]-Fe[2]>de[J]-Fe[J]?2:J]>=de[J])De[0]=0,De[1]=0,De[2]=1;else{for(Fe=We[J],je=je[J],We=[de=0,0,0],Fe=[Fe.g[0]-je.g[0],Fe.g[1]-je.g[1],Fe.g[2]-je.g[2]],He=[0,0,0],J=Oe.e;J!==Oe;J=J.e)He[0]=J.g[0]-je.g[0],He[1]=J.g[1]-je.g[1],He[2]=J.g[2]-je.g[2],We[0]=Fe[1]*He[2]-Fe[2]*He[1],We[1]=Fe[2]*He[0]-Fe[0]*He[2],We[2]=Fe[0]*He[1]-Fe[1]*He[0],de<(Je=We[0]*We[0]+We[1]*We[1]+We[2]*We[2])&&(de=Je,De[0]=We[0],De[1]=We[1],De[2]=We[2]);de<=0&&(De[0]=De[1]=De[2]=0,De[O(Fe)]=1)}Oe=!0}for(We=O(De),J=this.b.c,de=(We+1)%3,je=(We+2)%3,We=0>=1;)++g;if(x=1<>8&255,u[d++]=255&h,u[d++]=h>>8&255,u[d++]=(y!==null?128:0)|g,u[d++]=b,u[d++]=0,y!==null)for(var v=0,w=y.length;v>16&255,u[d++]=_>>8&255,u[d++]=255&_}if(m!==null){if(m<0||65535>8&255,u[d++]=0}var E=!1;this.addFrame=function(S,T,k,A,O,R){if(E===!0&&(--d,E=!1),R=R===void 0?{}:R,S<0||T<0||65535>=1;)++F;var z=1<>8&255,u[d++]=K,u[d++]=0),u[d++]=44,u[d++]=255&S,u[d++]=S>>8&255,u[d++]=255&T,u[d++]=T>>8&255,u[d++]=255&k,u[d++]=k>>8&255,u[d++]=255&A,u[d++]=A>>8&255,u[d++]=C===!0?128|F-1:0,C===!0)for(var Z=0,U=L.length;Z>16&255,u[d++]=I>>8&255,u[d++]=255&I}return d=function(B,H,Y,ee){B[H++]=Y;var oe=H++,ce=1<>=8,ne-=8,H===oe+256&&(B[oe]=255,oe=H++)}function Ee(ze){fe|=ze<>=8,ne-=8,H===oe+256&&(B[oe]=255,oe=H++);te===4096?(Ee(ce),te=1+ae,pe=Y+1,se={}):(1<>=g,x-=g,T==m)p=1+y,b=(1<<(g=d+1))-1,S=null;else{if(T==y)break;for(var k=T>8,++A;var R=O;if(f>=8;S!==null&&p<4096&&(E[p++]=S<<8|R,b+1<=p&&g<12&&(++g,b=b<<1|1)),S=T}}w!==f&&console.log("Warning, gif stream shorter than expected.")}try{a.GifWriter=s,a.GifReader=function(u){var c=0;if(u[c++]!==71||u[c++]!==73||u[c++]!==70||u[c++]!==56||(u[c++]+1&253)!=56||u[c++]!==97)throw new Error("Invalid GIF 87a/89a header.");var h=u[c++]|u[c++]<<8,f=u[c++]|u[c++]<<8,d=u[c++],m=1<<1+(7&d),y=(u[c++],u[c++],null),p=null,g=(d>>7&&(y=c,c+=3*(p=m)),!0),b=[],x=0,v=null,w=0,_=null;for(this.width=h,this.height=f;g&&c>2&7,c++;break;case 254:for(;;){if(!(0<=(S=u[c++])))throw Error("Invalid block size");if(S===0)break;c+=S}break;default:throw new Error("Unknown graphic control label: 0x"+u[c-1].toString(16))}break;case 44:var S,T=u[c++]|u[c++]<<8,k=u[c++]|u[c++]<<8,A=u[c++]|u[c++]<<8,O=u[c++]|u[c++]<<8,W=u[c++],R=W>>6&1,C=1<<1+(7&W),L=y,F=p,z=!1,W=(W>>7&&(z=!0,L=c,c+=3*(F=C)),c);for(c++;;){if(!(0<=(S=u[c++])))throw Error("Invalid block size");if(S===0)break;c+=S}b.push({x:T,y:k,width:A,height:O,has_local_palette:z,palette_offset:L,palette_size:F,data_offset:W,data_length:c-W,transparent_index:v,interlaced:!!R,delay:x,disposal:w});break;case 59:g=!1;break;default:throw new Error("Unknown gif block: 0x"+u[c-1].toString(16))}this.numFrames=function(){return b.length},this.loopCount=function(){return _},this.frameInfo=function($){if($<0||$>=b.length)throw new Error("Frame index out of range.");return b[$]},this.decodeAndBlitFrameBGRA=function($,G){for(var $=this.frameInfo($),K=$.width*$.height,Z=new Uint8Array(K),U=(l(u,$.data_offset,Z,K),$.palette_offset),I=$.transparent_index,B=(I===null&&(I=256),$.width),H=h-B,Y=B,ee=4*($.y*h+$.x),oe=4*(($.y+$.height)*h+$.x),ce=ee,he=4*H,ae=($.interlaced===!0&&(he+=4*h*7),8),te=0,pe=Z.length;te>=1)),be===I?ce+=4:(ne=u[U+3*be],fe=u[U+3*be+1],be=u[U+3*be+2],G[ce++]=be,G[ce++]=fe,G[ce++]=ne,G[ce++]=255),--Y}},this.decodeAndBlitFrameRGBA=function($,G){for(var $=this.frameInfo($),K=$.width*$.height,Z=new Uint8Array(K),U=(l(u,$.data_offset,Z,K),$.palette_offset),I=$.transparent_index,B=(I===null&&(I=256),$.width),H=h-B,Y=B,ee=4*($.y*h+$.x),oe=4*(($.y+$.height)*h+$.x),ce=ee,he=4*H,ae=($.interlaced===!0&&(he+=4*h*7),8),te=0,pe=Z.length;te>=1)),be===I?ce+=4:(ne=u[U+3*be],fe=u[U+3*be+1],be=u[U+3*be+2],G[ce++]=ne,G[ce++]=fe,G[ce++]=be,G[ce++]=255),--Y}}}}catch{}},{}],249:[function(n,i,a){(function(s){var l,u;l=this,u=function(c){function h(V){if(this==null)throw TypeError();var P,M=String(this),N=M.length,V=V?Number(V):0;if(!((V=V!=V?0:V)<0||N<=V))return 55296<=(P=M.charCodeAt(V))&&P<=56319&&V+1>>16-P;return j.tag>>>=P,j.bitcount-=P,N+M}function C(j,P){for(;j.bitcount<24;)j.tag|=j.source[j.sourceIndex++]<>>=1,M+=P.table[++V],0<=(N-=P.table[V]););return j.tag=X,j.bitcount-=V,P.trans[M+N]}function L(j,P,M){for(;;){var N=C(j,P);if(N===256)return d;if(N<256)j.dest[j.destLen++]=N;else for(var V,X=R(j,x[N-=257],v[N]),N=C(j,M),Q=V=j.destLen-R(j,w[N],_[N]);Q>>=1,N=V,R(X,2,0)){case 0:M=function(Ie){for(var pt,Et;8this.x2&&(this.x2=j)),typeof P=="number"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=P,this.y2=P),Pthis.y2&&(this.y2=P))},K.prototype.addX=function(j){this.addPoint(j,null)},K.prototype.addY=function(j){this.addPoint(null,j)},K.prototype.addBezier=function(j,P,M,N,V,X,Q,le){var ve=[j,P],ge=[M,N],Se=[V,X],Me=[Q,le];this.addPoint(j,P),this.addPoint(Q,le);for(var Ce=0;Ce<=1;Ce++){var xe,Ge=6*ve[Ce]-12*ge[Ce]+6*Se[Ce],Le=-3*ve[Ce]+9*ge[Ce]-9*Se[Ce]+3*Me[Ce],Ue=3*ge[Ce]-3*ve[Ce];Le==0?Ge==0||0<(xe=-Ue/Ge)&&xe<1&&(Ce===0&&this.addX(G(ve[Ce],ge[Ce],Se[Ce],Me[Ce],xe)),Ce===1&&this.addY(G(ve[Ce],ge[Ce],Se[Ce],Me[Ce],xe))):(xe=Math.pow(Ge,2)-4*Ue*Le)<0||(0<(Ue=(-Ge+Math.sqrt(xe))/(2*Le))&&Ue<1&&(Ce===0&&this.addX(G(ve[Ce],ge[Ce],Se[Ce],Me[Ce],Ue)),Ce===1&&this.addY(G(ve[Ce],ge[Ce],Se[Ce],Me[Ce],Ue))),0<(Ue=(-Ge-Math.sqrt(xe))/(2*Le))&&Ue<1&&(Ce===0&&this.addX(G(ve[Ce],ge[Ce],Se[Ce],Me[Ce],Ue)),Ce===1&&this.addY(G(ve[Ce],ge[Ce],Se[Ce],Me[Ce],Ue))))}},K.prototype.addQuad=function(j,P,M,N,V,X){M=j+2/3*(M-j),N=P+2/3*(N-P),this.addBezier(j,P,M,N,M+1/3*(V-j),N+1/3*(X-P),V,X)},Z.prototype.moveTo=function(j,P){this.commands.push({type:"M",x:j,y:P})},Z.prototype.lineTo=function(j,P){this.commands.push({type:"L",x:j,y:P})},Z.prototype.curveTo=Z.prototype.bezierCurveTo=function(j,P,M,N,V,X){this.commands.push({type:"C",x1:j,y1:P,x2:M,y2:N,x:V,y:X})},Z.prototype.quadTo=Z.prototype.quadraticCurveTo=function(j,P,M,N){this.commands.push({type:"Q",x1:j,y1:P,x:M,y:N})},Z.prototype.close=Z.prototype.closePath=function(){this.commands.push({type:"Z"})},Z.prototype.extend=function(j){var P;if(j.commands)j=j.commands;else if(j instanceof K)return P=j,this.moveTo(P.x1,P.y1),this.lineTo(P.x2,P.y1),this.lineTo(P.x2,P.y2),this.lineTo(P.x1,P.y2),void this.close();Array.prototype.push.apply(this.commands,j)},Z.prototype.getBoundingBox=function(){for(var j=new K,P=0,M=0,N=0,V=0,X=0;X>8&255,255&j]},ee.USHORT=oe(2),Y.SHORT=function(j){return[(j=32768<=j?-(65536-j):j)>>8&255,255&j]},ee.SHORT=oe(2),Y.UINT24=function(j){return[j>>16&255,j>>8&255,255&j]},ee.UINT24=oe(3),Y.ULONG=function(j){return[j>>24&255,j>>16&255,j>>8&255,255&j]},ee.ULONG=oe(4),Y.LONG=function(j){return[(j=2147483648<=j?-(4294967296-j):j)>>24&255,j>>16&255,j>>8&255,255&j]},ee.LONG=oe(4),Y.FIXED=Y.ULONG,ee.FIXED=ee.ULONG,Y.FWORD=Y.SHORT,ee.FWORD=ee.SHORT,Y.UFWORD=Y.USHORT,ee.UFWORD=ee.USHORT,Y.LONGDATETIME=function(j){return[0,0,0,0,j>>24&255,j>>16&255,j>>8&255,255&j]},ee.LONGDATETIME=oe(8),Y.TAG=function(j){return B.argument(j.length===4,"Tag should be exactly 4 ASCII characters."),[j.charCodeAt(0),j.charCodeAt(1),j.charCodeAt(2),j.charCodeAt(3)]},ee.TAG=oe(4),Y.Card8=Y.BYTE,ee.Card8=ee.BYTE,Y.Card16=Y.USHORT,ee.Card16=ee.USHORT,Y.OffSize=Y.BYTE,ee.OffSize=ee.BYTE,Y.SID=Y.USHORT,ee.SID=ee.USHORT,Y.NUMBER=function(j){return-107<=j&&j<=107?[j+139]:108<=j&&j<=1131?[247+((j-=108)>>8),255&j]:-1131<=j&&j<=-108?[251+((j=-j-108)>>8),255&j]:-32768<=j&&j<=32767?Y.NUMBER16(j):Y.NUMBER32(j)},ee.NUMBER=function(j){return Y.NUMBER(j).length},Y.NUMBER16=function(j){return[28,j>>8&255,255&j]},ee.NUMBER16=oe(3),Y.NUMBER32=function(j){return[29,j>>24&255,j>>16&255,j>>8&255,255&j]},ee.NUMBER32=oe(5),Y.REAL=function(j){for(var P=j.toString(),M=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(P),N=(M&&(M=parseFloat("1e"+((M[2]?+M[2]:0)+M[1].length)),P=(Math.round(j*M)/M).toString()),""),V=0,X=P.length;V>8&255,P[P.length]=255&N}return P},ee.UTF16=function(j){return 2*j.length};var ce,he={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"},ae=(H.MACSTRING=function(j,P,M,N){var V=he[N];if(V!==void 0){for(var X="",Q=0;Q>8&255,Ce+256&255)}return ge})(j,N,P);return P},Y.INDEX=function(j){for(var P=1,M=[P],N=[],V=0;V>8,P[Se+1]=255&Me,P=P.concat(N[ge])}return P},ee.TABLE=function(j){for(var P=0,M=j.fields.length,N=0;N>1,le.skip("uShort",3),Ue.glyphIndexMap={};for(var Et,yt=new ke.Parser(Re,Ie+pt+14),gt=new ke.Parser(Re,Ie+pt+16+2*Et),Mt=new ke.Parser(Re,Ie+pt+16+4*Et),hr=new ke.Parser(Re,Ie+pt+16+6*Et),Dr=Ie+pt+16+8*Et,Xr=0;Xr>4,Q=15&Q;if(X==15||(N+=V[X],Q==15))break;N+=V[Q]}return parseFloat(N)}if(32<=P&&P<=246)return P-139;if(247<=P&&P<=250)return 256*(P-247)+j.parseByte()+108;if(251<=P&&P<=254)return 256*-(P-251)-j.parseByte()-108;throw new Error("Invalid b0 "+P)}function kn(j,P,M){var N=new ke.Parser(j,P=P!==void 0?P:0),V=[],X=[];for(M=M!==void 0?M:j.length;N.relativeOffset>1,xe.length=0,Le=!0}return function gt(Mt){for(var hr,Dr,Xr,Pn,Cn,oi,cr,xr,er,An,Ar,wn,wr=0;wrMath.abs(wn-Ie)?Re=Ar+xe.shift():Ie=wn+xe.shift(),Ce.curveTo(N,V,X,Q,cr,xr),Ce.curveTo(er,An,Ar,wn,Re,Ie);break;default:console.log("Glyph "+P.index+": unknown operator 1200"+dn),xe.length=0}break;case 14:0>3;break;case 21:2>16),wr+=2;break;case 29:Cn=xe.pop()+j.gsubrsBias,(oi=j.gsubrs[Cn])&>(oi);break;case 30:for(;0=M.begin&&j=je.length&&(X=N.parseChar(),M.names.push(N.parseString(X)));break;case 2.5:M.numberOfGlyphs=N.parseUShort(),M.offset=new Array(M.numberOfGlyphs);for(var le=0;leMe.value.tag?1:-1}),P.fields=P.fields.concat(N),P.fields=P.fields.concat(V),P}function X2(j,P,M){for(var N=0;N 123 are reserved for internal usage");xe|=1<>>1,X=j[V].tag;if(X===P)return V;X>>1,X=j[V];if(X===P)return V;X>>1,Q=(V=j[X]).start;if(Q===P)return V;Q(V=j[M-1]).end?0:V}function Ip(j,P){this.font=j,this.tableName=P}function Np(j){Ip.call(this,j,"gpos")}function Pi(j){Ip.call(this,j,"gsub")}function Z2(j,P,M){for(var N=j.subtables,V=0;VP.points.length-1||N.matchedPoints[1]>V.points.length-1)throw Error("Matched points out of range in "+P.name);var Q=P.points[N.matchedPoints[0]],le=V.points[N.matchedPoints[1]],N={xScale:N.xScale,scale01:N.scale01,scale10:N.scale10,yScale:N.yScale,dx:0,dy:0},le=V0([le],N)[0];N.dx=Q.x-le.x,N.dy=Q.y-le.y,X=V0(V.points,N)}P.points=P.points.concat(X)}}return eE(P.points)}(Np.prototype=Ip.prototype={searchTag:z0,binSearch:Y2,getTable:function(j){var P=this.font.tables[this.tableName];return P=!P&&j?this.font.tables[this.tableName]=this.createDefaultTable():P},getScriptNames:function(){var j=this.getTable();return j?j.scripts.map(function(P){return P.tag}):[]},getDefaultScriptName:function(){var j=this.getTable();if(j){for(var P=!1,M=0;M=Q[P-1].tag,"Features must be added in alphabetical order."),Q.push(V={tag:M,feature:{params:0,lookupListIndexes:[]}}),X.push(P),V.feature}},getLookupTables:function(X,P,M,N,V){var X=this.getFeatureTable(X,P,M,V),Q=[];if(X){for(var le,ve=X.lookupListIndexes,ge=this.font.tables[this.tableName].lookups,Se=0;Se",X),P.stack.push(Math.round(64*X))}function W0(j,P){var M=P.stack,N=M.pop(),V=P.fv,X=P.pv,Q=P.ppem,le=P.deltaBase+16*(j-1),ve=P.deltaShift,ge=P.z0;c.DEBUG&&console.log(P.step,"DELTAP["+j+"]",N,M);for(var Se=0;Se>4)===Q&&(0<=(Ce=(15&Ce)-8)&&Ce++,c.DEBUG&&console.log(P.step,"DELTAPFIX",Me,"by",Ce*ve),Me=ge[Me],V.setRelative(Me,Me,Ce*ve,X))}}function Dp(j,P){var M=P.stack,N=M.pop();c.DEBUG&&console.log(P.step,"ROUND[]"),M.push(64*P.round(N/64))}function H0(j,P){var M=P.stack,N=M.pop(),V=P.ppem,X=P.deltaBase+16*(j-1),Q=P.deltaShift;c.DEBUG&&console.log(P.step,"DELTAC["+j+"]",N,M);for(var le=0;le>4)===V&&(0<=(ge=(15&ge)-8)&&ge++,ge=ge*Q,c.DEBUG&&console.log(P.step,"DELTACFIX",ve,"by",ge),P.cvt[ve]+=ge)}}function xE(j,P){var M,V=P.stack,N=V.pop(),V=V.pop(),X=P.z2[N],Q=P.z1[V];c.DEBUG&&console.log(P.step,"SDPVTL["+j+"]",N,V),N=j?(M=X.y-Q.y,Q.x-X.x):(M=Q.x-X.x,Q.y-X.y),P.dpv=Cd(M,N)}function Ha(j,P){var M=P.stack,N=P.prog,V=P.ip;c.DEBUG&&console.log(P.step,"PUSHB["+j+"]");for(var X=0;X":"_")+(N?"R":"_")+(V===0?"Gr":V===1?"Bl":V===2?"Wh":"")+"]",j?ve+"("+X.cvt[ve]+","+le+")":"",ge,"(d =",Q,"->",Ue*Le,")"),X.rp1=X.rp0,X.rp2=ge,P&&(X.rp0=ge)}rE.prototype.exec=function(j,P){if(typeof P!="number")throw new Error("Point size is not a number!");if(!(2",N),le.interpolate(Me,X,Q,ve),le.touch(Me)}j.loop=1},yE.bind(void 0,0),yE.bind(void 0,1),function(j){for(var P=j.stack,M=j.rp0,N=j.z0[M],V=j.loop,X=j.fv,Q=j.pv,le=j.z1;V--;){var ve=P.pop(),ge=le[ve];c.DEBUG&&console.log(j.step,(1"u"?Y6:K6)(j,function(M,N){if(M)return P(M);var V;try{V=q0(N)}catch(X){return P(X,null)}return P(null,V)})},c.loadSync=function(j){return q0(Q2(n("fs").readFileSync(j)))},Object.defineProperty(c,"__esModule",{value:!0})},u(typeof a=="object"&&i!==void 0?a:l.opentype={})}).call(this,n("buffer").Buffer)},{buffer:4,fs:2}],250:[function(n,i,a){(function(s){function l(h,f){for(var d=0,m=h.length-1;0<=m;m--){var y=h[m];y==="."?h.splice(m,1):y===".."?(h.splice(m,1),d++):d&&(h.splice(m,1),d--)}if(f)for(;d--;)h.unshift("..");return h}function u(h,f){if(h.filter)return h.filter(f);for(var d=[],m=0;m'.concat(x,"").concat(p,""),this.dummyDOM||(this.dummyDOM=document.getElementById(b).parentNode),this.descriptions?this.descriptions.fallbackElements||(this.descriptions.fallbackElements={}):this.descriptions={fallbackElements:{}},this.descriptions.fallbackElements[y]?this.descriptions.fallbackElements[y].innerHTML!==x&&(this.descriptions.fallbackElements[y].innerHTML=x):this._describeElementHTML("fallback",y,x),g===this.LABEL&&(this.descriptions.labelElements||(this.descriptions.labelElements={}),this.descriptions.labelElements[y]?this.descriptions.labelElements[y].innerHTML!==x&&(this.descriptions.labelElements[y].innerHTML=x):this._describeElementHTML("label",y,x)))},s.default.prototype._describeHTML=function(y,p){var g,b=this.canvas.id;y==="fallback"?(this.dummyDOM.querySelector("#".concat(b+l))?this.dummyDOM.querySelector("#"+b+c).insertAdjacentHTML("beforebegin",'

')):(g='

'),this.dummyDOM.querySelector("#".concat(b,"accessibleOutput"))?this.dummyDOM.querySelector("#".concat(b,"accessibleOutput")).insertAdjacentHTML("beforebegin",g):this.dummyDOM.querySelector("#".concat(b)).innerHTML=g),this.descriptions.fallback=this.dummyDOM.querySelector("#".concat(b).concat(u)),this.descriptions.fallback.innerHTML=p):y==="label"&&(this.dummyDOM.querySelector("#".concat(b+h))?this.dummyDOM.querySelector("#".concat(b+d))&&this.dummyDOM.querySelector("#".concat(b+d)).insertAdjacentHTML("beforebegin",'

')):(g='

'),this.dummyDOM.querySelector("#".concat(b,"accessibleOutputLabel"))?this.dummyDOM.querySelector("#".concat(b,"accessibleOutputLabel")).insertAdjacentHTML("beforebegin",g):this.dummyDOM.querySelector("#"+b).insertAdjacentHTML("afterend",g)),this.descriptions.label=this.dummyDOM.querySelector("#"+b+f),this.descriptions.label.innerHTML=p)},s.default.prototype._describeElementHTML=function(y,p,g){var b,x=this.canvas.id;y==="fallback"?(this.dummyDOM.querySelector("#".concat(x+l))?this.dummyDOM.querySelector("#"+x+c)||this.dummyDOM.querySelector("#"+x+u).insertAdjacentHTML("afterend",'
Canvas elements and their descriptions
')):(b='
Canvas elements and their descriptions
'),this.dummyDOM.querySelector("#".concat(x,"accessibleOutput"))?this.dummyDOM.querySelector("#".concat(x,"accessibleOutput")).insertAdjacentHTML("beforebegin",b):this.dummyDOM.querySelector("#"+x).innerHTML=b),(b=document.createElement("tr")).id=x+"_fte_"+p,this.dummyDOM.querySelector("#"+x+c).appendChild(b),this.descriptions.fallbackElements[p]=this.dummyDOM.querySelector("#".concat(x).concat("_fte_").concat(p)),this.descriptions.fallbackElements[p].innerHTML=g):y==="label"&&(this.dummyDOM.querySelector("#".concat(x+h))?this.dummyDOM.querySelector("#".concat(x+d))||this.dummyDOM.querySelector("#"+x+f).insertAdjacentHTML("afterend",'
')):(b='
'),this.dummyDOM.querySelector("#".concat(x,"accessibleOutputLabel"))?this.dummyDOM.querySelector("#".concat(x,"accessibleOutputLabel")).insertAdjacentHTML("beforebegin",b):this.dummyDOM.querySelector("#"+x).insertAdjacentHTML("afterend",b)),(y=document.createElement("tr")).id=x+"_lte_"+p,this.dummyDOM.querySelector("#"+x+d).appendChild(y),this.descriptions.labelElements[p]=this.dummyDOM.querySelector("#".concat(x).concat("_lte_").concat(p)),this.descriptions.labelElements[p].innerHTML=g)},n=s.default,a.default=n},{"../core/main":275,"core-js/modules/es.array.concat":151,"core-js/modules/es.regexp.exec":187,"core-js/modules/es.string.ends-with":190,"core-js/modules/es.string.replace":196}],256:[function(n,i,a){n("core-js/modules/es.array.concat"),n("core-js/modules/es.array.from"),n("core-js/modules/es.array.map"),n("core-js/modules/es.string.iterator"),n("core-js/modules/es.array.concat"),n("core-js/modules/es.array.from"),n("core-js/modules/es.array.map"),n("core-js/modules/es.string.iterator"),Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0,n=(n=n("../core/main"))&&n.__esModule?n:{default:n},n.default.prototype._updateGridOutput=function(s){var l,u,c,h;this.dummyDOM.querySelector("#".concat(s,"_summary"))&&(l=this._accessibleOutputs[s],c=function(f,d,m,y){return d="".concat(d," canvas, ").concat(m," by ").concat(y," pixels, contains ").concat(f[0]),d=(f[0]===1?"".concat(d," shape: "):"".concat(d," shapes: ")).concat(f[1]),d}((u=function(f,d){var m,y="",p="",g=0;for(m in d){var b,x=0;for(b in d[m]){var v='
  • ').concat(d[m][b].color," ").concat(m,",");m==="line"?v+=" location = ".concat(d[m][b].pos,", length = ").concat(d[m][b].length," pixels"):(v+=" location = ".concat(d[m][b].pos),m!=="point"&&(v+=", area = ".concat(d[m][b].area," %")),v+="
  • "),y+=v,x++,g++}p=1').concat(d[m][x].color," ").concat(m,"
    "):'').concat(d[m][x].color," ").concat(m," midpoint"),b[d[m][x].loc.locY][d[m][x].loc.locX]?b[d[m][x].loc.locY][d[m][x].loc.locX]=b[d[m][x].loc.locY][d[m][x].loc.locX]+" "+v:b[d[m][x].loc.locY][d[m][x].loc.locX]=v,p++}for(y in b){var w,_="";for(w in b[y])_+="",b[y][w]!==void 0&&(_+=b[y][w]),_+="";g=g+_+""}return g}(s,this.ingredients.shapes),c!==l.summary.innerHTML&&(l.summary.innerHTML=c),h!==l.map.innerHTML&&(l.map.innerHTML=h),u.details!==l.shapeDetails.innerHTML&&(l.shapeDetails.innerHTML=u.details),this._accessibleOutputs[s]=l)},n=n.default,a.default=n},{"../core/main":275,"core-js/modules/es.array.concat":151,"core-js/modules/es.array.from":158,"core-js/modules/es.array.map":164,"core-js/modules/es.string.iterator":192}],257:[function(n,i,a){n("core-js/modules/es.symbol"),n("core-js/modules/es.symbol.description"),n("core-js/modules/es.symbol.iterator"),n("core-js/modules/es.array.concat"),n("core-js/modules/es.array.fill"),n("core-js/modules/es.array.from"),n("core-js/modules/es.array.iterator"),n("core-js/modules/es.array.map"),n("core-js/modules/es.number.to-fixed"),n("core-js/modules/es.object.to-string"),n("core-js/modules/es.regexp.to-string"),n("core-js/modules/es.string.iterator"),n("core-js/modules/web.dom-collections.iterator"),n("core-js/modules/es.array.concat"),n("core-js/modules/es.array.fill"),n("core-js/modules/es.array.map"),n("core-js/modules/es.number.to-fixed"),Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var s=(n=n("../core/main"))&&n.__esModule?n:{default:n};function l(c){return function(h){if(Array.isArray(h)){for(var f=0,d=new Array(h.length);f')):this.dummyDOM.querySelector("#".concat(y)).innerHTML='
    '))):h==="Label"&&(f=y+c+(p=h),this.dummyDOM.querySelector("#".concat(d=y+"accessibleOutput"+h))||(this.dummyDOM.querySelector("#".concat(y,"_Label"))?this.dummyDOM.querySelector("#".concat(y,"_Label")):this.dummyDOM.querySelector("#".concat(y))).insertAdjacentHTML("afterend",'
    '))),this._accessibleOutputs[f]={},c==="textOutput"?(p="#".concat(y,"gridOutput").concat(p),m='
    Text Output

      '),this.dummyDOM.querySelector(p)?this.dummyDOM.querySelector(p).insertAdjacentHTML("beforebegin",m):this.dummyDOM.querySelector("#".concat(d)).innerHTML=m,this._accessibleOutputs[f].list=this.dummyDOM.querySelector("#".concat(f,"_list"))):c==="gridOutput"&&(p="#".concat(y,"textOutput").concat(p),m='
      Grid Output

        '),this.dummyDOM.querySelector(p)?this.dummyDOM.querySelector(p).insertAdjacentHTML("afterend",m):this.dummyDOM.querySelector("#".concat(d)).innerHTML=m,this._accessibleOutputs[f].map=this.dummyDOM.querySelector("#".concat(f,"_map"))),this._accessibleOutputs[f].shapeDetails=this.dummyDOM.querySelector("#".concat(f,"_shapeDetails")),this._accessibleOutputs[f].summary=this.dummyDOM.querySelector("#".concat(f,"_summary"))},s.default.prototype._updateAccsOutput=function(){var c=this.canvas.id;JSON.stringify(this.ingredients.shapes)!==this.ingredients.pShapes&&(this.ingredients.pShapes=JSON.stringify(this.ingredients.shapes),this._accessibleOutputs.text&&this._updateTextOutput(c+"textOutput"),this._accessibleOutputs.grid&&this._updateGridOutput(c+"gridOutput"),this._accessibleOutputs.textLabel&&this._updateTextOutput(c+"textOutputLabel"),this._accessibleOutputs.gridLabel&&this._updateGridOutput(c+"gridOutputLabel"))},s.default.prototype._accsBackground=function(c){this.ingredients.pShapes=JSON.stringify(this.ingredients.shapes),this.ingredients.shapes={},this.ingredients.colors.backgroundRGBA!==c&&(this.ingredients.colors.backgroundRGBA=c,this.ingredients.colors.background=this._rgbColorName(c))},s.default.prototype._accsCanvasColors=function(c,h){c==="fill"?this.ingredients.colors.fillRGBA!==h&&(this.ingredients.colors.fillRGBA=h,this.ingredients.colors.fill=this._rgbColorName(h)):c==="stroke"&&this.ingredients.colors.strokeRGBA!==h&&(this.ingredients.colors.strokeRGBA=h,this.ingredients.colors.stroke=this._rgbColorName(h))},s.default.prototype._accsOutput=function(c,h){c==="ellipse"&&h[2]===h[3]?c="circle":c==="rectangle"&&h[2]===h[3]&&(c="square");var f,d,m={},y=!0,p=function(b,x){var v;return b=b==="rectangle"||b==="ellipse"||b==="arc"||b==="circle"||b==="square"?(v=Math.round(x[0]+x[2]/2),Math.round(x[1]+x[3]/2)):b==="triangle"?(v=(x[0]+x[2]+x[4])/3,(x[1]+x[3]+x[5])/3):b==="quadrilateral"?(v=(x[0]+x[2]+x[4]+x[6])/4,(x[1]+x[3]+x[5]+x[7])/4):b==="line"?(v=(x[0]+x[2])/2,(x[1]+x[3])/2):(v=x[0],x[1]),[v,b]}(c,h);if(c==="line"?(m.color=this.ingredients.colors.stroke,m.length=Math.round(this.dist(h[0],h[1],h[2],h[3])),f=this._getPos(h[0],[1]),d=this._getPos(h[2],[3]),m.loc=u(p,this.width,this.height),m.pos=f===d?"at ".concat(f):"from ".concat(f," to ").concat(d)):(c==="point"?m.color=this.ingredients.colors.stroke:(m.color=this.ingredients.colors.fill,m.area=this._getArea(c,h)),m.pos=this._getPos.apply(this,l(p)),m.loc=u(p,this.width,this.height)),this.ingredients.shapes[c]){if(this.ingredients.shapes[c]!==[m]){for(var g in this.ingredients.shapes[c])JSON.stringify(this.ingredients.shapes[c][g])===JSON.stringify(m)&&(y=!1);y===!0&&this.ingredients.shapes[c].push(m)}}else this.ingredients.shapes[c]=[m]},s.default.prototype._getPos=function(d,f){var d=new DOMPointReadOnly(d,f),f=this._renderer.isP3D?new DOMMatrix(this._renderer.uMVMatrix.mat4):this.drawingContext.getTransform(),d=d.matrixTransform(f),f=d.x,d=d.y,m=this.width,y=this.height;return f<.4*m?d<.4*y?"top left":.6*yMath.PI?m+=d:m-=d)):c==="ellipse"||c==="circle"?m=3.14*h[2]/2*h[3]/2:c==="line"||c==="point"?m=0:c==="quadrilateral"?m=Math.abs((h[6]+h[0])*(h[7]-h[1])+(h[0]+h[2])*(h[1]-h[3])+(h[2]+h[4])*(h[3]-h[5])+(h[4]+h[6])*(h[5]-h[7]))/2:c==="rectangle"||c==="square"?m=h[2]*h[3]:c==="triangle"&&(m=Math.abs(h[0]*(h[3]-h[5])+h[2]*(h[5]-h[1])+h[4]*(h[1]-h[3]))/2),this.width*this._pixelDensity),p=this.height*this._pixelDensity,g=[new DOMPoint(0,0),new DOMPoint(y,0),new DOMPoint(y,p),new DOMPoint(0,p)],b=(this._renderer.isP3D?new DOMMatrix(this._renderer.uMVMatrix.mat4):this.drawingContext.getTransform()).inverse(),x=g.map(function(w){return w.matrixTransform(b)}),v=Math.abs((x[3].x+x[0].x)*(x[3].y-x[0].y)+(x[0].x+x[1].x)*(x[0].y-x[1].y)+(x[1].x+x[2].x)*(x[1].y-x[2].y)+(x[2].x+x[3].x)*(x[2].y-x[3].y))/2;return Math.round(100*m/v)},n=s.default,a.default=n},{"../core/main":275,"core-js/modules/es.array.concat":151,"core-js/modules/es.array.fill":154,"core-js/modules/es.array.from":158,"core-js/modules/es.array.iterator":161,"core-js/modules/es.array.map":164,"core-js/modules/es.number.to-fixed":175,"core-js/modules/es.object.to-string":182,"core-js/modules/es.regexp.to-string":188,"core-js/modules/es.string.iterator":192,"core-js/modules/es.symbol":204,"core-js/modules/es.symbol.description":202,"core-js/modules/es.symbol.iterator":203,"core-js/modules/web.dom-collections.iterator":238}],258:[function(n,i,a){n("core-js/modules/es.array.concat"),n("core-js/modules/es.array.concat"),Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0,n=(n=n("../core/main"))&&n.__esModule?n:{default:n},n.default.prototype._updateTextOutput=function(s){var l,u,c,h;this.dummyDOM.querySelector("#".concat(s,"_summary"))&&(l=this._accessibleOutputs[s],c=function(f,d,m,y){return m="Your output is a, ".concat(m," by ").concat(y," pixels, ").concat(d," canvas containing the following"),m=f===1?"".concat(m," shape:"):"".concat(m," ").concat(f," shapes:"),m}((u=function(f,d){var m,y="",p=0;for(m in d)for(var g in d[m]){var b='
      • ').concat(d[m][g].color," ").concat(m,"");m==="line"?b+=", ".concat(d[m][g].pos,", ").concat(d[m][g].length," pixels long.
      • "):(b+=", at ".concat(d[m][g].pos),m!=="point"&&(b+=", covering ".concat(d[m][g].area,"% of the canvas")),b+="."),y+=b,p++}return{numShapes:p,listShapes:y}}(s,this.ingredients.shapes)).numShapes,this.ingredients.colors.background,this.width,this.height),h=function(f,d){var m,y="",p=0;for(m in d)for(var g in d[m]){var b='').concat(d[m][g].color," ").concat(m,"");m==="line"?b+="location = ".concat(d[m][g].pos,"length = ").concat(d[m][g].length," pixels"):(b+="location = ".concat(d[m][g].pos,""),m!=="point"&&(b+=" area = ".concat(d[m][g].area,"%")),b+=""),y+=b,p++}return y}(s,this.ingredients.shapes),c!==l.summary.innerHTML&&(l.summary.innerHTML=c),u.listShapes!==l.list.innerHTML&&(l.list.innerHTML=u.listShapes),h!==l.shapeDetails.innerHTML&&(l.shapeDetails.innerHTML=h),this._accessibleOutputs[s]=l)},n=n.default,a.default=n},{"../core/main":275,"core-js/modules/es.array.concat":151}],259:[function(n,i,a){var s=(s=n("./core/main"))&&s.__esModule?s:{default:s};n("./core/constants"),n("./core/environment"),n("./core/friendly_errors/stacktrace"),n("./core/friendly_errors/validate_params"),n("./core/friendly_errors/file_errors"),n("./core/friendly_errors/fes_core"),n("./core/friendly_errors/sketch_reader"),n("./core/helpers"),n("./core/legacy"),n("./core/preload"),n("./core/p5.Element"),n("./core/p5.Graphics"),n("./core/p5.Renderer"),n("./core/p5.Renderer2D"),n("./core/rendering"),n("./core/shim"),n("./core/structure"),n("./core/transform"),n("./core/shape/2d_primitives"),n("./core/shape/attributes"),n("./core/shape/curves"),n("./core/shape/vertex"),n("./accessibility/outputs"),n("./accessibility/textOutput"),n("./accessibility/gridOutput"),n("./accessibility/color_namer"),n("./color/color_conversion"),n("./color/creating_reading"),n("./color/p5.Color"),n("./color/setting"),n("./data/p5.TypedDict"),n("./data/local_storage.js"),n("./dom/dom"),n("./accessibility/describe"),n("./events/acceleration"),n("./events/keyboard"),n("./events/mouse"),n("./events/touch"),n("./image/filters"),n("./image/image"),n("./image/loading_displaying"),n("./image/p5.Image"),n("./image/pixels"),n("./io/files"),n("./io/p5.Table"),n("./io/p5.TableRow"),n("./io/p5.XML"),n("./math/calculation"),n("./math/math"),n("./math/noise"),n("./math/p5.Vector"),n("./math/random"),n("./math/trigonometry"),n("./typography/attributes"),n("./typography/loading_displaying"),n("./typography/p5.Font"),n("./utilities/array_functions"),n("./utilities/conversion"),n("./utilities/string_functions"),n("./utilities/time_date"),n("./webgl/3d_primitives"),n("./webgl/interaction"),n("./webgl/light"),n("./webgl/loading"),n("./webgl/material"),n("./webgl/p5.Camera"),n("./webgl/p5.DataArray"),n("./webgl/p5.Geometry"),n("./webgl/p5.Matrix"),n("./webgl/p5.RendererGL.Immediate"),n("./webgl/p5.RendererGL"),n("./webgl/p5.RendererGL.Retained"),n("./webgl/p5.Framebuffer"),n("./webgl/p5.Shader"),n("./webgl/p5.RenderBuffer"),n("./webgl/p5.Texture"),n("./webgl/text"),n("./core/init"),i.exports=s.default},{"./accessibility/color_namer":254,"./accessibility/describe":255,"./accessibility/gridOutput":256,"./accessibility/outputs":257,"./accessibility/textOutput":258,"./color/color_conversion":260,"./color/creating_reading":261,"./color/p5.Color":262,"./color/setting":263,"./core/constants":264,"./core/environment":265,"./core/friendly_errors/fes_core":266,"./core/friendly_errors/file_errors":267,"./core/friendly_errors/sketch_reader":268,"./core/friendly_errors/stacktrace":269,"./core/friendly_errors/validate_params":270,"./core/helpers":271,"./core/init":272,"./core/legacy":274,"./core/main":275,"./core/p5.Element":276,"./core/p5.Graphics":277,"./core/p5.Renderer":278,"./core/p5.Renderer2D":279,"./core/preload":280,"./core/rendering":281,"./core/shape/2d_primitives":282,"./core/shape/attributes":283,"./core/shape/curves":284,"./core/shape/vertex":285,"./core/shim":286,"./core/structure":287,"./core/transform":288,"./data/local_storage.js":289,"./data/p5.TypedDict":290,"./dom/dom":291,"./events/acceleration":292,"./events/keyboard":293,"./events/mouse":294,"./events/touch":295,"./image/filters":296,"./image/image":297,"./image/loading_displaying":298,"./image/p5.Image":299,"./image/pixels":300,"./io/files":301,"./io/p5.Table":302,"./io/p5.TableRow":303,"./io/p5.XML":304,"./math/calculation":305,"./math/math":306,"./math/noise":307,"./math/p5.Vector":308,"./math/random":309,"./math/trigonometry":310,"./typography/attributes":311,"./typography/loading_displaying":312,"./typography/p5.Font":313,"./utilities/array_functions":314,"./utilities/conversion":315,"./utilities/string_functions":316,"./utilities/time_date":317,"./webgl/3d_primitives":318,"./webgl/interaction":320,"./webgl/light":321,"./webgl/loading":322,"./webgl/material":323,"./webgl/p5.Camera":324,"./webgl/p5.DataArray":325,"./webgl/p5.Framebuffer":326,"./webgl/p5.Geometry":327,"./webgl/p5.Matrix":328,"./webgl/p5.RenderBuffer":329,"./webgl/p5.RendererGL":332,"./webgl/p5.RendererGL.Immediate":330,"./webgl/p5.RendererGL.Retained":331,"./webgl/p5.Shader":333,"./webgl/p5.Texture":334,"./webgl/text":335}],260:[function(n,i,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0,n=(n=n("../core/main"))&&n.__esModule?n:{default:n},n.default.ColorConversion={_hsbaToHSLA:function(s){var l=s[0],u=s[1],c=s[2],h=(2-u)*c/2;return h!=0&&(h==1?u=0:h<.5?u/=2-u:u=u*c/(2-2*h)),[l,u,h,s[3]]},_hsbaToRGBA:function(s){var l,u,c,h,f,d=6*s[0],m=s[1],y=s[2];return m===0?[y,y,y,s[3]]:(u=y*(1-m),c=y*(1-m*(d-(l=Math.floor(d)))),m=y*(1-m*(1+l-d)),d=l===1?(h=c,f=y,u):l===2?(h=u,f=y,m):l===3?(h=u,f=c,y):l===4?(h=m,f=u,y):l===5?(h=y,f=u,c):(h=y,f=m,u),[h,f,d,s[3]])},_hslaToHSBA:function(s){var l=s[0],u=s[1],c=s[2],h=c<.5?(1+u)*c:c+u-c*u;return[l,u=2*(h-c)/h,h,s[3]]},_hslaToRGBA:function(s){var l,u=6*s[0],c=s[1],h=s[2];return c===0?[h,h,h,s[3]]:[(l=function(f,d,m){return f<0?f+=6:6<=f&&(f-=6),f<1?d+(m-d)*f:f<3?m:f<4?d+(m-d)*(4-f):d})(2+u,c=2*h-(h=h<.5?(1+c)*h:h+c-h*c),h),l(u,c,h),l(u-2,c,h),s[3]]},_rgbaToHSBA:function(s){var l,u,c=s[0],h=s[1],f=s[2],d=Math.max(c,h,f),m=d-Math.min(c,h,f);return m==0?u=l=0:(u=m/d,c===d?l=(h-f)/m:h===d?l=2+(f-c)/m:f===d&&(l=4+(c-h)/m),l<0?l+=6:6<=l&&(l-=6)),[l/6,u,d,s[3]]},_rgbaToHSLA:function(s){var l,u,c=s[0],h=s[1],f=s[2],d=Math.max(c,h,f),y=Math.min(c,h,f),m=d+y,y=d-y;return y==0?u=l=0:(u=m<1?y/m:y/(2-m),c===d?l=(h-f)/y:h===d?l=2+(f-c)/y:f===d&&(l=4+(c-h)/y),l<0?l+=6:6<=l&&(l-=6)),[l/6,u,m/2,s[3]]}},n=n.default.ColorConversion,a.default=n},{"../core/main":275}],261:[function(n,i,a){function s(d){return(s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m})(d)}function l(d){return(l=typeof Symbol=="function"&&s(Symbol.iterator)==="symbol"?function(m){return s(m)}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":s(m)})(d)}n("core-js/modules/es.symbol"),n("core-js/modules/es.symbol.description"),n("core-js/modules/es.symbol.iterator"),n("core-js/modules/es.array.iterator"),n("core-js/modules/es.array.map"),n("core-js/modules/es.object.get-own-property-descriptor"),n("core-js/modules/es.object.to-string"),n("core-js/modules/es.string.iterator"),n("core-js/modules/es.weak-map"),n("core-js/modules/web.dom-collections.iterator"),n("core-js/modules/es.array.map"),Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var u=(f=n("../core/main"))&&f.__esModule?f:{default:f},c=function(d){if(d&&d.__esModule)return d;if(d===null||l(d)!=="object"&&typeof d!="function")return{default:d};var m=h();if(m&&m.has(d))return m.get(d);var y,p={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(y in d){var b;Object.prototype.hasOwnProperty.call(d,y)&&((b=g?Object.getOwnPropertyDescriptor(d,y):null)&&(b.get||b.set)?Object.defineProperty(p,y,b):p[y]=d[y])}return p.default=d,m&&m.set(d,p),p}(n("../core/constants"));function h(){var d;return typeof WeakMap!="function"?null:(d=new WeakMap,h=function(){return d},d)}n("./p5.Color"),n("../core/friendly_errors/validate_params"),n("../core/friendly_errors/file_errors"),n("../core/friendly_errors/fes_core"),u.default.prototype.alpha=function(d){return u.default._validateParameters("alpha",arguments),this.color(d)._getAlpha()},u.default.prototype.blue=function(d){return u.default._validateParameters("blue",arguments),this.color(d)._getBlue()},u.default.prototype.brightness=function(d){return u.default._validateParameters("brightness",arguments),this.color(d)._getBrightness()},u.default.prototype.color=function(){var d;return u.default._validateParameters("color",arguments),arguments[0]instanceof u.default.Color?arguments[0]:(d=arguments[0]instanceof Array?arguments[0]:arguments,new u.default.Color(this,d))},u.default.prototype.green=function(d){return u.default._validateParameters("green",arguments),this.color(d)._getGreen()},u.default.prototype.hue=function(d){return u.default._validateParameters("hue",arguments),this.color(d)._getHue()},u.default.prototype.lerpColor=function(d,m,y){u.default._validateParameters("lerpColor",arguments);var p,g,b,x=this._colorMode,v=this._colorMaxes;if(x===c.RGB)g=d.levels.map(function(w){return w/255}),b=m.levels.map(function(w){return w/255});else if(x===c.HSB)d._getBrightness(),m._getBrightness(),g=d.hsba,b=m.hsba;else{if(x!==c.HSL)throw new Error("".concat(x,"cannot be used for interpolation."));d._getLightness(),m._getLightness(),g=d.hsla,b=m.hsla}return y=Math.max(Math.min(y,1),0),this.lerp===void 0&&(this.lerp=function(w,_,E){return E*(_-w)+w}),d=this.lerp(g[0],b[0],y),m=this.lerp(g[1],b[1],y),p=this.lerp(g[2],b[2],y),g=this.lerp(g[3],b[3],y),d*=v[x][0],m*=v[x][1],p*=v[x][2],g*=v[x][3],this.color(d,m,p,g)},u.default.prototype.lightness=function(d){return u.default._validateParameters("lightness",arguments),this.color(d)._getLightness()},u.default.prototype.red=function(d){return u.default._validateParameters("red",arguments),this.color(d)._getRed()},u.default.prototype.saturation=function(d){return u.default._validateParameters("saturation",arguments),this.color(d)._getSaturation()};var f=u.default;a.default=f},{"../core/constants":264,"../core/friendly_errors/fes_core":266,"../core/friendly_errors/file_errors":267,"../core/friendly_errors/validate_params":270,"../core/main":275,"./p5.Color":262,"core-js/modules/es.array.iterator":161,"core-js/modules/es.array.map":164,"core-js/modules/es.object.get-own-property-descriptor":178,"core-js/modules/es.object.to-string":182,"core-js/modules/es.string.iterator":192,"core-js/modules/es.symbol":204,"core-js/modules/es.symbol.description":202,"core-js/modules/es.symbol.iterator":203,"core-js/modules/es.weak-map":236,"core-js/modules/web.dom-collections.iterator":238}],262:[function(p,i,a){function s(w){return(s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(_){return typeof _}:function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _})(w)}function l(w){return(l=typeof Symbol=="function"&&s(Symbol.iterator)==="symbol"?function(_){return s(_)}:function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":s(_)})(w)}p("core-js/modules/es.symbol"),p("core-js/modules/es.symbol.description"),p("core-js/modules/es.symbol.iterator"),p("core-js/modules/es.array.includes"),p("core-js/modules/es.array.iterator"),p("core-js/modules/es.array.join"),p("core-js/modules/es.array.map"),p("core-js/modules/es.array.slice"),p("core-js/modules/es.object.get-own-property-descriptor"),p("core-js/modules/es.object.to-string"),p("core-js/modules/es.regexp.constructor"),p("core-js/modules/es.regexp.exec"),p("core-js/modules/es.regexp.to-string"),p("core-js/modules/es.string.includes"),p("core-js/modules/es.string.iterator"),p("core-js/modules/es.string.trim"),p("core-js/modules/es.weak-map"),p("core-js/modules/web.dom-collections.iterator"),p("core-js/modules/es.array.includes"),p("core-js/modules/es.array.join"),p("core-js/modules/es.array.map"),p("core-js/modules/es.array.slice"),p("core-js/modules/es.object.to-string"),p("core-js/modules/es.regexp.constructor"),p("core-js/modules/es.regexp.exec"),p("core-js/modules/es.regexp.to-string"),p("core-js/modules/es.string.includes"),p("core-js/modules/es.string.trim"),Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var u=d(p("../core/main")),c=function(w){if(w&&w.__esModule)return w;if(w===null||l(w)!=="object"&&typeof w!="function")return{default:w};var _=f();if(_&&_.has(w))return _.get(w);var E,S={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(E in w){var k;Object.prototype.hasOwnProperty.call(w,E)&&((k=T?Object.getOwnPropertyDescriptor(w,E):null)&&(k.get||k.set)?Object.defineProperty(S,E,k):S[E]=w[E])}return S.default=w,_&&_.set(w,S),S}(p("../core/constants")),h=d(p("./color_conversion"));function f(){var w;return typeof WeakMap!="function"?null:(w=new WeakMap,f=function(){return w},w)}function d(w){return w&&w.__esModule?w:{default:w}}function m(w,_){for(var E=0;E<_.length;E++){var S=_[E];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(w,S.key,S)}}var y={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},p=/\s*/,v=/(\d{1,3})/,g=/((?:\d+(?:\.\d+)?)|(?:\.\d+))/,b=new RegExp("".concat(g.source,"%")),x={HEX3:/^#([a-f0-9])([a-f0-9])([a-f0-9])$/i,HEX4:/^#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])$/i,HEX6:/^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i,HEX8:/^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i,RGB:new RegExp(["^rgb\\(",v.source,",",v.source,",",v.source,"\\)$"].join(p.source),"i"),RGB_PERCENT:new RegExp(["^rgb\\(",b.source,",",b.source,",",b.source,"\\)$"].join(p.source),"i"),RGBA:new RegExp(["^rgba\\(",v.source,",",v.source,",",v.source,",",g.source,"\\)$"].join(p.source),"i"),RGBA_PERCENT:new RegExp(["^rgba\\(",b.source,",",b.source,",",b.source,",",g.source,"\\)$"].join(p.source),"i"),HSL:new RegExp(["^hsl\\(",v.source,",",b.source,",",b.source,"\\)$"].join(p.source),"i"),HSLA:new RegExp(["^hsla\\(",v.source,",",b.source,",",b.source,",",g.source,"\\)$"].join(p.source),"i"),HSB:new RegExp(["^hsb\\(",v.source,",",b.source,",",b.source,"\\)$"].join(p.source),"i"),HSBA:new RegExp(["^hsba\\(",v.source,",",b.source,",",b.source,",",g.source,"\\)$"].join(p.source),"i")},v=(u.default.Color=function(){function w(T,k){if(!(this instanceof w))throw new TypeError("Cannot call a class as a function");if(this._storeModeAndMaxes(T._colorMode,T._colorMaxes),![c.RGB,c.HSL,c.HSB].includes(this.mode))throw new Error("".concat(this.mode," is an invalid colorMode."));this._array=w._parseInputs.apply(this,k),this._calculateLevels()}var _,E,S;return _=w,S=[{key:"_parseInputs",value:function(T,k,A,O){var R,C=arguments.length,L=this.mode,F=this.maxes[L],z=[];if(3<=C){for(z[0]=T/F[0],z[1]=k/F[1],z[2]=A/F[2],z[3]=typeof O=="number"?O/F[3]:1,R=z.length-1;0<=R;--R){var W=z[R];W<0?z[R]=0:1"].indexOf(m[0])?void 0:m[0],lineNumber:m[1],columnNumber:m[2],source:f}},this)},parseFFOrSafari:function(h){return h.stack.split(` `).filter(function(f){return!f.match(c)},this).map(function(f){var d,m;return(f=-1 eval")?f.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1"):f).indexOf("@")===-1&&f.indexOf(":")===-1?{functionName:f}:{functionName:(m=f.match(d=/((.*".+"[^@]*)?[^@]*)(?:@)/))&&m[1]?m[1]:void 0,fileName:(m=this.extractLocation(f.replace(d,"")))[0],lineNumber:m[1],columnNumber:m[2],source:f}},this)},parseOpera:function(h){return!h.stacktrace||-1h.stacktrace.split(` `).length?this.parseOpera9(h):h.stack?this.parseOpera11(h):this.parseOpera10(h)},parseOpera9:function(h){for(var f=/Line (\d+).*script (?:in )?(\S+)/i,d=h.message.split(` `),m=[],y=2,p=d.length;y/,"$2").replace(/\([^)]*\)/g,"")||void 0,args:(d=y.match(/\(([^)]*)\)/)?y.replace(/^[^(]+\(([^)]*)\)$/,"$1"):d)===void 0||d==="[arguments not available]"?void 0:d.split(","),fileName:m[0],lineNumber:m[1],columnNumber:m[2],source:f}},this)}}}n.default._getErrorStackParser=function(){return new s},n=n.default,a.default=n},{"../main":275,"core-js/modules/es.array.filter":155,"core-js/modules/es.array.index-of":160,"core-js/modules/es.array.join":162,"core-js/modules/es.array.map":164,"core-js/modules/es.array.slice":165,"core-js/modules/es.regexp.exec":187,"core-js/modules/es.string.match":193,"core-js/modules/es.string.replace":196,"core-js/modules/es.string.split":198}],270:[function(n,i,a){function s(h){return(s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f})(h)}n("core-js/modules/es.symbol"),n("core-js/modules/es.symbol.description"),n("core-js/modules/es.symbol.iterator"),n("core-js/modules/es.array.concat"),n("core-js/modules/es.array.for-each"),n("core-js/modules/es.array.includes"),n("core-js/modules/es.array.index-of"),n("core-js/modules/es.array.iterator"),n("core-js/modules/es.array.join"),n("core-js/modules/es.array.last-index-of"),n("core-js/modules/es.array.map"),n("core-js/modules/es.array.slice"),n("core-js/modules/es.function.name"),n("core-js/modules/es.map"),n("core-js/modules/es.number.constructor"),n("core-js/modules/es.object.get-own-property-descriptor"),n("core-js/modules/es.object.get-prototype-of"),n("core-js/modules/es.object.keys"),n("core-js/modules/es.object.to-string"),n("core-js/modules/es.reflect.construct"),n("core-js/modules/es.regexp.exec"),n("core-js/modules/es.regexp.to-string"),n("core-js/modules/es.set"),n("core-js/modules/es.string.includes"),n("core-js/modules/es.string.iterator"),n("core-js/modules/es.string.split"),n("core-js/modules/es.weak-map"),n("core-js/modules/web.dom-collections.for-each"),n("core-js/modules/web.dom-collections.iterator"),n("core-js/modules/es.symbol"),n("core-js/modules/es.symbol.description"),n("core-js/modules/es.symbol.iterator"),n("core-js/modules/es.array.concat"),n("core-js/modules/es.array.for-each"),n("core-js/modules/es.array.includes"),n("core-js/modules/es.array.iterator"),n("core-js/modules/es.array.join"),n("core-js/modules/es.array.last-index-of"),n("core-js/modules/es.array.map"),n("core-js/modules/es.array.slice"),n("core-js/modules/es.function.name"),n("core-js/modules/es.number.constructor"),n("core-js/modules/es.object.keys"),n("core-js/modules/es.object.to-string"),n("core-js/modules/es.regexp.exec"),n("core-js/modules/es.regexp.to-string"),n("core-js/modules/es.set"),n("core-js/modules/es.string.includes"),n("core-js/modules/es.string.iterator"),n("core-js/modules/es.string.split"),n("core-js/modules/web.dom-collections.for-each"),n("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var l=(l=n("../main"))&&l.__esModule?l:{default:l};(function(h){if(!(h&&h.__esModule)&&!(h===null||c(h)!=="object"&&typeof h!="function")){var f=u();if(f&&f.has(h))return f.get(h);var d,m={},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(d in h){var p;Object.prototype.hasOwnProperty.call(h,d)&&((p=y?Object.getOwnPropertyDescriptor(h,d):null)&&(p.get||p.set)?Object.defineProperty(m,d,p):m[d]=h[d])}m.default=h,f&&f.set(h,m)}})(n("../constants")),n("../internationalization");function u(){var h;return typeof WeakMap!="function"?null:(h=new WeakMap,u=function(){return h},h)}function c(h){return(c=typeof Symbol=="function"&&s(Symbol.iterator)==="symbol"?function(f){return s(f)}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":s(f)})(h)}l.default._validateParameters=l.default._clearValidateParamsCache=function(){},n=l.default,a.default=n},{"../../../docs/parameterData.json":void 0,"../constants":264,"../internationalization":273,"../main":275,"core-js/modules/es.array.concat":151,"core-js/modules/es.array.for-each":157,"core-js/modules/es.array.includes":159,"core-js/modules/es.array.index-of":160,"core-js/modules/es.array.iterator":161,"core-js/modules/es.array.join":162,"core-js/modules/es.array.last-index-of":163,"core-js/modules/es.array.map":164,"core-js/modules/es.array.slice":165,"core-js/modules/es.function.name":168,"core-js/modules/es.map":169,"core-js/modules/es.number.constructor":173,"core-js/modules/es.object.get-own-property-descriptor":178,"core-js/modules/es.object.get-prototype-of":180,"core-js/modules/es.object.keys":181,"core-js/modules/es.object.to-string":182,"core-js/modules/es.reflect.construct":184,"core-js/modules/es.regexp.exec":187,"core-js/modules/es.regexp.to-string":188,"core-js/modules/es.set":189,"core-js/modules/es.string.includes":191,"core-js/modules/es.string.iterator":192,"core-js/modules/es.string.split":198,"core-js/modules/es.symbol":204,"core-js/modules/es.symbol.description":202,"core-js/modules/es.symbol.iterator":203,"core-js/modules/es.weak-map":236,"core-js/modules/web.dom-collections.for-each":237,"core-js/modules/web.dom-collections.iterator":238}],271:[function(n,i,a){function s(h){return(s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f})(h)}function l(h){return(l=typeof Symbol=="function"&&s(Symbol.iterator)==="symbol"?function(f){return s(f)}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":s(f)})(h)}n("core-js/modules/es.symbol"),n("core-js/modules/es.symbol.description"),n("core-js/modules/es.symbol.iterator"),n("core-js/modules/es.array.iterator"),n("core-js/modules/es.object.get-own-property-descriptor"),n("core-js/modules/es.object.to-string"),n("core-js/modules/es.string.iterator"),n("core-js/modules/es.weak-map"),n("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var u=function(h){if(h&&h.__esModule)return h;if(h===null||l(h)!=="object"&&typeof h!="function")return{default:h};var f=c();if(f&&f.has(h))return f.get(h);var d,m={},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(d in h){var p;Object.prototype.hasOwnProperty.call(h,d)&&((p=y?Object.getOwnPropertyDescriptor(h,d):null)&&(p.get||p.set)?Object.defineProperty(m,d,p):m[d]=h[d])}return m.default=h,f&&f.set(h,m),m}(n("./constants"));function c(){var h;return typeof WeakMap!="function"?null:(h=new WeakMap,c=function(){return h},h)}a.default={modeAdjust:function(h,f,d,m,y){return y===u.CORNER?{x:h,y:f,w:d,h:m}:y===u.CORNERS?{x:h,y:f,w:d-h,h:m-f}:y===u.RADIUS?{x:h-d,y:f-m,w:2*d,h:2*m}:y===u.CENTER?{x:h-.5*d,y:f-.5*m,w:d,h:m}:void 0}}},{"./constants":264,"core-js/modules/es.array.iterator":161,"core-js/modules/es.object.get-own-property-descriptor":178,"core-js/modules/es.object.to-string":182,"core-js/modules/es.string.iterator":192,"core-js/modules/es.symbol":204,"core-js/modules/es.symbol.description":202,"core-js/modules/es.symbol.iterator":203,"core-js/modules/es.weak-map":236,"core-js/modules/web.dom-collections.iterator":238}],272:[function(n,i,a){n("core-js/modules/es.array.iterator"),n("core-js/modules/es.object.to-string"),n("core-js/modules/es.promise"),n("core-js/modules/es.string.iterator"),n("core-js/modules/web.dom-collections.iterator"),n("core-js/modules/es.array.iterator"),n("core-js/modules/es.object.to-string"),n("core-js/modules/es.promise"),n("core-js/modules/es.string.iterator"),n("core-js/modules/web.dom-collections.iterator");var s=(l=n("../core/main"))&&l.__esModule?l:{default:l};n("./internationalization");var l=Promise.resolve();Promise.all([new Promise(function(u,c){document.readyState==="complete"?u():window.addEventListener("load",u,!1)}),l]).then(function(){window._setupDone!==void 0?console.warn("p5.js seems to have been imported multiple times. Please remove the duplicate import"):window.mocha||(window.setup&&typeof window.setup=="function"||window.draw&&typeof window.draw=="function")&&!s.default.instance&&new s.default})},{"../core/main":275,"./internationalization":273,"core-js/modules/es.array.iterator":161,"core-js/modules/es.object.to-string":182,"core-js/modules/es.promise":183,"core-js/modules/es.string.iterator":192,"core-js/modules/web.dom-collections.iterator":238}],273:[function(n,i,a){n("core-js/modules/es.array.includes"),n("core-js/modules/es.array.iterator"),n("core-js/modules/es.array.join"),n("core-js/modules/es.array.slice"),n("core-js/modules/es.object.keys"),n("core-js/modules/es.object.to-string"),n("core-js/modules/es.promise"),n("core-js/modules/es.regexp.exec"),n("core-js/modules/es.string.includes"),n("core-js/modules/es.string.iterator"),n("core-js/modules/es.string.split"),n("core-js/modules/web.dom-collections.iterator"),n("core-js/modules/es.array.includes"),n("core-js/modules/es.array.iterator"),n("core-js/modules/es.array.join"),n("core-js/modules/es.array.slice"),n("core-js/modules/es.object.keys"),n("core-js/modules/es.object.to-string"),n("core-js/modules/es.promise"),n("core-js/modules/es.regexp.exec"),n("core-js/modules/es.string.includes"),n("core-js/modules/es.string.iterator"),n("core-js/modules/es.string.split"),n("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(a,"__esModule",{value:!0}),a.setTranslatorLanguage=a.currentTranslatorLanguage=a.availableTranslatorLanguages=a.initialize=a.translator=void 0;var s,l,u=h(n("i18next")),c=h(n("i18next-browser-languagedetector"));function h(m){return m&&m.__esModule?m:{default:m}}function f(m,y){for(var p=0;p=R.width||S>=R.height?[0,0,0,0]:this._getPixel(E,S);return A=new l.default.Image(T*O,k*O),A.pixelDensity(O),A.canvas.getContext("2d").drawImage(R,E,S,T*O,k*O,0,0,T*O,k*O),A}},{key:"textLeading",value:function(E){return typeof E=="number"?(this._setProperty("_leadingSet",!0),this._setProperty("_textLeading",E),this._pInst):this._textLeading}},{key:"textStyle",value:function(E){return E?(E!==u.NORMAL&&E!==u.ITALIC&&E!==u.BOLD&&E!==u.BOLDITALIC||this._setProperty("_textStyle",E),this._applyTextProperties()):this._textStyle}},{key:"textAscent",value:function(){return this._textAscent===null&&this._updateTextMetrics(),this._textAscent}},{key:"textDescent",value:function(){return this._textDescent===null&&this._updateTextMetrics(),this._textDescent}},{key:"textAlign",value:function(E,S){return E!==void 0?(this._setProperty("_textAlign",E),S!==void 0&&this._setProperty("_textBaseline",S),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}}},{key:"textWrap",value:function(E){return this._setProperty("_textWrap",E),this._textWrap}},{key:"text",value:function(E,S,T,k,A){var O,R,C,L,F=this._pInst,z=this._textWrap,W=Number.MAX_VALUE,$=T;if((this._doFill||this._doStroke)&&E!==void 0){if(O=(E=(E=typeof E!="string"?E.toString():E).replace(/(\t)/g," ")).split(` `),k!==void 0){switch(this._rectMode===u.CENTER&&(S-=k/2),this._textAlign){case u.CENTER:S+=k/2;break;case u.RIGHT:S+=k}if(A!==void 0){this._rectMode===u.CENTER&&(T-=A/2,$-=A/2);var E=T,G=F.textAscent();switch(this._textBaseline){case u.BOTTOM:L=T+A,T=Math.max(L,T),$+=G;break;case u.CENTER:L=T+A/2,T=Math.max(L,T),$+=G/2}W=T+A-G,this._textBaseline===u.CENTER&&(W=E+A-G/2)}else this._textBaseline!==u.BOTTOM&&this._textBaseline!==u.CENTER||($=T-(E=F.textSize()*this._textLeading)/2,W=T+E/2);if(z===u.WORD){for(var K=[],Z=0;Zc.HALF_PI&&y<=3*c.HALF_PI?Math.atan(g/b*Math.tan(y))+c.PI:Math.atan(g/b*Math.tan(y))+c.TWO_PI,p=p<=c.HALF_PI?Math.atan(g/b*Math.tan(p)):p>c.HALF_PI&&p<=3*c.HALF_PI?Math.atan(g/b*Math.tan(p))+c.PI:Math.atan(g/b*Math.tan(p))+c.TWO_PI),p"u"||Uint8ClampedArray.prototype.slice||Object.defineProperty(Uint8ClampedArray.prototype,"slice",{value:Array.prototype.slice,writable:!0,configurable:!0,enumerable:!1}),Object.assign||(c=Object.keys,n=Object.defineProperty,h=typeof Symbol=="function"&&u(Symbol())==="symbol",f=Object.prototype.propertyIsEnumerable,n(Object,"assign",{value:function(d,m){if(d==null)throw new TypeError("target must be an object");for(var y,p=Object(d),g=1;gb||Math.abs(this.accelerationY-this.pAccelerationY)>b||Math.abs(this.accelerationZ-this.pAccelerationZ)>b)&&k.deviceMoved(),typeof k.deviceTurned=="function"&&(_=this.rotationX+180,w=this.pRotationX+180,E=f+180,0<_-w&&_-w<270||_-w<-270?y="clockwise":(_-w<0||270<_-w)&&(y="counter-clockwise"),y!==this.pRotateDirectionX&&(E=_),90>>16,f[1+m]=(65280&d[y])>>>8,f[2+m]=255&d[y],f[3+m]=(4278190080&d[y])>>>24},_toImageData:function(f){return f instanceof ImageData?f:f.getContext("2d").getImageData(0,0,f.width,f.height)},_createImageData:function(f,d){return h._tmpCanvas=document.createElement("canvas"),h._tmpCtx=h._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(f,d)},apply:function(f,g,m){var y=f.getContext("2d"),p=y.getImageData(0,0,f.width,f.height),g=g(p,m);g instanceof ImageData?y.putImageData(g,0,0,0,0,f.width,f.height):y.putImageData(p,0,0,0,0,f.width,f.height)},threshold:function(f,d){for(var m=h._toPixels(f),y=(d===void 0&&(d=.5),Math.floor(255*d)),p=0;p>8)/y,m[p+1]=255*(b*d>>8)/y,m[p+2]=255*(x*d>>8)/y}},dilate:function(f){for(var d,m,y,p,g,b,x,v,w,_=h._toPixels(f),E=0,S=_.length?_.length/4:0,T=new Int32Array(S);E>16&255)+151*(p>>8&255)+28*(255&p))<(x=77*(w>>16&255)+151*(w>>8&255)+28*(255&w))&&(y=w,p=x),p<(x=77*((w=h._getARGB(_,v))>>16&255)+151*(w>>8&255)+28*(255&w))&&(y=w,p=x),p<(v=77*(g>>16&255)+151*(g>>8&255)+28*(255&g))&&(y=g,p=v),p<(w=77*(b>>16&255)+151*(b>>8&255)+28*(255&b))&&(y=b,p=w),T[E++]=y;h._setPixels(_,T)},erode:function(f){for(var d,m,y,p,g,b,x,v,w,_=h._toPixels(f),E=0,S=_.length?_.length/4:0,T=new Int32Array(S);E>16&255)+151*(w>>8&255)+28*(255&w))<(p=77*(p>>16&255)+151*(p>>8&255)+28*(255&p))&&(y=w,p=x),(x=77*((w=h._getARGB(_,v))>>16&255)+151*(w>>8&255)+28*(255&w))>16&255)+151*(g>>8&255)+28*(255&g))>16&255)+151*(b>>8&255)+28*(255&b))>>24],y+=z[(16711680&te)>>16],p+=z[(65280&te)>>8],g+=z[255&te],m+=u[F],x++}Z[v=H+C]=b/m,U[v]=y/m,I[v]=p/m,B[v]=g/m}H+=T}for(_=(w=-s)*T,L=H=0;L"+$.length.toString()+" out of "+L.toString()),ne.next=48,new Promise(function(fe){return setTimeout(fe,0)});ne.next=50;break;case 48:ne.next=39;break;case 50:A||G.html("Frames processed, generating color palette..."),this.loop(),this.pixelDensity(W),U=(0,d.GIFEncoder)(),I=function(fe){for(var be=new Uint8Array(fe.length*fe[0].length),Ee=0;Ee"+oe.toString()+" out of "+L.toString()),ne.next=68,new Promise(function(fe){return setTimeout(fe,0)});case 68:oe++,ne.next=60;break;case 71:U.finish(),te=U.bytesView(),te=new Blob([te],{type:"image/gif"}),$=[],this._recording=!1,this.loop(),A||(G.html("Done. Downloading your gif!🌸"),0=y&&(y=Math.floor(p.timeDisplayed/y),p.timeDisplayed=0,p.lastChangeTime=g,p.displayIndex+=y,p.loopCount=Math.floor(p.displayIndex/p.numFrames),p.loopLimit!==null&&p.loopCount>=p.loopLimit?p.playing=!1:(g=p.displayIndex%p.numFrames,this.drawingContext.putImageData(p.frames[g].image,0,0),p.displayIndex=g,this.setModified(!0))))}},{key:"_setProperty",value:function(m,y){this[m]=y,this.setModified(!0)}},{key:"loadPixels",value:function(){s.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)}},{key:"updatePixels",value:function(m,y,p,g){s.default.Renderer2D.prototype.updatePixels.call(this,m,y,p,g),this.setModified(!0)}},{key:"get",value:function(m,y,p,g){return s.default._validateParameters("p5.Image.get",arguments),s.default.Renderer2D.prototype.get.apply(this,arguments)}},{key:"_getPixel",value:function(){for(var m=arguments.length,y=new Array(m),p=0;p/g,">").replace(/"/g,""").replace(/'/g,"'")}function m(y,p){p&&p!==!0&&p!=="true"||(p="");var g="";return(y=y||"untitled")&&y.includes(".")&&(g=y.split(".").pop()),p&&g!==p&&(g=p,y="".concat(y,".").concat(g)),[y,g]}n("../core/friendly_errors/validate_params"),n("../core/friendly_errors/file_errors"),n("../core/friendly_errors/fes_core"),l.default.prototype.loadJSON=function(){for(var y=arguments.length,p=new Array(y),g=0;g"),x.print(""),x.print(' '),x.print(""),x.print(""),x.print(" "),v[0]!=="0"){x.print(" ");for(var T=0;T".concat(k)),x.print(" ")}x.print(" ")}for(var A=0;A");for(var O=0;O".concat(R)),x.print(" ")}x.print(" ")}x.print("
        "),x.print(""),x.print("")}x.close(),x.clear()},l.default.prototype.writeFile=function(x,p,g){var b="application/octet-stream",x=(l.default.prototype._isSafari()&&(b="text/plain"),new Blob(x,{type:b}));l.default.prototype.downloadFile(x,p,g)},l.default.prototype.downloadFile=function(y,x,v){var b,x=m(x,v),v=x[0];y instanceof Blob?c.default.saveAs(y,v):((b=document.createElement("a")).href=y,b.download=v,b.onclick=function(w){document.body.removeChild(w.target),w.stopPropagation()},b.style.display="none",document.body.appendChild(b),l.default.prototype._isSafari()&&(y=(y=`Hello, Safari user! To download this file... 1. Go to File --> Save As. 2. Choose "Page Source" as the Format. `)+'3. Name it with this extension: ."'.concat(x[1],'"'),alert(y)),b.click())},l.default.prototype._checkFileExtension=m,l.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return m},rand:function(){return(y=(1664525*y+1013904223)%p)/p}};g.setSeed(d),l=new Array(4096);for(var b=0;b<4096;b++)l[b]=g.rand()},f.default);a.default=f},{"../core/main":275}],308:[function(n,i,a){function s(p){return(s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g})(p)}function l(p){return(l=typeof Symbol=="function"&&s(Symbol.iterator)==="symbol"?function(g){return s(g)}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":s(g)})(p)}n("core-js/modules/es.symbol"),n("core-js/modules/es.symbol.description"),n("core-js/modules/es.symbol.iterator"),n("core-js/modules/es.array.concat"),n("core-js/modules/es.array.every"),n("core-js/modules/es.array.iterator"),n("core-js/modules/es.array.slice"),n("core-js/modules/es.array.some"),n("core-js/modules/es.math.sign"),n("core-js/modules/es.number.constructor"),n("core-js/modules/es.number.is-finite"),n("core-js/modules/es.object.get-own-property-descriptor"),n("core-js/modules/es.object.to-string"),n("core-js/modules/es.string.iterator"),n("core-js/modules/es.string.sub"),n("core-js/modules/es.weak-map"),n("core-js/modules/web.dom-collections.iterator"),n("core-js/modules/es.array.concat"),n("core-js/modules/es.array.every"),n("core-js/modules/es.array.slice"),n("core-js/modules/es.array.some"),n("core-js/modules/es.math.sign"),n("core-js/modules/es.number.constructor"),n("core-js/modules/es.number.is-finite"),n("core-js/modules/es.string.sub"),Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var u=(y=n("../core/main"))&&y.__esModule?y:{default:y},c=function(p){if(p&&p.__esModule)return p;if(p===null||l(p)!=="object"&&typeof p!="function")return{default:p};var g=h();if(g&&g.has(p))return g.get(p);var b,x={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(b in p){var w;Object.prototype.hasOwnProperty.call(p,b)&&((w=v?Object.getOwnPropertyDescriptor(p,b):null)&&(w.get||w.set)?Object.defineProperty(x,b,w):x[b]=p[b])}return x.default=p,g&&g.set(p,x),x}(n("../core/constants"));function h(){var p;return typeof WeakMap!="function"?null:(p=new WeakMap,h=function(){return p},p)}function f(p,g){for(var b=0;b>>0},s.default.prototype.randomSeed=function(f){this._lcgSetSeed(l,f),this._gaussian_previous=!1},s.default.prototype.random=function(f,d){var m,y;return s.default._validateParameters("random",arguments),m=this[l]!=null?this._lcg(l):Math.random(),f===void 0?m:d===void 0?f instanceof Array?f[Math.floor(m*f.length)]:m*f:(dH&&(he=G,oe=F,ce=z,G=pe+H*(ee&&pe=u?c.substring(c.length-u,c.length):c}},s.default.prototype.unhex=function(l){return l instanceof Array?l.map(s.default.prototype.unhex):parseInt("0x".concat(l),16)},n=s.default,a.default=n},{"../core/main":275,"core-js/modules/es.array.map":164,"core-js/modules/es.number.constructor":173,"core-js/modules/es.object.to-string":182,"core-js/modules/es.regexp.to-string":188,"core-js/modules/es.string.repeat":195}],316:[function(n,i,a){n("core-js/modules/es.symbol"),n("core-js/modules/es.symbol.description"),n("core-js/modules/es.symbol.iterator"),n("core-js/modules/es.array.filter"),n("core-js/modules/es.array.index-of"),n("core-js/modules/es.array.iterator"),n("core-js/modules/es.array.join"),n("core-js/modules/es.array.map"),n("core-js/modules/es.array.slice"),n("core-js/modules/es.number.to-fixed"),n("core-js/modules/es.object.to-string"),n("core-js/modules/es.regexp.constructor"),n("core-js/modules/es.regexp.exec"),n("core-js/modules/es.regexp.to-string"),n("core-js/modules/es.string.iterator"),n("core-js/modules/es.string.match"),n("core-js/modules/es.string.pad-start"),n("core-js/modules/es.string.replace"),n("core-js/modules/es.string.split"),n("core-js/modules/es.string.trim"),n("core-js/modules/web.dom-collections.iterator"),n("core-js/modules/es.array.filter"),n("core-js/modules/es.array.index-of"),n("core-js/modules/es.array.join"),n("core-js/modules/es.array.map"),n("core-js/modules/es.array.slice"),n("core-js/modules/es.number.to-fixed"),n("core-js/modules/es.object.to-string"),n("core-js/modules/es.regexp.constructor"),n("core-js/modules/es.regexp.exec"),n("core-js/modules/es.regexp.to-string"),n("core-js/modules/es.string.match"),n("core-js/modules/es.string.pad-start"),n("core-js/modules/es.string.replace"),n("core-js/modules/es.string.split"),n("core-js/modules/es.string.trim"),Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var s=(d=n("../core/main"))&&d.__esModule?d:{default:d};function l(m,y){return function(p){if(Array.isArray(p))return p}(m)||function(p,g){if(Symbol.iterator in Object(p)||Object.prototype.toString.call(p)==="[object Arguments]"){var b=[],x=!0,v=!1,w=void 0;try{for(var _,E=p[Symbol.iterator]();!(x=(_=E.next()).done)&&(b.push(_.value),!g||b.length!==g);x=!0);}catch(S){v=!0,w=S}finally{try{x||E.return==null||E.return()}finally{if(v)throw w}}return b}}(m,y)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function u(m,y,p){var b=l(m.toString().split("."),2),g=b[0],b=b[1];return p===void 0?(g=g.padStart(y,"0"),b?g+"."+b:g):(g=(m=l(m.toFixed(p).toString().split("."),2))[0],b=m[1],g=g.padStart(y,"0"),b===void 0?g:g+"."+b)}function c(b,y){var p=(b=b.toString()).indexOf("."),g=p!==-1?b.substring(p):"",b=(b=p!==-1?b.substring(0,p):b).toString().replace(/\B(?=(\d{3})+(?!\d))/g,",");if(y===0)g="";else if(y!==void 0)if(y>g.length)for(var x=y-(g+=p===-1?".":"").length+1,v=0;v=c.TWO_PI?"".concat(S="ellipse","|"):"".concat(S="arc","|").concat(x,"|").concat(v,"|").concat(w,"|")).concat(_,"|"),S=(this.geometryInHash(E)||((y=new u.default.Geometry(_,1,function(){if(x.toFixed(10)!==v.toFixed(10)){w!==c.PIE&&w!==void 0||(this.vertices.push(new u.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var T=0;T<=_;T++){var A=(v-x)*(T/_)+x,k=.5+Math.cos(A)/2,A=.5+Math.sin(A)/2;this.vertices.push(new u.default.Vector(k,A,0)),this.uvs.push([k,A]),T<_-1&&(this.faces.push([0,T+1,T+2]),this.edges.push([T+1,T+2]))}switch(w){case c.PIE:this.faces.push([0,this.vertices.length-2,this.vertices.length-1]),this.edges.push([0,1]),this.edges.push([this.vertices.length-2,this.vertices.length-1]),this.edges.push([0,this.vertices.length-1]);break;case c.CHORD:this.edges.push([0,1]),this.edges.push([0,this.vertices.length-1]);break;case c.OPEN:this.edges.push([0,1]);break;default:this.faces.push([0,this.vertices.length-2,this.vertices.length-1]),this.edges.push([this.vertices.length-2,this.vertices.length-1])}}})).computeNormals(),_<=50?y._edgesToVertices(y):this._doStroke&&console.log("Cannot apply a stroke to an ".concat(S," with more than 50 detail")),this.createBuffers(E,y)),this.uMVMatrix.copy());try{this.uMVMatrix.translate([m,p,0]),this.uMVMatrix.scale(g,b,1),this.drawBuffers(E)}finally{this.uMVMatrix=S}return this},u.default.RendererGL.prototype.rect=function(m){var y=m[0],p=m[1],g=m[2],b=m[3];if(m[4]===void 0){var w=this._pInst._glAttributes.perPixelLighting,x=m[4]||(w?1:24),v=m[5]||(w?1:16),w="rect|".concat(x,"|").concat(v),_=(this.geometryInHash(w)||((_=new u.default.Geometry(x,v,function(){for(var $=0;$<=this.detailY;$++)for(var G=$/this.detailY,K=0;K<=this.detailX;K++){var Z=K/this.detailX,U=new u.default.Vector(Z,G,0);this.vertices.push(U),this.uvs.push(Z,G)}0>5&31)/31,(z>>10&31)/31)),new s.default.Vector($,G,K)),U=1;U<=3;U++){var I=W+12*U,I=new s.default.Vector(O.getFloat32(I,!0),O.getFloat32(4+I,!0),O.getFloat32(8+I,!0));x.vertices.push(I),x.vertexNormals.push(Z),C&&S.push(w,_,E)}x.faces.push([3*F,3*F+1,3*F+2]),x.uvs.push([0,0],[0,0],[0,0])}})(g,b);else{if(b=new DataView(b),!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");b=new TextDecoder("utf-8").decode(b).split(` `),function(x,v){for(var w,_,E="",S=[],T=0;Tthis.cameraFar&&(y=this.cameraFar),Math.acos(Math.max(-1,Math.min(1,s.default.Vector.dot(p,g))))+w),w=f;(v<=0||v>=Math.PI)&&(this.upX*=-1,this.upY*=-1,this.upZ*=-1),g.mult(Math.cos(v)),x.mult(Math.cos(w)*Math.sin(v)),b.mult(Math.sin(w)*Math.sin(v)),p.set(g).add(x).add(b),this.eyeX=y*p.x+this.centerX,this.eyeY=y*p.y+this.centerY,this.eyeZ=y*p.z+this.centerZ,this.camera(this.eyeX,this.eyeY,this.eyeZ,this.centerX,this.centerY,this.centerZ,this.upX,this.upY,this.upZ)}},{key:"_orbitFree",value:function(v,w,E){var p=this.eyeX-this.centerX,g=this.eyeY-this.centerY,b=this.eyeZ-this.centerZ,y=Math.hypot(p,g,b),p=new s.default.Vector(p,g,b).normalize(),g=new s.default.Vector(this.upX,this.upY,this.upZ),b=new s.default.Vector.cross(g,p).normalize(),x=new s.default.Vector.cross(p,b),S=Math.atan2(w,v),S=(x.mult(Math.sin(S)),b.mult(Math.cos(S)).add(x),Math.sqrt(v*v+w*w)),x=new s.default.Vector.cross(p,b),v=((y=(y*=Math.pow(10,E))this.cameraFar&&(y=this.cameraFar),Math.cos(S)),w=Math.sin(S),E=g.dot(p),S=g.dot(b),_=E*v+S*w,E=-E*w+S*v,S=g.dot(x);g.x=_*p.x+E*b.x+S*x.x,g.y=_*p.y+E*b.y+S*x.y,g.z=_*p.z+E*b.z+S*x.z,b.mult(-w),p.mult(v).add(b).mult(y),this.camera(p.x+this.centerX,p.y+this.centerY,p.z+this.centerZ,this.centerX,this.centerY,this.centerZ,g.x,g.y,g.z)}},{key:"_isActive",value:function(){return this===this._renderer._curCamera}}])&&l(c.prototype,h),u}(),s.default.prototype.setCamera=function(u){this._renderer._curCamera=u,this._renderer.uPMatrix.set(u.projMatrix.mat4[0],u.projMatrix.mat4[1],u.projMatrix.mat4[2],u.projMatrix.mat4[3],u.projMatrix.mat4[4],u.projMatrix.mat4[5],u.projMatrix.mat4[6],u.projMatrix.mat4[7],u.projMatrix.mat4[8],u.projMatrix.mat4[9],u.projMatrix.mat4[10],u.projMatrix.mat4[11],u.projMatrix.mat4[12],u.projMatrix.mat4[13],u.projMatrix.mat4[14],u.projMatrix.mat4[15])},n=s.default.Camera,a.default=n},{"../core/main":275,"core-js/modules/es.array.slice":165,"core-js/modules/es.math.hypot":170,"core-js/modules/es.string.sub":200}],325:[function(n,i,a){n("core-js/modules/es.array.iterator"),n("core-js/modules/es.array.slice"),n("core-js/modules/es.math.log2"),n("core-js/modules/es.object.to-string"),n("core-js/modules/es.typed-array.float32-array"),n("core-js/modules/es.typed-array.copy-within"),n("core-js/modules/es.typed-array.every"),n("core-js/modules/es.typed-array.fill"),n("core-js/modules/es.typed-array.filter"),n("core-js/modules/es.typed-array.find"),n("core-js/modules/es.typed-array.find-index"),n("core-js/modules/es.typed-array.for-each"),n("core-js/modules/es.typed-array.includes"),n("core-js/modules/es.typed-array.index-of"),n("core-js/modules/es.typed-array.iterator"),n("core-js/modules/es.typed-array.join"),n("core-js/modules/es.typed-array.last-index-of"),n("core-js/modules/es.typed-array.map"),n("core-js/modules/es.typed-array.reduce"),n("core-js/modules/es.typed-array.reduce-right"),n("core-js/modules/es.typed-array.reverse"),n("core-js/modules/es.typed-array.set"),n("core-js/modules/es.typed-array.slice"),n("core-js/modules/es.typed-array.some"),n("core-js/modules/es.typed-array.sort"),n("core-js/modules/es.typed-array.subarray"),n("core-js/modules/es.typed-array.to-locale-string"),n("core-js/modules/es.typed-array.to-string"),n("core-js/modules/es.array.iterator"),n("core-js/modules/es.array.slice"),n("core-js/modules/es.math.log2"),n("core-js/modules/es.object.to-string"),n("core-js/modules/es.typed-array.float32-array"),n("core-js/modules/es.typed-array.copy-within"),n("core-js/modules/es.typed-array.every"),n("core-js/modules/es.typed-array.fill"),n("core-js/modules/es.typed-array.filter"),n("core-js/modules/es.typed-array.find"),n("core-js/modules/es.typed-array.find-index"),n("core-js/modules/es.typed-array.for-each"),n("core-js/modules/es.typed-array.includes"),n("core-js/modules/es.typed-array.index-of"),n("core-js/modules/es.typed-array.iterator"),n("core-js/modules/es.typed-array.join"),n("core-js/modules/es.typed-array.last-index-of"),n("core-js/modules/es.typed-array.map"),n("core-js/modules/es.typed-array.reduce"),n("core-js/modules/es.typed-array.reduce-right"),n("core-js/modules/es.typed-array.reverse"),n("core-js/modules/es.typed-array.set"),n("core-js/modules/es.typed-array.slice"),n("core-js/modules/es.typed-array.some"),n("core-js/modules/es.typed-array.sort"),n("core-js/modules/es.typed-array.subarray"),n("core-js/modules/es.typed-array.to-locale-string"),n("core-js/modules/es.typed-array.to-string"),Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0,n=(n=n("../core/main"))&&n.__esModule?n:{default:n};function s(l,u){for(var c=0;c=this.width||R>=this.height)&&(console.warn("The x and y values passed to p5.Framebuffer.get are outside of its range and will be clamped."),O=this.target.constrain(O,0,this.width-1),R=this.target.constrain(R,0,this.height-1)),(0,f.readPixelWebGL)(this.gl,this.framebuffer,O*this.density,R*this.density,F.format,F.type);O=this.target.constrain(O,0,this.width-1),R=this.target.constrain(R,0,this.height-1),C=this.target.constrain(C,1,this.width-O),L=this.target.constrain(L,1,this.height-R);for(var z=(0,f.readPixelsWebGL)(void 0,this.gl,this.framebuffer,O*this.density,R*this.density,C*this.density,L*this.density,F.format,F.type),W=new Uint8ClampedArray(C*L*this.density*this.density*4),$=(W.fill(255),F.type===this.gl.RGB?3:4),G=0;Gthis.vertices.length-1-this.detailX;w--)b.add(this.vertexNormals[w]);b=u.default.Vector.div(b,this.detailX);for(var _=this.vertices.length-1;_>this.vertices.length-1-this.detailX;_--)this.vertexNormals[_]=b;return this}},{key:"_makeTriangleEdges",value:function(){for(var b=this.edges.length=0;b 65535 triangles. Your web browser does not support the WebGL Extension OES_element_index_uint.");p.drawElements(p.TRIANGLES,y.vertexCount,y.indexBufferType,0)}else p.drawArrays(d||p.TRIANGLES,0,y.vertexCount)},u.default.RendererGL.prototype._drawPoints=function(d,m){var y=this.GL,p=this._getImmediatePointShader();this._setPointUniforms(p),this._bindBuffer(m,y.ARRAY_BUFFER,this._vToNArray(d),Float32Array,y.STATIC_DRAW),p.enableAttrib(p.attributes.aPosition,3),this._applyColorBlend(this.curStrokeColor),y.drawArrays(y.Points,0,d.length),p.unbindShader()};var f=u.default.RendererGL;a.default=f},{"../core/constants":264,"../core/main":275,"./p5.RenderBuffer":329,"./p5.RendererGL":332,"core-js/modules/es.array.fill":154,"core-js/modules/es.array.iterator":161,"core-js/modules/es.array.some":166,"core-js/modules/es.object.get-own-property-descriptor":178,"core-js/modules/es.object.keys":181,"core-js/modules/es.object.to-string":182,"core-js/modules/es.string.iterator":192,"core-js/modules/es.symbol":204,"core-js/modules/es.symbol.description":202,"core-js/modules/es.symbol.iterator":203,"core-js/modules/es.typed-array.copy-within":205,"core-js/modules/es.typed-array.every":206,"core-js/modules/es.typed-array.fill":207,"core-js/modules/es.typed-array.filter":208,"core-js/modules/es.typed-array.find":210,"core-js/modules/es.typed-array.find-index":209,"core-js/modules/es.typed-array.float32-array":211,"core-js/modules/es.typed-array.for-each":213,"core-js/modules/es.typed-array.includes":214,"core-js/modules/es.typed-array.index-of":215,"core-js/modules/es.typed-array.iterator":218,"core-js/modules/es.typed-array.join":219,"core-js/modules/es.typed-array.last-index-of":220,"core-js/modules/es.typed-array.map":221,"core-js/modules/es.typed-array.reduce":223,"core-js/modules/es.typed-array.reduce-right":222,"core-js/modules/es.typed-array.reverse":224,"core-js/modules/es.typed-array.set":225,"core-js/modules/es.typed-array.slice":226,"core-js/modules/es.typed-array.some":227,"core-js/modules/es.typed-array.sort":228,"core-js/modules/es.typed-array.subarray":229,"core-js/modules/es.typed-array.to-locale-string":230,"core-js/modules/es.typed-array.to-string":231,"core-js/modules/es.typed-array.uint16-array":232,"core-js/modules/es.typed-array.uint32-array":233,"core-js/modules/es.weak-map":236,"core-js/modules/web.dom-collections.iterator":238}],332:[function(C,i,a){function s($){return(s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(G){return typeof G}:function(G){return G&&typeof Symbol=="function"&&G.constructor===Symbol&&G!==Symbol.prototype?"symbol":typeof G})($)}function l($){return(l=typeof Symbol=="function"&&s(Symbol.iterator)==="symbol"?function(G){return s(G)}:function(G){return G&&typeof Symbol=="function"&&G.constructor===Symbol&&G!==Symbol.prototype?"symbol":s(G)})($)}C("core-js/modules/es.symbol"),C("core-js/modules/es.symbol.description"),C("core-js/modules/es.symbol.iterator"),C("core-js/modules/es.array.concat"),C("core-js/modules/es.array.copy-within"),C("core-js/modules/es.array.every"),C("core-js/modules/es.array.fill"),C("core-js/modules/es.array.from"),C("core-js/modules/es.array.includes"),C("core-js/modules/es.array.iterator"),C("core-js/modules/es.array.slice"),C("core-js/modules/es.array.some"),C("core-js/modules/es.map"),C("core-js/modules/es.object.assign"),C("core-js/modules/es.object.get-own-property-descriptor"),C("core-js/modules/es.object.get-prototype-of"),C("core-js/modules/es.object.to-string"),C("core-js/modules/es.reflect.construct"),C("core-js/modules/es.reflect.get"),C("core-js/modules/es.regexp.to-string"),C("core-js/modules/es.set"),C("core-js/modules/es.string.includes"),C("core-js/modules/es.string.iterator"),C("core-js/modules/es.typed-array.float32-array"),C("core-js/modules/es.typed-array.float64-array"),C("core-js/modules/es.typed-array.int16-array"),C("core-js/modules/es.typed-array.uint8-array"),C("core-js/modules/es.typed-array.uint16-array"),C("core-js/modules/es.typed-array.uint32-array"),C("core-js/modules/es.typed-array.copy-within"),C("core-js/modules/es.typed-array.every"),C("core-js/modules/es.typed-array.fill"),C("core-js/modules/es.typed-array.filter"),C("core-js/modules/es.typed-array.find"),C("core-js/modules/es.typed-array.find-index"),C("core-js/modules/es.typed-array.for-each"),C("core-js/modules/es.typed-array.includes"),C("core-js/modules/es.typed-array.index-of"),C("core-js/modules/es.typed-array.iterator"),C("core-js/modules/es.typed-array.join"),C("core-js/modules/es.typed-array.last-index-of"),C("core-js/modules/es.typed-array.map"),C("core-js/modules/es.typed-array.reduce"),C("core-js/modules/es.typed-array.reduce-right"),C("core-js/modules/es.typed-array.reverse"),C("core-js/modules/es.typed-array.set"),C("core-js/modules/es.typed-array.slice"),C("core-js/modules/es.typed-array.some"),C("core-js/modules/es.typed-array.sort"),C("core-js/modules/es.typed-array.subarray"),C("core-js/modules/es.typed-array.to-locale-string"),C("core-js/modules/es.typed-array.to-string"),C("core-js/modules/es.weak-map"),C("core-js/modules/web.dom-collections.iterator"),C("core-js/modules/es.symbol"),C("core-js/modules/es.symbol.description"),C("core-js/modules/es.symbol.iterator"),C("core-js/modules/es.array.concat"),C("core-js/modules/es.array.copy-within"),C("core-js/modules/es.array.every"),C("core-js/modules/es.array.fill"),C("core-js/modules/es.array.from"),C("core-js/modules/es.array.includes"),C("core-js/modules/es.array.iterator"),C("core-js/modules/es.array.slice"),C("core-js/modules/es.array.some"),C("core-js/modules/es.map"),C("core-js/modules/es.object.assign"),C("core-js/modules/es.object.to-string"),C("core-js/modules/es.set"),C("core-js/modules/es.string.includes"),C("core-js/modules/es.string.iterator"),C("core-js/modules/es.typed-array.float32-array"),C("core-js/modules/es.typed-array.float64-array"),C("core-js/modules/es.typed-array.int16-array"),C("core-js/modules/es.typed-array.uint8-array"),C("core-js/modules/es.typed-array.uint16-array"),C("core-js/modules/es.typed-array.uint32-array"),C("core-js/modules/es.typed-array.copy-within"),C("core-js/modules/es.typed-array.every"),C("core-js/modules/es.typed-array.fill"),C("core-js/modules/es.typed-array.filter"),C("core-js/modules/es.typed-array.find"),C("core-js/modules/es.typed-array.find-index"),C("core-js/modules/es.typed-array.for-each"),C("core-js/modules/es.typed-array.includes"),C("core-js/modules/es.typed-array.index-of"),C("core-js/modules/es.typed-array.iterator"),C("core-js/modules/es.typed-array.join"),C("core-js/modules/es.typed-array.last-index-of"),C("core-js/modules/es.typed-array.map"),C("core-js/modules/es.typed-array.reduce"),C("core-js/modules/es.typed-array.reduce-right"),C("core-js/modules/es.typed-array.reverse"),C("core-js/modules/es.typed-array.set"),C("core-js/modules/es.typed-array.slice"),C("core-js/modules/es.typed-array.some"),C("core-js/modules/es.typed-array.sort"),C("core-js/modules/es.typed-array.subarray"),C("core-js/modules/es.typed-array.to-locale-string"),C("core-js/modules/es.typed-array.to-string"),C("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(a,"__esModule",{value:!0}),a.readPixelsWebGL=z,a.readPixelWebGL=W,a.default=void 0;var u=y(C("../core/main")),c=function($){if($&&$.__esModule)return $;if($===null||l($)!=="object"&&typeof $!="function")return{default:$};var G=m();if(G&&G.has($))return G.get($);var K,Z={},U=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(K in $){var I;Object.prototype.hasOwnProperty.call($,K)&&((I=U?Object.getOwnPropertyDescriptor($,K):null)&&(I.get||I.set)?Object.defineProperty(Z,K,I):Z[K]=$[K])}return Z.default=$,G&&G.set($,Z),Z}(C("../core/constants")),h=y(C("./GeometryBuilder")),f=y(C("libtess")),d=(C("./p5.Shader"),C("./p5.Camera"),C("../core/p5.Renderer"),C("./p5.Matrix"),C("./p5.Framebuffer"),C("path"),C("./p5.Texture"));function m(){var $;return typeof WeakMap!="function"?null:($=new WeakMap,m=function(){return $},$)}function y($){return $&&$.__esModule?$:{default:$}}function p($){return function(G){if(Array.isArray(G)){for(var K=0,Z=new Array(G.length);K vTexCoord.y; bool y1 = p1.y > vTexCoord.y; bool y2 = p2.y > vTexCoord.y; // could web be under the curve (after t1)? if (y1 ? !y2 : y0) { // add the coverage for t1 coverage.x += saturate(C1.x + 0.5); // calculate the anti-aliasing for t1 weight.x = min(weight.x, abs(C1.x)); } // are we outside the curve (after t2)? if (y1 ? !y0 : y2) { // subtract the coverage for t2 coverage.x -= saturate(C2.x + 0.5); // calculate the anti-aliasing for t2 weight.x = min(weight.x, abs(C2.x)); } } // this is essentially the same as coverageX, but with the axes swapped void coverageY(vec2 p0, vec2 p1, vec2 p2) { vec2 C1, C2; calulateCrossings(p0, p1, p2, C1, C2); bool x0 = p0.x > vTexCoord.x; bool x1 = p1.x > vTexCoord.x; bool x2 = p2.x > vTexCoord.x; if (x1 ? !x2 : x0) { coverage.y -= saturate(C1.y + 0.5); weight.y = min(weight.y, abs(C1.y)); } if (x1 ? !x0 : x2) { coverage.y += saturate(C2.y + 0.5); weight.y = min(weight.y, abs(C2.y)); } } void main() { // calculate the pixel scale based on screen-coordinates pixelScale = hardness / fwidth(vTexCoord); // which grid cell is this pixel in? ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize)); // intersect curves in this row { // the index into the row info bitmap int rowIndex = gridCoord.y + uGridOffset.y; // fetch the info texel vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize); // unpack the rowInfo int rowStrokeIndex = getInt16(rowInfo.xy); int rowStrokeCount = getInt16(rowInfo.zw); for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) { if (iRowStroke >= rowStrokeCount) break; // each stroke is made up of 3 points: the start and control point // and the start of the next curve. // fetch the indices of this pair of strokes: vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize); // unpack the stroke index int strokePos = getInt16(strokeIndices.xy); // fetch the two strokes vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize); vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize); // calculate the coverage coverageX(stroke0.xy, stroke0.zw, stroke1.xy); } } // intersect curves in this column { int colIndex = gridCoord.x + uGridOffset.x; vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize); int colStrokeIndex = getInt16(colInfo.xy); int colStrokeCount = getInt16(colInfo.zw); for (int iColStroke = INT(0); iColStroke < N; iColStroke++) { if (iColStroke >= colStrokeCount) break; vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize); int strokePos = getInt16(strokeIndices.xy); vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize); vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize); coverageY(stroke0.xy, stroke0.zw, stroke1.xy); } } weight = saturate(1.0 - weight * 2.0); float distance = max(weight.x + weight.y, minDistance); // manhattan approx. float antialias = abs(dot(coverage, weight) / distance); float cover = min(abs(coverage.x), abs(coverage.y)); OUT_COLOR = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a; OUT_COLOR *= saturate(max(antialias, cover)); } `,lineVert:R+`/* Part of the Processing project - http://processing.org Copyright (c) 2012-15 The Processing Foundation Copyright (c) 2004-12 Ben Fry and Casey Reas Copyright (c) 2001-04 Massachusetts Institute of Technology This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, version 2.1. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #define PROCESSING_LINE_SHADER precision mediump int; uniform mat4 uModelViewMatrix; uniform mat4 uProjectionMatrix; uniform float uStrokeWeight; uniform bool uUseLineColor; uniform vec4 uMaterialColor; uniform vec4 uViewport; uniform int uPerspective; uniform int uStrokeJoin; IN vec4 aPosition; IN vec3 aTangentIn; IN vec3 aTangentOut; IN float aSide; IN vec4 aVertexColor; OUT vec4 vColor; OUT vec2 vTangent; OUT vec2 vCenter; OUT vec2 vPosition; OUT float vMaxDist; OUT float vCap; OUT float vJoin; vec2 lineIntersection(vec2 aPoint, vec2 aDir, vec2 bPoint, vec2 bDir) { // Rotate and translate so a starts at the origin and goes out to the right bPoint -= aPoint; vec2 rotatedBFrom = vec2( bPoint.x*aDir.x + bPoint.y*aDir.y, bPoint.y*aDir.x - bPoint.x*aDir.y ); vec2 bTo = bPoint + bDir; vec2 rotatedBTo = vec2( bTo.x*aDir.x + bTo.y*aDir.y, bTo.y*aDir.x - bTo.x*aDir.y ); float intersectionDistance = rotatedBTo.x + (rotatedBFrom.x - rotatedBTo.x) * rotatedBTo.y / (rotatedBTo.y - rotatedBFrom.y); return aPoint + aDir * intersectionDistance; } void main() { // Caps have one of either the in or out tangent set to 0 vCap = (aTangentIn == vec3(0.)) != (aTangentOut == (vec3(0.))) ? 1. : 0.; // Joins have two unique, defined tangents vJoin = ( aTangentIn != vec3(0.) && aTangentOut != vec3(0.) && aTangentIn != aTangentOut ) ? 1. : 0.; vec4 posp = uModelViewMatrix * aPosition; vec4 posqIn = uModelViewMatrix * (aPosition + vec4(aTangentIn, 0)); vec4 posqOut = uModelViewMatrix * (aPosition + vec4(aTangentOut, 0)); float facingCamera = pow( // The word space tangent's z value is 0 if it's facing the camera abs(normalize(posqIn-posp).z), // Using pow() here to ramp \`facingCamera\` up from 0 to 1 really quickly // so most lines get scaled and don't get clipped 0.25 ); // using a scale <1 moves the lines towards the camera // in order to prevent popping effects due to half of // the line disappearing behind the geometry faces. float scale = mix(1., 0.995, facingCamera); // Moving vertices slightly toward the camera // to avoid depth-fighting with the fill triangles. // Discussed here: // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 posp.xyz = posp.xyz * scale; posqIn.xyz = posqIn.xyz * scale; posqOut.xyz = posqOut.xyz * scale; vec4 p = uProjectionMatrix * posp; vec4 qIn = uProjectionMatrix * posqIn; vec4 qOut = uProjectionMatrix * posqOut; vCenter = p.xy; // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height]) // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw // prevent division by W by transforming the tangent formula (div by 0 causes // the line to disappear, see https://github.com/processing/processing/issues/5183) // t = screen_q - screen_p // // tangent is normalized and we don't care which aDirection it points to (+-) // t = +- normalize( screen_q - screen_p ) // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw ) // // extract common factor, <1,1> - <1,1> cancels out // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw ) // // convert to common divisor // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw ) // // remove the common scalar divisor/factor, not needed due to normalize and +- // (keep uViewport - can't remove because it has different components for x and y // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181) // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw ) vec2 tangentIn = normalize((qIn.xy*p.w - p.xy*qIn.w) * uViewport.zw); vec2 tangentOut = normalize((qOut.xy*p.w - p.xy*qOut.w) * uViewport.zw); vec2 curPerspScale; if(uPerspective == 1) { // Perspective --- // convert from world to clip by multiplying with projection scaling factor // to get the right thickness (see https://github.com/processing/processing/issues/5182) // The y value of the projection matrix may be flipped if rendering to a Framebuffer. // Multiplying again by its sign here negates the flip to get just the scale. curPerspScale = (uProjectionMatrix * vec4(1, sign(uProjectionMatrix[1][1]), 0, 0)).xy; } else { // No Perspective --- // multiply by W (to cancel out division by W later in the pipeline) and // convert from screen to clip (derived from clip to screen above) curPerspScale = p.w / (0.5 * uViewport.zw); } vec2 offset; if (vJoin == 1.) { vTangent = normalize(tangentIn + tangentOut); vec2 normalIn = vec2(-tangentIn.y, tangentIn.x); vec2 normalOut = vec2(-tangentOut.y, tangentOut.x); float side = sign(aSide); float sideEnum = abs(aSide); // We generate vertices for joins on either side of the centerline, but // the "elbow" side is the only one needing a join. By not setting the // offset for the other side, all its vertices will end up in the same // spot and not render, effectively discarding it. if (sign(dot(tangentOut, vec2(-tangentIn.y, tangentIn.x))) != side) { // Side enums: // 1: the side going into the join // 2: the middle of the join // 3: the side going out of the join if (sideEnum == 2.) { // Calculate the position + tangent on either side of the join, and // find where the lines intersect to find the elbow of the join vec2 c = (posp.xy/posp.w + vec2(1.,1.)) * 0.5 * uViewport.zw; vec2 intersection = lineIntersection( c + (side * normalIn * uStrokeWeight / 2.), tangentIn, c + (side * normalOut * uStrokeWeight / 2.), tangentOut ); offset = (intersection - c); // When lines are thick and the angle of the join approaches 180, the // elbow might be really far from the center. We'll apply a limit to // the magnitude to avoid lines going across the whole screen when this // happens. float mag = length(offset); float maxMag = 3. * uStrokeWeight; if (mag > maxMag) { offset *= maxMag / mag; } } else if (sideEnum == 1.) { offset = side * normalIn * uStrokeWeight / 2.; } else if (sideEnum == 3.) { offset = side * normalOut * uStrokeWeight / 2.; } } if (uStrokeJoin == STROKE_JOIN_BEVEL) { vec2 avgNormal = vec2(-vTangent.y, vTangent.x); vMaxDist = abs(dot(avgNormal, normalIn * uStrokeWeight / 2.)); } else { vMaxDist = uStrokeWeight / 2.; } } else { vec2 tangent = aTangentIn == vec3(0.) ? tangentOut : tangentIn; vTangent = tangent; vec2 normal = vec2(-tangent.y, tangent.x); float normalOffset = sign(aSide); // Caps will have side values of -2 or 2 on the edge of the cap that // extends out from the line float tangentOffset = abs(aSide) - 1.; offset = (normal * normalOffset + tangent * tangentOffset) * uStrokeWeight * 0.5; vMaxDist = uStrokeWeight / 2.; } vPosition = vCenter + offset; gl_Position.xy = p.xy + offset.xy * curPerspScale; gl_Position.zw = p.zw; vColor = (uUseLineColor ? aVertexColor : uMaterialColor); } `,lineFrag:R+`precision mediump int; uniform vec4 uMaterialColor; uniform int uStrokeCap; uniform int uStrokeJoin; uniform float uStrokeWeight; IN vec4 vColor; IN vec2 vTangent; IN vec2 vCenter; IN vec2 vPosition; IN float vMaxDist; IN float vCap; IN float vJoin; float distSquared(vec2 a, vec2 b) { vec2 aToB = b - a; return dot(aToB, aToB); } void main() { if (vCap > 0.) { if ( uStrokeCap == STROKE_CAP_ROUND && distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25 ) { discard; } else if ( uStrokeCap == STROKE_CAP_SQUARE && dot(vPosition - vCenter, vTangent) > 0. ) { discard; } // Use full area for PROJECT } else if (vJoin > 0.) { if ( uStrokeJoin == STROKE_JOIN_ROUND && distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25 ) { discard; } else if (uStrokeJoin == STROKE_JOIN_BEVEL) { vec2 normal = vec2(-vTangent.y, vTangent.x); if (abs(dot(vPosition - vCenter, normal)) > vMaxDist) { discard; } } // Use full area for MITER } OUT_COLOR = vec4(vColor.rgb, 1.) * vColor.a; } `,pointVert:`IN vec3 aPosition; uniform float uPointSize; OUT float vStrokeWeight; uniform mat4 uModelViewMatrix; uniform mat4 uProjectionMatrix; void main() { vec4 positionVec4 = vec4(aPosition, 1.0); gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4; gl_PointSize = uPointSize; vStrokeWeight = uPointSize; } `,pointFrag:`precision mediump int; uniform vec4 uMaterialColor; IN float vStrokeWeight; void main(){ float mask = 0.0; // make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point) // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant mask = step(0.98, length(gl_PointCoord * 2.0 - 1.0)); // if strokeWeight is 1 or less lets just draw a square // this prevents weird artifacting from carving circles when our points are really small // if strokeWeight is larger than 1, we just use it as is mask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0)); // throw away the borders of the mask // otherwise we get weird alpha blending issues if(mask > 0.98){ discard; } OUT_COLOR = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a; } `,imageLightVert:`precision highp float; attribute vec3 aPosition; attribute vec3 aNormal; attribute vec2 aTexCoord; varying vec3 localPos; varying vec3 vWorldNormal; varying vec3 vWorldPosition; varying vec2 vTexCoord; uniform mat4 uModelViewMatrix; uniform mat4 uProjectionMatrix; uniform mat3 uNormalMatrix; void main() { // Multiply the position by the matrix. vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0); gl_Position = uProjectionMatrix * viewModelPosition; // orient the normals and pass to the fragment shader vWorldNormal = uNormalMatrix * aNormal; // send the view position to the fragment shader vWorldPosition = (uModelViewMatrix * vec4(aPosition, 1.0)).xyz; localPos = vWorldPosition; vTexCoord = aTexCoord; } /* in the vertex shader we'll compute the world position and world oriented normal of the vertices and pass those to the fragment shader as varyings. */ `,imageLightDiffusedFrag:`precision highp float; varying vec3 localPos; // the HDR cubemap converted (can be from an equirectangular environment map.) uniform sampler2D environmentMap; varying vec2 vTexCoord; const float PI = 3.14159265359; vec2 nTOE( vec3 v ){ // x = r sin(phi) cos(theta) // y = r cos(phi) // z = r sin(phi) sin(theta) float phi = acos( v.y ); // if phi is 0, then there are no x, z components float theta = 0.0; // else theta = acos(v.x / sin(phi)); float sinTheta = v.z / sin(phi); if (sinTheta < 0.0) { // Turn it into -theta, but in the 0-2PI range theta = 2.0 * PI - theta; } theta = theta / (2.0 * 3.14159); phi = phi / 3.14159 ; vec2 angles = vec2( phi, theta ); return angles; } void main() { // the sample direction equals the hemisphere's orientation float phi = vTexCoord.x * 2.0 * PI; float theta = vTexCoord.y * PI; float x = sin(theta) * cos(phi); float y = sin(theta) * sin(phi); float z = cos(theta); vec3 normal = vec3( x, y, z); // Discretely sampling the hemisphere given the integral's // spherical coordinates translates to the following fragment code: vec3 irradiance = vec3(0.0); vec3 up = vec3(0.0, 1.0, 0.0); vec3 right = normalize(cross(up, normal)); up = normalize(cross(normal, right)); // We specify a fixed sampleDelta delta value to traverse // the hemisphere; decreasing or increasing the sample delta // will increase or decrease the accuracy respectively. const float sampleDelta = 0.025; float nrSamples = 0.0; for(float phi = 0.0; phi < 2.0 * PI; phi += sampleDelta) { for(float theta = 0.0; theta < ( 0.5 ) * PI; theta += sampleDelta) { // spherical to cartesian (in tangent space) // tangent space to world // add each sample result to irradiance float x = sin(theta) * cos(phi); float y = sin(theta) * sin(phi); float z = cos(theta); vec3 tangentSample = vec3( x, y, z); vec3 sampleVec = tangentSample.x * right + tangentSample.y * up + tangentSample.z * normal; irradiance += (texture2D(environmentMap, nTOE(sampleVec)).xyz) * cos(theta) * sin(theta); nrSamples++; } } // divide by the total number of samples taken, giving us the average sampled irradiance. irradiance = PI * irradiance * (1.0 / float(nrSamples )) ; gl_FragColor = vec4(irradiance, 1.0); }`,imageLightSpecularFrag:`precision highp float;\r varying vec3 localPos;\r varying vec2 vTexCoord;\r \r // our texture\r uniform sampler2D environmentMap;\r uniform float roughness;\r \r const float PI = 3.14159265359;\r \r float VanDerCorput(int bits);\r vec2 HammersleyNoBitOps(int i, int N);\r vec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness);\r \r \r vec2 nTOE( vec3 v ){\r // x = r sin(phi) cos(theta) \r // y = r cos(phi) \r // z = r sin(phi) sin(theta)\r float phi = acos( v.y );\r // if phi is 0, then there are no x, z components\r float theta = 0.0;\r // else \r theta = acos(v.x / sin(phi));\r float sinTheta = v.z / sin(phi);\r if (sinTheta < 0.0) {\r // Turn it into -theta, but in the 0-2PI range\r theta = 2.0 * PI - theta;\r }\r theta = theta / (2.0 * 3.14159);\r phi = phi / 3.14159 ;\r \r vec2 angles = vec2( phi, theta );\r return angles;\r }\r \r \r void main(){\r const int SAMPLE_COUNT = 1024; // 4096\r float totalWeight = 0.0;\r vec3 prefilteredColor = vec3(0.0);\r float phi = vTexCoord.x * 2.0 * PI;\r float theta = vTexCoord.y * PI;\r float x = sin(theta) * cos(phi);\r float y = sin(theta) * sin(phi);\r float z = cos(theta);\r vec3 N = vec3(x,y,z);\r vec3 V = N;\r for (int i = 0; i < SAMPLE_COUNT; ++i)\r {\r vec2 Xi = HammersleyNoBitOps(i, SAMPLE_COUNT);\r vec3 H = ImportanceSampleGGX(Xi, N, roughness);\r vec3 L = normalize(2.0 * dot(V, H) * H - V);\r \r float NdotL = max(dot(N, L), 0.0);\r if (NdotL > 0.0)\r {\r prefilteredColor += texture2D(environmentMap, nTOE(L)).xyz * NdotL;\r totalWeight += NdotL;\r }\r }\r prefilteredColor = prefilteredColor / totalWeight;\r \r gl_FragColor = vec4(prefilteredColor, 1.0);\r }\r \r vec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness){\r float a = roughness * roughness;\r \r float phi = 2.0 * PI * Xi.x;\r float cosTheta = sqrt((1.0 - Xi.y) / (1.0 + (a * a - 1.0) * Xi.y));\r float sinTheta = sqrt(1.0 - cosTheta * cosTheta);\r // from spherical coordinates to cartesian coordinates\r vec3 H;\r H.x = cos(phi) * sinTheta;\r H.y = sin(phi) * sinTheta;\r H.z = cosTheta;\r \r // from tangent-space vector to world-space sample vector\r vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\r vec3 tangent = normalize(cross(up, N));\r vec3 bitangent = cross(N, tangent);\r \r vec3 sampleVec = tangent * H.x + bitangent * H.y + N * H.z;\r return normalize(sampleVec);\r }\r \r \r float VanDerCorput(int n, int base)\r {\r float invBase = 1.0 / float(base);\r float denom = 1.0;\r float result = 0.0;\r \r for (int i = 0; i < 32; ++i)\r {\r if (n > 0)\r {\r denom = mod(float(n), 2.0);\r result += denom * invBase;\r invBase = invBase / 2.0;\r n = int(float(n) / 2.0);\r }\r }\r \r return result;\r }\r \r vec2 HammersleyNoBitOps(int i, int N)\r {\r return vec2(float(i) / float(N), VanDerCorput(i, 2));\r }\r `};for(k in L)L[k]=`#ifdef WEBGL2 #define IN in #define OUT out #ifdef FRAGMENT_SHADER out vec4 outColor; #define OUT_COLOR outColor #endif #define TEXTURE texture #else #ifdef FRAGMENT_SHADER #define IN varying #else #define IN attribute #endif #define OUT varying #define TEXTURE texture2D #ifdef FRAGMENT_SHADER #define OUT_COLOR gl_FragColor #endif #endif `+L[k];E(C={},c.GRAY,`precision highp float; varying vec2 vTexCoord; uniform sampler2D tex0; float luma(vec3 color) { // weighted grayscale with luminance values return dot(color, vec3(0.2126, 0.7152, 0.0722)); } void main() { vec4 tex = texture2D(tex0, vTexCoord); float gray = luma(tex.rgb); gl_FragColor = vec4(gray, gray, gray, tex.a); } `),E(C,c.ERODE,`// Reduces the bright areas in an image precision highp float; varying vec2 vTexCoord; uniform sampler2D tex0; uniform vec2 texelSize; float luma(vec3 color) { // weighted grayscale with luminance values // weights 77, 151, 28 taken from src/image/filters.js return dot(color, vec3(0.300781, 0.589844, 0.109375)); } void main() { vec4 color = texture2D(tex0, vTexCoord); float lum = luma(color.rgb); // set current color as the darkest neighbor color vec4 neighbors[4]; neighbors[0] = texture2D(tex0, vTexCoord + vec2( texelSize.x, 0.0)); neighbors[1] = texture2D(tex0, vTexCoord + vec2(-texelSize.x, 0.0)); neighbors[2] = texture2D(tex0, vTexCoord + vec2(0.0, texelSize.y)); neighbors[3] = texture2D(tex0, vTexCoord + vec2(0.0, -texelSize.y)); for (int i = 0; i < 4; i++) { vec4 neighborColor = neighbors[i]; float neighborLum = luma(neighborColor.rgb); if (neighborLum < lum) { color = neighborColor; lum = neighborLum; } } gl_FragColor = color; } `),E(C,c.DILATE,`// Increase the bright areas in an image precision highp float; varying vec2 vTexCoord; uniform sampler2D tex0; uniform vec2 texelSize; float luma(vec3 color) { // weighted grayscale with luminance values // weights 77, 151, 28 taken from src/image/filters.js return dot(color, vec3(0.300781, 0.589844, 0.109375)); } void main() { vec4 color = texture2D(tex0, vTexCoord); float lum = luma(color.rgb); // set current color as the brightest neighbor color vec4 neighbors[4]; neighbors[0] = texture2D(tex0, vTexCoord + vec2( texelSize.x, 0.0)); neighbors[1] = texture2D(tex0, vTexCoord + vec2(-texelSize.x, 0.0)); neighbors[2] = texture2D(tex0, vTexCoord + vec2(0.0, texelSize.y)); neighbors[3] = texture2D(tex0, vTexCoord + vec2(0.0, -texelSize.y)); for (int i = 0; i < 4; i++) { vec4 neighborColor = neighbors[i]; float neighborLum = luma(neighborColor.rgb); if (neighborLum > lum) { color = neighborColor; lum = neighborLum; } } gl_FragColor = color; } `),E(C,c.BLUR,`precision highp float; // Two-pass blur filter, unweighted kernel. // See also a similar blur at Adam Ferriss' repo of shader examples: // https://github.com/aferriss/p5jsShaderExamples/blob/gh-pages/4_image-effects/4-9_single-pass-blur/effect.frag uniform sampler2D tex0; varying vec2 vTexCoord; uniform vec2 direction; uniform vec2 canvasSize; uniform float radius; float random(vec2 p) { vec3 p3 = fract(vec3(p.xyx) * .1031); p3 += dot(p3, p3.yzx + 33.33); return fract((p3.x + p3.y) * p3.z); } // This isn't a real Gaussian weight, it's a quadratic weight. It's what the // CPU mode's blur uses though, so we also use it here to match. float quadWeight(float x, float e) { return pow(e-abs(x), 2.); } void main(){ vec2 uv = vTexCoord; // A reasonable maximum number of samples const float maxSamples = 64.0; float numSamples = floor(7. * radius); if (fract(numSamples / 2.) == 0.) { numSamples++; } vec4 avg = vec4(0.0); float total = 0.0; // Calculate the spacing to avoid skewing if numSamples > maxSamples float spacing = 1.0; if (numSamples > maxSamples) { spacing = numSamples / maxSamples; numSamples = maxSamples; } float randomOffset = (spacing - 1.0) * mix(-0.5, 0.5, random(gl_FragCoord.xy)); for (float i = 0.0; i < maxSamples; i++) { if (i >= numSamples) break; float sample = i * spacing - (numSamples - 1.0) * 0.5 * spacing + randomOffset; vec2 sampleCoord = uv + vec2(sample, sample) / canvasSize * direction; float weight = quadWeight(sample, (numSamples - 1.0) * 0.5 * spacing); avg += weight * texture2D(tex0, sampleCoord); total += weight; } avg /= total; gl_FragColor = avg; } `),E(C,c.POSTERIZE,`// Limit color space for a stylized cartoon / poster effect precision highp float; varying vec2 vTexCoord; uniform sampler2D tex0; uniform float filterParameter; vec3 quantize(vec3 color, float n) { // restrict values to N options/bins // and floor each channel to nearest value // // eg. when N = 5, values = 0.0, 0.25, 0.50, 0.75, 1.0 // then quantize (0.1, 0.7, 0.9) -> (0.0, 0.5, 1.0) color = color * n; color = floor(color); color = color / (n - 1.0); return color; } void main() { vec4 color = texture2D(tex0, vTexCoord); vec3 restrictedColor = quantize(color.rgb / color.a, filterParameter); gl_FragColor = vec4(restrictedColor.rgb * color.a, color.a); } `),E(C,c.OPAQUE,`// Set alpha channel to entirely opaque precision highp float; varying vec2 vTexCoord; uniform sampler2D tex0; void main() { vec4 color = texture2D(tex0, vTexCoord); gl_FragColor = vec4(color.rgb / color.a, 1.0); } `),E(C,c.INVERT,`// Set each pixel to inverse value // Note that original INVERT does not change the opacity, so this follows suit precision highp float; varying vec2 vTexCoord; uniform sampler2D tex0; void main() { vec4 color = texture2D(tex0, vTexCoord); vec3 origColor = color.rgb / color.a; vec3 invertedColor = vec3(1.0) - origColor; gl_FragColor = vec4(invertedColor * color.a, color.a); } `),E(C,c.THRESHOLD,`// Convert pixels to either white or black, // depending on if their luma is above or below filterParameter precision highp float; varying vec2 vTexCoord; uniform sampler2D tex0; uniform float filterParameter; float luma(vec3 color) { // weighted grayscale with luminance values return dot(color, vec3(0.2126, 0.7152, 0.0722)); } void main() { vec4 color = texture2D(tex0, vTexCoord); float gray = luma(color.rgb / color.a); // floor() used to match src/image/filters.js float threshold = floor(filterParameter * 255.0) / 255.0; float blackOrWhite = step(threshold, gray); gl_FragColor = vec4(vec3(blackOrWhite) * color.a, color.a); } `);var F=C;function z($,G,ce,Z,U,I,B,H,Y,ee){var oe=G.getParameter(G.FRAMEBUFFER_BINDING),ce=(G.bindFramebuffer(G.FRAMEBUFFER,ce),H===G.RGBA?4:3),he=I*B*ce,ae=Y===G.UNSIGNED_BYTE?Uint8Array:Float32Array;if($ instanceof ae&&$.length===he||($=new ae(he)),G.readPixels(Z,ee?ee-U-B:U,I,B,H,Y,$),G.bindFramebuffer(G.FRAMEBUFFER,oe),ee)for(var te=Math.floor(B/2),pe=new ae(I*ce),ne=0;ne>7,127&je,de>>7,127&de);for(var Oe=0;Oe>7,127&De,0,0)}}return{cellImageInfo:ie,dimOffset:ze,dimImageInfo:Te}}}}]),v}();c.default.RendererGL.prototype._renderText=function(v,w,_,E,S){if(this._textFont&&typeof this._textFont!="string"){if(!(S<=E)&&this._doFill){if(this._isOpenType()){v.push();var S=this._doStroke,T=this.drawMode,k=(this._doStroke=!1,this.drawMode=h.TEXTURE,this._textFont.font),A=(A=this._textFont._fontInfo)||(this._textFont._fontInfo=new x(k)),_=this._textFont._handleAlignment(this,w,_,E),E=this._textSize/k.unitsPerEm,O=(this.translate(_.x,_.y,0),this.scale(E,E,1),this.GL),_=!this._defaultFontShader,R=this._getFontShader(),C=(R.init(),R.bindShader(),_&&(R.setUniform("uGridImageSize",[64,64]),R.setUniform("uCellsImageSize",[64,64]),R.setUniform("uStrokeImageSize",[64,64]),R.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor),this.retainedMode.geometry.glyph),L=(C||((E=this._textGeom=new c.default.Geometry(1,1,function(){for(var te=0;te<=1;te++)for(var pe=0;pe<=1;pe++)this.vertices.push(new c.default.Vector(pe,te,0)),this.uvs.push(pe,te)})).computeFaces().computeNormals(),C=this.createBuffers("glyph",E)),!0),_=!1,E=void 0;try{for(var F,z=this.retainedMode.buffers.text[Symbol.iterator]();!(L=(F=z.next()).done);L=!0)F.value._prepareBuffer(C,R)}catch(te){_=!0,E=te}finally{try{L||z.return==null||z.return()}finally{if(_)throw E}}this._bindBuffer(C.indexBuffer,O.ELEMENT_ARRAY_BUFFER),R.setUniform("uMaterialColor",this.curFillColor),O.pixelStorei(O.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);try{var W=0,$=null,G=k.stringToGlyphs(w),K=!0,Z=!1,U=void 0;try{for(var I,B=G[Symbol.iterator]();!(K=(I=B.next()).done);K=!0){var H,Y,ee=I.value,oe=($&&(W+=k.getKerningValue($,ee)),A.getGlyphInfo(ee));oe.uGlyphRect&&(H=oe.rowInfo,Y=oe.colInfo,R.setUniform("uSamplerStrokes",oe.strokeImageInfo.imageData),R.setUniform("uSamplerRowStrokes",H.cellImageInfo.imageData),R.setUniform("uSamplerRows",H.dimImageInfo.imageData),R.setUniform("uSamplerColStrokes",Y.cellImageInfo.imageData),R.setUniform("uSamplerCols",Y.dimImageInfo.imageData),R.setUniform("uGridOffset",oe.uGridOffset),R.setUniform("uGlyphRect",oe.uGlyphRect),R.setUniform("uGlyphOffset",W),R.bindTextures(),O.drawElements(O.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)),W+=ee.advanceWidth,$=ee}}catch(te){Z=!0,U=te}finally{try{K||B.return==null||B.return()}finally{if(Z)throw U}}}finally{R.unbindShader(),this._doStroke=S,this.drawMode=T,O.pixelStorei(O.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),v.pop()}}else console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported");return v}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":264,"../core/main":275,"./p5.RendererGL.Retained":331,"./p5.Shader":333,"core-js/modules/es.array.iterator":161,"core-js/modules/es.object.get-own-property-descriptor":178,"core-js/modules/es.object.to-string":182,"core-js/modules/es.regexp.exec":187,"core-js/modules/es.string.iterator":192,"core-js/modules/es.string.split":198,"core-js/modules/es.string.sub":200,"core-js/modules/es.symbol":204,"core-js/modules/es.symbol.description":202,"core-js/modules/es.symbol.iterator":203,"core-js/modules/es.weak-map":236,"core-js/modules/web.dom-collections.iterator":238}]},{},[259])(259)})})(zL);var jH=zL.exports;const SH=Kt(jH),EH=()=>{const t=q.useRef(null);return q.useEffect(()=>{if(!t.current)return;const r=n=>{let i=[];n.setup=()=>{n.createCanvas(t.current.offsetWidth,300).parent(t.current);for(let l=0;l<5;l++)i.push({x:n.random(n.width),y:n.random(n.height),speedX:n.random(-3,3),speedY:n.random(-3,3),size:15})},n.draw=()=>{n.background(13,14,18,220),n.stroke(0,162,255),n.strokeWeight(2),n.noFill(),n.drawingContext.shadowBlur=15,n.drawingContext.shadowColor="#0EA5E9",n.rect(50,50,n.width-100,n.height-100,20),n.line(n.width/2,50,n.width/2,n.height-50),n.stroke(0,162,255,150),n.strokeWeight(1);for(let s=60;s{s.x+=s.speedX,s.y+=s.speedY,(s.xn.width-s.size)&&(s.speedX*=-1,n.drawingContext.shadowBlur=20,n.drawingContext.shadowColor="#0EA5E9",n.stroke(0,162,255),n.strokeWeight(2),n.noFill(),n.circle(s.x,s.y,s.size*2),n.drawingContext.shadowBlur=0),(s.yn.height-s.size)&&(s.speedY*=-1),n.noStroke(),n.fill(0,0,0,20),n.ellipse(s.x+2,s.y+2,s.size,s.size),n.drawingContext.shadowBlur=10,n.drawingContext.shadowColor="rgba(255, 220, 0, 0.5)",n.fill(255,220,0),n.noStroke(),n.circle(s.x,s.y,s.size),n.stroke(255,200,0),n.noFill(),n.arc(s.x,s.y,s.size,s.size,l+n.frameCount*.05,l+n.frameCount*.05+n.PI),n.drawingContext.shadowBlur=0})},n.windowResized=()=>{t.current&&n.resizeCanvas(t.current.offsetWidth,300)}},o=new SH(r);return()=>{o.remove()}},[]),D.jsx("div",{ref:t,className:"w-full h-[300px] bg-[#0D0E12] rounded-lg shadow-lg border border-[#0EA5E9]/20"})};function TH(t){return Object.prototype.toString.call(t)==="[object Object]"}function MO(t){return TH(t)||Array.isArray(t)}function OH(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function pS(t,r){const o=Object.keys(t),n=Object.keys(r);if(o.length!==n.length)return!1;const i=JSON.stringify(Object.keys(t.breakpoints||{})),a=JSON.stringify(Object.keys(r.breakpoints||{}));return i!==a?!1:o.every(s=>{const l=t[s],u=r[s];return typeof l=="function"?`${l}`==`${u}`:!MO(l)||!MO(u)?l===u:pS(l,u)})}function RO(t){return t.concat().sort((r,o)=>r.name>o.name?1:-1).map(r=>r.options)}function kH(t,r){if(t.length!==r.length)return!1;const o=RO(t),n=RO(r);return o.every((i,a)=>{const s=n[a];return pS(i,s)})}function mS(t){return typeof t=="number"}function Kx(t){return typeof t=="string"}function Mv(t){return typeof t=="boolean"}function IO(t){return Object.prototype.toString.call(t)==="[object Object]"}function Rr(t){return Math.abs(t)}function yS(t){return Math.sign(t)}function Af(t,r){return Rr(t-r)}function PH(t,r){if(t===0||r===0||Rr(t)<=Rr(r))return 0;const o=Af(Rr(t),Rr(r));return Rr(o/t)}function fh(t){return hh(t).map(Number)}function wi(t){return t[bp(t)]}function bp(t){return Math.max(0,t.length-1)}function gS(t,r){return r===bp(t)}function NO(t,r=0){return Array.from(Array(t),(o,n)=>r+n)}function hh(t){return Object.keys(t)}function VL(t,r){return[t,r].reduce((o,n)=>(hh(n).forEach(i=>{const a=o[i],s=n[i],l=IO(a)&&IO(s);o[i]=l?VL(a,s):s}),o),{})}function Zx(t,r){return typeof r.MouseEvent<"u"&&t instanceof r.MouseEvent}function CH(t,r){const o={start:n,center:i,end:a};function n(){return 0}function i(u){return a(u)/2}function a(u){return r-u}function s(u,c){return Kx(t)?o[t](u):t(r,u,c)}return{measure:s}}function ph(){let t=[];function r(i,a,s,l={passive:!0}){let u;if("addEventListener"in i)i.addEventListener(a,s,l),u=()=>i.removeEventListener(a,s,l);else{const c=i;c.addListener(s),u=()=>c.removeListener(s)}return t.push(u),n}function o(){t=t.filter(i=>i())}const n={add:r,clear:o};return n}function AH(t,r,o,n){const i=ph(),a=1e3/60;let s=null,l=0,u=0;function c(){i.add(t,"visibilitychange",()=>{t.hidden&&y()})}function h(){m(),i.clear()}function f(g){if(!u)return;s||(s=g);const b=g-s;for(s=g,l+=b;l>=a;)o(a),l-=a;const x=l/a;n(x),u&&r.requestAnimationFrame(f)}function d(){u||(u=r.requestAnimationFrame(f))}function m(){r.cancelAnimationFrame(u),s=null,l=0,u=0}function y(){s=null,l=0}return{init:c,destroy:h,start:d,stop:m,update:()=>o(a),render:n}}function MH(t,r){const o=r==="rtl",n=t==="y",i=n?"y":"x",a=n?"x":"y",s=!n&&o?-1:1,l=h(),u=f();function c(y){const{height:p,width:g}=y;return n?p:g}function h(){return n?"top":o?"right":"left"}function f(){return n?"bottom":o?"left":"right"}function d(y){return y*s}return{scroll:i,cross:a,startEdge:l,endEdge:u,measureSize:c,direction:d}}function Bl(t=0,r=0){const o=Rr(t-r);function n(c){return cr}function a(c){return n(c)||i(c)}function s(c){return a(c)?n(c)?t:r:c}function l(c){return o?c-o*Math.ceil((c-r)/o):c}return{length:o,max:r,min:t,constrain:s,reachedAny:a,reachedMax:i,reachedMin:n,removeOffset:l}}function GL(t,r,o){const{constrain:n}=Bl(0,t),i=t+1;let a=s(r);function s(d){return o?Rr((i+d)%i):n(d)}function l(){return a}function u(d){return a=s(d),f}function c(d){return h().set(l()+d)}function h(){return GL(t,l(),o)}const f={get:l,set:u,add:c,clone:h};return f}function RH(t,r,o,n,i,a,s,l,u,c,h,f,d,m,y,p,g,b,x){const{cross:v,direction:w}=t,_=["INPUT","SELECT","TEXTAREA"],E={passive:!1},S=ph(),T=ph(),k=Bl(50,225).constrain(m.measure(20)),A={mouse:300,touch:400},O={mouse:500,touch:600},R=y?43:25;let C=!1,L=0,F=0,z=!1,W=!1,$=!1,G=!1;function K(te){if(!x)return;function pe(fe){(Mv(x)||x(te,fe))&&Y(fe)}const ne=r;S.add(ne,"dragstart",fe=>fe.preventDefault(),E).add(ne,"touchmove",()=>{},E).add(ne,"touchend",()=>{}).add(ne,"touchstart",pe).add(ne,"mousedown",pe).add(ne,"touchcancel",oe).add(ne,"contextmenu",oe).add(ne,"click",ce,!0)}function Z(){S.clear(),T.clear()}function U(){const te=G?o:r;T.add(te,"touchmove",ee,E).add(te,"touchend",oe).add(te,"mousemove",ee,E).add(te,"mouseup",oe)}function I(te){const pe=te.nodeName||"";return _.includes(pe)}function B(){return(y?O:A)[G?"mouse":"touch"]}function H(te,pe){const ne=f.add(yS(te)*-1),fe=h.byDistance(te,!y).distance;return y||Rr(te)=2,!(pe&&te.button!==0)&&(I(te.target)||(z=!0,a.pointerDown(te),c.useFriction(0).useDuration(0),i.set(s),U(),L=a.readPoint(te),F=a.readPoint(te,v),d.emit("pointerDown")))}function ee(te){if(!Zx(te,n)&&te.touches.length>=2)return oe(te);const ne=a.readPoint(te),fe=a.readPoint(te,v),be=Af(ne,L),Ee=Af(fe,F);if(!W&&!G&&(!te.cancelable||(W=be>Ee,!W)))return oe(te);const re=a.pointerMove(te);be>p&&($=!0),c.useFriction(.3).useDuration(.75),l.start(),i.add(w(re)),te.preventDefault()}function oe(te){const ne=h.byDistance(0,!1).index!==f.get(),fe=a.pointerUp(te)*B(),be=H(w(fe),ne),Ee=PH(fe,be),re=R-10*Ee,se=b+Ee/50;W=!1,z=!1,T.clear(),c.useDuration(re).useFriction(se),u.distance(be,!y),G=!1,d.emit("pointerUp")}function ce(te){$&&(te.stopPropagation(),te.preventDefault(),$=!1)}function he(){return z}return{init:K,destroy:Z,pointerDown:he}}function IH(t,r){let n,i;function a(f){return f.timeStamp}function s(f,d){const y=`client${(d||t.scroll)==="x"?"X":"Y"}`;return(Zx(f,r)?f:f.touches[0])[y]}function l(f){return n=f,i=f,s(f)}function u(f){const d=s(f)-s(i),m=a(f)-a(n)>170;return i=f,m&&(n=f),d}function c(f){if(!n||!i)return 0;const d=s(i)-s(n),m=a(f)-a(n),y=a(f)-a(i)>170,p=d/m;return m&&!y&&Rr(p)>.1?p:0}return{pointerDown:l,pointerMove:u,pointerUp:c,readPoint:s}}function NH(){function t(o){const{offsetTop:n,offsetLeft:i,offsetWidth:a,offsetHeight:s}=o;return{top:n,right:i+a,bottom:n+s,left:i,width:a,height:s}}return{measure:t}}function LH(t){function r(n){return t*(n/100)}return{measure:r}}function DH(t,r,o,n,i,a,s){const l=[t].concat(n);let u,c,h=[],f=!1;function d(g){return i.measureSize(s.measure(g))}function m(g){if(!a)return;c=d(t),h=n.map(d);function b(x){for(const v of x){if(f)return;const w=v.target===t,_=n.indexOf(v.target),E=w?c:h[_],S=d(w?t:n[_]);if(Rr(S-E)>=.5){g.reInit(),r.emit("resize");break}}}u=new ResizeObserver(x=>{(Mv(a)||a(g,x))&&b(x)}),o.requestAnimationFrame(()=>{l.forEach(x=>u.observe(x))})}function y(){f=!0,u&&u.disconnect()}return{init:m,destroy:y}}function FH(t,r,o,n,i,a){let s=0,l=0,u=i,c=a,h=t.get(),f=0;function d(E){const S=E/1e3,T=u*S,k=n.get()-t.get(),A=!u;let O=0;return A?(s=0,o.set(n),t.set(n),O=k):(o.set(t),s+=k/T,s*=c,h+=s,t.add(s*S),O=h-f),l=yS(O),f=h,_}function m(){const E=n.get()-r.get();return Rr(E)<.001}function y(){return u}function p(){return l}function g(){return s}function b(){return v(i)}function x(){return w(a)}function v(E){return u=E,_}function w(E){return c=E,_}const _={direction:p,duration:y,velocity:g,seek:d,settled:m,useBaseFriction:x,useBaseDuration:b,useFriction:w,useDuration:v};return _}function $H(t,r,o,n,i){const a=i.measure(10),s=i.measure(50),l=Bl(.1,.99);let u=!1;function c(){return!(u||!t.reachedAny(o.get())||!t.reachedAny(r.get()))}function h(m){if(!c())return;const y=t.reachedMin(r.get())?"min":"max",p=Rr(t[y]-r.get()),g=o.get()-r.get(),b=l.constrain(p/s);o.subtract(g*b),!m&&Rr(g){const{min:g,max:b}=a,x=a.constrain(y),v=!p,w=gS(o,p);return v?b:w||c(g,x)?g:c(b,x)?b:x}).map(y=>parseFloat(y.toFixed(3)))}function d(){if(r<=t+i)return[a.max];if(n==="keepSnaps")return s;const{min:y,max:p}=l;return s.slice(y,p)}return{snapsContained:u,scrollContainLimit:l}}function BH(t,r,o){const n=r[0],i=o?n-t:wi(r);return{limit:Bl(i,n)}}function zH(t,r,o,n){const a=r.min+.1,s=r.max+.1,{reachedMin:l,reachedMax:u}=Bl(a,s);function c(d){return d===1?u(o.get()):d===-1?l(o.get()):!1}function h(d){if(!c(d))return;const m=t*(d*-1);n.forEach(y=>y.add(m))}return{loop:h}}function VH(t){const{max:r,length:o}=t;function n(a){const s=a-r;return o?s/-o:0}return{get:n}}function GH(t,r,o,n,i){const{startEdge:a,endEdge:s}=t,{groupSlides:l}=i,u=f().map(r.measure),c=d(),h=m();function f(){return l(n).map(p=>wi(p)[s]-p[0][a]).map(Rr)}function d(){return n.map(p=>o[a]-p[a]).map(p=>-Rr(p))}function m(){return l(c).map(p=>p[0]).map((p,g)=>p+u[g])}return{snaps:c,snapsAligned:h}}function WH(t,r,o,n,i,a){const{groupSlides:s}=i,{min:l,max:u}=n,c=h();function h(){const d=s(a),m=!t||r==="keepSnaps";return o.length===1?[a]:m?d:d.slice(l,u).map((y,p,g)=>{const b=!p,x=gS(g,p);if(b){const v=wi(g[0])+1;return NO(v)}if(x){const v=bp(a)-wi(g)[0]+1;return NO(v,wi(g)[0])}return y})}return{slideRegistry:c}}function HH(t,r,o,n,i){const{reachedAny:a,removeOffset:s,constrain:l}=n;function u(y){return y.concat().sort((p,g)=>Rr(p)-Rr(g))[0]}function c(y){const p=t?s(y):l(y),g=r.map((x,v)=>({diff:h(x-p,0),index:v})).sort((x,v)=>Rr(x.diff)-Rr(v.diff)),{index:b}=g[0];return{index:b,distance:p}}function h(y,p){const g=[y,y+o,y-o];if(!t)return y;if(!p)return u(g);const b=g.filter(x=>yS(x)===p);return b.length?u(b):wi(g)-o}function f(y,p){const g=r[y]-i.get(),b=h(g,p);return{index:y,distance:b}}function d(y,p){const g=i.get()+y,{index:b,distance:x}=c(g),v=!t&&a(g);if(!p||v)return{index:b,distance:y};const w=r[b]-x,_=y+h(w,0);return{index:b,distance:_}}return{byDistance:d,byIndex:f,shortcut:h}}function qH(t,r,o,n,i,a,s){function l(f){const d=f.distance,m=f.index!==r.get();a.add(d),d&&(n.duration()?t.start():(t.update(),t.render(1),t.update())),m&&(o.set(r.get()),r.set(f.index),s.emit("select"))}function u(f,d){const m=i.byDistance(f,d);l(m)}function c(f,d){const m=r.clone().set(f),y=i.byIndex(m.get(),d);l(y)}return{distance:u,index:c}}function XH(t,r,o,n,i,a,s,l){const u={passive:!0,capture:!0};let c=0;function h(m){if(!l)return;function y(p){if(new Date().getTime()-c>10)return;s.emit("slideFocusStart"),t.scrollLeft=0;const x=o.findIndex(v=>v.includes(p));mS(x)&&(i.useDuration(0),n.index(x,0),s.emit("slideFocus"))}a.add(document,"keydown",f,!1),r.forEach((p,g)=>{a.add(p,"focus",b=>{(Mv(l)||l(m,b))&&y(g)},u)})}function f(m){m.code==="Tab"&&(c=new Date().getTime())}return{init:h}}function cf(t){let r=t;function o(){return r}function n(u){r=s(u)}function i(u){r+=s(u)}function a(u){r-=s(u)}function s(u){return mS(u)?u:u.get()}return{get:o,set:n,add:i,subtract:a}}function WL(t,r){const o=t.scroll==="x"?a:s,n=r.style;let i=!1;function a(f){return`translate3d(${f}px,0px,0px)`}function s(f){return`translate3d(0px,${f}px,0px)`}function l(f){i||(n.transform=o(t.direction(f)))}function u(f){i=!f}function c(){i||(n.transform="",r.getAttribute("style")||r.removeAttribute("style"))}return{clear:c,to:l,toggleActive:u}}function YH(t,r,o,n,i,a,s,l,u){const h=fh(i),f=fh(i).reverse(),d=b().concat(x());function m(S,T){return S.reduce((k,A)=>k-i[A],T)}function y(S,T){return S.reduce((k,A)=>m(k,T)>0?k.concat([A]):k,[])}function p(S){return a.map((T,k)=>({start:T-n[k]+.5+S,end:T+r-.5+S}))}function g(S,T,k){const A=p(T);return S.map(O=>{const R=k?0:-o,C=k?o:0,L=k?"end":"start",F=A[O][L];return{index:O,loopPoint:F,slideLocation:cf(-1),translate:WL(t,u[O]),target:()=>l.get()>F?R:C}})}function b(){const S=s[0],T=y(f,S);return g(T,o,!1)}function x(){const S=r-s[0]-1,T=y(h,S);return g(T,-o,!0)}function v(){return d.every(({index:S})=>{const T=h.filter(k=>k!==S);return m(T,r)<=.1})}function w(){d.forEach(S=>{const{target:T,translate:k,slideLocation:A}=S,O=T();O!==A.get()&&(k.to(O),A.set(O))})}function _(){d.forEach(S=>S.translate.clear())}return{canLoop:v,clear:_,loop:w,loopPoints:d}}function KH(t,r,o){let n,i=!1;function a(u){if(!o)return;function c(h){for(const f of h)if(f.type==="childList"){u.reInit(),r.emit("slidesChanged");break}}n=new MutationObserver(h=>{i||(Mv(o)||o(u,h))&&c(h)}),n.observe(t,{childList:!0})}function s(){n&&n.disconnect(),i=!0}return{init:a,destroy:s}}function ZH(t,r,o,n){const i={};let a=null,s=null,l,u=!1;function c(){l=new IntersectionObserver(y=>{u||(y.forEach(p=>{const g=r.indexOf(p.target);i[g]=p}),a=null,s=null,o.emit("slidesInView"))},{root:t.parentElement,threshold:n}),r.forEach(y=>l.observe(y))}function h(){l&&l.disconnect(),u=!0}function f(y){return hh(i).reduce((p,g)=>{const b=parseInt(g),{isIntersecting:x}=i[b];return(y&&x||!y&&!x)&&p.push(b),p},[])}function d(y=!0){if(y&&a)return a;if(!y&&s)return s;const p=f(y);return y&&(a=p),y||(s=p),p}return{init:c,destroy:h,get:d}}function QH(t,r,o,n,i,a){const{measureSize:s,startEdge:l,endEdge:u}=t,c=o[0]&&i,h=y(),f=p(),d=o.map(s),m=g();function y(){if(!c)return 0;const x=o[0];return Rr(r[l]-x[l])}function p(){if(!c)return 0;const x=a.getComputedStyle(wi(n));return parseFloat(x.getPropertyValue(`margin-${u}`))}function g(){return o.map((x,v,w)=>{const _=!v,E=gS(w,v);return _?d[v]+h:E?d[v]+f:w[v+1][l]-x[l]}).map(Rr)}return{slideSizes:d,slideSizesWithGaps:m,startGap:h,endGap:f}}function JH(t,r,o,n,i,a,s,l,u){const{startEdge:c,endEdge:h,direction:f}=t,d=mS(o);function m(b,x){return fh(b).filter(v=>v%x===0).map(v=>b.slice(v,v+x))}function y(b){return b.length?fh(b).reduce((x,v,w)=>{const _=wi(x)||0,E=_===0,S=v===bp(b),T=i[c]-a[_][c],k=i[c]-a[v][h],A=!n&&E?f(s):0,O=!n&&S?f(l):0,R=Rr(k-O-(T+A));return w&&R>r+u&&x.push(v),S&&x.push(b.length),x},[]).map((x,v,w)=>{const _=Math.max(w[v-1]||0);return b.slice(_,x)}):[]}function p(b){return d?m(b,o):y(b)}return{groupSlides:p}}function eq(t,r,o,n,i,a,s){const{align:l,axis:u,direction:c,startIndex:h,loop:f,duration:d,dragFree:m,dragThreshold:y,inViewThreshold:p,slidesToScroll:g,skipSnaps:b,containScroll:x,watchResize:v,watchSlides:w,watchDrag:_,watchFocus:E}=a,S=2,T=NH(),k=T.measure(r),A=o.map(T.measure),O=MH(u,c),R=O.measureSize(k),C=LH(R),L=CH(l,R),F=!f&&!!x,z=f||!!x,{slideSizes:W,slideSizesWithGaps:$,startGap:G,endGap:K}=QH(O,k,A,o,z,i),Z=JH(O,R,g,f,k,A,G,K,S),{snaps:U,snapsAligned:I}=GH(O,L,k,A,Z),B=-wi(U)+wi($),{snapsContained:H,scrollContainLimit:Y}=UH(R,B,I,x,S),ee=F?H:I,{limit:oe}=BH(B,ee,f),ce=GL(bp(ee),h,f),he=ce.clone(),ae=fh(o),te=({dragHandler:ke,scrollBody:ie,scrollBounds:ue,options:{loop:J}},de)=>{J||ue.constrain(ke.pointerDown()),ie.seek(de)},pe=({scrollBody:ke,translate:ie,location:ue,offsetLocation:J,scrollLooper:de,slideLooper:je,dragHandler:Oe,animation:De,eventHandler:Fe,scrollBounds:We,options:{loop:He}},Je)=>{const ht=ke.settled(),mt=!We.shouldConstrain(),st=He?ht:ht&&mt;st&&!Oe.pointerDown()&&(De.stop(),Fe.emit("settle")),st||Fe.emit("scroll");const xt=ue.get()*Je+re.get()*(1-Je);J.set(xt),He&&(de.loop(ke.direction()),je.loop()),ie.to(J.get())},ne=AH(n,i,ke=>te(Be,ke),ke=>pe(Be,ke)),fe=.68,be=ee[ce.get()],Ee=cf(be),re=cf(be),se=cf(be),ye=cf(be),Pe=FH(Ee,se,re,ye,d,fe),_e=HH(f,ee,B,oe,ye),Ne=qH(ne,ce,he,Pe,_e,ye,s),$e=VH(oe),ze=ph(),Ke=ZH(r,o,s,p),{slideRegistry:Xe}=WH(F,x,ee,Y,Z,ae),Te=XH(t,o,Xe,Ne,Pe,ze,s,E),Be={ownerDocument:n,ownerWindow:i,eventHandler:s,containerRect:k,slideRects:A,animation:ne,axis:O,dragHandler:RH(O,t,n,i,ye,IH(O,i),Ee,ne,Ne,Pe,_e,ce,s,C,m,y,b,fe,_),eventStore:ze,percentOfView:C,index:ce,indexPrevious:he,limit:oe,location:Ee,offsetLocation:se,previousLocation:re,options:a,resizeHandler:DH(r,s,i,o,O,v,T),scrollBody:Pe,scrollBounds:$H(oe,se,ye,Pe,C),scrollLooper:zH(B,oe,se,[Ee,se,re,ye]),scrollProgress:$e,scrollSnapList:ee.map($e.get),scrollSnaps:ee,scrollTarget:_e,scrollTo:Ne,slideLooper:YH(O,R,B,W,$,U,ee,se,o),slideFocus:Te,slidesHandler:KH(r,s,w),slidesInView:Ke,slideIndexes:ae,slideRegistry:Xe,slidesToScroll:Z,target:ye,translate:WL(O,r)};return Be}function tq(){let t={},r;function o(c){r=c}function n(c){return t[c]||[]}function i(c){return n(c).forEach(h=>h(r,c)),u}function a(c,h){return t[c]=n(c).concat([h]),u}function s(c,h){return t[c]=n(c).filter(f=>f!==h),u}function l(){t={}}const u={init:o,emit:i,off:s,on:a,clear:l};return u}const rq={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function nq(t){function r(a,s){return VL(a,s||{})}function o(a){const s=a.breakpoints||{},l=hh(s).filter(u=>t.matchMedia(u).matches).map(u=>s[u]).reduce((u,c)=>r(u,c),{});return r(a,l)}function n(a){return a.map(s=>hh(s.breakpoints||{})).reduce((s,l)=>s.concat(l),[]).map(t.matchMedia)}return{mergeOptions:r,optionsAtMedia:o,optionsMediaQueries:n}}function oq(t){let r=[];function o(a,s){return r=s.filter(({options:l})=>t.optionsAtMedia(l).active!==!1),r.forEach(l=>l.init(a,t)),s.reduce((l,u)=>Object.assign(l,{[u.name]:u}),{})}function n(){r=r.filter(a=>a.destroy())}return{init:o,destroy:n}}function Cy(t,r,o){const n=t.ownerDocument,i=n.defaultView,a=nq(i),s=oq(a),l=ph(),u=tq(),{mergeOptions:c,optionsAtMedia:h,optionsMediaQueries:f}=a,{on:d,off:m,emit:y}=u,p=O;let g=!1,b,x=c(rq,Cy.globalOptions),v=c(x),w=[],_,E,S;function T(){const{container:ae,slides:te}=v;E=(Kx(ae)?t.querySelector(ae):ae)||t.children[0];const ne=Kx(te)?E.querySelectorAll(te):te;S=[].slice.call(ne||E.children)}function k(ae){const te=eq(t,E,S,n,i,ae,u);if(ae.loop&&!te.slideLooper.canLoop()){const pe=Object.assign({},ae,{loop:!1});return k(pe)}return te}function A(ae,te){g||(x=c(x,ae),v=h(x),w=te||w,T(),b=k(v),f([x,...w.map(({options:pe})=>pe)]).forEach(pe=>l.add(pe,"change",O)),v.active&&(b.translate.to(b.location.get()),b.animation.init(),b.slidesInView.init(),b.slideFocus.init(he),b.eventHandler.init(he),b.resizeHandler.init(he),b.slidesHandler.init(he),b.options.loop&&b.slideLooper.loop(),E.offsetParent&&S.length&&b.dragHandler.init(he),_=s.init(he,w)))}function O(ae,te){const pe=Z();R(),A(c({startIndex:pe},ae),te),u.emit("reInit")}function R(){b.dragHandler.destroy(),b.eventStore.clear(),b.translate.clear(),b.slideLooper.clear(),b.resizeHandler.destroy(),b.slidesHandler.destroy(),b.slidesInView.destroy(),b.animation.destroy(),s.destroy(),l.clear()}function C(){g||(g=!0,l.clear(),R(),u.emit("destroy"),u.clear())}function L(ae,te,pe){!v.active||g||(b.scrollBody.useBaseFriction().useDuration(te===!0?0:v.duration),b.scrollTo.index(ae,pe||0))}function F(ae){const te=b.index.add(1).get();L(te,ae,-1)}function z(ae){const te=b.index.add(-1).get();L(te,ae,1)}function W(){return b.index.add(1).get()!==Z()}function $(){return b.index.add(-1).get()!==Z()}function G(){return b.scrollSnapList}function K(){return b.scrollProgress.get(b.location.get())}function Z(){return b.index.get()}function U(){return b.indexPrevious.get()}function I(){return b.slidesInView.get()}function B(){return b.slidesInView.get(!1)}function H(){return _}function Y(){return b}function ee(){return t}function oe(){return E}function ce(){return S}const he={canScrollNext:W,canScrollPrev:$,containerNode:oe,internalEngine:Y,destroy:C,off:m,on:d,emit:y,plugins:H,previousScrollSnap:U,reInit:p,rootNode:ee,scrollNext:F,scrollPrev:z,scrollProgress:K,scrollSnapList:G,scrollTo:L,selectedScrollSnap:Z,slideNodes:ce,slidesInView:I,slidesNotInView:B};return A(r,o),setTimeout(()=>u.emit("init"),0),he}Cy.globalOptions=void 0;function vS(t={},r=[]){const o=q.useRef(t),n=q.useRef(r),[i,a]=q.useState(),[s,l]=q.useState(),u=q.useCallback(()=>{i&&i.reInit(o.current,n.current)},[i]);return q.useEffect(()=>{pS(o.current,t)||(o.current=t,u())},[t,u]),q.useEffect(()=>{kH(n.current,r)||(n.current=r,u())},[r,u]),q.useEffect(()=>{if(OH()&&s){Cy.globalOptions=vS.globalOptions;const c=Cy(s,o.current,n.current);return a(c),()=>c.destroy()}else a(void 0)},[s,a]),[l,i]}vS.globalOptions=void 0;const HL=q.createContext(null);function Rv(){const t=q.useContext(HL);if(!t)throw new Error("useCarousel must be used within a ");return t}const Qx=q.forwardRef(({orientation:t="horizontal",opts:r,setApi:o,plugins:n,className:i,children:a,...s},l)=>{const[u,c]=vS({...r,axis:t==="horizontal"?"x":"y"},n),[h,f]=q.useState(!1),[d,m]=q.useState(!1),y=q.useCallback(x=>{x&&(f(x.canScrollPrev()),m(x.canScrollNext()))},[]),p=q.useCallback(()=>{c==null||c.scrollPrev()},[c]),g=q.useCallback(()=>{c==null||c.scrollNext()},[c]),b=q.useCallback(x=>{x.key==="ArrowLeft"?(x.preventDefault(),p()):x.key==="ArrowRight"&&(x.preventDefault(),g())},[p,g]);return q.useEffect(()=>{!c||!o||o(c)},[c,o]),q.useEffect(()=>{if(c)return y(c),c.on("reInit",y),c.on("select",y),()=>{c==null||c.off("select",y)}},[c,y]),D.jsx(HL.Provider,{value:{carouselRef:u,api:c,opts:r,orientation:t||((r==null?void 0:r.axis)==="y"?"vertical":"horizontal"),scrollPrev:p,scrollNext:g,canScrollPrev:h,canScrollNext:d},children:D.jsx("div",{ref:l,onKeyDownCapture:b,className:St("relative",i),role:"region","aria-roledescription":"carousel",...s,children:a})})});Qx.displayName="Carousel";const Jx=q.forwardRef(({className:t,...r},o)=>{const{carouselRef:n,orientation:i}=Rv();return D.jsx("div",{ref:n,className:"overflow-hidden",children:D.jsx("div",{ref:o,className:St("flex",i==="horizontal"?"-ml-4":"-mt-4 flex-col",t),...r})})});Jx.displayName="CarouselContent";const df=q.forwardRef(({className:t,...r},o)=>{const{orientation:n}=Rv();return D.jsx("div",{ref:o,role:"group","aria-roledescription":"slide",className:St("min-w-0 shrink-0 grow-0 basis-full",n==="horizontal"?"pl-4":"pt-4",t),...r})});df.displayName="CarouselItem";const ew=q.forwardRef(({className:t,variant:r="outline",size:o="icon",...n},i)=>{const{orientation:a,scrollPrev:s,canScrollPrev:l}=Rv();return D.jsxs(tr,{ref:i,variant:r,size:o,className:St("absolute h-8 w-8 rounded-full",a==="horizontal"?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!l,onClick:s,...n,children:[D.jsx(xB,{className:"h-4 w-4"}),D.jsx("span",{className:"sr-only",children:"Previous slide"})]})});ew.displayName="CarouselPrevious";const tw=q.forwardRef(({className:t,variant:r="outline",size:o="icon",...n},i)=>{const{orientation:a,scrollNext:s,canScrollNext:l}=Rv();return D.jsxs(tr,{ref:i,variant:r,size:o,className:St("absolute h-8 w-8 rounded-full",a==="horizontal"?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!l,onClick:s,...n,children:[D.jsx(xy,{className:"h-4 w-4"}),D.jsx("span",{className:"sr-only",children:"Next slide"})]})});tw.displayName="CarouselNext";const Ib={ES:"Spain",SE:"Sweden",DE:"Germany",IT:"Italy"},iq=[{question:"How do I book a padel court?",answer:"Booking a padel court is simple! Browse through our available courts, select your preferred location and time slot, and follow the booking process. You can pay securely online and receive instant confirmation."},{question:"What's included in a court booking?",answer:"A standard court booking includes the court rental for your selected time slot. Some facilities may offer additional services like equipment rental, coaching, or access to changing rooms. Check individual court listings for specific amenities."},{question:"Can I cancel or modify my booking?",answer:"Yes, most bookings can be modified or cancelled up to 24 hours before the scheduled time. Please check the specific cancellation policy for your chosen court as policies may vary by location."},{question:"Are there courts suitable for beginners?",answer:"Absolutely! We have courts suitable for all skill levels. Many facilities offer beginner-friendly sessions and equipment rental. You can filter courts based on your experience level and find the perfect match."}],aq=()=>{const[t,r]=q.useState("DE"),[o,n]=q.useState(null),[i,a]=q.useState(0),[s,l]=q.useState(),u=y=>y==="indoor"||y==="outdoor"?y:"indoor",{data:c,isLoading:h}=Ty({queryKey:["featuredCourts"],queryFn:async()=>{const{data:y,error:p}=await rr.from("courts").select(` *, reviews!left ( rating ) `).order("created_at",{ascending:!1});if(p)throw p;return y.map(x=>{const v=x.reviews||[],w=v.length>0?v.reduce((_,E)=>_+E.rating,0)/v.length:0;return{...x,avgRating:w,court_type:u(x.court_type)}}).sort(()=>.5-Math.random()).slice(0,3)}}),{data:f,isLoading:d}=Ty({queryKey:["courts",t],queryFn:async()=>{const{data:y,error:p}=await rr.from("courts").select(` *, reviews!left ( rating ) `).eq("country",t).order("created_at",{ascending:!1});if(p)throw p;return y.map(b=>{const x=b.reviews||[],v=x.length>0?x.reduce((w,_)=>w+_.rating,0)/x.length:0;return{...b,avgRating:v,court_type:u(b.court_type)}}).sort((b,x)=>x.avgRating-b.avgRating).slice(0,5)}});q.useEffect(()=>{s&&s.on("select",()=>{a(s.selectedScrollSnap())})},[s]);const m=(y,p)=>{let g=Math.max(0,y-1),b=Math.min(p-1,g+2);return b-g<2&&(g=Math.max(0,b-2)),Array.from({length:3},(x,v)=>g+v).filter(x=>xD.jsx("div",{className:"h-64 bg-gray-100 animate-pulse rounded-lg"},y))}):c&&c.length>0?D.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:c.map(y=>{var p;return D.jsx(Yx,{id:y.id,name:y.name,location:y.location,rating:y.avgRating,imageUrl:(p=y.images)==null?void 0:p[0],isPremium:y.is_premium,country:y.country,courtType:y.court_type,images:y.images},y.id)})}):D.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No featured courts available yet"})]}),D.jsx("section",{className:"mt-16 mb-16",children:D.jsxs("div",{className:"max-w-5xl mx-auto",children:[D.jsx("h2",{className:"text-2xl font-semibold mb-6 text-center",children:"Experience the Energy of Padel"}),D.jsx(EH,{})]})}),D.jsxs("section",{className:"mt-12",children:[D.jsx("h2",{className:"text-2xl font-semibold mb-6",children:"Select Country"}),D.jsx(wH,{selectedCountry:t,onSelect:r})]}),D.jsxs("section",{className:"mt-12",children:[D.jsxs("div",{className:"flex items-center justify-between mb-6",children:[D.jsxs("h2",{className:"text-2xl font-semibold flex items-center gap-2",children:[D.jsx("img",{src:`https://flagcdn.com/${t.toLowerCase()}.svg`,alt:Ib[t],className:"w-6 h-4"}),Ib[t]]}),D.jsxs(kr,{to:`/padel-courts-${t.toLowerCase()==="es"?"spain":t.toLowerCase()==="se"?"sweden":t.toLowerCase()==="de"?"germany":"italy"}`,className:"text-brand-500 hover:text-brand-600 flex items-center gap-1",children:["View all ",D.jsx(SB,{className:"w-4 h-4"})]})]}),D.jsxs(Qx,{opts:{align:"start",loop:!1},className:"w-full",setApi:l,children:[D.jsx(Jx,{children:d?[1,2,3].map(y=>D.jsx(df,{className:"md:basis-1/3",children:D.jsx("div",{className:"h-64 bg-gray-100 animate-pulse rounded-lg"})},y)):f&&f.length>0?f.map(y=>{var p;return D.jsx(df,{className:"md:basis-1/3",children:D.jsx(Yx,{id:y.id,name:y.name,location:y.location,rating:y.avgRating,imageUrl:(p=y.images)==null?void 0:p[0],isPremium:y.is_premium,country:y.country,courtType:y.court_type,images:y.images})},y.id)}):D.jsx(df,{className:"md:basis-full",children:D.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:["No courts available in ",Ib[t]," yet"]})})}),D.jsxs("div",{className:"flex items-center justify-center gap-2 mt-4",children:[D.jsx(ew,{className:"relative static"}),D.jsx("div",{className:"flex gap-2",children:m(i,(f==null?void 0:f.length)||0).map(y=>D.jsx("div",{className:`h-2 w-2 rounded-full transition-colors cursor-pointer ${y===i?"bg-brand-500":"bg-gray-300"}`,onClick:()=>{s&&s.scrollTo(y)}},y))}),D.jsx(tw,{className:"relative static"})]})]})]}),D.jsx("section",{className:"mt-24 bg-gradient-to-br from-brand-500/10 to-brand-700/10 rounded-2xl p-6 md:p-12",children:D.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8 md:gap-12 items-center",children:[D.jsxs("div",{className:"space-y-4 md:space-y-6",children:[D.jsx("h2",{className:"text-2xl md:text-3xl font-bold",children:"Experience Premium Padel Courts"}),D.jsx("p",{className:"text-base md:text-lg text-muted-foreground",children:"Discover state-of-the-art facilities, professional-grade courts, and an active community of padel enthusiasts. Whether you're a beginner or a pro, find the perfect court for your game."}),D.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[D.jsx(kr,{to:"/padel-courts-worldwide",children:D.jsx(tr,{size:"lg",className:"w-full sm:w-auto bg-brand-500 hover:bg-brand-600",children:"Find Courts Near You"})}),D.jsx(kr,{to:"/about",children:D.jsx(tr,{size:"lg",variant:"outline",className:"w-full sm:w-auto",children:"Learn More"})})]})]}),D.jsx("div",{className:"relative mt-6 md:mt-0",children:D.jsx("img",{src:"/lovable-uploads/81d6c33a-3033-4fa9-8e45-b27ea778afd6.png",alt:"Premium Padel Courts",className:"rounded-lg shadow-xl w-full"})})]})}),D.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8 py-12",children:[D.jsx("div",{className:"bg-gradient-to-br from-brand-500 to-brand-700 rounded-2xl p-8 text-white hover:shadow-xl transition-all duration-300 group",children:D.jsxs("div",{className:"space-y-4",children:[D.jsx("div",{className:"w-12 h-12 bg-white/10 rounded-lg flex items-center justify-center",children:D.jsx(Gm,{className:"w-6 h-6 text-white"})}),D.jsx("h2",{className:"text-2xl font-bold",children:"List Your Padel Court"}),D.jsx("p",{className:"text-white/80",children:"Own a padel facility? Join our network and reach thousands of players looking for courts like yours."}),D.jsx(kr,{to:"/submit-court",children:D.jsx(tr,{size:"lg",variant:"secondary",className:"mt-4 w-full sm:w-auto bg-white text-brand-600 hover:bg-white/90",children:"Get Started"})})]})}),D.jsx("div",{className:"bg-gradient-to-br from-[#2C3E50] to-[#3498DB] rounded-2xl p-8 text-white hover:shadow-xl transition-all duration-300 group",children:D.jsxs("div",{className:"space-y-4",children:[D.jsx("div",{className:"w-12 h-12 bg-white/10 rounded-lg flex items-center justify-center",children:D.jsx(Wj,{className:"w-6 h-6 text-white"})}),D.jsx("h2",{className:"text-2xl font-bold",children:"Explore Courts Worldwide"}),D.jsx("p",{className:"text-white/80",children:"Discover premium padel facilities across Europe. Find your next game in Spain, Sweden, Italy, or Germany."}),D.jsx(kr,{to:"/padel-courts-worldwide",className:"inline-block w-full sm:w-auto",children:D.jsxs(tr,{size:"lg",variant:"secondary",className:"mt-4 w-full sm:w-auto bg-white text-[#2C3E50] hover:bg-white/90 group-hover:gap-2 transition-all duration-300",children:[D.jsx("span",{children:"View All Countries"}),D.jsx(xy,{className:"w-5 h-5 hidden group-hover:inline-block"})]})})]})})]}),D.jsxs("section",{className:"mt-24",children:[D.jsx("h2",{className:"text-2xl font-semibold text-center mb-12",children:"Trusted by Leading Brands"}),D.jsxs(Qx,{opts:{align:"start",loop:!0},className:"w-full",children:[D.jsx(Jx,{className:"px-4",children:[1,2,3,4].map((y,p)=>D.jsx(df,{className:"basis-1/2 md:basis-1/4",children:D.jsx("div",{className:"p-4",children:D.jsx("img",{src:"/placeholder.svg",alt:`Partner ${p+1}`,className:"h-12 mx-auto opacity-70"})})},p))}),D.jsx(ew,{}),D.jsx(tw,{})]})]}),D.jsx("section",{className:"mt-24",children:D.jsxs("div",{className:"max-w-3xl mx-auto",children:[D.jsx("h2",{className:"text-3xl font-bold text-center mb-12",children:"Frequently Asked Questions"}),D.jsx("div",{className:"space-y-4",children:iq.map((y,p)=>D.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[D.jsxs("button",{className:"w-full px-6 py-4 flex justify-between items-center hover:bg-muted/50 transition-colors",onClick:()=>n(o===p?null:p),children:[D.jsx("span",{className:"font-medium text-lg text-left",children:y.question}),D.jsx(gv,{className:`w-5 h-5 transition-transform ${o===p?"rotate-180":""}`})]}),o===p&&D.jsx("div",{className:"px-6 py-4 bg-muted/30",children:D.jsx("p",{className:"text-muted-foreground",children:y.answer})})]},p))})]})})]})]}),D.jsx(Qi,{})]})},bS=q.forwardRef(({className:t,...r},o)=>D.jsx("textarea",{className:St("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:o,...r}));bS.displayName="Textarea";const LO=["Thomas G.","Sarah M.","Michael R.","Emma L.","David P.","Julia K.","Robert S.","Anna W.","John D.","Sophie H."],xp=({courtData:t})=>{const[r,o]=q.useState(t),[n,i]=q.useState(""),[a,s]=q.useState(!1),[l,u]=q.useState(""),[c,h]=q.useState(5),[f,d]=q.useState([]),[m,y]=q.useState(!1),p=$a(),{id:g}=yp(),{toast:b}=Fa();q.useEffect(()=>{var T;if(t){o(t),i(((T=t.images)==null?void 0:T[0])||""),x(t.id);return}g&&(async()=>{var k;try{const A=g?parseInt(g,10):null;if(!A||isNaN(A)){b({title:"Invalid court ID",description:"The provided court ID is invalid.",variant:"destructive"}),p("/");return}const{data:O,error:R}=await rr.from("courts").select("*").eq("id",A).maybeSingle();if(R)throw R;if(!O){b({title:"Court not found",description:"The requested court could not be found.",variant:"destructive"}),p("/");return}o(O),i(((k=O.images)==null?void 0:k[0])||""),x(O.id)}catch(A){console.error("Error fetching court:",A),b({title:"Error",description:"Failed to load court details.",variant:"destructive"})}})()},[g,t,p,b]);const x=async S=>{try{const{data:T,error:k}=await rr.from("reviews").select("*").eq("court_id",S).order("created_at",{ascending:!1});if(k)throw k;d(T||[])}catch(T){console.error("Error fetching reviews:",T)}},v=()=>{if(!rr.auth.getSession()){p(`/auth?redirectTo=${window.location.pathname}`);return}s(!0)},w=async()=>{try{y(!0);const S=await rr.auth.getSession();if(!S.data.session){b({title:"Authentication required",description:"Please sign in to submit a review.",variant:"destructive"});return}const{error:T}=await rr.from("reviews").insert({court_id:r.id,user_id:S.data.session.user.id,rating:c,comment:l});if(T){if(T.code==="23505")b({title:"Already reviewed",description:"You have already reviewed this court.",variant:"destructive"});else throw T;return}b({title:"Review submitted!",description:"Thank you for your feedback."}),s(!1),u(""),h(5),x(r.id)}catch(S){console.error("Error submitting review:",S),b({title:"Error",description:"Failed to submit review. Please try again.",variant:"destructive"})}finally{y(!1)}},_=S=>{if(!S)return"Not specified";try{const[T,k]=S.split(":");return`${T}:${k}`}catch{return S}},E=()=>LO[Math.floor(Math.random()*LO.length)];return r?D.jsxs("div",{className:"min-h-screen bg-background",children:[D.jsxs("div",{className:"p-6",children:[D.jsx(Zi,{}),D.jsxs("div",{className:"max-w-6xl mx-auto space-y-8",children:[D.jsxs("header",{className:"flex flex-col md:flex-row justify-between items-start gap-6",children:[D.jsxs("div",{className:"space-y-2",children:[D.jsx("h1",{className:"text-4xl font-bold tracking-tight text-gradient",children:r.name}),D.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[D.jsx(lN,{className:"w-4 h-4"}),D.jsx("span",{children:r.location})]})]}),D.jsxs("div",{className:"flex gap-4",children:[r.website&&D.jsxs(tr,{variant:"outline",className:"gap-2",onClick:()=>window.open(r.website,"_blank"),children:[D.jsx(kB,{className:"w-4 h-4"}),"Visit Website"]}),r.booking_url&&D.jsxs(tr,{className:"bg-brand-500 hover:bg-brand-600 gap-2",onClick:()=>window.open(r.booking_url,"_blank"),children:[D.jsx(gx,{className:"w-4 h-4"}),"Book Now"]})]})]}),D.jsxs("div",{className:"space-y-4",children:[D.jsx("div",{className:"aspect-video w-full rounded-lg overflow-hidden bg-black/20",children:r.images&&r.images.length>0&&D.jsx("img",{src:n||r.images[0],alt:"Court View",className:"w-full h-full object-cover"})}),D.jsx("div",{className:"flex gap-4 overflow-x-auto pb-2",children:r.images&&r.images.map((S,T)=>D.jsx("button",{onClick:()=>i(S),className:`relative aspect-video w-32 rounded-md overflow-hidden ${n===S?"ring-2 ring-brand-500":""}`,children:D.jsx("img",{src:S,alt:`Court View ${T+1}`,className:"w-full h-full object-cover"})},T))})]}),D.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:[D.jsxs("div",{className:"md:col-span-2 space-y-8",children:[D.jsxs(Kn,{className:"p-6 glass-card",children:[D.jsx("h2",{className:"text-xl font-semibold mb-4",children:"About"}),D.jsx("p",{className:"text-muted-foreground",children:r.description})]}),D.jsxs(Kn,{className:"p-6 glass-card",children:[D.jsx("h2",{className:"text-xl font-semibold mb-4",children:"Features"}),D.jsx("div",{className:"grid grid-cols-2 gap-4",children:r.features&&r.features.split(", ").map((S,T)=>D.jsxs("div",{className:"flex items-center gap-2",children:[D.jsx(TB,{className:"w-4 h-4 text-brand-400"}),D.jsx("span",{children:S})]},T))})]}),a&&D.jsxs(Kn,{className:"p-6 glass-card",children:[D.jsx("h2",{className:"text-xl font-semibold mb-4",children:"Write a Review"}),D.jsxs("div",{className:"space-y-4",children:[D.jsx("div",{className:"flex items-center gap-2",children:[1,2,3,4,5].map(S=>D.jsx("button",{onClick:()=>h(S),className:"focus:outline-none",children:D.jsx(Pl,{className:`w-6 h-6 ${S<=c?"text-brand-400 fill-brand-400":"text-gray-300"}`})},S))}),D.jsx(bS,{placeholder:"Share your experience...",value:l,onChange:S=>u(S.target.value),className:"min-h-[100px]"}),D.jsx("p",{className:"text-sm text-muted-foreground",children:"Due to data security reasons, your name is anonymized"}),D.jsx(tr,{onClick:w,className:"bg-brand-500 hover:bg-brand-600",disabled:m,children:m?"Submitting...":"Submit Review"})]})]}),D.jsxs(Kn,{className:"p-6 glass-card",children:[D.jsxs("div",{className:"flex items-center justify-between mb-6",children:[D.jsx("h2",{className:"text-xl font-semibold",children:"Reviews"}),D.jsxs("div",{className:"flex items-center gap-2",children:[D.jsx(Pl,{className:"w-5 h-5 text-brand-400"}),D.jsx("span",{className:"font-semibold",children:f.length>0?(f.reduce((S,T)=>S+T.rating,0)/f.length).toFixed(1):"No ratings"}),D.jsxs("span",{className:"text-muted-foreground",children:["(",f.length," ",f.length===1?"review":"reviews",")"]})]})]}),D.jsxs("div",{className:"space-y-6",children:[f.map(S=>D.jsxs("div",{className:"space-y-2",children:[D.jsxs("div",{className:"flex justify-between items-center",children:[D.jsxs("div",{className:"flex items-center gap-2",children:[D.jsx("span",{className:"font-medium",children:E()}),D.jsx(_B,{className:"w-4 h-4 text-green-500"})]}),D.jsxs("div",{className:"flex items-center gap-1",children:[D.jsx(Pl,{className:"w-4 h-4 text-brand-400"}),D.jsx("span",{children:S.rating})]})]}),D.jsx("p",{className:"text-muted-foreground",children:S.comment}),D.jsx("span",{className:"text-sm text-muted-foreground",children:new Date(S.created_at).toLocaleDateString()})]},S.id)),f.length===0&&D.jsx("p",{className:"text-muted-foreground text-center py-4",children:"No reviews yet. Be the first to review this court!"})]})]})]}),D.jsxs("div",{className:"space-y-6",children:[D.jsxs(Kn,{className:"p-6 glass-card",children:[D.jsx("h2",{className:"text-xl font-semibold mb-4",children:"Opening Hours"}),D.jsxs("div",{className:"space-y-4",children:[D.jsxs("div",{className:"flex justify-between items-center",children:[D.jsx("span",{children:"Monday - Friday"}),D.jsxs(Cf,{variant:"outline",children:[_(r.opening_time_weekday)," - ",_(r.closing_time_weekday)]})]}),D.jsxs("div",{className:"flex justify-between items-center",children:[D.jsx("span",{children:"Weekends"}),D.jsxs(Cf,{variant:"outline",children:[_(r.opening_time_weekend)," - ",_(r.closing_time_weekend)]})]})]})]}),D.jsxs(Kn,{className:"p-6 glass-card",children:[D.jsx("h2",{className:"text-xl font-semibold mb-4",children:"Quick Actions"}),D.jsxs("div",{className:"space-y-4",children:[D.jsxs(tr,{className:"w-full gap-2",onClick:v,children:[D.jsx(Hj,{className:"w-4 h-4"}),"Write a Review"]}),r.booking_url&&D.jsxs(tr,{className:"w-full bg-brand-500 hover:bg-brand-600 gap-2",onClick:()=>window.open(r.booking_url,"_blank"),children:[D.jsx(gx,{className:"w-4 h-4"}),"Book a Court"]})]})]})]})]})]})]}),D.jsx(Qi,{})]}):D.jsx("div",{children:"Loading..."})},qL=q.forwardRef(({className:t,...r},o)=>D.jsx("div",{className:"relative w-full overflow-auto",children:D.jsx("table",{ref:o,className:St("w-full caption-bottom text-sm",t),...r})}));qL.displayName="Table";const XL=q.forwardRef(({className:t,...r},o)=>D.jsx("thead",{ref:o,className:St("[&_tr]:border-b",t),...r}));XL.displayName="TableHeader";const YL=q.forwardRef(({className:t,...r},o)=>D.jsx("tbody",{ref:o,className:St("[&_tr:last-child]:border-0",t),...r}));YL.displayName="TableBody";const sq=q.forwardRef(({className:t,...r},o)=>D.jsx("tfoot",{ref:o,className:St("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...r}));sq.displayName="TableFooter";const ff=q.forwardRef(({className:t,...r},o)=>D.jsx("tr",{ref:o,className:St("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...r}));ff.displayName="TableRow";const il=q.forwardRef(({className:t,...r},o)=>D.jsx("th",{ref:o,className:St("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...r}));il.displayName="TableHead";const sa=q.forwardRef(({className:t,...r},o)=>D.jsx("td",{ref:o,className:St("p-4 align-middle [&:has([role=checkbox])]:pr-0",t),...r}));sa.displayName="TableCell";const lq=q.forwardRef(({className:t,...r},o)=>D.jsx("caption",{ref:o,className:St("mt-4 text-sm text-muted-foreground",t),...r}));lq.displayName="TableCaption";function DO(t,[r,o]){return Math.min(o,Math.max(r,t))}var uq=q.createContext(void 0);function KL(t){const r=q.useContext(uq);return t||r||"ltr"}var Nb=0;function cq(){q.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??FO()),document.body.insertAdjacentElement("beforeend",t[1]??FO()),Nb++,()=>{Nb===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Nb--}},[])}function FO(){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 Lb="focusScope.autoFocusOnMount",Db="focusScope.autoFocusOnUnmount",$O={bubbles:!1,cancelable:!0},dq="FocusScope",ZL=q.forwardRef((t,r)=>{const{loop:o=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...s}=t,[l,u]=q.useState(null),c=Ro(i),h=Ro(a),f=q.useRef(null),d=Or(r,p=>u(p)),m=q.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;q.useEffect(()=>{if(n){let p=function(v){if(m.paused||!l)return;const w=v.target;l.contains(w)?f.current=w:es(f.current,{select:!0})},g=function(v){if(m.paused||!l)return;const w=v.relatedTarget;w!==null&&(l.contains(w)||es(f.current,{select:!0}))},b=function(v){if(document.activeElement===document.body)for(const _ of v)_.removedNodes.length>0&&es(l)};document.addEventListener("focusin",p),document.addEventListener("focusout",g);const x=new MutationObserver(b);return l&&x.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",g),x.disconnect()}}},[n,l,m.paused]),q.useEffect(()=>{if(l){BO.add(m);const p=document.activeElement;if(!l.contains(p)){const b=new CustomEvent(Lb,$O);l.addEventListener(Lb,c),l.dispatchEvent(b),b.defaultPrevented||(fq(gq(QL(l)),{select:!0}),document.activeElement===p&&es(l))}return()=>{l.removeEventListener(Lb,c),setTimeout(()=>{const b=new CustomEvent(Db,$O);l.addEventListener(Db,h),l.dispatchEvent(b),b.defaultPrevented||es(p??document.body,{select:!0}),l.removeEventListener(Db,h),BO.remove(m)},0)}}},[l,c,h,m]);const y=q.useCallback(p=>{if(!o&&!n||m.paused)return;const g=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,b=document.activeElement;if(g&&b){const x=p.currentTarget,[v,w]=hq(x);v&&w?!p.shiftKey&&b===w?(p.preventDefault(),o&&es(v,{select:!0})):p.shiftKey&&b===v&&(p.preventDefault(),o&&es(w,{select:!0})):b===x&&p.preventDefault()}},[o,n,m.paused]);return D.jsx(Gt.div,{tabIndex:-1,...s,ref:d,onKeyDown:y})});ZL.displayName=dq;function fq(t,{select:r=!1}={}){const o=document.activeElement;for(const n of t)if(es(n,{select:r}),document.activeElement!==o)return}function hq(t){const r=QL(t),o=UO(r,t),n=UO(r.reverse(),t);return[o,n]}function QL(t){const r=[],o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;o.nextNode();)r.push(o.currentNode);return r}function UO(t,r){for(const o of t)if(!pq(o,{upTo:r}))return o}function pq(t,{upTo:r}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(r!==void 0&&t===r)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function mq(t){return t instanceof HTMLInputElement&&"select"in t}function es(t,{select:r=!1}={}){if(t&&t.focus){const o=document.activeElement;t.focus({preventScroll:!0}),t!==o&&mq(t)&&r&&t.select()}}var BO=yq();function yq(){let t=[];return{add(r){const o=t[0];r!==o&&(o==null||o.pause()),t=zO(t,r),t.unshift(r)},remove(r){var o;t=zO(t,r),(o=t[0])==null||o.resume()}}}function zO(t,r){const o=[...t],n=o.indexOf(r);return n!==-1&&o.splice(n,1),o}function gq(t){return t.filter(r=>r.tagName!=="A")}function JL(t){const r=q.useRef({value:t,previous:t});return q.useMemo(()=>(r.current.value!==t&&(r.current.previous=r.current.value,r.current.value=t),r.current.previous),[t])}var vq=function(t){if(typeof document>"u")return null;var r=Array.isArray(t)?t[0]:t;return r.ownerDocument.body},pu=new WeakMap,fm=new WeakMap,hm={},Fb=0,e3=function(t){return t&&(t.host||e3(t.parentNode))},bq=function(t,r){return r.map(function(o){if(t.contains(o))return o;var n=e3(o);return n&&t.contains(n)?n:(console.error("aria-hidden",o,"in not contained inside",t,". Doing nothing"),null)}).filter(function(o){return!!o})},xq=function(t,r,o,n){var i=bq(r,Array.isArray(t)?t:[t]);hm[o]||(hm[o]=new WeakMap);var a=hm[o],s=[],l=new Set,u=new Set(i),c=function(f){!f||l.has(f)||(l.add(f),c(f.parentNode))};i.forEach(c);var h=function(f){!f||u.has(f)||Array.prototype.forEach.call(f.children,function(d){if(l.has(d))h(d);else try{var m=d.getAttribute(n),y=m!==null&&m!=="false",p=(pu.get(d)||0)+1,g=(a.get(d)||0)+1;pu.set(d,p),a.set(d,g),s.push(d),p===1&&y&&fm.set(d,!0),g===1&&d.setAttribute(o,"true"),y||d.setAttribute(n,"true")}catch(b){console.error("aria-hidden: cannot operate on ",d,b)}})};return h(r),l.clear(),Fb++,function(){s.forEach(function(f){var d=pu.get(f)-1,m=a.get(f)-1;pu.set(f,d),a.set(f,m),d||(fm.has(f)||f.removeAttribute(n),fm.delete(f)),m||f.removeAttribute(o)}),Fb--,Fb||(pu=new WeakMap,pu=new WeakMap,fm=new WeakMap,hm={})}},wq=function(t,r,o){o===void 0&&(o="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),i=vq(t);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),xq(n,i,o,"aria-hidden")):function(){return null}},$i=function(){return $i=Object.assign||function(r){for(var o,n=1,i=arguments.length;n"u")return Fq;var r=$q(t),o=document.documentElement.clientWidth,n=window.innerWidth;return{left:r[0],top:r[1],right:r[2],gap:Math.max(0,n-o+r[2]-r[0])}},Bq=o3(),Zu="data-scroll-locked",zq=function(t,r,o,n){var i=t.left,a=t.top,s=t.right,l=t.gap;return o===void 0&&(o="margin"),` .`.concat(jq,` { overflow: hidden `).concat(n,`; padding-right: `).concat(l,"px ").concat(n,`; } body[`).concat(Zu,`] { overflow: hidden `).concat(n,`; overscroll-behavior: contain; `).concat([r&&"position: relative ".concat(n,";"),o==="margin"&&` padding-left: `.concat(i,`px; padding-top: `).concat(a,`px; padding-right: `).concat(s,`px; margin-left:0; margin-top:0; margin-right: `).concat(l,"px ").concat(n,`; `),o==="padding"&&"padding-right: ".concat(l,"px ").concat(n,";")].filter(Boolean).join(""),` } .`).concat(Hm,` { right: `).concat(l,"px ").concat(n,`; } .`).concat(qm,` { margin-right: `).concat(l,"px ").concat(n,`; } .`).concat(Hm," .").concat(Hm,` { right: 0 `).concat(n,`; } .`).concat(qm," .").concat(qm,` { margin-right: 0 `).concat(n,`; } body[`).concat(Zu,`] { `).concat(Sq,": ").concat(l,`px; } `)},GO=function(){var t=parseInt(document.body.getAttribute(Zu)||"0",10);return isFinite(t)?t:0},Vq=function(){q.useEffect(function(){return document.body.setAttribute(Zu,(GO()+1).toString()),function(){var t=GO()-1;t<=0?document.body.removeAttribute(Zu):document.body.setAttribute(Zu,t.toString())}},[])},Gq=function(t){var r=t.noRelative,o=t.noImportant,n=t.gapMode,i=n===void 0?"margin":n;Vq();var a=q.useMemo(function(){return Uq(i)},[i]);return q.createElement(Bq,{styles:zq(a,!r,i,o?"":"!important")})},rw=!1;if(typeof window<"u")try{var pm=Object.defineProperty({},"passive",{get:function(){return rw=!0,!0}});window.addEventListener("test",pm,pm),window.removeEventListener("test",pm,pm)}catch{rw=!1}var mu=rw?{passive:!1}:!1,Wq=function(t){return t.tagName==="TEXTAREA"},i3=function(t,r){if(!(t instanceof Element))return!1;var o=window.getComputedStyle(t);return o[r]!=="hidden"&&!(o.overflowY===o.overflowX&&!Wq(t)&&o[r]==="visible")},Hq=function(t){return i3(t,"overflowY")},qq=function(t){return i3(t,"overflowX")},WO=function(t,r){var o=r.ownerDocument,n=r;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=a3(t,n);if(i){var a=s3(t,n),s=a[1],l=a[2];if(s>l)return!0}n=n.parentNode}while(n&&n!==o.body);return!1},Xq=function(t){var r=t.scrollTop,o=t.scrollHeight,n=t.clientHeight;return[r,o,n]},Yq=function(t){var r=t.scrollLeft,o=t.scrollWidth,n=t.clientWidth;return[r,o,n]},a3=function(t,r){return t==="v"?Hq(r):qq(r)},s3=function(t,r){return t==="v"?Xq(r):Yq(r)},Kq=function(t,r){return t==="h"&&r==="rtl"?-1:1},Zq=function(t,r,o,n,i){var a=Kq(t,window.getComputedStyle(r).direction),s=a*n,l=o.target,u=r.contains(l),c=!1,h=s>0,f=0,d=0;do{var m=s3(t,l),y=m[0],p=m[1],g=m[2],b=p-g-a*y;(y||b)&&a3(t,l)&&(f+=b,d+=y),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!u&&l!==document.body||u&&(r.contains(l)||r===l));return(h&&(Math.abs(f)<1||!i)||!h&&(Math.abs(d)<1||!i))&&(c=!0),c},mm=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},HO=function(t){return[t.deltaX,t.deltaY]},qO=function(t){return t&&"current"in t?t.current:t},Qq=function(t,r){return t[0]===r[0]&&t[1]===r[1]},Jq=function(t){return` .block-interactivity-`.concat(t,` {pointer-events: none;} .allow-interactivity-`).concat(t,` {pointer-events: all;} `)},eX=0,yu=[];function tX(t){var r=q.useRef([]),o=q.useRef([0,0]),n=q.useRef(),i=q.useState(eX++)[0],a=q.useState(o3)[0],s=q.useRef(t);q.useEffect(function(){s.current=t},[t]),q.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var p=_q([t.lockRef.current],(t.shards||[]).map(qO),!0).filter(Boolean);return p.forEach(function(g){return g.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),p.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var l=q.useCallback(function(p,g){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!s.current.allowPinchZoom;var b=mm(p),x=o.current,v="deltaX"in p?p.deltaX:x[0]-b[0],w="deltaY"in p?p.deltaY:x[1]-b[1],_,E=p.target,S=Math.abs(v)>Math.abs(w)?"h":"v";if("touches"in p&&S==="h"&&E.type==="range")return!1;var T=WO(S,E);if(!T)return!0;if(T?_=S:(_=S==="v"?"h":"v",T=WO(S,E)),!T)return!1;if(!n.current&&"changedTouches"in p&&(v||w)&&(n.current=_),!_)return!0;var k=n.current||_;return Zq(k,g,p,k==="h"?v:w,!0)},[]),u=q.useCallback(function(p){var g=p;if(!(!yu.length||yu[yu.length-1]!==a)){var b="deltaY"in g?HO(g):mm(g),x=r.current.filter(function(_){return _.name===g.type&&(_.target===g.target||g.target===_.shadowParent)&&Qq(_.delta,b)})[0];if(x&&x.should){g.cancelable&&g.preventDefault();return}if(!x){var v=(s.current.shards||[]).map(qO).filter(Boolean).filter(function(_){return _.contains(g.target)}),w=v.length>0?l(g,v[0]):!s.current.noIsolation;w&&g.cancelable&&g.preventDefault()}}},[]),c=q.useCallback(function(p,g,b,x){var v={name:p,delta:g,target:b,should:x,shadowParent:rX(b)};r.current.push(v),setTimeout(function(){r.current=r.current.filter(function(w){return w!==v})},1)},[]),h=q.useCallback(function(p){o.current=mm(p),n.current=void 0},[]),f=q.useCallback(function(p){c(p.type,HO(p),p.target,l(p,t.lockRef.current))},[]),d=q.useCallback(function(p){c(p.type,mm(p),p.target,l(p,t.lockRef.current))},[]);q.useEffect(function(){return yu.push(a),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:d}),document.addEventListener("wheel",u,mu),document.addEventListener("touchmove",u,mu),document.addEventListener("touchstart",h,mu),function(){yu=yu.filter(function(p){return p!==a}),document.removeEventListener("wheel",u,mu),document.removeEventListener("touchmove",u,mu),document.removeEventListener("touchstart",h,mu)}},[]);var m=t.removeScrollBar,y=t.inert;return q.createElement(q.Fragment,null,y?q.createElement(a,{styles:Jq(i)}):null,m?q.createElement(Gq,{gapMode:t.gapMode}):null)}function rX(t){for(var r=null;t!==null;)t instanceof ShadowRoot&&(r=t.host,t=t.host),t=t.parentNode;return r}const nX=Aq(n3,tX);var l3=q.forwardRef(function(t,r){return q.createElement(Iv,$i({},t,{ref:r,sideCar:nX}))});l3.classNames=Iv.classNames;var oX=[" ","Enter","ArrowUp","ArrowDown"],iX=[" ","Enter"],wp="Select",[Nv,Lv,aX]=Uj(wp),[cd,F_e]=nd(wp,[aX,wv]),Dv=wv(),[sX,Hs]=cd(wp),[lX,uX]=cd(wp),u3=t=>{const{__scopeSelect:r,children:o,open:n,defaultOpen:i,onOpenChange:a,value:s,defaultValue:l,onValueChange:u,dir:c,name:h,autoComplete:f,disabled:d,required:m,form:y}=t,p=Dv(r),[g,b]=q.useState(null),[x,v]=q.useState(null),[w,_]=q.useState(!1),E=KL(c),[S=!1,T]=Fl({prop:n,defaultProp:i,onChange:a}),[k,A]=Fl({prop:s,defaultProp:l,onChange:u}),O=q.useRef(null),R=g?y||!!g.closest("form"):!0,[C,L]=q.useState(new Set),F=Array.from(C).map(z=>z.props.value).join(";");return D.jsx(o9,{...p,children:D.jsxs(sX,{required:m,scope:r,trigger:g,onTriggerChange:b,valueNode:x,onValueNodeChange:v,valueNodeHasChildren:w,onValueNodeHasChildrenChange:_,contentId:fp(),value:k,onValueChange:A,open:S,onOpenChange:T,dir:E,triggerPointerDownPosRef:O,disabled:d,children:[D.jsx(Nv.Provider,{scope:r,children:D.jsx(lX,{scope:t.__scopeSelect,onNativeOptionAdd:q.useCallback(z=>{L(W=>new Set(W).add(z))},[]),onNativeOptionRemove:q.useCallback(z=>{L(W=>{const $=new Set(W);return $.delete(z),$})},[]),children:o})}),R?D.jsxs(I3,{"aria-hidden":!0,required:m,tabIndex:-1,name:h,autoComplete:f,value:k,onChange:z=>A(z.target.value),disabled:d,form:y,children:[k===void 0?D.jsx("option",{value:""}):null,Array.from(C)]},F):null]})})};u3.displayName=wp;var c3="SelectTrigger",d3=q.forwardRef((t,r)=>{const{__scopeSelect:o,disabled:n=!1,...i}=t,a=Dv(o),s=Hs(c3,o),l=s.disabled||n,u=Or(r,s.onTriggerChange),c=Lv(o),h=q.useRef("touch"),[f,d,m]=N3(p=>{const g=c().filter(v=>!v.disabled),b=g.find(v=>v.value===s.value),x=L3(g,p,b);x!==void 0&&s.onValueChange(x.value)}),y=p=>{l||(s.onOpenChange(!0),m()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return D.jsx(FN,{asChild:!0,...a,children:D.jsx(Gt.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:l,"data-disabled":l?"":void 0,"data-placeholder":R3(s.value)?"":void 0,...i,ref:u,onClick:It(i.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&y(p)}),onPointerDown:It(i.onPointerDown,p=>{h.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(y(p),p.preventDefault())}),onKeyDown:It(i.onKeyDown,p=>{const g=f.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&d(p.key),!(g&&p.key===" ")&&oX.includes(p.key)&&(y(),p.preventDefault())})})})});d3.displayName=c3;var f3="SelectValue",h3=q.forwardRef((t,r)=>{const{__scopeSelect:o,className:n,style:i,children:a,placeholder:s="",...l}=t,u=Hs(f3,o),{onValueNodeHasChildrenChange:c}=u,h=a!==void 0,f=Or(r,u.onValueNodeChange);return On(()=>{c(h)},[c,h]),D.jsx(Gt.span,{...l,ref:f,style:{pointerEvents:"none"},children:R3(u.value)?D.jsx(D.Fragment,{children:s}):a})});h3.displayName=f3;var cX="SelectIcon",p3=q.forwardRef((t,r)=>{const{__scopeSelect:o,children:n,...i}=t;return D.jsx(Gt.span,{"aria-hidden":!0,...i,ref:r,children:n||"▼"})});p3.displayName=cX;var dX="SelectPortal",m3=t=>D.jsx(Bj,{asChild:!0,...t});m3.displayName=dX;var zl="SelectContent",y3=q.forwardRef((t,r)=>{const o=Hs(zl,t.__scopeSelect),[n,i]=q.useState();if(On(()=>{i(new DocumentFragment)},[]),!o.open){const a=n;return a?Ql.createPortal(D.jsx(g3,{scope:t.__scopeSelect,children:D.jsx(Nv.Slot,{scope:t.__scopeSelect,children:D.jsx("div",{children:t.children})})}),a):null}return D.jsx(v3,{...t,ref:r})});y3.displayName=zl;var si=10,[g3,qs]=cd(zl),fX="SelectContentImpl",v3=q.forwardRef((t,r)=>{const{__scopeSelect:o,position:n="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:s,side:l,sideOffset:u,align:c,alignOffset:h,arrowPadding:f,collisionBoundary:d,collisionPadding:m,sticky:y,hideWhenDetached:p,avoidCollisions:g,...b}=t,x=Hs(zl,o),[v,w]=q.useState(null),[_,E]=q.useState(null),S=Or(r,ee=>w(ee)),[T,k]=q.useState(null),[A,O]=q.useState(null),R=Lv(o),[C,L]=q.useState(!1),F=q.useRef(!1);q.useEffect(()=>{if(v)return wq(v)},[v]),cq();const z=q.useCallback(ee=>{const[oe,...ce]=R().map(te=>te.ref.current),[he]=ce.slice(-1),ae=document.activeElement;for(const te of ee)if(te===ae||(te==null||te.scrollIntoView({block:"nearest"}),te===oe&&_&&(_.scrollTop=0),te===he&&_&&(_.scrollTop=_.scrollHeight),te==null||te.focus(),document.activeElement!==ae))return},[R,_]),W=q.useCallback(()=>z([T,v]),[z,T,v]);q.useEffect(()=>{C&&W()},[C,W]);const{onOpenChange:$,triggerPointerDownPosRef:G}=x;q.useEffect(()=>{if(v){let ee={x:0,y:0};const oe=he=>{var ae,te;ee={x:Math.abs(Math.round(he.pageX)-(((ae=G.current)==null?void 0:ae.x)??0)),y:Math.abs(Math.round(he.pageY)-(((te=G.current)==null?void 0:te.y)??0))}},ce=he=>{ee.x<=10&&ee.y<=10?he.preventDefault():v.contains(he.target)||$(!1),document.removeEventListener("pointermove",oe),G.current=null};return G.current!==null&&(document.addEventListener("pointermove",oe),document.addEventListener("pointerup",ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",oe),document.removeEventListener("pointerup",ce,{capture:!0})}}},[v,$,G]),q.useEffect(()=>{const ee=()=>$(!1);return window.addEventListener("blur",ee),window.addEventListener("resize",ee),()=>{window.removeEventListener("blur",ee),window.removeEventListener("resize",ee)}},[$]);const[K,Z]=N3(ee=>{const oe=R().filter(ae=>!ae.disabled),ce=oe.find(ae=>ae.ref.current===document.activeElement),he=L3(oe,ee,ce);he&&setTimeout(()=>he.ref.current.focus())}),U=q.useCallback((ee,oe,ce)=>{const he=!F.current&&!ce;(x.value!==void 0&&x.value===oe||he)&&(k(ee),he&&(F.current=!0))},[x.value]),I=q.useCallback(()=>v==null?void 0:v.focus(),[v]),B=q.useCallback((ee,oe,ce)=>{const he=!F.current&&!ce;(x.value!==void 0&&x.value===oe||he)&&O(ee)},[x.value]),H=n==="popper"?nw:b3,Y=H===nw?{side:l,sideOffset:u,align:c,alignOffset:h,arrowPadding:f,collisionBoundary:d,collisionPadding:m,sticky:y,hideWhenDetached:p,avoidCollisions:g}:{};return D.jsx(g3,{scope:o,content:v,viewport:_,onViewportChange:E,itemRefCallback:U,selectedItem:T,onItemLeave:I,itemTextRefCallback:B,focusSelectedItem:W,selectedItemText:A,position:n,isPositioned:C,searchRef:K,children:D.jsx(l3,{as:Dl,allowPinchZoom:!0,children:D.jsx(ZL,{asChild:!0,trapped:x.open,onMountAutoFocus:ee=>{ee.preventDefault()},onUnmountAutoFocus:It(i,ee=>{var oe;(oe=x.trigger)==null||oe.focus({preventScroll:!0}),ee.preventDefault()}),children:D.jsx(hv,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:ee=>ee.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:D.jsx(H,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:ee=>ee.preventDefault(),...b,...Y,onPlaced:()=>L(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:It(b.onKeyDown,ee=>{const oe=ee.ctrlKey||ee.altKey||ee.metaKey;if(ee.key==="Tab"&&ee.preventDefault(),!oe&&ee.key.length===1&&Z(ee.key),["ArrowUp","ArrowDown","Home","End"].includes(ee.key)){let he=R().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);if(["ArrowUp","End"].includes(ee.key)&&(he=he.slice().reverse()),["ArrowUp","ArrowDown"].includes(ee.key)){const ae=ee.target,te=he.indexOf(ae);he=he.slice(te+1)}setTimeout(()=>z(he)),ee.preventDefault()}})})})})})})});v3.displayName=fX;var hX="SelectItemAlignedPosition",b3=q.forwardRef((t,r)=>{const{__scopeSelect:o,onPlaced:n,...i}=t,a=Hs(zl,o),s=qs(zl,o),[l,u]=q.useState(null),[c,h]=q.useState(null),f=Or(r,S=>h(S)),d=Lv(o),m=q.useRef(!1),y=q.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:b,focusSelectedItem:x}=s,v=q.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&c&&p&&g&&b){const S=a.trigger.getBoundingClientRect(),T=c.getBoundingClientRect(),k=a.valueNode.getBoundingClientRect(),A=b.getBoundingClientRect();if(a.dir!=="rtl"){const ae=A.left-T.left,te=k.left-ae,pe=S.left-te,ne=S.width+pe,fe=Math.max(ne,T.width),be=window.innerWidth-si,Ee=DO(te,[si,Math.max(si,be-fe)]);l.style.minWidth=ne+"px",l.style.left=Ee+"px"}else{const ae=T.right-A.right,te=window.innerWidth-k.right-ae,pe=window.innerWidth-S.right-te,ne=S.width+pe,fe=Math.max(ne,T.width),be=window.innerWidth-si,Ee=DO(te,[si,Math.max(si,be-fe)]);l.style.minWidth=ne+"px",l.style.right=Ee+"px"}const O=d(),R=window.innerHeight-si*2,C=p.scrollHeight,L=window.getComputedStyle(c),F=parseInt(L.borderTopWidth,10),z=parseInt(L.paddingTop,10),W=parseInt(L.borderBottomWidth,10),$=parseInt(L.paddingBottom,10),G=F+z+C+$+W,K=Math.min(g.offsetHeight*5,G),Z=window.getComputedStyle(p),U=parseInt(Z.paddingTop,10),I=parseInt(Z.paddingBottom,10),B=S.top+S.height/2-si,H=R-B,Y=g.offsetHeight/2,ee=g.offsetTop+Y,oe=F+z+ee,ce=G-oe;if(oe<=B){const ae=O.length>0&&g===O[O.length-1].ref.current;l.style.bottom="0px";const te=c.clientHeight-p.offsetTop-p.offsetHeight,pe=Math.max(H,Y+(ae?I:0)+te+W),ne=oe+pe;l.style.height=ne+"px"}else{const ae=O.length>0&&g===O[0].ref.current;l.style.top="0px";const pe=Math.max(B,F+p.offsetTop+(ae?U:0)+Y)+ce;l.style.height=pe+"px",p.scrollTop=oe-B+p.offsetTop}l.style.margin=`${si}px 0`,l.style.minHeight=K+"px",l.style.maxHeight=R+"px",n==null||n(),requestAnimationFrame(()=>m.current=!0)}},[d,a.trigger,a.valueNode,l,c,p,g,b,a.dir,n]);On(()=>v(),[v]);const[w,_]=q.useState();On(()=>{c&&_(window.getComputedStyle(c).zIndex)},[c]);const E=q.useCallback(S=>{S&&y.current===!0&&(v(),x==null||x(),y.current=!1)},[v,x]);return D.jsx(mX,{scope:o,contentWrapper:l,shouldExpandOnScrollRef:m,onScrollButtonChange:E,children:D.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:D.jsx(Gt.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});b3.displayName=hX;var pX="SelectPopperPosition",nw=q.forwardRef((t,r)=>{const{__scopeSelect:o,align:n="start",collisionPadding:i=si,...a}=t,s=Dv(o);return D.jsx($N,{...s,...a,ref:r,align:n,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)"}})});nw.displayName=pX;var[mX,xS]=cd(zl,{}),ow="SelectViewport",x3=q.forwardRef((t,r)=>{const{__scopeSelect:o,nonce:n,...i}=t,a=qs(ow,o),s=xS(ow,o),l=Or(r,a.onViewportChange),u=q.useRef(0);return D.jsxs(D.Fragment,{children:[D.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:n}),D.jsx(Nv.Slot,{scope:o,children:D.jsx(Gt.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:It(i.onScroll,c=>{const h=c.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:d}=s;if(d!=null&&d.current&&f){const m=Math.abs(u.current-h.scrollTop);if(m>0){const y=window.innerHeight-si*2,p=parseFloat(f.style.minHeight),g=parseFloat(f.style.height),b=Math.max(p,g);if(b0?w:0,f.style.justifyContent="flex-end")}}}u.current=h.scrollTop})})})]})});x3.displayName=ow;var w3="SelectGroup",[yX,gX]=cd(w3),vX=q.forwardRef((t,r)=>{const{__scopeSelect:o,...n}=t,i=fp();return D.jsx(yX,{scope:o,id:i,children:D.jsx(Gt.div,{role:"group","aria-labelledby":i,...n,ref:r})})});vX.displayName=w3;var _3="SelectLabel",j3=q.forwardRef((t,r)=>{const{__scopeSelect:o,...n}=t,i=gX(_3,o);return D.jsx(Gt.div,{id:i.id,...n,ref:r})});j3.displayName=_3;var Ay="SelectItem",[bX,S3]=cd(Ay),E3=q.forwardRef((t,r)=>{const{__scopeSelect:o,value:n,disabled:i=!1,textValue:a,...s}=t,l=Hs(Ay,o),u=qs(Ay,o),c=l.value===n,[h,f]=q.useState(a??""),[d,m]=q.useState(!1),y=Or(r,x=>{var v;return(v=u.itemRefCallback)==null?void 0:v.call(u,x,n,i)}),p=fp(),g=q.useRef("touch"),b=()=>{i||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")throw new Error("A 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 D.jsx(bX,{scope:o,value:n,disabled:i,textId:p,isSelected:c,onItemTextChange:q.useCallback(x=>{f(v=>v||((x==null?void 0:x.textContent)??"").trim())},[]),children:D.jsx(Nv.ItemSlot,{scope:o,value:n,disabled:i,textValue:h,children:D.jsx(Gt.div,{role:"option","aria-labelledby":p,"data-highlighted":d?"":void 0,"aria-selected":c&&d,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:y,onFocus:It(s.onFocus,()=>m(!0)),onBlur:It(s.onBlur,()=>m(!1)),onClick:It(s.onClick,()=>{g.current!=="mouse"&&b()}),onPointerUp:It(s.onPointerUp,()=>{g.current==="mouse"&&b()}),onPointerDown:It(s.onPointerDown,x=>{g.current=x.pointerType}),onPointerMove:It(s.onPointerMove,x=>{var v;g.current=x.pointerType,i?(v=u.onItemLeave)==null||v.call(u):g.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:It(s.onPointerLeave,x=>{var v;x.currentTarget===document.activeElement&&((v=u.onItemLeave)==null||v.call(u))}),onKeyDown:It(s.onKeyDown,x=>{var w;((w=u.searchRef)==null?void 0:w.current)!==""&&x.key===" "||(iX.includes(x.key)&&b(),x.key===" "&&x.preventDefault())})})})})});E3.displayName=Ay;var hf="SelectItemText",T3=q.forwardRef((t,r)=>{const{__scopeSelect:o,className:n,style:i,...a}=t,s=Hs(hf,o),l=qs(hf,o),u=S3(hf,o),c=uX(hf,o),[h,f]=q.useState(null),d=Or(r,b=>f(b),u.onItemTextChange,b=>{var x;return(x=l.itemTextRefCallback)==null?void 0:x.call(l,b,u.value,u.disabled)}),m=h==null?void 0:h.textContent,y=q.useMemo(()=>D.jsx("option",{value:u.value,disabled:u.disabled,children:m},u.value),[u.disabled,u.value,m]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=c;return On(()=>(p(y),()=>g(y)),[p,g,y]),D.jsxs(D.Fragment,{children:[D.jsx(Gt.span,{id:u.textId,...a,ref:d}),u.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ql.createPortal(a.children,s.valueNode):null]})});T3.displayName=hf;var O3="SelectItemIndicator",k3=q.forwardRef((t,r)=>{const{__scopeSelect:o,...n}=t;return S3(O3,o).isSelected?D.jsx(Gt.span,{"aria-hidden":!0,...n,ref:r}):null});k3.displayName=O3;var iw="SelectScrollUpButton",P3=q.forwardRef((t,r)=>{const o=qs(iw,t.__scopeSelect),n=xS(iw,t.__scopeSelect),[i,a]=q.useState(!1),s=Or(r,n.onScrollButtonChange);return On(()=>{if(o.viewport&&o.isPositioned){let l=function(){const c=u.scrollTop>0;a(c)};const u=o.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[o.viewport,o.isPositioned]),i?D.jsx(A3,{...t,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=o;l&&u&&(l.scrollTop=l.scrollTop-u.offsetHeight)}}):null});P3.displayName=iw;var aw="SelectScrollDownButton",C3=q.forwardRef((t,r)=>{const o=qs(aw,t.__scopeSelect),n=xS(aw,t.__scopeSelect),[i,a]=q.useState(!1),s=Or(r,n.onScrollButtonChange);return On(()=>{if(o.viewport&&o.isPositioned){let l=function(){const c=u.scrollHeight-u.clientHeight,h=Math.ceil(u.scrollTop)u.removeEventListener("scroll",l)}},[o.viewport,o.isPositioned]),i?D.jsx(A3,{...t,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=o;l&&u&&(l.scrollTop=l.scrollTop+u.offsetHeight)}}):null});C3.displayName=aw;var A3=q.forwardRef((t,r)=>{const{__scopeSelect:o,onAutoScroll:n,...i}=t,a=qs("SelectScrollButton",o),s=q.useRef(null),l=Lv(o),u=q.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return q.useEffect(()=>()=>u(),[u]),On(()=>{var h;const c=l().find(f=>f.ref.current===document.activeElement);(h=c==null?void 0:c.ref.current)==null||h.scrollIntoView({block:"nearest"})},[l]),D.jsx(Gt.div,{"aria-hidden":!0,...i,ref:r,style:{flexShrink:0,...i.style},onPointerDown:It(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:It(i.onPointerMove,()=>{var c;(c=a.onItemLeave)==null||c.call(a),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:It(i.onPointerLeave,()=>{u()})})}),xX="SelectSeparator",M3=q.forwardRef((t,r)=>{const{__scopeSelect:o,...n}=t;return D.jsx(Gt.div,{"aria-hidden":!0,...n,ref:r})});M3.displayName=xX;var sw="SelectArrow",wX=q.forwardRef((t,r)=>{const{__scopeSelect:o,...n}=t,i=Dv(o),a=Hs(sw,o),s=qs(sw,o);return a.open&&s.position==="popper"?D.jsx(UN,{...i,...n,ref:r}):null});wX.displayName=sw;function R3(t){return t===""||t===void 0}var I3=q.forwardRef((t,r)=>{const{value:o,...n}=t,i=q.useRef(null),a=Or(r,i),s=JL(o);return q.useEffect(()=>{const l=i.current,u=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(u,"value").set;if(s!==o&&h){const f=new Event("change",{bubbles:!0});h.call(l,o),l.dispatchEvent(f)}},[s,o]),D.jsx(dp,{asChild:!0,children:D.jsx("select",{...n,ref:a,defaultValue:o})})});I3.displayName="BubbleSelect";function N3(t){const r=Ro(t),o=q.useRef(""),n=q.useRef(0),i=q.useCallback(s=>{const l=o.current+s;r(l),function u(c){o.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>u(""),1e3))}(l)},[r]),a=q.useCallback(()=>{o.current="",window.clearTimeout(n.current)},[]);return q.useEffect(()=>()=>window.clearTimeout(n.current),[]),[o,i,a]}function L3(t,r,o){const i=r.length>1&&Array.from(r).every(c=>c===r[0])?r[0]:r,a=o?t.indexOf(o):-1;let s=_X(t,Math.max(a,0));i.length===1&&(s=s.filter(c=>c!==o));const u=s.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return u!==o?u:void 0}function _X(t,r){return t.map((o,n)=>t[(r+n)%t.length])}var jX=u3,D3=d3,SX=h3,EX=p3,TX=m3,F3=y3,OX=x3,$3=j3,U3=E3,kX=T3,PX=k3,B3=P3,z3=C3,V3=M3;const My=jX,Ry=SX,mh=q.forwardRef(({className:t,children:r,...o},n)=>D.jsxs(D3,{ref:n,className:St("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-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),...o,children:[r,D.jsx(EX,{asChild:!0,children:D.jsx(gv,{className:"h-4 w-4 opacity-50"})})]}));mh.displayName=D3.displayName;const G3=q.forwardRef(({className:t,...r},o)=>D.jsx(B3,{ref:o,className:St("flex cursor-default items-center justify-center py-1",t),...r,children:D.jsx(EB,{className:"h-4 w-4"})}));G3.displayName=B3.displayName;const W3=q.forwardRef(({className:t,...r},o)=>D.jsx(z3,{ref:o,className:St("flex cursor-default items-center justify-center py-1",t),...r,children:D.jsx(gv,{className:"h-4 w-4"})}));W3.displayName=z3.displayName;const yh=q.forwardRef(({className:t,children:r,position:o="popper",...n},i)=>D.jsx(TX,{children:D.jsxs(F3,{ref:i,className:St("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",o==="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:o,...n,children:[D.jsx(G3,{}),D.jsx(OX,{className:St("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),D.jsx(W3,{})]})}));yh.displayName=F3.displayName;const CX=q.forwardRef(({className:t,...r},o)=>D.jsx($3,{ref:o,className:St("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...r}));CX.displayName=$3.displayName;const yi=q.forwardRef(({className:t,children:r,...o},n)=>D.jsxs(U3,{ref:n,className:St("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...o,children:[D.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:D.jsx(PX,{children:D.jsx(aN,{className:"h-4 w-4"})})}),D.jsx(kX,{children:r})]}));yi.displayName=U3.displayName;const AX=q.forwardRef(({className:t,...r},o)=>D.jsx(V3,{ref:o,className:St("-mx-1 my-1 h-px bg-muted",t),...r}));AX.displayName=V3.displayName;const MX=()=>{const[t,r]=q.useState(null),[o,n]=q.useState([]),[i,a]=q.useState(!0);q.useEffect(()=>{(async()=>{try{const{data:h,error:f}=await rr.from("courts").select("id, name, location, country");if(f)throw f;const{data:d,error:m}=await rr.from("reviews").select("court_id, rating");if(m)throw m;const y=h.map(p=>{const g=d.filter(v=>v.court_id===p.id),b=g.reduce((v,w)=>v+w.rating,0),x=g.length>0?b/g.length:0;return{...p,rating:x,reviews:g.length}});n(y)}catch(h){console.error("Error fetching courts:",h)}finally{a(!1)}})()},[]);const l=[...t?o.filter(c=>c.country===t):o].sort((c,h)=>h.rating-c.rating),u=Array.from(new Set(o.map(c=>c.country))).sort();return D.jsxs("div",{className:"min-h-screen",children:[D.jsxs("div",{className:"p-6",children:[D.jsx(Zi,{}),D.jsxs("div",{className:"max-w-6xl mx-auto space-y-8",children:[D.jsxs("header",{className:"text-center space-y-4",children:[D.jsx("h1",{className:"text-4xl font-bold tracking-tight",children:"Padel Courts Ranking"}),D.jsx("p",{className:"text-muted-foreground",children:"Discover and compare all registered padel courts"})]}),D.jsx("div",{className:"flex justify-end mb-6",children:D.jsxs(My,{onValueChange:c=>r(c==="all"?null:c),children:[D.jsx(mh,{className:"w-[180px]",children:D.jsx(Ry,{placeholder:"Filter by country"})}),D.jsxs(yh,{children:[D.jsx(yi,{value:"all",children:"All Countries"}),u.map(c=>D.jsx(yi,{value:c,children:c},c))]})]})}),D.jsx("div",{className:"bg-card rounded-lg shadow-lg",children:D.jsxs(qL,{children:[D.jsx(XL,{children:D.jsxs(ff,{children:[D.jsx(il,{children:"Rank"}),D.jsx(il,{children:"Court Name"}),D.jsx(il,{children:"Location"}),D.jsx(il,{children:"Rating"}),D.jsx(il,{children:"Reviews"}),D.jsx(il,{children:"Actions"})]})}),D.jsx(YL,{children:i?D.jsx(ff,{children:D.jsx(sa,{colSpan:6,className:"text-center py-8",children:"Loading courts..."})}):l.length===0?D.jsx(ff,{children:D.jsx(sa,{colSpan:6,className:"text-center py-8",children:"No courts found for the selected criteria"})}):l.map((c,h)=>D.jsxs(ff,{children:[D.jsxs(sa,{className:"font-medium",children:["#",h+1]}),D.jsx(sa,{children:c.name}),D.jsx(sa,{children:c.location}),D.jsx(sa,{children:D.jsxs("div",{className:"flex items-center gap-1",children:[D.jsx(Pl,{className:"w-4 h-4 text-yellow-400 fill-yellow-400"}),c.rating.toFixed(1)]})}),D.jsx(sa,{children:c.reviews}),D.jsx(sa,{children:D.jsx(tr,{variant:"secondary",size:"sm",asChild:!0,children:D.jsx(kr,{to:`/courts/${c.id}`,children:"View Details"})})})]},c.id))})]})})]})]}),D.jsx(Qi,{})]})},RX=()=>D.jsxs("div",{className:"min-h-screen",children:[D.jsxs("div",{className:"p-6",children:[D.jsx(Zi,{}),D.jsxs("div",{className:"max-w-6xl mx-auto space-y-16",children:[D.jsxs("header",{className:"text-center space-y-4",children:[D.jsx("h1",{className:"text-4xl font-bold tracking-tight text-foreground",children:"About Padellocator"}),D.jsx("p",{className:"text-xl text-muted-foreground max-w-2xl mx-auto",children:"Your trusted platform for discovering and booking the finest padel courts Worldwide."})]}),D.jsxs("div",{className:"grid md:grid-cols-2 lg:grid-cols-4 gap-8",children:[D.jsxs("div",{className:"space-y-4 text-center",children:[D.jsx("div",{className:"mx-auto w-12 h-12 flex items-center justify-center bg-brand-50 rounded-full",children:D.jsx(sN,{className:"w-6 h-6 text-brand-500"})}),D.jsx("h3",{className:"font-semibold text-xl",children:"Our Mission"}),D.jsx("p",{className:"text-muted-foreground",children:"To connect padel enthusiasts with the best courts and facilities, making the sport more accessible to everyone."})]}),D.jsxs("div",{className:"space-y-4 text-center",children:[D.jsx("div",{className:"mx-auto w-12 h-12 flex items-center justify-center bg-brand-50 rounded-full",children:D.jsx(LB,{className:"w-6 h-6 text-brand-500"})}),D.jsx("h3",{className:"font-semibold text-xl",children:"Community"}),D.jsx("p",{className:"text-muted-foreground",children:"Join a growing community of padel players, share experiences, and discover new courts together."})]}),D.jsxs("div",{className:"space-y-4 text-center",children:[D.jsx("div",{className:"mx-auto w-12 h-12 flex items-center justify-center bg-brand-50 rounded-full",children:D.jsx(wB,{className:"w-6 h-6 text-brand-500"})}),D.jsx("h3",{className:"font-semibold text-xl",children:"Quality First"}),D.jsx("p",{className:"text-muted-foreground",children:"We carefully verify and rate each court to ensure you get the best playing experience possible."})]}),D.jsxs("div",{className:"space-y-4 text-center",children:[D.jsx("div",{className:"mx-auto w-12 h-12 flex items-center justify-center bg-brand-50 rounded-full",children:D.jsx(Hj,{className:"w-6 h-6 text-brand-500"})}),D.jsx("h3",{className:"font-semibold text-xl",children:"Support"}),D.jsx("p",{className:"text-muted-foreground",children:"Our dedicated team is here to help you find the perfect court and answer any questions."})]})]}),D.jsx("div",{className:"premium-card rounded-2xl p-8 md:p-12",children:D.jsxs("div",{className:"max-w-3xl mx-auto space-y-6 text-center",children:[D.jsx("h2",{className:"text-3xl font-bold text-foreground",children:"Why Choose Padellocator?"}),D.jsx("p",{className:"text-lg text-muted-foreground",children:"Padellocator is Europe's leading platform for padel court bookings. We offer:"}),D.jsxs("ul",{className:"text-left space-y-4 max-w-xl mx-auto",children:[D.jsxs("li",{className:"flex items-center gap-3",children:[D.jsx("span",{className:"w-2 h-2 bg-brand-500 rounded-full"}),"Verified court listings with detailed information and photos"]}),D.jsxs("li",{className:"flex items-center gap-3",children:[D.jsx("span",{className:"w-2 h-2 bg-brand-500 rounded-full"}),"Real user reviews and ratings from the padel community"]}),D.jsxs("li",{className:"flex items-center gap-3",children:[D.jsx("span",{className:"w-2 h-2 bg-brand-500 rounded-full"}),"Easy booking system with instant confirmation"]}),D.jsxs("li",{className:"flex items-center gap-3",children:[D.jsx("span",{className:"w-2 h-2 bg-brand-500 rounded-full"}),"Regular updates on new courts and special offers"]})]})]})})]})]}),D.jsx(Qi,{})]}),IX=()=>{const t=Ws();return q.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",t.pathname)},[t.pathname]),D.jsxs("div",{className:"min-h-screen",children:[D.jsxs("div",{className:"p-6",children:[D.jsx(Zi,{}),D.jsx("div",{className:"flex-1 flex items-center justify-center",children:D.jsxs("div",{className:"text-center",children:[D.jsx("h1",{className:"text-4xl font-bold mb-4",children:"404"}),D.jsx("p",{className:"text-xl text-muted-foreground mb-4",children:"Oops! Page not found"}),D.jsx("a",{href:"/",className:"text-brand-500 hover:text-brand-600 underline",children:"Return to Home"})]})})]}),D.jsx(Qi,{})]})};var _p=t=>t.type==="checkbox",ml=t=>t instanceof Date,Yn=t=>t==null;const H3=t=>typeof t=="object";var Wr=t=>!Yn(t)&&!Array.isArray(t)&&H3(t)&&!ml(t),q3=t=>Wr(t)&&t.target?_p(t.target)?t.target.checked:t.target.value:t,NX=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,X3=(t,r)=>t.has(NX(r)),LX=t=>{const r=t.constructor&&t.constructor.prototype;return Wr(r)&&r.hasOwnProperty("isPrototypeOf")},wS=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function io(t){let r;const o=Array.isArray(t);if(t instanceof Date)r=new Date(t);else if(t instanceof Set)r=new Set(t);else if(!(wS&&(t instanceof Blob||t instanceof FileList))&&(o||Wr(t)))if(r=o?[]:{},!o&&!LX(t))r=t;else for(const n in t)t.hasOwnProperty(n)&&(r[n]=io(t[n]));else return t;return r}var Fv=t=>Array.isArray(t)?t.filter(Boolean):[],Br=t=>t===void 0,rt=(t,r,o)=>{if(!r||!Wr(t))return o;const n=Fv(r.split(/[,[\].]+?/)).reduce((i,a)=>Yn(i)?i:i[a],t);return Br(n)||n===t?Br(t[r])?o:t[r]:n},zo=t=>typeof t=="boolean",_S=t=>/^\w*$/.test(t),Y3=t=>Fv(t.replace(/["|']|\]/g,"").split(/\.|\[/)),Qt=(t,r,o)=>{let n=-1;const i=_S(r)?[r]:Y3(r),a=i.length,s=a-1;for(;++nme.useContext(K3),DX=t=>{const{children:r,...o}=t;return me.createElement(K3.Provider,{value:o},r)};var Z3=(t,r,o,n=!0)=>{const i={defaultValues:r._defaultValues};for(const a in t)Object.defineProperty(i,a,{get:()=>{const s=a;return r._proxyFormState[s]!==gi.all&&(r._proxyFormState[s]=!n||gi.all),o&&(o[s]=!0),t[s]}});return i},lo=t=>Wr(t)&&!Object.keys(t).length,Q3=(t,r,o,n)=>{o(t);const{name:i,...a}=t;return lo(a)||Object.keys(a).length>=Object.keys(r).length||Object.keys(a).find(s=>r[s]===(!n||gi.all))},Mf=t=>Array.isArray(t)?t:[t],J3=(t,r,o)=>!t||!r||t===r||Mf(t).some(n=>n&&(o?n===r:n.startsWith(r)||r.startsWith(n)));function jS(t){const r=me.useRef(t);r.current=t,me.useEffect(()=>{const o=!t.disabled&&r.current.subject&&r.current.subject.subscribe({next:r.current.next});return()=>{o&&o.unsubscribe()}},[t.disabled])}function FX(t){const r=$v(),{control:o=r.control,disabled:n,name:i,exact:a}=t||{},[s,l]=me.useState(o._formState),u=me.useRef(!0),c=me.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),h=me.useRef(i);return h.current=i,jS({disabled:n,next:f=>u.current&&J3(h.current,f.name,a)&&Q3(f,c.current,o._updateFormState)&&l({...o._formState,...f}),subject:o._subjects.state}),me.useEffect(()=>(u.current=!0,c.current.isValid&&o._updateValid(!0),()=>{u.current=!1}),[o]),Z3(s,o,c.current,!1)}var Ui=t=>typeof t=="string",e5=(t,r,o,n,i)=>Ui(t)?(n&&r.watch.add(t),rt(o,t,i)):Array.isArray(t)?t.map(a=>(n&&r.watch.add(a),rt(o,a))):(n&&(r.watchAll=!0),o);function $X(t){const r=$v(),{control:o=r.control,name:n,defaultValue:i,disabled:a,exact:s}=t||{},l=me.useRef(n);l.current=n,jS({disabled:a,subject:o._subjects.values,next:h=>{J3(l.current,h.name,s)&&c(io(e5(l.current,o._names,h.values||o._formValues,!1,i)))}});const[u,c]=me.useState(o._getWatch(n,i));return me.useEffect(()=>o._removeUnmounted()),u}function UX(t){const r=$v(),{name:o,disabled:n,control:i=r.control,shouldUnregister:a}=t,s=X3(i._names.array,o),l=$X({control:i,name:o,defaultValue:rt(i._formValues,o,rt(i._defaultValues,o,t.defaultValue)),exact:!0}),u=FX({control:i,name:o,exact:!0}),c=me.useRef(i.register(o,{...t.rules,value:l,...zo(t.disabled)?{disabled:t.disabled}:{}}));return me.useEffect(()=>{const h=i._options.shouldUnregister||a,f=(d,m)=>{const y=rt(i._fields,d);y&&y._f&&(y._f.mount=m)};if(f(o,!0),h){const d=io(rt(i._options.defaultValues,o));Qt(i._defaultValues,o,d),Br(rt(i._formValues,o))&&Qt(i._formValues,o,d)}return()=>{(s?h&&!i._state.action:h)?i.unregister(o):f(o,!1)}},[o,i,s,a]),me.useEffect(()=>{rt(i._fields,o)&&i._updateDisabledField({disabled:n,fields:i._fields,name:o,value:rt(i._fields,o)._f.value})},[n,o,i]),{field:{name:o,value:l,...zo(n)||u.disabled?{disabled:u.disabled||n}:{},onChange:me.useCallback(h=>c.current.onChange({target:{value:q3(h),name:o},type:Iy.CHANGE}),[o]),onBlur:me.useCallback(()=>c.current.onBlur({target:{value:rt(i._formValues,o),name:o},type:Iy.BLUR}),[o,i]),ref:me.useCallback(h=>{const f=rt(i._fields,o);f&&h&&(f._f.ref={focus:()=>h.focus(),select:()=>h.select(),setCustomValidity:d=>h.setCustomValidity(d),reportValidity:()=>h.reportValidity()})},[i._fields,o])},formState:u,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!rt(u.errors,o)},isDirty:{enumerable:!0,get:()=>!!rt(u.dirtyFields,o)},isTouched:{enumerable:!0,get:()=>!!rt(u.touchedFields,o)},isValidating:{enumerable:!0,get:()=>!!rt(u.validatingFields,o)},error:{enumerable:!0,get:()=>rt(u.errors,o)}})}}const BX=t=>t.render(UX(t));var t5=(t,r,o,n,i)=>r?{...o[t],types:{...o[t]&&o[t].types?o[t].types:{},[n]:i||!0}}:{},XO=t=>({isOnSubmit:!t||t===gi.onSubmit,isOnBlur:t===gi.onBlur,isOnChange:t===gi.onChange,isOnAll:t===gi.all,isOnTouch:t===gi.onTouched}),YO=(t,r,o)=>!o&&(r.watchAll||r.watch.has(t)||[...r.watch].some(n=>t.startsWith(n)&&/^\.\w+/.test(t.slice(n.length))));const Rf=(t,r,o,n)=>{for(const i of o||Object.keys(t)){const a=rt(t,i);if(a){const{_f:s,...l}=a;if(s){if(s.refs&&s.refs[0]&&r(s.refs[0],i)&&!n)return!0;if(s.ref&&r(s.ref,s.name)&&!n)return!0;if(Rf(l,r))break}else if(Wr(l)&&Rf(l,r))break}}};var zX=(t,r,o)=>{const n=Mf(rt(t,o));return Qt(n,"root",r[o]),Qt(t,o,n),t},SS=t=>t.type==="file",ma=t=>typeof t=="function",Ny=t=>{if(!wS)return!1;const r=t?t.ownerDocument:0;return t instanceof(r&&r.defaultView?r.defaultView.HTMLElement:HTMLElement)},Xm=t=>Ui(t),ES=t=>t.type==="radio",Ly=t=>t instanceof RegExp;const KO={value:!1,isValid:!1},ZO={value:!0,isValid:!0};var r5=t=>{if(Array.isArray(t)){if(t.length>1){const r=t.filter(o=>o&&o.checked&&!o.disabled).map(o=>o.value);return{value:r,isValid:!!r.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!Br(t[0].attributes.value)?Br(t[0].value)||t[0].value===""?ZO:{value:t[0].value,isValid:!0}:ZO:KO}return KO};const QO={isValid:!1,value:null};var n5=t=>Array.isArray(t)?t.reduce((r,o)=>o&&o.checked&&!o.disabled?{isValid:!0,value:o.value}:r,QO):QO;function JO(t,r,o="validate"){if(Xm(t)||Array.isArray(t)&&t.every(Xm)||zo(t)&&!t)return{type:o,message:Xm(t)?t:"",ref:r}}var gu=t=>Wr(t)&&!Ly(t)?t:{value:t,message:""},ek=async(t,r,o,n,i)=>{const{ref:a,refs:s,required:l,maxLength:u,minLength:c,min:h,max:f,pattern:d,validate:m,name:y,valueAsNumber:p,mount:g,disabled:b}=t._f,x=rt(r,y);if(!g||b)return{};const v=s?s[0]:a,w=R=>{n&&v.reportValidity&&(v.setCustomValidity(zo(R)?"":R||""),v.reportValidity())},_={},E=ES(a),S=_p(a),T=E||S,k=(p||SS(a))&&Br(a.value)&&Br(x)||Ny(a)&&a.value===""||x===""||Array.isArray(x)&&!x.length,A=t5.bind(null,y,o,_),O=(R,C,L,F=oa.maxLength,z=oa.minLength)=>{const W=R?C:L;_[y]={type:R?F:z,message:W,ref:a,...A(R?F:z,W)}};if(i?!Array.isArray(x)||!x.length:l&&(!T&&(k||Yn(x))||zo(x)&&!x||S&&!r5(s).isValid||E&&!n5(s).isValid)){const{value:R,message:C}=Xm(l)?{value:!!l,message:l}:gu(l);if(R&&(_[y]={type:oa.required,message:C,ref:v,...A(oa.required,C)},!o))return w(C),_}if(!k&&(!Yn(h)||!Yn(f))){let R,C;const L=gu(f),F=gu(h);if(!Yn(x)&&!isNaN(x)){const z=a.valueAsNumber||x&&+x;Yn(L.value)||(R=z>L.value),Yn(F.value)||(C=znew Date(new Date().toDateString()+" "+K),$=a.type=="time",G=a.type=="week";Ui(L.value)&&x&&(R=$?W(x)>W(L.value):G?x>L.value:z>new Date(L.value)),Ui(F.value)&&x&&(C=$?W(x)+R.value,F=!Yn(C.value)&&x.length<+C.value;if((L||F)&&(O(L,R.message,C.message),!o))return w(_[y].message),_}if(d&&!k&&Ui(x)){const{value:R,message:C}=gu(d);if(Ly(R)&&!x.match(R)&&(_[y]={type:oa.pattern,message:C,ref:a,...A(oa.pattern,C)},!o))return w(C),_}if(m){if(ma(m)){const R=await m(x,r),C=JO(R,v);if(C&&(_[y]={...C,...A(oa.validate,C.message)},!o))return w(C.message),_}else if(Wr(m)){let R={};for(const C in m){if(!lo(R)&&!o)break;const L=JO(await m[C](x,r),v,C);L&&(R={...L,...A(C,L.message)},w(L.message),o&&(_[y]=R))}if(!lo(R)&&(_[y]={ref:v,...R},!o))return _}}return w(!0),_};function VX(t,r){const o=r.slice(0,-1).length;let n=0;for(;n{let t=[];return{get observers(){return t},next:i=>{for(const a of t)a.next&&a.next(i)},subscribe:i=>(t.push(i),{unsubscribe:()=>{t=t.filter(a=>a!==i)}}),unsubscribe:()=>{t=[]}}},lw=t=>Yn(t)||!H3(t);function us(t,r){if(lw(t)||lw(r))return t===r;if(ml(t)&&ml(r))return t.getTime()===r.getTime();const o=Object.keys(t),n=Object.keys(r);if(o.length!==n.length)return!1;for(const i of o){const a=t[i];if(!n.includes(i))return!1;if(i!=="ref"){const s=r[i];if(ml(a)&&ml(s)||Wr(a)&&Wr(s)||Array.isArray(a)&&Array.isArray(s)?!us(a,s):a!==s)return!1}}return!0}var o5=t=>t.type==="select-multiple",WX=t=>ES(t)||_p(t),Vb=t=>Ny(t)&&t.isConnected,i5=t=>{for(const r in t)if(ma(t[r]))return!0;return!1};function Dy(t,r={}){const o=Array.isArray(t);if(Wr(t)||o)for(const n in t)Array.isArray(t[n])||Wr(t[n])&&!i5(t[n])?(r[n]=Array.isArray(t[n])?[]:{},Dy(t[n],r[n])):Yn(t[n])||(r[n]=!0);return r}function a5(t,r,o){const n=Array.isArray(t);if(Wr(t)||n)for(const i in t)Array.isArray(t[i])||Wr(t[i])&&!i5(t[i])?Br(r)||lw(o[i])?o[i]=Array.isArray(t[i])?Dy(t[i],[]):{...Dy(t[i])}:a5(t[i],Yn(r)?{}:r[i],o[i]):o[i]=!us(t[i],r[i]);return o}var Wd=(t,r)=>a5(t,r,Dy(r)),s5=(t,{valueAsNumber:r,valueAsDate:o,setValueAs:n})=>Br(t)?t:r?t===""?NaN:t&&+t:o&&Ui(t)?new Date(t):n?n(t):t;function Gb(t){const r=t.ref;if(!(t.refs?t.refs.every(o=>o.disabled):r.disabled))return SS(r)?r.files:ES(r)?n5(t.refs).value:o5(r)?[...r.selectedOptions].map(({value:o})=>o):_p(r)?r5(t.refs).value:s5(Br(r.value)?t.ref.value:r.value,t)}var HX=(t,r,o,n)=>{const i={};for(const a of t){const s=rt(r,a);s&&Qt(i,a,s._f)}return{criteriaMode:o,names:[...t],fields:i,shouldUseNativeValidation:n}},Hd=t=>Br(t)?t:Ly(t)?t.source:Wr(t)?Ly(t.value)?t.value.source:t.value:t;const tk="AsyncFunction";var qX=t=>(!t||!t.validate)&&!!(ma(t.validate)&&t.validate.constructor.name===tk||Wr(t.validate)&&Object.values(t.validate).find(r=>r.constructor.name===tk)),XX=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate);function rk(t,r,o){const n=rt(t,o);if(n||_S(o))return{error:n,name:o};const i=o.split(".");for(;i.length;){const a=i.join("."),s=rt(r,a),l=rt(t,a);if(s&&!Array.isArray(s)&&o!==a)return{name:o};if(l&&l.type)return{name:a,error:l};i.pop()}return{name:o}}var YX=(t,r,o,n,i)=>i.isOnAll?!1:!o&&i.isOnTouch?!(r||t):(o?n.isOnBlur:i.isOnBlur)?!t:(o?n.isOnChange:i.isOnChange)?t:!0,KX=(t,r)=>!Fv(rt(t,r)).length&&rn(t,r);const ZX={mode:gi.onSubmit,reValidateMode:gi.onChange,shouldFocusError:!0};function QX(t={}){let r={...ZX,...t},o={submitCount:0,isDirty:!1,isLoading:ma(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},n={},i=Wr(r.defaultValues)||Wr(r.values)?io(r.defaultValues||r.values)||{}:{},a=r.shouldUnregister?{}:io(i),s={action:!1,mount:!1,watch:!1},l={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,c=0;const h={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={values:zb(),array:zb(),state:zb()},d=XO(r.mode),m=XO(r.reValidateMode),y=r.criteriaMode===gi.all,p=re=>se=>{clearTimeout(c),c=setTimeout(re,se)},g=async re=>{if(!t.disabled&&(h.isValid||re)){const se=r.resolver?lo((await T()).errors):await A(n,!0);se!==o.isValid&&f.state.next({isValid:se})}},b=(re,se)=>{!t.disabled&&(h.isValidating||h.validatingFields)&&((re||Array.from(l.mount)).forEach(ye=>{ye&&(se?Qt(o.validatingFields,ye,se):rn(o.validatingFields,ye))}),f.state.next({validatingFields:o.validatingFields,isValidating:!lo(o.validatingFields)}))},x=(re,se=[],ye,Pe,_e=!0,Ne=!0)=>{if(Pe&&ye&&!t.disabled){if(s.action=!0,Ne&&Array.isArray(rt(n,re))){const $e=ye(rt(n,re),Pe.argA,Pe.argB);_e&&Qt(n,re,$e)}if(Ne&&Array.isArray(rt(o.errors,re))){const $e=ye(rt(o.errors,re),Pe.argA,Pe.argB);_e&&Qt(o.errors,re,$e),KX(o.errors,re)}if(h.touchedFields&&Ne&&Array.isArray(rt(o.touchedFields,re))){const $e=ye(rt(o.touchedFields,re),Pe.argA,Pe.argB);_e&&Qt(o.touchedFields,re,$e)}h.dirtyFields&&(o.dirtyFields=Wd(i,a)),f.state.next({name:re,isDirty:R(re,se),dirtyFields:o.dirtyFields,errors:o.errors,isValid:o.isValid})}else Qt(a,re,se)},v=(re,se)=>{Qt(o.errors,re,se),f.state.next({errors:o.errors})},w=re=>{o.errors=re,f.state.next({errors:o.errors,isValid:!1})},_=(re,se,ye,Pe)=>{const _e=rt(n,re);if(_e){const Ne=rt(a,re,Br(ye)?rt(i,re):ye);Br(Ne)||Pe&&Pe.defaultChecked||se?Qt(a,re,se?Ne:Gb(_e._f)):F(re,Ne),s.mount&&g()}},E=(re,se,ye,Pe,_e)=>{let Ne=!1,$e=!1;const ze={name:re};if(!t.disabled){const Ke=!!(rt(n,re)&&rt(n,re)._f&&rt(n,re)._f.disabled);if(!ye||Pe){h.isDirty&&($e=o.isDirty,o.isDirty=ze.isDirty=R(),Ne=$e!==ze.isDirty);const Xe=Ke||us(rt(i,re),se);$e=!!(!Ke&&rt(o.dirtyFields,re)),Xe||Ke?rn(o.dirtyFields,re):Qt(o.dirtyFields,re,!0),ze.dirtyFields=o.dirtyFields,Ne=Ne||h.dirtyFields&&$e!==!Xe}if(ye){const Xe=rt(o.touchedFields,re);Xe||(Qt(o.touchedFields,re,ye),ze.touchedFields=o.touchedFields,Ne=Ne||h.touchedFields&&Xe!==ye)}Ne&&_e&&f.state.next(ze)}return Ne?ze:{}},S=(re,se,ye,Pe)=>{const _e=rt(o.errors,re),Ne=h.isValid&&zo(se)&&o.isValid!==se;if(t.delayError&&ye?(u=p(()=>v(re,ye)),u(t.delayError)):(clearTimeout(c),u=null,ye?Qt(o.errors,re,ye):rn(o.errors,re)),(ye?!us(_e,ye):_e)||!lo(Pe)||Ne){const $e={...Pe,...Ne&&zo(se)?{isValid:se}:{},errors:o.errors,name:re};o={...o,...$e},f.state.next($e)}},T=async re=>{b(re,!0);const se=await r.resolver(a,r.context,HX(re||l.mount,n,r.criteriaMode,r.shouldUseNativeValidation));return b(re),se},k=async re=>{const{errors:se}=await T(re);if(re)for(const ye of re){const Pe=rt(se,ye);Pe?Qt(o.errors,ye,Pe):rn(o.errors,ye)}else o.errors=se;return se},A=async(re,se,ye={valid:!0})=>{for(const Pe in re){const _e=re[Pe];if(_e){const{_f:Ne,...$e}=_e;if(Ne){const ze=l.array.has(Ne.name),Ke=_e._f&&qX(_e._f);Ke&&h.validatingFields&&b([Pe],!0);const Xe=await ek(_e,a,y,r.shouldUseNativeValidation&&!se,ze);if(Ke&&h.validatingFields&&b([Pe]),Xe[Ne.name]&&(ye.valid=!1,se))break;!se&&(rt(Xe,Ne.name)?ze?zX(o.errors,Xe,Ne.name):Qt(o.errors,Ne.name,Xe[Ne.name]):rn(o.errors,Ne.name))}!lo($e)&&await A($e,se,ye)}}return ye.valid},O=()=>{for(const re of l.unMount){const se=rt(n,re);se&&(se._f.refs?se._f.refs.every(ye=>!Vb(ye)):!Vb(se._f.ref))&&Y(re)}l.unMount=new Set},R=(re,se)=>!t.disabled&&(re&&se&&Qt(a,re,se),!us(Z(),i)),C=(re,se,ye)=>e5(re,l,{...s.mount?a:Br(se)?i:Ui(re)?{[re]:se}:se},ye,se),L=re=>Fv(rt(s.mount?a:i,re,t.shouldUnregister?rt(i,re,[]):[])),F=(re,se,ye={})=>{const Pe=rt(n,re);let _e=se;if(Pe){const Ne=Pe._f;Ne&&(!Ne.disabled&&Qt(a,re,s5(se,Ne)),_e=Ny(Ne.ref)&&Yn(se)?"":se,o5(Ne.ref)?[...Ne.ref.options].forEach($e=>$e.selected=_e.includes($e.value)):Ne.refs?_p(Ne.ref)?Ne.refs.length>1?Ne.refs.forEach($e=>(!$e.defaultChecked||!$e.disabled)&&($e.checked=Array.isArray(_e)?!!_e.find(ze=>ze===$e.value):_e===$e.value)):Ne.refs[0]&&(Ne.refs[0].checked=!!_e):Ne.refs.forEach($e=>$e.checked=$e.value===_e):SS(Ne.ref)?Ne.ref.value="":(Ne.ref.value=_e,Ne.ref.type||f.values.next({name:re,values:{...a}})))}(ye.shouldDirty||ye.shouldTouch)&&E(re,_e,ye.shouldTouch,ye.shouldDirty,!0),ye.shouldValidate&&K(re)},z=(re,se,ye)=>{for(const Pe in se){const _e=se[Pe],Ne=`${re}.${Pe}`,$e=rt(n,Ne);(l.array.has(re)||Wr(_e)||$e&&!$e._f)&&!ml(_e)?z(Ne,_e,ye):F(Ne,_e,ye)}},W=(re,se,ye={})=>{const Pe=rt(n,re),_e=l.array.has(re),Ne=io(se);Qt(a,re,Ne),_e?(f.array.next({name:re,values:{...a}}),(h.isDirty||h.dirtyFields)&&ye.shouldDirty&&f.state.next({name:re,dirtyFields:Wd(i,a),isDirty:R(re,Ne)})):Pe&&!Pe._f&&!Yn(Ne)?z(re,Ne,ye):F(re,Ne,ye),YO(re,l)&&f.state.next({...o}),f.values.next({name:s.mount?re:void 0,values:{...a}})},$=async re=>{s.mount=!0;const se=re.target;let ye=se.name,Pe=!0;const _e=rt(n,ye),Ne=()=>se.type?Gb(_e._f):q3(re),$e=ze=>{Pe=Number.isNaN(ze)||ml(ze)&&isNaN(ze.getTime())||us(ze,rt(a,ye,ze))};if(_e){let ze,Ke;const Xe=Ne(),Te=re.type===Iy.BLUR||re.type===Iy.FOCUS_OUT,Be=!XX(_e._f)&&!r.resolver&&!rt(o.errors,ye)&&!_e._f.deps||YX(Te,rt(o.touchedFields,ye),o.isSubmitted,m,d),ke=YO(ye,l,Te);Qt(a,ye,Xe),Te?(_e._f.onBlur&&_e._f.onBlur(re),u&&u(0)):_e._f.onChange&&_e._f.onChange(re);const ie=E(ye,Xe,Te,!1),ue=!lo(ie)||ke;if(!Te&&f.values.next({name:ye,type:re.type,values:{...a}}),Be)return h.isValid&&(t.mode==="onBlur"?Te&&g():g()),ue&&f.state.next({name:ye,...ke?{}:ie});if(!Te&&ke&&f.state.next({...o}),r.resolver){const{errors:J}=await T([ye]);if($e(Xe),Pe){const de=rk(o.errors,n,ye),je=rk(J,n,de.name||ye);ze=je.error,ye=je.name,Ke=lo(J)}}else b([ye],!0),ze=(await ek(_e,a,y,r.shouldUseNativeValidation))[ye],b([ye]),$e(Xe),Pe&&(ze?Ke=!1:h.isValid&&(Ke=await A(n,!0)));Pe&&(_e._f.deps&&K(_e._f.deps),S(ye,Ke,ze,ie))}},G=(re,se)=>{if(rt(o.errors,se)&&re.focus)return re.focus(),1},K=async(re,se={})=>{let ye,Pe;const _e=Mf(re);if(r.resolver){const Ne=await k(Br(re)?re:_e);ye=lo(Ne),Pe=re?!_e.some($e=>rt(Ne,$e)):ye}else re?(Pe=(await Promise.all(_e.map(async Ne=>{const $e=rt(n,Ne);return await A($e&&$e._f?{[Ne]:$e}:$e)}))).every(Boolean),!(!Pe&&!o.isValid)&&g()):Pe=ye=await A(n);return f.state.next({...!Ui(re)||h.isValid&&ye!==o.isValid?{}:{name:re},...r.resolver||!re?{isValid:ye}:{},errors:o.errors}),se.shouldFocus&&!Pe&&Rf(n,G,re?_e:l.mount),Pe},Z=re=>{const se={...s.mount?a:i};return Br(re)?se:Ui(re)?rt(se,re):re.map(ye=>rt(se,ye))},U=(re,se)=>({invalid:!!rt((se||o).errors,re),isDirty:!!rt((se||o).dirtyFields,re),error:rt((se||o).errors,re),isValidating:!!rt(o.validatingFields,re),isTouched:!!rt((se||o).touchedFields,re)}),I=re=>{re&&Mf(re).forEach(se=>rn(o.errors,se)),f.state.next({errors:re?o.errors:{}})},B=(re,se,ye)=>{const Pe=(rt(n,re,{_f:{}})._f||{}).ref,_e=rt(o.errors,re)||{},{ref:Ne,message:$e,type:ze,...Ke}=_e;Qt(o.errors,re,{...Ke,...se,ref:Pe}),f.state.next({name:re,errors:o.errors,isValid:!1}),ye&&ye.shouldFocus&&Pe&&Pe.focus&&Pe.focus()},H=(re,se)=>ma(re)?f.values.subscribe({next:ye=>re(C(void 0,se),ye)}):C(re,se,!0),Y=(re,se={})=>{for(const ye of re?Mf(re):l.mount)l.mount.delete(ye),l.array.delete(ye),se.keepValue||(rn(n,ye),rn(a,ye)),!se.keepError&&rn(o.errors,ye),!se.keepDirty&&rn(o.dirtyFields,ye),!se.keepTouched&&rn(o.touchedFields,ye),!se.keepIsValidating&&rn(o.validatingFields,ye),!r.shouldUnregister&&!se.keepDefaultValue&&rn(i,ye);f.values.next({values:{...a}}),f.state.next({...o,...se.keepDirty?{isDirty:R()}:{}}),!se.keepIsValid&&g()},ee=({disabled:re,name:se,field:ye,fields:Pe,value:_e})=>{if(zo(re)&&s.mount||re){const Ne=re?void 0:Br(_e)?Gb(ye?ye._f:rt(Pe,se)._f):_e;Qt(a,se,Ne),E(se,Ne,!1,!1,!0)}},oe=(re,se={})=>{let ye=rt(n,re);const Pe=zo(se.disabled)||zo(t.disabled);return Qt(n,re,{...ye||{},_f:{...ye&&ye._f?ye._f:{ref:{name:re}},name:re,mount:!0,...se}}),l.mount.add(re),ye?ee({field:ye,disabled:zo(se.disabled)?se.disabled:t.disabled,name:re,value:se.value}):_(re,!0,se.value),{...Pe?{disabled:se.disabled||t.disabled}:{},...r.progressive?{required:!!se.required,min:Hd(se.min),max:Hd(se.max),minLength:Hd(se.minLength),maxLength:Hd(se.maxLength),pattern:Hd(se.pattern)}:{},name:re,onChange:$,onBlur:$,ref:_e=>{if(_e){oe(re,se),ye=rt(n,re);const Ne=Br(_e.value)&&_e.querySelectorAll&&_e.querySelectorAll("input,select,textarea")[0]||_e,$e=WX(Ne),ze=ye._f.refs||[];if($e?ze.find(Ke=>Ke===Ne):Ne===ye._f.ref)return;Qt(n,re,{_f:{...ye._f,...$e?{refs:[...ze.filter(Vb),Ne,...Array.isArray(rt(i,re))?[{}]:[]],ref:{type:Ne.type,name:re}}:{ref:Ne}}}),_(re,!1,void 0,Ne)}else ye=rt(n,re,{}),ye._f&&(ye._f.mount=!1),(r.shouldUnregister||se.shouldUnregister)&&!(X3(l.array,re)&&s.action)&&l.unMount.add(re)}}},ce=()=>r.shouldFocusError&&Rf(n,G,l.mount),he=re=>{zo(re)&&(f.state.next({disabled:re}),Rf(n,(se,ye)=>{const Pe=rt(n,ye);Pe&&(se.disabled=Pe._f.disabled||re,Array.isArray(Pe._f.refs)&&Pe._f.refs.forEach(_e=>{_e.disabled=Pe._f.disabled||re}))},0,!1))},ae=(re,se)=>async ye=>{let Pe;ye&&(ye.preventDefault&&ye.preventDefault(),ye.persist&&ye.persist());let _e=io(a);if(f.state.next({isSubmitting:!0}),r.resolver){const{errors:Ne,values:$e}=await T();o.errors=Ne,_e=$e}else await A(n);if(rn(o.errors,"root"),lo(o.errors)){f.state.next({errors:{}});try{await re(_e,ye)}catch(Ne){Pe=Ne}}else se&&await se({...o.errors},ye),ce(),setTimeout(ce);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:lo(o.errors)&&!Pe,submitCount:o.submitCount+1,errors:o.errors}),Pe)throw Pe},te=(re,se={})=>{rt(n,re)&&(Br(se.defaultValue)?W(re,io(rt(i,re))):(W(re,se.defaultValue),Qt(i,re,io(se.defaultValue))),se.keepTouched||rn(o.touchedFields,re),se.keepDirty||(rn(o.dirtyFields,re),o.isDirty=se.defaultValue?R(re,io(rt(i,re))):R()),se.keepError||(rn(o.errors,re),h.isValid&&g()),f.state.next({...o}))},pe=(re,se={})=>{const ye=re?io(re):i,Pe=io(ye),_e=lo(re),Ne=_e?i:Pe;if(se.keepDefaultValues||(i=ye),!se.keepValues){if(se.keepDirtyValues){const $e=new Set([...l.mount,...Object.keys(Wd(i,a))]);for(const ze of Array.from($e))rt(o.dirtyFields,ze)?Qt(Ne,ze,rt(a,ze)):W(ze,rt(Ne,ze))}else{if(wS&&Br(re))for(const $e of l.mount){const ze=rt(n,$e);if(ze&&ze._f){const Ke=Array.isArray(ze._f.refs)?ze._f.refs[0]:ze._f.ref;if(Ny(Ke)){const Xe=Ke.closest("form");if(Xe){Xe.reset();break}}}}n={}}a=t.shouldUnregister?se.keepDefaultValues?io(i):{}:io(Ne),f.array.next({values:{...Ne}}),f.values.next({values:{...Ne}})}l={mount:se.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!h.isValid||!!se.keepIsValid||!!se.keepDirtyValues,s.watch=!!t.shouldUnregister,f.state.next({submitCount:se.keepSubmitCount?o.submitCount:0,isDirty:_e?!1:se.keepDirty?o.isDirty:!!(se.keepDefaultValues&&!us(re,i)),isSubmitted:se.keepIsSubmitted?o.isSubmitted:!1,dirtyFields:_e?{}:se.keepDirtyValues?se.keepDefaultValues&&a?Wd(i,a):o.dirtyFields:se.keepDefaultValues&&re?Wd(i,re):se.keepDirty?o.dirtyFields:{},touchedFields:se.keepTouched?o.touchedFields:{},errors:se.keepErrors?o.errors:{},isSubmitSuccessful:se.keepIsSubmitSuccessful?o.isSubmitSuccessful:!1,isSubmitting:!1})},ne=(re,se)=>pe(ma(re)?re(a):re,se);return{control:{register:oe,unregister:Y,getFieldState:U,handleSubmit:ae,setError:B,_executeSchema:T,_getWatch:C,_getDirty:R,_updateValid:g,_removeUnmounted:O,_updateFieldArray:x,_updateDisabledField:ee,_getFieldArray:L,_reset:pe,_resetDefaultValues:()=>ma(r.defaultValues)&&r.defaultValues().then(re=>{ne(re,r.resetOptions),f.state.next({isLoading:!1})}),_updateFormState:re=>{o={...o,...re}},_disableForm:he,_subjects:f,_proxyFormState:h,_setErrors:w,get _fields(){return n},get _formValues(){return a},get _state(){return s},set _state(re){s=re},get _defaultValues(){return i},get _names(){return l},set _names(re){l=re},get _formState(){return o},set _formState(re){o=re},get _options(){return r},set _options(re){r={...r,...re}}},trigger:K,register:oe,handleSubmit:ae,watch:H,setValue:W,getValues:Z,reset:ne,resetField:te,clearErrors:I,unregister:Y,setError:B,setFocus:(re,se={})=>{const ye=rt(n,re),Pe=ye&&ye._f;if(Pe){const _e=Pe.refs?Pe.refs[0]:Pe.ref;_e.focus&&(_e.focus(),se.shouldSelect&&_e.select())}},getFieldState:U}}function JX(t={}){const r=me.useRef(),o=me.useRef(),[n,i]=me.useState({isDirty:!1,isValidating:!1,isLoading:ma(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,defaultValues:ma(t.defaultValues)?void 0:t.defaultValues});r.current||(r.current={...QX(t),formState:n});const a=r.current.control;return a._options=t,jS({subject:a._subjects.state,next:s=>{Q3(s,a._proxyFormState,a._updateFormState,!0)&&i({...a._formState})}}),me.useEffect(()=>a._disableForm(t.disabled),[a,t.disabled]),me.useEffect(()=>{if(a._proxyFormState.isDirty){const s=a._getDirty();s!==n.isDirty&&a._subjects.state.next({isDirty:s})}},[a,n.isDirty]),me.useEffect(()=>{t.values&&!us(t.values,o.current)?(a._reset(t.values,a._options.resetOptions),o.current=t.values,i(s=>({...s}))):a._resetDefaultValues()},[t.values,a]),me.useEffect(()=>{t.errors&&a._setErrors(t.errors)},[t.errors,a]),me.useEffect(()=>{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),me.useEffect(()=>{t.shouldUnregister&&a._subjects.values.next({values:a._getWatch()})},[t.shouldUnregister,a]),me.useEffect(()=>{r.current&&(r.current.watch=r.current.watch.bind({}))},[n]),r.current.formState=Z3(n,a),r.current}const nk=(t,r,o)=>{if(t&&"reportValidity"in t){const n=rt(o,r);t.setCustomValidity(n&&n.message||""),t.reportValidity()}},l5=(t,r)=>{for(const o in r.fields){const n=r.fields[o];n&&n.ref&&"reportValidity"in n.ref?nk(n.ref,o,t):n.refs&&n.refs.forEach(i=>nk(i,o,t))}},eY=(t,r)=>{r.shouldUseNativeValidation&&l5(t,r);const o={};for(const n in t){const i=rt(r.fields,n),a=Object.assign(t[n]||{},{ref:i&&i.ref});if(tY(r.names||Object.keys(t),n)){const s=Object.assign({},rt(o,n));Qt(s,"root",a),Qt(o,n,s)}else Qt(o,n,a)}return o},tY=(t,r)=>t.some(o=>o.startsWith(r+"."));var rY=function(t,r){for(var o={};t.length;){var n=t[0],i=n.code,a=n.message,s=n.path.join(".");if(!o[s])if("unionErrors"in n){var l=n.unionErrors[0].errors[0];o[s]={message:l.message,type:l.code}}else o[s]={message:a,type:i};if("unionErrors"in n&&n.unionErrors.forEach(function(h){return h.errors.forEach(function(f){return t.push(f)})}),r){var u=o[s].types,c=u&&u[n.code];o[s]=t5(s,r,o,i,c?[].concat(c,n.message):n.message)}t.shift()}return o},nY=function(t,r,o){return o===void 0&&(o={}),function(n,i,a){try{return Promise.resolve(function(s,l){try{var u=Promise.resolve(t[o.mode==="sync"?"parse":"parseAsync"](n,r)).then(function(c){return a.shouldUseNativeValidation&&l5({},a),{errors:{},values:o.raw?n:c}})}catch(c){return l(c)}return u&&u.then?u.then(void 0,l):u}(0,function(s){if(function(l){return Array.isArray(l==null?void 0:l.errors)}(s))return{values:{},errors:eY(rY(s.errors,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw s}))}catch(s){return Promise.reject(s)}}},qt;(function(t){t.assertEqual=i=>i;function r(i){}t.assertIs=r;function o(i){throw new Error}t.assertNever=o,t.arrayToEnum=i=>{const a={};for(const s of i)a[s]=s;return a},t.getValidEnumValues=i=>{const a=t.objectKeys(i).filter(l=>typeof i[i[l]]!="number"),s={};for(const l of a)s[l]=i[l];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"&&isFinite(i)&&Math.floor(i)===i;function n(i,a=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(a)}t.joinValues=n,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(qt||(qt={}));var ok;(function(t){t.mergeShapes=(r,o)=>({...r,...o})})(ok||(ok={}));const lt=qt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),cl=t=>{switch(typeof t){case"undefined":return lt.undefined;case"string":return lt.string;case"number":return isNaN(t)?lt.nan:lt.number;case"boolean":return lt.boolean;case"function":return lt.function;case"bigint":return lt.bigint;case"symbol":return lt.symbol;case"object":return Array.isArray(t)?lt.array:t===null?lt.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?lt.promise:typeof Map<"u"&&t instanceof Map?lt.map:typeof Set<"u"&&t instanceof Set?lt.set:typeof Date<"u"&&t instanceof Date?lt.date:lt.object;default:return lt.unknown}},et=qt.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 Yo extends Error{constructor(r){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const o=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,o):this.__proto__=o,this.name="ZodError",this.issues=r}get errors(){return this.issues}format(r){const o=r||function(a){return a.message},n={_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)n._errors.push(o(s));else{let l=n,u=0;for(;uo.message){const o={},n=[];for(const i of this.issues)i.path.length>0?(o[i.path[0]]=o[i.path[0]]||[],o[i.path[0]].push(r(i))):n.push(r(i));return{formErrors:n,fieldErrors:o}}get formErrors(){return this.flatten()}}Yo.create=t=>new Yo(t);const gh=(t,r)=>{let o;switch(t.code){case et.invalid_type:t.received===lt.undefined?o="Required":o=`Expected ${t.expected}, received ${t.received}`;break;case et.invalid_literal:o=`Invalid literal value, expected ${JSON.stringify(t.expected,qt.jsonStringifyReplacer)}`;break;case et.unrecognized_keys:o=`Unrecognized key(s) in object: ${qt.joinValues(t.keys,", ")}`;break;case et.invalid_union:o="Invalid input";break;case et.invalid_union_discriminator:o=`Invalid discriminator value. Expected ${qt.joinValues(t.options)}`;break;case et.invalid_enum_value:o=`Invalid enum value. Expected ${qt.joinValues(t.options)}, received '${t.received}'`;break;case et.invalid_arguments:o="Invalid function arguments";break;case et.invalid_return_type:o="Invalid function return type";break;case et.invalid_date:o="Invalid date";break;case et.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(o=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(o=`${o} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?o=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?o=`Invalid input: must end with "${t.validation.endsWith}"`:qt.assertNever(t.validation):t.validation!=="regex"?o=`Invalid ${t.validation}`:o="Invalid";break;case et.too_small:t.type==="array"?o=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?o=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?o=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?o=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:o="Invalid input";break;case et.too_big:t.type==="array"?o=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?o=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?o=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?o=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?o=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:o="Invalid input";break;case et.custom:o="Invalid input";break;case et.invalid_intersection_types:o="Intersection results could not be merged";break;case et.not_multiple_of:o=`Number must be a multiple of ${t.multipleOf}`;break;case et.not_finite:o="Number must be finite";break;default:o=r.defaultError,qt.assertNever(t)}return{message:o}};let oY=gh;function uw(){return oY}const cw=t=>{const{data:r,path:o,errorMaps:n,issueData:i}=t,a=[...o,...i.path||[]],s={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let l="";const u=n.filter(c=>!!c).slice().reverse();for(const c of u)l=c(s,{data:r,defaultError:l}).message;return{...i,path:a,message:l}};function at(t,r){const o=uw(),n=cw({issueData:r,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,o,o===gh?void 0:gh].filter(i=>!!i)});t.common.issues.push(n)}class to{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(r,o){const n=[];for(const i of o){if(i.status==="aborted")return Ot;i.status==="dirty"&&r.dirty(),n.push(i.value)}return{status:r.value,value:n}}static async mergeObjectAsync(r,o){const n=[];for(const i of o){const a=await i.key,s=await i.value;n.push({key:a,value:s})}return to.mergeObjectSync(r,n)}static mergeObjectSync(r,o){const n={};for(const i of o){const{key:a,value:s}=i;if(a.status==="aborted"||s.status==="aborted")return Ot;a.status==="dirty"&&r.dirty(),s.status==="dirty"&&r.dirty(),a.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(n[a.value]=s.value)}return{status:r.value,value:n}}}const Ot=Object.freeze({status:"aborted"}),pf=t=>({status:"dirty",value:t}),go=t=>({status:"valid",value:t}),ik=t=>t.status==="aborted",ak=t=>t.status==="dirty",Fy=t=>t.status==="valid",$y=t=>typeof Promise<"u"&&t instanceof Promise;function Uy(t,r,o,n){if(typeof r=="function"?t!==r||!n:!r.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r.get(t)}function u5(t,r,o,n,i){if(typeof r=="function"?t!==r||!i:!r.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r.set(t,o),o}var vt;(function(t){t.errToObj=r=>typeof r=="string"?{message:r}:r||{},t.toString=r=>typeof r=="string"?r:r==null?void 0:r.message})(vt||(vt={}));var mf,yf;class Xi{constructor(r,o,n,i){this._cachedPath=[],this.parent=r,this.data=o,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const sk=(t,r)=>{if(Fy(r))return{success:!0,data:r.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 o=new Yo(t.common.issues);return this._error=o,this._error}}};function Pt(t){if(!t)return{};const{errorMap:r,invalid_type_error:o,required_error:n,description:i}=t;if(r&&(o||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return r?{errorMap:r,description:i}:{errorMap:(s,l)=>{var u,c;const{message:h}=t;return s.code==="invalid_enum_value"?{message:h??l.defaultError}:typeof l.data>"u"?{message:(u=h??n)!==null&&u!==void 0?u:l.defaultError}:s.code!=="invalid_type"?{message:l.defaultError}:{message:(c=h??o)!==null&&c!==void 0?c:l.defaultError}},description:i}}class Ft{constructor(r){this.spa=this.safeParseAsync,this._def=r,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(r){return cl(r.data)}_getOrReturnCtx(r,o){return o||{common:r.parent.common,data:r.data,parsedType:cl(r.data),schemaErrorMap:this._def.errorMap,path:r.path,parent:r.parent}}_processInputParams(r){return{status:new to,ctx:{common:r.parent.common,data:r.data,parsedType:cl(r.data),schemaErrorMap:this._def.errorMap,path:r.path,parent:r.parent}}}_parseSync(r){const o=this._parse(r);if($y(o))throw new Error("Synchronous parse encountered promise.");return o}_parseAsync(r){const o=this._parse(r);return Promise.resolve(o)}parse(r,o){const n=this.safeParse(r,o);if(n.success)return n.data;throw n.error}safeParse(r,o){var n;const i={common:{issues:[],async:(n=o==null?void 0:o.async)!==null&&n!==void 0?n:!1,contextualErrorMap:o==null?void 0:o.errorMap},path:(o==null?void 0:o.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:cl(r)},a=this._parseSync({data:r,path:i.path,parent:i});return sk(i,a)}async parseAsync(r,o){const n=await this.safeParseAsync(r,o);if(n.success)return n.data;throw n.error}async safeParseAsync(r,o){const n={common:{issues:[],contextualErrorMap:o==null?void 0:o.errorMap,async:!0},path:(o==null?void 0:o.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:cl(r)},i=this._parse({data:r,path:n.path,parent:n}),a=await($y(i)?i:Promise.resolve(i));return sk(n,a)}refine(r,o){const n=i=>typeof o=="string"||typeof o>"u"?{message:o}:typeof o=="function"?o(i):o;return this._refinement((i,a)=>{const s=r(i),l=()=>a.addIssue({code:et.custom,...n(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(u=>u?!0:(l(),!1)):s?!0:(l(),!1)})}refinement(r,o){return this._refinement((n,i)=>r(n)?!0:(i.addIssue(typeof o=="function"?o(n,i):o),!1))}_refinement(r){return new Ma({schema:this,typeName:_t.ZodEffects,effect:{type:"refinement",refinement:r}})}superRefine(r){return this._refinement(r)}optional(){return wa.create(this,this._def)}nullable(){return Gl.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Gi.create(this,this._def)}promise(){return bh.create(this,this._def)}or(r){return Vy.create([this,r],this._def)}and(r){return Gy.create(this,r,this._def)}transform(r){return new Ma({...Pt(this._def),schema:this,typeName:_t.ZodEffects,effect:{type:"transform",transform:r}})}default(r){const o=typeof r=="function"?r:()=>r;return new Yy({...Pt(this._def),innerType:this,defaultValue:o,typeName:_t.ZodDefault})}brand(){return new h5({typeName:_t.ZodBranded,type:this,...Pt(this._def)})}catch(r){const o=typeof r=="function"?r:()=>r;return new Ky({...Pt(this._def),innerType:this,catchValue:o,typeName:_t.ZodCatch})}describe(r){const o=this.constructor;return new o({...this._def,description:r})}pipe(r){return Uv.create(this,r)}readonly(){return Zy.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const iY=/^c[^\s-]{8,}$/i,aY=/^[0-9a-z]+$/,sY=/^[0-9A-HJKMNP-TV-Z]{26}$/,lY=/^[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,uY=/^[a-z0-9_-]{21}$/i,cY=/^[-+]?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)?)??$/,dY=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,fY="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Wb;const hY=/^(?:(?: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])$/,pY=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,mY=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,c5="((\\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])))",yY=new RegExp(`^${c5}$`);function d5(t){let r="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?r=`${r}\\.\\d{${t.precision}}`:t.precision==null&&(r=`${r}(\\.\\d+)?`),r}function gY(t){return new RegExp(`^${d5(t)}$`)}function vY(t){let r=`${c5}T${d5(t)}`;const o=[];return o.push(t.local?"Z?":"Z"),t.offset&&o.push("([+-]\\d{2}:?\\d{2})"),r=`${r}(${o.join("|")})`,new RegExp(`^${r}$`)}function bY(t,r){return!!((r==="v4"||!r)&&hY.test(t)||(r==="v6"||!r)&&pY.test(t))}class ya extends Ft{_parse(r){if(this._def.coerce&&(r.data=String(r.data)),this._getType(r)!==lt.string){const a=this._getOrReturnCtx(r);return at(a,{code:et.invalid_type,expected:lt.string,received:a.parsedType}),Ot}const n=new to;let i;for(const a of this._def.checks)if(a.kind==="min")r.data.lengtha.value&&(i=this._getOrReturnCtx(r,i),at(i,{code:et.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const s=r.data.length>a.value,l=r.data.lengthr.test(i),{validation:o,code:et.invalid_string,...vt.errToObj(n)})}_addCheck(r){return new ya({...this._def,checks:[...this._def.checks,r]})}email(r){return this._addCheck({kind:"email",...vt.errToObj(r)})}url(r){return this._addCheck({kind:"url",...vt.errToObj(r)})}emoji(r){return this._addCheck({kind:"emoji",...vt.errToObj(r)})}uuid(r){return this._addCheck({kind:"uuid",...vt.errToObj(r)})}nanoid(r){return this._addCheck({kind:"nanoid",...vt.errToObj(r)})}cuid(r){return this._addCheck({kind:"cuid",...vt.errToObj(r)})}cuid2(r){return this._addCheck({kind:"cuid2",...vt.errToObj(r)})}ulid(r){return this._addCheck({kind:"ulid",...vt.errToObj(r)})}base64(r){return this._addCheck({kind:"base64",...vt.errToObj(r)})}ip(r){return this._addCheck({kind:"ip",...vt.errToObj(r)})}datetime(r){var o,n;return typeof r=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:r}):this._addCheck({kind:"datetime",precision:typeof(r==null?void 0:r.precision)>"u"?null:r==null?void 0:r.precision,offset:(o=r==null?void 0:r.offset)!==null&&o!==void 0?o:!1,local:(n=r==null?void 0:r.local)!==null&&n!==void 0?n:!1,...vt.errToObj(r==null?void 0:r.message)})}date(r){return this._addCheck({kind:"date",message:r})}time(r){return typeof r=="string"?this._addCheck({kind:"time",precision:null,message:r}):this._addCheck({kind:"time",precision:typeof(r==null?void 0:r.precision)>"u"?null:r==null?void 0:r.precision,...vt.errToObj(r==null?void 0:r.message)})}duration(r){return this._addCheck({kind:"duration",...vt.errToObj(r)})}regex(r,o){return this._addCheck({kind:"regex",regex:r,...vt.errToObj(o)})}includes(r,o){return this._addCheck({kind:"includes",value:r,position:o==null?void 0:o.position,...vt.errToObj(o==null?void 0:o.message)})}startsWith(r,o){return this._addCheck({kind:"startsWith",value:r,...vt.errToObj(o)})}endsWith(r,o){return this._addCheck({kind:"endsWith",value:r,...vt.errToObj(o)})}min(r,o){return this._addCheck({kind:"min",value:r,...vt.errToObj(o)})}max(r,o){return this._addCheck({kind:"max",value:r,...vt.errToObj(o)})}length(r,o){return this._addCheck({kind:"length",value:r,...vt.errToObj(o)})}nonempty(r){return this.min(1,vt.errToObj(r))}trim(){return new ya({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ya({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ya({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(r=>r.kind==="datetime")}get isDate(){return!!this._def.checks.find(r=>r.kind==="date")}get isTime(){return!!this._def.checks.find(r=>r.kind==="time")}get isDuration(){return!!this._def.checks.find(r=>r.kind==="duration")}get isEmail(){return!!this._def.checks.find(r=>r.kind==="email")}get isURL(){return!!this._def.checks.find(r=>r.kind==="url")}get isEmoji(){return!!this._def.checks.find(r=>r.kind==="emoji")}get isUUID(){return!!this._def.checks.find(r=>r.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(r=>r.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(r=>r.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(r=>r.kind==="cuid2")}get isULID(){return!!this._def.checks.find(r=>r.kind==="ulid")}get isIP(){return!!this._def.checks.find(r=>r.kind==="ip")}get isBase64(){return!!this._def.checks.find(r=>r.kind==="base64")}get minLength(){let r=null;for(const o of this._def.checks)o.kind==="min"&&(r===null||o.value>r)&&(r=o.value);return r}get maxLength(){let r=null;for(const o of this._def.checks)o.kind==="max"&&(r===null||o.value{var r;return new ya({checks:[],typeName:_t.ZodString,coerce:(r=t==null?void 0:t.coerce)!==null&&r!==void 0?r:!1,...Pt(t)})};function xY(t,r){const o=(t.toString().split(".")[1]||"").length,n=(r.toString().split(".")[1]||"").length,i=o>n?o:n,a=parseInt(t.toFixed(i).replace(".","")),s=parseInt(r.toFixed(i).replace(".",""));return a%s/Math.pow(10,i)}class Oc extends Ft{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(r){if(this._def.coerce&&(r.data=Number(r.data)),this._getType(r)!==lt.number){const a=this._getOrReturnCtx(r);return at(a,{code:et.invalid_type,expected:lt.number,received:a.parsedType}),Ot}let n;const i=new to;for(const a of this._def.checks)a.kind==="int"?qt.isInteger(r.data)||(n=this._getOrReturnCtx(r,n),at(n,{code:et.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?r.dataa.value:r.data>=a.value)&&(n=this._getOrReturnCtx(r,n),at(n,{code:et.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?xY(r.data,a.value)!==0&&(n=this._getOrReturnCtx(r,n),at(n,{code:et.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(r.data)||(n=this._getOrReturnCtx(r,n),at(n,{code:et.not_finite,message:a.message}),i.dirty()):qt.assertNever(a);return{status:i.value,value:r.data}}gte(r,o){return this.setLimit("min",r,!0,vt.toString(o))}gt(r,o){return this.setLimit("min",r,!1,vt.toString(o))}lte(r,o){return this.setLimit("max",r,!0,vt.toString(o))}lt(r,o){return this.setLimit("max",r,!1,vt.toString(o))}setLimit(r,o,n,i){return new Oc({...this._def,checks:[...this._def.checks,{kind:r,value:o,inclusive:n,message:vt.toString(i)}]})}_addCheck(r){return new Oc({...this._def,checks:[...this._def.checks,r]})}int(r){return this._addCheck({kind:"int",message:vt.toString(r)})}positive(r){return this._addCheck({kind:"min",value:0,inclusive:!1,message:vt.toString(r)})}negative(r){return this._addCheck({kind:"max",value:0,inclusive:!1,message:vt.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:0,inclusive:!0,message:vt.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:0,inclusive:!0,message:vt.toString(r)})}multipleOf(r,o){return this._addCheck({kind:"multipleOf",value:r,message:vt.toString(o)})}finite(r){return this._addCheck({kind:"finite",message:vt.toString(r)})}safe(r){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:vt.toString(r)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:vt.toString(r)})}get minValue(){let r=null;for(const o of this._def.checks)o.kind==="min"&&(r===null||o.value>r)&&(r=o.value);return r}get maxValue(){let r=null;for(const o of this._def.checks)o.kind==="max"&&(r===null||o.valuer.kind==="int"||r.kind==="multipleOf"&&qt.isInteger(r.value))}get isFinite(){let r=null,o=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(o===null||n.value>o)&&(o=n.value):n.kind==="max"&&(r===null||n.valuenew Oc({checks:[],typeName:_t.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Pt(t)});class kc extends Ft{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(r){if(this._def.coerce&&(r.data=BigInt(r.data)),this._getType(r)!==lt.bigint){const a=this._getOrReturnCtx(r);return at(a,{code:et.invalid_type,expected:lt.bigint,received:a.parsedType}),Ot}let n;const i=new to;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?r.dataa.value:r.data>=a.value)&&(n=this._getOrReturnCtx(r,n),at(n,{code:et.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?r.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(r,n),at(n,{code:et.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):qt.assertNever(a);return{status:i.value,value:r.data}}gte(r,o){return this.setLimit("min",r,!0,vt.toString(o))}gt(r,o){return this.setLimit("min",r,!1,vt.toString(o))}lte(r,o){return this.setLimit("max",r,!0,vt.toString(o))}lt(r,o){return this.setLimit("max",r,!1,vt.toString(o))}setLimit(r,o,n,i){return new kc({...this._def,checks:[...this._def.checks,{kind:r,value:o,inclusive:n,message:vt.toString(i)}]})}_addCheck(r){return new kc({...this._def,checks:[...this._def.checks,r]})}positive(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:vt.toString(r)})}negative(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:vt.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:vt.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:vt.toString(r)})}multipleOf(r,o){return this._addCheck({kind:"multipleOf",value:r,message:vt.toString(o)})}get minValue(){let r=null;for(const o of this._def.checks)o.kind==="min"&&(r===null||o.value>r)&&(r=o.value);return r}get maxValue(){let r=null;for(const o of this._def.checks)o.kind==="max"&&(r===null||o.value{var r;return new kc({checks:[],typeName:_t.ZodBigInt,coerce:(r=t==null?void 0:t.coerce)!==null&&r!==void 0?r:!1,...Pt(t)})};class dw extends Ft{_parse(r){if(this._def.coerce&&(r.data=!!r.data),this._getType(r)!==lt.boolean){const n=this._getOrReturnCtx(r);return at(n,{code:et.invalid_type,expected:lt.boolean,received:n.parsedType}),Ot}return go(r.data)}}dw.create=t=>new dw({typeName:_t.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Pt(t)});class vh extends Ft{_parse(r){if(this._def.coerce&&(r.data=new Date(r.data)),this._getType(r)!==lt.date){const a=this._getOrReturnCtx(r);return at(a,{code:et.invalid_type,expected:lt.date,received:a.parsedType}),Ot}if(isNaN(r.data.getTime())){const a=this._getOrReturnCtx(r);return at(a,{code:et.invalid_date}),Ot}const n=new to;let i;for(const a of this._def.checks)a.kind==="min"?r.data.getTime()a.value&&(i=this._getOrReturnCtx(r,i),at(i,{code:et.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):qt.assertNever(a);return{status:n.value,value:new Date(r.data.getTime())}}_addCheck(r){return new vh({...this._def,checks:[...this._def.checks,r]})}min(r,o){return this._addCheck({kind:"min",value:r.getTime(),message:vt.toString(o)})}max(r,o){return this._addCheck({kind:"max",value:r.getTime(),message:vt.toString(o)})}get minDate(){let r=null;for(const o of this._def.checks)o.kind==="min"&&(r===null||o.value>r)&&(r=o.value);return r!=null?new Date(r):null}get maxDate(){let r=null;for(const o of this._def.checks)o.kind==="max"&&(r===null||o.valuenew vh({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:_t.ZodDate,...Pt(t)});class fw extends Ft{_parse(r){if(this._getType(r)!==lt.symbol){const n=this._getOrReturnCtx(r);return at(n,{code:et.invalid_type,expected:lt.symbol,received:n.parsedType}),Ot}return go(r.data)}}fw.create=t=>new fw({typeName:_t.ZodSymbol,...Pt(t)});class By extends Ft{_parse(r){if(this._getType(r)!==lt.undefined){const n=this._getOrReturnCtx(r);return at(n,{code:et.invalid_type,expected:lt.undefined,received:n.parsedType}),Ot}return go(r.data)}}By.create=t=>new By({typeName:_t.ZodUndefined,...Pt(t)});class zy extends Ft{_parse(r){if(this._getType(r)!==lt.null){const n=this._getOrReturnCtx(r);return at(n,{code:et.invalid_type,expected:lt.null,received:n.parsedType}),Ot}return go(r.data)}}zy.create=t=>new zy({typeName:_t.ZodNull,...Pt(t)});class hw extends Ft{constructor(){super(...arguments),this._any=!0}_parse(r){return go(r.data)}}hw.create=t=>new hw({typeName:_t.ZodAny,...Pt(t)});class Qu extends Ft{constructor(){super(...arguments),this._unknown=!0}_parse(r){return go(r.data)}}Qu.create=t=>new Qu({typeName:_t.ZodUnknown,...Pt(t)});class Us extends Ft{_parse(r){const o=this._getOrReturnCtx(r);return at(o,{code:et.invalid_type,expected:lt.never,received:o.parsedType}),Ot}}Us.create=t=>new Us({typeName:_t.ZodNever,...Pt(t)});class pw extends Ft{_parse(r){if(this._getType(r)!==lt.undefined){const n=this._getOrReturnCtx(r);return at(n,{code:et.invalid_type,expected:lt.void,received:n.parsedType}),Ot}return go(r.data)}}pw.create=t=>new pw({typeName:_t.ZodVoid,...Pt(t)});class Gi extends Ft{_parse(r){const{ctx:o,status:n}=this._processInputParams(r),i=this._def;if(o.parsedType!==lt.array)return at(o,{code:et.invalid_type,expected:lt.array,received:o.parsedType}),Ot;if(i.exactLength!==null){const s=o.data.length>i.exactLength.value,l=o.data.lengthi.maxLength.value&&(at(o,{code:et.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),o.common.async)return Promise.all([...o.data].map((s,l)=>i.type._parseAsync(new Xi(o,s,o.path,l)))).then(s=>to.mergeArray(n,s));const a=[...o.data].map((s,l)=>i.type._parseSync(new Xi(o,s,o.path,l)));return to.mergeArray(n,a)}get element(){return this._def.type}min(r,o){return new Gi({...this._def,minLength:{value:r,message:vt.toString(o)}})}max(r,o){return new Gi({...this._def,maxLength:{value:r,message:vt.toString(o)}})}length(r,o){return new Gi({...this._def,exactLength:{value:r,message:vt.toString(o)}})}nonempty(r){return this.min(1,r)}}Gi.create=(t,r)=>new Gi({type:t,minLength:null,maxLength:null,exactLength:null,typeName:_t.ZodArray,...Pt(r)});function wu(t){if(t instanceof $r){const r={};for(const o in t.shape){const n=t.shape[o];r[o]=wa.create(wu(n))}return new $r({...t._def,shape:()=>r})}else return t instanceof Gi?new Gi({...t._def,type:wu(t.element)}):t instanceof wa?wa.create(wu(t.unwrap())):t instanceof Gl?Gl.create(wu(t.unwrap())):t instanceof Aa?Aa.create(t.items.map(r=>wu(r))):t}class $r extends Ft{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const r=this._def.shape(),o=qt.objectKeys(r);return this._cached={shape:r,keys:o}}_parse(r){if(this._getType(r)!==lt.object){const c=this._getOrReturnCtx(r);return at(c,{code:et.invalid_type,expected:lt.object,received:c.parsedType}),Ot}const{status:n,ctx:i}=this._processInputParams(r),{shape:a,keys:s}=this._getCached(),l=[];if(!(this._def.catchall instanceof Us&&this._def.unknownKeys==="strip"))for(const c in i.data)s.includes(c)||l.push(c);const u=[];for(const c of s){const h=a[c],f=i.data[c];u.push({key:{status:"valid",value:c},value:h._parse(new Xi(i,f,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof Us){const c=this._def.unknownKeys;if(c==="passthrough")for(const h of l)u.push({key:{status:"valid",value:h},value:{status:"valid",value:i.data[h]}});else if(c==="strict")l.length>0&&(at(i,{code:et.unrecognized_keys,keys:l}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const h of l){const f=i.data[h];u.push({key:{status:"valid",value:h},value:c._parse(new Xi(i,f,i.path,h)),alwaysSet:h in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const h of u){const f=await h.key,d=await h.value;c.push({key:f,value:d,alwaysSet:h.alwaysSet})}return c}).then(c=>to.mergeObjectSync(n,c)):to.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(r){return vt.errToObj,new $r({...this._def,unknownKeys:"strict",...r!==void 0?{errorMap:(o,n)=>{var i,a,s,l;const u=(s=(a=(i=this._def).errorMap)===null||a===void 0?void 0:a.call(i,o,n).message)!==null&&s!==void 0?s:n.defaultError;return o.code==="unrecognized_keys"?{message:(l=vt.errToObj(r).message)!==null&&l!==void 0?l:u}:{message:u}}}:{}})}strip(){return new $r({...this._def,unknownKeys:"strip"})}passthrough(){return new $r({...this._def,unknownKeys:"passthrough"})}extend(r){return new $r({...this._def,shape:()=>({...this._def.shape(),...r})})}merge(r){return new $r({unknownKeys:r._def.unknownKeys,catchall:r._def.catchall,shape:()=>({...this._def.shape(),...r._def.shape()}),typeName:_t.ZodObject})}setKey(r,o){return this.augment({[r]:o})}catchall(r){return new $r({...this._def,catchall:r})}pick(r){const o={};return qt.objectKeys(r).forEach(n=>{r[n]&&this.shape[n]&&(o[n]=this.shape[n])}),new $r({...this._def,shape:()=>o})}omit(r){const o={};return qt.objectKeys(this.shape).forEach(n=>{r[n]||(o[n]=this.shape[n])}),new $r({...this._def,shape:()=>o})}deepPartial(){return wu(this)}partial(r){const o={};return qt.objectKeys(this.shape).forEach(n=>{const i=this.shape[n];r&&!r[n]?o[n]=i:o[n]=i.optional()}),new $r({...this._def,shape:()=>o})}required(r){const o={};return qt.objectKeys(this.shape).forEach(n=>{if(r&&!r[n])o[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof wa;)a=a._def.innerType;o[n]=a}}),new $r({...this._def,shape:()=>o})}keyof(){return f5(qt.objectKeys(this.shape))}}$r.create=(t,r)=>new $r({shape:()=>t,unknownKeys:"strip",catchall:Us.create(),typeName:_t.ZodObject,...Pt(r)});$r.strictCreate=(t,r)=>new $r({shape:()=>t,unknownKeys:"strict",catchall:Us.create(),typeName:_t.ZodObject,...Pt(r)});$r.lazycreate=(t,r)=>new $r({shape:t,unknownKeys:"strip",catchall:Us.create(),typeName:_t.ZodObject,...Pt(r)});class Vy extends Ft{_parse(r){const{ctx:o}=this._processInputParams(r),n=this._def.options;function i(a){for(const l of a)if(l.result.status==="valid")return l.result;for(const l of a)if(l.result.status==="dirty")return o.common.issues.push(...l.ctx.common.issues),l.result;const s=a.map(l=>new Yo(l.ctx.common.issues));return at(o,{code:et.invalid_union,unionErrors:s}),Ot}if(o.common.async)return Promise.all(n.map(async a=>{const s={...o,common:{...o.common,issues:[]},parent:null};return{result:await a._parseAsync({data:o.data,path:o.path,parent:s}),ctx:s}})).then(i);{let a;const s=[];for(const u of n){const c={...o,common:{...o.common,issues:[]},parent:null},h=u._parseSync({data:o.data,path:o.path,parent:c});if(h.status==="valid")return h;h.status==="dirty"&&!a&&(a={result:h,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(a)return o.common.issues.push(...a.ctx.common.issues),a.result;const l=s.map(u=>new Yo(u));return at(o,{code:et.invalid_union,unionErrors:l}),Ot}}get options(){return this._def.options}}Vy.create=(t,r)=>new Vy({options:t,typeName:_t.ZodUnion,...Pt(r)});const la=t=>t instanceof Hy?la(t.schema):t instanceof Ma?la(t.innerType()):t instanceof qy?[t.value]:t instanceof Vl?t.options:t instanceof Xy?qt.objectValues(t.enum):t instanceof Yy?la(t._def.innerType):t instanceof By?[void 0]:t instanceof zy?[null]:t instanceof wa?[void 0,...la(t.unwrap())]:t instanceof Gl?[null,...la(t.unwrap())]:t instanceof h5||t instanceof Zy?la(t.unwrap()):t instanceof Ky?la(t._def.innerType):[];class TS extends Ft{_parse(r){const{ctx:o}=this._processInputParams(r);if(o.parsedType!==lt.object)return at(o,{code:et.invalid_type,expected:lt.object,received:o.parsedType}),Ot;const n=this.discriminator,i=o.data[n],a=this.optionsMap.get(i);return a?o.common.async?a._parseAsync({data:o.data,path:o.path,parent:o}):a._parseSync({data:o.data,path:o.path,parent:o}):(at(o,{code:et.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Ot)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(r,o,n){const i=new Map;for(const a of o){const s=la(a.shape[r]);if(!s.length)throw new Error(`A discriminator value for key \`${r}\` could not be extracted from all schema options`);for(const l of s){if(i.has(l))throw new Error(`Discriminator property ${String(r)} has duplicate value ${String(l)}`);i.set(l,a)}}return new TS({typeName:_t.ZodDiscriminatedUnion,discriminator:r,options:o,optionsMap:i,...Pt(n)})}}function mw(t,r){const o=cl(t),n=cl(r);if(t===r)return{valid:!0,data:t};if(o===lt.object&&n===lt.object){const i=qt.objectKeys(r),a=qt.objectKeys(t).filter(l=>i.indexOf(l)!==-1),s={...t,...r};for(const l of a){const u=mw(t[l],r[l]);if(!u.valid)return{valid:!1};s[l]=u.data}return{valid:!0,data:s}}else if(o===lt.array&&n===lt.array){if(t.length!==r.length)return{valid:!1};const i=[];for(let a=0;a{if(ik(a)||ik(s))return Ot;const l=mw(a.value,s.value);return l.valid?((ak(a)||ak(s))&&o.dirty(),{status:o.value,value:l.data}):(at(n,{code:et.invalid_intersection_types}),Ot)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,s])=>i(a,s)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Gy.create=(t,r,o)=>new Gy({left:t,right:r,typeName:_t.ZodIntersection,...Pt(o)});class Aa extends Ft{_parse(r){const{status:o,ctx:n}=this._processInputParams(r);if(n.parsedType!==lt.array)return at(n,{code:et.invalid_type,expected:lt.array,received:n.parsedType}),Ot;if(n.data.lengththis._def.items.length&&(at(n,{code:et.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),o.dirty());const a=[...n.data].map((s,l)=>{const u=this._def.items[l]||this._def.rest;return u?u._parse(new Xi(n,s,n.path,l)):null}).filter(s=>!!s);return n.common.async?Promise.all(a).then(s=>to.mergeArray(o,s)):to.mergeArray(o,a)}get items(){return this._def.items}rest(r){return new Aa({...this._def,rest:r})}}Aa.create=(t,r)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Aa({items:t,typeName:_t.ZodTuple,rest:null,...Pt(r)})};class Wy extends Ft{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){const{status:o,ctx:n}=this._processInputParams(r);if(n.parsedType!==lt.object)return at(n,{code:et.invalid_type,expected:lt.object,received:n.parsedType}),Ot;const i=[],a=this._def.keyType,s=this._def.valueType;for(const l in n.data)i.push({key:a._parse(new Xi(n,l,n.path,l)),value:s._parse(new Xi(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?to.mergeObjectAsync(o,i):to.mergeObjectSync(o,i)}get element(){return this._def.valueType}static create(r,o,n){return o instanceof Ft?new Wy({keyType:r,valueType:o,typeName:_t.ZodRecord,...Pt(n)}):new Wy({keyType:ya.create(),valueType:r,typeName:_t.ZodRecord,...Pt(o)})}}class yw extends Ft{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){const{status:o,ctx:n}=this._processInputParams(r);if(n.parsedType!==lt.map)return at(n,{code:et.invalid_type,expected:lt.map,received:n.parsedType}),Ot;const i=this._def.keyType,a=this._def.valueType,s=[...n.data.entries()].map(([l,u],c)=>({key:i._parse(new Xi(n,l,n.path,[c,"key"])),value:a._parse(new Xi(n,u,n.path,[c,"value"]))}));if(n.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const u of s){const c=await u.key,h=await u.value;if(c.status==="aborted"||h.status==="aborted")return Ot;(c.status==="dirty"||h.status==="dirty")&&o.dirty(),l.set(c.value,h.value)}return{status:o.value,value:l}})}else{const l=new Map;for(const u of s){const c=u.key,h=u.value;if(c.status==="aborted"||h.status==="aborted")return Ot;(c.status==="dirty"||h.status==="dirty")&&o.dirty(),l.set(c.value,h.value)}return{status:o.value,value:l}}}}yw.create=(t,r,o)=>new yw({valueType:r,keyType:t,typeName:_t.ZodMap,...Pt(o)});class Pc extends Ft{_parse(r){const{status:o,ctx:n}=this._processInputParams(r);if(n.parsedType!==lt.set)return at(n,{code:et.invalid_type,expected:lt.set,received:n.parsedType}),Ot;const i=this._def;i.minSize!==null&&n.data.sizei.maxSize.value&&(at(n,{code:et.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),o.dirty());const a=this._def.valueType;function s(u){const c=new Set;for(const h of u){if(h.status==="aborted")return Ot;h.status==="dirty"&&o.dirty(),c.add(h.value)}return{status:o.value,value:c}}const l=[...n.data.values()].map((u,c)=>a._parse(new Xi(n,u,n.path,c)));return n.common.async?Promise.all(l).then(u=>s(u)):s(l)}min(r,o){return new Pc({...this._def,minSize:{value:r,message:vt.toString(o)}})}max(r,o){return new Pc({...this._def,maxSize:{value:r,message:vt.toString(o)}})}size(r,o){return this.min(r,o).max(r,o)}nonempty(r){return this.min(1,r)}}Pc.create=(t,r)=>new Pc({valueType:t,minSize:null,maxSize:null,typeName:_t.ZodSet,...Pt(r)});class If extends Ft{constructor(){super(...arguments),this.validate=this.implement}_parse(r){const{ctx:o}=this._processInputParams(r);if(o.parsedType!==lt.function)return at(o,{code:et.invalid_type,expected:lt.function,received:o.parsedType}),Ot;function n(l,u){return cw({data:l,path:o.path,errorMaps:[o.common.contextualErrorMap,o.schemaErrorMap,uw(),gh].filter(c=>!!c),issueData:{code:et.invalid_arguments,argumentsError:u}})}function i(l,u){return cw({data:l,path:o.path,errorMaps:[o.common.contextualErrorMap,o.schemaErrorMap,uw(),gh].filter(c=>!!c),issueData:{code:et.invalid_return_type,returnTypeError:u}})}const a={errorMap:o.common.contextualErrorMap},s=o.data;if(this._def.returns instanceof bh){const l=this;return go(async function(...u){const c=new Yo([]),h=await l._def.args.parseAsync(u,a).catch(m=>{throw c.addIssue(n(u,m)),c}),f=await Reflect.apply(s,this,h);return await l._def.returns._def.type.parseAsync(f,a).catch(m=>{throw c.addIssue(i(f,m)),c})})}else{const l=this;return go(function(...u){const c=l._def.args.safeParse(u,a);if(!c.success)throw new Yo([n(u,c.error)]);const h=Reflect.apply(s,this,c.data),f=l._def.returns.safeParse(h,a);if(!f.success)throw new Yo([i(h,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...r){return new If({...this._def,args:Aa.create(r).rest(Qu.create())})}returns(r){return new If({...this._def,returns:r})}implement(r){return this.parse(r)}strictImplement(r){return this.parse(r)}static create(r,o,n){return new If({args:r||Aa.create([]).rest(Qu.create()),returns:o||Qu.create(),typeName:_t.ZodFunction,...Pt(n)})}}class Hy extends Ft{get schema(){return this._def.getter()}_parse(r){const{ctx:o}=this._processInputParams(r);return this._def.getter()._parse({data:o.data,path:o.path,parent:o})}}Hy.create=(t,r)=>new Hy({getter:t,typeName:_t.ZodLazy,...Pt(r)});class qy extends Ft{_parse(r){if(r.data!==this._def.value){const o=this._getOrReturnCtx(r);return at(o,{received:o.data,code:et.invalid_literal,expected:this._def.value}),Ot}return{status:"valid",value:r.data}}get value(){return this._def.value}}qy.create=(t,r)=>new qy({value:t,typeName:_t.ZodLiteral,...Pt(r)});function f5(t,r){return new Vl({values:t,typeName:_t.ZodEnum,...Pt(r)})}class Vl extends Ft{constructor(){super(...arguments),mf.set(this,void 0)}_parse(r){if(typeof r.data!="string"){const o=this._getOrReturnCtx(r),n=this._def.values;return at(o,{expected:qt.joinValues(n),received:o.parsedType,code:et.invalid_type}),Ot}if(Uy(this,mf)||u5(this,mf,new Set(this._def.values)),!Uy(this,mf).has(r.data)){const o=this._getOrReturnCtx(r),n=this._def.values;return at(o,{received:o.data,code:et.invalid_enum_value,options:n}),Ot}return go(r.data)}get options(){return this._def.values}get enum(){const r={};for(const o of this._def.values)r[o]=o;return r}get Values(){const r={};for(const o of this._def.values)r[o]=o;return r}get Enum(){const r={};for(const o of this._def.values)r[o]=o;return r}extract(r,o=this._def){return Vl.create(r,{...this._def,...o})}exclude(r,o=this._def){return Vl.create(this.options.filter(n=>!r.includes(n)),{...this._def,...o})}}mf=new WeakMap;Vl.create=f5;class Xy extends Ft{constructor(){super(...arguments),yf.set(this,void 0)}_parse(r){const o=qt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(r);if(n.parsedType!==lt.string&&n.parsedType!==lt.number){const i=qt.objectValues(o);return at(n,{expected:qt.joinValues(i),received:n.parsedType,code:et.invalid_type}),Ot}if(Uy(this,yf)||u5(this,yf,new Set(qt.getValidEnumValues(this._def.values))),!Uy(this,yf).has(r.data)){const i=qt.objectValues(o);return at(n,{received:n.data,code:et.invalid_enum_value,options:i}),Ot}return go(r.data)}get enum(){return this._def.values}}yf=new WeakMap;Xy.create=(t,r)=>new Xy({values:t,typeName:_t.ZodNativeEnum,...Pt(r)});class bh extends Ft{unwrap(){return this._def.type}_parse(r){const{ctx:o}=this._processInputParams(r);if(o.parsedType!==lt.promise&&o.common.async===!1)return at(o,{code:et.invalid_type,expected:lt.promise,received:o.parsedType}),Ot;const n=o.parsedType===lt.promise?o.data:Promise.resolve(o.data);return go(n.then(i=>this._def.type.parseAsync(i,{path:o.path,errorMap:o.common.contextualErrorMap})))}}bh.create=(t,r)=>new bh({type:t,typeName:_t.ZodPromise,...Pt(r)});class Ma extends Ft{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_t.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(r){const{status:o,ctx:n}=this._processInputParams(r),i=this._def.effect||null,a={addIssue:s=>{at(n,s),s.fatal?o.abort():o.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){const s=i.transform(n.data,a);if(n.common.async)return Promise.resolve(s).then(async l=>{if(o.value==="aborted")return Ot;const u=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return u.status==="aborted"?Ot:u.status==="dirty"||o.value==="dirty"?pf(u.value):u});{if(o.value==="aborted")return Ot;const l=this._def.schema._parseSync({data:s,path:n.path,parent:n});return l.status==="aborted"?Ot:l.status==="dirty"||o.value==="dirty"?pf(l.value):l}}if(i.type==="refinement"){const s=l=>{const u=i.refinement(l,a);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(n.common.async===!1){const l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?Ot:(l.status==="dirty"&&o.dirty(),s(l.value),{status:o.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?Ot:(l.status==="dirty"&&o.dirty(),s(l.value).then(()=>({status:o.value,value:l.value}))))}if(i.type==="transform")if(n.common.async===!1){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Fy(s))return s;const l=i.transform(s.value,a);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:o.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>Fy(s)?Promise.resolve(i.transform(s.value,a)).then(l=>({status:o.value,value:l})):s);qt.assertNever(i)}}Ma.create=(t,r,o)=>new Ma({schema:t,typeName:_t.ZodEffects,effect:r,...Pt(o)});Ma.createWithPreprocess=(t,r,o)=>new Ma({schema:r,effect:{type:"preprocess",transform:t},typeName:_t.ZodEffects,...Pt(o)});class wa extends Ft{_parse(r){return this._getType(r)===lt.undefined?go(void 0):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}}wa.create=(t,r)=>new wa({innerType:t,typeName:_t.ZodOptional,...Pt(r)});class Gl extends Ft{_parse(r){return this._getType(r)===lt.null?go(null):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}}Gl.create=(t,r)=>new Gl({innerType:t,typeName:_t.ZodNullable,...Pt(r)});class Yy extends Ft{_parse(r){const{ctx:o}=this._processInputParams(r);let n=o.data;return o.parsedType===lt.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:o.path,parent:o})}removeDefault(){return this._def.innerType}}Yy.create=(t,r)=>new Yy({innerType:t,typeName:_t.ZodDefault,defaultValue:typeof r.default=="function"?r.default:()=>r.default,...Pt(r)});class Ky extends Ft{_parse(r){const{ctx:o}=this._processInputParams(r),n={...o,common:{...o.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return $y(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Yo(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Yo(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Ky.create=(t,r)=>new Ky({innerType:t,typeName:_t.ZodCatch,catchValue:typeof r.catch=="function"?r.catch:()=>r.catch,...Pt(r)});class gw extends Ft{_parse(r){if(this._getType(r)!==lt.nan){const n=this._getOrReturnCtx(r);return at(n,{code:et.invalid_type,expected:lt.nan,received:n.parsedType}),Ot}return{status:"valid",value:r.data}}}gw.create=t=>new gw({typeName:_t.ZodNaN,...Pt(t)});class h5 extends Ft{_parse(r){const{ctx:o}=this._processInputParams(r),n=o.data;return this._def.type._parse({data:n,path:o.path,parent:o})}unwrap(){return this._def.type}}class Uv extends Ft{_parse(r){const{status:o,ctx:n}=this._processInputParams(r);if(n.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Ot:a.status==="dirty"?(o.dirty(),pf(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{const i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Ot:i.status==="dirty"?(o.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(r,o){return new Uv({in:r,out:o,typeName:_t.ZodPipeline})}}class Zy extends Ft{_parse(r){const o=this._def.innerType._parse(r),n=i=>(Fy(i)&&(i.value=Object.freeze(i.value)),i);return $y(o)?o.then(i=>n(i)):n(o)}unwrap(){return this._def.innerType}}Zy.create=(t,r)=>new Zy({innerType:t,typeName:_t.ZodReadonly,...Pt(r)});$r.lazycreate;var _t;(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"})(_t||(_t={}));const Lo=ya.create,wY=Oc.create;gw.create;kc.create;const _Y=dw.create;vh.create;fw.create;By.create;zy.create;hw.create;Qu.create;Us.create;pw.create;const jY=Gi.create,SY=$r.create;$r.strictCreate;Vy.create;TS.create;Gy.create;Aa.create;Wy.create;yw.create;Pc.create;If.create;Hy.create;qy.create;const EY=Vl.create;Xy.create;bh.create;Ma.create;wa.create;Gl.create;Ma.createWithPreprocess;Uv.create;var OS="Checkbox",[TY,$_e]=nd(OS),[OY,kY]=TY(OS),p5=q.forwardRef((t,r)=>{const{__scopeCheckbox:o,name:n,checked:i,defaultChecked:a,required:s,disabled:l,value:u="on",onCheckedChange:c,form:h,...f}=t,[d,m]=q.useState(null),y=Or(r,w=>m(w)),p=q.useRef(!1),g=d?h||!!d.closest("form"):!0,[b=!1,x]=Fl({prop:i,defaultProp:a,onChange:c}),v=q.useRef(b);return q.useEffect(()=>{const w=d==null?void 0:d.form;if(w){const _=()=>x(v.current);return w.addEventListener("reset",_),()=>w.removeEventListener("reset",_)}},[d,x]),D.jsxs(OY,{scope:o,state:b,disabled:l,children:[D.jsx(Gt.button,{type:"button",role:"checkbox","aria-checked":As(b)?"mixed":b,"aria-required":s,"data-state":g5(b),"data-disabled":l?"":void 0,disabled:l,value:u,...f,ref:y,onKeyDown:It(t.onKeyDown,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:It(t.onClick,w=>{x(_=>As(_)?!0:!_),g&&(p.current=w.isPropagationStopped(),p.current||w.stopPropagation())})}),g&&D.jsx(PY,{control:d,bubbles:!p.current,name:n,value:u,checked:b,required:s,disabled:l,form:h,style:{transform:"translateX(-100%)"},defaultChecked:As(a)?!1:a})]})});p5.displayName=OS;var m5="CheckboxIndicator",y5=q.forwardRef((t,r)=>{const{__scopeCheckbox:o,forceMount:n,...i}=t,a=kY(m5,o);return D.jsx(cp,{present:n||As(a.state)||a.state===!0,children:D.jsx(Gt.span,{"data-state":g5(a.state),"data-disabled":a.disabled?"":void 0,...i,ref:r,style:{pointerEvents:"none",...t.style}})})});y5.displayName=m5;var PY=t=>{const{control:r,checked:o,bubbles:n=!0,defaultChecked:i,...a}=t,s=q.useRef(null),l=JL(o),u=kN(r);q.useEffect(()=>{const h=s.current,f=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(f,"checked").set;if(l!==o&&m){const y=new Event("click",{bubbles:n});h.indeterminate=As(o),m.call(h,As(o)?!1:o),h.dispatchEvent(y)}},[l,o,n]);const c=q.useRef(As(o)?!1:o);return D.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i??c.current,...a,tabIndex:-1,ref:s,style:{...t.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function As(t){return t==="indeterminate"}function g5(t){return As(t)?"indeterminate":t?"checked":"unchecked"}var v5=p5,CY=y5;const b5=q.forwardRef(({className:t,...r},o)=>D.jsx(v5,{ref:o,className:St("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...r,children:D.jsx(CY,{className:St("flex items-center justify-center text-current"),children:D.jsx(aN,{className:"h-4 w-4"})})}));b5.displayName=v5.displayName;var AY="Label",x5=q.forwardRef((t,r)=>D.jsx(Gt.label,{...t,ref:r,onMouseDown:o=>{var i;o.target.closest("button, input, select, textarea")||((i=t.onMouseDown)==null||i.call(t,o),!o.defaultPrevented&&o.detail>1&&o.preventDefault())}}));x5.displayName=AY;var w5=x5;const MY=yv("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),_5=q.forwardRef(({className:t,...r},o)=>D.jsx(w5,{ref:o,className:St(MY(),t),...r}));_5.displayName=w5.displayName;const RY=DX,j5=q.createContext({}),Bn=({...t})=>D.jsx(j5.Provider,{value:{name:t.name},children:D.jsx(BX,{...t})}),Bv=()=>{const t=q.useContext(j5),r=q.useContext(S5),{getFieldState:o,formState:n}=$v(),i=o(t.name,n);if(!t)throw new Error("useFormField should be used within ");const{id:a}=r;return{id:a,name:t.name,formItemId:`${a}-form-item`,formDescriptionId:`${a}-form-item-description`,formMessageId:`${a}-form-item-message`,...i}},S5=q.createContext({}),In=q.forwardRef(({className:t,...r},o)=>{const n=q.useId();return D.jsx(S5.Provider,{value:{id:n},children:D.jsx("div",{ref:o,className:St("space-y-2",t),...r})})});In.displayName="FormItem";const Vn=q.forwardRef(({className:t,...r},o)=>{const{error:n,formItemId:i}=Bv();return D.jsx(_5,{ref:o,className:St(n&&"text-destructive",t),htmlFor:i,...r})});Vn.displayName="FormLabel";const Gn=q.forwardRef(({...t},r)=>{const{error:o,formItemId:n,formDescriptionId:i,formMessageId:a}=Bv();return D.jsx(Dl,{ref:r,id:n,"aria-describedby":o?`${i} ${a}`:`${i}`,"aria-invalid":!!o,...t})});Gn.displayName="FormControl";const E5=q.forwardRef(({className:t,...r},o)=>{const{formDescriptionId:n}=Bv();return D.jsx("p",{ref:o,id:n,className:St("text-sm text-muted-foreground",t),...r})});E5.displayName="FormDescription";const Wn=q.forwardRef(({className:t,children:r,...o},n)=>{const{error:i,formMessageId:a}=Bv(),s=i?String(i==null?void 0:i.message):r;return s?D.jsx("p",{ref:n,id:a,className:St("text-sm font-medium text-destructive",t),...o,children:s}):null});Wn.displayName="FormMessage";const lk=[{id:"pro-shop",label:"Pro Shop"},{id:"showers",label:"Showers"},{id:"lockers",label:"Lockers"},{id:"cafe",label:"Café/Restaurant"},{id:"parking",label:"Free Parking"},{id:"led-lighting",label:"LED Lighting"},{id:"coaching",label:"Coaching Available"},{id:"equipment-rental",label:"Equipment Rental"},{id:"changing-rooms",label:"Changing Rooms"},{id:"wifi",label:"Free WiFi"}],IY=SY({name:Lo().min(2,{message:"Court name must be at least 2 characters."}),location:Lo().min(5,{message:"Please enter a valid location."}),country:Lo({required_error:"Please select a country."}),courtType:EY(["indoor","outdoor"],{required_error:"Please select whether the court is indoor or outdoor."}),numberOfCourts:wY().min(1,{message:"Must have at least 1 court."}).max(50,{message:"Maximum 50 courts allowed."}),description:Lo().min(10,{message:"Description must be at least 10 characters."}),hourlyRate:Lo().regex(/^\d+(\.\d{1,2})?$/,{message:"Please enter a valid price."}),openingTimeWeekday:Lo(),closingTimeWeekday:Lo(),openingTimeWeekend:Lo(),closingTimeWeekend:Lo(),selectedFeatures:jY(Lo()),website:Lo().url({message:"Please enter a valid URL."}).optional(),bookingUrl:Lo().url({message:"Please enter a valid booking URL."}).optional(),isPremium:_Y().default(!1)}),NY=()=>{const{toast:t}=Fa(),r=$a(),[o,n]=q.useState([]),[i,a]=q.useState(!1),s=JX({resolver:nY(IY),defaultValues:{name:"",location:"",country:"",courtType:"indoor",numberOfCourts:1,description:"",hourlyRate:"",openingTimeWeekday:"07:30",closingTimeWeekday:"23:00",openingTimeWeekend:"08:00",closingTimeWeekend:"22:00",selectedFeatures:[],website:"",bookingUrl:"",isPremium:!1}}),l=async c=>{try{a(!0);const{data:{session:h}}=await rr.auth.getSession();if(!h){t({title:"Authentication required",description:"Please sign in to submit a court.",variant:"destructive"}),r("/auth?redirectTo=/submit-court");return}let f=[];if(o.length>0)for(const p of o){const g=p.name.split(".").pop(),b=`${Math.random()}.${g}`,{error:x,data:v}=await rr.storage.from("courts").upload(`court-images/${b}`,p);if(x)throw x;if(v){const{data:{publicUrl:w}}=rr.storage.from("courts").getPublicUrl(`court-images/${b}`);f.push(w)}}const d=c.selectedFeatures.map(p=>{var g;return(g=lk.find(b=>b.id===p))==null?void 0:g.label}).filter(Boolean).join(", "),m={ES:"spain",SE:"sweden",DE:"germany",IT:"italy"},{error:y}=await rr.from("courts").insert({name:c.name,location:c.location,country:c.country,country_name:m[c.country]||c.country.toLowerCase(),court_type:c.courtType,number_of_courts:c.numberOfCourts,description:c.description,hourly_rate:parseFloat(c.hourlyRate),opening_time_weekday:c.openingTimeWeekday,closing_time_weekday:c.closingTimeWeekday,opening_time_weekend:c.openingTimeWeekend,closing_time_weekend:c.closingTimeWeekend,features:d,website:c.website||null,booking_url:c.bookingUrl||null,is_premium:c.isPremium,images:f,user_id:h.user.id});if(y)throw y;t({title:"Court Submitted",description:"Your court has been submitted successfully."}),r("/")}catch(h){console.error("Error submitting court:",h),t({title:"Error",description:h.message||"Failed to submit court. Please try again.",variant:"destructive"})}finally{a(!1)}},u=c=>{c.target.files&&n(Array.from(c.target.files))};return D.jsxs("div",{className:"min-h-screen",children:[D.jsxs("div",{className:"p-6",children:[D.jsx(Zi,{}),D.jsxs("div",{className:"max-w-4xl mx-auto space-y-8",children:[D.jsxs("div",{className:"text-center space-y-4",children:[D.jsx("h1",{className:"text-4xl font-bold tracking-tight",children:"Submit Your Court"}),D.jsx("p",{className:"text-muted-foreground",children:"List your padel court and reach thousands of players in your area"})]}),D.jsx(RY,{...s,children:D.jsxs("form",{onSubmit:s.handleSubmit(l),className:"space-y-8",children:[D.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[D.jsxs("div",{className:"space-y-8",children:[D.jsx(Bn,{control:s.control,name:"name",render:({field:c})=>D.jsxs(In,{children:[D.jsx(Vn,{children:"Court Name"}),D.jsx(Gn,{children:D.jsx(so,{placeholder:"Enter court name",...c})}),D.jsx(Wn,{})]})}),D.jsx(Bn,{control:s.control,name:"location",render:({field:c})=>D.jsxs(In,{children:[D.jsx(Vn,{children:"Location"}),D.jsx(Gn,{children:D.jsx(so,{placeholder:"Enter full address",...c})}),D.jsx(Wn,{})]})}),D.jsx(Bn,{control:s.control,name:"country",render:({field:c})=>D.jsxs(In,{children:[D.jsx(Vn,{children:"Country"}),D.jsxs(My,{onValueChange:c.onChange,defaultValue:c.value,children:[D.jsx(Gn,{children:D.jsx(mh,{children:D.jsx(Ry,{placeholder:"Select a country"})})}),D.jsxs(yh,{children:[D.jsx(yi,{value:"ES",children:"Spain"}),D.jsx(yi,{value:"SE",children:"Sweden"}),D.jsx(yi,{value:"DE",children:"Germany"}),D.jsx(yi,{value:"IT",children:"Italy"})]})]}),D.jsx(Wn,{})]})}),D.jsx(Bn,{control:s.control,name:"courtType",render:({field:c})=>D.jsxs(In,{children:[D.jsx(Vn,{children:"Court Type"}),D.jsxs(My,{onValueChange:c.onChange,defaultValue:c.value,children:[D.jsx(Gn,{children:D.jsx(mh,{children:D.jsx(Ry,{placeholder:"Select court type"})})}),D.jsxs(yh,{children:[D.jsx(yi,{value:"indoor",children:"Indoor"}),D.jsx(yi,{value:"outdoor",children:"Outdoor"})]})]}),D.jsx(Wn,{})]})}),D.jsx(Bn,{control:s.control,name:"numberOfCourts",render:({field:c})=>D.jsxs(In,{children:[D.jsx(Vn,{children:"Number of Courts"}),D.jsx(Gn,{children:D.jsx(so,{type:"number",min:1,max:50,...c,onChange:h=>c.onChange(+h.target.value)})}),D.jsx(E5,{children:"How many padel courts are available at this location?"}),D.jsx(Wn,{})]})}),D.jsx(Bn,{control:s.control,name:"description",render:({field:c})=>D.jsxs(In,{children:[D.jsx(Vn,{children:"Description"}),D.jsx(Gn,{children:D.jsx(bS,{placeholder:"Tell us about your court...",className:"resize-none",...c})}),D.jsx(Wn,{})]})})]}),D.jsxs("div",{className:"space-y-8",children:[D.jsxs("div",{className:"space-y-4",children:[D.jsx("h3",{className:"text-lg font-semibold",children:"Opening Hours"}),D.jsxs("div",{className:"space-y-4",children:[D.jsxs("div",{children:[D.jsx(Vn,{className:"text-sm text-muted-foreground",children:"Monday - Friday"}),D.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[D.jsx(Bn,{control:s.control,name:"openingTimeWeekday",render:({field:c})=>D.jsxs(In,{children:[D.jsx(Gn,{children:D.jsx(so,{type:"time",...c})}),D.jsx(Wn,{})]})}),D.jsx(Bn,{control:s.control,name:"closingTimeWeekday",render:({field:c})=>D.jsxs(In,{children:[D.jsx(Gn,{children:D.jsx(so,{type:"time",...c})}),D.jsx(Wn,{})]})})]})]}),D.jsxs("div",{children:[D.jsx(Vn,{className:"text-sm text-muted-foreground",children:"Weekends"}),D.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[D.jsx(Bn,{control:s.control,name:"openingTimeWeekend",render:({field:c})=>D.jsxs(In,{children:[D.jsx(Gn,{children:D.jsx(so,{type:"time",...c})}),D.jsx(Wn,{})]})}),D.jsx(Bn,{control:s.control,name:"closingTimeWeekend",render:({field:c})=>D.jsxs(In,{children:[D.jsx(Gn,{children:D.jsx(so,{type:"time",...c})}),D.jsx(Wn,{})]})})]})]})]})]}),D.jsx(Bn,{control:s.control,name:"selectedFeatures",render:()=>D.jsxs(In,{children:[D.jsx(Vn,{children:"Features"}),D.jsx("div",{className:"grid grid-cols-2 gap-4",children:lk.map(c=>D.jsx(Bn,{control:s.control,name:"selectedFeatures",render:({field:h})=>{var f;return D.jsxs(In,{className:"flex flex-row items-start space-x-3 space-y-0",children:[D.jsx(Gn,{children:D.jsx(b5,{checked:(f=h.value)==null?void 0:f.includes(c.id),onCheckedChange:d=>{var m;return d?h.onChange([...h.value,c.id]):h.onChange((m=h.value)==null?void 0:m.filter(y=>y!==c.id))}})}),D.jsx(Vn,{className:"font-normal",children:c.label})]},c.id)}},c.id))}),D.jsx(Wn,{})]})})]})]}),D.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[D.jsx(Bn,{control:s.control,name:"website",render:({field:c})=>D.jsxs(In,{children:[D.jsx(Vn,{children:"Website URL"}),D.jsx(Gn,{children:D.jsxs("div",{className:"relative",children:[D.jsx(Wj,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),D.jsx(so,{className:"pl-8",placeholder:"https://...",...c})]})}),D.jsx(Wn,{})]})}),D.jsx(Bn,{control:s.control,name:"bookingUrl",render:({field:c})=>D.jsxs(In,{children:[D.jsx(Vn,{children:"Booking URL"}),D.jsx(Gn,{children:D.jsxs("div",{className:"relative",children:[D.jsx(gx,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),D.jsx(so,{className:"pl-8",placeholder:"https://...",...c})]})}),D.jsx(Wn,{})]})}),D.jsx(Bn,{control:s.control,name:"hourlyRate",render:({field:c})=>D.jsxs(In,{children:[D.jsx(Vn,{children:"Hourly Rate (€)"}),D.jsx(Gn,{children:D.jsx(so,{type:"number",step:"0.01",min:"0",...c})}),D.jsx(Wn,{})]})})]}),D.jsxs("div",{className:"space-y-4",children:[D.jsx(Vn,{children:"Court Images"}),D.jsx("div",{className:"flex items-center justify-center w-full",children:D.jsxs("label",{htmlFor:"images",className:"flex flex-col items-center justify-center w-full h-64 border-2 border-dashed rounded-lg cursor-pointer bg-card hover:bg-accent/50",children:[D.jsxs("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[D.jsx(IB,{className:"w-8 h-8 mb-4 text-muted-foreground"}),D.jsxs("p",{className:"mb-2 text-sm text-muted-foreground",children:[D.jsx("span",{className:"font-semibold",children:"Click to upload"})," or drag and drop"]}),D.jsx("p",{className:"text-xs text-muted-foreground",children:"PNG, JPG or WEBP (MAX. 5MB each)"})]}),D.jsx("input",{id:"images",type:"file",className:"hidden",multiple:!0,accept:"image/*",onChange:u})]})}),o.length>0&&D.jsxs("p",{className:"text-sm text-muted-foreground",children:[o.length," image",o.length>1?"s":""," selected"]})]}),D.jsx(tr,{type:"submit",className:"w-full bg-brand-500 hover:bg-brand-600",disabled:i,children:i?"Submitting...":"Submit Court"})]})})]})]}),D.jsx(Qi,{})]})};var LY=Array.isArray,vo=LY,DY=typeof Zr=="object"&&Zr&&Zr.Object===Object&&Zr,T5=DY,FY=T5,$Y=typeof self=="object"&&self&&self.Object===Object&&self,UY=FY||$Y||Function("return this")(),Ji=UY,BY=Ji,zY=BY.Symbol,jp=zY,uk=jp,O5=Object.prototype,VY=O5.hasOwnProperty,GY=O5.toString,qd=uk?uk.toStringTag:void 0;function WY(t){var r=VY.call(t,qd),o=t[qd];try{t[qd]=void 0;var n=!0}catch{}var i=GY.call(t);return n&&(r?t[qd]=o:delete t[qd]),i}var HY=WY,qY=Object.prototype,XY=qY.toString;function YY(t){return XY.call(t)}var KY=YY,ck=jp,ZY=HY,QY=KY,JY="[object Null]",eK="[object Undefined]",dk=ck?ck.toStringTag:void 0;function tK(t){return t==null?t===void 0?eK:JY:dk&&dk in Object(t)?ZY(t):QY(t)}var Ua=tK;function rK(t){return t!=null&&typeof t=="object"}var Ba=rK,nK=Ua,oK=Ba,iK="[object Symbol]";function aK(t){return typeof t=="symbol"||oK(t)&&nK(t)==iK}var dd=aK,sK=vo,lK=dd,uK=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,cK=/^\w*$/;function dK(t,r){if(sK(t))return!1;var o=typeof t;return o=="number"||o=="symbol"||o=="boolean"||t==null||lK(t)?!0:cK.test(t)||!uK.test(t)||r!=null&&t in Object(r)}var kS=dK;function fK(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}var Xs=fK;const fd=Kt(Xs);var hK=Ua,pK=Xs,mK="[object AsyncFunction]",yK="[object Function]",gK="[object GeneratorFunction]",vK="[object Proxy]";function bK(t){if(!pK(t))return!1;var r=hK(t);return r==yK||r==gK||r==mK||r==vK}var PS=bK;const kt=Kt(PS);var xK=Ji,wK=xK["__core-js_shared__"],_K=wK,Hb=_K,fk=function(){var t=/[^.]+$/.exec(Hb&&Hb.keys&&Hb.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function jK(t){return!!fk&&fk in t}var SK=jK,EK=Function.prototype,TK=EK.toString;function OK(t){if(t!=null){try{return TK.call(t)}catch{}try{return t+""}catch{}}return""}var k5=OK,kK=PS,PK=SK,CK=Xs,AK=k5,MK=/[\\^$.*+?()[\]{}|]/g,RK=/^\[object .+?Constructor\]$/,IK=Function.prototype,NK=Object.prototype,LK=IK.toString,DK=NK.hasOwnProperty,FK=RegExp("^"+LK.call(DK).replace(MK,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function $K(t){if(!CK(t)||PK(t))return!1;var r=kK(t)?FK:RK;return r.test(AK(t))}var UK=$K;function BK(t,r){return t==null?void 0:t[r]}var zK=BK,VK=UK,GK=zK;function WK(t,r){var o=GK(t,r);return VK(o)?o:void 0}var ru=WK,HK=ru,qK=HK(Object,"create"),zv=qK,hk=zv;function XK(){this.__data__=hk?hk(null):{},this.size=0}var YK=XK;function KK(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}var ZK=KK,QK=zv,JK="__lodash_hash_undefined__",eZ=Object.prototype,tZ=eZ.hasOwnProperty;function rZ(t){var r=this.__data__;if(QK){var o=r[t];return o===JK?void 0:o}return tZ.call(r,t)?r[t]:void 0}var nZ=rZ,oZ=zv,iZ=Object.prototype,aZ=iZ.hasOwnProperty;function sZ(t){var r=this.__data__;return oZ?r[t]!==void 0:aZ.call(r,t)}var lZ=sZ,uZ=zv,cZ="__lodash_hash_undefined__";function dZ(t,r){var o=this.__data__;return this.size+=this.has(t)?0:1,o[t]=uZ&&r===void 0?cZ:r,this}var fZ=dZ,hZ=YK,pZ=ZK,mZ=nZ,yZ=lZ,gZ=fZ;function hd(t){var r=-1,o=t==null?0:t.length;for(this.clear();++r-1}var IZ=RZ,NZ=Vv;function LZ(t,r){var o=this.__data__,n=NZ(o,t);return n<0?(++this.size,o.push([t,r])):o[n][1]=r,this}var DZ=LZ,FZ=xZ,$Z=kZ,UZ=AZ,BZ=IZ,zZ=DZ;function pd(t){var r=-1,o=t==null?0:t.length;for(this.clear();++r0?1:-1},yl=function(r){return Sp(r)&&r.indexOf("%")===r.length-1},tt=function(r){return uJ(r)&&!Ep(r)},an=function(r){return tt(r)||Sp(r)},hJ=0,Tp=function(r){var o=++hJ;return"".concat(r||"").concat(o)},Qn=function(r,o){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!tt(r)&&!Sp(r))return n;var a;if(yl(r)){var s=r.indexOf("%");a=o*parseFloat(r.slice(0,s))/100}else a=+r;return Ep(a)&&(a=n),i&&a>o&&(a=o),a},cs=function(r){if(!r)return null;var o=Object.keys(r);return o&&o.length?r[o[0]]:null},pJ=function(r){if(!Array.isArray(r))return!1;for(var o=r.length,n={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function xJ(t,r){if(t==null)return{};var o={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(r.indexOf(n)>=0)continue;o[n]=t[n]}return o}var xk={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},_a=function(r){return typeof r=="string"?r:r?r.displayName||r.name||"Component":""},wk=null,Xb=null,$S=function t(r){if(r===wk&&Array.isArray(Xb))return Xb;var o=[];return q.Children.forEach(r,function(n){Dt(n)||(D5.isFragment(n)?o=o.concat(t(n.props.children)):o.push(n))}),Xb=o,wk=r,o};function Ko(t,r){var o=[],n=[];return Array.isArray(r)?n=r.map(function(i){return _a(i)}):n=[_a(r)],$S(t).forEach(function(i){var a=Ao(i,"type.displayName")||Ao(i,"type.name");n.indexOf(a)!==-1&&o.push(i)}),o}function Eo(t,r){var o=Ko(t,r);return o&&o[0]}var _k=function(r){if(!r||!r.props)return!1;var o=r.props,n=o.width,i=o.height;return!(!tt(n)||n<=0||!tt(i)||i<=0)},wJ=["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"],_J=function(r){return r&&r.type&&Sp(r.type)&&wJ.indexOf(r.type)>=0},jJ=function(r,o,n,i){var a,s=(a=qb==null?void 0:qb[i])!==null&&a!==void 0?a:[];return!kt(r)&&(i&&s.includes(o)||yJ.includes(o))||n&&FS.includes(o)},jt=function(r,o,n){if(!r||typeof r=="function"||typeof r=="boolean")return null;var i=r;if(q.isValidElement(r)&&(i=r.props),!fd(i))return null;var a={};return Object.keys(i).forEach(function(s){var l;jJ((l=i)===null||l===void 0?void 0:l[s],s,o,n)&&(a[s]=i[s])}),a},xw=function t(r,o){if(r===o)return!0;var n=q.Children.count(r);if(n!==q.Children.count(o))return!1;if(n===0)return!0;if(n===1)return jk(Array.isArray(r)?r[0]:r,Array.isArray(o)?o[0]:o);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function kJ(t,r){if(t==null)return{};var o={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(r.indexOf(n)>=0)continue;o[n]=t[n]}return o}function _w(t){var r=t.children,o=t.width,n=t.height,i=t.viewBox,a=t.className,s=t.style,l=t.title,u=t.desc,c=OJ(t,TJ),h=i||{width:o,height:n,x:0,y:0},f=Nt("recharts-surface",a);return me.createElement("svg",ww({},jt(c,!0,"svg"),{className:f,width:o,height:n,style:s,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height)}),me.createElement("title",null,l),me.createElement("desc",null,u),r)}var PJ=["children","className"];function jw(){return jw=Object.assign?Object.assign.bind():function(t){for(var r=1;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function AJ(t,r){if(t==null)return{};var o={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(r.indexOf(n)>=0)continue;o[n]=t[n]}return o}var nr=me.forwardRef(function(t,r){var o=t.children,n=t.className,i=CJ(t,PJ),a=Nt("recharts-layer",n);return me.createElement("g",jw({className:a},jt(i,!0),{ref:r}),o)}),_i=function(r,o){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;ai?0:i+r),o=o>i?i:o,o<0&&(o+=i),i=r>o?0:o-r>>>0,r>>>=0;for(var a=Array(i);++n=n?t:IJ(t,r,o)}var LJ=NJ,DJ="\\ud800-\\udfff",FJ="\\u0300-\\u036f",$J="\\ufe20-\\ufe2f",UJ="\\u20d0-\\u20ff",BJ=FJ+$J+UJ,zJ="\\ufe0e\\ufe0f",VJ="\\u200d",GJ=RegExp("["+VJ+DJ+BJ+zJ+"]");function WJ(t){return GJ.test(t)}var $5=WJ;function HJ(t){return t.split("")}var qJ=HJ,U5="\\ud800-\\udfff",XJ="\\u0300-\\u036f",YJ="\\ufe20-\\ufe2f",KJ="\\u20d0-\\u20ff",ZJ=XJ+YJ+KJ,QJ="\\ufe0e\\ufe0f",JJ="["+U5+"]",Sw="["+ZJ+"]",Ew="\\ud83c[\\udffb-\\udfff]",eee="(?:"+Sw+"|"+Ew+")",B5="[^"+U5+"]",z5="(?:\\ud83c[\\udde6-\\uddff]){2}",V5="[\\ud800-\\udbff][\\udc00-\\udfff]",tee="\\u200d",G5=eee+"?",W5="["+QJ+"]?",ree="(?:"+tee+"(?:"+[B5,z5,V5].join("|")+")"+W5+G5+")*",nee=W5+G5+ree,oee="(?:"+[B5+Sw+"?",Sw,z5,V5,JJ].join("|")+")",iee=RegExp(Ew+"(?="+Ew+")|"+oee+nee,"g");function aee(t){return t.match(iee)||[]}var see=aee,lee=qJ,uee=$5,cee=see;function dee(t){return uee(t)?cee(t):lee(t)}var fee=dee,hee=LJ,pee=$5,mee=fee,yee=M5;function gee(t){return function(r){r=yee(r);var o=pee(r)?mee(r):void 0,n=o?o[0]:r.charAt(0),i=o?hee(o,1).join(""):r.slice(1);return n[t]()+i}}var vee=gee,bee=vee,xee=bee("toUpperCase"),wee=xee;const n0=Kt(wee);function yr(t){return function(){return t}}const H5=Math.cos,Jy=Math.sin,Ti=Math.sqrt,eg=Math.PI,o0=2*eg,Tw=Math.PI,Ow=2*Tw,al=1e-6,_ee=Ow-al;function q5(t){this._+=t[0];for(let r=1,o=t.length;r=0))throw new Error(`invalid digits: ${t}`);if(r>15)return q5;const o=10**r;return function(n){this._+=n[0];for(let i=1,a=n.length;ial)if(!(Math.abs(f*u-c*h)>al)||!a)this._append`L${this._x1=r},${this._y1=o}`;else{let m=n-s,y=i-l,p=u*u+c*c,g=m*m+y*y,b=Math.sqrt(p),x=Math.sqrt(d),v=a*Math.tan((Tw-Math.acos((p+d-g)/(2*b*x)))/2),w=v/x,_=v/b;Math.abs(w-1)>al&&this._append`L${r+w*h},${o+w*f}`,this._append`A${a},${a},0,0,${+(f*m>h*y)},${this._x1=r+_*u},${this._y1=o+_*c}`}}arc(r,o,n,i,a,s){if(r=+r,o=+o,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(i),u=n*Math.sin(i),c=r+l,h=o+u,f=1^s,d=s?i-a:a-i;this._x1===null?this._append`M${c},${h}`:(Math.abs(this._x1-c)>al||Math.abs(this._y1-h)>al)&&this._append`L${c},${h}`,n&&(d<0&&(d=d%Ow+Ow),d>_ee?this._append`A${n},${n},0,1,${f},${r-l},${o-u}A${n},${n},0,1,${f},${this._x1=c},${this._y1=h}`:d>al&&this._append`A${n},${n},0,${+(d>=Tw)},${f},${this._x1=r+n*Math.cos(a)},${this._y1=o+n*Math.sin(a)}`)}rect(r,o,n,i){this._append`M${this._x0=this._x1=+r},${this._y0=this._y1=+o}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function US(t){let r=3;return t.digits=function(o){if(!arguments.length)return r;if(o==null)r=null;else{const n=Math.floor(o);if(!(n>=0))throw new RangeError(`invalid digits: ${o}`);r=n}return t},()=>new See(r)}function BS(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function X5(t){this._context=t}X5.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,r){switch(t=+t,r=+r,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break;case 1:this._point=2;default:this._context.lineTo(t,r);break}}};function i0(t){return new X5(t)}function Y5(t){return t[0]}function K5(t){return t[1]}function Z5(t,r){var o=yr(!0),n=null,i=i0,a=null,s=US(l);t=typeof t=="function"?t:t===void 0?Y5:yr(t),r=typeof r=="function"?r:r===void 0?K5:yr(r);function l(u){var c,h=(u=BS(u)).length,f,d=!1,m;for(n==null&&(a=i(m=s())),c=0;c<=h;++c)!(c=m;--y)l.point(v[y],w[y]);l.lineEnd(),l.areaEnd()}b&&(v[d]=+t(g,d,f),w[d]=+r(g,d,f),l.point(n?+n(g,d,f):v[d],o?+o(g,d,f):w[d]))}if(x)return l=null,x+""||null}function h(){return Z5().defined(i).curve(s).context(a)}return c.x=function(f){return arguments.length?(t=typeof f=="function"?f:yr(+f),n=null,c):t},c.x0=function(f){return arguments.length?(t=typeof f=="function"?f:yr(+f),c):t},c.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:yr(+f),c):n},c.y=function(f){return arguments.length?(r=typeof f=="function"?f:yr(+f),o=null,c):r},c.y0=function(f){return arguments.length?(r=typeof f=="function"?f:yr(+f),c):r},c.y1=function(f){return arguments.length?(o=f==null?null:typeof f=="function"?f:yr(+f),c):o},c.lineX0=c.lineY0=function(){return h().x(t).y(r)},c.lineY1=function(){return h().x(t).y(o)},c.lineX1=function(){return h().x(n).y(r)},c.defined=function(f){return arguments.length?(i=typeof f=="function"?f:yr(!!f),c):i},c.curve=function(f){return arguments.length?(s=f,a!=null&&(l=s(a)),c):s},c.context=function(f){return arguments.length?(f==null?a=l=null:l=s(a=f),c):a},c}class Q5{constructor(r,o){this._context=r,this._x=o}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(r,o){switch(r=+r,o=+o,this._point){case 0:{this._point=1,this._line?this._context.lineTo(r,o):this._context.moveTo(r,o);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+r)/2,this._y0,this._x0,o,r,o):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+o)/2,r,this._y0,r,o);break}}this._x0=r,this._y0=o}}function Eee(t){return new Q5(t,!0)}function Tee(t){return new Q5(t,!1)}const zS={draw(t,r){const o=Ti(r/eg);t.moveTo(o,0),t.arc(0,0,o,0,o0)}},Oee={draw(t,r){const o=Ti(r/5)/2;t.moveTo(-3*o,-o),t.lineTo(-o,-o),t.lineTo(-o,-3*o),t.lineTo(o,-3*o),t.lineTo(o,-o),t.lineTo(3*o,-o),t.lineTo(3*o,o),t.lineTo(o,o),t.lineTo(o,3*o),t.lineTo(-o,3*o),t.lineTo(-o,o),t.lineTo(-3*o,o),t.closePath()}},J5=Ti(1/3),kee=J5*2,Pee={draw(t,r){const o=Ti(r/kee),n=o*J5;t.moveTo(0,-o),t.lineTo(n,0),t.lineTo(0,o),t.lineTo(-n,0),t.closePath()}},Cee={draw(t,r){const o=Ti(r),n=-o/2;t.rect(n,n,o,o)}},Aee=.8908130915292852,e4=Jy(eg/10)/Jy(7*eg/10),Mee=Jy(o0/10)*e4,Ree=-H5(o0/10)*e4,Iee={draw(t,r){const o=Ti(r*Aee),n=Mee*o,i=Ree*o;t.moveTo(0,-o),t.lineTo(n,i);for(let a=1;a<5;++a){const s=o0*a/5,l=H5(s),u=Jy(s);t.lineTo(u*o,-l*o),t.lineTo(l*n-u*i,u*n+l*i)}t.closePath()}},Yb=Ti(3),Nee={draw(t,r){const o=-Ti(r/(Yb*3));t.moveTo(0,o*2),t.lineTo(-Yb*o,-o),t.lineTo(Yb*o,-o),t.closePath()}},Do=-.5,Fo=Ti(3)/2,kw=1/Ti(12),Lee=(kw/2+1)*3,Dee={draw(t,r){const o=Ti(r/Lee),n=o/2,i=o*kw,a=n,s=o*kw+o,l=-a,u=s;t.moveTo(n,i),t.lineTo(a,s),t.lineTo(l,u),t.lineTo(Do*n-Fo*i,Fo*n+Do*i),t.lineTo(Do*a-Fo*s,Fo*a+Do*s),t.lineTo(Do*l-Fo*u,Fo*l+Do*u),t.lineTo(Do*n+Fo*i,Do*i-Fo*n),t.lineTo(Do*a+Fo*s,Do*s-Fo*a),t.lineTo(Do*l+Fo*u,Do*u-Fo*l),t.closePath()}};function Fee(t,r){let o=null,n=US(i);t=typeof t=="function"?t:yr(t||zS),r=typeof r=="function"?r:yr(r===void 0?64:+r);function i(){let a;if(o||(o=a=n()),t.apply(this,arguments).draw(o,+r.apply(this,arguments)),a)return o=null,a+""||null}return i.type=function(a){return arguments.length?(t=typeof a=="function"?a:yr(a),i):t},i.size=function(a){return arguments.length?(r=typeof a=="function"?a:yr(+a),i):r},i.context=function(a){return arguments.length?(o=a??null,i):o},i}function tg(){}function rg(t,r,o){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+r)/6,(t._y0+4*t._y1+o)/6)}function t4(t){this._context=t}t4.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:rg(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,r){switch(t=+t,r=+r,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);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:rg(this,t,r);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=r}};function $ee(t){return new t4(t)}function r4(t){this._context=t}r4.prototype={areaStart:tg,areaEnd:tg,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,r){switch(t=+t,r=+r,this._point){case 0:this._point=1,this._x2=t,this._y2=r;break;case 1:this._point=2,this._x3=t,this._y3=r;break;case 2:this._point=3,this._x4=t,this._y4=r,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+r)/6);break;default:rg(this,t,r);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=r}};function Uee(t){return new r4(t)}function n4(t){this._context=t}n4.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,r){switch(t=+t,r=+r,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var o=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+r)/6;this._line?this._context.lineTo(o,n):this._context.moveTo(o,n);break;case 3:this._point=4;default:rg(this,t,r);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=r}};function Bee(t){return new n4(t)}function o4(t){this._context=t}o4.prototype={areaStart:tg,areaEnd:tg,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,r){t=+t,r=+r,this._point?this._context.lineTo(t,r):(this._point=1,this._context.moveTo(t,r))}};function zee(t){return new o4(t)}function Ek(t){return t<0?-1:1}function Tk(t,r,o){var n=t._x1-t._x0,i=r-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),s=(o-t._y1)/(i||n<0&&-0),l=(a*i+s*n)/(n+i);return(Ek(a)+Ek(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(l))||0}function Ok(t,r){var o=t._x1-t._x0;return o?(3*(t._y1-t._y0)/o-r)/2:r}function Kb(t,r,o){var n=t._x0,i=t._y0,a=t._x1,s=t._y1,l=(a-n)/3;t._context.bezierCurveTo(n+l,i+l*r,a-l,s-l*o,a,s)}function ng(t){this._context=t}ng.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:Kb(this,this._t0,Ok(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,r){var o=NaN;if(t=+t,r=+r,!(t===this._x1&&r===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break;case 1:this._point=2;break;case 2:this._point=3,Kb(this,Ok(this,o=Tk(this,t,r)),o);break;default:Kb(this,this._t0,o=Tk(this,t,r));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=r,this._t0=o}}};function i4(t){this._context=new a4(t)}(i4.prototype=Object.create(ng.prototype)).point=function(t,r){ng.prototype.point.call(this,r,t)};function a4(t){this._context=t}a4.prototype={moveTo:function(t,r){this._context.moveTo(r,t)},closePath:function(){this._context.closePath()},lineTo:function(t,r){this._context.lineTo(r,t)},bezierCurveTo:function(t,r,o,n,i,a){this._context.bezierCurveTo(r,t,n,o,a,i)}};function Vee(t){return new ng(t)}function Gee(t){return new i4(t)}function s4(t){this._context=t}s4.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,r=this._y,o=t.length;if(o)if(this._line?this._context.lineTo(t[0],r[0]):this._context.moveTo(t[0],r[0]),o===2)this._context.lineTo(t[1],r[1]);else for(var n=kk(t),i=kk(r),a=0,s=1;s=0;--r)i[r]=(s[r]-i[r+1])/a[r];for(a[o-1]=(t[o]+i[o-1])/2,r=0;r=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,r){switch(t=+t,r=+r,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,r),this._context.lineTo(t,r);else{var o=this._x*(1-this._t)+t*this._t;this._context.lineTo(o,this._y),this._context.lineTo(o,r)}break}}this._x=t,this._y=r}};function Hee(t){return new a0(t,.5)}function qee(t){return new a0(t,0)}function Xee(t){return new a0(t,1)}function Cc(t,r){if((s=t.length)>1)for(var o=1,n,i,a=t[r[0]],s,l=a.length;o=0;)o[r]=r;return o}function Yee(t,r){return t[r]}function Kee(t){const r=[];return r.key=t,r}function Zee(){var t=yr([]),r=Pw,o=Cc,n=Yee;function i(a){var s=Array.from(t.apply(this,arguments),Kee),l,u=s.length,c=-1,h;for(const f of a)for(l=0,++c;l0){for(var o,n,i=0,a=t[0].length,s;i0){for(var o=0,n=t[r[0]],i,a=n.length;o0)||!((a=(i=t[r[0]]).length)>0))){for(var o=0,n=1,i,a,s;n=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function ate(t,r){if(t==null)return{};var o={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(r.indexOf(n)>=0)continue;o[n]=t[n]}return o}var l4={symbolCircle:zS,symbolCross:Oee,symbolDiamond:Pee,symbolSquare:Cee,symbolStar:Iee,symbolTriangle:Nee,symbolWye:Dee},ste=Math.PI/180,lte=function(r){var o="symbol".concat(n0(r));return l4[o]||zS},ute=function(r,o,n){if(o==="area")return r;switch(n){case"cross":return 5*r*r/9;case"diamond":return .5*r*r/Math.sqrt(3);case"square":return r*r;case"star":{var i=18*ste;return 1.25*r*r*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*r*r/4;case"wye":return(21-10*Math.sqrt(3))*r*r/8;default:return Math.PI*r*r/4}},cte=function(r,o){l4["symbol".concat(n0(r))]=o},VS=function(r){var o=r.type,n=o===void 0?"circle":o,i=r.size,a=i===void 0?64:i,s=r.sizeType,l=s===void 0?"area":s,u=ite(r,tte),c=Ck(Ck({},u),{},{type:n,size:a,sizeType:l}),h=function(){var g=lte(n),b=Fee().type(g).size(ute(a,l,n));return b()},f=c.className,d=c.cx,m=c.cy,y=jt(c,!0);return d===+d&&m===+m&&a===+a?me.createElement("path",Cw({},y,{className:Nt("recharts-symbols",f),transform:"translate(".concat(d,", ").concat(m,")"),d:h()})):null};VS.registerSymbol=cte;function Ac(t){"@babel/helpers - typeof";return Ac=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ac(t)}function Aw(){return Aw=Object.assign?Object.assign.bind():function(t){for(var r=1;r`);var x=m.inactive?c:m.color;return me.createElement("li",Aw({className:g,style:f,key:"legend-item-".concat(y)},Wl(n.props,m,y)),me.createElement(_w,{width:s,height:s,viewBox:h,style:d},n.renderIcon(m)),me.createElement("span",{className:"recharts-legend-item-text",style:{color:x}},p?p(b,m,y):b))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,s=n.align;if(!i||!i.length)return null;var l={padding:0,margin:0,textAlign:a==="horizontal"?s:"left"};return me.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(q.PureComponent);wh(GS,"displayName","Legend");wh(GS,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var xte=Gv;function wte(){this.__data__=new xte,this.size=0}var _te=wte;function jte(t){var r=this.__data__,o=r.delete(t);return this.size=r.size,o}var Ste=jte;function Ete(t){return this.__data__.get(t)}var Tte=Ete;function Ote(t){return this.__data__.has(t)}var kte=Ote,Pte=Gv,Cte=AS,Ate=MS,Mte=200;function Rte(t,r){var o=this.__data__;if(o instanceof Pte){var n=o.__data__;if(!Cte||n.lengthl))return!1;var c=a.get(t),h=a.get(r);if(c&&h)return c==r&&h==t;var f=-1,d=!0,m=o&tre?new Zte:void 0;for(a.set(t,r),a.set(r,t);++f-1&&t%1==0&&t-1&&t%1==0&&t<=ine}var XS=ane,sne=Ua,lne=XS,une=Ba,cne="[object Arguments]",dne="[object Array]",fne="[object Boolean]",hne="[object Date]",pne="[object Error]",mne="[object Function]",yne="[object Map]",gne="[object Number]",vne="[object Object]",bne="[object RegExp]",xne="[object Set]",wne="[object String]",_ne="[object WeakMap]",jne="[object ArrayBuffer]",Sne="[object DataView]",Ene="[object Float32Array]",Tne="[object Float64Array]",One="[object Int8Array]",kne="[object Int16Array]",Pne="[object Int32Array]",Cne="[object Uint8Array]",Ane="[object Uint8ClampedArray]",Mne="[object Uint16Array]",Rne="[object Uint32Array]",Sr={};Sr[Ene]=Sr[Tne]=Sr[One]=Sr[kne]=Sr[Pne]=Sr[Cne]=Sr[Ane]=Sr[Mne]=Sr[Rne]=!0;Sr[cne]=Sr[dne]=Sr[jne]=Sr[fne]=Sr[Sne]=Sr[hne]=Sr[pne]=Sr[mne]=Sr[yne]=Sr[gne]=Sr[vne]=Sr[bne]=Sr[xne]=Sr[wne]=Sr[_ne]=!1;function Ine(t){return une(t)&&lne(t.length)&&!!Sr[sne(t)]}var Nne=Ine;function Lne(t){return function(r){return t(r)}}var b4=Lne,sg={exports:{}};sg.exports;(function(t,r){var o=T5,n=r&&!r.nodeType&&r,i=n&&!0&&t&&!t.nodeType&&t,a=i&&i.exports===n,s=a&&o.process,l=function(){try{var u=i&&i.require&&i.require("util").types;return u||s&&s.binding&&s.binding("util")}catch{}}();t.exports=l})(sg,sg.exports);var Dne=sg.exports,Fne=Nne,$ne=b4,Dk=Dne,Fk=Dk&&Dk.isTypedArray,Une=Fk?$ne(Fk):Fne,x4=Une,Bne=Gre,zne=HS,Vne=vo,Gne=v4,Wne=qS,Hne=x4,qne=Object.prototype,Xne=qne.hasOwnProperty;function Yne(t,r){var o=Vne(t),n=!o&&zne(t),i=!o&&!n&&Gne(t),a=!o&&!n&&!i&&Hne(t),s=o||n||i||a,l=s?Bne(t.length,String):[],u=l.length;for(var c in t)(r||Xne.call(t,c))&&!(s&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Wne(c,u)))&&l.push(c);return l}var Kne=Yne,Zne=Object.prototype;function Qne(t){var r=t&&t.constructor,o=typeof r=="function"&&r.prototype||Zne;return t===o}var Jne=Qne;function eoe(t,r){return function(o){return t(r(o))}}var w4=eoe,toe=w4,roe=toe(Object.keys,Object),noe=roe,ooe=Jne,ioe=noe,aoe=Object.prototype,soe=aoe.hasOwnProperty;function loe(t){if(!ooe(t))return ioe(t);var r=[];for(var o in Object(t))soe.call(t,o)&&o!="constructor"&&r.push(o);return r}var uoe=loe,coe=PS,doe=XS;function foe(t){return t!=null&&doe(t.length)&&!coe(t)}var Op=foe,hoe=Kne,poe=uoe,moe=Op;function yoe(t){return moe(t)?hoe(t):poe(t)}var s0=yoe,goe=Mre,voe=zre,boe=s0;function xoe(t){return goe(t,boe,voe)}var woe=xoe,$k=woe,_oe=1,joe=Object.prototype,Soe=joe.hasOwnProperty;function Eoe(t,r,o,n,i,a){var s=o&_oe,l=$k(t),u=l.length,c=$k(r),h=c.length;if(u!=h&&!s)return!1;for(var f=u;f--;){var d=l[f];if(!(s?d in r:Soe.call(r,d)))return!1}var m=a.get(t),y=a.get(r);if(m&&y)return m==r&&y==t;var p=!0;a.set(t,r),a.set(r,t);for(var g=s;++f-1}var jae=_ae;function Sae(t,r,o){for(var n=-1,i=t==null?0:t.length;++n=$ae){var c=r?null:Dae(t);if(c)return Fae(c);s=!1,i=Lae,u=new Rae}else u=r?[]:l;e:for(;++n=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function tse(t,r){if(t==null)return{};var o={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(r.indexOf(n)>=0)continue;o[n]=t[n]}return o}function rse(t){return t.value}function nse(t,r){if(me.isValidElement(t))return me.cloneElement(t,r);if(typeof t=="function")return me.createElement(t,r);r.ref;var o=ese(r,Hae);return me.createElement(GS,o)}var tP=1,ec=function(t){function r(){var o;qae(this,r);for(var n=arguments.length,i=new Array(n),a=0;atP||Math.abs(i.height-this.lastBoundingBox.height)>tP)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?ia({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,s=i.align,l=i.verticalAlign,u=i.margin,c=i.chartWidth,h=i.chartHeight,f,d;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(s==="center"&&a==="vertical"){var m=this.getBBoxSnapshot();f={left:((c||0)-m.width)/2}}else f=s==="right"?{right:u&&u.right||0}:{left:u&&u.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(l==="middle"){var y=this.getBBoxSnapshot();d={top:((h||0)-y.height)/2}}else d=l==="bottom"?{bottom:u&&u.bottom||0}:{top:u&&u.top||0};return ia(ia({},f),d)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,s=i.width,l=i.height,u=i.wrapperStyle,c=i.payloadUniqBy,h=i.payload,f=ia(ia({position:"absolute",width:s||"auto",height:l||"auto"},this.getDefaultPosition(u)),u);return me.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(m){n.wrapperNode=m}},nse(a,ia(ia({},this.props),{},{payload:k4(h,c,rse)})))}}],[{key:"getWithHeight",value:function(n,i){var a=ia(ia({},this.defaultProps),n.props),s=a.layout;return s==="vertical"&&tt(n.props.height)?{height:n.props.height}:s==="horizontal"?{width:n.props.width||i}:null}}])}(q.PureComponent);l0(ec,"displayName","Legend");l0(ec,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var rP=jp,ose=HS,ise=vo,nP=rP?rP.isConcatSpreadable:void 0;function ase(t){return ise(t)||ose(t)||!!(nP&&t&&t[nP])}var sse=ase,lse=y4,use=sse;function A4(t,r,o,n,i){var a=-1,s=t.length;for(o||(o=use),i||(i=[]);++a0&&o(l)?r>1?A4(l,r-1,o,n,i):lse(i,l):n||(i[i.length]=l)}return i}var M4=A4;function cse(t){return function(r,o,n){for(var i=-1,a=Object(r),s=n(r),l=s.length;l--;){var u=s[t?l:++i];if(o(a[u],u,a)===!1)break}return r}}var dse=cse,fse=dse,hse=fse(),pse=hse,mse=pse,yse=s0;function gse(t,r){return t&&mse(t,r,yse)}var R4=gse,vse=Op;function bse(t,r){return function(o,n){if(o==null)return o;if(!vse(o))return t(o,n);for(var i=o.length,a=r?i:-1,s=Object(o);(r?a--:++ar||a&&s&&u&&!l&&!c||n&&s&&u||!o&&u||!i)return 1;if(!n&&!a&&!c&&t=l)return u;var c=o[n];return u*(c=="desc"?-1:1)}}return t.index-r.index}var Rse=Mse,e1=IS,Ise=NS,Nse=ea,Lse=I4,Dse=kse,Fse=b4,$se=Rse,Use=vd,Bse=vo;function zse(t,r,o){r.length?r=e1(r,function(a){return Bse(a)?function(s){return Ise(s,a.length===1?a[0]:a)}:a}):r=[Use];var n=-1;r=e1(r,Fse(Nse));var i=Lse(t,function(a,s,l){var u=e1(r,function(c){return c(a)});return{criteria:u,index:++n,value:a}});return Dse(i,function(a,s){return $se(a,s,o)})}var Vse=zse;function Gse(t,r,o){switch(o.length){case 0:return t.call(r);case 1:return t.call(r,o[0]);case 2:return t.call(r,o[0],o[1]);case 3:return t.call(r,o[0],o[1],o[2])}return t.apply(r,o)}var Wse=Gse,Hse=Wse,iP=Math.max;function qse(t,r,o){return r=iP(r===void 0?t.length-1:r,0),function(){for(var n=arguments,i=-1,a=iP(n.length-r,0),s=Array(a);++i0){if(++r>=nle)return arguments[0]}else r=0;return t.apply(void 0,arguments)}}var sle=ale,lle=rle,ule=sle,cle=ule(lle),dle=cle,fle=vd,hle=Xse,ple=dle;function mle(t,r){return ple(hle(t,r,fle),t+"")}var yle=mle,gle=CS,vle=Op,ble=qS,xle=Xs;function wle(t,r,o){if(!xle(o))return!1;var n=typeof r;return(n=="number"?vle(o)&&ble(r,o.length):n=="string"&&r in o)?gle(o[r],t):!1}var u0=wle,_le=M4,jle=Vse,Sle=yle,sP=u0,Ele=Sle(function(t,r){if(t==null)return[];var o=r.length;return o>1&&sP(t,r[0],r[1])?r=[]:o>2&&sP(r[0],r[1],r[2])&&(r=[r[0]]),jle(t,_le(r,1),[])}),Tle=Ele;const ZS=Kt(Tle);function _h(t){"@babel/helpers - typeof";return _h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},_h(t)}function $w(){return $w=Object.assign?Object.assign.bind():function(t){for(var r=1;rt.length)&&(r=t.length);for(var o=0,n=new Array(r);o=r.x),"".concat(Xd,"-left"),tt(o)&&r&&tt(r.x)&&o=r.y),"".concat(Xd,"-top"),tt(n)&&r&&tt(r.y)&&np?Math.max(h,u[n]):Math.max(f,u[n])}function Ble(t){var r=t.translateX,o=t.translateY,n=t.useTranslate3d;return{transform:n?"translate3d(".concat(r,"px, ").concat(o,"px, 0)"):"translate(".concat(r,"px, ").concat(o,"px)")}}function zle(t){var r=t.allowEscapeViewBox,o=t.coordinate,n=t.offsetTopLeft,i=t.position,a=t.reverseDirection,s=t.tooltipBox,l=t.useTranslate3d,u=t.viewBox,c,h,f;return s.height>0&&s.width>0&&o?(h=cP({allowEscapeViewBox:r,coordinate:o,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:s.width,viewBox:u,viewBoxDimension:u.width}),f=cP({allowEscapeViewBox:r,coordinate:o,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:s.height,viewBox:u,viewBoxDimension:u.height}),c=Ble({translateX:h,translateY:f,useTranslate3d:l})):c=$le,{cssProperties:c,cssClasses:Ule({translateX:h,translateY:f,coordinate:o})}}function Rc(t){"@babel/helpers - typeof";return Rc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Rc(t)}function dP(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),o.push.apply(o,n)}return o}function fP(t){for(var r=1;rhP||Math.abs(n.height-this.state.lastBoundingBox.height)>hP)&&this.setState({lastBoundingBox:{width:n.width,height:n.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 n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.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 n=this,i=this.props,a=i.active,s=i.allowEscapeViewBox,l=i.animationDuration,u=i.animationEasing,c=i.children,h=i.coordinate,f=i.hasPayload,d=i.isAnimationActive,m=i.offset,y=i.position,p=i.reverseDirection,g=i.useTranslate3d,b=i.viewBox,x=i.wrapperStyle,v=zle({allowEscapeViewBox:s,coordinate:h,offsetTopLeft:m,position:y,reverseDirection:p,tooltipBox:this.state.lastBoundingBox,useTranslate3d:g,viewBox:b}),w=v.cssClasses,_=v.cssProperties,E=fP(fP({transition:d&&a?"transform ".concat(l,"ms ").concat(u):void 0},_),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&f?"visible":"hidden",position:"absolute",top:0,left:0},x);return me.createElement("div",{tabIndex:-1,className:w,style:E,ref:function(T){n.wrapperNode=T}},c)}}])}(q.PureComponent),Qle=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},ja={isSsr:Qle(),get:function(r){return ja[r]},set:function(r,o){if(typeof r=="string")ja[r]=o;else{var n=Object.keys(r);n&&n.length&&n.forEach(function(i){ja[i]=r[i]})}}};function Ic(t){"@babel/helpers - typeof";return Ic=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ic(t)}function pP(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),o.push.apply(o,n)}return o}function mP(t){for(var r=1;r0;return me.createElement(Zle,{allowEscapeViewBox:s,animationDuration:l,animationEasing:u,isAnimationActive:d,active:a,coordinate:h,hasPayload:E,offset:m,position:g,reverseDirection:b,useTranslate3d:x,viewBox:v,wrapperStyle:w},lue(c,mP(mP({},this.props),{},{payload:_})))}}])}(q.PureComponent);QS(fi,"displayName","Tooltip");QS(fi,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!ja.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 uue=Ji,cue=function(){return uue.Date.now()},due=cue,fue=/\s/;function hue(t){for(var r=t.length;r--&&fue.test(t.charAt(r)););return r}var pue=hue,mue=pue,yue=/^\s+/;function gue(t){return t&&t.slice(0,mue(t)+1).replace(yue,"")}var vue=gue,bue=vue,yP=Xs,xue=dd,gP=NaN,wue=/^[-+]0x[0-9a-f]+$/i,_ue=/^0b[01]+$/i,jue=/^0o[0-7]+$/i,Sue=parseInt;function Eue(t){if(typeof t=="number")return t;if(xue(t))return gP;if(yP(t)){var r=typeof t.valueOf=="function"?t.valueOf():t;t=yP(r)?r+"":r}if(typeof t!="string")return t===0?t:+t;t=bue(t);var o=_ue.test(t);return o||jue.test(t)?Sue(t.slice(2),o?2:8):wue.test(t)?gP:+t}var U4=Eue,Tue=Xs,r1=due,vP=U4,Oue="Expected a function",kue=Math.max,Pue=Math.min;function Cue(t,r,o){var n,i,a,s,l,u,c=0,h=!1,f=!1,d=!0;if(typeof t!="function")throw new TypeError(Oue);r=vP(r)||0,Tue(o)&&(h=!!o.leading,f="maxWait"in o,a=f?kue(vP(o.maxWait)||0,r):a,d="trailing"in o?!!o.trailing:d);function m(E){var S=n,T=i;return n=i=void 0,c=E,s=t.apply(T,S),s}function y(E){return c=E,l=setTimeout(b,r),h?m(E):s}function p(E){var S=E-u,T=E-c,k=r-S;return f?Pue(k,a-T):k}function g(E){var S=E-u,T=E-c;return u===void 0||S>=r||S<0||f&&T>=a}function b(){var E=r1();if(g(E))return x(E);l=setTimeout(b,p(E))}function x(E){return l=void 0,d&&n?m(E):(n=i=void 0,s)}function v(){l!==void 0&&clearTimeout(l),c=0,n=u=i=l=void 0}function w(){return l===void 0?s:x(r1())}function _(){var E=r1(),S=g(E);if(n=arguments,i=this,u=E,S){if(l===void 0)return y(u);if(f)return clearTimeout(l),l=setTimeout(b,r),m(u)}return l===void 0&&(l=setTimeout(b,r)),s}return _.cancel=v,_.flush=w,_}var Aue=Cue,Mue=Aue,Rue=Xs,Iue="Expected a function";function Nue(t,r,o){var n=!0,i=!0;if(typeof t!="function")throw new TypeError(Iue);return Rue(o)&&(n="leading"in o?!!o.leading:n,i="trailing"in o?!!o.trailing:i),Mue(t,r,{leading:n,maxWait:r,trailing:i})}var Lue=Nue;const B4=Kt(Lue);function Sh(t){"@babel/helpers - typeof";return Sh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Sh(t)}function bP(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),o.push.apply(o,n)}return o}function bm(t){for(var r=1;rt.length)&&(r=t.length);for(var o=0,n=new Array(r);o0&&(C=B4(C,p,{trailing:!0,leading:!1}));var L=new ResizeObserver(C),F=_.current.getBoundingClientRect(),z=F.width,W=F.height;return O(z,W),L.observe(_.current),function(){L.disconnect()}},[O,p]);var R=q.useMemo(function(){var C=k.containerWidth,L=k.containerHeight;if(C<0||L<0)return null;_i(yl(s)||yl(u),`The width(%s) and height(%s) are both fixed numbers, maybe you don't need to use a ResponsiveContainer.`,s,u),_i(!o||o>0,"The aspect(%s) must be greater than zero.",o);var F=yl(s)?C:s,z=yl(u)?L:u;o&&o>0&&(F?z=F/o:z&&(F=z*o),d&&z>d&&(z=d)),_i(F>0||z>0,`The width(%s) and height(%s) of chart should be greater than 0, please check the style of container, or the props width(%s) and height(%s), or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the height and width.`,F,z,s,u,h,f,o);var W=!Array.isArray(m)&&_a(m.type).endsWith("Chart");return me.Children.map(m,function($){return D5.isElement($)?q.cloneElement($,bm({width:F,height:z},W?{style:bm({height:"100%",width:"100%",maxHeight:z,maxWidth:F},$.props.style)}:{})):$})},[o,m,u,d,f,h,k,s]);return me.createElement("div",{id:g?"".concat(g):void 0,className:Nt("recharts-responsive-container",b),style:bm(bm({},w),{},{width:s,height:u,minWidth:h,minHeight:f,maxHeight:d}),ref:_},R)}),c0=function(r){return null};c0.displayName="Cell";function Eh(t){"@babel/helpers - typeof";return Eh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Eh(t)}function _P(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),o.push.apply(o,n)}return o}function Vw(t){for(var r=1;r1&&arguments[1]!==void 0?arguments[1]:{};if(r==null||ja.isSsr)return{width:0,height:0};var n=Kue(o),i=JSON.stringify({text:r,copyStyle:n});if(vu.widthCache[i])return vu.widthCache[i];try{var a=document.getElementById(jP);a||(a=document.createElement("span"),a.setAttribute("id",jP),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var s=Vw(Vw({},Yue),n);Object.assign(a.style,s),a.textContent="".concat(r);var l=a.getBoundingClientRect(),u={width:l.width,height:l.height};return vu.widthCache[i]=u,++vu.cacheCount>Xue&&(vu.cacheCount=0,vu.widthCache={}),u}catch{return{width:0,height:0}}},Zue=function(r){return{top:r.top+window.scrollY-document.documentElement.clientTop,left:r.left+window.scrollX-document.documentElement.clientLeft}};function Th(t){"@babel/helpers - typeof";return Th=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Th(t)}function dg(t,r){return tce(t)||ece(t,r)||Jue(t,r)||Que()}function Que(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jue(t,r){if(t){if(typeof t=="string")return SP(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);if(o==="Object"&&t.constructor&&(o=t.constructor.name),o==="Map"||o==="Set")return Array.from(t);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return SP(t,r)}}function SP(t,r){(r==null||r>t.length)&&(r=t.length);for(var o=0,n=new Array(r);o=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function mce(t,r){if(t==null)return{};var o={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(r.indexOf(n)>=0)continue;o[n]=t[n]}return o}function CP(t,r){return bce(t)||vce(t,r)||gce(t,r)||yce()}function yce(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gce(t,r){if(t){if(typeof t=="string")return AP(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);if(o==="Object"&&t.constructor&&(o=t.constructor.name),o==="Map"||o==="Set")return Array.from(t);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return AP(t,r)}}function AP(t,r){(r==null||r>t.length)&&(r=t.length);for(var o=0,n=new Array(r);o0&&arguments[0]!==void 0?arguments[0]:[];return F.reduce(function(z,W){var $=W.word,G=W.width,K=z[z.length-1];if(K&&(i==null||a||K.width+G+nW.width?z:W})};if(!h)return m;for(var p="…",g=function(F){var z=f.slice(0,F),W=W4({breakAll:c,style:u,children:z+p}).wordsWithComputedWidth,$=d(W),G=$.length>s||y($).width>Number(i);return[G,$]},b=0,x=f.length-1,v=0,w;b<=x&&v<=f.length-1;){var _=Math.floor((b+x)/2),E=_-1,S=g(E),T=CP(S,2),k=T[0],A=T[1],O=g(_),R=CP(O,1),C=R[0];if(!k&&!C&&(b=_+1),k&&C&&(x=_-1),!k&&C){w=A;break}v++}return w||m},MP=function(r){var o=Dt(r)?[]:r.toString().split(G4);return[{words:o}]},wce=function(r){var o=r.width,n=r.scaleToFit,i=r.children,a=r.style,s=r.breakAll,l=r.maxLines;if((o||n)&&!ja.isSsr){var u,c,h=W4({breakAll:s,children:i,style:a});if(h){var f=h.wordsWithComputedWidth,d=h.spaceWidth;u=f,c=d}else return MP(i);return xce({breakAll:s,children:i,maxLines:l,style:a},u,c,o,n)}return MP(i)},RP="#808080",Hl=function(r){var o=r.x,n=o===void 0?0:o,i=r.y,a=i===void 0?0:i,s=r.lineHeight,l=s===void 0?"1em":s,u=r.capHeight,c=u===void 0?"0.71em":u,h=r.scaleToFit,f=h===void 0?!1:h,d=r.textAnchor,m=d===void 0?"start":d,y=r.verticalAnchor,p=y===void 0?"end":y,g=r.fill,b=g===void 0?RP:g,x=PP(r,hce),v=q.useMemo(function(){return wce({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:f,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,f,x.style,x.width]),w=x.dx,_=x.dy,E=x.angle,S=x.className,T=x.breakAll,k=PP(x,pce);if(!an(n)||!an(a))return null;var A=n+(tt(w)?w:0),O=a+(tt(_)?_:0),R;switch(p){case"start":R=n1("calc(".concat(c,")"));break;case"middle":R=n1("calc(".concat((v.length-1)/2," * -").concat(l," + (").concat(c," / 2))"));break;default:R=n1("calc(".concat(v.length-1," * -").concat(l,")"));break}var C=[];if(f){var L=v[0].width,F=x.width;C.push("scale(".concat((tt(F)?F/L:1)/L,")"))}return E&&C.push("rotate(".concat(E,", ").concat(A,", ").concat(O,")")),C.length&&(k.transform=C.join(" ")),me.createElement("text",Gw({},jt(k,!0),{x:A,y:O,className:Nt("recharts-text",S),textAnchor:m,fill:b.includes("url")?RP:b}),v.map(function(z,W){var $=z.words.join(T?"":" ");return me.createElement("tspan",{x:A,dy:W===0?R:l,key:"".concat($,"-").concat(W)},$)}))};function Ms(t,r){return t==null||r==null?NaN:tr?1:t>=r?0:NaN}function _ce(t,r){return t==null||r==null?NaN:rt?1:r>=t?0:NaN}function JS(t){let r,o,n;t.length!==2?(r=Ms,o=(l,u)=>Ms(t(l),u),n=(l,u)=>t(l)-u):(r=t===Ms||t===_ce?t:jce,o=t,n=t);function i(l,u,c=0,h=l.length){if(c>>1;o(l[f],u)<0?c=f+1:h=f}while(c>>1;o(l[f],u)<=0?c=f+1:h=f}while(cc&&n(l[f-1],u)>-n(l[f],u)?f-1:f}return{left:i,center:s,right:a}}function jce(){return 0}function H4(t){return t===null?NaN:+t}function*Sce(t,r){for(let o of t)o!=null&&(o=+o)>=o&&(yield o)}const Ece=JS(Ms),kp=Ece.right;JS(H4).center;class IP extends Map{constructor(r,o=kce){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:o}}),r!=null)for(const[n,i]of r)this.set(n,i)}get(r){return super.get(NP(this,r))}has(r){return super.has(NP(this,r))}set(r,o){return super.set(Tce(this,r),o)}delete(r){return super.delete(Oce(this,r))}}function NP({_intern:t,_key:r},o){const n=r(o);return t.has(n)?t.get(n):o}function Tce({_intern:t,_key:r},o){const n=r(o);return t.has(n)?t.get(n):(t.set(n,o),o)}function Oce({_intern:t,_key:r},o){const n=r(o);return t.has(n)&&(o=t.get(n),t.delete(n)),o}function kce(t){return t!==null&&typeof t=="object"?t.valueOf():t}function Pce(t=Ms){if(t===Ms)return q4;if(typeof t!="function")throw new TypeError("compare is not a function");return(r,o)=>{const n=t(r,o);return n||n===0?n:(t(o,o)===0)-(t(r,r)===0)}}function q4(t,r){return(t==null||!(t>=t))-(r==null||!(r>=r))||(tr?1:0)}const Cce=Math.sqrt(50),Ace=Math.sqrt(10),Mce=Math.sqrt(2);function fg(t,r,o){const n=(r-t)/Math.max(0,o),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),s=a>=Cce?10:a>=Ace?5:a>=Mce?2:1;let l,u,c;return i<0?(c=Math.pow(10,-i)/s,l=Math.round(t*c),u=Math.round(r*c),l/cr&&--u,c=-c):(c=Math.pow(10,i)*s,l=Math.round(t/c),u=Math.round(r/c),l*cr&&--u),u0))return[];if(t===r)return[t];const n=r=i))return[];const l=a-i+1,u=new Array(l);if(n)if(s<0)for(let c=0;c=n)&&(o=n);return o}function DP(t,r){let o;for(const n of t)n!=null&&(o>n||o===void 0&&n>=n)&&(o=n);return o}function X4(t,r,o=0,n=1/0,i){if(r=Math.floor(r),o=Math.floor(Math.max(0,o)),n=Math.floor(Math.min(t.length-1,n)),!(o<=r&&r<=n))return t;for(i=i===void 0?q4:Pce(i);n>o;){if(n-o>600){const u=n-o+1,c=r-o+1,h=Math.log(u),f=.5*Math.exp(2*h/3),d=.5*Math.sqrt(h*f*(u-f)/u)*(c-u/2<0?-1:1),m=Math.max(o,Math.floor(r-c*f/u+d)),y=Math.min(n,Math.floor(r+(u-c)*f/u+d));X4(t,r,m,y,i)}const a=t[r];let s=o,l=n;for(Yd(t,o,r),i(t[n],a)>0&&Yd(t,o,n);s0;)--l}i(t[o],a)===0?Yd(t,o,l):(++l,Yd(t,l,n)),l<=r&&(o=l+1),r<=l&&(n=l-1)}return t}function Yd(t,r,o){const n=t[r];t[r]=t[o],t[o]=n}function Rce(t,r,o){if(t=Float64Array.from(Sce(t)),!(!(n=t.length)||isNaN(r=+r))){if(r<=0||n<2)return DP(t);if(r>=1)return LP(t);var n,i=(n-1)*r,a=Math.floor(i),s=LP(X4(t,a).subarray(0,a+1)),l=DP(t.subarray(a+1));return s+(l-s)*(i-a)}}function Ice(t,r,o=H4){if(!(!(n=t.length)||isNaN(r=+r))){if(r<=0||n<2)return+o(t[0],0,t);if(r>=1)return+o(t[n-1],n-1,t);var n,i=(n-1)*r,a=Math.floor(i),s=+o(t[a],a,t),l=+o(t[a+1],a+1,t);return s+(l-s)*(i-a)}}function Nce(t,r,o){t=+t,r=+r,o=(i=arguments.length)<2?(r=t,t=0,1):i<3?1:+o;for(var n=-1,i=Math.max(0,Math.ceil((r-t)/o))|0,a=new Array(i);++n>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):o===8?wm(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):o===4?wm(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=Dce.exec(t))?new ho(r[1],r[2],r[3],1):(r=Fce.exec(t))?new ho(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=$ce.exec(t))?wm(r[1],r[2],r[3],r[4]):(r=Uce.exec(t))?wm(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=Bce.exec(t))?GP(r[1],r[2]/100,r[3]/100,1):(r=zce.exec(t))?GP(r[1],r[2]/100,r[3]/100,r[4]):FP.hasOwnProperty(t)?BP(FP[t]):t==="transparent"?new ho(NaN,NaN,NaN,0):null}function BP(t){return new ho(t>>16&255,t>>8&255,t&255,1)}function wm(t,r,o,n){return n<=0&&(t=r=o=NaN),new ho(t,r,o,n)}function Wce(t){return t instanceof Pp||(t=Ch(t)),t?(t=t.rgb(),new ho(t.r,t.g,t.b,t.opacity)):new ho}function Yw(t,r,o,n){return arguments.length===1?Wce(t):new ho(t,r,o,n??1)}function ho(t,r,o,n){this.r=+t,this.g=+r,this.b=+o,this.opacity=+n}t2(ho,Yw,K4(Pp,{brighter(t){return t=t==null?hg:Math.pow(hg,t),new ho(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?kh:Math.pow(kh,t),new ho(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ho(Cl(this.r),Cl(this.g),Cl(this.b),pg(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:zP,formatHex:zP,formatHex8:Hce,formatRgb:VP,toString:VP}));function zP(){return`#${gl(this.r)}${gl(this.g)}${gl(this.b)}`}function Hce(){return`#${gl(this.r)}${gl(this.g)}${gl(this.b)}${gl((isNaN(this.opacity)?1:this.opacity)*255)}`}function VP(){const t=pg(this.opacity);return`${t===1?"rgb(":"rgba("}${Cl(this.r)}, ${Cl(this.g)}, ${Cl(this.b)}${t===1?")":`, ${t})`}`}function pg(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Cl(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function gl(t){return t=Cl(t),(t<16?"0":"")+t.toString(16)}function GP(t,r,o,n){return n<=0?t=r=o=NaN:o<=0||o>=1?t=r=NaN:r<=0&&(t=NaN),new vi(t,r,o,n)}function Z4(t){if(t instanceof vi)return new vi(t.h,t.s,t.l,t.opacity);if(t instanceof Pp||(t=Ch(t)),!t)return new vi;if(t instanceof vi)return t;t=t.rgb();var r=t.r/255,o=t.g/255,n=t.b/255,i=Math.min(r,o,n),a=Math.max(r,o,n),s=NaN,l=a-i,u=(a+i)/2;return l?(r===a?s=(o-n)/l+(o0&&u<1?0:s,new vi(s,l,u,t.opacity)}function qce(t,r,o,n){return arguments.length===1?Z4(t):new vi(t,r,o,n??1)}function vi(t,r,o,n){this.h=+t,this.s=+r,this.l=+o,this.opacity=+n}t2(vi,qce,K4(Pp,{brighter(t){return t=t==null?hg:Math.pow(hg,t),new vi(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?kh:Math.pow(kh,t),new vi(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,r=isNaN(t)||isNaN(this.s)?0:this.s,o=this.l,n=o+(o<.5?o:1-o)*r,i=2*o-n;return new ho(o1(t>=240?t-240:t+120,i,n),o1(t,i,n),o1(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new vi(WP(this.h),_m(this.s),_m(this.l),pg(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=pg(this.opacity);return`${t===1?"hsl(":"hsla("}${WP(this.h)}, ${_m(this.s)*100}%, ${_m(this.l)*100}%${t===1?")":`, ${t})`}`}}));function WP(t){return t=(t||0)%360,t<0?t+360:t}function _m(t){return Math.max(0,Math.min(1,t||0))}function o1(t,r,o){return(t<60?r+(o-r)*t/60:t<180?o:t<240?r+(o-r)*(240-t)/60:r)*255}const r2=t=>()=>t;function Xce(t,r){return function(o){return t+o*r}}function Yce(t,r,o){return t=Math.pow(t,o),r=Math.pow(r,o)-t,o=1/o,function(n){return Math.pow(t+n*r,o)}}function Kce(t){return(t=+t)==1?Q4:function(r,o){return o-r?Yce(r,o,t):r2(isNaN(r)?o:r)}}function Q4(t,r){var o=r-t;return o?Xce(t,o):r2(isNaN(t)?r:t)}const HP=function t(r){var o=Kce(r);function n(i,a){var s=o((i=Yw(i)).r,(a=Yw(a)).r),l=o(i.g,a.g),u=o(i.b,a.b),c=Q4(i.opacity,a.opacity);return function(h){return i.r=s(h),i.g=l(h),i.b=u(h),i.opacity=c(h),i+""}}return n.gamma=t,n}(1);function Zce(t,r){r||(r=[]);var o=t?Math.min(r.length,t.length):0,n=r.slice(),i;return function(a){for(i=0;io&&(a=r.slice(o,a),l[s]?l[s]+=a:l[++s]=a),(n=n[0])===(i=i[0])?l[s]?l[s]+=i:l[++s]=i:(l[++s]=null,u.push({i:s,x:mg(n,i)})),o=i1.lastIndex;return or&&(o=t,t=r,r=o),function(n){return Math.max(t,Math.min(r,n))}}function lde(t,r,o){var n=t[0],i=t[1],a=r[0],s=r[1];return i2?ude:lde,u=c=null,f}function f(d){return d==null||isNaN(d=+d)?a:(u||(u=l(t.map(n),r,o)))(n(s(d)))}return f.invert=function(d){return s(i((c||(c=l(r,t.map(n),mg)))(d)))},f.domain=function(d){return arguments.length?(t=Array.from(d,yg),h()):t.slice()},f.range=function(d){return arguments.length?(r=Array.from(d),h()):r.slice()},f.rangeRound=function(d){return r=Array.from(d),o=n2,h()},f.clamp=function(d){return arguments.length?(s=d?!0:Jn,h()):s!==Jn},f.interpolate=function(d){return arguments.length?(o=d,h()):o},f.unknown=function(d){return arguments.length?(a=d,f):a},function(d,m){return n=d,i=m,h()}}function o2(){return d0()(Jn,Jn)}function cde(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function gg(t,r){if((o=(t=r?t.toExponential(r-1):t.toExponential()).indexOf("e"))<0)return null;var o,n=t.slice(0,o);return[n.length>1?n[0]+n.slice(2):n,+t.slice(o+1)]}function Nc(t){return t=gg(Math.abs(t)),t?t[1]:NaN}function dde(t,r){return function(o,n){for(var i=o.length,a=[],s=0,l=t[0],u=0;i>0&&l>0&&(u+l+1>n&&(l=Math.max(1,n-u)),a.push(o.substring(i-=l,i+l)),!((u+=l+1)>n));)l=t[s=(s+1)%t.length];return a.reverse().join(r)}}function fde(t){return function(r){return r.replace(/[0-9]/g,function(o){return t[+o]})}}var hde=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ah(t){if(!(r=hde.exec(t)))throw new Error("invalid format: "+t);var r;return new i2({fill:r[1],align:r[2],sign:r[3],symbol:r[4],zero:r[5],width:r[6],comma:r[7],precision:r[8]&&r[8].slice(1),trim:r[9],type:r[10]})}Ah.prototype=i2.prototype;function i2(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+""}i2.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 pde(t){e:for(var r=t.length,o=1,n=-1,i;o0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(i+1):t}var J4;function mde(t,r){var o=gg(t,r);if(!o)return t+"";var n=o[0],i=o[1],a=i-(J4=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=n.length;return a===s?n:a>s?n+new Array(a-s+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+gg(t,Math.max(0,r+a-1))[0]}function XP(t,r){var o=gg(t,r);if(!o)return t+"";var n=o[0],i=o[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const YP={"%":(t,r)=>(t*100).toFixed(r),b:t=>Math.round(t).toString(2),c:t=>t+"",d:cde,e:(t,r)=>t.toExponential(r),f:(t,r)=>t.toFixed(r),g:(t,r)=>t.toPrecision(r),o:t=>Math.round(t).toString(8),p:(t,r)=>XP(t*100,r),r:XP,s:mde,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function KP(t){return t}var ZP=Array.prototype.map,QP=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function yde(t){var r=t.grouping===void 0||t.thousands===void 0?KP:dde(ZP.call(t.grouping,Number),t.thousands+""),o=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?KP:fde(ZP.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",l=t.minus===void 0?"−":t.minus+"",u=t.nan===void 0?"NaN":t.nan+"";function c(f){f=Ah(f);var d=f.fill,m=f.align,y=f.sign,p=f.symbol,g=f.zero,b=f.width,x=f.comma,v=f.precision,w=f.trim,_=f.type;_==="n"?(x=!0,_="g"):YP[_]||(v===void 0&&(v=12),w=!0,_="g"),(g||d==="0"&&m==="=")&&(g=!0,d="0",m="=");var E=p==="$"?o:p==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",S=p==="$"?n:/[%p]/.test(_)?s:"",T=YP[_],k=/[defgprs%]/.test(_);v=v===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function A(O){var R=E,C=S,L,F,z;if(_==="c")C=T(O)+C,O="";else{O=+O;var W=O<0||1/O<0;if(O=isNaN(O)?u:T(Math.abs(O),v),w&&(O=pde(O)),W&&+O==0&&y!=="+"&&(W=!1),R=(W?y==="("?y:l:y==="-"||y==="("?"":y)+R,C=(_==="s"?QP[8+J4/3]:"")+C+(W&&y==="("?")":""),k){for(L=-1,F=O.length;++Lz||z>57){C=(z===46?i+O.slice(L+1):O.slice(L))+C,O=O.slice(0,L);break}}}x&&!g&&(O=r(O,1/0));var $=R.length+O.length+C.length,G=$>1)+R+O+C+G.slice($);break;default:O=G+R+O+C;break}return a(O)}return A.toString=function(){return f+""},A}function h(f,d){var m=c((f=Ah(f),f.type="f",f)),y=Math.max(-8,Math.min(8,Math.floor(Nc(d)/3)))*3,p=Math.pow(10,-y),g=QP[8+y/3];return function(b){return m(p*b)+g}}return{format:c,formatPrefix:h}}var jm,a2,eD;gde({thousands:",",grouping:[3],currency:["$",""]});function gde(t){return jm=yde(t),a2=jm.format,eD=jm.formatPrefix,jm}function vde(t){return Math.max(0,-Nc(Math.abs(t)))}function bde(t,r){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Nc(r)/3)))*3-Nc(Math.abs(t)))}function xde(t,r){return t=Math.abs(t),r=Math.abs(r)-t,Math.max(0,Nc(r)-Nc(t))+1}function tD(t,r,o,n){var i=qw(t,r,o),a;switch(n=Ah(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(r));return n.precision==null&&!isNaN(a=bde(i,s))&&(n.precision=a),eD(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=xde(i,Math.max(Math.abs(t),Math.abs(r))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=vde(i))&&(n.precision=a-(n.type==="%")*2);break}}return a2(n)}function Ys(t){var r=t.domain;return t.ticks=function(o){var n=r();return Ww(n[0],n[n.length-1],o??10)},t.tickFormat=function(o,n){var i=r();return tD(i[0],i[i.length-1],o??10,n)},t.nice=function(o){o==null&&(o=10);var n=r(),i=0,a=n.length-1,s=n[i],l=n[a],u,c,h=10;for(l0;){if(c=Hw(s,l,o),c===u)return n[i]=s,n[a]=l,r(n);if(c>0)s=Math.floor(s/c)*c,l=Math.ceil(l/c)*c;else if(c<0)s=Math.ceil(s*c)/c,l=Math.floor(l*c)/c;else break;u=c}return t},t}function vg(){var t=o2();return t.copy=function(){return Cp(t,vg())},ti.apply(t,arguments),Ys(t)}function rD(t){var r;function o(n){return n==null||isNaN(n=+n)?r:n}return o.invert=o,o.domain=o.range=function(n){return arguments.length?(t=Array.from(n,yg),o):t.slice()},o.unknown=function(n){return arguments.length?(r=n,o):r},o.copy=function(){return rD(t).unknown(r)},t=arguments.length?Array.from(t,yg):[0,1],Ys(o)}function nD(t,r){t=t.slice();var o=0,n=t.length-1,i=t[o],a=t[n],s;return aMath.pow(t,r)}function Ede(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),r=>Math.log(r)/t)}function tC(t){return(r,o)=>-t(-r,o)}function s2(t){const r=t(JP,eC),o=r.domain;let n=10,i,a;function s(){return i=Ede(n),a=Sde(n),o()[0]<0?(i=tC(i),a=tC(a),t(wde,_de)):t(JP,eC),r}return r.base=function(l){return arguments.length?(n=+l,s()):n},r.domain=function(l){return arguments.length?(o(l),s()):o()},r.ticks=l=>{const u=o();let c=u[0],h=u[u.length-1];const f=h0){for(;d<=m;++d)for(y=1;yh)break;b.push(p)}}else for(;d<=m;++d)for(y=n-1;y>=1;--y)if(p=d>0?y/a(-d):y*a(d),!(ph)break;b.push(p)}b.length*2{if(l==null&&(l=10),u==null&&(u=n===10?"s":","),typeof u!="function"&&(!(n%1)&&(u=Ah(u)).precision==null&&(u.trim=!0),u=a2(u)),l===1/0)return u;const c=Math.max(1,n*l/r.ticks().length);return h=>{let f=h/a(Math.round(i(h)));return f*no(nD(o(),{floor:l=>a(Math.floor(i(l))),ceil:l=>a(Math.ceil(i(l)))})),r}function oD(){const t=s2(d0()).domain([1,10]);return t.copy=()=>Cp(t,oD()).base(t.base()),ti.apply(t,arguments),t}function rC(t){return function(r){return Math.sign(r)*Math.log1p(Math.abs(r/t))}}function nC(t){return function(r){return Math.sign(r)*Math.expm1(Math.abs(r))*t}}function l2(t){var r=1,o=t(rC(r),nC(r));return o.constant=function(n){return arguments.length?t(rC(r=+n),nC(r)):r},Ys(o)}function iD(){var t=l2(d0());return t.copy=function(){return Cp(t,iD()).constant(t.constant())},ti.apply(t,arguments)}function oC(t){return function(r){return r<0?-Math.pow(-r,t):Math.pow(r,t)}}function Tde(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function Ode(t){return t<0?-t*t:t*t}function u2(t){var r=t(Jn,Jn),o=1;function n(){return o===1?t(Jn,Jn):o===.5?t(Tde,Ode):t(oC(o),oC(1/o))}return r.exponent=function(i){return arguments.length?(o=+i,n()):o},Ys(r)}function c2(){var t=u2(d0());return t.copy=function(){return Cp(t,c2()).exponent(t.exponent())},ti.apply(t,arguments),t}function kde(){return c2.apply(null,arguments).exponent(.5)}function iC(t){return Math.sign(t)*t*t}function Pde(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function aD(){var t=o2(),r=[0,1],o=!1,n;function i(a){var s=Pde(t(a));return isNaN(s)?n:o?Math.round(s):s}return i.invert=function(a){return t.invert(iC(a))},i.domain=function(a){return arguments.length?(t.domain(a),i):t.domain()},i.range=function(a){return arguments.length?(t.range((r=Array.from(a,yg)).map(iC)),i):r.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(o=!!a,i):o},i.clamp=function(a){return arguments.length?(t.clamp(a),i):t.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return aD(t.domain(),r).round(o).clamp(t.clamp()).unknown(n)},ti.apply(i,arguments),Ys(i)}function sD(){var t=[],r=[],o=[],n;function i(){var s=0,l=Math.max(1,r.length);for(o=new Array(l-1);++s0?o[l-1]:t[0],l=o?[n[o-1],r]:[n[c-1],n[c]]},s.unknown=function(u){return arguments.length&&(a=u),s},s.thresholds=function(){return n.slice()},s.copy=function(){return lD().domain([t,r]).range(i).unknown(a)},ti.apply(Ys(s),arguments)}function uD(){var t=[.5],r=[0,1],o,n=1;function i(a){return a!=null&&a<=a?r[kp(t,a,0,n)]:o}return i.domain=function(a){return arguments.length?(t=Array.from(a),n=Math.min(t.length,r.length-1),i):t.slice()},i.range=function(a){return arguments.length?(r=Array.from(a),n=Math.min(t.length,r.length-1),i):r.slice()},i.invertExtent=function(a){var s=r.indexOf(a);return[t[s-1],t[s]]},i.unknown=function(a){return arguments.length?(o=a,i):o},i.copy=function(){return uD().domain(t).range(r).unknown(o)},ti.apply(i,arguments)}const a1=new Date,s1=new Date;function sn(t,r,o,n){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)),r(a,1),t(a),a),i.round=a=>{const s=i(a),l=i.ceil(a);return a-s(r(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,l)=>{const u=[];if(a=i.ceil(a),l=l==null?1:Math.floor(l),!(a0))return u;let c;do u.push(c=new Date(+a)),r(a,l),t(a);while(csn(s=>{if(s>=s)for(;t(s),!a(s);)s.setTime(s-1)},(s,l)=>{if(s>=s)if(l<0)for(;++l<=0;)for(;r(s,-1),!a(s););else for(;--l>=0;)for(;r(s,1),!a(s););}),o&&(i.count=(a,s)=>(a1.setTime(+a),s1.setTime(+s),t(a1),t(s1),Math.floor(o(a1,s1))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?s=>n(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const bg=sn(()=>{},(t,r)=>{t.setTime(+t+r)},(t,r)=>r-t);bg.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?sn(r=>{r.setTime(Math.floor(r/t)*t)},(r,o)=>{r.setTime(+r+o*t)},(r,o)=>(o-r)/t):bg);bg.range;const ga=1e3,qo=ga*60,va=qo*60,Ra=va*24,d2=Ra*7,aC=Ra*30,l1=Ra*365,vl=sn(t=>{t.setTime(t-t.getMilliseconds())},(t,r)=>{t.setTime(+t+r*ga)},(t,r)=>(r-t)/ga,t=>t.getUTCSeconds());vl.range;const f2=sn(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*ga)},(t,r)=>{t.setTime(+t+r*qo)},(t,r)=>(r-t)/qo,t=>t.getMinutes());f2.range;const h2=sn(t=>{t.setUTCSeconds(0,0)},(t,r)=>{t.setTime(+t+r*qo)},(t,r)=>(r-t)/qo,t=>t.getUTCMinutes());h2.range;const p2=sn(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*ga-t.getMinutes()*qo)},(t,r)=>{t.setTime(+t+r*va)},(t,r)=>(r-t)/va,t=>t.getHours());p2.range;const m2=sn(t=>{t.setUTCMinutes(0,0,0)},(t,r)=>{t.setTime(+t+r*va)},(t,r)=>(r-t)/va,t=>t.getUTCHours());m2.range;const Ap=sn(t=>t.setHours(0,0,0,0),(t,r)=>t.setDate(t.getDate()+r),(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*qo)/Ra,t=>t.getDate()-1);Ap.range;const f0=sn(t=>{t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r)},(t,r)=>(r-t)/Ra,t=>t.getUTCDate()-1);f0.range;const cD=sn(t=>{t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r)},(t,r)=>(r-t)/Ra,t=>Math.floor(t/Ra));cD.range;function nu(t){return sn(r=>{r.setDate(r.getDate()-(r.getDay()+7-t)%7),r.setHours(0,0,0,0)},(r,o)=>{r.setDate(r.getDate()+o*7)},(r,o)=>(o-r-(o.getTimezoneOffset()-r.getTimezoneOffset())*qo)/d2)}const h0=nu(0),xg=nu(1),Cde=nu(2),Ade=nu(3),Lc=nu(4),Mde=nu(5),Rde=nu(6);h0.range;xg.range;Cde.range;Ade.range;Lc.range;Mde.range;Rde.range;function ou(t){return sn(r=>{r.setUTCDate(r.getUTCDate()-(r.getUTCDay()+7-t)%7),r.setUTCHours(0,0,0,0)},(r,o)=>{r.setUTCDate(r.getUTCDate()+o*7)},(r,o)=>(o-r)/d2)}const p0=ou(0),wg=ou(1),Ide=ou(2),Nde=ou(3),Dc=ou(4),Lde=ou(5),Dde=ou(6);p0.range;wg.range;Ide.range;Nde.range;Dc.range;Lde.range;Dde.range;const y2=sn(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,r)=>{t.setMonth(t.getMonth()+r)},(t,r)=>r.getMonth()-t.getMonth()+(r.getFullYear()-t.getFullYear())*12,t=>t.getMonth());y2.range;const g2=sn(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCMonth(t.getUTCMonth()+r)},(t,r)=>r.getUTCMonth()-t.getUTCMonth()+(r.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());g2.range;const Ia=sn(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r)},(t,r)=>r.getFullYear()-t.getFullYear(),t=>t.getFullYear());Ia.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:sn(r=>{r.setFullYear(Math.floor(r.getFullYear()/t)*t),r.setMonth(0,1),r.setHours(0,0,0,0)},(r,o)=>{r.setFullYear(r.getFullYear()+o*t)});Ia.range;const Na=sn(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r)},(t,r)=>r.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());Na.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:sn(r=>{r.setUTCFullYear(Math.floor(r.getUTCFullYear()/t)*t),r.setUTCMonth(0,1),r.setUTCHours(0,0,0,0)},(r,o)=>{r.setUTCFullYear(r.getUTCFullYear()+o*t)});Na.range;function dD(t,r,o,n,i,a){const s=[[vl,1,ga],[vl,5,5*ga],[vl,15,15*ga],[vl,30,30*ga],[a,1,qo],[a,5,5*qo],[a,15,15*qo],[a,30,30*qo],[i,1,va],[i,3,3*va],[i,6,6*va],[i,12,12*va],[n,1,Ra],[n,2,2*Ra],[o,1,d2],[r,1,aC],[r,3,3*aC],[t,1,l1]];function l(c,h,f){const d=hg).right(s,d);if(m===s.length)return t.every(qw(c/l1,h/l1,f));if(m===0)return bg.every(Math.max(qw(c,h,f),1));const[y,p]=s[d/s[m-1][2]53)return null;"w"in te||(te.w=1),"Z"in te?(ne=c1(Kd(te.y,0,1)),fe=ne.getUTCDay(),ne=fe>4||fe===0?wg.ceil(ne):wg(ne),ne=f0.offset(ne,(te.V-1)*7),te.y=ne.getUTCFullYear(),te.m=ne.getUTCMonth(),te.d=ne.getUTCDate()+(te.w+6)%7):(ne=u1(Kd(te.y,0,1)),fe=ne.getDay(),ne=fe>4||fe===0?xg.ceil(ne):xg(ne),ne=Ap.offset(ne,(te.V-1)*7),te.y=ne.getFullYear(),te.m=ne.getMonth(),te.d=ne.getDate()+(te.w+6)%7)}else("W"in te||"U"in te)&&("w"in te||(te.w="u"in te?te.u%7:"W"in te?1:0),fe="Z"in te?c1(Kd(te.y,0,1)).getUTCDay():u1(Kd(te.y,0,1)).getDay(),te.m=0,te.d="W"in te?(te.w+6)%7+te.W*7-(fe+5)%7:te.w+te.U*7-(fe+6)%7);return"Z"in te?(te.H+=te.Z/100|0,te.M+=te.Z%100,c1(te)):u1(te)}}function T(ce,he,ae,te){for(var pe=0,ne=he.length,fe=ae.length,be,Ee;pe=fe)return-1;if(be=he.charCodeAt(pe++),be===37){if(be=he.charAt(pe++),Ee=_[be in sC?he.charAt(pe++):be],!Ee||(te=Ee(ce,ae,te))<0)return-1}else if(be!=ae.charCodeAt(te++))return-1}return te}function k(ce,he,ae){var te=c.exec(he.slice(ae));return te?(ce.p=h.get(te[0].toLowerCase()),ae+te[0].length):-1}function A(ce,he,ae){var te=m.exec(he.slice(ae));return te?(ce.w=y.get(te[0].toLowerCase()),ae+te[0].length):-1}function O(ce,he,ae){var te=f.exec(he.slice(ae));return te?(ce.w=d.get(te[0].toLowerCase()),ae+te[0].length):-1}function R(ce,he,ae){var te=b.exec(he.slice(ae));return te?(ce.m=x.get(te[0].toLowerCase()),ae+te[0].length):-1}function C(ce,he,ae){var te=p.exec(he.slice(ae));return te?(ce.m=g.get(te[0].toLowerCase()),ae+te[0].length):-1}function L(ce,he,ae){return T(ce,r,he,ae)}function F(ce,he,ae){return T(ce,o,he,ae)}function z(ce,he,ae){return T(ce,n,he,ae)}function W(ce){return s[ce.getDay()]}function $(ce){return a[ce.getDay()]}function G(ce){return u[ce.getMonth()]}function K(ce){return l[ce.getMonth()]}function Z(ce){return i[+(ce.getHours()>=12)]}function U(ce){return 1+~~(ce.getMonth()/3)}function I(ce){return s[ce.getUTCDay()]}function B(ce){return a[ce.getUTCDay()]}function H(ce){return u[ce.getUTCMonth()]}function Y(ce){return l[ce.getUTCMonth()]}function ee(ce){return i[+(ce.getUTCHours()>=12)]}function oe(ce){return 1+~~(ce.getUTCMonth()/3)}return{format:function(ce){var he=E(ce+="",v);return he.toString=function(){return ce},he},parse:function(ce){var he=S(ce+="",!1);return he.toString=function(){return ce},he},utcFormat:function(ce){var he=E(ce+="",w);return he.toString=function(){return ce},he},utcParse:function(ce){var he=S(ce+="",!0);return he.toString=function(){return ce},he}}}var sC={"-":"",_:" ",0:"0"},vn=/^\s*\d+/,Vde=/^%/,Gde=/[\\^$*+?|[\]().{}]/g;function Yt(t,r,o){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a[r.toLowerCase(),o]))}function Hde(t,r,o){var n=vn.exec(r.slice(o,o+1));return n?(t.w=+n[0],o+n[0].length):-1}function qde(t,r,o){var n=vn.exec(r.slice(o,o+1));return n?(t.u=+n[0],o+n[0].length):-1}function Xde(t,r,o){var n=vn.exec(r.slice(o,o+2));return n?(t.U=+n[0],o+n[0].length):-1}function Yde(t,r,o){var n=vn.exec(r.slice(o,o+2));return n?(t.V=+n[0],o+n[0].length):-1}function Kde(t,r,o){var n=vn.exec(r.slice(o,o+2));return n?(t.W=+n[0],o+n[0].length):-1}function lC(t,r,o){var n=vn.exec(r.slice(o,o+4));return n?(t.y=+n[0],o+n[0].length):-1}function uC(t,r,o){var n=vn.exec(r.slice(o,o+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),o+n[0].length):-1}function Zde(t,r,o){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(r.slice(o,o+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),o+n[0].length):-1}function Qde(t,r,o){var n=vn.exec(r.slice(o,o+1));return n?(t.q=n[0]*3-3,o+n[0].length):-1}function Jde(t,r,o){var n=vn.exec(r.slice(o,o+2));return n?(t.m=n[0]-1,o+n[0].length):-1}function cC(t,r,o){var n=vn.exec(r.slice(o,o+2));return n?(t.d=+n[0],o+n[0].length):-1}function efe(t,r,o){var n=vn.exec(r.slice(o,o+3));return n?(t.m=0,t.d=+n[0],o+n[0].length):-1}function dC(t,r,o){var n=vn.exec(r.slice(o,o+2));return n?(t.H=+n[0],o+n[0].length):-1}function tfe(t,r,o){var n=vn.exec(r.slice(o,o+2));return n?(t.M=+n[0],o+n[0].length):-1}function rfe(t,r,o){var n=vn.exec(r.slice(o,o+2));return n?(t.S=+n[0],o+n[0].length):-1}function nfe(t,r,o){var n=vn.exec(r.slice(o,o+3));return n?(t.L=+n[0],o+n[0].length):-1}function ofe(t,r,o){var n=vn.exec(r.slice(o,o+6));return n?(t.L=Math.floor(n[0]/1e3),o+n[0].length):-1}function ife(t,r,o){var n=Vde.exec(r.slice(o,o+1));return n?o+n[0].length:-1}function afe(t,r,o){var n=vn.exec(r.slice(o));return n?(t.Q=+n[0],o+n[0].length):-1}function sfe(t,r,o){var n=vn.exec(r.slice(o));return n?(t.s=+n[0],o+n[0].length):-1}function fC(t,r){return Yt(t.getDate(),r,2)}function lfe(t,r){return Yt(t.getHours(),r,2)}function ufe(t,r){return Yt(t.getHours()%12||12,r,2)}function cfe(t,r){return Yt(1+Ap.count(Ia(t),t),r,3)}function fD(t,r){return Yt(t.getMilliseconds(),r,3)}function dfe(t,r){return fD(t,r)+"000"}function ffe(t,r){return Yt(t.getMonth()+1,r,2)}function hfe(t,r){return Yt(t.getMinutes(),r,2)}function pfe(t,r){return Yt(t.getSeconds(),r,2)}function mfe(t){var r=t.getDay();return r===0?7:r}function yfe(t,r){return Yt(h0.count(Ia(t)-1,t),r,2)}function hD(t){var r=t.getDay();return r>=4||r===0?Lc(t):Lc.ceil(t)}function gfe(t,r){return t=hD(t),Yt(Lc.count(Ia(t),t)+(Ia(t).getDay()===4),r,2)}function vfe(t){return t.getDay()}function bfe(t,r){return Yt(xg.count(Ia(t)-1,t),r,2)}function xfe(t,r){return Yt(t.getFullYear()%100,r,2)}function wfe(t,r){return t=hD(t),Yt(t.getFullYear()%100,r,2)}function _fe(t,r){return Yt(t.getFullYear()%1e4,r,4)}function jfe(t,r){var o=t.getDay();return t=o>=4||o===0?Lc(t):Lc.ceil(t),Yt(t.getFullYear()%1e4,r,4)}function Sfe(t){var r=t.getTimezoneOffset();return(r>0?"-":(r*=-1,"+"))+Yt(r/60|0,"0",2)+Yt(r%60,"0",2)}function hC(t,r){return Yt(t.getUTCDate(),r,2)}function Efe(t,r){return Yt(t.getUTCHours(),r,2)}function Tfe(t,r){return Yt(t.getUTCHours()%12||12,r,2)}function Ofe(t,r){return Yt(1+f0.count(Na(t),t),r,3)}function pD(t,r){return Yt(t.getUTCMilliseconds(),r,3)}function kfe(t,r){return pD(t,r)+"000"}function Pfe(t,r){return Yt(t.getUTCMonth()+1,r,2)}function Cfe(t,r){return Yt(t.getUTCMinutes(),r,2)}function Afe(t,r){return Yt(t.getUTCSeconds(),r,2)}function Mfe(t){var r=t.getUTCDay();return r===0?7:r}function Rfe(t,r){return Yt(p0.count(Na(t)-1,t),r,2)}function mD(t){var r=t.getUTCDay();return r>=4||r===0?Dc(t):Dc.ceil(t)}function Ife(t,r){return t=mD(t),Yt(Dc.count(Na(t),t)+(Na(t).getUTCDay()===4),r,2)}function Nfe(t){return t.getUTCDay()}function Lfe(t,r){return Yt(wg.count(Na(t)-1,t),r,2)}function Dfe(t,r){return Yt(t.getUTCFullYear()%100,r,2)}function Ffe(t,r){return t=mD(t),Yt(t.getUTCFullYear()%100,r,2)}function $fe(t,r){return Yt(t.getUTCFullYear()%1e4,r,4)}function Ufe(t,r){var o=t.getUTCDay();return t=o>=4||o===0?Dc(t):Dc.ceil(t),Yt(t.getUTCFullYear()%1e4,r,4)}function Bfe(){return"+0000"}function pC(){return"%"}function mC(t){return+t}function yC(t){return Math.floor(+t/1e3)}var bu,yD,gD;zfe({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","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 zfe(t){return bu=zde(t),yD=bu.format,bu.parse,gD=bu.utcFormat,bu.utcParse,bu}function Vfe(t){return new Date(t)}function Gfe(t){return t instanceof Date?+t:+new Date(+t)}function v2(t,r,o,n,i,a,s,l,u,c){var h=o2(),f=h.invert,d=h.domain,m=c(".%L"),y=c(":%S"),p=c("%I:%M"),g=c("%I %p"),b=c("%a %d"),x=c("%b %d"),v=c("%B"),w=c("%Y");function _(E){return(u(E)r(i/(t.length-1)))},o.quantiles=function(n){return Array.from({length:n+1},(i,a)=>Rce(t,a/n))},o.copy=function(){return wD(r).domain(t)},za.apply(o,arguments)}function y0(){var t=0,r=.5,o=1,n=1,i,a,s,l,u,c=Jn,h,f=!1,d;function m(p){return isNaN(p=+p)?d:(p=.5+((p=+h(p))-a)*(n*pr}var ED=Zfe,Qfe=g0,Jfe=ED,ehe=vd;function the(t){return t&&t.length?Qfe(t,ehe,Jfe):void 0}var rhe=the;const v0=Kt(rhe);function nhe(t,r){return tt.e^a.s<0?1:-1;for(n=a.d.length,i=t.d.length,r=0,o=nt.d[r]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};ct.decimalPlaces=ct.dp=function(){var t=this,r=t.d.length-1,o=(r-t.e)*Er;if(r=t.d[r],r)for(;r%10==0;r/=10)o--;return o<0?0:o};ct.dividedBy=ct.div=function(t){return Sa(this,new this.constructor(t))};ct.dividedToIntegerBy=ct.idiv=function(t){var r=this,o=r.constructor;return dr(Sa(r,new o(t),0,1),o.precision)};ct.equals=ct.eq=function(t){return!this.cmp(t)};ct.exponent=function(){return Jr(this)};ct.greaterThan=ct.gt=function(t){return this.cmp(t)>0};ct.greaterThanOrEqualTo=ct.gte=function(t){return this.cmp(t)>=0};ct.isInteger=ct.isint=function(){return this.e>this.d.length-2};ct.isNegative=ct.isneg=function(){return this.s<0};ct.isPositive=ct.ispos=function(){return this.s>0};ct.isZero=function(){return this.s===0};ct.lessThan=ct.lt=function(t){return this.cmp(t)<0};ct.lessThanOrEqualTo=ct.lte=function(t){return this.cmp(t)<1};ct.logarithm=ct.log=function(t){var r,o=this,n=o.constructor,i=n.precision,a=i+5;if(t===void 0)t=new n(10);else if(t=new n(t),t.s<1||t.eq(Oo))throw Error(Jo+"NaN");if(o.s<1)throw Error(Jo+(o.s?"NaN":"-Infinity"));return o.eq(Oo)?new n(0):(Cr=!1,r=Sa(Mh(o,a),Mh(t,a),a),Cr=!0,dr(r,i))};ct.minus=ct.sub=function(t){var r=this;return t=new r.constructor(t),r.s==t.s?CD(r,t):kD(r,(t.s=-t.s,t))};ct.modulo=ct.mod=function(t){var r,o=this,n=o.constructor,i=n.precision;if(t=new n(t),!t.s)throw Error(Jo+"NaN");return o.s?(Cr=!1,r=Sa(o,t,0,1).times(t),Cr=!0,o.minus(r)):dr(new n(o),i)};ct.naturalExponential=ct.exp=function(){return PD(this)};ct.naturalLogarithm=ct.ln=function(){return Mh(this)};ct.negated=ct.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};ct.plus=ct.add=function(t){var r=this;return t=new r.constructor(t),r.s==t.s?kD(r,t):CD(r,(t.s=-t.s,t))};ct.precision=ct.sd=function(t){var r,o,n,i=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(Al+t);if(r=Jr(i)+1,n=i.d.length-1,o=n*Er+1,n=i.d[n],n){for(;n%10==0;n/=10)o--;for(n=i.d[0];n>=10;n/=10)o++}return t&&r>o?r:o};ct.squareRoot=ct.sqrt=function(){var t,r,o,n,i,a,s,l=this,u=l.constructor;if(l.s<1){if(!l.s)return new u(0);throw Error(Jo+"NaN")}for(t=Jr(l),Cr=!1,i=Math.sqrt(+l),i==0||i==1/0?(r=Bi(l.d),(r.length+t)%2==0&&(r+="0"),i=Math.sqrt(r),t=wd((t+1)/2)-(t<0||t%2),i==1/0?r="5e"+t:(r=i.toExponential(),r=r.slice(0,r.indexOf("e")+1)+t),n=new u(r)):n=new u(i.toString()),o=u.precision,i=s=o+3;;)if(a=n,n=a.plus(Sa(l,a,s+2)).times(.5),Bi(a.d).slice(0,s)===(r=Bi(n.d)).slice(0,s)){if(r=r.slice(s-3,s+1),i==s&&r=="4999"){if(dr(a,o+1,0),a.times(a).eq(l)){n=a;break}}else if(r!="9999")break;s+=4}return Cr=!0,dr(n,o)};ct.times=ct.mul=function(t){var r,o,n,i,a,s,l,u,c,h=this,f=h.constructor,d=h.d,m=(t=new f(t)).d;if(!h.s||!t.s)return new f(0);for(t.s*=h.s,o=h.e+t.e,u=d.length,c=m.length,u=0;){for(r=0,i=u+n;i>n;)l=a[i]+m[n]*d[i-n-1]+r,a[i--]=l%pn|0,r=l/pn|0;a[i]=(a[i]+r)%pn|0}for(;!a[--s];)a.pop();return r?++o:a.shift(),t.d=a,t.e=o,Cr?dr(t,f.precision):t};ct.toDecimalPlaces=ct.todp=function(t,r){var o=this,n=o.constructor;return o=new n(o),t===void 0?o:(Yi(t,0,xd),r===void 0?r=n.rounding:Yi(r,0,8),dr(o,t+Jr(o)+1,r))};ct.toExponential=function(t,r){var o,n=this,i=n.constructor;return t===void 0?o=ql(n,!0):(Yi(t,0,xd),r===void 0?r=i.rounding:Yi(r,0,8),n=dr(new i(n),t+1,r),o=ql(n,!0,t+1)),o};ct.toFixed=function(t,r){var o,n,i=this,a=i.constructor;return t===void 0?ql(i):(Yi(t,0,xd),r===void 0?r=a.rounding:Yi(r,0,8),n=dr(new a(i),t+Jr(i)+1,r),o=ql(n.abs(),!1,t+Jr(n)+1),i.isneg()&&!i.isZero()?"-"+o:o)};ct.toInteger=ct.toint=function(){var t=this,r=t.constructor;return dr(new r(t),Jr(t)+1,r.rounding)};ct.toNumber=function(){return+this};ct.toPower=ct.pow=function(t){var r,o,n,i,a,s,l=this,u=l.constructor,c=12,h=+(t=new u(t));if(!t.s)return new u(Oo);if(l=new u(l),!l.s){if(t.s<1)throw Error(Jo+"Infinity");return l}if(l.eq(Oo))return l;if(n=u.precision,t.eq(Oo))return dr(l,n);if(r=t.e,o=t.d.length-1,s=r>=o,a=l.s,s){if((o=h<0?-h:h)<=OD){for(i=new u(Oo),r=Math.ceil(n/Er+4),Cr=!1;o%2&&(i=i.times(l),bC(i.d,r)),o=wd(o/2),o!==0;)l=l.times(l),bC(l.d,r);return Cr=!0,t.s<0?new u(Oo).div(i):dr(i,n)}}else if(a<0)throw Error(Jo+"NaN");return a=a<0&&t.d[Math.max(r,o)]&1?-1:1,l.s=1,Cr=!1,i=t.times(Mh(l,n+c)),Cr=!0,i=PD(i),i.s=a,i};ct.toPrecision=function(t,r){var o,n,i=this,a=i.constructor;return t===void 0?(o=Jr(i),n=ql(i,o<=a.toExpNeg||o>=a.toExpPos)):(Yi(t,1,xd),r===void 0?r=a.rounding:Yi(r,0,8),i=dr(new a(i),t,r),o=Jr(i),n=ql(i,t<=o||o<=a.toExpNeg,t)),n};ct.toSignificantDigits=ct.tosd=function(t,r){var o=this,n=o.constructor;return t===void 0?(t=n.precision,r=n.rounding):(Yi(t,1,xd),r===void 0?r=n.rounding:Yi(r,0,8)),dr(new n(o),t,r)};ct.toString=ct.valueOf=ct.val=ct.toJSON=ct[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,r=Jr(t),o=t.constructor;return ql(t,r<=o.toExpNeg||r>=o.toExpPos)};function kD(t,r){var o,n,i,a,s,l,u,c,h=t.constructor,f=h.precision;if(!t.s||!r.s)return r.s||(r=new h(t)),Cr?dr(r,f):r;if(u=t.d,c=r.d,s=t.e,i=r.e,u=u.slice(),a=s-i,a){for(a<0?(n=u,a=-a,l=c.length):(n=c,i=s,l=u.length),s=Math.ceil(f/Er),l=s>l?s+1:l+1,a>l&&(a=l,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(l=u.length,a=c.length,l-a<0&&(a=l,n=c,c=u,u=n),o=0;a;)o=(u[--a]=u[a]+c[a]+o)/pn|0,u[a]%=pn;for(o&&(u.unshift(o),++i),l=u.length;u[--l]==0;)u.pop();return r.d=u,r.e=i,Cr?dr(r,f):r}function Yi(t,r,o){if(t!==~~t||to)throw Error(Al+t)}function Bi(t){var r,o,n,i=t.length-1,a="",s=t[0];if(i>0){for(a+=s,r=1;rs?1:-1;else for(l=u=0;li[l]?1:-1;break}return u}function o(n,i,a){for(var s=0;a--;)n[a]-=s,s=n[a]1;)n.shift()}return function(n,i,a,s){var l,u,c,h,f,d,m,y,p,g,b,x,v,w,_,E,S,T,k=n.constructor,A=n.s==i.s?1:-1,O=n.d,R=i.d;if(!n.s)return new k(n);if(!i.s)throw Error(Jo+"Division by zero");for(u=n.e-i.e,S=R.length,_=O.length,m=new k(A),y=m.d=[],c=0;R[c]==(O[c]||0);)++c;if(R[c]>(O[c]||0)&&--u,a==null?x=a=k.precision:s?x=a+(Jr(n)-Jr(i))+1:x=a,x<0)return new k(0);if(x=x/Er+2|0,c=0,S==1)for(h=0,R=R[0],x++;(c<_||h)&&x--;c++)v=h*pn+(O[c]||0),y[c]=v/R|0,h=v%R|0;else{for(h=pn/(R[0]+1)|0,h>1&&(R=t(R,h),O=t(O,h),S=R.length,_=O.length),w=S,p=O.slice(0,S),g=p.length;g=pn/2&&++E;do h=0,l=r(R,p,S,g),l<0?(b=p[0],S!=g&&(b=b*pn+(p[1]||0)),h=b/E|0,h>1?(h>=pn&&(h=pn-1),f=t(R,h),d=f.length,g=p.length,l=r(f,p,d,g),l==1&&(h--,o(f,S16)throw Error(w2+Jr(t));if(!t.s)return new h(Oo);for(r==null?(Cr=!1,l=f):l=r,s=new h(.03125);t.abs().gte(.1);)t=t.times(s),c+=5;for(n=Math.log(ll(2,c))/Math.LN10*2+5|0,l+=n,o=i=a=new h(Oo),h.precision=l;;){if(i=dr(i.times(t),l),o=o.times(++u),s=a.plus(Sa(i,o,l)),Bi(s.d).slice(0,l)===Bi(a.d).slice(0,l)){for(;c--;)a=dr(a.times(a),l);return h.precision=f,r==null?(Cr=!0,dr(a,f)):a}a=s}}function Jr(t){for(var r=t.e*Er,o=t.d[0];o>=10;o/=10)r++;return r}function d1(t,r,o){if(r>t.LN10.sd())throw Cr=!0,o&&(t.precision=o),Error(Jo+"LN10 precision limit exceeded");return dr(new t(t.LN10),r)}function is(t){for(var r="";t--;)r+="0";return r}function Mh(t,r){var o,n,i,a,s,l,u,c,h,f=1,d=10,m=t,y=m.d,p=m.constructor,g=p.precision;if(m.s<1)throw Error(Jo+(m.s?"NaN":"-Infinity"));if(m.eq(Oo))return new p(0);if(r==null?(Cr=!1,c=g):c=r,m.eq(10))return r==null&&(Cr=!0),d1(p,c);if(c+=d,p.precision=c,o=Bi(y),n=o.charAt(0),a=Jr(m),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&o.charAt(1)>3;)m=m.times(t),o=Bi(m.d),n=o.charAt(0),f++;a=Jr(m),n>1?(m=new p("0."+o),a++):m=new p(n+"."+o.slice(1))}else return u=d1(p,c+2,g).times(a+""),m=Mh(new p(n+"."+o.slice(1)),c-d).plus(u),p.precision=g,r==null?(Cr=!0,dr(m,g)):m;for(l=s=m=Sa(m.minus(Oo),m.plus(Oo),c),h=dr(m.times(m),c),i=3;;){if(s=dr(s.times(h),c),u=l.plus(Sa(s,new p(i),c)),Bi(u.d).slice(0,c)===Bi(l.d).slice(0,c))return l=l.times(2),a!==0&&(l=l.plus(d1(p,c+2,g).times(a+""))),l=Sa(l,new p(f),c),p.precision=g,r==null?(Cr=!0,dr(l,g)):l;l=u,i+=2}}function vC(t,r){var o,n,i;for((o=r.indexOf("."))>-1&&(r=r.replace(".","")),(n=r.search(/e/i))>0?(o<0&&(o=n),o+=+r.slice(n+1),r=r.substring(0,n)):o<0&&(o=r.length),n=0;r.charCodeAt(n)===48;)++n;for(i=r.length;r.charCodeAt(i-1)===48;)--i;if(r=r.slice(n,i),r){if(i-=n,o=o-n-1,t.e=wd(o/Er),t.d=[],n=(o+1)%Er,o<0&&(n+=Er),n_g||t.e<-_g))throw Error(w2+o)}else t.s=0,t.e=0,t.d=[0];return t}function dr(t,r,o){var n,i,a,s,l,u,c,h,f=t.d;for(s=1,a=f[0];a>=10;a/=10)s++;if(n=r-s,n<0)n+=Er,i=r,c=f[h=0];else{if(h=Math.ceil((n+1)/Er),a=f.length,h>=a)return t;for(c=a=f[h],s=1;a>=10;a/=10)s++;n%=Er,i=n-Er+s}if(o!==void 0&&(a=ll(10,s-i-1),l=c/a%10|0,u=r<0||f[h+1]!==void 0||c%a,u=o<4?(l||u)&&(o==0||o==(t.s<0?3:2)):l>5||l==5&&(o==4||u||o==6&&(n>0?i>0?c/ll(10,s-i):0:f[h-1])%10&1||o==(t.s<0?8:7))),r<1||!f[0])return u?(a=Jr(t),f.length=1,r=r-a-1,f[0]=ll(10,(Er-r%Er)%Er),t.e=wd(-r/Er)||0):(f.length=1,f[0]=t.e=t.s=0),t;if(n==0?(f.length=h,a=1,h--):(f.length=h+1,a=ll(10,Er-n),f[h]=i>0?(c/ll(10,s-i)%ll(10,i)|0)*a:0),u)for(;;)if(h==0){(f[0]+=a)==pn&&(f[0]=1,++t.e);break}else{if(f[h]+=a,f[h]!=pn)break;f[h--]=0,a=1}for(n=f.length;f[--n]===0;)f.pop();if(Cr&&(t.e>_g||t.e<-_g))throw Error(w2+Jr(t));return t}function CD(t,r){var o,n,i,a,s,l,u,c,h,f,d=t.constructor,m=d.precision;if(!t.s||!r.s)return r.s?r.s=-r.s:r=new d(t),Cr?dr(r,m):r;if(u=t.d,f=r.d,n=r.e,c=t.e,u=u.slice(),s=c-n,s){for(h=s<0,h?(o=u,s=-s,l=f.length):(o=f,n=c,l=u.length),i=Math.max(Math.ceil(m/Er),l)+2,s>i&&(s=i,o.length=1),o.reverse(),i=s;i--;)o.push(0);o.reverse()}else{for(i=u.length,l=f.length,h=i0;--i)u[l++]=0;for(i=f.length;i>s;){if(u[--i]0?a=a.charAt(0)+"."+a.slice(1)+is(n):s>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+is(-i-1)+a,o&&(n=o-s)>0&&(a+=is(n))):i>=s?(a+=is(i+1-s),o&&(n=o-i-1)>0&&(a=a+"."+is(n))):((n=i+1)0&&(i+1===s&&(a+="."),a+=is(n))),t.s<0?"-"+a:a}function bC(t,r){if(t.length>r)return t.length=r,!0}function AD(t){var r,o,n;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(Al+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 vC(s,a.toString())}else if(typeof a!="string")throw Error(Al+a);if(a.charCodeAt(0)===45?(a=a.slice(1),s.s=-1):s.s=1,She.test(a))vC(s,a);else throw Error(Al+a)}if(i.prototype=ct,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=AD,i.config=i.set=Ehe,t===void 0&&(t={}),t)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],r=0;r=i[r+1]&&n<=i[r+2])this[o]=n;else throw Error(Al+o+": "+n);if((n=t[o="LN10"])!==void 0)if(n==Math.LN10)this[o]=new this(n);else throw Error(Al+o+": "+n);return this}var _2=AD(jhe);Oo=new _2(1);const lr=_2;function The(t){return Che(t)||Phe(t)||khe(t)||Ohe()}function Ohe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function khe(t,r){if(t){if(typeof t=="string")return Qw(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);if(o==="Object"&&t.constructor&&(o=t.constructor.name),o==="Map"||o==="Set")return Array.from(t);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return Qw(t,r)}}function Phe(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function Che(t){if(Array.isArray(t))return Qw(t)}function Qw(t,r){(r==null||r>t.length)&&(r=t.length);for(var o=0,n=new Array(r);o=r?o.apply(void 0,i):t(r-s,xC(function(){for(var l=arguments.length,u=new Array(l),c=0;ct.length)&&(r=t.length);for(var o=0,n=new Array(r);o"u"||!(Symbol.iterator in Object(t)))){var o=[],n=!0,i=!1,a=void 0;try{for(var s=t[Symbol.iterator](),l;!(n=(l=s.next()).done)&&(o.push(l.value),!(r&&o.length===r));n=!0);}catch(u){i=!0,a=u}finally{try{!n&&s.return!=null&&s.return()}finally{if(i)throw a}}return o}}function Whe(t){if(Array.isArray(t))return t}function LD(t){var r=Rh(t,2),o=r[0],n=r[1],i=o,a=n;return o>n&&(i=n,a=o),[i,a]}function DD(t,r,o){if(t.lte(0))return new lr(0);var n=_0.getDigitCount(t.toNumber()),i=new lr(10).pow(n),a=t.div(i),s=n!==1?.05:.1,l=new lr(Math.ceil(a.div(s).toNumber())).add(o).mul(s),u=l.mul(i);return r?u:new lr(Math.ceil(u))}function Hhe(t,r,o){var n=1,i=new lr(t);if(!i.isint()&&o){var a=Math.abs(t);a<1?(n=new lr(10).pow(_0.getDigitCount(t)-1),i=new lr(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new lr(Math.floor(t)))}else t===0?i=new lr(Math.floor((r-1)/2)):o||(i=new lr(Math.floor(t)));var s=Math.floor((r-1)/2),l=Ihe(Rhe(function(u){return i.add(new lr(u-s).mul(n)).toNumber()}),Jw);return l(0,r)}function FD(t,r,o,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((r-t)/(o-1)))return{step:new lr(0),tickMin:new lr(0),tickMax:new lr(0)};var a=DD(new lr(r).sub(t).div(o-1),n,i),s;t<=0&&r>=0?s=new lr(0):(s=new lr(t).add(r).div(2),s=s.sub(new lr(s).mod(a)));var l=Math.ceil(s.sub(t).div(a).toNumber()),u=Math.ceil(new lr(r).sub(s).div(a).toNumber()),c=l+u+1;return c>o?FD(t,r,o,n,i+1):(c0?u+(o-c):u,l=r>0?l:l+(o-c)),{step:a,tickMin:s.sub(new lr(l).mul(a)),tickMax:s.add(new lr(u).mul(a))})}function qhe(t){var r=Rh(t,2),o=r[0],n=r[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),l=LD([o,n]),u=Rh(l,2),c=u[0],h=u[1];if(c===-1/0||h===1/0){var f=h===1/0?[c].concat(t_(Jw(0,i-1).map(function(){return 1/0}))):[].concat(t_(Jw(0,i-1).map(function(){return-1/0})),[h]);return o>n?e_(f):f}if(c===h)return Hhe(c,i,a);var d=FD(c,h,s,a),m=d.step,y=d.tickMin,p=d.tickMax,g=_0.rangeStep(y,p.add(new lr(.1).mul(m)),m);return o>n?e_(g):g}function Xhe(t,r){var o=Rh(t,2),n=o[0],i=o[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=LD([n,i]),l=Rh(s,2),u=l[0],c=l[1];if(u===-1/0||c===1/0)return[n,i];if(u===c)return[u];var h=Math.max(r,2),f=DD(new lr(c).sub(u).div(h-1),a,0),d=[].concat(t_(_0.rangeStep(new lr(u),new lr(c).sub(new lr(.99).mul(f)),f)),[c]);return n>i?e_(d):d}var Yhe=ID(qhe),Khe=ID(Xhe),Zhe="Invariant failed";function Xl(t,r){throw new Error(Zhe)}var Qhe=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Fc(t){"@babel/helpers - typeof";return Fc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Fc(t)}function jg(){return jg=Object.assign?Object.assign.bind():function(t){for(var r=1;rt.length)&&(r=t.length);for(var o=0,n=new Array(r);o=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function ipe(t,r){if(t==null)return{};var o={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(r.indexOf(n)>=0)continue;o[n]=t[n]}return o}function ape(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function spe(t,r){for(var o=0;ot.length)&&(r=t.length);for(var o=0,n=new Array(r);o1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,s=-1,l=(o=n==null?void 0:n.length)!==null&&o!==void 0?o:0;if(l<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var u=a.range,c=0;c0?i[c-1].coordinate:i[l-1].coordinate,f=i[c].coordinate,d=c>=l-1?i[0].coordinate:i[c+1].coordinate,m=void 0;if(Zn(f-h)!==Zn(d-f)){var y=[];if(Zn(d-f)===Zn(u[1]-u[0])){m=d;var p=f+u[1]-u[0];y[0]=Math.min(p,(p+h)/2),y[1]=Math.max(p,(p+h)/2)}else{m=h;var g=d+u[1]-u[0];y[0]=Math.min(f,(g+f)/2),y[1]=Math.max(f,(g+f)/2)}var b=[Math.min(f,(m+f)/2),Math.max(f,(m+f)/2)];if(r>b[0]&&r<=b[1]||r>=y[0]&&r<=y[1]){s=i[c].index;break}}else{var x=Math.min(h,d),v=Math.max(h,d);if(r>(x+f)/2&&r<=(v+f)/2){s=i[c].index;break}}}else for(var w=0;w0&&w(n[w].coordinate+n[w-1].coordinate)/2&&r<=(n[w].coordinate+n[w+1].coordinate)/2||w===l-1&&r>(n[w].coordinate+n[w-1].coordinate)/2){s=n[w].index;break}return s},j2=function(r){var o,n=r,i=n.type.displayName,a=(o=r.type)!==null&&o!==void 0&&o.defaultProps?zr(zr({},r.type.defaultProps),r.props):r.props,s=a.stroke,l=a.fill,u;switch(i){case"Line":u=s;break;case"Area":case"Radar":u=s&&s!=="none"?s:l;break;default:u=l;break}return u},Spe=function(r){var o=r.barSize,n=r.totalSize,i=r.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var s={},l=Object.keys(a),u=0,c=l.length;u=0});if(b&&b.length){var x=b[0].type.defaultProps,v=x!==void 0?zr(zr({},x),b[0].props):b[0].props,w=v.barSize,_=v[g];s[_]||(s[_]=[]);var E=Dt(w)?o:w;s[_].push({item:b[0],stackList:b.slice(1),barSize:Dt(E)?void 0:Qn(E,n,0)})}}return s},Epe=function(r){var o=r.barGap,n=r.barCategoryGap,i=r.bandSize,a=r.sizeList,s=a===void 0?[]:a,l=r.maxBarSize,u=s.length;if(u<1)return null;var c=Qn(o,i,0,!0),h,f=[];if(s[0].barSize===+s[0].barSize){var d=!1,m=i/u,y=s.reduce(function(w,_){return w+_.barSize||0},0);y+=(u-1)*c,y>=i&&(y-=(u-1)*c,c=0),y>=i&&m>0&&(d=!0,m*=.9,y=u*m);var p=(i-y)/2>>0,g={offset:p-c,size:0};h=s.reduce(function(w,_){var E={item:_.item,position:{offset:g.offset+g.size+c,size:d?m:_.barSize}},S=[].concat(jC(w),[E]);return g=S[S.length-1].position,_.stackList&&_.stackList.length&&_.stackList.forEach(function(T){S.push({item:T,position:g})}),S},f)}else{var b=Qn(n,i,0,!0);i-2*b-(u-1)*c<=0&&(c=0);var x=(i-2*b-(u-1)*c)/u;x>1&&(x>>=0);var v=l===+l?Math.min(x,l):x;h=s.reduce(function(w,_,E){var S=[].concat(jC(w),[{item:_.item,position:{offset:b+(x+c)*E+(x-v)/2,size:v}}]);return _.stackList&&_.stackList.length&&_.stackList.forEach(function(T){S.push({item:T,position:S[S.length-1].position})}),S},f)}return h},Tpe=function(r,o,n,i){var a=n.children,s=n.width,l=n.margin,u=s-(l.left||0)-(l.right||0),c=zD({children:a,legendWidth:u});if(c){var h=i||{},f=h.width,d=h.height,m=c.align,y=c.verticalAlign,p=c.layout;if((p==="vertical"||p==="horizontal"&&y==="middle")&&m!=="center"&&tt(r[m]))return zr(zr({},r),{},rc({},m,r[m]+(f||0)));if((p==="horizontal"||p==="vertical"&&m==="center")&&y!=="middle"&&tt(r[y]))return zr(zr({},r),{},rc({},y,r[y]+(d||0)))}return r},Ope=function(r,o,n){return Dt(o)?!0:r==="horizontal"?o==="yAxis":r==="vertical"||n==="x"?o==="xAxis":n==="y"?o==="yAxis":!0},VD=function(r,o,n,i,a){var s=o.props.children,l=Ko(s,j0).filter(function(c){return Ope(i,a,c.props.direction)});if(l&&l.length){var u=l.map(function(c){return c.props.dataKey});return r.reduce(function(c,h){var f=$n(h,n);if(Dt(f))return c;var d=Array.isArray(f)?[b0(f),v0(f)]:[f,f],m=u.reduce(function(y,p){var g=$n(h,p,0),b=d[0]-Math.abs(Array.isArray(g)?g[0]:g),x=d[1]+Math.abs(Array.isArray(g)?g[1]:g);return[Math.min(b,y[0]),Math.max(x,y[1])]},[1/0,-1/0]);return[Math.min(m[0],c[0]),Math.max(m[1],c[1])]},[1/0,-1/0])}return null},kpe=function(r,o,n,i,a){var s=o.map(function(l){return VD(r,l,n,a,i)}).filter(function(l){return!Dt(l)});return s&&s.length?s.reduce(function(l,u){return[Math.min(l[0],u[0]),Math.max(l[1],u[1])]},[1/0,-1/0]):null},GD=function(r,o,n,i,a){var s=o.map(function(u){var c=u.props.dataKey;return n==="number"&&c&&VD(r,u,c,i)||Df(r,c,n,a)});if(n==="number")return s.reduce(function(u,c){return[Math.min(u[0],c[0]),Math.max(u[1],c[1])]},[1/0,-1/0]);var l={};return s.reduce(function(u,c){for(var h=0,f=c.length;h=2?Zn(l[0]-l[1])*2*c:c,o&&(r.ticks||r.niceTicks)){var h=(r.ticks||r.niceTicks).map(function(f){var d=a?a.indexOf(f):f;return{coordinate:i(d)+c,value:f,offset:c}});return h.filter(function(f){return!Ep(f.coordinate)})}return r.isCategorical&&r.categoricalDomain?r.categoricalDomain.map(function(f,d){return{coordinate:i(f)+c,value:f,index:d,offset:c}}):i.ticks&&!n?i.ticks(r.tickCount).map(function(f){return{coordinate:i(f)+c,value:f,offset:c}}):i.domain().map(function(f,d){return{coordinate:i(f)+c,value:a?a[f]:f,index:d,offset:c}})},f1=new WeakMap,Sm=function(r,o){if(typeof o!="function")return r;f1.has(r)||f1.set(r,new WeakMap);var n=f1.get(r);if(n.has(o))return n.get(o);var i=function(){r.apply(void 0,arguments),o.apply(void 0,arguments)};return n.set(o,i),i},qD=function(r,o,n){var i=r.scale,a=r.type,s=r.layout,l=r.axisType;if(i==="auto")return s==="radial"&&l==="radiusAxis"?{scale:Oh(),realScaleType:"band"}:s==="radial"&&l==="angleAxis"?{scale:vg(),realScaleType:"linear"}:a==="category"&&o&&(o.indexOf("LineChart")>=0||o.indexOf("AreaChart")>=0||o.indexOf("ComposedChart")>=0&&!n)?{scale:Lf(),realScaleType:"point"}:a==="category"?{scale:Oh(),realScaleType:"band"}:{scale:vg(),realScaleType:"linear"};if(Sp(i)){var u="scale".concat(n0(i));return{scale:(gC[u]||Lf)(),realScaleType:gC[u]?u:"point"}}return kt(i)?{scale:i}:{scale:Lf(),realScaleType:"point"}},EC=1e-4,XD=function(r){var o=r.domain();if(!(!o||o.length<=2)){var n=o.length,i=r.range(),a=Math.min(i[0],i[1])-EC,s=Math.max(i[0],i[1])+EC,l=r(o[0]),u=r(o[n-1]);(ls||us)&&r.domain([o[0],o[n-1]])}},Ppe=function(r,o){if(!r)return null;for(var n=0,i=r.length;ni)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]=0?(r[l][n][0]=a,r[l][n][1]=a+u,a=r[l][n][1]):(r[l][n][0]=s,r[l][n][1]=s+u,s=r[l][n][1])}},Mpe=function(r){var o=r.length;if(!(o<=0))for(var n=0,i=r[0].length;n=0?(r[s][n][0]=a,r[s][n][1]=a+l,a=r[s][n][1]):(r[s][n][0]=0,r[s][n][1]=0)}},Rpe={sign:Ape,expand:Qee,none:Cc,silhouette:Jee,wiggle:ete,positive:Mpe},Ipe=function(r,o,n){var i=o.map(function(l){return l.props.dataKey}),a=Rpe[n],s=Zee().keys(i).value(function(l,u){return+$n(l,u,0)}).order(Pw).offset(a);return s(r)},Npe=function(r,o,n,i,a,s){if(!r)return null;var l=s?o.reverse():o,u={},c=l.reduce(function(f,d){var m,y=(m=d.type)!==null&&m!==void 0&&m.defaultProps?zr(zr({},d.type.defaultProps),d.props):d.props,p=y.stackId,g=y.hide;if(g)return f;var b=y[n],x=f[b]||{hasStack:!1,stackGroups:{}};if(an(p)){var v=x.stackGroups[p]||{numericAxisId:n,cateAxisId:i,items:[]};v.items.push(d),x.hasStack=!0,x.stackGroups[p]=v}else x.stackGroups[Tp("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[d]};return zr(zr({},f),{},rc({},b,x))},u),h={};return Object.keys(c).reduce(function(f,d){var m=c[d];if(m.hasStack){var y={};m.stackGroups=Object.keys(m.stackGroups).reduce(function(p,g){var b=m.stackGroups[g];return zr(zr({},p),{},rc({},g,{numericAxisId:n,cateAxisId:i,items:b.items,stackedData:Ipe(r,b.items,a)}))},y)}return zr(zr({},f),{},rc({},d,m))},h)},YD=function(r,o){var n=o.realScaleType,i=o.type,a=o.tickCount,s=o.originalDomain,l=o.allowDecimals,u=n||o.scale;if(u!=="auto"&&u!=="linear")return null;if(a&&i==="number"&&s&&(s[0]==="auto"||s[1]==="auto")){var c=r.domain();if(!c.length)return null;var h=Yhe(c,a,l);return r.domain([b0(h),v0(h)]),{niceTicks:h}}if(a&&i==="number"){var f=r.domain(),d=Khe(f,a,l);return{niceTicks:d}}return null},TC=function(r){var o=r.axis,n=r.ticks,i=r.offset,a=r.bandSize,s=r.entry,l=r.index;if(o.type==="category")return n[l]?n[l].coordinate+i:null;var u=$n(s,o.dataKey,o.domain[l]);return Dt(u)?null:o.scale(u)-a/2+i},Lpe=function(r){var o=r.numericAxis,n=o.scale.domain();if(o.type==="number"){var i=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return i<=0&&a>=0?0:a<0?a:i}return n[0]},Dpe=function(r,o){var n,i=(n=r.type)!==null&&n!==void 0&&n.defaultProps?zr(zr({},r.type.defaultProps),r.props):r.props,a=i.stackId;if(an(a)){var s=o[a];if(s){var l=s.items.indexOf(r);return l>=0?s.stackedData[l]:null}}return null},Fpe=function(r){return r.reduce(function(o,n){return[b0(n.concat([o[0]]).filter(tt)),v0(n.concat([o[1]]).filter(tt))]},[1/0,-1/0])},KD=function(r,o,n){return Object.keys(r).reduce(function(i,a){var s=r[a],l=s.stackedData,u=l.reduce(function(c,h){var f=Fpe(h.slice(o,n+1));return[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]);return[Math.min(u[0],i[0]),Math.max(u[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},OC=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,kC=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,i_=function(r,o,n){if(kt(r))return r(o,n);if(!Array.isArray(r))return o;var i=[];if(tt(r[0]))i[0]=n?r[0]:Math.min(r[0],o[0]);else if(OC.test(r[0])){var a=+OC.exec(r[0])[1];i[0]=o[0]-a}else kt(r[0])?i[0]=r[0](o[0]):i[0]=o[0];if(tt(r[1]))i[1]=n?r[1]:Math.max(r[1],o[1]);else if(kC.test(r[1])){var s=+kC.exec(r[1])[1];i[1]=o[1]+s}else kt(r[1])?i[1]=r[1](o[1]):i[1]=o[1];return i},Eg=function(r,o,n){if(r&&r.scale&&r.scale.bandwidth){var i=r.scale.bandwidth();if(!n||i>0)return i}if(r&&o&&o.length>=2){for(var a=ZS(o,function(f){return f.coordinate}),s=1/0,l=1,u=a.length;lt.length)&&(r=t.length);for(var o=0,n=new Array(r);o2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(r-(n.left||0)-(n.right||0)),Math.abs(o-(n.top||0)-(n.bottom||0)))/2},qpe=function(r,o,n,i,a){var s=r.width,l=r.height,u=r.startAngle,c=r.endAngle,h=Qn(r.cx,s,s/2),f=Qn(r.cy,l,l/2),d=JD(s,l,n),m=Qn(r.innerRadius,d,0),y=Qn(r.outerRadius,d,d*.8),p=Object.keys(o);return p.reduce(function(g,b){var x=o[b],v=x.domain,w=x.reversed,_;if(Dt(x.range))i==="angleAxis"?_=[u,c]:i==="radiusAxis"&&(_=[m,y]),w&&(_=[_[1],_[0]]);else{_=x.range;var E=_,S=Bpe(E,2);u=S[0],c=S[1]}var T=qD(x,a),k=T.realScaleType,A=T.scale;A.domain(v).range(_),XD(A);var O=YD(A,da(da({},x),{},{realScaleType:k})),R=da(da(da({},x),O),{},{range:_,radius:y,realScaleType:k,scale:A,cx:h,cy:f,innerRadius:m,outerRadius:y,startAngle:u,endAngle:c});return da(da({},g),{},QD({},b,R))},{})},Xpe=function(r,o){var n=r.x,i=r.y,a=o.x,s=o.y;return Math.sqrt(Math.pow(n-a,2)+Math.pow(i-s,2))},Ype=function(r,o){var n=r.x,i=r.y,a=o.cx,s=o.cy,l=Xpe({x:n,y:i},{x:a,y:s});if(l<=0)return{radius:l};var u=(n-a)/l,c=Math.acos(u);return i>s&&(c=2*Math.PI-c),{radius:l,angle:Hpe(c),angleInRadian:c}},Kpe=function(r){var o=r.startAngle,n=r.endAngle,i=Math.floor(o/360),a=Math.floor(n/360),s=Math.min(i,a);return{startAngle:o-s*360,endAngle:n-s*360}},Zpe=function(r,o){var n=o.startAngle,i=o.endAngle,a=Math.floor(n/360),s=Math.floor(i/360),l=Math.min(a,s);return r+l*360},MC=function(r,o){var n=r.x,i=r.y,a=Ype({x:n,y:i},o),s=a.radius,l=a.angle,u=o.innerRadius,c=o.outerRadius;if(sc)return!1;if(s===0)return!0;var h=Kpe(o),f=h.startAngle,d=h.endAngle,m=l,y;if(f<=d){for(;m>d;)m-=360;for(;m=f&&m<=d}else{for(;m>f;)m-=360;for(;m=d&&m<=f}return y?da(da({},o),{},{radius:s,angle:Zpe(m,o)}):null},eF=function(r){return!q.isValidElement(r)&&!kt(r)&&typeof r!="boolean"?r.className:""};function Dh(t){"@babel/helpers - typeof";return Dh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Dh(t)}var Qpe=["offset"];function Jpe(t){return nme(t)||rme(t)||tme(t)||eme()}function eme(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tme(t,r){if(t){if(typeof t=="string")return a_(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);if(o==="Object"&&t.constructor&&(o=t.constructor.name),o==="Map"||o==="Set")return Array.from(t);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return a_(t,r)}}function rme(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function nme(t){if(Array.isArray(t))return a_(t)}function a_(t,r){(r==null||r>t.length)&&(r=t.length);for(var o=0,n=new Array(r);o=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function ime(t,r){if(t==null)return{};var o={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(r.indexOf(n)>=0)continue;o[n]=t[n]}return o}function RC(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),o.push.apply(o,n)}return o}function tn(t){for(var r=1;r=0?1:-1,v,w;i==="insideStart"?(v=m+x*s,w=p):i==="insideEnd"?(v=y-x*s,w=!p):i==="end"&&(v=y+x*s,w=p),w=b<=0?w:!w;var _=vr(c,h,g,v),E=vr(c,h,g,v+(w?1:-1)*359),S="M".concat(_.x,",").concat(_.y,` A`).concat(g,",").concat(g,",0,1,").concat(w?0:1,`, `).concat(E.x,",").concat(E.y),T=Dt(r.id)?Tp("recharts-radial-line-"):r.id;return me.createElement("text",Fh({},n,{dominantBaseline:"central",className:Nt("recharts-radial-bar-label",l)}),me.createElement("defs",null,me.createElement("path",{id:T,d:S})),me.createElement("textPath",{xlinkHref:"#".concat(T)},o))},fme=function(r){var o=r.viewBox,n=r.offset,i=r.position,a=o,s=a.cx,l=a.cy,u=a.innerRadius,c=a.outerRadius,h=a.startAngle,f=a.endAngle,d=(h+f)/2;if(i==="outside"){var m=vr(s,l,c+n,d),y=m.x,p=m.y;return{x:y,y:p,textAnchor:y>=s?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:s,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:s,y:l,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:s,y:l,textAnchor:"middle",verticalAnchor:"end"};var g=(u+c)/2,b=vr(s,l,g,d),x=b.x,v=b.y;return{x,y:v,textAnchor:"middle",verticalAnchor:"middle"}},hme=function(r){var o=r.viewBox,n=r.parentViewBox,i=r.offset,a=r.position,s=o,l=s.x,u=s.y,c=s.width,h=s.height,f=h>=0?1:-1,d=f*i,m=f>0?"end":"start",y=f>0?"start":"end",p=c>=0?1:-1,g=p*i,b=p>0?"end":"start",x=p>0?"start":"end";if(a==="top"){var v={x:l+c/2,y:u-f*i,textAnchor:"middle",verticalAnchor:m};return tn(tn({},v),n?{height:Math.max(u-n.y,0),width:c}:{})}if(a==="bottom"){var w={x:l+c/2,y:u+h+d,textAnchor:"middle",verticalAnchor:y};return tn(tn({},w),n?{height:Math.max(n.y+n.height-(u+h),0),width:c}:{})}if(a==="left"){var _={x:l-g,y:u+h/2,textAnchor:b,verticalAnchor:"middle"};return tn(tn({},_),n?{width:Math.max(_.x-n.x,0),height:h}:{})}if(a==="right"){var E={x:l+c+g,y:u+h/2,textAnchor:x,verticalAnchor:"middle"};return tn(tn({},E),n?{width:Math.max(n.x+n.width-E.x,0),height:h}:{})}var S=n?{width:c,height:h}:{};return a==="insideLeft"?tn({x:l+g,y:u+h/2,textAnchor:x,verticalAnchor:"middle"},S):a==="insideRight"?tn({x:l+c-g,y:u+h/2,textAnchor:b,verticalAnchor:"middle"},S):a==="insideTop"?tn({x:l+c/2,y:u+d,textAnchor:"middle",verticalAnchor:y},S):a==="insideBottom"?tn({x:l+c/2,y:u+h-d,textAnchor:"middle",verticalAnchor:m},S):a==="insideTopLeft"?tn({x:l+g,y:u+d,textAnchor:x,verticalAnchor:y},S):a==="insideTopRight"?tn({x:l+c-g,y:u+d,textAnchor:b,verticalAnchor:y},S):a==="insideBottomLeft"?tn({x:l+g,y:u+h-d,textAnchor:x,verticalAnchor:m},S):a==="insideBottomRight"?tn({x:l+c-g,y:u+h-d,textAnchor:b,verticalAnchor:m},S):fd(a)&&(tt(a.x)||yl(a.x))&&(tt(a.y)||yl(a.y))?tn({x:l+Qn(a.x,c),y:u+Qn(a.y,h),textAnchor:"end",verticalAnchor:"end"},S):tn({x:l+c/2,y:u+h/2,textAnchor:"middle",verticalAnchor:"middle"},S)},pme=function(r){return"cx"in r&&tt(r.cx)};function yn(t){var r=t.offset,o=r===void 0?5:r,n=ome(t,Qpe),i=tn({offset:o},n),a=i.viewBox,s=i.position,l=i.value,u=i.children,c=i.content,h=i.className,f=h===void 0?"":h,d=i.textBreakAll;if(!a||Dt(l)&&Dt(u)&&!q.isValidElement(c)&&!kt(c))return null;if(q.isValidElement(c))return q.cloneElement(c,i);var m;if(kt(c)){if(m=q.createElement(c,i),q.isValidElement(m))return m}else m=ume(i);var y=pme(a),p=jt(i,!0);if(y&&(s==="insideStart"||s==="insideEnd"||s==="end"))return dme(i,m,p);var g=y?fme(i):hme(i);return me.createElement(Hl,Fh({className:Nt("recharts-label",f)},p,g,{breakAll:d}),m)}yn.displayName="Label";var tF=function(r){var o=r.cx,n=r.cy,i=r.angle,a=r.startAngle,s=r.endAngle,l=r.r,u=r.radius,c=r.innerRadius,h=r.outerRadius,f=r.x,d=r.y,m=r.top,y=r.left,p=r.width,g=r.height,b=r.clockWise,x=r.labelViewBox;if(x)return x;if(tt(p)&&tt(g)){if(tt(f)&&tt(d))return{x:f,y:d,width:p,height:g};if(tt(m)&&tt(y))return{x:m,y,width:p,height:g}}return tt(f)&&tt(d)?{x:f,y:d,width:0,height:0}:tt(o)&&tt(n)?{cx:o,cy:n,startAngle:a||i||0,endAngle:s||i||0,innerRadius:c||0,outerRadius:h||u||l||0,clockWise:b}:r.viewBox?r.viewBox:{}},mme=function(r,o){return r?r===!0?me.createElement(yn,{key:"label-implicit",viewBox:o}):an(r)?me.createElement(yn,{key:"label-implicit",viewBox:o,value:r}):q.isValidElement(r)?r.type===yn?q.cloneElement(r,{key:"label-implicit",viewBox:o}):me.createElement(yn,{key:"label-implicit",content:r,viewBox:o}):kt(r)?me.createElement(yn,{key:"label-implicit",content:r,viewBox:o}):fd(r)?me.createElement(yn,Fh({viewBox:o},r,{key:"label-implicit"})):null:null},yme=function(r,o){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!r||!r.children&&n&&!r.label)return null;var i=r.children,a=tF(r),s=Ko(i,yn).map(function(u,c){return q.cloneElement(u,{viewBox:o||a,key:"label-".concat(c)})});if(!n)return s;var l=mme(r.label,o||a);return[l].concat(Jpe(s))};yn.parseViewBox=tF;yn.renderCallByParent=yme;function gme(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}var vme=gme;const bme=Kt(vme);function $h(t){"@babel/helpers - typeof";return $h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},$h(t)}var xme=["valueAccessor"],wme=["data","dataKey","clockWise","id","textBreakAll"];function _me(t){return Tme(t)||Eme(t)||Sme(t)||jme()}function jme(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sme(t,r){if(t){if(typeof t=="string")return s_(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);if(o==="Object"&&t.constructor&&(o=t.constructor.name),o==="Map"||o==="Set")return Array.from(t);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return s_(t,r)}}function Eme(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Tme(t){if(Array.isArray(t))return s_(t)}function s_(t,r){(r==null||r>t.length)&&(r=t.length);for(var o=0,n=new Array(r);o=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function Cme(t,r){if(t==null)return{};var o={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(r.indexOf(n)>=0)continue;o[n]=t[n]}return o}var Ame=function(r){return Array.isArray(r.value)?bme(r.value):r.value};function Rs(t){var r=t.valueAccessor,o=r===void 0?Ame:r,n=LC(t,xme),i=n.data,a=n.dataKey,s=n.clockWise,l=n.id,u=n.textBreakAll,c=LC(n,wme);return!i||!i.length?null:me.createElement(nr,{className:"recharts-label-list"},i.map(function(h,f){var d=Dt(a)?o(h,f):$n(h&&h.payload,a),m=Dt(l)?{}:{id:"".concat(l,"-").concat(f)};return me.createElement(yn,Og({},jt(h,!0),c,m,{parentViewBox:h.parentViewBox,value:d,textBreakAll:u,viewBox:yn.parseViewBox(Dt(s)?h:NC(NC({},h),{},{clockWise:s})),key:"label-".concat(f),index:f}))}))}Rs.displayName="LabelList";function Mme(t,r){return t?t===!0?me.createElement(Rs,{key:"labelList-implicit",data:r}):me.isValidElement(t)||kt(t)?me.createElement(Rs,{key:"labelList-implicit",data:r,content:t}):fd(t)?me.createElement(Rs,Og({data:r},t,{key:"labelList-implicit"})):null:null}function Rme(t,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&o&&!t.label)return null;var n=t.children,i=Ko(n,Rs).map(function(s,l){return q.cloneElement(s,{data:r,key:"labelList-".concat(l)})});if(!o)return i;var a=Mme(t.label,r);return[a].concat(_me(i))}Rs.renderCallByParent=Rme;function Uh(t){"@babel/helpers - typeof";return Uh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Uh(t)}function l_(){return l_=Object.assign?Object.assign.bind():function(t){for(var r=1;r180),",").concat(+(s>c),`, `).concat(f.x,",").concat(f.y,` `);if(i>0){var m=vr(o,n,i,s),y=vr(o,n,i,c);d+="L ".concat(y.x,",").concat(y.y,` A `).concat(i,",").concat(i,`,0, `).concat(+(Math.abs(u)>180),",").concat(+(s<=c),`, `).concat(m.x,",").concat(m.y," Z")}else d+="L ".concat(o,",").concat(n," Z");return d},Fme=function(r){var o=r.cx,n=r.cy,i=r.innerRadius,a=r.outerRadius,s=r.cornerRadius,l=r.forceCornerRadius,u=r.cornerIsExternal,c=r.startAngle,h=r.endAngle,f=Zn(h-c),d=Em({cx:o,cy:n,radius:a,angle:c,sign:f,cornerRadius:s,cornerIsExternal:u}),m=d.circleTangency,y=d.lineTangency,p=d.theta,g=Em({cx:o,cy:n,radius:a,angle:h,sign:-f,cornerRadius:s,cornerIsExternal:u}),b=g.circleTangency,x=g.lineTangency,v=g.theta,w=u?Math.abs(c-h):Math.abs(c-h)-p-v;if(w<0)return l?"M ".concat(y.x,",").concat(y.y,` a`).concat(s,",").concat(s,",0,0,1,").concat(s*2,`,0 a`).concat(s,",").concat(s,",0,0,1,").concat(-s*2,`,0 `):rF({cx:o,cy:n,innerRadius:i,outerRadius:a,startAngle:c,endAngle:h});var _="M ".concat(y.x,",").concat(y.y,` A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(m.x,",").concat(m.y,` A`).concat(a,",").concat(a,",0,").concat(+(w>180),",").concat(+(f<0),",").concat(b.x,",").concat(b.y,` A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(x.x,",").concat(x.y,` `);if(i>0){var E=Em({cx:o,cy:n,radius:i,angle:c,sign:f,isExternal:!0,cornerRadius:s,cornerIsExternal:u}),S=E.circleTangency,T=E.lineTangency,k=E.theta,A=Em({cx:o,cy:n,radius:i,angle:h,sign:-f,isExternal:!0,cornerRadius:s,cornerIsExternal:u}),O=A.circleTangency,R=A.lineTangency,C=A.theta,L=u?Math.abs(c-h):Math.abs(c-h)-k-C;if(L<0&&s===0)return"".concat(_,"L").concat(o,",").concat(n,"Z");_+="L".concat(R.x,",").concat(R.y,` A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(O.x,",").concat(O.y,` A`).concat(i,",").concat(i,",0,").concat(+(L>180),",").concat(+(f>0),",").concat(S.x,",").concat(S.y,` A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(T.x,",").concat(T.y,"Z")}else _+="L".concat(o,",").concat(n,"Z");return _},$me={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},nF=function(r){var o=FC(FC({},$me),r),n=o.cx,i=o.cy,a=o.innerRadius,s=o.outerRadius,l=o.cornerRadius,u=o.forceCornerRadius,c=o.cornerIsExternal,h=o.startAngle,f=o.endAngle,d=o.className;if(s0&&Math.abs(h-f)<360?g=Fme({cx:n,cy:i,innerRadius:a,outerRadius:s,cornerRadius:Math.min(p,y/2),forceCornerRadius:u,cornerIsExternal:c,startAngle:h,endAngle:f}):g=rF({cx:n,cy:i,innerRadius:a,outerRadius:s,startAngle:h,endAngle:f}),me.createElement("path",l_({},jt(o,!0),{className:m,d:g,role:"img"}))};function Bh(t){"@babel/helpers - typeof";return Bh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Bh(t)}function u_(){return u_=Object.assign?Object.assign.bind():function(t){for(var r=1;r0;)if(!o.equals(t[n],r[n],n,n,t,r,o))return!1;return!0}function eye(t,r){return _d(t.getTime(),r.getTime())}function HC(t,r,o){if(t.size!==r.size)return!1;for(var n={},i=t.entries(),a=0,s,l;(s=i.next())&&!s.done;){for(var u=r.entries(),c=!1,h=0;(l=u.next())&&!l.done;){var f=s.value,d=f[0],m=f[1],y=l.value,p=y[0],g=y[1];!c&&!n[h]&&(c=o.equals(d,p,a,h,t,r,o)&&o.equals(m,g,d,p,t,r,o))&&(n[h]=!0),h++}if(!c)return!1;a++}return!0}function tye(t,r,o){var n=WC(t),i=n.length;if(WC(r).length!==i)return!1;for(var a;i-- >0;)if(a=n[i],a===lF&&(t.$$typeof||r.$$typeof)&&t.$$typeof!==r.$$typeof||!sF(r,a)||!o.equals(t[a],r[a],a,a,t,r,o))return!1;return!0}function tf(t,r,o){var n=VC(t),i=n.length;if(VC(r).length!==i)return!1;for(var a,s,l;i-- >0;)if(a=n[i],a===lF&&(t.$$typeof||r.$$typeof)&&t.$$typeof!==r.$$typeof||!sF(r,a)||!o.equals(t[a],r[a],a,a,t,r,o)||(s=GC(t,a),l=GC(r,a),(s||l)&&(!s||!l||s.configurable!==l.configurable||s.enumerable!==l.enumerable||s.writable!==l.writable)))return!1;return!0}function rye(t,r){return _d(t.valueOf(),r.valueOf())}function nye(t,r){return t.source===r.source&&t.flags===r.flags}function qC(t,r,o){if(t.size!==r.size)return!1;for(var n={},i=t.values(),a,s;(a=i.next())&&!a.done;){for(var l=r.values(),u=!1,c=0;(s=l.next())&&!s.done;)!u&&!n[c]&&(u=o.equals(a.value,s.value,a.value,s.value,t,r,o))&&(n[c]=!0),c++;if(!u)return!1}return!0}function oye(t,r){var o=t.length;if(r.length!==o)return!1;for(;o-- >0;)if(t[o]!==r[o])return!1;return!0}var iye="[object Arguments]",aye="[object Boolean]",sye="[object Date]",lye="[object Map]",uye="[object Number]",cye="[object Object]",dye="[object RegExp]",fye="[object Set]",hye="[object String]",pye=Array.isArray,XC=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,YC=Object.assign,mye=Object.prototype.toString.call.bind(Object.prototype.toString);function yye(t){var r=t.areArraysEqual,o=t.areDatesEqual,n=t.areMapsEqual,i=t.areObjectsEqual,a=t.arePrimitiveWrappersEqual,s=t.areRegExpsEqual,l=t.areSetsEqual,u=t.areTypedArraysEqual;return function(h,f,d){if(h===f)return!0;if(h==null||f==null||typeof h!="object"||typeof f!="object")return h!==h&&f!==f;var m=h.constructor;if(m!==f.constructor)return!1;if(m===Object)return i(h,f,d);if(pye(h))return r(h,f,d);if(XC!=null&&XC(h))return u(h,f,d);if(m===Date)return o(h,f,d);if(m===RegExp)return s(h,f,d);if(m===Map)return n(h,f,d);if(m===Set)return l(h,f,d);var y=mye(h);return y===sye?o(h,f,d):y===dye?s(h,f,d):y===lye?n(h,f,d):y===fye?l(h,f,d):y===cye?typeof h.then!="function"&&typeof f.then!="function"&&i(h,f,d):y===iye?i(h,f,d):y===aye||y===uye||y===hye?a(h,f,d):!1}}function gye(t){var r=t.circular,o=t.createCustomConfig,n=t.strict,i={areArraysEqual:n?tf:Jme,areDatesEqual:eye,areMapsEqual:n?zC(HC,tf):HC,areObjectsEqual:n?tf:tye,arePrimitiveWrappersEqual:rye,areRegExpsEqual:nye,areSetsEqual:n?zC(qC,tf):qC,areTypedArraysEqual:n?tf:oye};if(o&&(i=YC({},i,o(i))),r){var a=Om(i.areArraysEqual),s=Om(i.areMapsEqual),l=Om(i.areObjectsEqual),u=Om(i.areSetsEqual);i=YC({},i,{areArraysEqual:a,areMapsEqual:s,areObjectsEqual:l,areSetsEqual:u})}return i}function vye(t){return function(r,o,n,i,a,s,l){return t(r,o,l)}}function bye(t){var r=t.circular,o=t.comparator,n=t.createState,i=t.equals,a=t.strict;if(n)return function(u,c){var h=n(),f=h.cache,d=f===void 0?r?new WeakMap:void 0:f,m=h.meta;return o(u,c,{cache:d,equals:i,meta:m,strict:a})};if(r)return function(u,c){return o(u,c,{cache:new WeakMap,equals:i,meta:void 0,strict:a})};var s={cache:void 0,equals:i,meta:void 0,strict:a};return function(u,c){return o(u,c,s)}}var xye=Zs();Zs({strict:!0});Zs({circular:!0});Zs({circular:!0,strict:!0});Zs({createInternalComparator:function(){return _d}});Zs({strict:!0,createInternalComparator:function(){return _d}});Zs({circular:!0,createInternalComparator:function(){return _d}});Zs({circular:!0,createInternalComparator:function(){return _d},strict:!0});function Zs(t){t===void 0&&(t={});var r=t.circular,o=r===void 0?!1:r,n=t.createInternalComparator,i=t.createState,a=t.strict,s=a===void 0?!1:a,l=gye(t),u=yye(l),c=n?n(u):vye(u);return bye({circular:o,comparator:u,createState:i,equals:c,strict:s})}function wye(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function KC(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=-1,n=function i(a){o<0&&(o=a),a-o>r?(t(a),o=-1):wye(i)};requestAnimationFrame(n)}function d_(t){"@babel/helpers - typeof";return d_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},d_(t)}function _ye(t){return Tye(t)||Eye(t)||Sye(t)||jye()}function jye(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sye(t,r){if(t){if(typeof t=="string")return ZC(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);if(o==="Object"&&t.constructor&&(o=t.constructor.name),o==="Map"||o==="Set")return Array.from(t);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return ZC(t,r)}}function ZC(t,r){(r==null||r>t.length)&&(r=t.length);for(var o=0,n=new Array(r);ot.length)&&(r=t.length);for(var o=0,n=new Array(r);o1?1:b<0?0:b},p=function(b){for(var x=b>1?1:b,v=x,w=0;w<8;++w){var _=f(v)-x,E=m(v);if(Math.abs(_-x)0&&arguments[0]!==void 0?arguments[0]:{},o=r.stiff,n=o===void 0?100:o,i=r.damping,a=i===void 0?8:i,s=r.dt,l=s===void 0?17:s,u=function(h,f,d){var m=-(h-f)*n,y=d*a,p=d+(m-y)*l/1e3,g=d*l/1e3+h;return Math.abs(g-f)t.length)&&(r=t.length);for(var o=0,n=new Array(r);o=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function nge(t,r){if(t==null)return{};var o={},n=Object.keys(t),i,a;for(a=0;a=0)&&(o[i]=t[i]);return o}function h1(t){return sge(t)||age(t)||ige(t)||oge()}function oge(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ige(t,r){if(t){if(typeof t=="string")return y_(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);if(o==="Object"&&t.constructor&&(o=t.constructor.name),o==="Map"||o==="Set")return Array.from(t);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return y_(t,r)}}function age(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function sge(t){if(Array.isArray(t))return y_(t)}function y_(t,r){(r==null||r>t.length)&&(r=t.length);for(var o=0,n=new Array(r);o"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 Cg(t){return Cg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(o){return o.__proto__||Object.getPrototypeOf(o)},Cg(t)}var La=function(t){fge(o,t);var r=hge(o);function o(n,i){var a;lge(this,o),a=r.call(this,n,i);var s=a.props,l=s.isActive,u=s.attributeName,c=s.from,h=s.to,f=s.steps,d=s.children,m=s.duration;if(a.handleStyleChange=a.handleStyleChange.bind(b_(a)),a.changeStyle=a.changeStyle.bind(b_(a)),!l||m<=0)return a.state={style:{}},typeof d=="function"&&(a.state={style:h}),v_(a);if(f&&f.length)a.state={style:f[0].style};else if(c){if(typeof d=="function")return a.state={style:c},v_(a);a.state={style:u?gf({},u,c):c}}else a.state={style:{}};return a}return cge(o,[{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,l=a.canBegin,u=a.attributeName,c=a.shouldReAnimate,h=a.to,f=a.from,d=this.state.style;if(l){if(!s){var m={style:u?gf({},u,h):h};this.state&&d&&(u&&d[u]!==h||!u&&d!==h)&&this.setState(m);return}if(!(xye(i.to,h)&&i.canBegin&&i.isActive)){var y=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var p=y||c?f:i.to;if(this.state&&d){var g={style:u?gf({},u,p):p};(u&&d[u]!==p||!u&&d!==p)&&this.setState(g)}this.runAnimation(ai(ai({},this.props),{},{from:p,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,l=i.to,u=i.duration,c=i.easing,h=i.begin,f=i.onAnimationEnd,d=i.onAnimationStart,m=ege(s,l,Vye(c),u,this.changeStyle),y=function(){a.stopJSAnimation=m()};this.manager.start([d,h,y,u,f])}},{key:"runStepAnimation",value:function(i){var a=this,s=i.steps,l=i.begin,u=i.onAnimationStart,c=s[0],h=c.style,f=c.duration,d=f===void 0?0:f,m=function(p,g,b){if(b===0)return p;var x=g.duration,v=g.easing,w=v===void 0?"ease":v,_=g.style,E=g.properties,S=g.onAnimationEnd,T=b>0?s[b-1]:g,k=E||Object.keys(_);if(typeof w=="function"||w==="spring")return[].concat(h1(p),[a.runJSAnimation.bind(a,{from:T.style,to:_,duration:x,easing:w}),x]);var A=eA(k,x,w),O=ai(ai(ai({},T.style),_),{},{transition:A});return[].concat(h1(p),[O,x,S]).filter(Aye)};return this.manager.start([u].concat(h1(s.reduce(m,[h,Math.max(d,l)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=Oye());var a=i.begin,s=i.duration,l=i.attributeName,u=i.to,c=i.easing,h=i.onAnimationStart,f=i.onAnimationEnd,d=i.steps,m=i.children,y=this.manager;if(this.unSubscribe=y.subscribe(this.handleStyleChange),typeof c=="function"||typeof m=="function"||c==="spring"){this.runJSAnimation(i);return}if(d.length>1){this.runStepAnimation(i);return}var p=l?gf({},l,u):u,g=eA(Object.keys(p),s,c);y.start([h,a,ai(ai({},p),{},{transition:g}),s,f])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var s=i.duration;i.attributeName,i.easing;var l=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var u=rge(i,tge),c=q.Children.count(a),h=this.state.style;if(typeof a=="function")return a(h);if(!l||c===0||s<=0)return a;var f=function(m){var y=m.props,p=y.style,g=p===void 0?{}:p,b=y.className,x=q.cloneElement(m,ai(ai({},u),{},{style:ai(ai({},g),h),className:b}));return x};return c===1?f(q.Children.only(a)):me.createElement("div",null,q.Children.map(a,function(d){return f(d)}))}}]),o}(q.PureComponent);La.displayName="Animate";La.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};La.propTypes={from:At.oneOfType([At.object,At.string]),to:At.oneOfType([At.object,At.string]),attributeName:At.string,duration:At.number,begin:At.number,easing:At.oneOfType([At.string,At.func]),steps:At.arrayOf(At.shape({duration:At.number.isRequired,style:At.object.isRequired,easing:At.oneOfType([At.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),At.func]),properties:At.arrayOf("string"),onAnimationEnd:At.func})),children:At.oneOfType([At.node,At.func]),isActive:At.bool,canBegin:At.bool,onAnimationEnd:At.func,shouldReAnimate:At.bool,onAnimationStart:At.func,onAnimationReStart:At.func};At.object,At.object,At.object,At.element;At.object,At.object,At.object,At.oneOfType([At.array,At.element]),At.any;function Gh(t){"@babel/helpers - typeof";return Gh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Gh(t)}function Ag(){return Ag=Object.assign?Object.assign.bind():function(t){for(var r=1;rt.length)&&(r=t.length);for(var o=0,n=new Array(r);o=0?1:-1,u=n>=0?1:-1,c=i>=0&&n>=0||i<0&&n<0?1:0,h;if(s>0&&a instanceof Array){for(var f=[0,0,0,0],d=0,m=4;ds?s:a[d];h="M".concat(r,",").concat(o+l*f[0]),f[0]>0&&(h+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(c,",").concat(r+u*f[0],",").concat(o)),h+="L ".concat(r+n-u*f[1],",").concat(o),f[1]>0&&(h+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(c,`, `).concat(r+n,",").concat(o+l*f[1])),h+="L ".concat(r+n,",").concat(o+i-l*f[2]),f[2]>0&&(h+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(c,`, `).concat(r+n-u*f[2],",").concat(o+i)),h+="L ".concat(r+u*f[3],",").concat(o+i),f[3]>0&&(h+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(c,`, `).concat(r,",").concat(o+i-l*f[3])),h+="Z"}else if(s>0&&a===+a&&a>0){var y=Math.min(s,a);h="M ".concat(r,",").concat(o+l*y,` A `).concat(y,",").concat(y,",0,0,").concat(c,",").concat(r+u*y,",").concat(o,` L `).concat(r+n-u*y,",").concat(o,` A `).concat(y,",").concat(y,",0,0,").concat(c,",").concat(r+n,",").concat(o+l*y,` L `).concat(r+n,",").concat(o+i-l*y,` A `).concat(y,",").concat(y,",0,0,").concat(c,",").concat(r+n-u*y,",").concat(o+i,` L `).concat(r+u*y,",").concat(o+i,` A `).concat(y,",").concat(y,",0,0,").concat(c,",").concat(r,",").concat(o+i-l*y," Z")}else h="M ".concat(r,",").concat(o," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return h},jge=function(r,o){if(!r||!o)return!1;var n=r.x,i=r.y,a=o.x,s=o.y,l=o.width,u=o.height;if(Math.abs(l)>0&&Math.abs(u)>0){var c=Math.min(a,a+l),h=Math.max(a,a+l),f=Math.min(s,s+u),d=Math.max(s,s+u);return n>=c&&n<=h&&i>=f&&i<=d}return!1},Sge={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},S2=function(r){var o=lA(lA({},Sge),r),n=q.useRef(),i=q.useState(-1),a=mge(i,2),s=a[0],l=a[1];q.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var w=n.current.getTotalLength();w&&l(w)}catch{}},[]);var u=o.x,c=o.y,h=o.width,f=o.height,d=o.radius,m=o.className,y=o.animationEasing,p=o.animationDuration,g=o.animationBegin,b=o.isAnimationActive,x=o.isUpdateAnimationActive;if(u!==+u||c!==+c||h!==+h||f!==+f||h===0||f===0)return null;var v=Nt("recharts-rectangle",m);return x?me.createElement(La,{canBegin:s>0,from:{width:h,height:f,x:u,y:c},to:{width:h,height:f,x:u,y:c},duration:p,animationEasing:y,isActive:x},function(w){var _=w.width,E=w.height,S=w.x,T=w.y;return me.createElement(La,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:p,isActive:b,easing:y},me.createElement("path",Ag({},jt(o,!0),{className:v,d:uA(S,T,_,E,d),ref:n})))}):me.createElement("path",Ag({},jt(o,!0),{className:v,d:uA(u,c,h,f,d)}))},Ege=["points","className","baseLinePoints","connectNulls"];function Nu(){return Nu=Object.assign?Object.assign.bind():function(t){for(var r=1;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function Oge(t,r){if(t==null)return{};var o={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(r.indexOf(n)>=0)continue;o[n]=t[n]}return o}function cA(t){return Age(t)||Cge(t)||Pge(t)||kge()}function kge(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pge(t,r){if(t){if(typeof t=="string")return x_(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);if(o==="Object"&&t.constructor&&(o=t.constructor.name),o==="Map"||o==="Set")return Array.from(t);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return x_(t,r)}}function Cge(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Age(t){if(Array.isArray(t))return x_(t)}function x_(t,r){(r==null||r>t.length)&&(r=t.length);for(var o=0,n=new Array(r);o0&&arguments[0]!==void 0?arguments[0]:[],o=[[]];return r.forEach(function(n){dA(n)?o[o.length-1].push(n):o[o.length-1].length>0&&o.push([])}),dA(r[0])&&o[o.length-1].push(r[0]),o[o.length-1].length<=0&&(o=o.slice(0,-1)),o},$f=function(r,o){var n=Mge(r);o&&(n=[n.reduce(function(a,s){return[].concat(cA(a),cA(s))},[])]);var i=n.map(function(a){return a.reduce(function(s,l,u){return"".concat(s).concat(u===0?"M":"L").concat(l.x,",").concat(l.y)},"")}).join("");return n.length===1?"".concat(i,"Z"):i},Rge=function(r,o,n){var i=$f(r,n);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat($f(o.reverse(),n).slice(1))},Ige=function(r){var o=r.points,n=r.className,i=r.baseLinePoints,a=r.connectNulls,s=Tge(r,Ege);if(!o||!o.length)return null;var l=Nt("recharts-polygon",n);if(i&&i.length){var u=s.stroke&&s.stroke!=="none",c=Rge(o,i,a);return me.createElement("g",{className:l},me.createElement("path",Nu({},jt(s,!0),{fill:c.slice(-1)==="Z"?s.fill:"none",stroke:"none",d:c})),u?me.createElement("path",Nu({},jt(s,!0),{fill:"none",d:$f(o,a)})):null,u?me.createElement("path",Nu({},jt(s,!0),{fill:"none",d:$f(i,a)})):null)}var h=$f(o,a);return me.createElement("path",Nu({},jt(s,!0),{fill:h.slice(-1)==="Z"?s.fill:"none",className:l,d:h}))};function w_(){return w_=Object.assign?Object.assign.bind():function(t){for(var r=1;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function Bge(t,r){if(t==null)return{};var o={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(r.indexOf(n)>=0)continue;o[n]=t[n]}return o}var zge=function(r,o,n,i,a,s){return"M".concat(r,",").concat(a,"v").concat(i,"M").concat(s,",").concat(o,"h").concat(n)},Vge=function(r){var o=r.x,n=o===void 0?0:o,i=r.y,a=i===void 0?0:i,s=r.top,l=s===void 0?0:s,u=r.left,c=u===void 0?0:u,h=r.width,f=h===void 0?0:h,d=r.height,m=d===void 0?0:d,y=r.className,p=Uge(r,Nge),g=Lge({x:n,y:a,top:l,left:c,width:f,height:m},p);return!tt(n)||!tt(a)||!tt(f)||!tt(m)||!tt(l)||!tt(c)?null:me.createElement("path",__({},jt(g,!0),{className:Nt("recharts-cross",y),d:zge(n,a,f,m,l,c)}))},Gge=g0,Wge=ED,Hge=ea;function qge(t,r){return t&&t.length?Gge(t,Hge(r),Wge):void 0}var Xge=qge;const Yge=Kt(Xge);var Kge=g0,Zge=ea,Qge=TD;function Jge(t,r){return t&&t.length?Kge(t,Zge(r),Qge):void 0}var eve=Jge;const tve=Kt(eve);var rve=["cx","cy","angle","ticks","axisLine"],nve=["ticks","tick","angle","tickFormatter","stroke"];function Uc(t){"@babel/helpers - typeof";return Uc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Uc(t)}function Uf(){return Uf=Object.assign?Object.assign.bind():function(t){for(var r=1;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function ove(t,r){if(t==null)return{};var o={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(r.indexOf(n)>=0)continue;o[n]=t[n]}return o}function ive(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function mA(t,r){for(var o=0;ovA?s=i==="outer"?"start":"end":a<-vA?s=i==="outer"?"end":"start":s="middle",s}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,a=n.cy,s=n.radius,l=n.axisLine,u=n.axisLineType,c=tl(tl({},jt(this.props,!1)),{},{fill:"none"},jt(l,!1));if(u==="circle")return me.createElement(E2,dl({className:"recharts-polar-angle-axis-line"},c,{cx:i,cy:a,r:s}));var h=this.props.ticks,f=h.map(function(d){return vr(i,a,s,d.coordinate)});return me.createElement(Ige,dl({className:"recharts-polar-angle-axis-line"},c,{points:f}))}},{key:"renderTicks",value:function(){var n=this,i=this.props,a=i.ticks,s=i.tick,l=i.tickLine,u=i.tickFormatter,c=i.stroke,h=jt(this.props,!1),f=jt(s,!1),d=tl(tl({},h),{},{fill:"none"},jt(l,!1)),m=a.map(function(y,p){var g=n.getTickLineCoord(y),b=n.getTickTextAnchor(y),x=tl(tl(tl({textAnchor:b},h),{},{stroke:"none",fill:c},f),{},{index:p,payload:y,x:g.x2,y:g.y2});return me.createElement(nr,dl({className:Nt("recharts-polar-angle-axis-tick",eF(s)),key:"tick-".concat(y.coordinate)},Wl(n.props,y,p)),l&&me.createElement("line",dl({className:"recharts-polar-angle-axis-tick-line"},d,g)),s&&r.renderTickItem(s,x,u?u(y.value,p):y.value))});return me.createElement(nr,{className:"recharts-polar-angle-axis-ticks"},m)}},{key:"render",value:function(){var n=this.props,i=n.ticks,a=n.radius,s=n.axisLine;return a<=0||!i||!i.length?null:me.createElement(nr,{className:Nt("recharts-polar-angle-axis",this.props.className)},s&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,i,a){var s;return me.isValidElement(n)?s=me.cloneElement(n,i):kt(n)?s=n(i):s=me.createElement(Hl,dl({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),s}}])}(q.PureComponent);T0(O0,"displayName","PolarAngleAxis");T0(O0,"axisType","angleAxis");T0(O0,"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 xve=w4,wve=xve(Object.getPrototypeOf,Object),_ve=wve,jve=Ua,Sve=_ve,Eve=Ba,Tve="[object Object]",Ove=Function.prototype,kve=Object.prototype,bF=Ove.toString,Pve=kve.hasOwnProperty,Cve=bF.call(Object);function Ave(t){if(!Eve(t)||jve(t)!=Tve)return!1;var r=Sve(t);if(r===null)return!0;var o=Pve.call(r,"constructor")&&r.constructor;return typeof o=="function"&&o instanceof o&&bF.call(o)==Cve}var Mve=Ave;const Rve=Kt(Mve);var Ive=Ua,Nve=Ba,Lve="[object Boolean]";function Dve(t){return t===!0||t===!1||Nve(t)&&Ive(t)==Lve}var Fve=Dve;const $ve=Kt(Fve);function Hh(t){"@babel/helpers - typeof";return Hh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Hh(t)}function Ig(){return Ig=Object.assign?Object.assign.bind():function(t){for(var r=1;rt.length)&&(r=t.length);for(var o=0,n=new Array(r);o0,from:{upperWidth:0,lowerWidth:0,height:d,x:u,y:c},to:{upperWidth:h,lowerWidth:f,height:d,x:u,y:c},duration:p,animationEasing:y,isActive:b},function(v){var w=v.upperWidth,_=v.lowerWidth,E=v.height,S=v.x,T=v.y;return me.createElement(La,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:p,easing:y},me.createElement("path",Ig({},jt(o,!0),{className:x,d:_A(S,T,w,_,E),ref:n})))}):me.createElement("g",null,me.createElement("path",Ig({},jt(o,!0),{className:x,d:_A(u,c,h,f,d)})))},Kve=["option","shapeType","propTransformer","activeClassName","isActive"];function qh(t){"@babel/helpers - typeof";return qh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},qh(t)}function Zve(t,r){if(t==null)return{};var o=Qve(t,r),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function Qve(t,r){if(t==null)return{};var o={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(r.indexOf(n)>=0)continue;o[n]=t[n]}return o}function jA(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),o.push.apply(o,n)}return o}function Ng(t){for(var r=1;r0?Ao(v,"paddingAngle",0):0;if(_){var S=os(_.endAngle-_.startAngle,v.endAngle-v.startAngle),T=mr(mr({},v),{},{startAngle:x+E,endAngle:x+S(p)+E});g.push(T),x=T.endAngle}else{var k=v.endAngle,A=v.startAngle,O=os(0,k-A),R=O(p),C=mr(mr({},v),{},{startAngle:x+E,endAngle:x+R+E});g.push(C),x=C.endAngle}}),me.createElement(nr,null,n.renderSectorsStatically(g))})}},{key:"attachKeyboardHandlers",value:function(n){var i=this;n.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 l=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[l].focus(),i.setState({sectorToFocus:l});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,i=n.sectors,a=n.isAnimationActive,s=this.state.prevSectors;return a&&i&&i.length&&(!s||!x0(s,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,i=this.props,a=i.hide,s=i.sectors,l=i.className,u=i.label,c=i.cx,h=i.cy,f=i.innerRadius,d=i.outerRadius,m=i.isAnimationActive,y=this.state.isAnimationFinished;if(a||!s||!s.length||!tt(c)||!tt(h)||!tt(f)||!tt(d))return null;var p=Nt("recharts-pie",l);return me.createElement(nr,{tabIndex:this.props.rootTabIndex,className:p,ref:function(b){n.pieRef=b}},this.renderSectors(),u&&this.renderLabels(s),yn.renderCallByParent(this.props,null,!1),(!m||y)&&Rs.renderCallByParent(this.props,s,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return i.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:n.sectors!==i.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,i){return n>i?"start":n=360?x:x-1)*u,w=g-x*m-v,_=i.reduce(function(T,k){var A=$n(k,b,0);return T+(tt(A)?A:0)},0),E;if(_>0){var S;E=i.map(function(T,k){var A=$n(T,b,0),O=$n(T,h,k),R=(tt(A)?A:0)/_,C;k?C=S.endAngle+Zn(p)*u*(A!==0?1:0):C=s;var L=C+Zn(p)*((A!==0?m:0)+R*w),F=(C+L)/2,z=(y.innerRadius+y.outerRadius)/2,W=[{name:O,value:A,payload:T,dataKey:b,type:d}],$=vr(y.cx,y.cy,z,F);return S=mr(mr(mr({percent:R,cornerRadius:a,name:O,tooltipPayload:W,midAngle:F,middleRadius:z,tooltipPosition:$},T),y),{},{value:$n(T,b),startAngle:C,endAngle:L,payload:T,paddingAngle:Zn(p)*u}),S})}return mr(mr({},y),{},{sectors:E,data:i})});var b0e=Math.ceil,x0e=Math.max;function w0e(t,r,o,n){for(var i=-1,a=x0e(b0e((r-t)/(o||1)),0),s=Array(a);a--;)s[n?a:++i]=t,t+=o;return s}var _0e=w0e,j0e=U4,OA=1/0,S0e=17976931348623157e292;function E0e(t){if(!t)return t===0?t:0;if(t=j0e(t),t===OA||t===-OA){var r=t<0?-1:1;return r*S0e}return t===t?t:0}var jF=E0e,T0e=_0e,O0e=u0,p1=jF;function k0e(t){return function(r,o,n){return n&&typeof n!="number"&&O0e(r,o,n)&&(o=n=void 0),r=p1(r),o===void 0?(o=r,r=0):o=p1(o),n=n===void 0?r0&&n.handleDrag(i.changedTouches[0])}),wo(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,a=i.endIndex,s=i.onDragEnd,l=i.startIndex;s==null||s({endIndex:a,startIndex:l})}),n.detachDragEndListener()}),wo(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),wo(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),wo(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),wo(n,"handleSlideDragStart",function(i){var a=MA(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return z0e(r,t),F0e(r,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,a=n.endX,s=this.state.scaleValues,l=this.props,u=l.gap,c=l.data,h=c.length-1,f=Math.min(i,a),d=Math.max(i,a),m=r.getIndexInRange(s,f),y=r.getIndexInRange(s,d);return{startIndex:m-m%u,endIndex:y===h?h:y-y%u}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,s=i.tickFormatter,l=i.dataKey,u=$n(a[n],l,n);return kt(s)?s(u,n):u}},{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(n){var i=this.state,a=i.slideMoveStartX,s=i.startX,l=i.endX,u=this.props,c=u.x,h=u.width,f=u.travellerWidth,d=u.startIndex,m=u.endIndex,y=u.onChange,p=n.pageX-a;p>0?p=Math.min(p,c+h-f-l,c+h-f-s):p<0&&(p=Math.max(p,c-s,c-l));var g=this.getIndex({startX:s+p,endX:l+p});(g.startIndex!==d||g.endIndex!==m)&&y&&y(g),this.setState({startX:s+p,endX:l+p,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=MA(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,a=i.brushMoveStartX,s=i.movingTravellerId,l=i.endX,u=i.startX,c=this.state[s],h=this.props,f=h.x,d=h.width,m=h.travellerWidth,y=h.onChange,p=h.gap,g=h.data,b={startX:this.state.startX,endX:this.state.endX},x=n.pageX-a;x>0?x=Math.min(x,f+d-m-c):x<0&&(x=Math.max(x,f-c)),b[s]=c+x;var v=this.getIndex(b),w=v.startIndex,_=v.endIndex,E=function(){var T=g.length-1;return s==="startX"&&(l>u?w%p===0:_%p===0)||lu?_%p===0:w%p===0)||l>u&&_===T};this.setState(wo(wo({},s,c+x),"brushMoveStartX",n.pageX),function(){y&&E()&&y(v)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,s=this.state,l=s.scaleValues,u=s.startX,c=s.endX,h=this.state[i],f=l.indexOf(h);if(f!==-1){var d=f+n;if(!(d===-1||d>=l.length)){var m=l[d];i==="startX"&&m>=c||i==="endX"&&m<=u||this.setState(wo({},i,m),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,a=n.y,s=n.width,l=n.height,u=n.fill,c=n.stroke;return me.createElement("rect",{stroke:c,fill:u,x:i,y:a,width:s,height:l})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,a=n.y,s=n.width,l=n.height,u=n.data,c=n.children,h=n.padding,f=q.Children.only(c);return f?me.cloneElement(f,{x:i,y:a,width:s,height:l,margin:h,compact:!0,data:u}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,s,l=this,u=this.props,c=u.y,h=u.travellerWidth,f=u.height,d=u.traveller,m=u.ariaLabel,y=u.data,p=u.startIndex,g=u.endIndex,b=Math.max(n,this.props.x),x=m1(m1({},jt(this.props,!1)),{},{x:b,y:c,width:h,height:f}),v=m||"Min value: ".concat((a=y[p])===null||a===void 0?void 0:a.name,", Max value: ").concat((s=y[g])===null||s===void 0?void 0:s.name);return me.createElement(nr,{tabIndex:0,role:"slider","aria-label":v,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(_){["ArrowLeft","ArrowRight"].includes(_.key)&&(_.preventDefault(),_.stopPropagation(),l.handleTravellerMoveKeyboard(_.key==="ArrowRight"?1:-1,i))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},r.renderTraveller(d,x))}},{key:"renderSlide",value:function(n,i){var a=this.props,s=a.y,l=a.height,u=a.stroke,c=a.travellerWidth,h=Math.min(n,i)+c,f=Math.max(Math.abs(i-n)-c,0);return me.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:u,fillOpacity:.2,x:h,y:s,width:f,height:l})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,s=n.y,l=n.height,u=n.travellerWidth,c=n.stroke,h=this.state,f=h.startX,d=h.endX,m=5,y={pointerEvents:"none",fill:c};return me.createElement(nr,{className:"recharts-brush-texts"},me.createElement(Hl,Fg({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,d)-m,y:s+l/2},y),this.getTextOfTick(i)),me.createElement(Hl,Fg({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,d)+u+m,y:s+l/2},y),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,s=n.children,l=n.x,u=n.y,c=n.width,h=n.height,f=n.alwaysShowText,d=this.state,m=d.startX,y=d.endX,p=d.isTextActive,g=d.isSlideMoving,b=d.isTravellerMoving,x=d.isTravellerFocused;if(!i||!i.length||!tt(l)||!tt(u)||!tt(c)||!tt(h)||c<=0||h<=0)return null;var v=Nt("recharts-brush",a),w=me.Children.count(s)===1,_=L0e("userSelect","none");return me.createElement(nr,{className:v,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:_},this.renderBackground(),w&&this.renderPanorama(),this.renderSlide(m,y),this.renderTravellerLayer(m,"startX"),this.renderTravellerLayer(y,"endX"),(p||g||b||x||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,s=n.width,l=n.height,u=n.stroke,c=Math.floor(a+l/2)-1;return me.createElement(me.Fragment,null,me.createElement("rect",{x:i,y:a,width:s,height:l,fill:u,stroke:"none"}),me.createElement("line",{x1:i+1,y1:c,x2:i+s-1,y2:c,fill:"none",stroke:"#fff"}),me.createElement("line",{x1:i+1,y1:c+2,x2:i+s-1,y2:c+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return me.isValidElement(n)?a=me.cloneElement(n,i):kt(n)?a=n(i):a=r.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(n,i){var a=n.data,s=n.width,l=n.x,u=n.travellerWidth,c=n.updateId,h=n.startIndex,f=n.endIndex;if(a!==i.prevData||c!==i.prevUpdateId)return m1({prevData:a,prevTravellerWidth:u,prevUpdateId:c,prevX:l,prevWidth:s},a&&a.length?G0e({data:a,width:s,x:l,travellerWidth:u,startIndex:h,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(s!==i.prevWidth||l!==i.prevX||u!==i.prevTravellerWidth)){i.scale.range([l,l+s-u]);var d=i.scale.domain().map(function(m){return i.scale(m)});return{prevData:a,prevTravellerWidth:u,prevUpdateId:c,prevX:l,prevWidth:s,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:d}}return null}},{key:"getIndexInRange",value:function(n,i){for(var a=n.length,s=0,l=a-1;l-s>1;){var u=Math.floor((s+l)/2);n[u]>i?l=u:s=u}return i>=n[l]?l:s}}])}(q.PureComponent);wo(Gc,"displayName","Brush");wo(Gc,"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 W0e=KS;function H0e(t,r){var o;return W0e(t,function(n,i,a){return o=r(n,i,a),!o}),!!o}var q0e=H0e,X0e=h4,Y0e=ea,K0e=q0e,Z0e=vo,Q0e=u0;function J0e(t,r,o){var n=Z0e(t)?X0e:K0e;return o&&Q0e(t,r,o)&&(r=void 0),n(t,Y0e(r))}var ebe=J0e;const tbe=Kt(ebe);var Hi=function(r,o){var n=r.alwaysShow,i=r.ifOverflow;return n&&(i="extendDomain"),i===o},RA=N4;function rbe(t,r,o){r=="__proto__"&&RA?RA(t,r,{configurable:!0,enumerable:!0,value:o,writable:!0}):t[r]=o}var nbe=rbe,obe=nbe,ibe=R4,abe=ea;function sbe(t,r){var o={};return r=abe(r),ibe(t,function(n,i,a){obe(o,i,r(n,i,a))}),o}var lbe=sbe;const ube=Kt(lbe);function cbe(t,r){for(var o=-1,n=t==null?0:t.length;++o=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function Obe(t,r){if(t==null)return{};var o={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(r.indexOf(n)>=0)continue;o[n]=t[n]}return o}function kbe(t,r){var o=t.x,n=t.y,i=Tbe(t,_be),a="".concat(o),s=parseInt(a,10),l="".concat(n),u=parseInt(l,10),c="".concat(r.height||i.height),h=parseInt(c,10),f="".concat(r.width||i.width),d=parseInt(f,10);return rf(rf(rf(rf(rf({},r),i),s?{x:s}:{}),u?{y:u}:{}),{},{height:h,width:d,name:r.name,radius:r.radius})}function NA(t){return me.createElement(xF,O_({shapeType:"rectangle",propTransformer:kbe,activeClassName:"recharts-active-bar"},t))}var Pbe=function(r){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof r=="number")return r;var a=typeof n=="number";return a?r(n,i):(a||Xl(),o)}},Cbe=["value","background"],kF;function Wc(t){"@babel/helpers - typeof";return Wc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Wc(t)}function Abe(t,r){if(t==null)return{};var o=Mbe(t,r),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function Mbe(t,r){if(t==null)return{};var o={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(r.indexOf(n)>=0)continue;o[n]=t[n]}return o}function Ug(){return Ug=Object.assign?Object.assign.bind():function(t){for(var r=1;r0&&Math.abs(F)0&&Math.abs(L)0&&(C=Math.min((B||0)-(L[H-1]||0),C))}),Number.isFinite(C)){var F=C/R,z=p.layout==="vertical"?n.height:n.width;if(p.padding==="gap"&&(S=F*z/2),p.padding==="no-gap"){var W=Qn(r.barCategoryGap,F*z),$=F*z/2;S=$-W-($-W)/z*W}}}i==="xAxis"?T=[n.left+(v.left||0)+(S||0),n.left+n.width-(v.right||0)-(S||0)]:i==="yAxis"?T=u==="horizontal"?[n.top+n.height-(v.bottom||0),n.top+(v.top||0)]:[n.top+(v.top||0)+(S||0),n.top+n.height-(v.bottom||0)-(S||0)]:T=p.range,_&&(T=[T[1],T[0]]);var G=qD(p,a,d),K=G.scale,Z=G.realScaleType;K.domain(b).range(T),XD(K);var U=YD(K,hi(hi({},p),{},{realScaleType:Z}));i==="xAxis"?(O=g==="top"&&!w||g==="bottom"&&w,k=n.left,A=f[E]-O*p.height):i==="yAxis"&&(O=g==="left"&&!w||g==="right"&&w,k=f[E]-O*p.width,A=n.top);var I=hi(hi(hi({},p),U),{},{realScaleType:Z,x:k,y:A,scale:K,width:i==="xAxis"?n.width:p.width,height:i==="yAxis"?n.height:p.height});return I.bandSize=Eg(I,U),!p.hide&&i==="xAxis"?f[E]+=(O?-1:1)*I.height:p.hide||(f[E]+=(O?-1:1)*I.width),hi(hi({},m),{},C0({},y,I))},{})},MF=function(r,o){var n=r.x,i=r.y,a=o.x,s=o.y;return{x:Math.min(n,a),y:Math.min(i,s),width:Math.abs(a-n),height:Math.abs(s-i)}},Gbe=function(r){var o=r.x1,n=r.y1,i=r.x2,a=r.y2;return MF({x:o,y:n},{x:i,y:a})},RF=function(){function t(r){Ube(this,t),this.scale=r}return Bbe(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(o){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,a=n.position;if(o!==void 0){if(a)switch(a){case"start":return this.scale(o);case"middle":{var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(o)+s}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(o)+l}default:return this.scale(o)}if(i){var u=this.bandwidth?this.bandwidth()/2:0;return this.scale(o)+u}return this.scale(o)}}},{key:"isInRange",value:function(o){var n=this.range(),i=n[0],a=n[n.length-1];return i<=a?o>=i&&o<=a:o>=a&&o<=i}}],[{key:"create",value:function(o){return new t(o)}}])}();C0(RF,"EPS",1e-4);var T2=function(r){var o=Object.keys(r).reduce(function(n,i){return hi(hi({},n),{},C0({},i,RF.create(r[i])))},{});return hi(hi({},o),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=a.bandAware,l=a.position;return ube(i,function(u,c){return o[c].apply(u,{bandAware:s,position:l})})},isInRange:function(i){return OF(i,function(a,s){return o[s].isInRange(a)})}})};function Wbe(t){return(t%180+180)%180}var Hbe=function(r){var o=r.width,n=r.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Wbe(i),s=a*Math.PI/180,l=Math.atan(n/o),u=s>l&&s-1?i[a?r[s]:s]:void 0}}var Zbe=Kbe,Qbe=jF;function Jbe(t){var r=Qbe(t),o=r%1;return r===r?o?r-o:r:0}var e1e=Jbe,t1e=O4,r1e=ea,n1e=e1e,o1e=Math.max;function i1e(t,r,o){var n=t==null?0:t.length;if(!n)return-1;var i=o==null?0:n1e(o);return i<0&&(i=o1e(n+i,0)),t1e(t,r1e(r),i)}var a1e=i1e,s1e=Zbe,l1e=a1e,u1e=s1e(l1e),c1e=u1e;const d1e=Kt(c1e);var f1e=vQ(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("")}),O2=q.createContext(void 0),k2=q.createContext(void 0),IF=q.createContext(void 0),NF=q.createContext({}),LF=q.createContext(void 0),DF=q.createContext(0),FF=q.createContext(0),UA=function(r){var o=r.state,n=o.xAxisMap,i=o.yAxisMap,a=o.offset,s=r.clipPathId,l=r.children,u=r.width,c=r.height,h=f1e(a);return me.createElement(O2.Provider,{value:n},me.createElement(k2.Provider,{value:i},me.createElement(NF.Provider,{value:a},me.createElement(IF.Provider,{value:h},me.createElement(LF.Provider,{value:s},me.createElement(DF.Provider,{value:c},me.createElement(FF.Provider,{value:u},l)))))))},h1e=function(){return q.useContext(LF)},$F=function(r){var o=q.useContext(O2);o==null&&Xl();var n=o[r];return n==null&&Xl(),n},p1e=function(){var r=q.useContext(O2);return cs(r)},m1e=function(){var r=q.useContext(k2),o=d1e(r,function(n){return OF(n.domain,Number.isFinite)});return o||cs(r)},UF=function(r){var o=q.useContext(k2);o==null&&Xl();var n=o[r];return n==null&&Xl(),n},y1e=function(){var r=q.useContext(IF);return r},g1e=function(){return q.useContext(NF)},P2=function(){return q.useContext(FF)},C2=function(){return q.useContext(DF)};function Hc(t){"@babel/helpers - typeof";return Hc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Hc(t)}function v1e(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function b1e(t,r){for(var o=0;ot.length)&&(r=t.length);for(var o=0,n=new Array(r);ot*i)return!1;var a=o();return t*(r-t*a/2-n)>=0&&t*(r+t*a/2-i)<=0}function exe(t,r){return qF(t,r+1)}function txe(t,r,o,n,i){for(var a=(n||[]).slice(),s=r.start,l=r.end,u=0,c=1,h=s,f=function(){var y=n==null?void 0:n[u];if(y===void 0)return{v:qF(n,c)};var p=u,g,b=function(){return g===void 0&&(g=o(y,p)),g},x=y.coordinate,v=u===0||Wg(t,x,b,h,l);v||(u=0,h=s,c+=1),v&&(h=x+t*(b()/2+i),u+=c)},d;c<=a.length;)if(d=f(),d)return d.v;return[]}function Qh(t){"@babel/helpers - typeof";return Qh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Qh(t)}function XA(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),o.push.apply(o,n)}return o}function Ln(t){for(var r=1;r0?m.coordinate-g*t:m.coordinate})}else a[d]=m=Ln(Ln({},m),{},{tickCoord:m.coordinate});var b=Wg(t,m.tickCoord,p,l,u);b&&(u=m.tickCoord-t*(p()/2+i),a[d]=Ln(Ln({},m),{},{isShow:!0}))},h=s-1;h>=0;h--)c(h);return a}function axe(t,r,o,n,i,a){var s=(n||[]).slice(),l=s.length,u=r.start,c=r.end;if(a){var h=n[l-1],f=o(h,l-1),d=t*(h.coordinate+t*f/2-c);s[l-1]=h=Ln(Ln({},h),{},{tickCoord:d>0?h.coordinate-d*t:h.coordinate});var m=Wg(t,h.tickCoord,function(){return f},u,c);m&&(c=h.tickCoord-t*(f/2+i),s[l-1]=Ln(Ln({},h),{},{isShow:!0}))}for(var y=a?l-1:l,p=function(x){var v=s[x],w,_=function(){return w===void 0&&(w=o(v,x)),w};if(x===0){var E=t*(v.coordinate-t*_()/2-u);s[x]=v=Ln(Ln({},v),{},{tickCoord:E<0?v.coordinate-E*t:v.coordinate})}else s[x]=v=Ln(Ln({},v),{},{tickCoord:v.coordinate});var S=Wg(t,v.tickCoord,_,u,c);S&&(u=v.tickCoord+t*(_()/2+i),s[x]=Ln(Ln({},v),{},{isShow:!0}))},g=0;g=2?Zn(i[1].coordinate-i[0].coordinate):1,b=J1e(a,g,m);return u==="equidistantPreserveStart"?txe(g,b,p,i,s):(u==="preserveStart"||u==="preserveStartEnd"?d=axe(g,b,p,i,s,u==="preserveStartEnd"):d=ixe(g,b,p,i,s),d.filter(function(x){return x.isShow}))}var sxe=["viewBox"],lxe=["viewBox"],uxe=["ticks"];function Yc(t){"@babel/helpers - typeof";return Yc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Yc(t)}function Du(){return Du=Object.assign?Object.assign.bind():function(t){for(var r=1;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function cxe(t,r){if(t==null)return{};var o={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(r.indexOf(n)>=0)continue;o[n]=t[n]}return o}function dxe(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function KA(t,r){for(var o=0;o0?u(this.props):u(m)),s<=0||l<=0||!y||!y.length?null:me.createElement(nr,{className:Nt("recharts-cartesian-axis",c),ref:function(g){n.layerReference=g}},a&&this.renderAxisLine(),this.renderTicks(y,this.state.fontSize,this.state.letterSpacing),yn.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var s;return me.isValidElement(n)?s=me.cloneElement(n,i):kt(n)?s=n(i):s=me.createElement(Hl,Du({},i,{className:"recharts-cartesian-axis-tick-value"}),a),s}}])}(q.Component);I2(jd,"displayName","CartesianAxis");I2(jd,"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 vxe=["x1","y1","x2","y2","key"],bxe=["offset"];function Yl(t){"@babel/helpers - typeof";return Yl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Yl(t)}function ZA(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),o.push.apply(o,n)}return o}function Fn(t){for(var r=1;r=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function jxe(t,r){if(t==null)return{};var o={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(r.indexOf(n)>=0)continue;o[n]=t[n]}return o}var Sxe=function(r){var o=r.fill;if(!o||o==="none")return null;var n=r.fillOpacity,i=r.x,a=r.y,s=r.width,l=r.height,u=r.ry;return me.createElement("rect",{x:i,y:a,ry:u,width:s,height:l,stroke:"none",fill:o,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function KF(t,r){var o;if(me.isValidElement(t))o=me.cloneElement(t,r);else if(kt(t))o=t(r);else{var n=r.x1,i=r.y1,a=r.x2,s=r.y2,l=r.key,u=QA(r,vxe),c=jt(u,!1);c.offset;var h=QA(c,bxe);o=me.createElement("line",bl({},h,{x1:n,y1:i,x2:a,y2:s,fill:"none",key:l}))}return o}function Exe(t){var r=t.x,o=t.width,n=t.horizontal,i=n===void 0?!0:n,a=t.horizontalPoints;if(!i||!a||!a.length)return null;var s=a.map(function(l,u){var c=Fn(Fn({},t),{},{x1:r,y1:l,x2:r+o,y2:l,key:"line-".concat(u),index:u});return KF(i,c)});return me.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function Txe(t){var r=t.y,o=t.height,n=t.vertical,i=n===void 0?!0:n,a=t.verticalPoints;if(!i||!a||!a.length)return null;var s=a.map(function(l,u){var c=Fn(Fn({},t),{},{x1:l,y1:r,x2:l,y2:r+o,key:"line-".concat(u),index:u});return KF(i,c)});return me.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function Oxe(t){var r=t.horizontalFill,o=t.fillOpacity,n=t.x,i=t.y,a=t.width,s=t.height,l=t.horizontalPoints,u=t.horizontal,c=u===void 0?!0:u;if(!c||!r||!r.length)return null;var h=l.map(function(d){return Math.round(d+i-i)}).sort(function(d,m){return d-m});i!==h[0]&&h.unshift(0);var f=h.map(function(d,m){var y=!h[m+1],p=y?i+s-d:h[m+1]-d;if(p<=0)return null;var g=m%r.length;return me.createElement("rect",{key:"react-".concat(m),y:d,x:n,height:p,width:a,stroke:"none",fill:r[g],fillOpacity:o,className:"recharts-cartesian-grid-bg"})});return me.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function kxe(t){var r=t.vertical,o=r===void 0?!0:r,n=t.verticalFill,i=t.fillOpacity,a=t.x,s=t.y,l=t.width,u=t.height,c=t.verticalPoints;if(!o||!n||!n.length)return null;var h=c.map(function(d){return Math.round(d+a-a)}).sort(function(d,m){return d-m});a!==h[0]&&h.unshift(0);var f=h.map(function(d,m){var y=!h[m+1],p=y?a+l-d:h[m+1]-d;if(p<=0)return null;var g=m%n.length;return me.createElement("rect",{key:"react-".concat(m),x:d,y:s,width:p,height:u,stroke:"none",fill:n[g],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return me.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var Pxe=function(r,o){var n=r.xAxis,i=r.width,a=r.height,s=r.offset;return HD(R2(Fn(Fn(Fn({},jd.defaultProps),n),{},{ticks:ba(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),s.left,s.left+s.width,o)},Cxe=function(r,o){var n=r.yAxis,i=r.width,a=r.height,s=r.offset;return HD(R2(Fn(Fn(Fn({},jd.defaultProps),n),{},{ticks:ba(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),s.top,s.top+s.height,o)},xu={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function ZF(t){var r,o,n,i,a,s,l=P2(),u=C2(),c=g1e(),h=Fn(Fn({},t),{},{stroke:(r=t.stroke)!==null&&r!==void 0?r:xu.stroke,fill:(o=t.fill)!==null&&o!==void 0?o:xu.fill,horizontal:(n=t.horizontal)!==null&&n!==void 0?n:xu.horizontal,horizontalFill:(i=t.horizontalFill)!==null&&i!==void 0?i:xu.horizontalFill,vertical:(a=t.vertical)!==null&&a!==void 0?a:xu.vertical,verticalFill:(s=t.verticalFill)!==null&&s!==void 0?s:xu.verticalFill,x:tt(t.x)?t.x:c.left,y:tt(t.y)?t.y:c.top,width:tt(t.width)?t.width:c.width,height:tt(t.height)?t.height:c.height}),f=h.x,d=h.y,m=h.width,y=h.height,p=h.syncWithTicks,g=h.horizontalValues,b=h.verticalValues,x=p1e(),v=m1e();if(!tt(m)||m<=0||!tt(y)||y<=0||!tt(f)||f!==+f||!tt(d)||d!==+d)return null;var w=h.verticalCoordinatesGenerator||Pxe,_=h.horizontalCoordinatesGenerator||Cxe,E=h.horizontalPoints,S=h.verticalPoints;if((!E||!E.length)&&kt(_)){var T=g&&g.length,k=_({yAxis:v?Fn(Fn({},v),{},{ticks:T?g:v.ticks}):void 0,width:l,height:u,offset:c},T?!0:p);_i(Array.isArray(k),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Yl(k),"]")),Array.isArray(k)&&(E=k)}if((!S||!S.length)&&kt(w)){var A=b&&b.length,O=w({xAxis:x?Fn(Fn({},x),{},{ticks:A?b:x.ticks}):void 0,width:l,height:u,offset:c},A?!0:p);_i(Array.isArray(O),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Yl(O),"]")),Array.isArray(O)&&(S=O)}return me.createElement("g",{className:"recharts-cartesian-grid"},me.createElement(Sxe,{fill:h.fill,fillOpacity:h.fillOpacity,x:h.x,y:h.y,width:h.width,height:h.height,ry:h.ry}),me.createElement(Exe,bl({},h,{offset:c,horizontalPoints:E,xAxis:x,yAxis:v})),me.createElement(Txe,bl({},h,{offset:c,verticalPoints:S,xAxis:x,yAxis:v})),me.createElement(Oxe,bl({},h,{horizontalPoints:E})),me.createElement(kxe,bl({},h,{verticalPoints:S})))}ZF.displayName="CartesianGrid";function Kc(t){"@babel/helpers - typeof";return Kc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Kc(t)}function Axe(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function Mxe(t,r){for(var o=0;ot.length)&&(r=t.length);for(var o=0,n=new Array(r);o=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function vwe(t,r){if(t==null)return{};var o={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(r.indexOf(n)>=0)continue;o[n]=t[n]}return o}function bwe(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function xwe(t,r){for(var o=0;ot.length)&&(r=t.length);for(var o=0,n=new Array(r);o0?s:r&&r.length&&tt(i)&&tt(a)?r.slice(i,a+1):[]};function d6(t){return t==="number"?[0,"auto"]:void 0}var G_=function(r,o,n,i){var a=r.graphicalItems,s=r.tooltipAxis,l=D0(o,r);return n<0||!a||!a.length||n>=l.length?null:a.reduce(function(u,c){var h,f=(h=c.props.data)!==null&&h!==void 0?h:o;f&&r.dataStartIndex+r.dataEndIndex!==0&&r.dataEndIndex-r.dataStartIndex>=n&&(f=f.slice(r.dataStartIndex,r.dataEndIndex+1));var d;if(s.dataKey&&!s.allowDuplicatedCategory){var m=f===void 0?l:f;d=vw(m,s.dataKey,i)}else d=f&&f[n]||l[n];return d?[].concat(Jc(u),[ZD(c,d)]):u},[])},oM=function(r,o,n,i){var a=i||{x:r.chartX,y:r.chartY},s=Mwe(a,n),l=r.orderedTooltipTicks,u=r.tooltipAxis,c=r.tooltipTicks,h=jpe(s,l,c,u);if(h>=0&&c){var f=c[h]&&c[h].value,d=G_(r,o,h,f),m=Rwe(n,l,h,a);return{activeTooltipIndex:h,activeLabel:f,activePayload:d,activeCoordinate:m}}return null},Iwe=function(r,o){var n=o.axes,i=o.graphicalItems,a=o.axisType,s=o.axisIdKey,l=o.stackGroups,u=o.dataStartIndex,c=o.dataEndIndex,h=r.layout,f=r.children,d=r.stackOffset,m=WD(h,a);return n.reduce(function(y,p){var g,b=p.type.defaultProps!==void 0?Ve(Ve({},p.type.defaultProps),p.props):p.props,x=b.type,v=b.dataKey,w=b.allowDataOverflow,_=b.allowDuplicatedCategory,E=b.scale,S=b.ticks,T=b.includeHidden,k=b[s];if(y[k])return y;var A=D0(r.data,{graphicalItems:i.filter(function(U){var I,B=s in U.props?U.props[s]:(I=U.type.defaultProps)===null||I===void 0?void 0:I[s];return B===k}),dataStartIndex:u,dataEndIndex:c}),O=A.length,R,C,L;awe(b.domain,w,x)&&(R=i_(b.domain,null,w),m&&(x==="number"||E!=="auto")&&(L=Df(A,v,"category")));var F=d6(x);if(!R||R.length===0){var z,W=(z=b.domain)!==null&&z!==void 0?z:F;if(v){if(R=Df(A,v,x),x==="category"&&m){var $=pJ(R);_&&$?(C=R,R=Dg(0,O)):_||(R=PC(W,R,p).reduce(function(U,I){return U.indexOf(I)>=0?U:[].concat(Jc(U),[I])},[]))}else if(x==="category")_?R=R.filter(function(U){return U!==""&&!Dt(U)}):R=PC(W,R,p).reduce(function(U,I){return U.indexOf(I)>=0||I===""||Dt(I)?U:[].concat(Jc(U),[I])},[]);else if(x==="number"){var G=kpe(A,i.filter(function(U){var I,B,H=s in U.props?U.props[s]:(I=U.type.defaultProps)===null||I===void 0?void 0:I[s],Y="hide"in U.props?U.props.hide:(B=U.type.defaultProps)===null||B===void 0?void 0:B.hide;return H===k&&(T||!Y)}),v,a,h);G&&(R=G)}m&&(x==="number"||E!=="auto")&&(L=Df(A,v,"category"))}else m?R=Dg(0,O):l&&l[k]&&l[k].hasStack&&x==="number"?R=d==="expand"?[0,1]:KD(l[k].stackGroups,u,c):R=GD(A,i.filter(function(U){var I=s in U.props?U.props[s]:U.type.defaultProps[s],B="hide"in U.props?U.props.hide:U.type.defaultProps.hide;return I===k&&(T||!B)}),x,h,!0);if(x==="number")R=B_(f,R,k,a,S),W&&(R=i_(W,R,w));else if(x==="category"&&W){var K=W,Z=R.every(function(U){return K.indexOf(U)>=0});Z&&(R=K)}}return Ve(Ve({},y),{},wt({},k,Ve(Ve({},b),{},{axisType:a,domain:R,categoricalDomain:L,duplicateDomain:C,originalDomain:(g=b.domain)!==null&&g!==void 0?g:F,isCategorical:m,layout:h})))},{})},Nwe=function(r,o){var n=o.graphicalItems,i=o.Axis,a=o.axisType,s=o.axisIdKey,l=o.stackGroups,u=o.dataStartIndex,c=o.dataEndIndex,h=r.layout,f=r.children,d=D0(r.data,{graphicalItems:n,dataStartIndex:u,dataEndIndex:c}),m=d.length,y=WD(h,a),p=-1;return n.reduce(function(g,b){var x=b.type.defaultProps!==void 0?Ve(Ve({},b.type.defaultProps),b.props):b.props,v=x[s],w=d6("number");if(!g[v]){p++;var _;return y?_=Dg(0,m):l&&l[v]&&l[v].hasStack?(_=KD(l[v].stackGroups,u,c),_=B_(f,_,v,a)):(_=i_(w,GD(d,n.filter(function(E){var S,T,k=s in E.props?E.props[s]:(S=E.type.defaultProps)===null||S===void 0?void 0:S[s],A="hide"in E.props?E.props.hide:(T=E.type.defaultProps)===null||T===void 0?void 0:T.hide;return k===v&&!A}),"number",h),i.defaultProps.allowDataOverflow),_=B_(f,_,v,a)),Ve(Ve({},g),{},wt({},v,Ve(Ve({axisType:a},i.defaultProps),{},{hide:!0,orientation:Ao(Cwe,"".concat(a,".").concat(p%2),null),domain:_,originalDomain:w,isCategorical:y,layout:h})))}return g},{})},Lwe=function(r,o){var n=o.axisType,i=n===void 0?"xAxis":n,a=o.AxisComp,s=o.graphicalItems,l=o.stackGroups,u=o.dataStartIndex,c=o.dataEndIndex,h=r.children,f="".concat(i,"Id"),d=Ko(h,a),m={};return d&&d.length?m=Iwe(r,{axes:d,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:l,dataStartIndex:u,dataEndIndex:c}):s&&s.length&&(m=Nwe(r,{Axis:a,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:l,dataStartIndex:u,dataEndIndex:c})),m},Dwe=function(r){var o=cs(r),n=ba(o,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:ZS(n,function(i){return i.coordinate}),tooltipAxis:o,tooltipAxisBandSize:Eg(o,n)}},iM=function(r){var o=r.children,n=r.defaultShowTooltip,i=Eo(o,Gc),a=0,s=0;return r.data&&r.data.length!==0&&(s=r.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:!!n}},Fwe=function(r){return!r||!r.length?!1:r.some(function(o){var n=_a(o&&o.type);return n&&n.indexOf("Bar")>=0})},aM=function(r){return r==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:r==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:r==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},$we=function(r,o){var n=r.props,i=r.graphicalItems,a=r.xAxisMap,s=a===void 0?{}:a,l=r.yAxisMap,u=l===void 0?{}:l,c=n.width,h=n.height,f=n.children,d=n.margin||{},m=Eo(f,Gc),y=Eo(f,ec),p=Object.keys(u).reduce(function(_,E){var S=u[E],T=S.orientation;return!S.mirror&&!S.hide?Ve(Ve({},_),{},wt({},T,_[T]+S.width)):_},{left:d.left||0,right:d.right||0}),g=Object.keys(s).reduce(function(_,E){var S=s[E],T=S.orientation;return!S.mirror&&!S.hide?Ve(Ve({},_),{},wt({},T,Ao(_,"".concat(T))+S.height)):_},{top:d.top||0,bottom:d.bottom||0}),b=Ve(Ve({},g),p),x=b.bottom;m&&(b.bottom+=m.props.height||Gc.defaultProps.height),y&&o&&(b=Tpe(b,i,n,o));var v=c-b.left-b.right,w=h-b.top-b.bottom;return Ve(Ve({brushBottom:x},b),{},{width:Math.max(v,0),height:Math.max(w,0)})},Uwe=function(r,o){if(o==="xAxis")return r[o].width;if(o==="yAxis")return r[o].height},f6=function(r){var o=r.chartName,n=r.GraphicalChild,i=r.defaultTooltipEventType,a=i===void 0?"axis":i,s=r.validateTooltipEventTypes,l=s===void 0?["axis"]:s,u=r.axisComponents,c=r.legendContent,h=r.formatAxisMap,f=r.defaultProps,d=function(g,b){var x=b.graphicalItems,v=b.stackGroups,w=b.offset,_=b.updateId,E=b.dataStartIndex,S=b.dataEndIndex,T=g.barSize,k=g.layout,A=g.barGap,O=g.barCategoryGap,R=g.maxBarSize,C=aM(k),L=C.numericAxisName,F=C.cateAxisName,z=Fwe(x),W=[];return x.forEach(function($,G){var K=D0(g.data,{graphicalItems:[$],dataStartIndex:E,dataEndIndex:S}),Z=$.type.defaultProps!==void 0?Ve(Ve({},$.type.defaultProps),$.props):$.props,U=Z.dataKey,I=Z.maxBarSize,B=Z["".concat(L,"Id")],H=Z["".concat(F,"Id")],Y={},ee=u.reduce(function(ye,Pe){var _e=b["".concat(Pe.axisType,"Map")],Ne=Z["".concat(Pe.axisType,"Id")];_e&&_e[Ne]||Pe.axisType==="zAxis"||Xl();var $e=_e[Ne];return Ve(Ve({},ye),{},wt(wt({},Pe.axisType,$e),"".concat(Pe.axisType,"Ticks"),ba($e)))},Y),oe=ee[F],ce=ee["".concat(F,"Ticks")],he=v&&v[B]&&v[B].hasStack&&Dpe($,v[B].stackGroups),ae=_a($.type).indexOf("Bar")>=0,te=Eg(oe,ce),pe=[],ne=z&&Spe({barSize:T,stackGroups:v,totalSize:Uwe(ee,F)});if(ae){var fe,be,Ee=Dt(I)?R:I,re=(fe=(be=Eg(oe,ce,!0))!==null&&be!==void 0?be:Ee)!==null&&fe!==void 0?fe:0;pe=Epe({barGap:A,barCategoryGap:O,bandSize:re!==te?re:te,sizeList:ne[H],maxBarSize:Ee}),re!==te&&(pe=pe.map(function(ye){return Ve(Ve({},ye),{},{position:Ve(Ve({},ye.position),{},{offset:ye.position.offset-re/2})})}))}var se=$&&$.type&&$.type.getComposedData;se&&W.push({props:Ve(Ve({},se(Ve(Ve({},ee),{},{displayedData:K,props:g,dataKey:U,item:$,bandSize:te,barPosition:pe,offset:w,stackedData:he,layout:k,dataStartIndex:E,dataEndIndex:S}))),{},wt(wt(wt({key:$.key||"item-".concat(G)},L,ee[L]),F,ee[F]),"animationId",_)),childIndex:EJ($,g.children),item:$})}),W},m=function(g,b){var x=g.props,v=g.dataStartIndex,w=g.dataEndIndex,_=g.updateId;if(!_k({props:x}))return null;var E=x.children,S=x.layout,T=x.stackOffset,k=x.data,A=x.reverseStackOrder,O=aM(S),R=O.numericAxisName,C=O.cateAxisName,L=Ko(E,n),F=Npe(k,L,"".concat(R,"Id"),"".concat(C,"Id"),T,A),z=u.reduce(function(Z,U){var I="".concat(U.axisType,"Map");return Ve(Ve({},Z),{},wt({},I,Lwe(x,Ve(Ve({},U),{},{graphicalItems:L,stackGroups:U.axisType===R&&F,dataStartIndex:v,dataEndIndex:w}))))},{}),W=$we(Ve(Ve({},z),{},{props:x,graphicalItems:L}),b==null?void 0:b.legendBBox);Object.keys(z).forEach(function(Z){z[Z]=h(x,z[Z],W,Z.replace("Map",""),o)});var $=z["".concat(C,"Map")],G=Dwe($),K=d(x,Ve(Ve({},z),{},{dataStartIndex:v,dataEndIndex:w,updateId:_,graphicalItems:L,stackGroups:F,offset:W}));return Ve(Ve({formattedGraphicalItems:K,graphicalItems:L,offset:W,stackGroups:F},G),z)},y=function(p){function g(b){var x,v,w;return bwe(this,g),w=_we(this,g,[b]),wt(w,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),wt(w,"accessibilityManager",new iwe),wt(w,"handleLegendBBoxUpdate",function(_){if(_){var E=w.state,S=E.dataStartIndex,T=E.dataEndIndex,k=E.updateId;w.setState(Ve({legendBBox:_},m({props:w.props,dataStartIndex:S,dataEndIndex:T,updateId:k},Ve(Ve({},w.state),{},{legendBBox:_}))))}}),wt(w,"handleReceiveSyncEvent",function(_,E,S){if(w.props.syncId===_){if(S===w.eventEmitterSymbol&&typeof w.props.syncMethod!="function")return;w.applySyncEvent(E)}}),wt(w,"handleBrushChange",function(_){var E=_.startIndex,S=_.endIndex;if(E!==w.state.dataStartIndex||S!==w.state.dataEndIndex){var T=w.state.updateId;w.setState(function(){return Ve({dataStartIndex:E,dataEndIndex:S},m({props:w.props,dataStartIndex:E,dataEndIndex:S,updateId:T},w.state))}),w.triggerSyncEvent({dataStartIndex:E,dataEndIndex:S})}}),wt(w,"handleMouseEnter",function(_){var E=w.getMouseInfo(_);if(E){var S=Ve(Ve({},E),{},{isTooltipActive:!0});w.setState(S),w.triggerSyncEvent(S);var T=w.props.onMouseEnter;kt(T)&&T(S,_)}}),wt(w,"triggeredAfterMouseMove",function(_){var E=w.getMouseInfo(_),S=E?Ve(Ve({},E),{},{isTooltipActive:!0}):{isTooltipActive:!1};w.setState(S),w.triggerSyncEvent(S);var T=w.props.onMouseMove;kt(T)&&T(S,_)}),wt(w,"handleItemMouseEnter",function(_){w.setState(function(){return{isTooltipActive:!0,activeItem:_,activePayload:_.tooltipPayload,activeCoordinate:_.tooltipPosition||{x:_.cx,y:_.cy}}})}),wt(w,"handleItemMouseLeave",function(){w.setState(function(){return{isTooltipActive:!1}})}),wt(w,"handleMouseMove",function(_){_.persist(),w.throttleTriggeredAfterMouseMove(_)}),wt(w,"handleMouseLeave",function(_){w.throttleTriggeredAfterMouseMove.cancel();var E={isTooltipActive:!1};w.setState(E),w.triggerSyncEvent(E);var S=w.props.onMouseLeave;kt(S)&&S(E,_)}),wt(w,"handleOuterEvent",function(_){var E=SJ(_),S=Ao(w.props,"".concat(E));if(E&&kt(S)){var T,k;/.*touch.*/i.test(E)?k=w.getMouseInfo(_.changedTouches[0]):k=w.getMouseInfo(_),S((T=k)!==null&&T!==void 0?T:{},_)}}),wt(w,"handleClick",function(_){var E=w.getMouseInfo(_);if(E){var S=Ve(Ve({},E),{},{isTooltipActive:!0});w.setState(S),w.triggerSyncEvent(S);var T=w.props.onClick;kt(T)&&T(S,_)}}),wt(w,"handleMouseDown",function(_){var E=w.props.onMouseDown;if(kt(E)){var S=w.getMouseInfo(_);E(S,_)}}),wt(w,"handleMouseUp",function(_){var E=w.props.onMouseUp;if(kt(E)){var S=w.getMouseInfo(_);E(S,_)}}),wt(w,"handleTouchMove",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&w.throttleTriggeredAfterMouseMove(_.changedTouches[0])}),wt(w,"handleTouchStart",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&w.handleMouseDown(_.changedTouches[0])}),wt(w,"handleTouchEnd",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&w.handleMouseUp(_.changedTouches[0])}),wt(w,"triggerSyncEvent",function(_){w.props.syncId!==void 0&&g1.emit(v1,w.props.syncId,_,w.eventEmitterSymbol)}),wt(w,"applySyncEvent",function(_){var E=w.props,S=E.layout,T=E.syncMethod,k=w.state.updateId,A=_.dataStartIndex,O=_.dataEndIndex;if(_.dataStartIndex!==void 0||_.dataEndIndex!==void 0)w.setState(Ve({dataStartIndex:A,dataEndIndex:O},m({props:w.props,dataStartIndex:A,dataEndIndex:O,updateId:k},w.state)));else if(_.activeTooltipIndex!==void 0){var R=_.chartX,C=_.chartY,L=_.activeTooltipIndex,F=w.state,z=F.offset,W=F.tooltipTicks;if(!z)return;if(typeof T=="function")L=T(W,_);else if(T==="value"){L=-1;for(var $=0;$=0){var he,ae;if(R.dataKey&&!R.allowDuplicatedCategory){var te=typeof R.dataKey=="function"?ce:"payload.".concat(R.dataKey.toString());he=vw($,te,L),ae=G&&K&&vw(K,te,L)}else he=$==null?void 0:$[C],ae=G&&K&&K[C];if(H||B){var pe=_.props.activeIndex!==void 0?_.props.activeIndex:C;return[q.cloneElement(_,Ve(Ve(Ve({},T.props),ee),{},{activeIndex:pe})),null,null]}if(!Dt(he))return[oe].concat(Jc(w.renderActivePoints({item:T,activePoint:he,basePoint:ae,childIndex:C,isRange:G})))}else{var ne,fe=(ne=w.getItemByXY(w.state.activeCoordinate))!==null&&ne!==void 0?ne:{graphicalItem:oe},be=fe.graphicalItem,Ee=be.item,re=Ee===void 0?_:Ee,se=be.childIndex,ye=Ve(Ve(Ve({},T.props),ee),{},{activeIndex:se});return[q.cloneElement(re,ye),null,null]}return G?[oe,null,null]:[oe,null]}),wt(w,"renderCustomized",function(_,E,S){return q.cloneElement(_,Ve(Ve({key:"recharts-customized-".concat(S)},w.props),w.state))}),wt(w,"renderMap",{CartesianGrid:{handler:Pm,once:!0},ReferenceArea:{handler:w.renderReferenceElement},ReferenceLine:{handler:Pm},ReferenceDot:{handler:w.renderReferenceElement},XAxis:{handler:Pm},YAxis:{handler:Pm},Brush:{handler:w.renderBrush,once:!0},Bar:{handler:w.renderGraphicChild},Line:{handler:w.renderGraphicChild},Area:{handler:w.renderGraphicChild},Radar:{handler:w.renderGraphicChild},RadialBar:{handler:w.renderGraphicChild},Scatter:{handler:w.renderGraphicChild},Pie:{handler:w.renderGraphicChild},Funnel:{handler:w.renderGraphicChild},Tooltip:{handler:w.renderCursor,once:!0},PolarGrid:{handler:w.renderPolarGrid,once:!0},PolarAngleAxis:{handler:w.renderPolarAxis},PolarRadiusAxis:{handler:w.renderPolarAxis},Customized:{handler:w.renderCustomized}}),w.clipPathId="".concat((x=b.id)!==null&&x!==void 0?x:Tp("recharts"),"-clip"),w.throttleTriggeredAfterMouseMove=B4(w.triggeredAfterMouseMove,(v=b.throttleDelay)!==null&&v!==void 0?v:1e3/60),w.state={},w}return Ewe(g,p),wwe(g,[{key:"componentDidMount",value:function(){var x,v;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(x=this.props.margin.left)!==null&&x!==void 0?x:0,top:(v=this.props.margin.top)!==null&&v!==void 0?v:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var x=this.props,v=x.children,w=x.data,_=x.height,E=x.layout,S=Eo(v,fi);if(S){var T=S.props.defaultIndex;if(!(typeof T!="number"||T<0||T>this.state.tooltipTicks.length-1)){var k=this.state.tooltipTicks[T]&&this.state.tooltipTicks[T].value,A=G_(this.state,w,T,k),O=this.state.tooltipTicks[T].coordinate,R=(this.state.offset.top+_)/2,C=E==="horizontal",L=C?{x:O,y:R}:{y:O,x:R},F=this.state.formattedGraphicalItems.find(function(W){var $=W.item;return $.type.name==="Scatter"});F&&(L=Ve(Ve({},L),F.props.points[T].tooltipPosition),A=F.props.points[T].tooltipPayload);var z={activeTooltipIndex:T,isTooltipActive:!0,activeLabel:k,activePayload:A,activeCoordinate:L};this.setState(z),this.renderCursor(S),this.accessibilityManager.setIndex(T)}}}},{key:"getSnapshotBeforeUpdate",value:function(x,v){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==v.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==x.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==x.margin){var w,_;this.accessibilityManager.setDetails({offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(_=this.props.margin.top)!==null&&_!==void 0?_:0}})}return null}},{key:"componentDidUpdate",value:function(x){xw([Eo(x.children,fi)],[Eo(this.props.children,fi)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var x=Eo(this.props.children,fi);if(x&&typeof x.props.shared=="boolean"){var v=x.props.shared?"axis":"item";return l.indexOf(v)>=0?v:a}return a}},{key:"getMouseInfo",value:function(x){if(!this.container)return null;var v=this.container,w=v.getBoundingClientRect(),_=Zue(w),E={chartX:Math.round(x.pageX-_.left),chartY:Math.round(x.pageY-_.top)},S=w.width/v.offsetWidth||1,T=this.inRange(E.chartX,E.chartY,S);if(!T)return null;var k=this.state,A=k.xAxisMap,O=k.yAxisMap,R=this.getTooltipEventType();if(R!=="axis"&&A&&O){var C=cs(A).scale,L=cs(O).scale,F=C&&C.invert?C.invert(E.chartX):null,z=L&&L.invert?L.invert(E.chartY):null;return Ve(Ve({},E),{},{xValue:F,yValue:z})}var W=oM(this.state,this.props.data,this.props.layout,T);return W?Ve(Ve({},E),W):null}},{key:"inRange",value:function(x,v){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,_=this.props.layout,E=x/w,S=v/w;if(_==="horizontal"||_==="vertical"){var T=this.state.offset,k=E>=T.left&&E<=T.left+T.width&&S>=T.top&&S<=T.top+T.height;return k?{x:E,y:S}:null}var A=this.state,O=A.angleAxisMap,R=A.radiusAxisMap;if(O&&R){var C=cs(O);return MC({x:E,y:S},C)}return null}},{key:"parseEventsOfWrapper",value:function(){var x=this.props.children,v=this.getTooltipEventType(),w=Eo(x,fi),_={};w&&v==="axis"&&(w.props.trigger==="click"?_={onClick:this.handleClick}:_={onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd});var E=Qy(this.props,this.handleOuterEvent);return Ve(Ve({},E),_)}},{key:"addListener",value:function(){g1.on(v1,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){g1.removeListener(v1,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(x,v,w){for(var _=this.state.formattedGraphicalItems,E=0,S=_.length;E{var u;const[t,r]=q.useState(null),[o,n]=q.useState([]),[i,a]=q.useState([]),[s,l]=q.useState(!0);return q.useEffect(()=>{(async()=>{try{const{data:h}=await rr.from("statistics").select("*").order("created_at",{ascending:!1}).limit(1).single();h&&r(h);const{data:f,error:d}=await rr.from("courts").select(` country, reviews!left ( rating ) `);if(f&&!d){const y=f.reduce((g,b)=>(g[b.country]||(g[b.country]={count:0,ratings:[]}),g[b.country].count+=1,b.reviews&&g[b.country].ratings.push(...b.reviews.map(x=>x.rating).filter(Boolean)),g),{}),p=Object.entries(y).map(([g,b])=>({country:g,courts:b.count,avgRating:b.ratings.length>0?parseFloat((b.ratings.reduce((x,v)=>x+v,0)/b.ratings.length).toFixed(1)):0}));n(p)}const{data:m}=await rr.from("reviews").select("rating");if(m){const y=Array(5).fill(0);m.forEach(g=>{y[g.rating-1]++});const p=y.map((g,b)=>({name:`${b+1} stars`,value:g}));a(p)}}catch(h){console.error("Error fetching statistics:",h)}finally{l(!1)}})()},[]),s?D.jsx("div",{children:"Loading statistics..."}):D.jsxs("div",{className:"min-h-screen flex flex-col",children:[D.jsx("div",{className:"mb-12",children:D.jsx(Zi,{})}),D.jsxs("div",{className:"container mx-auto px-4 flex-grow",children:[D.jsx("h1",{className:"text-4xl font-bold mb-8",children:"Padel Statistics"}),D.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-8",children:[D.jsxs(Kn,{className:"p-6 glass-card",children:[D.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[D.jsx(Wj,{className:"w-6 h-6 text-brand-500"}),D.jsx("h3",{className:"text-xl font-semibold",children:"Total Courts Submitted"})]}),D.jsx("p",{className:"text-4xl font-bold text-brand-500",children:(t==null?void 0:t.total_courts)||0}),D.jsx("p",{className:"text-sm text-muted-foreground",children:"Worldwide"})]}),D.jsxs(Kn,{className:"p-6 glass-card",children:[D.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[D.jsx(RB,{className:"w-6 h-6 text-brand-500"}),D.jsx("h3",{className:"text-xl font-semibold",children:"Average Rating"})]}),D.jsx("p",{className:"text-4xl font-bold text-brand-500",children:((u=t==null?void 0:t.avg_rating)==null?void 0:u.toFixed(1))||"0.0"}),D.jsx("p",{className:"text-sm text-muted-foreground",children:"Last 30 days"})]}),D.jsxs(Kn,{className:"p-6 glass-card",children:[D.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[D.jsx(iN,{className:"w-6 h-6 text-brand-500"}),D.jsx("h3",{className:"text-xl font-semibold",children:"Monthly Growth"})]}),D.jsxs("p",{className:"text-4xl font-bold text-brand-500",children:["+",(t==null?void 0:t.monthly_growth_rate)||0,"%"]}),D.jsx("p",{className:"text-sm text-muted-foreground",children:"New submissions"})]})]}),D.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 mb-8",children:[D.jsxs(Kn,{className:"p-6 glass-card",children:[D.jsx("h3",{className:"text-xl font-semibold mb-6",children:"Courts by Country"}),D.jsx("div",{className:"h-[300px]",children:D.jsx(wP,{width:"100%",height:"100%",children:D.jsxs(Bwe,{data:o,children:[D.jsx(ZF,{strokeDasharray:"3 3"}),D.jsx(N0,{dataKey:"country"}),D.jsx(L0,{}),D.jsx(fi,{}),D.jsx(iu,{dataKey:"courts",fill:"#0c83e8"})]})})})]}),D.jsxs(Kn,{className:"p-6 glass-card",children:[D.jsx("h3",{className:"text-xl font-semibold mb-6",children:"Rating Distribution"}),D.jsx("div",{className:"h-[300px]",children:D.jsx(wP,{width:"100%",height:"100%",children:D.jsxs(zwe,{children:[D.jsx(Va,{data:i,cx:"50%",cy:"50%",labelLine:!1,outerRadius:100,fill:"#8884d8",dataKey:"value",children:i.map((c,h)=>D.jsx(c0,{fill:sM[h%sM.length]},`cell-${h}`))}),D.jsx(fi,{})]})})})]})]}),D.jsxs(Kn,{className:"p-6 glass-card mb-8",children:[D.jsx("h3",{className:"text-xl font-semibold mb-6",children:"Country Rankings"}),D.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:o.map((c,h)=>D.jsxs("div",{className:"flex items-center gap-4",children:[D.jsx("div",{className:"w-8 h-8 rounded-full bg-brand-500/10 flex items-center justify-center text-brand-500 font-bold",children:h+1}),D.jsxs("div",{children:[D.jsx("p",{className:"font-semibold",children:c.country}),D.jsxs("p",{className:"text-sm text-muted-foreground",children:[c.avgRating," avg rating"]})]})]},c.country))})]})]}),D.jsx(Qi,{})]})},Gwe=()=>{const[t,r]=q.useState(!0),[o,n]=q.useState(""),[i,a]=q.useState(""),[s,l]=q.useState(!1),u=$a(),[c]=rG(),{toast:h}=Fa(),f=c.get("redirectTo")||"/";q.useEffect(()=>{(async()=>{const{data:{session:p}}=await rr.auth.getSession();p&&u(f)})()},[u,f]);const d=async y=>{y.preventDefault(),l(!0);try{if(t){const{error:p}=await rr.auth.signInWithPassword({email:o,password:i});if(p)throw p;h({title:"Login successful!",description:"Welcome back to PadelHub"}),u(f)}else{const{error:p}=await rr.auth.signUp({email:o,password:i});if((p==null?void 0:p.message)==="User already registered")h({title:"Account exists",description:"This email is already registered. Please sign in instead.",variant:"destructive"}),r(!0);else{if(p)throw p;h({title:"Account created successfully!",description:"Welcome to PadelHub"}),u(f)}}}catch(p){h({title:"Error",description:p.message,variant:"destructive"})}finally{l(!1)}},m=async()=>{try{const{error:y}=await rr.auth.signInWithOAuth({provider:"google",options:{redirectTo:`${window.location.origin}/auth?redirectTo=${f}`}});if(y)throw y}catch(y){h({title:"Error",description:y.message,variant:"destructive"})}};return D.jsxs("div",{className:"min-h-screen bg-background",children:[D.jsxs("div",{className:"p-6",children:[D.jsx(Zi,{}),D.jsx("div",{className:"max-w-md mx-auto mt-12",children:D.jsxs(Kn,{className:"p-8 glass-card",children:[D.jsx("div",{className:"flex justify-center mb-6",children:D.jsx("div",{className:"w-12 h-12 bg-brand-100 rounded-full flex items-center justify-center",children:D.jsx(NB,{className:"w-6 h-6 text-brand-500"})})}),D.jsx("h1",{className:"text-2xl font-bold text-center mb-6",children:t?"Welcome Back":"Create Account"}),D.jsxs("form",{onSubmit:d,className:"space-y-4",children:[D.jsx("div",{children:D.jsx(so,{type:"email",placeholder:"Email",value:o,onChange:y=>n(y.target.value),required:!0})}),D.jsx("div",{children:D.jsx(so,{type:"password",placeholder:"Password",value:i,onChange:y=>a(y.target.value),required:!0})}),D.jsxs(tr,{type:"submit",className:"w-full bg-brand-500 hover:bg-brand-600",disabled:s,children:[D.jsx(CB,{className:"w-4 h-4 mr-2"}),t?"Sign In with Email":"Sign Up with Email"]})]}),D.jsxs("div",{className:"relative my-6",children:[D.jsx("div",{className:"absolute inset-0 flex items-center",children:D.jsx("span",{className:"w-full border-t"})}),D.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:D.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"Or continue with"})})]}),D.jsxs(tr,{type:"button",variant:"outline",className:"w-full",onClick:m,disabled:s,children:[D.jsxs("svg",{className:"mr-2 h-4 w-4",viewBox:"0 0 24 24",children:[D.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),D.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),D.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),D.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}),"Sign in with Google"]}),D.jsx("div",{className:"mt-4 text-center",children:D.jsx("button",{onClick:()=>r(!t),className:"text-sm text-muted-foreground hover:text-brand-500",children:t?"Don't have an account? Sign up":"Already have an account? Sign in"})})]})})]}),D.jsx(Qi,{})]})};var N2="Collapsible",[Wwe,h6]=nd(N2),[Hwe,L2]=Wwe(N2),p6=q.forwardRef((t,r)=>{const{__scopeCollapsible:o,open:n,defaultOpen:i,disabled:a,onOpenChange:s,...l}=t,[u=!1,c]=Fl({prop:n,defaultProp:i,onChange:s});return D.jsx(Hwe,{scope:o,disabled:a,contentId:fp(),open:u,onOpenToggle:q.useCallback(()=>c(h=>!h),[c]),children:D.jsx(Gt.div,{"data-state":F2(u),"data-disabled":a?"":void 0,...l,ref:r})})});p6.displayName=N2;var m6="CollapsibleTrigger",y6=q.forwardRef((t,r)=>{const{__scopeCollapsible:o,...n}=t,i=L2(m6,o);return D.jsx(Gt.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":F2(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...n,ref:r,onClick:It(t.onClick,i.onOpenToggle)})});y6.displayName=m6;var D2="CollapsibleContent",g6=q.forwardRef((t,r)=>{const{forceMount:o,...n}=t,i=L2(D2,t.__scopeCollapsible);return D.jsx(cp,{present:o||i.open,children:({present:a})=>D.jsx(qwe,{...n,ref:r,present:a})})});g6.displayName=D2;var qwe=q.forwardRef((t,r)=>{const{__scopeCollapsible:o,present:n,children:i,...a}=t,s=L2(D2,o),[l,u]=q.useState(n),c=q.useRef(null),h=Or(r,c),f=q.useRef(0),d=f.current,m=q.useRef(0),y=m.current,p=s.open||l,g=q.useRef(p),b=q.useRef();return q.useEffect(()=>{const x=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(x)},[]),On(()=>{const x=c.current;if(x){b.current=b.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const v=x.getBoundingClientRect();f.current=v.height,m.current=v.width,g.current||(x.style.transitionDuration=b.current.transitionDuration,x.style.animationName=b.current.animationName),u(n)}},[s.open,n]),D.jsx(Gt.div,{"data-state":F2(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!p,...a,ref:h,style:{"--radix-collapsible-content-height":d?`${d}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...t.style},children:p&&i})});function F2(t){return t?"open":"closed"}var Xwe=p6,Ywe=y6,Kwe=g6,Ga="Accordion",Zwe=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[$2,Qwe,Jwe]=Uj(Ga),[F0,U_e]=nd(Ga,[Jwe,h6]),U2=h6(),v6=me.forwardRef((t,r)=>{const{type:o,...n}=t,i=n,a=n;return D.jsx($2.Provider,{scope:t.__scopeAccordion,children:o==="multiple"?D.jsx(n_e,{...a,ref:r}):D.jsx(r_e,{...i,ref:r})})});v6.displayName=Ga;var[b6,e_e]=F0(Ga),[x6,t_e]=F0(Ga,{collapsible:!1}),r_e=me.forwardRef((t,r)=>{const{value:o,defaultValue:n,onValueChange:i=()=>{},collapsible:a=!1,...s}=t,[l,u]=Fl({prop:o,defaultProp:n,onChange:i});return D.jsx(b6,{scope:t.__scopeAccordion,value:l?[l]:[],onItemOpen:u,onItemClose:me.useCallback(()=>a&&u(""),[a,u]),children:D.jsx(x6,{scope:t.__scopeAccordion,collapsible:a,children:D.jsx(w6,{...s,ref:r})})})}),n_e=me.forwardRef((t,r)=>{const{value:o,defaultValue:n,onValueChange:i=()=>{},...a}=t,[s=[],l]=Fl({prop:o,defaultProp:n,onChange:i}),u=me.useCallback(h=>l((f=[])=>[...f,h]),[l]),c=me.useCallback(h=>l((f=[])=>f.filter(d=>d!==h)),[l]);return D.jsx(b6,{scope:t.__scopeAccordion,value:s,onItemOpen:u,onItemClose:c,children:D.jsx(x6,{scope:t.__scopeAccordion,collapsible:!0,children:D.jsx(w6,{...a,ref:r})})})}),[o_e,$0]=F0(Ga),w6=me.forwardRef((t,r)=>{const{__scopeAccordion:o,disabled:n,dir:i,orientation:a="vertical",...s}=t,l=me.useRef(null),u=Or(l,r),c=Qwe(o),f=KL(i)==="ltr",d=It(t.onKeyDown,m=>{var T;if(!Zwe.includes(m.key))return;const y=m.target,p=c().filter(k=>{var A;return!((A=k.ref.current)!=null&&A.disabled)}),g=p.findIndex(k=>k.ref.current===y),b=p.length;if(g===-1)return;m.preventDefault();let x=g;const v=0,w=b-1,_=()=>{x=g+1,x>w&&(x=v)},E=()=>{x=g-1,x{const{__scopeAccordion:o,value:n,...i}=t,a=$0(Kg,o),s=e_e(Kg,o),l=U2(o),u=fp(),c=n&&s.value.includes(n)||!1,h=a.disabled||t.disabled;return D.jsx(i_e,{scope:o,open:c,disabled:h,triggerId:u,children:D.jsx(Xwe,{"data-orientation":a.orientation,"data-state":k6(c),...l,...i,ref:r,disabled:h,open:c,onOpenChange:f=>{f?s.onItemOpen(n):s.onItemClose(n)}})})});_6.displayName=Kg;var j6="AccordionHeader",S6=me.forwardRef((t,r)=>{const{__scopeAccordion:o,...n}=t,i=$0(Ga,o),a=B2(j6,o);return D.jsx(Gt.h3,{"data-orientation":i.orientation,"data-state":k6(a.open),"data-disabled":a.disabled?"":void 0,...n,ref:r})});S6.displayName=j6;var W_="AccordionTrigger",E6=me.forwardRef((t,r)=>{const{__scopeAccordion:o,...n}=t,i=$0(Ga,o),a=B2(W_,o),s=t_e(W_,o),l=U2(o);return D.jsx($2.ItemSlot,{scope:o,children:D.jsx(Ywe,{"aria-disabled":a.open&&!s.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...l,...n,ref:r})})});E6.displayName=W_;var T6="AccordionContent",O6=me.forwardRef((t,r)=>{const{__scopeAccordion:o,...n}=t,i=$0(Ga,o),a=B2(T6,o),s=U2(o);return D.jsx(Kwe,{role:"region","aria-labelledby":a.triggerId,"data-orientation":i.orientation,...s,...n,ref:r,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}})});O6.displayName=T6;function k6(t){return t?"open":"closed"}var a_e=v6,s_e=_6,l_e=S6,P6=E6,C6=O6;const A6=a_e,Fu=q.forwardRef(({className:t,...r},o)=>D.jsx(s_e,{ref:o,className:St("border-b",t),...r}));Fu.displayName="AccordionItem";const $u=q.forwardRef(({className:t,children:r,...o},n)=>D.jsx(l_e,{className:"flex",children:D.jsxs(P6,{ref:n,className:St("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",t),...o,children:[r,D.jsx(gv,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));$u.displayName=P6.displayName;const Uu=q.forwardRef(({className:t,children:r,...o},n)=>D.jsx(C6,{ref:n,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...o,children:D.jsx("div",{className:St("pb-4 pt-0",t),children:r})}));Uu.displayName=C6.displayName;const u_e=()=>{UL();const t=[{name:"Spain",description:"Discover premium padel courts in the birthplace of padel",gradient:"bg-gradient-to-r from-[#ee9ca7] to-[#ffdde1]",path:"/padel-courts-spain"},{name:"Sweden",description:"Explore Nordic padel facilities and indoor courts",gradient:"bg-gradient-to-r from-[#accbee] to-[#e7f0fd]",path:"/padel-courts-sweden"},{name:"Italy",description:"Find Mediterranean padel venues with stunning views",gradient:"bg-gradient-to-r from-[#d299c2] to-[#fef9d7]",path:"/padel-courts-italy"},{name:"Germany",description:"Experience state-of-the-art padel facilities",gradient:"bg-gradient-to-r from-[#243949] to-[#517fa4]",path:"/padel-courts-germany"}],r=[{question:"How many padel courts are available across Europe?",answer:"There are over 300 registered padel courts across our European network, with the highest concentration in Spain, followed by Sweden, Germany, and Italy."},{question:"What's the average rating of padel courts?",answer:"The average rating across all courts is 4.2 out of 5 stars, with many premium facilities maintaining ratings above 4.5 stars."},{question:"Can I book courts directly through Padellocator?",answer:"Yes, most courts in our database offer direct booking through our platform. Some venues may require you to contact them directly."},{question:"What makes a padel court premium rated?",answer:"Premium rated courts typically feature professional-grade surfaces, excellent lighting, weather protection, clean facilities, and additional amenities like equipment rental and coaching services."}];return D.jsxs("div",{className:"min-h-screen",children:[D.jsxs("div",{className:"p-6",children:[D.jsx(Zi,{}),D.jsxs("div",{className:"max-w-6xl mx-auto space-y-16",children:[D.jsxs("header",{className:"text-center space-y-4",children:[D.jsx("h1",{className:"text-4xl font-bold tracking-tight",children:"Explore Padel Courts by Country"}),D.jsx("p",{className:"text-muted-foreground max-w-2xl mx-auto",children:"Discover premium padel courts across the World. Find your perfect venue in our curated collection of facilities."})]}),D.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:t.map(o=>D.jsx(kr,{to:o.path,className:`${o.gradient} rounded-lg p-8 transition-transform hover:scale-[1.02] group`,children:D.jsxs("div",{className:"flex flex-col h-full justify-between",children:[D.jsxs("div",{className:"space-y-2",children:[D.jsx("h2",{className:"text-2xl font-bold text-white",children:o.name}),D.jsx("p",{className:"text-white/90",children:o.description})]}),D.jsxs("div",{className:"mt-4 flex items-center text-white group-hover:gap-2 transition-all",children:[D.jsx("span",{children:"View all courts"}),D.jsx(xy,{className:"w-5 h-5"})]})]})},o.name))}),D.jsxs("div",{className:"bg-gradient-to-r from-brand-500/20 to-brand-700/20 rounded-lg p-8 text-center space-y-6",children:[D.jsx("div",{className:"inline-block p-3 bg-brand-500/10 rounded-full",children:D.jsx(jB,{className:"w-8 h-8 text-brand-500"})}),D.jsx("h2",{className:"text-3xl font-bold",children:"Dive Into Padel Statistics"}),D.jsx("p",{className:"text-muted-foreground max-w-2xl mx-auto mb-8",children:"Explore comprehensive data about padel courts across Europe. From popularity trends to facility ratings, get insights that matter."}),D.jsx(kr,{to:"/statistics",children:D.jsxs("button",{className:"bg-brand-500 text-white px-6 py-3 rounded-lg font-medium hover:bg-brand-600 transition-colors inline-flex items-center gap-2",children:["View Statistics",D.jsx(xy,{className:"w-4 h-4"})]})})]}),D.jsxs("div",{className:"space-y-6",children:[D.jsx("h2",{className:"text-3xl font-bold text-center",children:"Frequently Asked Questions"}),D.jsx(A6,{type:"single",collapsible:!0,className:"w-full max-w-3xl mx-auto",children:r.map((o,n)=>D.jsxs(Fu,{value:`item-${n}`,children:[D.jsx($u,{children:o.question}),D.jsx(Uu,{children:o.answer})]},n))})]})]})]}),D.jsx(Qi,{})]})},c_e={ES:["Madrid","Barcelona","Valencia","Malaga","Seville"],SE:["Stockholm","Gothenburg","Malmö","Uppsala","Helsingborg"],DE:["Berlin","Hamburg","Munich","Frankfurt","Cologne"],IT:["Milan","Rome","Turin","Naples","Florence"]},U0=({country:t})=>{var s;const[r,o]=q.useState("all"),{toast:n}=Fa(),{data:i,isLoading:a}=Ty({queryKey:["courts",t.code,r],queryFn:async()=>{let l=rr.from("courts").select("*").eq("country",t.code);r!=="all"&&(l=l.ilike("location",`%${r}%`));const{data:u,error:c}=await l;return c?(n({title:"Error fetching courts",description:c.message,variant:"destructive"}),[]):u||[]}});return D.jsxs("div",{className:"min-h-screen",children:[D.jsxs("div",{className:"p-6",children:[D.jsx(Zi,{}),D.jsxs("div",{className:"max-w-6xl mx-auto space-y-8",children:[D.jsxs("header",{className:"text-center space-y-4",children:[D.jsxs("h1",{className:"text-4xl font-bold tracking-tight",children:["Padel Courts in ",t.name]}),D.jsxs("p",{className:"text-muted-foreground max-w-2xl mx-auto",children:["Discover the best padel courts across ",t.name,". Premium facilities and player reviews all in one place."]})]}),D.jsxs("div",{className:"flex flex-col md:flex-row justify-center gap-4 mb-6",children:[D.jsx("div",{className:"w-full md:w-96",children:D.jsx(BL,{})}),D.jsx("div",{className:"w-full md:w-64",children:D.jsxs(My,{value:r,onValueChange:o,children:[D.jsx(mh,{children:D.jsx(Ry,{placeholder:"Select your city"})}),D.jsxs(yh,{children:[D.jsx(yi,{value:"all",children:"All Cities"}),(s=c_e[t.code])==null?void 0:s.map(l=>D.jsx(yi,{value:l,children:l},l))]})]})})]}),a?D.jsx("div",{className:"text-center py-12",children:D.jsx("p",{className:"text-muted-foreground",children:"Loading courts..."})}):i&&i.length>0?D.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:i.map(l=>{var u;return D.jsx(Yx,{id:l.id,name:l.name,location:l.location,imageUrl:(u=l.images)==null?void 0:u[0],images:l.images,isPremium:l.is_premium,country:l.country,courtType:l.court_type},l.id)})}):D.jsx("div",{className:"text-center py-12",children:D.jsxs("p",{className:"text-muted-foreground",children:["No courts found in ",r==="all"?t.name:r,"."]})}),D.jsxs("div",{className:"bg-gradient-to-r from-brand-500/20 to-brand-700/20 rounded-lg p-8 text-center space-y-4",children:[D.jsx("h2",{className:"text-2xl font-bold",children:"Discover Top Padel Courts Worldwide"}),D.jsx("p",{className:"text-muted-foreground max-w-2xl mx-auto",children:"Looking for the highest-rated padel courts? Check out our curated list of top-rated facilities across all countries."}),D.jsx(tr,{asChild:!0,className:"bg-brand-500 hover:bg-brand-600",children:D.jsx(kr,{to:"/top-courts",children:"View Top Courts"})})]}),D.jsxs("div",{className:"py-8",children:[D.jsx("h2",{className:"text-2xl font-bold text-center mb-6",children:"Frequently Asked Questions"}),D.jsx("div",{className:"max-w-3xl mx-auto",children:D.jsxs(A6,{type:"single",collapsible:!0,children:[D.jsxs(Fu,{value:"item-1",children:[D.jsxs($u,{children:["How can I book a court in ",t.name,"?"]}),D.jsx(Uu,{children:'You can book a court by selecting your preferred facility and clicking on the "View Details" button. Each facility has its own booking system and contact information.'})]}),D.jsxs(Fu,{value:"item-2",children:[D.jsx($u,{children:"What equipment do I need to play padel?"}),D.jsxs(Uu,{children:["To play padel, you'll need a padel racket and balls. Most courts in ",t.name," offer equipment rental services. Comfortable sports clothing and non-marking shoes are also recommended."]})]}),D.jsxs(Fu,{value:"item-3",children:[D.jsxs($u,{children:["Are there any beginner-friendly courts in ",t.name,"?"]}),D.jsxs(Uu,{children:["Yes! Many courts in ",t.name," offer beginner lessons and have facilities suitable for all skill levels. Look for courts with coaching services in their details."]})]}),D.jsxs(Fu,{value:"item-4",children:[D.jsxs($u,{children:["What's the average cost of playing padel in ",t.name,"?"]}),D.jsx(Uu,{children:"Court prices vary by location and time of day. Most facilities offer both peak and off-peak rates, with average sessions ranging from 60-90 minutes. Contact individual courts for specific pricing."})]})]})})]})]})]}),D.jsx(Qi,{})]})},d_e=()=>D.jsx(U0,{country:{code:"SE",name:"Sweden"}}),f_e=()=>D.jsx(U0,{country:{code:"ES",name:"Spain"}}),h_e=()=>D.jsx(U0,{country:{code:"IT",name:"Italy"}}),p_e=()=>D.jsx(U0,{country:{code:"DE",name:"Germany"}}),m_e=()=>{const{location:t,name:r}=yp(),{toast:o}=Fa(),n=$a(),[i,a]=q.useState(null),[s,l]=q.useState(!0);return q.useEffect(()=>{(async()=>{try{const{data:c,error:h}=await rr.from("courts").select("*").eq("country","DE").eq("location",decodeURIComponent(t||"")).eq("name",decodeURIComponent(r||"")).maybeSingle();if(h)throw h;if(!c){o({title:"Court not found",description:"The requested court could not be found.",variant:"destructive"}),n("/padel-courts-germany");return}a(c)}catch(c){console.error("Error fetching court:",c),o({title:"Error",description:"Failed to load court details.",variant:"destructive"})}finally{l(!1)}})()},[t,r,n,o]),s?D.jsx("div",{className:"flex items-center justify-center min-h-screen",children:"Loading..."}):i?D.jsx(xp,{courtData:i}):null},y_e=()=>{const{location:t,name:r}=yp(),{toast:o}=Fa(),n=$a(),[i,a]=q.useState(null),[s,l]=q.useState(!0);return q.useEffect(()=>{(async()=>{try{if(!t||!r)throw new Error("Missing location or name parameters");const c=decodeURIComponent(t).toLowerCase(),h=decodeURIComponent(r),{data:f,error:d}=await rr.from("courts").select("*").eq("country","IT").ilike("location",c).eq("name",h).maybeSingle();if(d)throw d;if(!f){o({title:"Court not found",description:"The requested court could not be found.",variant:"destructive"}),n("/padel-courts-italy");return}a(f)}catch(c){console.error("Error fetching court:",c),o({title:"Error",description:"Failed to load court details.",variant:"destructive"})}finally{l(!1)}})()},[t,r,n,o]),s?D.jsx("div",{className:"flex items-center justify-center min-h-screen",children:"Loading..."}):i?D.jsx(xp,{courtData:i}):null},g_e=()=>{const{location:t,name:r}=yp(),{toast:o}=Fa(),n=$a(),[i,a]=q.useState(null),[s,l]=q.useState(!0);return q.useEffect(()=>{(async()=>{try{if(!t||!r)throw new Error("Missing location or name parameters");const c=decodeURIComponent(t).toLowerCase(),h=decodeURIComponent(r),{data:f,error:d}=await rr.from("courts").select("*").eq("country","ES").ilike("location",c).eq("name",h).maybeSingle();if(d)throw d;if(!f){o({title:"Court not found",description:"The requested court could not be found.",variant:"destructive"}),n("/padel-courts-spain");return}a(f)}catch(c){console.error("Error fetching court:",c),o({title:"Error",description:"Failed to load court details.",variant:"destructive"})}finally{l(!1)}})()},[t,r,n,o]),s?D.jsx("div",{className:"flex items-center justify-center min-h-screen",children:"Loading..."}):i?D.jsx(xp,{courtData:i}):null},v_e=()=>{const{location:t,name:r}=yp(),{toast:o}=Fa(),n=$a(),[i,a]=q.useState(null),[s,l]=q.useState(!0);return q.useEffect(()=>{(async()=>{try{const{data:c,error:h}=await rr.from("courts").select("*").eq("country","SE").eq("location",decodeURIComponent(t||"")).eq("name",decodeURIComponent(r||"")).maybeSingle();if(h)throw h;if(!c){o({title:"Court not found",description:"The requested court could not be found.",variant:"destructive"}),n("/padel-courts-sweden");return}a(c)}catch(c){console.error("Error fetching court:",c),o({title:"Error",description:"Failed to load court details.",variant:"destructive"})}finally{l(!1)}})()},[t,r,n,o]),s?D.jsx("div",{className:"flex items-center justify-center min-h-screen",children:"Loading..."}):i?D.jsx(xp,{courtData:i}):null},b_e=()=>{const{pathname:t}=Ws();q.useEffect(()=>{window.scrollTo(0,0)},[t])},x_e=new F9,w_e=({children:t})=>(b_e(),D.jsx(D.Fragment,{children:t})),__e=()=>D.jsx(V9,{client:x_e,children:D.jsxs(w9,{children:[D.jsx(bz,{}),D.jsx(Xz,{}),D.jsx(QV,{children:D.jsx(w_e,{children:D.jsx(fH,{children:D.jsxs(GV,{children:[D.jsx(fn,{path:"/",element:D.jsx(aq,{})}),D.jsx(fn,{path:"/courts/:id",element:D.jsx(xp,{})}),D.jsx(fn,{path:"/top-courts",element:D.jsx(MX,{})}),D.jsx(fn,{path:"/about",element:D.jsx(RX,{})}),D.jsx(fn,{path:"/submit-court",element:D.jsx(NY,{})}),D.jsx(fn,{path:"/statistics",element:D.jsx(Vwe,{})}),D.jsx(fn,{path:"/auth",element:D.jsx(Gwe,{})}),D.jsx(fn,{path:"/padel-courts-worldwide",element:D.jsx(u_e,{})}),D.jsx(fn,{path:"/padel-courts-sweden",element:D.jsx(d_e,{})}),D.jsx(fn,{path:"/padel-courts-spain",element:D.jsx(f_e,{})}),D.jsx(fn,{path:"/padel-courts-italy",element:D.jsx(h_e,{})}),D.jsx(fn,{path:"/padel-courts-germany",element:D.jsx(p_e,{})}),D.jsx(fn,{path:"/padel-courts-germany/:location/:name",element:D.jsx(m_e,{})}),D.jsx(fn,{path:"/padel-courts-italy/:location/:name",element:D.jsx(y_e,{})}),D.jsx(fn,{path:"/padel-courts-spain/:location/:name",element:D.jsx(g_e,{})}),D.jsx(fn,{path:"/padel-courts-sweden/:location/:name",element:D.jsx(v_e,{})}),D.jsx(fn,{path:"*",element:D.jsx(IX,{})})]})})})})]})});AI(document.getElementById("root")).render(D.jsx(__e,{}));export{Kt as g};